qsoft-x6-materials-six
Version:
qsoft-x6-materials
160 lines (158 loc) • 4.35 kB
JavaScript
"use strict";
exports.__esModule = true;
exports["default"] = void 0;
var Compo = function Compo() {
return {
processId: '',
condition: '',
priority: '',
memo: '',
width: 180,
// 保持宽度
height: 120,
// 保持高度
shape: 'react-shape',
ports: {
groups: {
top: {
position: 'top',
attrs: {
circle: {
r: 8,
magnet: true,
stroke: '#5584FF',
strokeWidth: 1,
fill: '#fff'
}
}
},
bottom: {
position: 'bottom',
attrs: {
circle: {
r: 8,
magnet: true,
stroke: '#5584FF',
strokeWidth: 1,
fill: '#fff'
}
}
}
},
items: [{
id: 'top',
group: 'top'
}, {
id: 'bottom',
group: 'bottom'
}]
},
component: function component(node) {
var name = node.prop('name') || '条件1';
var condition = node.prop('condition');
var priority = node.prop('priority'); // 使用空格占位符确保布局稳定
// 限制 name 长度为 10 个字符,超出部分显示省略号
var truncatedName = name.length > 10 ? name.slice(0, 10) + '...' : name;
return /*#__PURE__*/React.createElement("div", {
style: {
width: '100%',
height: '100%',
border: '2px solid #5584FF',
borderRadius: '8px',
// 圆角
background: '#fff',
fontFamily: 'Arial, sans-serif',
display: 'flex',
flexDirection: 'column'
}
}, /*#__PURE__*/React.createElement("div", {
style: {
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
padding: '6px 10px'
}
}, /*#__PURE__*/React.createElement("div", {
style: {
display: 'flex',
alignItems: 'center'
}
}, /*#__PURE__*/React.createElement("span", {
style: {
fontSize: '14px',
color: '#5584FF',
fontWeight: 'bold'
}
}, truncatedName))), /*#__PURE__*/React.createElement("div", {
style: {
display: 'flex',
flexDirection: 'column',
padding: '6px',
background: '#fff',
borderRadius: '4px',
margin: '6px'
}
}, /*#__PURE__*/React.createElement("div", {
style: {
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
marginBottom: '4px'
}
}, /*#__PURE__*/React.createElement("span", {
style: {
fontSize: '12px',
color: '#5584FF',
fontWeight: 'bold'
}
}, "\u4F18\u5148\u7EA7"), /*#__PURE__*/React.createElement("span", {
style: {
fontSize: '12px',
color: '#000',
background: '#f5f5f5',
// 灰色背景
padding: '4px 6px',
borderRadius: '4px',
maxWidth: '100px',
// 限制宽度
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap'
}
}, priority || '高')), /*#__PURE__*/React.createElement("div", {
style: {
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center',
background: '#f5f5f5',
padding: '4px 6px',
borderRadius: '4px',
marginTop: '4px'
}
}, /*#__PURE__*/React.createElement("span", {
style: {
fontSize: '12px',
color: '#666',
fontWeight: 'bold',
maxWidth: '80px',
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap'
}
}, "\u6761\u4EF6"), /*#__PURE__*/React.createElement("span", {
style: {
fontSize: '12px',
color: '#333',
background: '#f5f5f5',
padding: '4px 6px',
borderRadius: '4px',
maxWidth: '100px',
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap'
}
}, condition || ''))));
}
};
};
var _default = exports["default"] = Compo;