Commit 9972a808 authored by 邓超's avatar 邓超

fix: 修改工作流编辑,跟业务平添同步

parent 3f76e2bb
Pipeline #60925 passed with stages
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
...@@ -8,6 +8,9 @@ import * as go from 'gojs'; ...@@ -8,6 +8,9 @@ import * as go from 'gojs';
import styles from '../workflow.less'; import styles from '../workflow.less';
import NodeModal from './flowChartComponents/NodeModal'; import NodeModal from './flowChartComponents/NodeModal';
import imgUrl from '@/assets/images/icons/closeBlue.png'; import imgUrl from '@/assets/images/icons/closeBlue.png';
import imgEnd from '@/assets/images/workFlow/end.png';
import imgGeneral from '@/assets/images/workFlow/general.png';
import imgStart from '@/assets/images/workFlow/start.png';
const { confirm } = Modal; const { confirm } = Modal;
let diagram = null; let diagram = null;
const FlowChart = props => { const FlowChart = props => {
...@@ -162,64 +165,57 @@ const FlowChart = props => { ...@@ -162,64 +165,57 @@ const FlowChart = props => {
objGo( objGo(
go.Panel, go.Panel,
objGo( objGo(
go.Shape, go.Picture,
new go.Binding('width', 'NodeType', v => (v === '0' ? 135 : 105)), new go.Binding('source', 'NodeType', v => {
new go.Binding('height', 'NodeType', v => (v === '0' ? 75 : 105)),
new go.Binding('figure', 'NodeType', v => (v === '0' ? 'RoundedRectangle' : 'Ellipse')),
new go.Binding('strokeWidth', 'NodeType', v => (v === '0' ? 1 : 15)),
new go.Binding('stroke', 'NodeType', v => {
// 普通节点
if (v === '0') {
return '#0587E0';
}
// 开始节点
if (v === '1') {
return '#d7efff';
}
// 结束节点
if (v === '2') {
return '#d7efff';
}
return '';
}),
new go.Binding('fill', 'NodeType', v => {
// 普通节点
if (v === '0') {
return '#DCF2FE';
}
// 开始节点
if (v === '1') { if (v === '1') {
return '#0AC03D'; return imgStart;
} }
// 结束节点
if (v === '2') { if (v === '2') {
return '#8585FF'; return imgEnd;
} }
return ''; return imgGeneral;
}), }),
new go.Binding('width', 'NodeType', v => (v === '0' ? 136 : 120)),
new go.Binding('height', 'NodeType', v => (v === '0' ? 76 : 120)),
), ),
), ),
// 节点文案 // 节点文案
objGo( objGo(
go.TextBlock, go.TextBlock,
{ maxSize: new go.Size(130, NaN), wrap: go.TextBlock.WrapFit }, { maxSize: new go.Size(130, NaN), wrap: go.TextBlock.WrapFit },
new go.Binding('text', 'NodeName', v => v.slice(0, 6)), new go.Binding('text', 'NodeName', v => v.slice(0, 6)),
new go.Binding('stroke', 'NodeType', v => (v === '0' ? '#077BD6' : '#fff')), new go.Binding('stroke', 'NodeType', v => {
), // 普通节点
objGo( if (v === '0') {
go.Picture, return '#1685FF';
{ }
source: imgUrl, // 图片路径 // 开始节点
desiredSize: new go.Size(12, 12), if (v === '1') {
alignment: go.Spot.TopRight, // 对齐主要形状上的端口 return '#FEFFFF';
alignmentFocus: go.Spot.TopRight, // 就在形状里面 }
click() { // 结束节点
// 删除节点 if (v === '2') {
showDeleteConfirm(); return '#51C21A';
}, }
},
new go.Binding('margin', 'NodeType', v => (v === '0' ? 5 : 17)), return '';
}),
), ),
// objGo(
// go.Picture,
// {
// source: imgUrl, // 图片路径
// desiredSize: new go.Size(12, 12),
// alignment: go.Spot.TopRight, // 对齐主要形状上的端口
// alignmentFocus: go.Spot.TopRight, // 就在形状里面
// click() {
// // 删除节点
// showDeleteConfirm();
// },
// },
// new go.Binding('margin', 'NodeType', v => (v === '0' ? 5 : 17)),
// ),
// 我们的小命名端口,每侧一个: // 我们的小命名端口,每侧一个:
makePort('T', go.Spot.Top), makePort('T', go.Spot.Top),
makePort('L', go.Spot.Left), makePort('L', go.Spot.Left),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment