Commit 08f77e51 by 吴斌

Fix UI overlap issue and enable rule execution

parent 875f2e49
......@@ -132,7 +132,7 @@
<!-- 添加图形模板弹窗-->
<!-- 添加端口弹窗-->
<el-dialog v-model="showAddPortDialog" title="添加端口" class="w-[500px] h-[500px]">
<el-form v-model="addPortForm">
<el-form v-model="addPortForm">
<el-form-item label="端口名称">
<el-input v-model="addPortForm.name"></el-input>
</el-form-item>
......@@ -562,7 +562,6 @@ function listenDiagram(){
myDiagram.addModelChangedListener(function(e:any){
if (e.isTransactionFinished) {
deviceMap.value = getDiagramMapData(myDiagram)
runAllEnableRule(deviceMap.value)
}
})
}
......@@ -776,6 +775,7 @@ function changeDeviceData(){
}
)
myDiagram.commitTransaction('changeDeviceData')
runAllEnableRule(deviceMap.value)
}
function changeDataRealTime(){
......
......@@ -8,10 +8,10 @@ import {DeviceType} from "./DeviceData.ts";
* type: 节点类别类型, svg: 图片, geometry: 路径绘制, shape: gojs内置形状, go: gojs内置对象
*/
export const SourceNodeCategory: { key: string; name: string; type: string }[] = [
{key:"valve",name:"阀门", type:"svg"},
{key:"pump",name:"泵", type:"svg"},
{key:"pipeline", name:"管道线", type:"svg"},
{key:"container", name:"容器", type:"svg"},
{key: "valve", name: "阀门", type: "svg"},
{key: "pump", name: "泵", type: "svg"},
{key: "pipeline", name: "管道线", type: "svg"},
{key: "container", name: "容器", type: "svg"},
// {key:"shape", name:"形状", type:"geometry"},
]
......@@ -20,27 +20,49 @@ export const SourceNodeModel = [
//geometry
//valve
{
name:"闸阀",
name: "闸阀",
nodeCollection: "valve",
geometry:"XFM 0 0 L 50 30 L 0 60 Z M 100 0 L 50 30 L 100 60 Z",
stroke:'black',
fill:'white',
geometry: "XFM 0 0 L 50 30 L 0 60 Z M 100 0 L 50 30 L 100 60 Z",
stroke: 'black',
fill: 'white',
category: 'geometry',
deviceType:DeviceType.GateValve,
portArray:[
{"name": "端口1", "portId": "510331ce-31ba-475b-a085-60ddc0294346", "alignment": "0 0.5 0 0", "fromLinkable": true, "toLinkable": true, "fromMaxLinks": 999, "toMaxLinks": 999, "fromSpot": "0 0.5 0 0", "toSpot": "0 0.5 0 0", "isHighlighted": false},
{"name": "端口2", "portId": "3861fadc-6be3-4ff9-bac5-c4ae4545d221", "alignment": "1 0.5 0 0", "fromLinkable": true, "toLinkable": true, "fromMaxLinks": 999, "toMaxLinks": 999, "fromSpot": "1 0.5 0 0", "toSpot": "1 0.5 0 0", "isHighlighted": false}
deviceType: DeviceType.GateValve,
portArray: [
{
"name": "端口1",
"portId": "510331ce-31ba-475b-a085-60ddc0294346",
"alignment": "0 0.5 0 0",
"fromLinkable": true,
"toLinkable": true,
"fromMaxLinks": 999,
"toMaxLinks": 999,
"fromSpot": "0 0.5 0 0",
"toSpot": "0 0.5 0 0",
"isHighlighted": false
},
{
"name": "端口2",
"portId": "3861fadc-6be3-4ff9-bac5-c4ae4545d221",
"alignment": "1 0.5 0 0",
"fromLinkable": true,
"toLinkable": true,
"fromMaxLinks": 999,
"toMaxLinks": 999,
"fromSpot": "1 0.5 0 0",
"toSpot": "1 0.5 0 0",
"isHighlighted": false
}
]
},
{
name:"截止阀",
name: "截止阀",
nodeCollection: "valve",
geometry:'XM 0 0 L 50 30 L 0 60 Z M 100 0 L 50 30 L 100 60 Z XM 70 30 B0 360 50 30 20 19.2 XFM 70 30 B0 360 50 30 20 19.2',
fill:'black',
stroke:'black',
geometry: 'XM 0 0 L 50 30 L 0 60 Z M 100 0 L 50 30 L 100 60 Z XM 70 30 B0 360 50 30 20 19.2 XFM 70 30 B0 360 50 30 20 19.2',
fill: 'black',
stroke: 'black',
category: 'geometry',
deviceType:DeviceType.GlobeValve,
portArray:[
deviceType: DeviceType.GlobeValve,
portArray: [
{
"name": "端口1",
"portId": "08bb41f6-0562-45f6-8e7d-98aa35618635",
......@@ -66,13 +88,13 @@ export const SourceNodeModel = [
]
},
{
name:"止回阀",
name: "止回阀",
nodeCollection: "valve",
geometry:'XFM 0 0 L 0 60 M 100 0 L 100 60 M 5 3 L 95 57 XFM 89.25 48.9 L 95.7 57.3 L 85 55.68 Z ',
fill:'black',
geometry: 'XFM 0 0 L 0 60 M 100 0 L 100 60 M 5 3 L 95 57 XFM 89.25 48.9 L 95.7 57.3 L 85 55.68 Z ',
fill: 'black',
stroke: 'black',
category: 'geometry',
deviceType:DeviceType.CheckValve,
deviceType: DeviceType.CheckValve,
portArray: [
{
"name": "端口1",
......@@ -99,13 +121,13 @@ export const SourceNodeModel = [
]
},
{
name:"球阀",
name: "球阀",
nodeCollection: "valve",
geometry:'XFM 0 0 L 50 30 L 0 60 Z M 100 0 L 50 30 L 100 60 Z XFM 70 30 B0 360 50 30 20 19.2 XFM 70 30 B0 360 50 30 20 19.2',
fill:'white',
geometry: 'XFM 0 0 L 50 30 L 0 60 Z M 100 0 L 50 30 L 100 60 Z XFM 70 30 B0 360 50 30 20 19.2 XFM 70 30 B0 360 50 30 20 19.2',
fill: 'white',
stroke: 'black',
category: 'geometry',
deviceType:DeviceType.BallValve,
deviceType: DeviceType.BallValve,
portArray: [
{
"name": "端口1",
......@@ -129,16 +151,17 @@ export const SourceNodeModel = [
"fromSpot": "1 0.5 0 0",
"toSpot": "1 0.5 0 0"
}
]},
]
},
{
name:"安全阀",
name: "安全阀",
nodeCollection: "valve",
geometry:'XFM 50 60 L 100 30 L 100 90 Z M 50 60 L 80 110 L 20 110 Z XM 50 60 Q 50 60 50 0 XM 30 20 Q 30 20 70 20 XM 30 30 Q 30 30 70 30 ',
fill:'white',
geometry: 'XFM 50 60 L 100 30 L 100 90 Z M 50 60 L 80 110 L 20 110 Z XM 50 60 Q 50 60 50 0 XM 30 20 Q 30 20 70 20 XM 30 30 Q 30 30 70 30 ',
fill: 'white',
stroke: 'black',
category: 'geometry',
deviceType:DeviceType.SafetyValve,
portArray:[
deviceType: DeviceType.SafetyValve,
portArray: [
{
"name": "端口1",
"portId": "200182c3-6b87-4244-b2d4-75878cc27926",
......@@ -177,14 +200,14 @@ export const SourceNodeModel = [
]
},
{
name:"安全阀-2",
name: "安全阀-2",
nodeCollection: "valve",
geometry:'XFM 50 60 L 80 110 L 20 110Z XFM50 60 L0 30 0 90z XM 50 60 Q 50 60 50 0 XM 30 20 Q 30 20 70 20 XM 30 30 Q 30 30 70 30 ',
fill:'white',
geometry: 'XFM 50 60 L 80 110 L 20 110Z XFM50 60 L0 30 0 90z XM 50 60 Q 50 60 50 0 XM 30 20 Q 30 20 70 20 XM 30 30 Q 30 30 70 30 ',
fill: 'white',
stroke: 'black',
category: 'geometry',
deviceType:DeviceType.SafetyValve,
portArray:[
deviceType: DeviceType.SafetyValve,
portArray: [
{
"name": "端口1",
"portId": "200182c3-6b87-4244-b2d4-75878cc27926",
......@@ -225,13 +248,13 @@ export const SourceNodeModel = [
//pump
{
name:"机泵",
name: "机泵",
nodeCollection: "pump",
geometry:' XM 0.5 34.3 0.5 0 XM 24.4 34.1 58.6 34.1 XB 0 360 24.4 34.1 24 24 XM34.5 55L46.2 71.3 2.7 71.3 14 55.5',
fill:'black',
geometry: ' XM 0.5 34.3 0.5 0 XM 24.4 34.1 58.6 34.1 XB 0 360 24.4 34.1 24 24 XM34.5 55L46.2 71.3 2.7 71.3 14 55.5',
fill: 'black',
stroke: 'black',
category: 'geometry',
deviceType:DeviceType.CentrifugalPump,
deviceType: DeviceType.CentrifugalPump,
portArray: [
{
"name": "端口1",
......@@ -287,13 +310,13 @@ export const SourceNodeModel = [
//pipeline
// {name:"新旧管道交界", nodeCollection: "pipeline", img:"src/assets/models/pipeline/新旧管道交界.svg", category: 'svg'},
{
name:"管道变径",
name: "管道变径",
nodeCollection: "pipeline",
geometry:'XFM 0 0 L 20 5 L 20 15 L 0 20 Z ',
fill:'white',
geometry: 'XFM 0 0 L 20 5 L 20 15 L 0 20 Z ',
fill: 'white',
stroke: 'black',
category: 'geometry',
deviceType:DeviceType.DifferentDiameterPipe,
deviceType: DeviceType.DifferentDiameterPipe,
portArray: [
{
"name": "端口1",
......@@ -320,10 +343,10 @@ export const SourceNodeModel = [
]
},
{
name:"物料流向",
name: "物料流向",
nodeCollection: "pipeline",
geometry:'XFM 0 5.3 L 30.13 5.3 L 30.13 0 L 50 10 L 30.13 20 L 30.13 14.7 L 0 14.7 L 0 10 Z ',
fill:'white',
geometry: 'XFM 0 5.3 L 30.13 5.3 L 30.13 0 L 50 10 L 30.13 20 L 30.13 14.7 L 0 14.7 L 0 10 Z ',
fill: 'white',
stroke: 'black',
category: 'geometry',
portArray: [
......@@ -353,13 +376,13 @@ export const SourceNodeModel = [
]
},
{
name:"漏斗",
name: "漏斗",
nodeCollection: "pipeline",
geometry:'XM 30 30 Q 30 30 60 0 XM 30 30 Q 30 30 0 0 XM 30 60 Q 30 60 30 30 XM 0 75 L 6.84 54.49 Q 10 45 18 51 L 42 69 Q 50 75 53.16 65.51 L 60 45 ',
fill:'black',
geometry: 'XM 30 30 Q 30 30 60 0 XM 30 30 Q 30 30 0 0 XM 30 60 Q 30 60 30 30 XM 0 75 L 6.84 54.49 Q 10 45 18 51 L 42 69 Q 50 75 53.16 65.51 L 60 45 ',
fill: 'black',
stroke: 'black',
category: 'geometry',
deviceType:DeviceType.Funnel,
deviceType: DeviceType.Funnel,
portArray: [
{
"name": "端口1",
......@@ -375,14 +398,14 @@ export const SourceNodeModel = [
]
},
{
name:"8字盲板(开)",
name: "8字盲板(开)",
nodeCollection: "pipeline",
geometry:'XM 9.9 40 Q 9.9 40 9.9 30 XM -0.1 40 Q -0.1 40 -0.1 30 XM 4.95 40 Q 4.95 40 5 20 XFM 10 5 B0 360 5 5 5 5 XM 10 15 B0 360 5 15 5 5',
fill:'black',
geometry: 'XM 9.9 40 Q 9.9 40 9.9 30 XM -0.1 40 Q -0.1 40 -0.1 30 XM 4.95 40 Q 4.95 40 5 20 XFM 10 5 B0 360 5 5 5 5 XM 10 15 B0 360 5 15 5 5',
fill: 'black',
stroke: 'black',
category: 'geometry',
deviceType:DeviceType.SpectacleBlind,
portArray:[
deviceType: DeviceType.SpectacleBlind,
portArray: [
{
"name": "端口1",
"portId": "c1d6b849-16ca-4ec8-903e-20d8cf5724d9",
......@@ -409,14 +432,14 @@ export const SourceNodeModel = [
]
},
{
name:"8字盲板(关)",
name: "8字盲板(关)",
nodeCollection: "pipeline",
geometry:'XM 5 40 Q 5 40 5 20 XM 10 40 Q 10 40 10 30 XM 5 40 Q 5 40 5 20 XM 0 40 Q 0 40 0 30 XFM 10 15 B0 360 5 15 5 5 XM 10 5 B0 360 5 5 5 5',
fill:'black',
geometry: 'XM 5 40 Q 5 40 5 20 XM 10 40 Q 10 40 10 30 XM 5 40 Q 5 40 5 20 XM 0 40 Q 0 40 0 30 XFM 10 15 B0 360 5 15 5 5 XM 10 5 B0 360 5 5 5 5',
fill: 'black',
stroke: 'black',
category: 'geometry',
deviceType:DeviceType.SpectacleBlind,
portArray:[
deviceType: DeviceType.SpectacleBlind,
portArray: [
{
"name": "端口1",
"portId": "E5AD2202-0A90-370B-9CA6-1D500A4BFE59",
......@@ -443,19 +466,19 @@ export const SourceNodeModel = [
]
},
{
name:"管道等级分界",
name: "管道等级分界",
nodeCollection: "pipeline",
geometry:'XM 0 20 Q 0 20 39.88 20 XFM 48.88 20 L 39.88 23 L 39.88 17 Z XM 100 20 Q 100 20 60.12 20 XFM 51.12 20 L 60.12 17 L 60.12 23 Z XM 50 30 Q 50 30 50 0 ',
fill:'black',
geometry: 'XM 0 20 Q 0 20 39.88 20 XFM 48.88 20 L 39.88 23 L 39.88 17 Z XM 100 20 Q 100 20 60.12 20 XFM 51.12 20 L 60.12 17 L 60.12 23 Z XM 50 30 Q 50 30 50 0 ',
fill: 'black',
stroke: 'black',
category: 'geometry',
},
{
name:"s型接口",
name: "s型接口",
nodeCollection: "pipeline",
deviceType:DeviceType.SInterface,
geometry:'XM 10 0 Q 5 5 10 10 T 10 20',
fill:'none',
deviceType: DeviceType.SInterface,
geometry: 'XM 10 0 Q 5 5 10 10 T 10 20',
fill: 'none',
stroke: 'black',
category: 'geometry',
portArray: [
......@@ -471,13 +494,13 @@ export const SourceNodeModel = [
]
},
{
name:"管道过滤器",
name: "管道过滤器",
nodeCollection: "pipeline",
geometry:'XM 0 14.71 L 70 14.71 M 70 0 L 70 29.41 M 0 0 L 0 29.41 M 35 14.71 L 63 44.12 M 56 50 L 70 37.5',
fill:'black',
geometry: 'XM 0 14.71 L 70 14.71 M 70 0 L 70 29.41 M 0 0 L 0 29.41 M 35 14.71 L 63 44.12 M 56 50 L 70 37.5',
fill: 'black',
stroke: 'black',
category: 'geometry',
deviceType:DeviceType.PipeFilter,
deviceType: DeviceType.PipeFilter,
portArray: [
{
"name": "端口1",
......@@ -517,14 +540,14 @@ export const SourceNodeModel = [
]
},
{
name:"管道混合器",
name: "管道混合器",
nodeCollection: "pipeline",
geometry:'XFM 30 20 L 70 20 L 80 30 L 70 40 L 30 40 L 20 30 Z XM 100 25 Q 100 25 100 35 XM 80 30 Q 80 30 100 30 XM 0 30 Q 0 30 20 30 XM 0 25 Q 0 25 0 35 XM 50 0 Q 50 0 50 20 XM 40 0 Q 40 0 60 0 ',
fill:'white',
geometry: 'XFM 30 20 L 70 20 L 80 30 L 70 40 L 30 40 L 20 30 Z XM 100 25 Q 100 25 100 35 XM 80 30 Q 80 30 100 30 XM 0 30 Q 0 30 20 30 XM 0 25 Q 0 25 0 35 XM 50 0 Q 50 0 50 20 XM 40 0 Q 40 0 60 0 ',
fill: 'white',
stroke: 'black',
category: 'geometry',
deviceType:DeviceType.PipeMixer,
portArray:[
deviceType: DeviceType.PipeMixer,
portArray: [
{
"name": "端口1",
"portId": "13482418-68c3-4d92-b4b3-97f48844088b",
......@@ -561,10 +584,10 @@ export const SourceNodeModel = [
]
},
{
name:"四接口",
name: "四接口",
nodeCollection: "pipeline",
geometry:'XM 0 20 Q 0 20 40 20 XM 20 40 Q 20 40 20 0 ',
fill:'black',
geometry: 'XM 0 20 Q 0 20 40 20 XM 20 40 Q 20 40 20 0 ',
fill: 'black',
stroke: 'black',
category: 'geometry',
portArray: [
......@@ -615,13 +638,13 @@ export const SourceNodeModel = [
]
},
{
name:"三接口",
name: "三接口",
nodeCollection: "pipeline",
geometry:'XM 20 20 Q 20 20 20 0 XM 0 20 Q 0 20 40 20',
fill:'black',
geometry: 'XM 20 20 Q 20 20 20 0 XM 0 20 Q 0 20 40 20',
fill: 'black',
stroke: 'black',
category: 'geometry',
portArray:[
portArray: [
{
"name": "端口1",
"portId": "986b50c0-cd51-43d4-a0b2-dad2ec218568",
......@@ -660,9 +683,9 @@ export const SourceNodeModel = [
},
{
name: "孔板",
geometry:'XM 20 30 L 20 0 XM 10 25 L 10 5 XM 0 30 L 0 0',
nodeCollection:'pipeline',
fill:'black',
geometry: 'XM 20 30 L 20 0 XM 10 25 L 10 5 XM 0 30 L 0 0',
nodeCollection: 'pipeline',
fill: 'black',
stroke: 'black',
category: 'geometry',
portArray: [
......@@ -693,64 +716,64 @@ export const SourceNodeModel = [
},
//container
{
name:"换热器",
name: "换热器",
nodeCollection: "container",
geometry:'XFM6,17h112c9.9,0,18,8.1,18,18s-8.1,18-18,18H6z XM 20 4 20 17 XM 20 67 20 54 XM 49 67 49 54 XM 81 4 81 17 XM 26.5 3.5 13.5 3.5 XM 13.5 67.5 26.5 67.5 XM 42.5 67.5 55.5 67.5 XM 87.5 3.5 74.5 3.5 XM 35 6 35 64 XM 5 6 5 64 XM 99 6 99 64',
fill:'white',
geometry: 'XFM6,17h112c9.9,0,18,8.1,18,18s-8.1,18-18,18H6z XM 20 4 20 17 XM 20 67 20 54 XM 49 67 49 54 XM 81 4 81 17 XM 26.5 3.5 13.5 3.5 XM 13.5 67.5 26.5 67.5 XM 42.5 67.5 55.5 67.5 XM 87.5 3.5 74.5 3.5 XM 35 6 35 64 XM 5 6 5 64 XM 99 6 99 64',
fill: 'white',
stroke: 'black',
category: 'geometry',
deviceType:DeviceType.HeatExchanger,
deviceType: DeviceType.HeatExchanger,
},
{
name:"脱硫塔",
name: "脱硫塔",
nodeCollection: "container",
geometry:'XFM51,23.1c0-4.2-8.6-7.6-19.1-7.6s-19.1,3.4-19.1,7.6v30.6l3.1,9.2h32.1l3.1-9.2V23.1z XFM15.9,225.5c0,5,7.2,9,16,9s16-4,16-9 XM13.4,32.2h37c0.1,0,0.1,0,0.1,0.1c0,0,0,0.1-0.1,0.1l-37,11.9c-0.1,0-0.1,0.1-0.1,0.1 c0,0,0.1,0.1,0.1,0.1h37c0.1,0,0.1,0,0.1-0.1c0,0,0-0.1-0.1-0.1l-37-11.9C13.3,32.4,13.3,32.4,13.4,32.2 C13.3,32.3,13.4,32.2,13.4,32.2z XFM15.8 62.9 H 47.900000000000006 V 224.9 H 15.8 z XM 12.8 23.1 51 23.1 XM 12.8 53.1 51 53.1 XM 31.8 15.5 31.8 1.5 XM 15.5 88.7 1.5 88.7 XM 15.5 203.7 1.5 203.7 XM 47 191.7 61 191.7 XM 31.8 234 31.8 248 XM 24.8 0.5 38.8 0.5 XM 0.5 95.7 0.5 81.7 XM 0.5 210.7 0.5 196.7 XM 62 184.7 62 198.7 XM 38.8 249 24.8 249 XM16.2 104.2 L 47.9 104.2 16.2 175.1 47.9 175.1 16.2 104.2',
fill:'white',
geometry: 'XFM51,23.1c0-4.2-8.6-7.6-19.1-7.6s-19.1,3.4-19.1,7.6v30.6l3.1,9.2h32.1l3.1-9.2V23.1z XFM15.9,225.5c0,5,7.2,9,16,9s16-4,16-9 XM13.4,32.2h37c0.1,0,0.1,0,0.1,0.1c0,0,0,0.1-0.1,0.1l-37,11.9c-0.1,0-0.1,0.1-0.1,0.1 c0,0,0.1,0.1,0.1,0.1h37c0.1,0,0.1,0,0.1-0.1c0,0,0-0.1-0.1-0.1l-37-11.9C13.3,32.4,13.3,32.4,13.4,32.2 C13.3,32.3,13.4,32.2,13.4,32.2z XFM15.8 62.9 H 47.900000000000006 V 224.9 H 15.8 z XM 12.8 23.1 51 23.1 XM 12.8 53.1 51 53.1 XM 31.8 15.5 31.8 1.5 XM 15.5 88.7 1.5 88.7 XM 15.5 203.7 1.5 203.7 XM 47 191.7 61 191.7 XM 31.8 234 31.8 248 XM 24.8 0.5 38.8 0.5 XM 0.5 95.7 0.5 81.7 XM 0.5 210.7 0.5 196.7 XM 62 184.7 62 198.7 XM 38.8 249 24.8 249 XM16.2 104.2 L 47.9 104.2 16.2 175.1 47.9 175.1 16.2 104.2',
fill: 'white',
stroke: 'black',
category: 'geometry',
deviceType:DeviceType.DesulfurizationTower,
deviceType: DeviceType.DesulfurizationTower,
},
{
name:"精脱硫罐",
name: "精脱硫罐",
nodeCollection: "container",
geometry:'XFM0,187.4c0,8.1,11.6,14.6,26,14.6s26-6.5,26-14.6 XFM0,39c0-8.1,11.6-14.6,26-14.6S52,30.9,52,39 XM11 9.4 H 41 V 15.4 H 11 z XM 26 9.3 26 0.4 XM 36 25.3 36 16.4 XM 16 25.3 16 15.4 XM 52.4 144.6 67.2 144.6 XM 27.1 202 27.1 215.8 XM 21.6 0.5 30.5 0.5 XM 67.2 137.2 67.2 152.1 XM 34.5 215.8 19.6 215.8 XFM 0.1 187.8L0.1 38.8 52.1 38.8 52.1 187.8 XM0.3 72.1 L51.2 72.1 0.3 146 51.2 146 0.3 72.1',
fill:'white',
geometry: 'XFM0,187.4c0,8.1,11.6,14.6,26,14.6s26-6.5,26-14.6 XFM0,39c0-8.1,11.6-14.6,26-14.6S52,30.9,52,39 XM11 9.4 H 41 V 15.4 H 11 z XM 26 9.3 26 0.4 XM 36 25.3 36 16.4 XM 16 25.3 16 15.4 XM 52.4 144.6 67.2 144.6 XM 27.1 202 27.1 215.8 XM 21.6 0.5 30.5 0.5 XM 67.2 137.2 67.2 152.1 XM 34.5 215.8 19.6 215.8 XFM 0.1 187.8L0.1 38.8 52.1 38.8 52.1 187.8 XM0.3 72.1 L51.2 72.1 0.3 146 51.2 146 0.3 72.1',
fill: 'white',
stroke: 'black',
category: 'geometry',
deviceType:DeviceType.DesulfurizationTank,
deviceType: DeviceType.DesulfurizationTank,
},
{
name:"胺液回收罐",
name: "胺液回收罐",
nodeCollection: "container",
geometry:'XFM39.7,23.9L39.7,23.9c13.8,0,25,11.2,25,25v124c0,13.8-11.2,25-25,25l0,0c-13.8,0-25-11.2-25-25v-124C14.7,35,25.9,23.9,39.7,23.9z XM 8.7 50.5 71.4 50.5 XM 32.7 0.5 47.2 0.5 XM 49.2 221.2 34.7 221.2 XM 0.5 88.2 0.5 73.7 XM 39.9 0.3 39.9 24.7 XM 41.9 221.5 41.9 197 XM 0.3 80.9 14.7 80.9 XM 14.7 173.5 64.4 173.5 XM 8.7 56.5 71.4 56.5 ',
fill:'white',
geometry: 'XFM39.7,23.9L39.7,23.9c13.8,0,25,11.2,25,25v124c0,13.8-11.2,25-25,25l0,0c-13.8,0-25-11.2-25-25v-124C14.7,35,25.9,23.9,39.7,23.9z XM 8.7 50.5 71.4 50.5 XM 32.7 0.5 47.2 0.5 XM 49.2 221.2 34.7 221.2 XM 0.5 88.2 0.5 73.7 XM 39.9 0.3 39.9 24.7 XM 41.9 221.5 41.9 197 XM 0.3 80.9 14.7 80.9 XM 14.7 173.5 64.4 173.5 XM 8.7 56.5 71.4 56.5 ',
fill: 'white',
stroke: 'black',
category: 'geometry',
deviceType:DeviceType.AmineRecoveryTank,
deviceType: DeviceType.AmineRecoveryTank,
},
{
name:"筒式过滤器",
name: "筒式过滤器",
nodeCollection: "container",
geometry:'XFM40,21.4L40,21.4c13.8,0,25,11.2,25,25v124c0,13.8-11.2,25-25,25l0,0c-13.8,0-25-11.2-25-25v-124C15,32.6,26.2,21.4,40,21.4z XM32.6 75.4 H 64.6 V 146.4 H 32.6 z XM 15 42.1 64.7 42.1 XM 15 174.1 64.7 174.1 XM 48.6 74.4 48.6 147.4 XM 39 75.8 32.4 85.8 XM 43.5 75.8 32.4 93.8 XM 37.4 75.8 48.5 93.8 XM 42.4 75.8 48.5 85.8 XM 48.5 134.8 41.6 146.6 XM 48.5 125.8 35.9 146.6 XM 48.5 75.8 32.4 102.3 XM 32.4 75.8 48.5 102.3 XM 32.4 84.8 48.5 111.3 XM 32.4 93.8 48.5 120.3 XM 32.4 102.8 48.5 129.3 XM 32.4 111.8 48.5 138.3 XM 32.4 127.8 43.5 146.6 XM 32.4 135.8 39 146.6 XM 32.4 119.8 48.5 146.3 XM 48.5 84.8 32.4 110.9 XM 48.5 92.8 32.4 118.9 XM 48.5 101.8 32.4 127.9 XM 48.5 109.8 32.4 135.9 XM 48.5 117.8 32.4 143.9 XM 39.9 1.4 39.9 21.6 XM 40.7 215.1 40.7 195 XM 78.1 117.9 64 117.9 XM 1.4 61.7 15.6 61.7 XM 31.4 0.5 48.1 0.5 XM 49.1 216.1 32.4 216.1 XM 79.1 109.4 79.1 126.1 XM 0.5 70.1 0.5 53.4 ',
fill:'white',
geometry: 'XFM40,21.4L40,21.4c13.8,0,25,11.2,25,25v124c0,13.8-11.2,25-25,25l0,0c-13.8,0-25-11.2-25-25v-124C15,32.6,26.2,21.4,40,21.4z XM32.6 75.4 H 64.6 V 146.4 H 32.6 z XM 15 42.1 64.7 42.1 XM 15 174.1 64.7 174.1 XM 48.6 74.4 48.6 147.4 XM 39 75.8 32.4 85.8 XM 43.5 75.8 32.4 93.8 XM 37.4 75.8 48.5 93.8 XM 42.4 75.8 48.5 85.8 XM 48.5 134.8 41.6 146.6 XM 48.5 125.8 35.9 146.6 XM 48.5 75.8 32.4 102.3 XM 32.4 75.8 48.5 102.3 XM 32.4 84.8 48.5 111.3 XM 32.4 93.8 48.5 120.3 XM 32.4 102.8 48.5 129.3 XM 32.4 111.8 48.5 138.3 XM 32.4 127.8 43.5 146.6 XM 32.4 135.8 39 146.6 XM 32.4 119.8 48.5 146.3 XM 48.5 84.8 32.4 110.9 XM 48.5 92.8 32.4 118.9 XM 48.5 101.8 32.4 127.9 XM 48.5 109.8 32.4 135.9 XM 48.5 117.8 32.4 143.9 XM 39.9 1.4 39.9 21.6 XM 40.7 215.1 40.7 195 XM 78.1 117.9 64 117.9 XM 1.4 61.7 15.6 61.7 XM 31.4 0.5 48.1 0.5 XM 49.1 216.1 32.4 216.1 XM 79.1 109.4 79.1 126.1 XM 0.5 70.1 0.5 53.4 ',
fill: 'white',
stroke: 'black',
category: 'geometry',
deviceType:DeviceType.DrumFilter,
deviceType: DeviceType.DrumFilter,
},
{
name:"卧式容器",
name: "卧式容器",
nodeCollection: "container",
geometry:'XFM 6.3 30 L 93.7 30 C 97.18 30 100 23.28 100 15 C 100 6.72 97.18 0 93.7 0 L 6.3 0 C 2.82 0 0 6.72 0 15 C 0 23.28 2.82 30 6.3 30 Z M 6.3 0 L 6.3 30 M 93.7 0 L 93.7 30 XFM 60 45 Q 60 50 65 50 Q 70 50 70 45 XFM60 30 H 70 V 45 H 60 z ',
fill:'white',
geometry: 'XFM 6.3 30 L 93.7 30 C 97.18 30 100 23.28 100 15 C 100 6.72 97.18 0 93.7 0 L 6.3 0 C 2.82 0 0 6.72 0 15 C 0 23.28 2.82 30 6.3 30 Z M 6.3 0 L 6.3 30 M 93.7 0 L 93.7 30 XFM 60 45 Q 60 50 65 50 Q 70 50 70 45 XFM60 30 H 70 V 45 H 60 z ',
fill: 'white',
stroke: 'black',
category: 'geometry',
deviceType:DeviceType.HorizontalVessel
deviceType: DeviceType.HorizontalVessel
},
{
name:"立式容器",
name: "立式容器",
nodeCollection: "container",
geometry:'XFM40,21.4L40,21.4c13.8,0,25,11.2,25,25v124c0,13.8-11.2,25-25,25l0,0c-13.8,0-25-11.2-25-25 v-124C15,32.6,26.2,21.4,40,21.4z XM 15 42.1 64.7 42.1 XM 39.9 1.4 39.9 21.6 XM 40.7 215.1 40.7 195 XM 78.1 117.9 64 117.9 XM 1.4 61.7 15.6 61.7 XM 31.4 0.5 48.1 0.5 XM 49.1 216.1 32.4 216.1 XM 79.1 109.4 79.1 126.1 XM 0.5 70.1 0.5 53.4 ',
fill:'white',
geometry: 'XFM40,21.4L40,21.4c13.8,0,25,11.2,25,25v124c0,13.8-11.2,25-25,25l0,0c-13.8,0-25-11.2-25-25 v-124C15,32.6,26.2,21.4,40,21.4z XM 15 42.1 64.7 42.1 XM 39.9 1.4 39.9 21.6 XM 40.7 215.1 40.7 195 XM 78.1 117.9 64 117.9 XM 1.4 61.7 15.6 61.7 XM 31.4 0.5 48.1 0.5 XM 49.1 216.1 32.4 216.1 XM 79.1 109.4 79.1 126.1 XM 0.5 70.1 0.5 53.4 ',
fill: 'white',
stroke: 'black',
category: 'geometry',
deviceType: DeviceType.VerticalVessel
......@@ -765,7 +788,7 @@ export const SourceNodeModel = [
export const diagramModelData = {
diagramData:{
diagramData: {
"class": "GraphLinksModel",
"copiesArrays": true,
"copiesArrayObjects": true,
......@@ -7784,7 +7807,7 @@ export const diagramModelData = {
}
]
},
ruleData:[
ruleData: [
{
"id": "ffaec6e554f7d4665bd0e9b07b7878640",
"name": "监测脱硫塔",
......@@ -7796,13 +7819,40 @@ export const diagramModelData = {
}
],
"description": "脱硫塔失效可能性是否小于0.001",
"func": "if (tonumber(data[0]) < 0.001) then \n return 0\n end",
"func": "if (tonumber(data[0]) > 0.005) then \n return 0\n end\nif (tonumber(data[0]) > 0.001) then \n return 1\n end\n",
"enable": false,
"type": "lua",
"actions": [{
'type': 'error',
'content': '脱硫塔失效可能性过低'
}]
"actions": [
{
"type": "error",
"content": "脱硫塔失效可能性过低"
},
{
"type": "warning",
"content": "失效可能性较低"
}
]
},
{
"id": "ffabc6e554f7d4665bd0e9b07b7878640",
"name": "监测脱硫塔2",
"inputs": [
{
"key": -2,
"valueKey": "failurePossibility",
"testData": "0.00000001"
}
],
"description": "脱硫塔失效可能性是否小于0.001",
"func": "if (tonumber(data[0]) > 0.001) then \n return 0\n end",
"enable": false,
"type": "lua",
"actions": [
{
"type": "error",
"content": "脱硫塔失效可能性过低"
}
]
}
]
}
......@@ -40,11 +40,6 @@ export function makeShapeNode (stretch: typeof go.GraphObject.Fill = go.GraphObj
)
}
//
// export function makeGONode(){
// return GO(go.Shape, )
// }
/*
* 不同类型返回不同的节点模板
*/
......
......@@ -120,7 +120,10 @@ export function runRule(rule: any, deviceMap: Record<string, any>) {
export function runAllEnableRule(deviceMap: Record<string, any>) {
rules.forEach((item: any) => {
if (item['enable'].toString() === 'true') {
runRule(item, deviceMap)
// 为了避免触发Notification的时间一样,会导致UI重叠,所以使用setTimeout添加延迟。
setTimeout(()=>{
runRule(item, deviceMap)
}, 1)
}
})
}
......@@ -205,10 +208,8 @@ export function runLua(rule: any, inputData: any) {
${rule['func']}
end
`
let luaFunction = fengari.load(codeString)
return luaFunction().call(inputData)
} catch (e) {
alert(e)
}
......
......@@ -4,6 +4,7 @@ import gojs from 'gojs'
import ElementUI from 'element-plus';
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import "element-plus/theme-chalk/index.css"
import './style/element-plus/custom.css'
import 'virtual:uno.css'
import './assets/iconfont/iconfont.css'
......@@ -15,4 +16,4 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component)
}
app.mount('#app')
app.mount('#app')
\ No newline at end of file
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