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';
import styles from '../workflow.less';
import NodeModal from './flowChartComponents/NodeModal';
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;
let diagram = null;
const FlowChart = props => {
......@@ -162,64 +165,57 @@ const FlowChart = props => {
objGo(
go.Panel,
objGo(
go.Shape,
new go.Binding('width', 'NodeType', v => (v === '0' ? 135 : 105)),
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';
}
// 开始节点
go.Picture,
new go.Binding('source', 'NodeType', v => {
if (v === '1') {
return '#0AC03D';
return imgStart;
}
// 结束节点
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(
go.TextBlock,
{ maxSize: new go.Size(130, NaN), wrap: go.TextBlock.WrapFit },
new go.Binding('text', 'NodeName', v => v.slice(0, 6)),
new go.Binding('stroke', 'NodeType', v => (v === '0' ? '#077BD6' : '#fff')),
),
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)),
new go.Binding('stroke', 'NodeType', v => {
// 普通节点
if (v === '0') {
return '#1685FF';
}
// 开始节点
if (v === '1') {
return '#FEFFFF';
}
// 结束节点
if (v === '2') {
return '#51C21A';
}
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('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