@nywqs/scada-engine 1.1.18 → 1.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/scada-components/iot/AlarmLight3D.d.ts +14 -0
- package/dist/scada-components/iot/Conveyor3D.d.ts +14 -0
- package/dist/scada-components/iot/Cylinder3D.d.ts +14 -0
- package/dist/scada-components/iot/EChartsGauge.d.ts +14 -0
- package/dist/scada-components/iot/EChartsLine.d.ts +14 -0
- package/dist/scada-components/iot/Filter3D.d.ts +14 -0
- package/dist/scada-components/iot/HeatExchanger3D.d.ts +14 -0
- package/dist/scada-components/iot/Light3D.d.ts +14 -0
- package/dist/scada-components/iot/Motor3D.d.ts +14 -0
- package/dist/scada-components/iot/Pipe3D.d.ts +14 -0
- package/dist/scada-components/iot/Pump3D.d.ts +14 -0
- package/dist/scada-components/iot/Switch3D.d.ts +14 -0
- package/dist/scada-components/iot/Tank3D.d.ts +14 -0
- package/dist/scada-components/iot/Tee3D.d.ts +14 -0
- package/dist/scada-components/iot/TemperatureSensor3D.d.ts +14 -0
- package/dist/scada-components/iot/Valve3D.d.ts +14 -0
- package/dist/scada-components/iot/echarts-gauge-presets.d.ts +18 -0
- package/dist/scada-components/iot/echarts-gauge.d.ts +6 -0
- package/dist/scada-components/iot/echarts-line-presets.d.ts +13 -0
- package/dist/scada-components/iot/echarts-line.d.ts +6 -0
- package/dist/scada-components/iot/index.d.ts +5 -1
- package/dist/scada-components/iot/industrial-3d-extended.d.ts +18 -0
- package/dist/scada-components/iot/industrial-3d-fluid.d.ts +9 -0
- package/dist/scada-components/iot/industrial-3d.d.ts +18 -0
- package/dist/scada-components/iot/light.d.ts +1 -1
- package/dist/scada-components/iot/switch.d.ts +1 -1
- package/dist/scada-engine.css +1 -1
- package/dist/scada-engine.es.js +8593 -3119
- package/dist/scada-engine.umd.js +18 -18
- package/package.json +2 -1
- package/dist/scada-components/iot/gauge.d.ts +0 -6
package/dist/scada-engine.umd.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(I,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@antv/x6"),require("@antv/x6-plugin-selection"),require("@antv/x6-plugin-snapline")):typeof define=="function"&&define.amd?define(["exports","vue","@antv/x6","@antv/x6-plugin-selection","@antv/x6-plugin-snapline"],e):(I=typeof globalThis<"u"?globalThis:I||self,e(I.ScadaEngine={},I.Vue,I.X6,I.X6PluginSelection,I.X6PluginSnapline))})(this,function(I,e,
|
|
2
|
-
* @nywqs/scada-engine v1.1.
|
|
1
|
+
(function(I,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@antv/x6"),require("@antv/x6-plugin-selection"),require("@antv/x6-plugin-snapline"),require("echarts")):typeof define=="function"&&define.amd?define(["exports","vue","@antv/x6","@antv/x6-plugin-selection","@antv/x6-plugin-snapline","echarts"],e):(I=typeof globalThis<"u"?globalThis:I||self,e(I.ScadaEngine={},I.Vue,I.X6,I.X6PluginSelection,I.X6PluginSnapline,I.echarts))})(this,function(I,e,Q,qe,Dt,It){"use strict";var wu=Object.defineProperty;var $u=(I,e,Q)=>e in I?wu(I,e,{enumerable:!0,configurable:!0,writable:!0,value:Q}):I[e]=Q;var be=(I,e,Q)=>$u(I,typeof e!="symbol"?e+"":e,Q);/*!
|
|
2
|
+
* @nywqs/scada-engine v1.1.19
|
|
3
3
|
* Copyright (c) 2025 leoncheng
|
|
4
4
|
* Licensed under proprietary license - see LICENSE file
|
|
5
5
|
* Contact: nywqs@outlook.com
|
|
6
|
-
*/const mt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ut=e.defineComponent({name:"AlignHorizontalCenter",render:function(l,n){return e.openBlock(),e.createElementBlock("svg",mt,n[0]||(n[0]=[e.createElementVNode("path",{d:"M24 18h-7v-4h3a2.002 2.002 0 0 0 2-2V8a2.002 2.002 0 0 0-2-2h-3V2h-2v4h-3a2.002 2.002 0 0 0-2 2v4a2.002 2.002 0 0 0 2 2h3v4H8a2.002 2.002 0 0 0-2 2v4a2.002 2.002 0 0 0 2 2h7v4h2v-4h7a2.002 2.002 0 0 0 2-2v-4a2.002 2.002 0 0 0-2-2zM12 8h8v4h-8zm12 16H8v-4h16z",fill:"currentColor"},null,-1)]))}}),gt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},ft=e.defineComponent({name:"AlignHorizontalLeft",render:function(l,n){return e.openBlock(),e.createElementBlock("svg",gt,n[0]||(n[0]=[e.createElementVNode("path",{d:"M26 26H11a2.002 2.002 0 0 1-2-2v-4a2.002 2.002 0 0 1 2-2h15a2.002 2.002 0 0 1 2 2v4a2.002 2.002 0 0 1-2 2zm0-6.001L11 20v4h15z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 14h-7a2.002 2.002 0 0 1-2-2V8a2.002 2.002 0 0 1 2-2h7a2.002 2.002 0 0 1 2 2v4a2.002 2.002 0 0 1-2 2zm0-6.001L11 8v4h7z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M4 2h2v28H4z",fill:"currentColor"},null,-1)]))}}),Et={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},yt=e.defineComponent({name:"AlignHorizontalRight",render:function(l,n){return e.openBlock(),e.createElementBlock("svg",Et,n[0]||(n[0]=[e.createElementVNode("path",{d:"M4 24v-4a2.002 2.002 0 0 1 2-2h15a2.002 2.002 0 0 1 2 2v4a2.002 2.002 0 0 1-2 2H6a2.002 2.002 0 0 1-2-2zm2 0h15v-4l-15-.001z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M12 12V8a2.002 2.002 0 0 1 2-2h7a2.002 2.002 0 0 1 2 2v4a2.002 2.002 0 0 1-2 2h-7a2.002 2.002 0 0 1-2-2zm2 0h7V8l-7-.001z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M28 30h-2V2h2z",fill:"currentColor"},null,-1)]))}}),bt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Nt=e.defineComponent({name:"AlignVerticalBottom",render:function(l,n){return e.openBlock(),e.createElementBlock("svg",bt,n[0]||(n[0]=[e.createElementVNode("path",{d:"M2 26h28v2H2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M24 23h-4a2.002 2.002 0 0 1-2-2v-7a2.002 2.002 0 0 1 2-2h4a2.002 2.002 0 0 1 2 2v7a2.002 2.002 0 0 1-2 2zm-4-9v7h4.001L24 14z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M12 23H8a2.002 2.002 0 0 1-2-2V6a2.002 2.002 0 0 1 2-2h4a2.002 2.002 0 0 1 2 2v15a2.002 2.002 0 0 1-2 2zM8 6v15h4.001L12 6z",fill:"currentColor"},null,-1)]))}}),ht={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Vt=e.defineComponent({name:"AlignVerticalCenter",render:function(l,n){return e.openBlock(),e.createElementBlock("svg",ht,n[0]||(n[0]=[e.createElementVNode("path",{d:"M30 15h-4v-3a2.002 2.002 0 0 0-2-2h-4a2.002 2.002 0 0 0-2 2v3h-4V8a2.002 2.002 0 0 0-2-2H8a2.002 2.002 0 0 0-2 2v7H2v2h4v7a2.002 2.002 0 0 0 2 2h4a2.002 2.002 0 0 0 2-2v-7h4v3a2.002 2.002 0 0 0 2 2h4a2.002 2.002 0 0 0 2-2v-3h4zM8 24V8h4l.001 16zm12-4v-8h4l.001 8z",fill:"currentColor"},null,-1)]))}}),kt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ct=e.defineComponent({name:"AlignVerticalTop",render:function(l,n){return e.openBlock(),e.createElementBlock("svg",kt,n[0]||(n[0]=[e.createElementVNode("path",{d:"M24 20h-4a2.002 2.002 0 0 1-2-2v-7a2.002 2.002 0 0 1 2-2h4a2.002 2.002 0 0 1 2 2v7a2.002 2.002 0 0 1-2 2zm-4-9v7h4.001L24 11z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M12 28H8a2.002 2.002 0 0 1-2-2V11a2.002 2.002 0 0 1 2-2h4a2.002 2.002 0 0 1 2 2v15a2.002 2.002 0 0 1-2 2zM8 11v15h4.001L12 11z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M2 4h28v2H2z",fill:"currentColor"},null,-1)]))}}),$t={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},vt=e.defineComponent({name:"DistributeHorizontalCenter",render:function(l,n){return e.openBlock(),e.createElementBlock("svg",$t,n[0]||(n[0]=[e.createElementVNode("path",{d:"M24 10h-1V2h-2v8h-1a2.002 2.002 0 0 0-2 2v8a2.002 2.002 0 0 0 2 2h1v8h2v-8h1a2.002 2.002 0 0 0 2-2v-8a2.002 2.002 0 0 0-2-2zm0 10h-4v-8h4z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M12 6h-1V2H9v4H8a2.002 2.002 0 0 0-2 2v16a2.002 2.002 0 0 0 2 2h1v4h2v-4h1a2.002 2.002 0 0 0 2-2V8a2.002 2.002 0 0 0-2-2zm0 18H8V8h4z",fill:"currentColor"},null,-1)]))}}),wt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Bt=e.defineComponent({name:"DistributeVerticalCenter",render:function(l,n){return e.openBlock(),e.createElementBlock("svg",wt,n[0]||(n[0]=[e.createElementVNode("path",{d:"M30 21h-4v-1a2.002 2.002 0 0 0-2-2H8a2.002 2.002 0 0 0-2 2v1H2v2h4v1a2.002 2.002 0 0 0 2 2h16a2.002 2.002 0 0 0 2-2v-1h4zm-6 3H8v-4l16-.001z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M30 9h-8V8a2.002 2.002 0 0 0-2-2h-8a2.002 2.002 0 0 0-2 2v1H2v2h8v1a2.002 2.002 0 0 0 2 2h8a2.002 2.002 0 0 0 2-2v-1h8zm-10 3h-8V8l8-.001z",fill:"currentColor"},null,-1)]))}}),St={class:"scada-header"},_t={class:"header-left"},xt={class:"header-center"},It={class:"tool-group"},Dt={key:0,class:"divider"},Tt={key:1,class:"tool-group"},Pt={key:2,class:"divider"},At={key:3,class:"tool-group"},Mt={class:"header-right"},zt={class:"tool-group"},Ot=e.defineComponent({__name:"Header",props:{selectedNodesCount:{default:0}},emits:["save","import","workflow","preview","export","zoomIn","zoomOut","clearAll","alignLeft","alignCenter","alignRight","alignTop","alignMiddle","alignBottom","distributeHorizontal","distributeVertical"],setup(i,{emit:l}){const n=i,r=l;return(t,s)=>(e.openBlock(),e.createElementBlock("header",St,[e.createElementVNode("div",_t,[e.renderSlot(t.$slots,"left",{},()=>[s[16]||(s[16]=e.createElementVNode("h1",{class:"logo"},"SCADA 组态引擎",-1)),s[17]||(s[17]=e.createElementVNode("span",{class:"version"},"v1.0.0",-1))],!0)]),e.createElementVNode("div",xt,[e.createElementVNode("div",It,[e.createElementVNode("button",{class:"toolbar-btn",onClick:s[0]||(s[0]=d=>r("zoomIn")),title:"放大"},[...s[18]||(s[18]=[e.createElementVNode("span",{class:"icon"},"+",-1)])]),e.createElementVNode("button",{class:"toolbar-btn",onClick:s[1]||(s[1]=d=>r("zoomOut")),title:"缩小"},[...s[19]||(s[19]=[e.createElementVNode("span",{class:"icon"},"-",-1)])]),e.createElementVNode("button",{class:"toolbar-btn",onClick:s[2]||(s[2]=d=>r("clearAll")),title:"清空画布"},[...s[20]||(s[20]=[e.createElementVNode("span",{class:"icon"},"🗑",-1)])])]),n.selectedNodesCount>=2?(e.openBlock(),e.createElementBlock("div",Dt)):e.createCommentVNode("",!0),n.selectedNodesCount>=2?(e.openBlock(),e.createElementBlock("div",Tt,[e.createElementVNode("button",{class:"toolbar-btn",onClick:s[3]||(s[3]=d=>r("alignLeft")),title:"左对齐"},[e.createVNode(e.unref(ft),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:s[4]||(s[4]=d=>r("alignCenter")),title:"水平居中"},[e.createVNode(e.unref(ut),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:s[5]||(s[5]=d=>r("alignRight")),title:"右对齐"},[e.createVNode(e.unref(yt),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:s[6]||(s[6]=d=>r("alignTop")),title:"顶部对齐"},[e.createVNode(e.unref(Ct),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:s[7]||(s[7]=d=>r("alignMiddle")),title:"垂直居中"},[e.createVNode(e.unref(Vt),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:s[8]||(s[8]=d=>r("alignBottom")),title:"底部对齐"},[e.createVNode(e.unref(Nt),{class:"icon-svg"})])])):e.createCommentVNode("",!0),n.selectedNodesCount>=3?(e.openBlock(),e.createElementBlock("div",Pt)):e.createCommentVNode("",!0),n.selectedNodesCount>=3?(e.openBlock(),e.createElementBlock("div",At,[e.createElementVNode("button",{class:"toolbar-btn",onClick:s[9]||(s[9]=d=>r("distributeHorizontal")),title:"横向分布"},[e.createVNode(e.unref(vt),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:s[10]||(s[10]=d=>r("distributeVertical")),title:"纵向分布"},[e.createVNode(e.unref(Bt),{class:"icon-svg"})])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Mt,[e.createElementVNode("div",zt,[e.createElementVNode("button",{class:"header-btn",onClick:s[11]||(s[11]=d=>r("workflow")),title:"流程编排"},[...s[21]||(s[21]=[e.createElementVNode("span",{class:"icon"},"⚡",-1),e.createElementVNode("span",null,"流程编排",-1)])]),e.createElementVNode("button",{class:"header-btn",onClick:s[12]||(s[12]=d=>r("import")),title:"导入"},[...s[22]||(s[22]=[e.createElementVNode("span",{class:"icon"},"📂",-1),e.createElementVNode("span",null,"导入",-1)])]),e.createElementVNode("button",{class:"header-btn",onClick:s[13]||(s[13]=d=>r("export")),title:"导出"},[...s[23]||(s[23]=[e.createElementVNode("span",{class:"icon"},"📤",-1),e.createElementVNode("span",null,"导出",-1)])]),e.createElementVNode("button",{class:"header-btn",onClick:s[14]||(s[14]=d=>r("preview")),title:"预览"},[...s[24]||(s[24]=[e.createElementVNode("span",{class:"icon"},"👁",-1),e.createElementVNode("span",null,"预览",-1)])]),e.createElementVNode("button",{class:"header-btn",onClick:s[15]||(s[15]=d=>r("save")),title:"保存"},[...s[25]||(s[25]=[e.createElementVNode("span",{class:"icon"},"💾",-1),e.createElementVNode("span",null,"保存",-1)])])])])]))}}),H=(i,l)=>{const n=i.__vccOpts||i;for(const[r,t]of l)n[r]=t;return n},we=H(Ot,[["__scopeId","data-v-a2c5b2cf"]]),re=[{key:"animationEnabled",label:"启用动画",type:"boolean",path:"data.animation.enabled",defaultValue:!1,description:"是否启用动画效果",bindable:!0},{key:"animationType",label:"动画类型",type:"select",path:"data.animation.type",defaultValue:"none",options:[{label:"无动画",value:"none"},{label:"闪烁",value:"blink"},{label:"缩放",value:"scale"},{label:"旋转",value:"rotate"},{label:"浮动",value:"float"},{label:"脉冲",value:"pulse"}],description:"组件动画效果类型",bindable:!1},{key:"animationDuration",label:"动画时长(ms)",type:"number",path:"data.animation.duration",defaultValue:1e3,min:100,max:5e3,step:100,description:"动画完成一次所需时间",bindable:!1},{key:"animationLoop",label:"循环播放",type:"boolean",path:"data.animation.loop",defaultValue:!0,description:"是否循环播放动画",bindable:!1}],He={metadata:{id:"rect",name:"矩形",category:"basic",icon:"▢",description:"基础矩形图形组件",version:"1.0.0"},shape:"rect",width:120,height:60,label:"矩形",attrs:{body:{fill:"#3b82f6",stroke:"#2563eb",strokeWidth:2},label:{fill:"#fff",fontSize:14}},ports:{groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-top",group:"top"},{id:"port-right",group:"right"},{id:"port-bottom",group:"bottom"},{id:"port-left",group:"left"}]},props:[{key:"name",label:"按钮文本",type:"text",path:"attrs.label.text",defaultValue:"矩形",description:"矩形名称"},{key:"fill",label:"填充色",type:"color",path:"attrs.body.fill",defaultValue:"#3b82f6",description:"矩形填充颜色"},{key:"stroke",label:"边框色",type:"color",path:"attrs.body.stroke",defaultValue:"#2563eb",description:"矩形边框颜色"},{key:"strokeWidth",label:"边框宽度",type:"number",path:"attrs.body.strokeWidth",defaultValue:2,min:0,max:10,description:"矩形边框宽度"},{key:"opacity",label:"透明度",type:"slider",path:"attrs.body.opacity",defaultValue:1,min:0,max:1,step:.1,description:"矩形透明度"},...re]},Je={metadata:{id:"circle",name:"圆形",category:"basic",icon:"○",description:"基础圆形图形组件",version:"1.0.0"},shape:"circle",width:80,height:80,label:"圆形",attrs:{body:{fill:"#10b981",stroke:"#059669",strokeWidth:2},label:{fill:"#fff",fontSize:14}},ports:{groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-top",group:"top"},{id:"port-right",group:"right"},{id:"port-bottom",group:"bottom"},{id:"port-left",group:"left"}]},props:[{key:"text",label:"初始文本",type:"text",path:"attrs.label.text",defaultValue:"圆形",description:"圆形初始文本"},{key:"fill",label:"填充色",type:"color",path:"attrs.body.fill",defaultValue:"#10b981",description:"圆形填充颜色"},{key:"stroke",label:"边框色",type:"color",path:"attrs.body.stroke",defaultValue:"#059669",description:"圆形边框颜色"},{key:"strokeWidth",label:"边框宽度",type:"number",path:"attrs.body.strokeWidth",defaultValue:2,min:0,max:10,description:"圆形边框宽度"},{key:"opacity",label:"透明度",type:"slider",path:"attrs.body.opacity",defaultValue:1,min:0,max:1,step:.1,description:"圆形透明度"},...re]},qe={metadata:{id:"text",name:"文本",category:"basic",icon:"T",description:"文本标签组件",version:"1.0.0"},shape:"rect",width:100,height:40,label:"文本",attrs:{body:{fill:"transparent",stroke:"#64748b",strokeWidth:1,strokeDasharray:"5 5"},label:{fill:"#e2e8f0",fontSize:16}},props:[{key:"label",label:"文本内容",type:"text",path:"attrs.label.text",defaultValue:"文本",description:"显示的文本内容"},{key:"fontSize",label:"字体大小",type:"number",path:"attrs.label.fontSize",defaultValue:16,min:12,max:48,description:"文本字体大小"},{key:"fontColor",label:"字体颜色",type:"color",path:"attrs.label.fill",defaultValue:"#e2e8f0",description:"文本字体颜色"},{key:"stroke",label:"边框色",type:"color",path:"attrs.body.stroke",defaultValue:"#64748b",description:"边框颜色"},...re]},Ut=Object.freeze(Object.defineProperty({__proto__:null,CircleComponent:Je,RectComponent:He,TextComponent:qe},Symbol.toStringTag,{value:"Module"})),Ye={metadata:{id:"light",name:"灯泡",category:"iot",icon:"💡",description:"IoT灯泡控制组件",version:"1.0.0"},shape:"circle",width:60,height:60,label:"💡",attrs:{body:{fill:"#fbbf24",stroke:"#f59e0b",strokeWidth:2},label:{fill:"#fff",fontSize:24}},data:{type:"light",deviceId:"",property:""},ports:{groups:{left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-left",group:"left"},{id:"port-right",group:"right"}]},props:[{key:"fill",label:"填充色",type:"color",path:"attrs.body.fill",defaultValue:"#fbbf24",description:"灯泡颜色"},{key:"stroke",label:"边框色",type:"color",path:"attrs.body.stroke",defaultValue:"#f59e0b",description:"边框颜色"},{key:"deviceId",label:"设备ID",type:"text",path:"data.deviceId",defaultValue:"",description:"绑定的设备ID"},{key:"property",label:"设备属性",type:"text",path:"data.property",defaultValue:"",description:"绑定的设备属性名称"},...re]},Xe={metadata:{id:"switch",name:"开关",category:"iot",icon:"🔘",description:"IoT开关控制组件",version:"1.0.0"},shape:"rect",width:100,height:50,label:"开关",attrs:{body:{fill:"#64748b",stroke:"#475569",strokeWidth:2,rx:25,ry:25},label:{fill:"#fff",fontSize:14}},data:{type:"switch",deviceId:"",property:"",state:!1},ports:{groups:{left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-left",group:"left"},{id:"port-right",group:"right"}]},props:[{key:"fill",label:"填充色",type:"color",path:"attrs.body.fill",defaultValue:"#64748b",description:"开关颜色"},{key:"stroke",label:"边框色",type:"color",path:"attrs.body.stroke",defaultValue:"#475569",description:"边框颜色"},{key:"deviceId",label:"设备ID",type:"text",path:"data.deviceId",defaultValue:"",description:"绑定的设备ID"},{key:"property",label:"设备属性",type:"text",path:"data.property",defaultValue:"",description:"绑定的设备属性名称"},{key:"state",label:"开关状态",type:"boolean",path:"data.state",defaultValue:!1,description:"开关当前状态"},...re]},Ke={metadata:{id:"gauge",name:"仪表",category:"iot",icon:"📊",description:"IoT仪表盘数据展示组件",version:"1.0.0"},shape:"circle",width:100,height:100,label:"📊",attrs:{body:{fill:"#8b5cf6",stroke:"#7c3aed",strokeWidth:2},label:{fill:"#fff",fontSize:32}},data:{type:"gauge",deviceId:"",property:"",value:0},ports:{groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-top",group:"top"},{id:"port-right",group:"right"},{id:"port-bottom",group:"bottom"},{id:"port-left",group:"left"}]},props:[{key:"fill",label:"填充色",type:"color",path:"attrs.body.fill",defaultValue:"#8b5cf6",description:"仪表颜色"},{key:"stroke",label:"边框色",type:"color",path:"attrs.body.stroke",defaultValue:"#7c3aed",description:"边框颜色"},{key:"deviceId",label:"设备ID",type:"text",path:"data.deviceId",defaultValue:"",description:"绑定的设备ID"},{key:"property",label:"设备属性",type:"text",path:"data.property",defaultValue:"",description:"绑定的设备属性名称"},{key:"value",label:"当前值",type:"number",path:"data.value",defaultValue:0,min:0,max:100,description:"仪表当前显示值"},...re]},Rt=Object.freeze(Object.defineProperty({__proto__:null,GaugeComponent:Ke,LightComponent:Ye,SwitchComponent:Xe},Symbol.toStringTag,{value:"Module"}));class Lt{constructor(){be(this,"registry",{});this.registerDefaultComponents()}registerDefaultComponents(){this.register(He),this.register(Je),this.register(qe),this.register(Ye),this.register(Xe),this.register(Ke)}register(l){const{id:n}=l.metadata;this.registry[n]&&console.warn(`组件 ${n} 已存在,将被覆盖`),this.registry[n]=l,console.log(`✓ 组件注册成功: ${l.metadata.name} (${n})`)}registerBatch(l){l.forEach(n=>this.register(n))}getComponent(l){return this.registry[l]}getAllComponents(){return{...this.registry}}getComponentsByCategory(l){return Object.values(this.registry).filter(n=>n.metadata.category===l)}getComponentList(){return Object.values(this.registry)}hasComponent(l){return l in this.registry}unregister(l){return this.registry[l]?(delete this.registry[l],console.log(`✓ 组件注销成功: ${l}`),!0):(console.warn(`组件 ${l} 不存在`),!1)}getCount(){return Object.keys(this.registry).length}clear(){this.registry={},console.log("✓ 组件注册表已清空")}}const me=new Lt,Be={size:{width:1920,height:1080,preset:"1920*1080"},zoom:{scale:1,min:.1,max:5},offset:{x:0,y:0},background:{color:"#1e293b",size:"origin",repeat:"repeat"},grid:{enabled:!0,size:10,color:"#475569",type:"dot"},snap:{enabled:!0,threshold:10},guides:{enabled:!1,color:"#3b82f6"},magnetism:{enabled:!0,threshold:10}},Wt=[{key:"sizePreset",label:"画布尺寸",type:"select",category:"basic",path:"size.preset",defaultValue:"1920*1080",options:[{label:"1920*1080",value:"1920*1080"},{label:"1366*768",value:"1366*768"},{label:"1280*720",value:"1280*720"},{label:"800*600",value:"800*600"}],description:"预设画布尺寸"},{key:"scale",label:"缩放倍数",type:"slider",category:"transform",path:"zoom.scale",defaultValue:1,min:.1,max:5,step:.1,description:"画布缩放比例"},{key:"offsetX",label:"画布X轴偏移",type:"number",category:"transform",path:"offset.x",defaultValue:0,description:"X轴偏移量"},{key:"offsetY",label:"画布Y轴偏移",type:"number",category:"transform",path:"offset.y",defaultValue:0,description:"Y轴偏移量"},{key:"backgroundColor",label:"背景颜色",type:"color",category:"background",path:"background.color",defaultValue:"#1e293b",description:"画布背景颜色"},{key:"backgroundImage",label:"背景图片",type:"image",category:"background",path:"background.image",defaultValue:"",description:"背景图片URL"},{key:"backgroundSize",label:"背景大小",type:"select",category:"background",path:"background.size",defaultValue:"origin",options:[{label:"原始",value:"origin"},{label:"包含",value:"contain"},{label:"覆盖",value:"cover"},{label:"拉伸",value:"stretch"}],description:"背景图片尺寸模式"},{key:"backgroundRepeat",label:"图像重复",type:"select",category:"background",path:"background.repeat",defaultValue:"repeat",options:[{label:"重复",value:"repeat"},{label:"X轴重复",value:"repeat-x"},{label:"Y轴重复",value:"repeat-y"},{label:"不重复",value:"no-repeat"}],description:"背景图片重复模式"},{key:"gridEnabled",label:"网格",type:"boolean",category:"assist",path:"grid.enabled",defaultValue:!0,description:"显示网格"},{key:"gridSize",label:"网格大小",type:"number",category:"assist",path:"grid.size",defaultValue:10,min:5,max:50,description:"网格单元格大小"},{key:"snapEnabled",label:"网格对齐",type:"boolean",category:"assist",path:"snap.enabled",defaultValue:!0,description:"启用网格对齐"},{key:"guidesEnabled",label:"参考线",type:"boolean",category:"assist",path:"guides.enabled",defaultValue:!0,description:"显示参考线"},{key:"magnetismEnabled",label:"吸附",type:"boolean",category:"assist",path:"magnetism.enabled",defaultValue:!0,description:"启用吸附功能"}],ue={"1920*1080":{width:1920,height:1080},"1366*768":{width:1366,height:768},"1280*720":{width:1280,height:720},"800*600":{width:800,height:600}};class Ft{constructor(){be(this,"config");this.config=e.reactive({...Be})}getConfig(){return this.config}updateConfig(l){Object.assign(this.config,l)}updateByPath(l,n){const r=l.split(".");let t=this.config;for(let s=0;s<r.length-1;s++)t=t[r[s]];if(t[r[r.length-1]]=n,l==="size.preset"&&n in ue){const{width:s,height:d}=ue[n];this.config.size.width=s,this.config.size.height=d}}getByPath(l){const n=l.split(".");let r=this.config;for(const t of n)r=r==null?void 0:r[t];return r}setSize(l,n,r){this.config.size.width=l,this.config.size.height=n,r&&(this.config.size.preset=r)}updateSize(l){this.config.size.width=l.width,this.config.size.height=l.height}setZoom(l){const{min:n=.1,max:r=5}=this.config.zoom;this.config.zoom.scale=Math.max(n,Math.min(r,l))}setOffset(l,n){this.config.offset.x=l,this.config.offset.y=n}setBackgroundColor(l){this.config.background.color=l}updateBackground(l){l.color!==void 0&&(this.config.background.color=l.color),l.image!==void 0&&(this.config.background.image=l.image),l.size!==void 0&&(this.config.background.size=l.size),l.repeat!==void 0&&(this.config.background.repeat=l.repeat)}setBackgroundImage(l){this.config.background.image=l}toggleGrid(l){this.config.grid.enabled=l??!this.config.grid.enabled}setGridSize(l){this.config.grid.size=l}toggleSnap(l){this.config.snap.enabled=l??!this.config.snap.enabled}toggleGuides(l){this.config.guides.enabled=l??!this.config.guides.enabled}toggleMagnetism(l){this.config.magnetism.enabled=l??!this.config.magnetism.enabled}reset(){Object.assign(this.config,Be)}export(){return JSON.stringify(this.config,null,2)}import(l){try{const n=JSON.parse(l);Object.assign(this.config,n)}catch(n){console.error("导入画布配置失败:",n)}}}const R=new Ft,jt={class:"component-library"},Gt={class:"library-content"},Ht={key:0,class:"component-section"},Jt={class:"component-grid"},qt=["onClick","title"],Yt={class:"component-icon"},Xt={class:"component-name"},Kt={key:1,class:"component-section"},Zt={class:"component-grid"},Qt=["onClick","title"],eo={class:"component-icon"},to={class:"component-name"},Se=H(e.defineComponent({__name:"ComponentLibrary",emits:["addComponent"],setup(i,{emit:l}){const n=l,r=e.computed(()=>me.getComponentsByCategory("basic")),t=e.computed(()=>me.getComponentsByCategory("iot")),s=d=>{n("addComponent",d.metadata.id)};return(d,c)=>(e.openBlock(),e.createElementBlock("aside",jt,[c[2]||(c[2]=e.createElementVNode("div",{class:"library-header"},[e.createElementVNode("h3",null,"组件库")],-1)),e.createElementVNode("div",Gt,[r.value.length>0?(e.openBlock(),e.createElementBlock("div",Ht,[c[0]||(c[0]=e.createElementVNode("h4",{class:"section-title"},"基础组件",-1)),e.createElementVNode("div",Jt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,p=>(e.openBlock(),e.createElementBlock("div",{key:p.metadata.id,class:"component-item",onClick:g=>s(p),title:p.metadata.description||p.metadata.name},[e.createElementVNode("span",Yt,e.toDisplayString(p.metadata.icon),1),e.createElementVNode("span",Xt,e.toDisplayString(p.metadata.name),1)],8,qt))),128))])])):e.createCommentVNode("",!0),t.value.length>0?(e.openBlock(),e.createElementBlock("div",Kt,[c[1]||(c[1]=e.createElementVNode("h4",{class:"section-title"},"IoT组件",-1)),e.createElementVNode("div",Zt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,p=>(e.openBlock(),e.createElementBlock("div",{key:p.metadata.id,class:"component-item",onClick:g=>s(p),title:p.metadata.description||p.metadata.name},[e.createElementVNode("span",eo,e.toDisplayString(p.metadata.icon),1),e.createElementVNode("span",to,e.toDisplayString(p.metadata.name),1)],8,Qt))),128))])])):e.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-92bb4e17"]]),oo={class:"canvas-area"},no=H(e.defineComponent({__name:"CanvasArea",setup(i,{expose:l}){const n=e.ref();return l({containerRef:n}),(r,t)=>(e.openBlock(),e.createElementBlock("div",oo,[e.createElementVNode("div",{ref_key:"containerRef",ref:n,class:"canvas-container"},null,512)]))}}),[["__scopeId","data-v-a869f6aa"]]),lo={class:"canvas-config-panel"},ao={class:"panel-content"},so={class:"config-section"},io={class:"config-item"},ro={class:"config-section"},co={class:"config-item"},po={class:"slider-group"},mo={class:"value-display"},uo={class:"config-item"},go={class:"number-input-group"},fo={class:"config-item"},Eo={class:"number-input-group"},yo={class:"config-section"},bo={class:"config-item"},No={class:"config-item"},ho={class:"image-upload"},Vo={class:"config-item"},ko={class:"config-item"},Co={class:"config-section"},$o={class:"config-item"},vo={class:"switch"},wo={class:"config-item"},Bo={class:"switch"},So={class:"config-item"},_o={class:"switch"},xo={key:0,class:"config-item"},Io={class:"number-input-group"},_e=H(e.defineComponent({__name:"CanvasConfigPanel",setup(i){const l=e.computed(()=>R.getConfig()),n=e.ref(),r=()=>{const g=l.value.size.preset;if(g&&g in ue){const{width:a,height:o}=ue[g];R.setSize(a,o,g)}},t=(g,a)=>{const o=l.value.offset[g];R.setOffset(g==="x"?o+a:l.value.offset.x,g==="y"?o+a:l.value.offset.y)},s=g=>{const a=Math.max(5,Math.min(50,l.value.grid.size+g));R.setGridSize(a)},d=()=>{var g;(g=n.value)==null||g.click()},c=g=>{var u;const o=(u=g.target.files)==null?void 0:u[0];if(o){const f=new FileReader;f.onload=b=>{var F;const S=(F=b.target)==null?void 0:F.result;R.updateByPath("background.image",S)},f.readAsDataURL(o)}},p=()=>{R.updateByPath("background.image",""),n.value&&(n.value.value="")};return(g,a)=>(e.openBlock(),e.createElementBlock("div",lo,[a[40]||(a[40]=e.createElementVNode("div",{class:"panel-header"},[e.createElementVNode("h3",null,"画布配置")],-1)),e.createElementVNode("div",ao,[e.createElementVNode("div",so,[a[19]||(a[19]=e.createElementVNode("h4",{class:"section-title"},"基础配置",-1)),e.createElementVNode("div",io,[a[18]||(a[18]=e.createElementVNode("label",null,"画布尺寸",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":a[0]||(a[0]=o=>l.value.size.preset=o),onChange:r,class:"config-select"},[...a[17]||(a[17]=[e.createElementVNode("option",{value:"1920*1080"},"1920*1080",-1),e.createElementVNode("option",{value:"1366*768"},"1366*768",-1),e.createElementVNode("option",{value:"1280*720"},"1280*720",-1),e.createElementVNode("option",{value:"800*600"},"800*600",-1)])],544),[[e.vModelSelect,l.value.size.preset]])])]),e.createElementVNode("div",ro,[a[23]||(a[23]=e.createElementVNode("h4",{class:"section-title"},"变换",-1)),e.createElementVNode("div",co,[a[20]||(a[20]=e.createElementVNode("label",null,"缩放倍数",-1)),e.createElementVNode("div",po,[e.withDirectives(e.createElementVNode("input",{type:"range","onUpdate:modelValue":a[1]||(a[1]=o=>l.value.zoom.scale=o),min:.1,max:5,step:.1,class:"config-slider"},null,512),[[e.vModelText,l.value.zoom.scale,void 0,{number:!0}]]),e.createElementVNode("span",mo,e.toDisplayString(l.value.zoom.scale.toFixed(1)),1)])]),e.createElementVNode("div",uo,[a[21]||(a[21]=e.createElementVNode("label",null,"画布X轴偏移",-1)),e.createElementVNode("div",go,[e.createElementVNode("button",{onClick:a[2]||(a[2]=o=>t("x",-10)),class:"adjust-btn"},"-"),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":a[3]||(a[3]=o=>l.value.offset.x=o),class:"config-number"},null,512),[[e.vModelText,l.value.offset.x,void 0,{number:!0}]]),e.createElementVNode("button",{onClick:a[4]||(a[4]=o=>t("x",10)),class:"adjust-btn"},"+")])]),e.createElementVNode("div",fo,[a[22]||(a[22]=e.createElementVNode("label",null,"画布Y轴偏移",-1)),e.createElementVNode("div",Eo,[e.createElementVNode("button",{onClick:a[5]||(a[5]=o=>t("y",-10)),class:"adjust-btn"},"-"),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":a[6]||(a[6]=o=>l.value.offset.y=o),class:"config-number"},null,512),[[e.vModelText,l.value.offset.y,void 0,{number:!0}]]),e.createElementVNode("button",{onClick:a[7]||(a[7]=o=>t("y",10)),class:"adjust-btn"},"+")])])]),e.createElementVNode("div",yo,[a[31]||(a[31]=e.createElementVNode("h4",{class:"section-title"},"背景",-1)),e.createElementVNode("div",bo,[a[24]||(a[24]=e.createElementVNode("label",null,"背景颜色",-1)),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":a[8]||(a[8]=o=>l.value.background.color=o),class:"config-color"},null,512),[[e.vModelText,l.value.background.color]])]),e.createElementVNode("div",No,[a[26]||(a[26]=e.createElementVNode("label",null,"背景图片",-1)),e.createElementVNode("div",ho,[e.createElementVNode("input",{type:"file",accept:"image/*",onChange:c,ref_key:"fileInput",ref:n,style:{display:"none"}},null,544),e.createElementVNode("button",{onClick:d,class:"upload-btn"},[...a[25]||(a[25]=[e.createElementVNode("span",null,"📄",-1)])]),l.value.background.image?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:p,class:"clear-btn",title:"清除背景图"}," ✕ ")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Vo,[a[28]||(a[28]=e.createElementVNode("label",null,"背景大小",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":a[9]||(a[9]=o=>l.value.background.size=o),class:"config-select"},[...a[27]||(a[27]=[e.createElementVNode("option",{value:"origin"},"原始",-1),e.createElementVNode("option",{value:"contain"},"包含",-1),e.createElementVNode("option",{value:"cover"},"覆盖",-1),e.createElementVNode("option",{value:"stretch"},"拉伸",-1)])],512),[[e.vModelSelect,l.value.background.size]])]),e.createElementVNode("div",ko,[a[30]||(a[30]=e.createElementVNode("label",null,"图像重复",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":a[10]||(a[10]=o=>l.value.background.repeat=o),class:"config-select"},[...a[29]||(a[29]=[e.createElementVNode("option",{value:"repeat"},"重复",-1),e.createElementVNode("option",{value:"repeat-x"},"X轴重复",-1),e.createElementVNode("option",{value:"repeat-y"},"Y轴重复",-1),e.createElementVNode("option",{value:"no-repeat"},"不重复",-1)])],512),[[e.vModelSelect,l.value.background.repeat]])])]),e.createElementVNode("div",Co,[a[39]||(a[39]=e.createElementVNode("h4",{class:"section-title"},"辅助",-1)),e.createElementVNode("div",$o,[a[33]||(a[33]=e.createElementVNode("label",null,"吸附",-1)),e.createElementVNode("label",vo,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":a[11]||(a[11]=o=>l.value.magnetism.enabled=o)},null,512),[[e.vModelCheckbox,l.value.magnetism.enabled]]),a[32]||(a[32]=e.createElementVNode("span",{class:"slider"},null,-1))])]),e.createElementVNode("div",wo,[a[35]||(a[35]=e.createElementVNode("label",null,"网格",-1)),e.createElementVNode("label",Bo,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":a[12]||(a[12]=o=>l.value.grid.enabled=o)},null,512),[[e.vModelCheckbox,l.value.grid.enabled]]),a[34]||(a[34]=e.createElementVNode("span",{class:"slider"},null,-1))])]),e.createElementVNode("div",So,[a[37]||(a[37]=e.createElementVNode("label",null,"网格对齐",-1)),e.createElementVNode("label",_o,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":a[13]||(a[13]=o=>l.value.snap.enabled=o)},null,512),[[e.vModelCheckbox,l.value.snap.enabled]]),a[36]||(a[36]=e.createElementVNode("span",{class:"slider"},null,-1))])]),l.value.grid.enabled?(e.openBlock(),e.createElementBlock("div",xo,[a[38]||(a[38]=e.createElementVNode("label",null,"网格大小",-1)),e.createElementVNode("div",Io,[e.createElementVNode("button",{onClick:a[14]||(a[14]=o=>s(-5)),class:"adjust-btn"},"-"),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":a[15]||(a[15]=o=>l.value.grid.size=o),min:5,max:50,class:"config-number"},null,512),[[e.vModelText,l.value.grid.size,void 0,{number:!0}]]),e.createElementVNode("button",{onClick:a[16]||(a[16]=o=>s(5)),class:"adjust-btn"},"+")])])):e.createCommentVNode("",!0)])])]))}}),[["__scopeId","data-v-f309895b"]]),Do={class:"tab-pane"},To={class:"property-section"},Po={class:"property-item-inline"},Ao=["value"],Mo={class:"property-item-inline"},zo=["value"],Oo={class:"property-item-inline"},Uo=["value"],Ro={class:"property-section"},Lo={class:"property-row"},Wo={class:"property-item"},Fo=["value"],jo={class:"property-item"},Go=["value"],Ho={class:"property-row"},Jo={class:"property-item"},qo=["value"],Yo={class:"property-item"},Xo=["value"],Ko={class:"property-section"},Zo={class:"property-item-inline"},Qo=["value"],en={class:"property-item-inline"},tn={class:"color-input-wrapper"},on=["value"],nn={class:"color-value"},ln={class:"property-item-inline"},an={class:"color-input-wrapper"},sn=["value"],rn={class:"color-value"},dn={class:"property-item-inline"},cn=["value"],pn={class:"property-item-inline"},mn=["value"],un={key:0,class:"property-section"},gn={key:0,class:"property-hint"},fn=["value","onInput","placeholder"],En=["value","onInput","min","max","step"],yn={key:2,class:"color-input-wrapper"},bn=["value","onInput"],Nn={class:"color-value"},hn={key:3,class:"checkbox-wrapper"},Vn=["checked","onChange"],kn={class:"checkbox-label"},Cn=["value","onChange"],$n=["value"],xe=H(e.defineComponent({__name:"BasicPropertiesTab",props:{selectedNode:{},nodePosition:{},nodeSize:{},nodeAttrs:{}},emits:["update-position","update-size","update-label","update-fill","update-stroke","update-stroke-width","update-opacity","update-component-name","update-dynamic-prop"],setup(i,{emit:l}){const n=i,r=l,t=e.computed(()=>{var p,g;if(!((g=(p=n.selectedNode)==null?void 0:p.data)!=null&&g.props))return[];const c=["label","fill","stroke","strokeWidth","opacity"];return n.selectedNode.data.props.filter(a=>!c.includes(a.key))}),s=c=>{if(!c.path)return c.defaultValue;const p=c.path.split(".");let g=n.selectedNode;for(const a of p)if(g&&typeof g=="object")g=g[a];else return c.defaultValue;return g!==void 0?g:c.defaultValue},d=(c,p)=>{const g=p.target;let a;c.type==="number"?a=Number(g.value):c.type==="boolean"?a=g.checked:a=g.value,r("update-dynamic-prop",c.path,a)};return(c,p)=>{var g,a,o,u,f,b,S,F,z,h,N,E,V,y,D,O,A;return e.openBlock(),e.createElementBlock("div",Do,[e.createElementVNode("div",To,[p[13]||(p[13]=e.createElementVNode("h4",null,"基础信息",-1)),e.createElementVNode("div",Po,[p[10]||(p[10]=e.createElementVNode("label",null,"组件名称",-1)),e.createElementVNode("input",{type:"text",value:((g=i.selectedNode.getData())==null?void 0:g.componentName)||"",onInput:p[0]||(p[0]=w=>c.$emit("update-component-name",w)),placeholder:"请输入组件名称"},null,40,Ao)]),e.createElementVNode("div",Mo,[p[11]||(p[11]=e.createElementVNode("label",null,"ID",-1)),e.createElementVNode("input",{type:"text",value:i.selectedNode.id,disabled:""},null,8,zo)]),e.createElementVNode("div",Oo,[p[12]||(p[12]=e.createElementVNode("label",null,"类型",-1)),e.createElementVNode("input",{type:"text",value:i.selectedNode.shape,disabled:""},null,8,Uo)])]),e.createElementVNode("div",Ro,[p[18]||(p[18]=e.createElementVNode("h4",null,"位置和尺寸",-1)),e.createElementVNode("div",Lo,[e.createElementVNode("div",Wo,[p[14]||(p[14]=e.createElementVNode("label",null,"X",-1)),e.createElementVNode("input",{type:"number",value:i.nodePosition.x,onInput:p[1]||(p[1]=w=>c.$emit("update-position","x",w))},null,40,Fo)]),e.createElementVNode("div",jo,[p[15]||(p[15]=e.createElementVNode("label",null,"Y",-1)),e.createElementVNode("input",{type:"number",value:i.nodePosition.y,onInput:p[2]||(p[2]=w=>c.$emit("update-position","y",w))},null,40,Go)])]),e.createElementVNode("div",Ho,[e.createElementVNode("div",Jo,[p[16]||(p[16]=e.createElementVNode("label",null,"宽度",-1)),e.createElementVNode("input",{type:"number",value:i.nodeSize.width,onInput:p[3]||(p[3]=w=>c.$emit("update-size","width",w))},null,40,qo)]),e.createElementVNode("div",Yo,[p[17]||(p[17]=e.createElementVNode("label",null,"高度",-1)),e.createElementVNode("input",{type:"number",value:i.nodeSize.height,onInput:p[4]||(p[4]=w=>c.$emit("update-size","height",w))},null,40,Xo)])])]),e.createElementVNode("div",Ko,[p[24]||(p[24]=e.createElementVNode("h4",null,"样式",-1)),e.createElementVNode("div",Zo,[p[19]||(p[19]=e.createElementVNode("label",null,"初始文本",-1)),e.createElementVNode("input",{type:"text",value:((o=(a=i.nodeAttrs)==null?void 0:a.text)==null?void 0:o.text)||((f=(u=i.nodeAttrs)==null?void 0:u.label)==null?void 0:f.text)||i.selectedNode.getProp("label")||"",onInput:p[5]||(p[5]=w=>c.$emit("update-label",w)),placeholder:"设置默认显示文本"},null,40,Qo)]),e.createElementVNode("div",en,[p[20]||(p[20]=e.createElementVNode("label",null,"填充颜色",-1)),e.createElementVNode("div",tn,[e.createElementVNode("input",{type:"color",value:((S=(b=i.nodeAttrs)==null?void 0:b.body)==null?void 0:S.fill)||"#3b82f6",onInput:p[6]||(p[6]=w=>c.$emit("update-fill",w))},null,40,on),e.createElementVNode("span",nn,e.toDisplayString(((z=(F=i.nodeAttrs)==null?void 0:F.body)==null?void 0:z.fill)||"#3b82f6"),1)])]),e.createElementVNode("div",ln,[p[21]||(p[21]=e.createElementVNode("label",null,"边框颜色",-1)),e.createElementVNode("div",an,[e.createElementVNode("input",{type:"color",value:((N=(h=i.nodeAttrs)==null?void 0:h.body)==null?void 0:N.stroke)||"#2563eb",onInput:p[7]||(p[7]=w=>c.$emit("update-stroke",w))},null,40,sn),e.createElementVNode("span",rn,e.toDisplayString(((V=(E=i.nodeAttrs)==null?void 0:E.body)==null?void 0:V.stroke)||"#2563eb"),1)])]),e.createElementVNode("div",dn,[p[22]||(p[22]=e.createElementVNode("label",null,"边框宽度",-1)),e.createElementVNode("input",{type:"number",min:"0",max:"10",value:((D=(y=i.nodeAttrs)==null?void 0:y.body)==null?void 0:D.strokeWidth)||2,onInput:p[8]||(p[8]=w=>c.$emit("update-stroke-width",w))},null,40,cn)]),e.createElementVNode("div",pn,[p[23]||(p[23]=e.createElementVNode("label",null,"透明度",-1)),e.createElementVNode("input",{type:"number",min:"0",max:"1",step:"0.1",value:((A=(O=i.nodeAttrs)==null?void 0:O.body)==null?void 0:A.opacity)!==void 0?i.nodeAttrs.body.opacity:1,onInput:p[9]||(p[9]=w=>c.$emit("update-opacity",w))},null,40,mn)])]),t.value.length>0?(e.openBlock(),e.createElementBlock("div",un,[p[25]||(p[25]=e.createElementVNode("h4",null,"组件属性",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,w=>(e.openBlock(),e.createElementBlock("div",{key:w.key,class:"property-item-inline"},[e.createElementVNode("label",null,[e.createTextVNode(e.toDisplayString(w.label)+" ",1),w.description?(e.openBlock(),e.createElementBlock("span",gn,e.toDisplayString(w.description),1)):e.createCommentVNode("",!0)]),w.type==="text"?(e.openBlock(),e.createElementBlock("input",{key:0,type:"text",value:s(w),onInput:B=>d(w,B),placeholder:w.defaultValue},null,40,fn)):w.type==="number"?(e.openBlock(),e.createElementBlock("input",{key:1,type:"number",value:s(w),onInput:B=>d(w,B),min:w.min,max:w.max,step:w.step},null,40,En)):w.type==="color"?(e.openBlock(),e.createElementBlock("div",yn,[e.createElementVNode("input",{type:"color",value:s(w),onInput:B=>d(w,B)},null,40,bn),e.createElementVNode("span",Nn,e.toDisplayString(s(w)),1)])):w.type==="boolean"?(e.openBlock(),e.createElementBlock("div",hn,[e.createElementVNode("input",{type:"checkbox",checked:s(w),onChange:B=>d(w,B)},null,40,Vn),e.createElementVNode("span",kn,e.toDisplayString(s(w)?"是":"否"),1)])):w.type==="select"?(e.openBlock(),e.createElementBlock("select",{key:4,value:s(w),onChange:B=>d(w,B)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.options,B=>(e.openBlock(),e.createElementBlock("option",{key:B.value,value:B.value},e.toDisplayString(B.label),9,$n))),128))],40,Cn)):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-def84c5f"]]),vn={class:"tab-pane"},wn={class:"property-section"},Bn={class:"property-item-inline"},Sn=["value"],_n={key:0,class:"property-section"},xn={class:"property-item-inline"},In=["value"],Dn={class:"property-item-inline"},Tn=["value"],Pn={class:"property-item-inline"},An=["value"],Mn={class:"property-item-inline"},zn=["value"],On={class:"property-item-inline"},Un=["value"],Rn={class:"property-item-inline"},Ln=["value"],Wn={key:1,class:"property-section"},Fn={class:"property-item-inline"},jn=["value"],Gn={class:"property-item-inline"},Hn=["value"],Jn={class:"property-item-inline"},qn=["value"],Yn={class:"property-item-inline"},Xn=["value"],Kn={class:"property-item-inline"},Zn=["value"],Qn={class:"property-item-inline"},el=["value"],tl={key:2,class:"property-section"},ol={class:"property-item-inline"},nl=["value"],ll={class:"property-item-inline"},al=["value"],sl={class:"property-item-inline"},il=["value"],rl={class:"property-item-inline"},dl=["value"],cl={class:"property-item-inline"},pl={class:"checkbox-wrapper"},ml=["checked"],ul={class:"checkbox-label"},gl={key:3,class:"property-section"},fl={class:"property-item-inline"},El=["value"],yl={class:"property-item-inline"},bl=["value"],Nl={class:"property-item-inline"},hl=["value"],Vl={key:4,class:"property-section"},kl={class:"property-item-inline"},Cl=["value"],$l={class:"property-item-inline"},vl=["value"],wl={key:5,class:"property-section"},Bl={class:"property-item-inline"},Sl={class:"checkbox-wrapper"},_l=["checked"],xl={class:"checkbox-label"},Il={class:"property-item-inline"},Dl=["value"],Tl=H(e.defineComponent({__name:"DataPropertiesTab",props:{selectedNode:{}},emits:["update-data-source"],setup(i,{emit:l}){const n=i,r=l,t=e.ref({type:"none",enabled:!0,retryCount:3});e.watch(()=>n.selectedNode,a=>{if(a){const o=a.getData();o!=null&&o.dataSource?t.value={...o.dataSource}:t.value={type:"none",enabled:!0,retryCount:3}}},{immediate:!0});const s=a=>{const o=a.target.value;let u={type:o,enabled:!0,retryCount:3};o==="http"?(u.pollInterval=5e3,u.method="GET"):o==="sse"&&(u.autoReconnect=!0),t.value=u,g()},d=(a,o)=>{const u=o.target;let f;u.type==="number"?f=Number(u.value):f=u.value,t.value={...t.value,[a]:f},g()},c=(a,o)=>{const u=o.target.checked;t.value={...t.value,[a]:u},g()},p=a=>{const o=a.target.checked;t.value={...t.value,enabled:o},g()},g=()=>{r("update-data-source",t.value)};return(a,o)=>(e.openBlock(),e.createElementBlock("div",vn,[e.createElementVNode("div",wn,[o[25]||(o[25]=e.createElementVNode("h4",null,"数据来源",-1)),e.createElementVNode("div",Bn,[o[24]||(o[24]=e.createElementVNode("label",null,"来源类型",-1)),e.createElementVNode("select",{value:t.value.type,onChange:s},[...o[23]||(o[23]=[e.createStaticVNode('<option value="none" data-v-5b515f8a>无数据源</option><option value="mqtt" data-v-5b515f8a>MQTT</option><option value="websocket" data-v-5b515f8a>WebSocket</option><option value="http" data-v-5b515f8a>HTTP</option><option value="sse" data-v-5b515f8a>SSE</option><option value="static" data-v-5b515f8a>静态数据</option>',6)])],40,Sn)])]),t.value.type==="mqtt"?(e.openBlock(),e.createElementBlock("div",_n,[o[32]||(o[32]=e.createElementVNode("h4",null,"MQTT配置",-1)),e.createElementVNode("div",xn,[o[26]||(o[26]=e.createElementVNode("label",null,"服务器",-1)),e.createElementVNode("input",{type:"text",value:t.value.broker||"",onInput:o[0]||(o[0]=u=>d("broker",u)),placeholder:"mqtt://localhost:1883"},null,40,In)]),e.createElementVNode("div",Dn,[o[27]||(o[27]=e.createElementVNode("label",null,"客户端ID",-1)),e.createElementVNode("input",{type:"text",value:t.value.clientId||"",onInput:o[1]||(o[1]=u=>d("clientId",u)),placeholder:"自动生成"},null,40,Tn)]),e.createElementVNode("div",Pn,[o[28]||(o[28]=e.createElementVNode("label",null,"订阅主题",-1)),e.createElementVNode("input",{type:"text",value:t.value.topic||"",onInput:o[2]||(o[2]=u=>d("topic",u)),placeholder:"例如: sensor/temperature"},null,40,An)]),e.createElementVNode("div",Mn,[o[29]||(o[29]=e.createElementVNode("label",null,"用户名",-1)),e.createElementVNode("input",{type:"text",value:t.value.username||"",onInput:o[3]||(o[3]=u=>d("username",u)),placeholder:"可选"},null,40,zn)]),e.createElementVNode("div",On,[o[30]||(o[30]=e.createElementVNode("label",null,"密码",-1)),e.createElementVNode("input",{type:"password",value:t.value.password||"",onInput:o[4]||(o[4]=u=>d("password",u)),placeholder:"可选"},null,40,Un)]),e.createElementVNode("div",Rn,[o[31]||(o[31]=e.createElementVNode("label",null,"数据路径",-1)),e.createElementVNode("input",{type:"text",value:t.value.dataPath||"",onInput:o[5]||(o[5]=u=>d("dataPath",u)),placeholder:"例如: value"},null,40,Ln)])])):e.createCommentVNode("",!0),t.value.type==="http"?(e.openBlock(),e.createElementBlock("div",Wn,[o[40]||(o[40]=e.createElementVNode("h4",null,"HTTP配置",-1)),e.createElementVNode("div",Fn,[o[33]||(o[33]=e.createElementVNode("label",null,"接口地址",-1)),e.createElementVNode("input",{type:"text",value:t.value.url||"",onInput:o[6]||(o[6]=u=>d("url",u)),placeholder:"https://api.example.com/data"},null,40,jn)]),e.createElementVNode("div",Gn,[o[35]||(o[35]=e.createElementVNode("label",null,"请求方法",-1)),e.createElementVNode("select",{value:t.value.method||"GET",onChange:o[7]||(o[7]=u=>d("method",u))},[...o[34]||(o[34]=[e.createElementVNode("option",{value:"GET"},"GET",-1),e.createElementVNode("option",{value:"POST"},"POST",-1),e.createElementVNode("option",{value:"PUT"},"PUT",-1),e.createElementVNode("option",{value:"DELETE"},"DELETE",-1)])],40,Hn)]),e.createElementVNode("div",Jn,[o[36]||(o[36]=e.createElementVNode("label",null,"请求头",-1)),e.createElementVNode("input",{type:"text",value:t.value.headers||"",onInput:o[8]||(o[8]=u=>d("headers",u)),placeholder:"JSON格式"},null,40,qn)]),e.createElementVNode("div",Yn,[o[37]||(o[37]=e.createElementVNode("label",null,"请求体",-1)),e.createElementVNode("input",{type:"text",value:t.value.body||"",onInput:o[9]||(o[9]=u=>d("body",u)),placeholder:"POST/PUT请求的数据"},null,40,Xn)]),e.createElementVNode("div",Kn,[o[38]||(o[38]=e.createElementVNode("label",null,"数据路径",-1)),e.createElementVNode("input",{type:"text",value:t.value.dataPath||"",onInput:o[10]||(o[10]=u=>d("dataPath",u)),placeholder:"例如: data.value"},null,40,Zn)]),e.createElementVNode("div",Qn,[o[39]||(o[39]=e.createElementVNode("label",null,"轮询间隔(ms)",-1)),e.createElementVNode("input",{type:"number",value:t.value.pollInterval||5e3,onInput:o[11]||(o[11]=u=>d("pollInterval",u)),min:"1000",step:"1000"},null,40,el)])])):e.createCommentVNode("",!0),t.value.type==="sse"?(e.openBlock(),e.createElementBlock("div",tl,[o[46]||(o[46]=e.createElementVNode("h4",null,"SSE配置",-1)),e.createElementVNode("div",ol,[o[41]||(o[41]=e.createElementVNode("label",null,"服务地址",-1)),e.createElementVNode("input",{type:"text",value:t.value.sseUrl||"",onInput:o[12]||(o[12]=u=>d("sseUrl",u)),placeholder:"https://api.example.com/events"},null,40,nl)]),e.createElementVNode("div",ll,[o[42]||(o[42]=e.createElementVNode("label",null,"事件类型",-1)),e.createElementVNode("input",{type:"text",value:t.value.eventType||"",onInput:o[13]||(o[13]=u=>d("eventType",u)),placeholder:"留空表示所有事件"},null,40,al)]),e.createElementVNode("div",sl,[o[43]||(o[43]=e.createElementVNode("label",null,"请求头",-1)),e.createElementVNode("input",{type:"text",value:t.value.headers||"",onInput:o[14]||(o[14]=u=>d("headers",u)),placeholder:"JSON格式"},null,40,il)]),e.createElementVNode("div",rl,[o[44]||(o[44]=e.createElementVNode("label",null,"数据路径",-1)),e.createElementVNode("input",{type:"text",value:t.value.dataPath||"",onInput:o[15]||(o[15]=u=>d("dataPath",u)),placeholder:"例如: data.value"},null,40,dl)]),e.createElementVNode("div",cl,[o[45]||(o[45]=e.createElementVNode("label",null,"自动重连",-1)),e.createElementVNode("div",pl,[e.createElementVNode("input",{type:"checkbox",checked:t.value.autoReconnect!==!1,onChange:o[16]||(o[16]=u=>c("autoReconnect",u))},null,40,ml),e.createElementVNode("span",ul,e.toDisplayString(t.value.autoReconnect!==!1?"是":"否"),1)])])])):e.createCommentVNode("",!0),t.value.type==="websocket"?(e.openBlock(),e.createElementBlock("div",gl,[o[50]||(o[50]=e.createElementVNode("h4",null,"WebSocket配置",-1)),e.createElementVNode("div",fl,[o[47]||(o[47]=e.createElementVNode("label",null,"服务地址",-1)),e.createElementVNode("input",{type:"text",value:t.value.wsUrl||"",onInput:o[17]||(o[17]=u=>d("wsUrl",u)),placeholder:"ws://localhost:8080"},null,40,El)]),e.createElementVNode("div",yl,[o[48]||(o[48]=e.createElementVNode("label",null,"订阅主题",-1)),e.createElementVNode("input",{type:"text",value:t.value.topic||"",onInput:o[18]||(o[18]=u=>d("topic",u)),placeholder:"例如: device/status"},null,40,bl)]),e.createElementVNode("div",Nl,[o[49]||(o[49]=e.createElementVNode("label",null,"数据路径",-1)),e.createElementVNode("input",{type:"text",value:t.value.dataPath||"",onInput:o[19]||(o[19]=u=>d("dataPath",u)),placeholder:"例如: payload.value"},null,40,hl)])])):e.createCommentVNode("",!0),t.value.type==="static"?(e.openBlock(),e.createElementBlock("div",Vl,[o[54]||(o[54]=e.createElementVNode("h4",null,"静态数据配置",-1)),e.createElementVNode("div",kl,[o[51]||(o[51]=e.createElementVNode("label",null,"数据值",-1)),e.createElementVNode("input",{type:"text",value:t.value.value||"",onInput:o[20]||(o[20]=u=>d("value",u)),placeholder:"请输入数据值"},null,40,Cl)]),e.createElementVNode("div",$l,[o[53]||(o[53]=e.createElementVNode("label",null,"数据类型",-1)),e.createElementVNode("select",{value:t.value.valueType||"string",onChange:o[21]||(o[21]=u=>d("valueType",u))},[...o[52]||(o[52]=[e.createElementVNode("option",{value:"string"},"字符串",-1),e.createElementVNode("option",{value:"number"},"数字",-1),e.createElementVNode("option",{value:"boolean"},"布尔值",-1),e.createElementVNode("option",{value:"json"},"JSON对象",-1)])],40,vl)])])):e.createCommentVNode("",!0),t.value.type!=="none"?(e.openBlock(),e.createElementBlock("div",wl,[o[57]||(o[57]=e.createElementVNode("h4",null,"通用配置",-1)),e.createElementVNode("div",Bl,[o[55]||(o[55]=e.createElementVNode("label",null,"启用状态",-1)),e.createElementVNode("div",Sl,[e.createElementVNode("input",{type:"checkbox",checked:t.value.enabled!==!1,onChange:p},null,40,_l),e.createElementVNode("span",xl,e.toDisplayString(t.value.enabled!==!1?"启用":"禁用"),1)])]),e.createElementVNode("div",Il,[o[56]||(o[56]=e.createElementVNode("label",null,"错误重试",-1)),e.createElementVNode("input",{type:"number",value:t.value.retryCount||3,onInput:o[22]||(o[22]=u=>d("retryCount",u)),min:"0",max:"10"},null,40,Dl)])])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-5b515f8a"]]),Pl={class:"edge-properties-tab"},Al={class:"property-section"},Ml={class:"property-item"},zl={class:"color-input-wrapper"},Ol=["value"],Ul=["value"],Rl={class:"property-item"},Ll={class:"number-input-wrapper"},Wl=["value"],Fl={class:"property-item"},jl=["value"],Gl={class:"property-item"},Hl={class:"slider-wrapper"},Jl=["value"],ql={class:"slider-value"},Yl={class:"property-item"},Xl=["value"],Kl={key:0,class:"property-item"},Zl={class:"number-input-wrapper"},Ql=["value"],ea={class:"property-section"},ta={class:"property-item"},oa=["value"],na={class:"property-item"},la=["value"],aa={class:"property-section"},sa={class:"property-item"},ia=["value"],ra={class:"property-item"},da=["value"],ca=H(e.defineComponent({__name:"EdgePropertiesTab",props:{selectedEdge:{}},emits:["updateEdge","deleteEdge"],setup(i,{emit:l}){const n=i,r=l,t=e.computed(()=>{var V;return((V=n.selectedEdge)==null?void 0:V.getAttrs())||{}}),s=V=>{const y=V.target.value;r("updateEdge",{attrs:{line:{stroke:y}}})},d=V=>{const y=Number(V.target.value);r("updateEdge",{attrs:{line:{strokeWidth:y}}})},c=()=>{var y;const V=(y=t.value.line)==null?void 0:y.strokeDasharray;return V?V==="5,5"?"5,5":V==="2,2"?"2,2":V==="10,5,2,5"?"10,5,2,5":"none":"none"},p=V=>{const y=V.target.value;r("updateEdge",{attrs:{line:{strokeDasharray:y==="none"?void 0:y}}})},g=V=>{const y=Number(V.target.value);r("updateEdge",{attrs:{line:{opacity:y}}})},a=V=>{var D;const y=(D=t.value.line)==null?void 0:D[`${V}Marker`];return!y||typeof y!="object"||!y.name?"none":y.name},o=()=>{var D;const V=(D=t.value.line)==null?void 0:D.opacity;return((V!==void 0&&typeof V=="number"?V:1)*100).toFixed(0)},u=V=>{const y=V.target.value;r("updateEdge",{attrs:{line:{sourceMarker:y==="none"?void 0:{name:y,width:8,height:6}}}})},f=V=>{const y=V.target.value;r("updateEdge",{attrs:{line:{targetMarker:y==="none"?void 0:{name:y,width:8,height:6}}}})},b=V=>{const y=V.target.value;r("updateEdge",{router:y})},S=V=>{const y=V.target.value;r("updateEdge",{connector:{name:y,args:y==="rounded"?{radius:8}:void 0}})},F=()=>{r("deleteEdge")},z=()=>{var y,D;const V=(D=(y=n.selectedEdge)==null?void 0:y.data)==null?void 0:D.animation;return V!=null&&V.enabled?"true":"false"},h=()=>{var y,D;const V=(D=(y=n.selectedEdge)==null?void 0:y.data)==null?void 0:D.animation;return V!=null&&V.duration?V.duration/1e3:2},N=V=>{if(!(V.target.value==="true"))r("updateEdge",{data:{animation:{enabled:!1}},animation:{enabled:!1}});else{const D=h()*1e3;r("updateEdge",{data:{animation:{enabled:!0,duration:D}},animation:{enabled:!0,duration:D}})}},E=V=>{const D=Number(V.target.value)*1e3;r("updateEdge",{data:{animation:{enabled:!0,duration:D}},animation:{enabled:!0,duration:D}})};return(V,y)=>{var D,O,A,w,B,T,K,te;return e.openBlock(),e.createElementBlock("div",Pl,[e.createElementVNode("div",Al,[y[10]||(y[10]=e.createElementVNode("h4",{class:"section-title"},"线条样式",-1)),e.createElementVNode("div",Ml,[y[0]||(y[0]=e.createElementVNode("label",{class:"property-label"},"线条颜色",-1)),e.createElementVNode("div",zl,[e.createElementVNode("input",{type:"color",class:"color-input",value:((D=t.value.line)==null?void 0:D.stroke)||"#10b981",onInput:s},null,40,Ol),e.createElementVNode("input",{type:"text",class:"color-text",value:((O=t.value.line)==null?void 0:O.stroke)||"#10b981",onInput:s},null,40,Ul)])]),e.createElementVNode("div",Rl,[y[2]||(y[2]=e.createElementVNode("label",{class:"property-label"},"线条粗细",-1)),e.createElementVNode("div",Ll,[e.createElementVNode("input",{type:"number",class:"property-input",min:"1",max:"20",step:"1",value:((A=t.value.line)==null?void 0:A.strokeWidth)||2,onInput:d},null,40,Wl),y[1]||(y[1]=e.createElementVNode("span",{class:"input-unit"},"px",-1))])]),e.createElementVNode("div",Fl,[y[4]||(y[4]=e.createElementVNode("label",{class:"property-label"},"线条样式",-1)),e.createElementVNode("select",{class:"property-select",value:c(),onChange:p},[...y[3]||(y[3]=[e.createElementVNode("option",{value:"none"},"实线",-1),e.createElementVNode("option",{value:"5,5"},"虚线",-1),e.createElementVNode("option",{value:"2,2"},"点线",-1),e.createElementVNode("option",{value:"10,5,2,5"},"点划线",-1)])],40,jl)]),e.createElementVNode("div",Gl,[y[5]||(y[5]=e.createElementVNode("label",{class:"property-label"},"透明度",-1)),e.createElementVNode("div",Hl,[e.createElementVNode("input",{type:"range",class:"property-slider",min:"0",max:"1",step:"0.1",value:((w=t.value.line)==null?void 0:w.opacity)!==void 0?t.value.line.opacity:1,onInput:g},null,40,Jl),e.createElementVNode("span",ql,e.toDisplayString(o())+"%",1)])]),e.createElementVNode("div",Yl,[y[7]||(y[7]=e.createElementVNode("label",{class:"property-label"},"流动动画",-1)),e.createElementVNode("select",{class:"property-select",value:z(),onChange:N},[...y[6]||(y[6]=[e.createElementVNode("option",{value:"false"},"关闭",-1),e.createElementVNode("option",{value:"true"},"开启",-1)])],40,Xl)]),z()==="true"?(e.openBlock(),e.createElementBlock("div",Kl,[y[9]||(y[9]=e.createElementVNode("label",{class:"property-label"},"动画速度",-1)),e.createElementVNode("div",Zl,[e.createElementVNode("input",{type:"number",class:"property-input",min:"0.5",max:"10",step:"0.5",value:h(),onInput:E},null,40,Ql),y[8]||(y[8]=e.createElementVNode("span",{class:"input-unit"},"秒",-1))])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",ea,[y[15]||(y[15]=e.createElementVNode("h4",{class:"section-title"},"箭头样式",-1)),e.createElementVNode("div",ta,[y[12]||(y[12]=e.createElementVNode("label",{class:"property-label"},"起点箭头",-1)),e.createElementVNode("select",{class:"property-select",value:a("source"),onChange:u},[...y[11]||(y[11]=[e.createStaticVNode('<option value="none" data-v-e47f1784>无</option><option value="block" data-v-e47f1784>实心箭头</option><option value="classic" data-v-e47f1784>经典箭头</option><option value="diamond" data-v-e47f1784>菱形</option><option value="circle" data-v-e47f1784>圆形</option>',5)])],40,oa)]),e.createElementVNode("div",na,[y[14]||(y[14]=e.createElementVNode("label",{class:"property-label"},"终点箭头",-1)),e.createElementVNode("select",{class:"property-select",value:a("target"),onChange:f},[...y[13]||(y[13]=[e.createStaticVNode('<option value="none" data-v-e47f1784>无</option><option value="block" data-v-e47f1784>实心箭头</option><option value="classic" data-v-e47f1784>经典箭头</option><option value="diamond" data-v-e47f1784>菱形</option><option value="circle" data-v-e47f1784>圆形</option>',5)])],40,la)])]),e.createElementVNode("div",aa,[y[20]||(y[20]=e.createElementVNode("h4",{class:"section-title"},"连接器",-1)),e.createElementVNode("div",sa,[y[17]||(y[17]=e.createElementVNode("label",{class:"property-label"},"路由方式",-1)),e.createElementVNode("select",{class:"property-select",value:((T=(B=i.selectedEdge)==null?void 0:B.getRouter())==null?void 0:T.name)||"manhattan",onChange:b},[...y[16]||(y[16]=[e.createElementVNode("option",{value:"manhattan"},"曼哈顿",-1),e.createElementVNode("option",{value:"orth"},"正交",-1),e.createElementVNode("option",{value:"normal"},"直线",-1)])],40,ia)]),e.createElementVNode("div",ra,[y[19]||(y[19]=e.createElementVNode("label",{class:"property-label"},"连接器类型",-1)),e.createElementVNode("select",{class:"property-select",value:((te=(K=i.selectedEdge)==null?void 0:K.getConnector())==null?void 0:te.name)||"rounded",onChange:S},[...y[18]||(y[18]=[e.createElementVNode("option",{value:"rounded"},"圆角",-1),e.createElementVNode("option",{value:"smooth"},"平滑",-1),e.createElementVNode("option",{value:"normal"},"普通",-1)])],40,da)])]),e.createElementVNode("div",{class:"property-section"},[e.createElementVNode("button",{class:"delete-btn",onClick:F}," 删除连线 ")])])}}}),[["__scopeId","data-v-e47f1784"]]),pa={class:"event-card"},ma={class:"header-left"},ua={class:"collapse-icon"},ga={class:"event-title"},fa={class:"event-card-body"},Ea={class:"event-field"},ya=["value"],ba={class:"event-field"},Na=["value"],ha={class:"event-field"},Va=["value"],ka={class:"condition-config"},Ca=["value"],$a=["value"],va=["value"],wa=["value"],Ba={key:0,class:"config-section"},Sa={key:1,class:"config-section"},_a={key:2,class:"config-section"},xa={key:0,class:"selected-workflow-info"},Ia={class:"info-row"},Da={class:"info-value"},Ta={class:"event-field"},Pa=["value"],Ie=H(e.defineComponent({__name:"EventCard",props:{event:{},index:{},isCollapsed:{type:Boolean},nodeProperties:{}},emits:["toggle-collapse","remove","update-field","update-condition","update-params","open-attribute-config","open-custom-code","open-workflow-selector"],setup(i){return(l,n)=>{var r,t,s,d,c,p,g;return e.openBlock(),e.createElementBlock("div",pa,[e.createElementVNode("div",{class:"event-card-header",onClick:n[1]||(n[1]=a=>l.$emit("toggle-collapse"))},[e.createElementVNode("div",ma,[e.createElementVNode("span",ua,e.toDisplayString(i.isCollapsed?"▶":"▼"),1),e.createElementVNode("span",ga,"事件"+e.toDisplayString(i.index+1),1)]),e.createElementVNode("button",{class:"btn-remove",onClick:n[0]||(n[0]=e.withModifiers(a=>l.$emit("remove"),["stop"])),title:"删除事件"},"🗑")]),e.withDirectives(e.createElementVNode("div",fa,[e.createElementVNode("div",Ea,[n[12]||(n[12]=e.createElementVNode("label",null,"事件名称",-1)),e.createElementVNode("input",{type:"text",value:i.event.name||"",onInput:n[2]||(n[2]=a=>l.$emit("update-field","name",a)),placeholder:"输入事件名称,如:温度报警、湿度预警"},null,40,ya)]),e.createElementVNode("div",ba,[n[14]||(n[14]=e.createElementVNode("label",null,"事件类型",-1)),e.createElementVNode("select",{value:i.event.type,onChange:n[3]||(n[3]=a=>l.$emit("update-field","type",a))},[...n[13]||(n[13]=[e.createStaticVNode('<option value="click" data-v-af7c633a>单击</option><option value="dblclick" data-v-af7c633a>双击</option><option value="mouseenter" data-v-af7c633a>鼠标移入</option><option value="mouseleave" data-v-af7c633a>鼠标移出</option><option value="focus" data-v-af7c633a>获取焦点</option><option value="blur" data-v-af7c633a>失去焦点</option><option value="input" data-v-af7c633a>输入</option><option value="change" data-v-af7c633a>值变化</option>',8)])],40,Na)]),e.createElementVNode("div",ha,[n[16]||(n[16]=e.createElementVNode("label",null,"事件行为",-1)),e.createElementVNode("select",{value:i.event.action,onChange:n[4]||(n[4]=a=>l.$emit("update-field","action",a))},[...n[15]||(n[15]=[e.createElementVNode("option",{value:"attributeChange"},"更改属性",-1),e.createElementVNode("option",{value:"customCode"},"自定义代码",-1),e.createElementVNode("option",{value:"callProcess"},"调用流程",-1)])],40,Va)]),n[30]||(n[30]=e.createElementVNode("div",{class:"section-title"},"形参配置",-1)),n[31]||(n[31]=e.createElementVNode("div",{class:"field-hint"},"(不填直接触发)",-1)),n[32]||(n[32]=e.createElementVNode("div",{class:"section-title"},"触发规则",-1)),n[33]||(n[33]=e.createElementVNode("div",{class:"field-hint"},"(不填写条件则直接触发,填写后按条件触发)",-1)),e.createElementVNode("div",ka,[n[19]||(n[19]=e.createElementVNode("div",{class:"condition-label"},"当",-1)),n[20]||(n[20]=e.createElementVNode("div",{class:"condition-label"},"当前节点属性",-1)),e.createElementVNode("select",{class:"condition-select",value:((r=i.event.condition)==null?void 0:r.attribute)||"",onChange:n[5]||(n[5]=a=>l.$emit("update-condition","attribute",a))},[n[17]||(n[17]=e.createElementVNode("option",{value:""},"选择属性",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.nodeProperties,a=>(e.openBlock(),e.createElementBlock("option",{key:a.key,value:a.key},e.toDisplayString(a.label),9,$a))),128))],40,Ca),n[21]||(n[21]=e.createElementVNode("div",{class:"condition-label"},"运算符",-1)),e.createElementVNode("select",{class:"condition-select",value:((t=i.event.condition)==null?void 0:t.operator)||"==",onChange:n[6]||(n[6]=a=>l.$emit("update-condition","operator",a))},[...n[18]||(n[18]=[e.createStaticVNode('<option value="==" data-v-af7c633a>等于</option><option value="!=" data-v-af7c633a>不等于</option><option value=">" data-v-af7c633a>大于</option><option value=">=" data-v-af7c633a>大于等于</option><option value="<" data-v-af7c633a>小于</option><option value="<=" data-v-af7c633a>小于等于</option><option value="contains" data-v-af7c633a>包含</option>',7)])],40,va),n[22]||(n[22]=e.createElementVNode("div",{class:"condition-label"},"值",-1)),e.createElementVNode("input",{type:"text",class:"condition-input",value:((s=i.event.condition)==null?void 0:s.value)||"",onInput:n[7]||(n[7]=a=>l.$emit("update-condition","value",a)),placeholder:"输入值"},null,40,wa),n[23]||(n[23]=e.createElementVNode("div",{class:"condition-label"},"时",-1)),n[24]||(n[24]=e.createElementVNode("div",{class:"condition-label"},"触发该事件",-1))]),i.event.action==="attributeChange"?(e.openBlock(),e.createElementBlock("div",Ba,[n[25]||(n[25]=e.createElementVNode("div",{class:"section-title"},"属性更改",-1)),e.createElementVNode("button",{class:"btn-config",onClick:n[8]||(n[8]=a=>l.$emit("open-attribute-config"))},"点击配置")])):e.createCommentVNode("",!0),i.event.action==="customCode"?(e.openBlock(),e.createElementBlock("div",Sa,[n[26]||(n[26]=e.createElementVNode("div",{class:"section-title"},"自定义代码",-1)),e.createElementVNode("button",{class:"btn-config",onClick:n[9]||(n[9]=a=>l.$emit("open-custom-code"))},"点击配置")])):e.createCommentVNode("",!0),i.event.action==="callProcess"?(e.openBlock(),e.createElementBlock("div",_a,[n[29]||(n[29]=e.createElementVNode("div",{class:"section-title"},"调用流程",-1)),e.createElementVNode("button",{class:"btn-config",onClick:n[10]||(n[10]=a=>l.$emit("open-workflow-selector"))},"选择流程"),(d=i.event.params)!=null&&d.processId?(e.openBlock(),e.createElementBlock("div",xa,[e.createElementVNode("div",Ia,[n[27]||(n[27]=e.createElementVNode("span",{class:"info-label"},"已选择:",-1)),e.createElementVNode("span",Da,e.toDisplayString(((c=i.event.params)==null?void 0:c.processName)||((p=i.event.params)==null?void 0:p.processId)),1)]),e.createElementVNode("div",Ta,[n[28]||(n[28]=e.createElementVNode("label",null,"传入参数",-1)),e.createElementVNode("textarea",{value:((g=i.event.params)==null?void 0:g.processParams)||"",onInput:n[11]||(n[11]=a=>l.$emit("update-params","processParams",a)),placeholder:'JSON格式: {"param1":"value1","param2":"value2"}',rows:"3"},null,40,Pa)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],512),[[e.vShow,!i.isCollapsed]])])}}}),[["__scopeId","data-v-af7c633a"]]);var Z=(i=>(i.BOOLEAN="boolean",i.NUMBER="number",i.STRING="string",i))(Z||{}),Q=(i=>(i.READ="read",i.WRITE="write",i.READ_WRITE="readWrite",i))(Q||{}),ge=(i=>(i.ONLINE="online",i.OFFLINE="offline",i.ERROR="error",i.MAINTENANCE="maintenance",i))(ge||{}),fe=(i=>(i.PLC="plc",i.SENSOR="sensor",i.ACTUATOR="actuator",i.METER="meter",i.CAMERA="camera",i.OTHER="other",i))(fe||{});const De=[{id:"device_001",name:"1号温控设备",code:"TC-001",type:fe.PLC,description:"车间1号温控PLC",status:ge.ONLINE,ipAddress:"192.168.1.101",port:502,protocol:"Modbus TCP",enabled:!0,tags:["车间1","温控","PLC"],points:[{id:"point_001_01",name:"当前温度",code:"40001",description:"实时温度采集",dataType:Z.NUMBER,accessMode:Q.READ,value:25.5,unit:"°C",minValue:-20,maxValue:100,precision:1,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_001_02",name:"设定温度",code:"40002",description:"目标温度设定值",dataType:Z.NUMBER,accessMode:Q.READ_WRITE,value:28,unit:"°C",minValue:0,maxValue:50,precision:1,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_001_03",name:"加热状态",code:"40003",description:"加热器运行状态",dataType:Z.BOOLEAN,accessMode:Q.READ,value:!0,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_001_04",name:"告警状态",code:"40004",description:"设备告警状态",dataType:Z.BOOLEAN,accessMode:Q.READ,value:!1,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"}],createTime:"2025-01-01 00:00:00",updateTime:"2025-12-17 08:15:00"},{id:"device_002",name:"主管道压力传感器",code:"PS-001",type:fe.SENSOR,description:"主管道压力监测",status:ge.ONLINE,ipAddress:"192.168.1.102",port:502,protocol:"Modbus TCP",enabled:!0,tags:["管道","压力","传感器"],points:[{id:"point_002_01",name:"当前压力",code:"40001",description:"实时压力值",dataType:Z.NUMBER,accessMode:Q.READ,value:1.25,unit:"MPa",minValue:0,maxValue:5,precision:2,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_002_02",name:"压力上限",code:"40002",description:"压力告警上限",dataType:Z.NUMBER,accessMode:Q.READ_WRITE,value:2,unit:"MPa",minValue:0,maxValue:5,precision:2,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_002_03",name:"压力下限",code:"40003",description:"压力告警下限",dataType:Z.NUMBER,accessMode:Q.READ_WRITE,value:.5,unit:"MPa",minValue:0,maxValue:5,precision:2,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"}],createTime:"2025-01-01 00:00:00",updateTime:"2025-12-17 08:15:00"},{id:"device_003",name:"1号电机控制器",code:"MC-001",type:fe.ACTUATOR,description:"主传送带电机控制",status:ge.ONLINE,ipAddress:"192.168.1.103",port:502,protocol:"Modbus TCP",enabled:!0,tags:["电机","控制器","传送带"],points:[{id:"point_003_01",name:"运行状态",code:"40001",description:"电机运行状态",dataType:Z.BOOLEAN,accessMode:Q.READ,value:!0,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_003_02",name:"启动命令",code:"40002",description:"电机启动控制",dataType:Z.BOOLEAN,accessMode:Q.WRITE,value:!1,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_003_03",name:"停止命令",code:"40003",description:"电机停止控制",dataType:Z.BOOLEAN,accessMode:Q.WRITE,value:!1,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_003_04",name:"当前转速",code:"40004",description:"电机实时转速",dataType:Z.NUMBER,accessMode:Q.READ,value:1450,unit:"RPM",minValue:0,maxValue:3e3,precision:0,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_003_05",name:"设定转速",code:"40005",description:"目标转速设定",dataType:Z.NUMBER,accessMode:Q.READ_WRITE,value:1500,unit:"RPM",minValue:0,maxValue:3e3,precision:0,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_003_06",name:"电流",code:"40006",description:"电机运行电流",dataType:Z.NUMBER,accessMode:Q.READ,value:12.5,unit:"A",minValue:0,maxValue:50,precision:1,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"}],createTime:"2025-01-01 00:00:00",updateTime:"2025-12-17 08:15:00"},{id:"device_004",name:"进水流量计",code:"FM-001",type:fe.METER,description:"进水管道流量监测",status:ge.OFFLINE,ipAddress:"192.168.1.104",port:502,protocol:"Modbus TCP",enabled:!0,tags:["流量","仪表","进水"],points:[{id:"point_004_01",name:"瞬时流量",code:"40001",description:"当前流量值",dataType:Z.NUMBER,accessMode:Q.READ,value:0,unit:"m³/h",minValue:0,maxValue:100,precision:2,enabled:!0,quality:"bad",updateTime:"2025-12-17 07:30:00"},{id:"point_004_02",name:"累计流量",code:"40002",description:"累计流量统计",dataType:Z.NUMBER,accessMode:Q.READ,value:12345.67,unit:"m³",minValue:0,maxValue:999999,precision:2,enabled:!0,quality:"bad",updateTime:"2025-12-17 07:30:00"}],createTime:"2025-01-01 00:00:00",updateTime:"2025-12-17 07:30:00"}];De.length;const Ze=i=>De.find(l=>l.id===i),Aa=(i,l)=>{const n=Ze(i);if(n)return n.points.find(r=>r.id===l)},Ma={class:"device-point-selector"},za={class:"device-list-panel"},Oa={class:"panel-header"},Ua={class:"device-count"},Ra={class:"search-box"},La={class:"device-list"},Wa=["onClick"],Fa={class:"device-info"},ja={class:"device-name"},Ga={class:"device-meta"},Ha={class:"device-code"},Ja={class:"point-count"},qa={key:0,class:"empty-hint"},Ya={class:"point-list-panel"},Xa={class:"panel-header"},Ka={key:0,class:"point-count"},Za={key:0,class:"search-box"},Qa={class:"point-list"},es={key:0,class:"empty-hint"},ts={key:1,class:"empty-hint"},os=["onClick"],ns={class:"point-info"},ls={class:"point-name"},as={class:"point-meta"},ss={class:"point-code"},is={key:0,class:"point-unit"},rs={class:"point-type"},ds={key:0,class:"point-value"},cs={class:"value"},ps={class:"modal-footer"},ms=["disabled"],us=H(e.defineComponent({__name:"DevicePointSelector",props:{visible:{type:Boolean},modelValue:{}},emits:["update:visible","update:modelValue","confirm"],setup(i,{emit:l}){const n=i,r=l,t=e.ref(De),s=e.ref(null),d=e.ref(null),c=e.ref(""),p=e.ref("");if(n.modelValue){const[h,N]=n.modelValue.split(":"),E=t.value.find(V=>V.id===h);E&&(s.value=E,d.value=E.points.find(V=>V.id===N)||null)}const g=e.computed(()=>{if(!c.value)return t.value;const h=c.value.toLowerCase();return t.value.filter(N=>N.name.toLowerCase().includes(h)||N.code.toLowerCase().includes(h))}),a=e.computed(()=>{if(!s.value)return[];if(!p.value)return s.value.points;const h=p.value.toLowerCase();return s.value.points.filter(N=>N.name.toLowerCase().includes(h)||N.code.toLowerCase().includes(h))}),o=h=>{s.value=h,d.value=null,p.value=""},u=h=>{h.enabled&&(d.value=h)},f=()=>{r("update:visible",!1)},b=()=>{if(!s.value||!d.value)return;const h=`${s.value.id}:${d.value.id}`;r("update:modelValue",h),r("confirm",s.value.id,d.value.id,s.value,d.value),r("update:visible",!1)},S=h=>({read:"只读",write:"只写",readWrite:"读写"})[h]||h,F=h=>({boolean:"布尔",number:"数值",string:"字符",json:"JSON"})[h]||h,z=h=>h.value===void 0||h.value===null?"-":h.dataType==="boolean"?h.value?"是":"否":h.dataType==="number"&&h.precision!==void 0?Number(h.value).toFixed(h.precision):String(h.value);return(h,N)=>i.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal-overlay",onClick:f},[e.createElementVNode("div",{class:"modal-container",onClick:N[2]||(N[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"modal-header"},[N[3]||(N[3]=e.createElementVNode("h3",null,"选择设备点位",-1)),e.createElementVNode("button",{class:"btn-close",onClick:f},"✕")]),e.createElementVNode("div",Ma,[e.createElementVNode("div",za,[e.createElementVNode("div",Oa,[N[4]||(N[4]=e.createElementVNode("h4",null,"设备列表",-1)),e.createElementVNode("span",Ua,e.toDisplayString(t.value.length),1)]),e.createElementVNode("div",Ra,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":N[0]||(N[0]=E=>c.value=E),type:"text",placeholder:"搜索设备...",class:"search-input"},null,512),[[e.vModelText,c.value]])]),e.createElementVNode("div",La,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,E=>{var V;return e.openBlock(),e.createElementBlock("div",{key:E.id,class:e.normalizeClass(["device-item",{active:((V=s.value)==null?void 0:V.id)===E.id,offline:E.status==="offline"}]),onClick:y=>o(E)},[e.createElementVNode("div",Fa,[e.createElementVNode("div",ja,[e.createElementVNode("span",{class:e.normalizeClass(["status-dot",E.status])},null,2),e.createTextVNode(" "+e.toDisplayString(E.name),1)]),e.createElementVNode("div",Ga,[e.createElementVNode("span",Ha,e.toDisplayString(E.code),1),e.createElementVNode("span",Ja,e.toDisplayString(E.points.length)+" 点",1)])]),N[5]||(N[5]=e.createElementVNode("div",{class:"device-arrow"},"›",-1))],10,Wa)}),128)),g.value.length===0?(e.openBlock(),e.createElementBlock("div",qa," 暂无设备 ")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Ya,[e.createElementVNode("div",Xa,[e.createElementVNode("h4",null,e.toDisplayString(s.value?s.value.name:"点位列表"),1),s.value?(e.openBlock(),e.createElementBlock("span",Ka,e.toDisplayString(a.value.length),1)):e.createCommentVNode("",!0)]),s.value?(e.openBlock(),e.createElementBlock("div",Za,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":N[1]||(N[1]=E=>p.value=E),type:"text",placeholder:"搜索点位...",class:"search-input"},null,512),[[e.vModelText,p.value]])])):e.createCommentVNode("",!0),e.createElementVNode("div",Qa,[s.value?a.value.length===0?(e.openBlock(),e.createElementBlock("div",ts," 暂无点位 ")):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(a.value,E=>{var V;return e.openBlock(),e.createElementBlock("div",{key:E.id,class:e.normalizeClass(["point-item",{active:((V=d.value)==null?void 0:V.id)===E.id,disabled:!E.enabled}]),onClick:y=>u(E)},[e.createElementVNode("div",ns,[e.createElementVNode("div",ls,[e.createTextVNode(e.toDisplayString(E.name)+" ",1),e.createElementVNode("span",{class:e.normalizeClass(["access-mode",E.accessMode])},e.toDisplayString(S(E.accessMode)),3)]),e.createElementVNode("div",as,[e.createElementVNode("span",ss,e.toDisplayString(E.code),1),E.unit?(e.openBlock(),e.createElementBlock("span",is,e.toDisplayString(E.unit),1)):e.createCommentVNode("",!0),e.createElementVNode("span",rs,e.toDisplayString(F(E.dataType)),1)]),E.value!==void 0?(e.openBlock(),e.createElementBlock("div",ds,[N[6]||(N[6]=e.createTextVNode(" 当前值: ",-1)),e.createElementVNode("span",cs,e.toDisplayString(z(E)),1),e.createElementVNode("span",{class:e.normalizeClass(["quality",E.quality])},e.toDisplayString(E.quality),3)])):e.createCommentVNode("",!0)])],10,os)}),128)):(e.openBlock(),e.createElementBlock("div",es," ← 请先选择设备 "))])])]),e.createElementVNode("div",ps,[e.createElementVNode("button",{class:"btn-cancel",onClick:f},"取消"),e.createElementVNode("button",{class:"btn-confirm",disabled:!d.value,onClick:b}," 确定 ",8,ms)])])])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-7884b850"]]);var ie=(i=>(i.DIRECT="direct",i.BOOLEAN="boolean",i.RANGE="range",i.ENUM="enum",i))(ie||{}),Ee=(i=>(i.BOOLEAN="boolean",i.NUMBER="number",i.STRING="string",i))(Ee||{});const gs={class:"mapping-configurator"},fs={class:"config-item"},Es={key:0,class:"field-hint error"},ys={key:1,class:"field-hint"},bs={class:"config-item"},Ns={key:0,class:"field-hint error"},hs={key:1,class:"field-hint"},Vs={key:0,class:"config-item"},ks={class:"unit-config"},Cs={class:"checkbox-label"},$s={key:0,class:"custom-unit"},vs={key:1,class:"mapping-details"},ws={class:"config-item"},Bs={class:"config-item"},Ss={key:2,class:"mapping-details"},_s={class:"range-rules"},xs=["onUpdate:modelValue"],Is=["onUpdate:modelValue"],Ds=["onUpdate:modelValue"],Ts=["onClick"],Ps={key:3,class:"mapping-details"},As={class:"enum-mappings"},Ms=["value","onInput"],zs=["onUpdate:modelValue"],Os=["onClick"],Us={key:4,class:"mapping-preview"},Rs={class:"preview-content"},Ls={class:"preview-item"},Ws={class:"preview-output"},Fs={class:"preview-item"},js={class:"preview-output"},Gs={class:"preview-input"},Hs={class:"preview-output"},Js={class:"preview-input"},qs={class:"preview-output"},Ys=H(e.defineComponent({__name:"MappingConfigurator",props:{visible:{type:Boolean},modelValue:{}},emits:["update:visible","update:modelValue","confirm"],setup(i,{emit:l}){const n=i,r=l,t=e.ref(n.modelValue||{type:"",valueType:""});e.watch(()=>n.modelValue,z=>{z&&(t.value={...z})},{deep:!0});const s=()=>{t.value.type||(t.value.valueType===Ee.BOOLEAN?t.value.type=ie.BOOLEAN:t.value.valueType===Ee.NUMBER?t.value.type=ie.RANGE:t.value.type=ie.DIRECT),t.value.valueType!==Ee.NUMBER&&(delete t.value.keepOriginalUnit,delete t.value.customUnit)},d=z=>({boolean:"适用于开关状态、是否判断等场景",number:"适用于温度、压力、流量等数值型数据",string:"适用于文本、状态码等字符型数据"})[z]||"",c=z=>({direct:"不做任何转换,直接使用原始值",boolean:"根据 true/false 转换为不同的值",range:"根据数值范围转换为对应值",enum:"根据枚举键值对转换"})[z]||"",p=()=>{const z=t.value.valueType;t.value={type:t.value.type,valueType:z},t.value.type===ie.RANGE?t.value.rangeRules=[]:t.value.type===ie.ENUM&&(t.value.enumMappings={})},g=()=>{t.value.rangeRules||(t.value.rangeRules=[]),t.value.rangeRules.push({min:0,max:100,value:""})},a=z=>{var h;(h=t.value.rangeRules)==null||h.splice(z,1)},o=()=>{t.value.enumMappings||(t.value.enumMappings={});const z=`key_${Object.keys(t.value.enumMappings).length+1}`;t.value.enumMappings[z]=""},u=z=>{t.value.enumMappings&&delete t.value.enumMappings[z]},f=(z,h)=>{const N=z.target.value;if(!t.value.enumMappings||N===h)return;const E=t.value.enumMappings[h];delete t.value.enumMappings[h],t.value.enumMappings[N]=E},b=()=>{},S=()=>{r("update:visible",!1)},F=()=>{if(!t.value.valueType){alert("请选择值类型!");return}if(!t.value.type){alert("请选择映射类型!");return}r("update:modelValue",{...t.value}),r("confirm",{...t.value}),r("update:visible",!1)};return(z,h)=>i.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal-overlay",onClick:S},[e.createElementVNode("div",{class:"modal-container",onClick:h[6]||(h[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"modal-header"},[h[7]||(h[7]=e.createElementVNode("h3",null,"值映射配置",-1)),e.createElementVNode("button",{class:"btn-close",onClick:S},"✕")]),e.createElementVNode("div",gs,[e.createElementVNode("div",fs,[h[9]||(h[9]=e.createElementVNode("label",null,[e.createTextVNode("值类型 "),e.createElementVNode("span",{class:"required"},"*")],-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":h[0]||(h[0]=N=>t.value.valueType=N),onChange:s},[...h[8]||(h[8]=[e.createElementVNode("option",{value:""},"请选择值类型",-1),e.createElementVNode("option",{value:"boolean"},"布尔型 (true/false)",-1),e.createElementVNode("option",{value:"number"},"数值型 (123, 45.6)",-1),e.createElementVNode("option",{value:"string"},'字符串型 ("abc")',-1)])],544),[[e.vModelSelect,t.value.valueType]]),t.value.valueType?(e.openBlock(),e.createElementBlock("div",ys,e.toDisplayString(d(t.value.valueType)),1)):(e.openBlock(),e.createElementBlock("div",Es," 值类型为必填项 "))]),e.createElementVNode("div",bs,[h[11]||(h[11]=e.createElementVNode("label",null,[e.createTextVNode("映射类型 "),e.createElementVNode("span",{class:"required"},"*")],-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":h[1]||(h[1]=N=>t.value.type=N),onChange:p},[...h[10]||(h[10]=[e.createStaticVNode('<option value="" data-v-ef9e0ee1>请选择映射类型</option><option value="direct" data-v-ef9e0ee1>直接映射(无转换)</option><option value="boolean" data-v-ef9e0ee1>布尔映射</option><option value="range" data-v-ef9e0ee1>范围映射</option><option value="enum" data-v-ef9e0ee1>枚举映射</option>',5)])],544),[[e.vModelSelect,t.value.type]]),t.value.type?(e.openBlock(),e.createElementBlock("div",hs,e.toDisplayString(c(t.value.type)),1)):(e.openBlock(),e.createElementBlock("div",Ns," 映射类型为必填项 "))]),t.value.valueType==="number"?(e.openBlock(),e.createElementBlock("div",Vs,[h[13]||(h[13]=e.createElementVNode("label",null,"单位配置",-1)),e.createElementVNode("div",ks,[e.createElementVNode("label",Cs,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":h[2]||(h[2]=N=>t.value.keepOriginalUnit=N),onChange:b},null,544),[[e.vModelCheckbox,t.value.keepOriginalUnit]]),h[12]||(h[12]=e.createTextVNode(" 保留点位原始单位 ",-1))]),t.value.keepOriginalUnit?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",$s,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[3]||(h[3]=N=>t.value.customUnit=N),type:"text",placeholder:"自定义单位,如: °C, MPa, %",onInput:b},null,544),[[e.vModelText,t.value.customUnit]])]))])])):e.createCommentVNode("",!0),t.value.type==="boolean"?(e.openBlock(),e.createElementBlock("div",vs,[e.createElementVNode("div",ws,[h[14]||(h[14]=e.createElementVNode("label",null,"True 时的值",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[4]||(h[4]=N=>t.value.trueValue=N),type:"text",placeholder:"例如: 运行、#00ff00",onInput:b},null,544),[[e.vModelText,t.value.trueValue]])]),e.createElementVNode("div",Bs,[h[15]||(h[15]=e.createElementVNode("label",null,"False 时的值",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[5]||(h[5]=N=>t.value.falseValue=N),type:"text",placeholder:"例如: 停止、#ff0000",onInput:b},null,544),[[e.vModelText,t.value.falseValue]])])])):e.createCommentVNode("",!0),t.value.type==="range"?(e.openBlock(),e.createElementBlock("div",Ss,[e.createElementVNode("div",_s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value.rangeRules,(N,E)=>(e.openBlock(),e.createElementBlock("div",{key:E,class:"range-rule"},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":V=>N.min=V,type:"number",placeholder:"最小值",onInput:b},null,40,xs),[[e.vModelText,N.min,void 0,{number:!0}]]),h[16]||(h[16]=e.createElementVNode("span",{class:"range-separator"},"~",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":V=>N.max=V,type:"number",placeholder:"最大值",onInput:b},null,40,Is),[[e.vModelText,N.max,void 0,{number:!0}]]),h[17]||(h[17]=e.createElementVNode("span",{class:"range-arrow"},"→",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":V=>N.value=V,type:"text",placeholder:"映射值",onInput:b},null,40,Ds),[[e.vModelText,N.value]]),e.createElementVNode("button",{class:"btn-remove-rule",onClick:V=>a(E),title:"删除规则"}," ✕ ",8,Ts)]))),128))]),e.createElementVNode("button",{class:"btn-add-rule",onClick:g}," + 添加范围规则 ")])):e.createCommentVNode("",!0),t.value.type==="enum"?(e.openBlock(),e.createElementBlock("div",Ps,[e.createElementVNode("div",As,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value.enumMappings,(N,E,V)=>(e.openBlock(),e.createElementBlock("div",{key:V,class:"enum-mapping"},[e.createElementVNode("input",{value:E,type:"text",placeholder:"原始值",onInput:y=>f(y,E)},null,40,Ms),h[18]||(h[18]=e.createElementVNode("span",{class:"enum-arrow"},"→",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y=>t.value.enumMappings[E]=y,type:"text",placeholder:"映射值",onInput:b},null,40,zs),[[e.vModelText,t.value.enumMappings[E]]]),e.createElementVNode("button",{class:"btn-remove-rule",onClick:y=>u(E),title:"删除映射"}," ✕ ",8,Os)]))),128))]),e.createElementVNode("button",{class:"btn-add-rule",onClick:o}," + 添加枚举映射 ")])):e.createCommentVNode("",!0),t.value.type!=="direct"?(e.openBlock(),e.createElementBlock("div",Us,[h[25]||(h[25]=e.createElementVNode("label",null,"映射预览",-1)),e.createElementVNode("div",Rs,[t.value.type==="boolean"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",Ls,[h[19]||(h[19]=e.createElementVNode("span",{class:"preview-input"},"true",-1)),h[20]||(h[20]=e.createElementVNode("span",{class:"preview-arrow"},"→",-1)),e.createElementVNode("span",Ws,e.toDisplayString(t.value.trueValue||"true"),1)]),e.createElementVNode("div",Fs,[h[21]||(h[21]=e.createElementVNode("span",{class:"preview-input"},"false",-1)),h[22]||(h[22]=e.createElementVNode("span",{class:"preview-arrow"},"→",-1)),e.createElementVNode("span",js,e.toDisplayString(t.value.falseValue||"false"),1)])],64)):t.value.type==="range"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.value.rangeRules,(N,E)=>(e.openBlock(),e.createElementBlock("div",{key:E,class:"preview-item"},[e.createElementVNode("span",Gs,"["+e.toDisplayString(N.min)+" ~ "+e.toDisplayString(N.max)+"]",1),h[23]||(h[23]=e.createElementVNode("span",{class:"preview-arrow"},"→",-1)),e.createElementVNode("span",Hs,e.toDisplayString(N.value),1)]))),128)):t.value.type==="enum"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(t.value.enumMappings,(N,E)=>(e.openBlock(),e.createElementBlock("div",{key:E,class:"preview-item"},[e.createElementVNode("span",Js,e.toDisplayString(E),1),h[24]||(h[24]=e.createElementVNode("span",{class:"preview-arrow"},"→",-1)),e.createElementVNode("span",qs,e.toDisplayString(N),1)]))),128)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:"modal-footer"},[e.createElementVNode("button",{class:"btn-cancel",onClick:S},"取消"),e.createElementVNode("button",{class:"btn-confirm",onClick:F},"确定")])])])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-ef9e0ee1"]]),Xs={class:"event-card"},Ks={class:"header-left"},Zs={class:"collapse-icon"},Qs={class:"event-title"},ei={class:"event-card-body"},ti={class:"property-item"},oi={key:0,class:"selected-point"},ni={class:"point-main"},li={class:"device-name"},ai={class:"point-name"},si={class:"point-details"},ii={class:"point-code"},ri={key:0,class:"point-unit"},di={key:1,class:"placeholder"},ci={class:"property-item"},pi=["value"],mi=["value"],ui={class:"property-item"},gi={key:0,class:"mapping-summary"},fi={class:"mapping-type-label"},Ei={class:"mapping-detail"},yi={key:1,class:"placeholder"},Te=H(e.defineComponent({__name:"BindingCard",props:{binding:{},index:{},isCollapsed:{type:Boolean},nodeProperties:{}},emits:["toggle-collapse","remove","update-field"],setup(i,{emit:l}){const n=i,r=l,t=e.ref(n.binding.devicePointId||""),s=e.ref(!1),d=e.ref(!1),c=e.ref(n.binding.mapping||{type:ie.DIRECT,valueType:Ee.NUMBER});e.watch(()=>n.binding.devicePointId,f=>{t.value=f||""}),e.watch(()=>n.binding.mapping,f=>{f&&(c.value=f)},{deep:!0});const p=e.computed(()=>{if(!t.value)return null;const[f,b]=t.value.split(":");if(!f||!b)return null;const S=Ze(f),F=S?Aa(f,b):null;return!S||!F?null:{deviceName:S.name,pointName:F.name,pointCode:F.code,pointUnit:F.unit}}),g=(f,b,S,F)=>{const z=new Event("change");Object.defineProperty(z,"target",{value:{value:`${f}:${b}`},writable:!1}),r("update-field","devicePointId",z),console.log("选择了点位:",{device:S.name,point:F.name,dataType:F.dataType,accessMode:F.accessMode})},a=f=>{const b=new Event("change");Object.defineProperty(b,"target",{value:{value:f},writable:!1}),r("update-field","mapping",b)},o=f=>({direct:"直接映射",boolean:"布尔映射",range:"范围映射",enum:"枚举映射"})[f]||f,u=()=>{const f=c.value;return f.type==="boolean"?`True:${f.trueValue||"true"} / False:${f.falseValue||"false"}`:f.type==="range"&&f.rangeRules?`${f.rangeRules.length} 个范围规则`:f.type==="enum"&&f.enumMappings?`${Object.keys(f.enumMappings).length} 个枚举映射`:""};return(f,b)=>(e.openBlock(),e.createElementBlock("div",Xs,[e.createElementVNode("div",{class:"event-card-header",onClick:b[1]||(b[1]=S=>f.$emit("toggle-collapse"))},[e.createElementVNode("div",Ks,[e.createElementVNode("span",Zs,e.toDisplayString(i.isCollapsed?"▶":"▼"),1),e.createElementVNode("span",Qs,"绑定"+e.toDisplayString(i.index+1),1)]),e.createElementVNode("button",{class:"btn-remove",onClick:b[0]||(b[0]=e.withModifiers(S=>f.$emit("remove"),["stop"])),title:"删除绑定"},"🗑")]),e.withDirectives(e.createElementVNode("div",ei,[e.createElementVNode("div",ti,[b[10]||(b[10]=e.createElementVNode("label",null,"设备点位",-1)),e.createElementVNode("div",{class:"point-selector-trigger",onClick:b[2]||(b[2]=S=>s.value=!0)},[p.value?(e.openBlock(),e.createElementBlock("div",oi,[e.createElementVNode("div",ni,[e.createElementVNode("span",li,e.toDisplayString(p.value.deviceName),1),e.createElementVNode("span",ai,e.toDisplayString(p.value.pointName),1)]),e.createElementVNode("div",si,[e.createElementVNode("span",ii,e.toDisplayString(p.value.pointCode),1),p.value.pointUnit?(e.openBlock(),e.createElementBlock("span",ri,e.toDisplayString(p.value.pointUnit),1)):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createElementBlock("div",di," 点击选择设备点位 ")),b[9]||(b[9]=e.createElementVNode("span",{class:"selector-arrow"},"›",-1))])]),e.createVNode(us,{visible:s.value,"onUpdate:visible":b[3]||(b[3]=S=>s.value=S),modelValue:t.value,"onUpdate:modelValue":b[4]||(b[4]=S=>t.value=S),onConfirm:g},null,8,["visible","modelValue"]),e.createElementVNode("div",ci,[b[12]||(b[12]=e.createElementVNode("label",null,"目标属性",-1)),e.createElementVNode("select",{value:i.binding.targetProperty||"",onChange:b[5]||(b[5]=S=>f.$emit("update-field","targetProperty",S))},[b[11]||(b[11]=e.createElementVNode("option",{value:""},"选择属性",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.nodeProperties,S=>(e.openBlock(),e.createElementBlock("option",{key:S.key,value:S.key},e.toDisplayString(S.label),9,mi))),128))],40,pi)]),e.createElementVNode("div",ui,[b[14]||(b[14]=e.createElementVNode("label",null,"值映射配置",-1)),e.createElementVNode("div",{class:"mapping-trigger",onClick:b[6]||(b[6]=S=>d.value=!0)},[c.value.type!=="direct"?(e.openBlock(),e.createElementBlock("div",gi,[e.createElementVNode("span",fi,e.toDisplayString(o(c.value.type)),1),e.createElementVNode("span",Ei,e.toDisplayString(u()),1)])):(e.openBlock(),e.createElementBlock("div",yi," 点击配置值映射 ")),b[13]||(b[13]=e.createElementVNode("span",{class:"selector-arrow"},"›",-1))])]),e.createVNode(Ys,{visible:d.value,"onUpdate:visible":b[7]||(b[7]=S=>d.value=S),modelValue:c.value,"onUpdate:modelValue":b[8]||(b[8]=S=>c.value=S),onConfirm:a},null,8,["visible","modelValue"])],512),[[e.vShow,!i.isCollapsed]])]))}}),[["__scopeId","data-v-3731c19a"]]),bi={class:"dialog-content"},Ni={class:"dialog-header"},hi={class:"dialog-body"},Vi={class:"group-row"},ki={class:"group-field"},Ci=["value","onChange"],$i=["value"],vi={class:"group-field group-field-value"},wi=["value","onInput"],Bi=["value","onInput"],Si={key:2,class:"color-input-wrapper"},_i=["value","onInput"],xi={class:"color-value"},Ii=["value","onChange"],Di=["onClick"],Ti={key:0,class:"empty-hint"},Pi={class:"dialog-footer"},Pe=H(e.defineComponent({__name:"AttributeConfigDialog",props:{attributeGroups:{},nodeProperties:{}},emits:["close","save","add-group","remove-group","update-group"],setup(i,{emit:l}){const n=i,r=l,t=c=>{const p=n.nodeProperties.find(g=>g.key===c);return(p==null?void 0:p.type)||"text"},s=(c,p,g)=>{const a=g.target.value;r("update-group",c,p,a)},d=()=>{for(const c of n.attributeGroups)if(!c.property){alert("请为每组配置选择目标属性");return}r("save")};return(c,p)=>(e.openBlock(),e.createElementBlock("div",{class:"dialog-overlay",onClick:p[3]||(p[3]=e.withModifiers(g=>c.$emit("close"),["self"]))},[e.createElementVNode("div",bi,[e.createElementVNode("div",Ni,[p[4]||(p[4]=e.createElementVNode("h3",null,"事件属性更改配置",-1)),e.createElementVNode("button",{class:"btn-close",onClick:p[0]||(p[0]=g=>c.$emit("close"))},"×")]),e.createElementVNode("div",hi,[e.createElementVNode("button",{class:"btn-add-group",onClick:p[1]||(p[1]=g=>c.$emit("add-group"))},"新增一组"),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.attributeGroups,(g,a)=>(e.openBlock(),e.createElementBlock("div",{key:a,class:"attribute-group"},[e.createElementVNode("div",Vi,[e.createElementVNode("div",ki,[p[6]||(p[6]=e.createElementVNode("label",null,"目标属性",-1)),e.createElementVNode("select",{value:g.property,onChange:o=>s(a,"property",o)},[p[5]||(p[5]=e.createElementVNode("option",{value:""},"选择目标属性",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.nodeProperties,o=>(e.openBlock(),e.createElementBlock("option",{key:o.key,value:o.key},e.toDisplayString(o.label),9,$i))),128))],40,Ci)]),e.createElementVNode("div",vi,[p[8]||(p[8]=e.createElementVNode("label",null,"期望值",-1)),!g.property||t(g.property)==="text"?(e.openBlock(),e.createElementBlock("input",{key:0,value:g.value,type:"text",onInput:o=>s(a,"value",o),placeholder:"输入值"},null,40,wi)):t(g.property)==="number"?(e.openBlock(),e.createElementBlock("input",{key:1,value:g.value,type:"number",onInput:o=>s(a,"value",o),placeholder:"输入数字"},null,40,Bi)):t(g.property)==="color"?(e.openBlock(),e.createElementBlock("div",Si,[e.createElementVNode("input",{value:g.value,type:"color",onInput:o=>s(a,"value",o)},null,40,_i),e.createElementVNode("span",xi,e.toDisplayString(g.value||"#000000"),1)])):t(g.property)==="boolean"?(e.openBlock(),e.createElementBlock("select",{key:3,value:g.value,onChange:o=>s(a,"value",o)},[...p[7]||(p[7]=[e.createElementVNode("option",{value:"true"},"是",-1),e.createElementVNode("option",{value:"false"},"否",-1)])],40,Ii)):e.createCommentVNode("",!0)]),e.createElementVNode("button",{class:"btn-delete-group",onClick:o=>c.$emit("remove-group",a),title:"删除"}," 🗑 ",8,Di)])]))),128)),i.attributeGroups.length===0?(e.openBlock(),e.createElementBlock("div",Ti,' 请点击"新增一组"按钮添加属性配置 ')):e.createCommentVNode("",!0)]),e.createElementVNode("div",Pi,[e.createElementVNode("button",{class:"btn-cancel",onClick:p[2]||(p[2]=g=>c.$emit("close"))},"取消"),e.createElementVNode("button",{class:"btn-confirm",onClick:d},"确定")])])]))}}),[["__scopeId","data-v-90af9944"]]),Ai={class:"dialog-content dialog-large"},Mi={class:"dialog-header"},zi={class:"dialog-body dialog-body-split"},Oi={class:"code-editor-section"},Ui=["value"],Ri={class:"code-preview-section"},Li={class:"section-header"},Wi={class:"preview-status"},Fi={key:0,class:"status-success"},ji={key:1,class:"status-error"},Gi={class:"preview-canvas"},Hi={key:0,class:"preview-empty"},Ji={key:1,class:"preview-error-box"},qi={class:"error-message"},Yi={key:2,class:"preview-node-container"},Xi={key:0,class:"console-output"},Ki={class:"console-logs"},Zi={class:"dialog-footer"},Qi=`function execute(node) {
|
|
6
|
+
*/function Tt(i){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const o in i)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(i,o);Object.defineProperty(l,o,s.get?s:{enumerable:!0,get:()=>i[o]})}}return l.default=i,Object.freeze(l)}const Je=Tt(It);class Ye extends Q.Node{}(function(i){function l(o){const s=[],t=Q.Markup.getForeignObjectMarkup();return o?s.push({tagName:o,selector:"body"},t):s.push(t),s}i.config({view:"vue-shape-view",markup:l(),attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}},propHooks(o){if(o.markup==null){const s=o.primer;if(s){o.markup=l(s);let t={};switch(s){case"circle":t={refCx:"50%",refCy:"50%",refR:"50%"};break;case"ellipse":t={refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"};break}o.attrs=Q.ObjectExt.merge({},{body:Object.assign({refWidth:null,refHeight:null},t)},o.attrs||{})}}return o}}),Q.Node.registry.register("vue-shape",i,!0)})(Ye||(Ye={}));var zt=function(i,l){var o={};for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&l.indexOf(s)<0&&(o[s]=i[s]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,s=Object.getOwnPropertySymbols(i);t<s.length;t++)l.indexOf(s[t])<0&&Object.prototype.propertyIsEnumerable.call(i,s[t])&&(o[s[t]]=i[s[t]]);return o};const Xe={};function Z(i){const{shape:l,component:o,inherit:s}=i,t=zt(i,["shape","component","inherit"]);if(!l)throw new Error("should specify shape in config");Xe[l]={component:o},Q.Graph.registerNode(l,Object.assign({inherit:s||"vue-shape"},t),!0)}e.reactive({});class ke extends Q.NodeView{getComponentContainer(){return this.selectors&&this.selectors.foContent}confirmUpdate(l){const o=super.confirmUpdate(l);return this.handleAction(o,ke.action,()=>{this.renderVueComponent()})}targetId(){return`${this.graph.view.cid}:${this.cell.id}`}renderVueComponent(){this.unmountVueComponent();const l=this.getComponentContainer(),o=this.cell,s=this.graph;if(l){const{component:t}=Xe[o.shape];t&&(this.vm=e.createApp({render(){return e.h(t,{node:o,graph:s})},provide(){return{getNode:()=>o,getGraph:()=>s}}}),this.vm.mount(l))}}unmountVueComponent(){const l=this.getComponentContainer();return this.vm&&(this.vm.unmount(),this.vm=null),l&&(l.innerHTML=""),l}onMouseDown(l,o,s){const t=l.target;if(t.tagName.toLowerCase()==="input"){const p=t.getAttribute("type");if(p==null||["text","password","number","email","search","tel","url"].includes(p))return}super.onMouseDown(l,o,s)}unmount(){return this.unmountVueComponent(),super.unmount(),this}}(function(i){i.action="vue",i.config({bootstrap:[i.action],actions:{component:i.action}}),Q.NodeView.registry.register("vue-shape-view",i,!0)})(ke||(ke={}));const Mt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},At=e.defineComponent({name:"AlignHorizontalCenter",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Mt,o[0]||(o[0]=[e.createElementVNode("path",{d:"M24 18h-7v-4h3a2.002 2.002 0 0 0 2-2V8a2.002 2.002 0 0 0-2-2h-3V2h-2v4h-3a2.002 2.002 0 0 0-2 2v4a2.002 2.002 0 0 0 2 2h3v4H8a2.002 2.002 0 0 0-2 2v4a2.002 2.002 0 0 0 2 2h7v4h2v-4h7a2.002 2.002 0 0 0 2-2v-4a2.002 2.002 0 0 0-2-2zM12 8h8v4h-8zm12 16H8v-4h16z",fill:"currentColor"},null,-1)]))}}),Pt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ot=e.defineComponent({name:"AlignHorizontalLeft",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Pt,o[0]||(o[0]=[e.createElementVNode("path",{d:"M26 26H11a2.002 2.002 0 0 1-2-2v-4a2.002 2.002 0 0 1 2-2h15a2.002 2.002 0 0 1 2 2v4a2.002 2.002 0 0 1-2 2zm0-6.001L11 20v4h15z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M18 14h-7a2.002 2.002 0 0 1-2-2V8a2.002 2.002 0 0 1 2-2h7a2.002 2.002 0 0 1 2 2v4a2.002 2.002 0 0 1-2 2zm0-6.001L11 8v4h7z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M4 2h2v28H4z",fill:"currentColor"},null,-1)]))}}),Lt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Rt=e.defineComponent({name:"AlignHorizontalRight",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Lt,o[0]||(o[0]=[e.createElementVNode("path",{d:"M4 24v-4a2.002 2.002 0 0 1 2-2h15a2.002 2.002 0 0 1 2 2v4a2.002 2.002 0 0 1-2 2H6a2.002 2.002 0 0 1-2-2zm2 0h15v-4l-15-.001z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M12 12V8a2.002 2.002 0 0 1 2-2h7a2.002 2.002 0 0 1 2 2v4a2.002 2.002 0 0 1-2 2h-7a2.002 2.002 0 0 1-2-2zm2 0h7V8l-7-.001z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M28 30h-2V2h2z",fill:"currentColor"},null,-1)]))}}),Ut={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Wt=e.defineComponent({name:"AlignVerticalBottom",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ut,o[0]||(o[0]=[e.createElementVNode("path",{d:"M2 26h28v2H2z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M24 23h-4a2.002 2.002 0 0 1-2-2v-7a2.002 2.002 0 0 1 2-2h4a2.002 2.002 0 0 1 2 2v7a2.002 2.002 0 0 1-2 2zm-4-9v7h4.001L24 14z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M12 23H8a2.002 2.002 0 0 1-2-2V6a2.002 2.002 0 0 1 2-2h4a2.002 2.002 0 0 1 2 2v15a2.002 2.002 0 0 1-2 2zM8 6v15h4.001L12 6z",fill:"currentColor"},null,-1)]))}}),Ft={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Gt=e.defineComponent({name:"AlignVerticalCenter",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ft,o[0]||(o[0]=[e.createElementVNode("path",{d:"M30 15h-4v-3a2.002 2.002 0 0 0-2-2h-4a2.002 2.002 0 0 0-2 2v3h-4V8a2.002 2.002 0 0 0-2-2H8a2.002 2.002 0 0 0-2 2v7H2v2h4v7a2.002 2.002 0 0 0 2 2h4a2.002 2.002 0 0 0 2-2v-7h4v3a2.002 2.002 0 0 0 2 2h4a2.002 2.002 0 0 0 2-2v-3h4zM8 24V8h4l.001 16zm12-4v-8h4l.001 8z",fill:"currentColor"},null,-1)]))}}),jt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ht=e.defineComponent({name:"AlignVerticalTop",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",jt,o[0]||(o[0]=[e.createElementVNode("path",{d:"M24 20h-4a2.002 2.002 0 0 1-2-2v-7a2.002 2.002 0 0 1 2-2h4a2.002 2.002 0 0 1 2 2v7a2.002 2.002 0 0 1-2 2zm-4-9v7h4.001L24 11z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M12 28H8a2.002 2.002 0 0 1-2-2V11a2.002 2.002 0 0 1 2-2h4a2.002 2.002 0 0 1 2 2v15a2.002 2.002 0 0 1-2 2zM8 11v15h4.001L12 11z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M2 4h28v2H2z",fill:"currentColor"},null,-1)]))}}),qt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Jt=e.defineComponent({name:"DistributeHorizontalCenter",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",qt,o[0]||(o[0]=[e.createElementVNode("path",{d:"M24 10h-1V2h-2v8h-1a2.002 2.002 0 0 0-2 2v8a2.002 2.002 0 0 0 2 2h1v8h2v-8h1a2.002 2.002 0 0 0 2-2v-8a2.002 2.002 0 0 0-2-2zm0 10h-4v-8h4z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M12 6h-1V2H9v4H8a2.002 2.002 0 0 0-2 2v16a2.002 2.002 0 0 0 2 2h1v4h2v-4h1a2.002 2.002 0 0 0 2-2V8a2.002 2.002 0 0 0-2-2zm0 18H8V8h4z",fill:"currentColor"},null,-1)]))}}),Yt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Xt=e.defineComponent({name:"DistributeVerticalCenter",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Yt,o[0]||(o[0]=[e.createElementVNode("path",{d:"M30 21h-4v-1a2.002 2.002 0 0 0-2-2H8a2.002 2.002 0 0 0-2 2v1H2v2h4v1a2.002 2.002 0 0 0 2 2h16a2.002 2.002 0 0 0 2-2v-1h4zm-6 3H8v-4l16-.001z",fill:"currentColor"},null,-1),e.createElementVNode("path",{d:"M30 9h-8V8a2.002 2.002 0 0 0-2-2h-8a2.002 2.002 0 0 0-2 2v1H2v2h8v1a2.002 2.002 0 0 0 2 2h8a2.002 2.002 0 0 0 2-2v-1h8zm-10 3h-8V8l8-.001z",fill:"currentColor"},null,-1)]))}}),Kt={class:"scada-header"},Qt={class:"header-left"},Zt={class:"header-center"},eo={class:"tool-group"},to={key:0,class:"divider"},oo={key:1,class:"tool-group"},lo={key:2,class:"divider"},no={key:3,class:"tool-group"},ao={class:"header-right"},ro={class:"tool-group"},io=e.defineComponent({__name:"Header",props:{selectedNodesCount:{default:0}},emits:["save","import","workflow","preview","export","zoomIn","zoomOut","clearAll","alignLeft","alignCenter","alignRight","alignTop","alignMiddle","alignBottom","distributeHorizontal","distributeVertical"],setup(i,{emit:l}){const o=i,s=l;return(t,r)=>(e.openBlock(),e.createElementBlock("header",Kt,[e.createElementVNode("div",Qt,[e.renderSlot(t.$slots,"left",{},()=>[r[16]||(r[16]=e.createElementVNode("h1",{class:"logo"},"SCADA 组态引擎",-1)),r[17]||(r[17]=e.createElementVNode("span",{class:"version"},"v1.0.0",-1))],!0)]),e.createElementVNode("div",Zt,[e.createElementVNode("div",eo,[e.createElementVNode("button",{class:"toolbar-btn",onClick:r[0]||(r[0]=p=>s("zoomIn")),title:"放大"},[...r[18]||(r[18]=[e.createElementVNode("span",{class:"icon"},"+",-1)])]),e.createElementVNode("button",{class:"toolbar-btn",onClick:r[1]||(r[1]=p=>s("zoomOut")),title:"缩小"},[...r[19]||(r[19]=[e.createElementVNode("span",{class:"icon"},"-",-1)])]),e.createElementVNode("button",{class:"toolbar-btn",onClick:r[2]||(r[2]=p=>s("clearAll")),title:"清空画布"},[...r[20]||(r[20]=[e.createElementVNode("span",{class:"icon"},"🗑",-1)])])]),o.selectedNodesCount>=2?(e.openBlock(),e.createElementBlock("div",to)):e.createCommentVNode("",!0),o.selectedNodesCount>=2?(e.openBlock(),e.createElementBlock("div",oo,[e.createElementVNode("button",{class:"toolbar-btn",onClick:r[3]||(r[3]=p=>s("alignLeft")),title:"左对齐"},[e.createVNode(e.unref(Ot),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:r[4]||(r[4]=p=>s("alignCenter")),title:"水平居中"},[e.createVNode(e.unref(At),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:r[5]||(r[5]=p=>s("alignRight")),title:"右对齐"},[e.createVNode(e.unref(Rt),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:r[6]||(r[6]=p=>s("alignTop")),title:"顶部对齐"},[e.createVNode(e.unref(Ht),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:r[7]||(r[7]=p=>s("alignMiddle")),title:"垂直居中"},[e.createVNode(e.unref(Gt),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:r[8]||(r[8]=p=>s("alignBottom")),title:"底部对齐"},[e.createVNode(e.unref(Wt),{class:"icon-svg"})])])):e.createCommentVNode("",!0),o.selectedNodesCount>=3?(e.openBlock(),e.createElementBlock("div",lo)):e.createCommentVNode("",!0),o.selectedNodesCount>=3?(e.openBlock(),e.createElementBlock("div",no,[e.createElementVNode("button",{class:"toolbar-btn",onClick:r[9]||(r[9]=p=>s("distributeHorizontal")),title:"横向分布"},[e.createVNode(e.unref(Jt),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:r[10]||(r[10]=p=>s("distributeVertical")),title:"纵向分布"},[e.createVNode(e.unref(Xt),{class:"icon-svg"})])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",ao,[e.createElementVNode("div",ro,[e.createElementVNode("button",{class:"header-btn",onClick:r[11]||(r[11]=p=>s("workflow")),title:"流程编排"},[...r[21]||(r[21]=[e.createElementVNode("span",{class:"icon"},"⚡",-1),e.createElementVNode("span",null,"流程编排",-1)])]),e.createElementVNode("button",{class:"header-btn",onClick:r[12]||(r[12]=p=>s("import")),title:"导入"},[...r[22]||(r[22]=[e.createElementVNode("span",{class:"icon"},"📂",-1),e.createElementVNode("span",null,"导入",-1)])]),e.createElementVNode("button",{class:"header-btn",onClick:r[13]||(r[13]=p=>s("export")),title:"导出"},[...r[23]||(r[23]=[e.createElementVNode("span",{class:"icon"},"📤",-1),e.createElementVNode("span",null,"导出",-1)])]),e.createElementVNode("button",{class:"header-btn",onClick:r[14]||(r[14]=p=>s("preview")),title:"预览"},[...r[24]||(r[24]=[e.createElementVNode("span",{class:"icon"},"👁",-1),e.createElementVNode("span",null,"预览",-1)])]),e.createElementVNode("button",{class:"header-btn",onClick:r[15]||(r[15]=p=>s("save")),title:"保存"},[...r[25]||(r[25]=[e.createElementVNode("span",{class:"icon"},"💾",-1),e.createElementVNode("span",null,"保存",-1)])])])])]))}}),A=(i,l)=>{const o=i.__vccOpts||i;for(const[s,t]of l)o[s]=t;return o},_e=A(io,[["__scopeId","data-v-9bbedc41"]]),ve=[{key:"animationEnabled",label:"启用动画",type:"boolean",path:"data.animation.enabled",defaultValue:!1,description:"是否启用动画效果",bindable:!0},{key:"animationType",label:"动画类型",type:"select",path:"data.animation.type",defaultValue:"none",options:[{label:"无动画",value:"none"},{label:"闪烁",value:"blink"},{label:"缩放",value:"scale"},{label:"旋转",value:"rotate"},{label:"浮动",value:"float"},{label:"脉冲",value:"pulse"}],description:"组件动画效果类型",bindable:!1},{key:"animationDuration",label:"动画时长(ms)",type:"number",path:"data.animation.duration",defaultValue:1e3,min:100,max:5e3,step:100,description:"动画完成一次所需时间",bindable:!1},{key:"animationLoop",label:"循环播放",type:"boolean",path:"data.animation.loop",defaultValue:!0,description:"是否循环播放动画",bindable:!1}],Ke={metadata:{id:"rect",name:"矩形",category:"basic",icon:"▢",description:"基础矩形图形组件",version:"1.0.0"},shape:"rect",width:120,height:60,label:"矩形",attrs:{body:{fill:"#3b82f6",stroke:"#2563eb",strokeWidth:2},label:{fill:"#fff",fontSize:14}},ports:{groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-top",group:"top"},{id:"port-right",group:"right"},{id:"port-bottom",group:"bottom"},{id:"port-left",group:"left"}]},props:[{key:"name",label:"按钮文本",type:"text",path:"attrs.label.text",defaultValue:"矩形",description:"矩形名称"},{key:"fill",label:"填充色",type:"color",path:"attrs.body.fill",defaultValue:"#3b82f6",description:"矩形填充颜色"},{key:"stroke",label:"边框色",type:"color",path:"attrs.body.stroke",defaultValue:"#2563eb",description:"矩形边框颜色"},{key:"strokeWidth",label:"边框宽度",type:"number",path:"attrs.body.strokeWidth",defaultValue:2,min:0,max:10,description:"矩形边框宽度"},{key:"opacity",label:"透明度",type:"slider",path:"attrs.body.opacity",defaultValue:1,min:0,max:1,step:.1,description:"矩形透明度"},...ve]},Qe={metadata:{id:"circle",name:"圆形",category:"basic",icon:"○",description:"基础圆形图形组件",version:"1.0.0"},shape:"circle",width:80,height:80,label:"圆形",attrs:{body:{fill:"#10b981",stroke:"#059669",strokeWidth:2},label:{fill:"#fff",fontSize:14}},ports:{groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-top",group:"top"},{id:"port-right",group:"right"},{id:"port-bottom",group:"bottom"},{id:"port-left",group:"left"}]},props:[{key:"text",label:"初始文本",type:"text",path:"attrs.label.text",defaultValue:"圆形",description:"圆形初始文本"},{key:"fill",label:"填充色",type:"color",path:"attrs.body.fill",defaultValue:"#10b981",description:"圆形填充颜色"},{key:"stroke",label:"边框色",type:"color",path:"attrs.body.stroke",defaultValue:"#059669",description:"圆形边框颜色"},{key:"strokeWidth",label:"边框宽度",type:"number",path:"attrs.body.strokeWidth",defaultValue:2,min:0,max:10,description:"圆形边框宽度"},{key:"opacity",label:"透明度",type:"slider",path:"attrs.body.opacity",defaultValue:1,min:0,max:1,step:.1,description:"圆形透明度"},...ve]},Ze={metadata:{id:"text",name:"文本",category:"basic",icon:"T",description:"文本标签组件",version:"1.0.0"},shape:"rect",width:100,height:40,label:"文本",attrs:{body:{fill:"transparent",stroke:"#64748b",strokeWidth:1,strokeDasharray:"5 5"},label:{fill:"#e2e8f0",fontSize:16}},props:[{key:"label",label:"文本内容",type:"text",path:"attrs.label.text",defaultValue:"文本",description:"显示的文本内容"},{key:"fontSize",label:"字体大小",type:"number",path:"attrs.label.fontSize",defaultValue:16,min:12,max:48,description:"文本字体大小"},{key:"fontColor",label:"字体颜色",type:"color",path:"attrs.label.fill",defaultValue:"#e2e8f0",description:"文本字体颜色"},{key:"stroke",label:"边框色",type:"color",path:"attrs.body.stroke",defaultValue:"#64748b",description:"边框颜色"},...ve]},so=Object.freeze(Object.defineProperty({__proto__:null,CircleComponent:Qe,RectComponent:Ke,TextComponent:Ze},Symbol.toStringTag,{value:"Module"})),et={metadata:{id:"light",name:"3D灯泡",category:"iot",icon:"💡",description:"3D仿真IoT灯泡控制组件",version:"2.0.0"},shape:"light-3d-vue",width:100,height:120,label:"",attrs:{body:{fill:"transparent",stroke:"transparent"}},data:{type:"light",state:!1,color:"#fbbf24",deviceId:"",property:""},ports:{groups:{left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-left",group:"left"},{id:"port-right",group:"right"}]},props:[{key:"state",label:"灯泡状态",type:"select",path:"data.state",defaultValue:!1,options:[{label:"关闭",value:!1},{label:"开启",value:!0}],description:"灯泡开关状态"},{key:"color",label:"灯光颜色",type:"color",path:"data.color",defaultValue:"#fbbf24",description:"灯泡发光颜色"},{key:"deviceId",label:"设备ID",type:"text",path:"data.deviceId",defaultValue:"",description:"绑定的设备ID"},{key:"property",label:"设备属性",type:"text",path:"data.property",defaultValue:"",description:"绑定的设备属性名称"}]},tt={metadata:{id:"switch",name:"3D开关",category:"iot",icon:"🔘",description:"3D仿真IoT开关控制组件",version:"2.0.0"},shape:"switch-3d-vue",width:140,height:100,label:"",attrs:{body:{fill:"transparent",stroke:"transparent"}},data:{type:"switch",state:!1,deviceId:"",property:""},ports:{groups:{left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-left",group:"left"},{id:"port-right",group:"right"}]},props:[{key:"state",label:"开关状态",type:"select",path:"data.state",defaultValue:!1,options:[{label:"关闭",value:!1},{label:"开启",value:!0}],description:"开关当前状态"},{key:"deviceId",label:"设备ID",type:"text",path:"data.deviceId",defaultValue:"",description:"绑定的设备ID"},{key:"property",label:"设备属性",type:"text",path:"data.property",defaultValue:"",description:"绑定的设备属性名称"}]},ot=[{id:"basic",name:"基础仪表盘",config:{min:0,max:100,splitNumber:5,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.3,"#67e0e3"],[.7,"#37a2da"],[1,"#fd666d"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:20,fontSize:12,color:"#999"},title:{offsetCenter:[0,"90%"],fontSize:14,color:"#999"},detail:{fontSize:30,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value}"}}},{id:"temperature",name:"温度仪表盘",config:{min:-20,max:50,splitNumber:5,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.2,"#2563eb"],[.5,"#22c55e"],[.8,"#f59e0b"],[1,"#ef4444"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:10,fontSize:12,color:"#999"},title:{offsetCenter:[0,"90%"],fontSize:14,color:"#999"},detail:{fontSize:30,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value}°C"}}},{id:"humidity",name:"湿度仪表盘",config:{min:0,max:100,splitNumber:5,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.3,"#fbbf24"],[.7,"#3b82f6"],[1,"#1e40af"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:20,fontSize:12,color:"#999"},title:{offsetCenter:[0,"90%"],fontSize:14,color:"#999"},detail:{fontSize:30,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value}%"}}},{id:"speed",name:"速度仪表盘",config:{min:0,max:200,splitNumber:10,startAngle:225,endAngle:-45,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.4,"#10b981"],[.7,"#f59e0b"],[1,"#ef4444"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:20,fontSize:12,color:"#999"},title:{offsetCenter:[0,"90%"],fontSize:14,color:"#999"},detail:{fontSize:30,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value} km/h"}}},{id:"pressure",name:"压力仪表盘",config:{min:0,max:10,splitNumber:5,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.5,"#22c55e"],[.8,"#f59e0b"],[1,"#dc2626"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:20,fontSize:12,color:"#999"},title:{offsetCenter:[0,"90%"],fontSize:14,color:"#999"},detail:{fontSize:30,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value} MPa"}}},{id:"rpm",name:"转速仪表盘",config:{min:0,max:8e3,splitNumber:8,startAngle:225,endAngle:-45,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.6,"#06b6d4"],[.85,"#eab308"],[1,"#dc2626"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:20,fontSize:12,color:"#999"},title:{offsetCenter:[0,"90%"],fontSize:14,color:"#999"},detail:{fontSize:30,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value} RPM"}}},{id:"battery",name:"电池仪表盘",config:{min:0,max:100,splitNumber:5,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.2,"#dc2626"],[.5,"#f59e0b"],[1,"#22c55e"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:10,fontSize:12,color:"#999"},title:{offsetCenter:[0,"80%"],fontSize:12,color:"#999"},detail:{fontSize:20,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value}%"}}},{id:"power",name:"功率仪表盘",config:{min:0,max:100,splitNumber:5,radius:"100%",axisLine:{lineStyle:{width:10,color:[[.3,"#64748b"],[.7,"#3b82f6"],[1,"#8b5cf6"]]}},axisTick:{distance:2,length:5,lineStyle:{color:"#fff",width:1}},splitLine:{distance:2,length:10,lineStyle:{color:"#fff",width:2}},axisLabel:{distance:10,fontSize:12,color:"#999"},title:{offsetCenter:[0,"90%"],fontSize:12,color:"#999"},detail:{fontSize:20,offsetCenter:[0,"45%"],color:"#fff",formatter:"{value} kW"}}}];function co(i){return ot.find(l=>l.id===i)}const lt={metadata:{id:"echarts-gauge",name:"ECharts仪表盘",category:"iot",icon:"📈",description:"ECharts 仪表盘数据展示组件,支持丰富的配置选项",version:"1.0.0"},shape:"echarts-vue",width:200,height:200,label:"",attrs:{body:{fill:"transparent",stroke:"transparent"}},data:{type:"echarts-gauge",presetId:"basic",value:50,title:"SCORE",name:"Pressure"},ports:{groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-top",group:"top"},{id:"port-right",group:"right"},{id:"port-bottom",group:"bottom"},{id:"port-left",group:"left"}]},props:[{key:"presetId",label:"仪表盘类型",type:"select",path:"data.presetId",defaultValue:"basic",options:ot.map(i=>({label:i.name,value:i.id})),description:"选择预设的仪表盘类型,会自动应用对应的配置"},{key:"value",label:"当前值",type:"number",path:"data.value",defaultValue:50,description:"仪表盘当前显示值"},{key:"title",label:"标题",type:"text",path:"data.title",defaultValue:"SCORE",description:"仪表盘标题"},{key:"name",label:"系列名称",type:"text",path:"data.name",defaultValue:"Pressure",description:"显示在 tooltip 中的系列名称"}]},nt=[{id:"basic",name:"基础折线图",config:{smooth:!1,lineStyle:{width:2,color:"#5470c6"},areaStyle:null,symbol:"circle",symbolSize:6,radius:"100%"}},{id:"smooth",name:"平滑曲线",config:{smooth:!0,lineStyle:{width:2,color:"#91cc75"},areaStyle:null,symbol:"circle",symbolSize:6}},{id:"area",name:"区域折线图",config:{smooth:!1,lineStyle:{width:2,color:"#5470c6"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(84, 112, 198, 0.3)"},{offset:1,color:"rgba(84, 112, 198, 0.05)"}]}},symbol:"circle",symbolSize:6}},{id:"smooth-area",name:"平滑区域图",config:{smooth:!0,lineStyle:{width:2,color:"#91cc75"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(145, 204, 117, 0.3)"},{offset:1,color:"rgba(145, 204, 117, 0.05)"}]}},symbol:"circle",symbolSize:6}},{id:"dashed",name:"虚线折线图",config:{smooth:!1,lineStyle:{width:2,color:"#fac858",type:"dashed"},areaStyle:null,symbol:"circle",symbolSize:6}},{id:"step",name:"阶梯折线图",config:{smooth:!1,step:"middle",lineStyle:{width:2,color:"#ee6666"},areaStyle:null,symbol:"circle",symbolSize:6}}];function po(i){return nt.find(l=>l.id===i)}const at={metadata:{id:"echarts-line",name:"ECharts折线图",category:"iot",icon:"📉",description:"ECharts 折线图数据展示组件,支持时序数据可视化",version:"1.0.0"},shape:"echarts-line-vue",width:400,height:300,label:"",attrs:{body:{fill:"transparent",stroke:"transparent"}},data:{type:"echarts-line",presetId:"basic",title:"数据趋势",xAxisData:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],seriesData:[120,200,150,80,70,110,130],seriesName:"Data"},ports:{groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-top",group:"top"},{id:"port-right",group:"right"},{id:"port-bottom",group:"bottom"},{id:"port-left",group:"left"}]},props:[{key:"presetId",label:"折线图类型",type:"select",path:"data.presetId",defaultValue:"basic",options:nt.map(i=>({label:i.name,value:i.id})),description:"选择预设的折线图类型"},{key:"title",label:"图表标题",type:"text",path:"data.title",defaultValue:"数据趋势",description:"折线图标题"},{key:"seriesName",label:"系列名称",type:"text",path:"data.seriesName",defaultValue:"Data",description:"显示在 tooltip 和 legend 中的系列名称"}]},rt={metadata:{id:"motor-3d",name:"3D电机",category:"iot",icon:"⚡",description:"3D仿真电机组件,支持运行状态和转速显示",version:"1.0.0"},shape:"motor-3d-vue",width:140,height:110,label:"",attrs:{body:{fill:"transparent",stroke:"transparent"}},data:{type:"motor",state:!1,speed:1500,power:7.5,deviceId:"",property:""},ports:{groups:{left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-left",group:"left"},{id:"port-right",group:"right"}]},props:[{key:"state",label:"运行状态",type:"select",path:"data.state",defaultValue:!1,options:[{label:"停止",value:!1},{label:"运行",value:"running"}]},{key:"speed",label:"转速(rpm)",type:"number",path:"data.speed",defaultValue:1500,min:0},{key:"power",label:"功率(kW)",type:"number",path:"data.power",defaultValue:7.5,min:0},{key:"deviceId",label:"设备ID",type:"text",path:"data.deviceId",defaultValue:""},{key:"property",label:"设备属性",type:"text",path:"data.property",defaultValue:""}]},it={metadata:{id:"valve-3d",name:"3D阀门",category:"iot",icon:"🚰",description:"3D仿真阀门组件,支持开关状态和开度显示",version:"1.0.0"},shape:"valve-3d-vue",width:100,height:140,label:"",attrs:{body:{fill:"transparent",stroke:"transparent"}},data:{type:"valve",state:!1,openness:0,deviceId:"",property:""},ports:{groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-top",group:"top"},{id:"port-bottom",group:"bottom"}]},props:[{key:"state",label:"阀门状态",type:"select",path:"data.state",defaultValue:!1,options:[{label:"关闭",value:!1},{label:"开启",value:"open"}]},{key:"openness",label:"开度(%)",type:"number",path:"data.openness",defaultValue:0,min:0,max:100},{key:"deviceId",label:"设备ID",type:"text",path:"data.deviceId",defaultValue:""},{key:"property",label:"设备属性",type:"text",path:"data.property",defaultValue:""}]},st={metadata:{id:"tank-3d",name:"3D储罐",category:"iot",icon:"🛢️",description:"3D仿真储罐组件,支持液位、温度、压力显示",version:"1.0.0"},shape:"tank-3d-vue",width:120,height:160,label:"",attrs:{body:{fill:"transparent",stroke:"transparent"}},data:{type:"tank",level:50,capacity:100,temperature:25,pressure:101,liquidColor:"#3b82f6",deviceId:"",property:""},ports:{groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-top",group:"top"},{id:"port-right",group:"right"},{id:"port-bottom",group:"bottom"}]},props:[{key:"level",label:"液位(%)",type:"number",path:"data.level",defaultValue:50,min:0,max:100},{key:"capacity",label:"容量(m³)",type:"number",path:"data.capacity",defaultValue:100,min:0},{key:"temperature",label:"温度(°C)",type:"number",path:"data.temperature",defaultValue:25},{key:"pressure",label:"压力(kPa)",type:"number",path:"data.pressure",defaultValue:101,min:0},{key:"liquidColor",label:"液体颜色",type:"color",path:"data.liquidColor",defaultValue:"#3b82f6"},{key:"deviceId",label:"设备ID",type:"text",path:"data.deviceId",defaultValue:""},{key:"property",label:"设备属性",type:"text",path:"data.property",defaultValue:""}]},dt={metadata:{id:"pump-3d",name:"3D水泵",category:"iot",icon:"🌊",description:"3D仿真水泵组件,支持运行状态、流量、压力显示",version:"1.0.0"},shape:"pump-3d-vue",width:160,height:120,label:"",attrs:{body:{fill:"transparent",stroke:"transparent"}},data:{type:"pump",state:!1,speed:2900,power:5.5,flowRate:15,pressure:3.5,deviceId:"",property:""},ports:{groups:{left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-left",group:"left"},{id:"port-right",group:"right"}]},props:[{key:"state",label:"运行状态",type:"select",path:"data.state",defaultValue:!1,options:[{label:"停止",value:!1},{label:"运行",value:"running"}]},{key:"speed",label:"转速(rpm)",type:"number",path:"data.speed",defaultValue:2900,min:0},{key:"power",label:"功率(kW)",type:"number",path:"data.power",defaultValue:5.5,min:0},{key:"flowRate",label:"流量(m³/h)",type:"number",path:"data.flowRate",defaultValue:15,min:0},{key:"pressure",label:"压力(bar)",type:"number",path:"data.pressure",defaultValue:3.5,min:0},{key:"deviceId",label:"设备ID",type:"text",path:"data.deviceId",defaultValue:""},{key:"property",label:"设备属性",type:"text",path:"data.property",defaultValue:""}]},ct={metadata:{id:"conveyor-3d",name:"3D传送带",category:"iot",icon:"🔄",description:"3D仿真传送带组件,支持正反转和速度控制",version:"1.0.0"},shape:"conveyor-3d-vue",width:220,height:100,label:"",attrs:{body:{fill:"transparent",stroke:"transparent"}},data:{type:"conveyor",state:!1,speed:10,direction:"forward",deviceId:"",property:""},ports:{groups:{left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-left",group:"left"},{id:"port-right",group:"right"}]},props:[{key:"state",label:"运行状态",type:"select",path:"data.state",defaultValue:!1,options:[{label:"停止",value:!1},{label:"运行",value:"running"}],description:"传送带运行状态"},{key:"speed",label:"速度(m/min)",type:"number",path:"data.speed",defaultValue:10,min:0,max:100,description:"传送带运行速度"},{key:"direction",label:"运行方向",type:"select",path:"data.direction",defaultValue:"forward",options:[{label:"正向",value:"forward"},{label:"反向",value:"reverse"}],description:"传送带运行方向"},{key:"deviceId",label:"设备ID",type:"text",path:"data.deviceId",defaultValue:"",description:"绑定的设备ID"},{key:"property",label:"设备属性",type:"text",path:"data.property",defaultValue:"",description:"绑定的设备属性名称"}]},pt={metadata:{id:"alarm-light-3d",name:"3D报警灯",category:"iot",icon:"🚨",description:"3D仿真报警灯组件,支持旋转、闪烁、持续三种模式",version:"1.0.0"},shape:"alarm-light-3d-vue",width:100,height:120,label:"",attrs:{body:{fill:"transparent",stroke:"transparent"}},data:{type:"alarm-light",state:!1,mode:"rotating",color:"#ef4444",deviceId:"",property:""},ports:{groups:{bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-bottom",group:"bottom"}]},props:[{key:"state",label:"报警状态",type:"select",path:"data.state",defaultValue:!1,options:[{label:"正常",value:!1},{label:"报警",value:"active"}],description:"报警灯激活状态"},{key:"mode",label:"报警模式",type:"select",path:"data.mode",defaultValue:"rotating",options:[{label:"旋转",value:"rotating"},{label:"闪烁",value:"flashing"},{label:"持续",value:"steady"}],description:"报警灯工作模式"},{key:"color",label:"灯光颜色",type:"color",path:"data.color",defaultValue:"#ef4444",description:"报警灯颜色"},{key:"deviceId",label:"设备ID",type:"text",path:"data.deviceId",defaultValue:"",description:"绑定的设备ID"},{key:"property",label:"设备属性",type:"text",path:"data.property",defaultValue:"",description:"绑定的设备属性名称"}]},mt={metadata:{id:"temperature-sensor-3d",name:"3D温度传感器",category:"iot",icon:"🌡️",description:"3D仿真温度传感器,支持温度显示和报警",version:"1.0.0"},shape:"temperature-sensor-3d-vue",width:100,height:140,label:"",attrs:{body:{fill:"transparent",stroke:"transparent"}},data:{type:"temperature-sensor",temperature:25,maxTemp:100,minTemp:0,alarmHighLimit:80,alarmLowLimit:10,deviceId:"",property:""},ports:{groups:{bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-bottom",group:"bottom"}]},props:[{key:"temperature",label:"当前温度(°C)",type:"number",path:"data.temperature",defaultValue:25,description:"当前测量温度值"},{key:"maxTemp",label:"最大量程(°C)",type:"number",path:"data.maxTemp",defaultValue:100,description:"传感器最大测量温度"},{key:"minTemp",label:"最小量程(°C)",type:"number",path:"data.minTemp",defaultValue:0,description:"传感器最小测量温度"},{key:"alarmHighLimit",label:"高温报警(°C)",type:"number",path:"data.alarmHighLimit",defaultValue:80,description:"高温报警阈值"},{key:"alarmLowLimit",label:"低温报警(°C)",type:"number",path:"data.alarmLowLimit",defaultValue:10,description:"低温报警阈值"},{key:"deviceId",label:"设备ID",type:"text",path:"data.deviceId",defaultValue:"",description:"绑定的设备ID"},{key:"property",label:"设备属性",type:"text",path:"data.property",defaultValue:"",description:"绑定的设备属性名称"}]},ft={metadata:{id:"cylinder-3d",name:"3D气缸",category:"iot",icon:"🔩",description:"3D仿真气缸组件,支持伸缩动作和位置显示",version:"1.0.0"},shape:"cylinder-3d-vue",width:80,height:160,label:"",attrs:{body:{fill:"transparent",stroke:"transparent"}},data:{type:"cylinder",action:"stop",position:0,stroke:50,speed:200,deviceId:"",property:""},ports:{groups:{left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-left",group:"left"},{id:"port-right",group:"right"}]},props:[{key:"action",label:"动作指令",type:"select",path:"data.action",defaultValue:"stop",options:[{label:"停止",value:"stop"},{label:"伸出",value:"extend"},{label:"缩回",value:"retract"}],description:"气缸动作指令"},{key:"position",label:"当前位置(mm)",type:"number",path:"data.position",defaultValue:0,min:0,description:"活塞杆当前位置"},{key:"stroke",label:"行程(mm)",type:"number",path:"data.stroke",defaultValue:50,min:10,max:200,description:"气缸最大行程"},{key:"speed",label:"速度(mm/s)",type:"number",path:"data.speed",defaultValue:200,min:10,max:1e3,description:"活塞杆运动速度"},{key:"deviceId",label:"设备ID",type:"text",path:"data.deviceId",defaultValue:"",description:"绑定的设备ID"},{key:"property",label:"设备属性",type:"text",path:"data.property",defaultValue:"",description:"绑定的设备属性名称"}]},ut={metadata:{id:"pipe-3d",name:"3D管道",category:"iot",icon:"🔧",description:"3D仿真管道组件,支持横向/纵向和流体动画",version:"1.0.0"},shape:"pipe-3d-vue",width:220,height:60,label:"",attrs:{body:{fill:"transparent",stroke:"transparent"}},data:{type:"pipe",state:!1,flowRate:10,direction:"horizontal",fluidColor:"#3b82f6",diameter:40,length:200,deviceId:"",property:""},ports:{groups:{left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-left",group:"left"},{id:"port-right",group:"right"}]},props:[{key:"state",label:"流动状态",type:"select",path:"data.state",defaultValue:!1,options:[{label:"停止",value:!1},{label:"流动",value:"flowing"}],description:"管道流体状态"},{key:"flowRate",label:"流量(m³/h)",type:"number",path:"data.flowRate",defaultValue:10,min:0,description:"流体流量"},{key:"direction",label:"管道方向",type:"select",path:"data.direction",defaultValue:"horizontal",options:[{label:"横向",value:"horizontal"},{label:"纵向",value:"vertical"}],description:"管道布置方向"},{key:"fluidColor",label:"流体颜色",type:"color",path:"data.fluidColor",defaultValue:"#3b82f6",description:"流体显示颜色"},{key:"diameter",label:"管径(mm)",type:"number",path:"data.diameter",defaultValue:40,min:20,max:100,description:"管道直径"},{key:"length",label:"长度(mm)",type:"number",path:"data.length",defaultValue:200,min:100,max:500,description:"管道长度"},{key:"deviceId",label:"设备ID",type:"text",path:"data.deviceId",defaultValue:"",description:"绑定的设备ID"},{key:"property",label:"设备属性",type:"text",path:"data.property",defaultValue:"",description:"绑定的设备属性名称"}]},gt={metadata:{id:"filter-3d",name:"3D过滤器",category:"iot",icon:"🧹",description:"3D仿真过滤器,支持堵塞度和压差显示",version:"1.0.0"},shape:"filter-3d-vue",width:140,height:120,label:"",attrs:{body:{fill:"transparent",stroke:"transparent"}},data:{type:"filter",clogLevel:20,pressureDrop:5,diameter:50,alarmThreshold:70,deviceId:"",property:""},ports:{groups:{left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-left",group:"left"},{id:"port-right",group:"right"}]},props:[{key:"clogLevel",label:"堵塞度(%)",type:"number",path:"data.clogLevel",defaultValue:20,min:0,max:100,description:"滤芯堵塞程度"},{key:"pressureDrop",label:"压差(kPa)",type:"number",path:"data.pressureDrop",defaultValue:5,min:0,description:"过滤器压差"},{key:"diameter",label:"口径(mm)",type:"number",path:"data.diameter",defaultValue:50,min:20,max:100,description:"过滤器口径"},{key:"alarmThreshold",label:"报警阈值(%)",type:"number",path:"data.alarmThreshold",defaultValue:70,min:0,max:100,description:"堵塞度报警阈值"},{key:"deviceId",label:"设备ID",type:"text",path:"data.deviceId",defaultValue:"",description:"绑定的设备ID"},{key:"property",label:"设备属性",type:"text",path:"data.property",defaultValue:"",description:"绑定的设备属性名称"}]},ht={metadata:{id:"heat-exchanger-3d",name:"3D换热器",category:"iot",icon:"🔥",description:"3D仿真换热器,支持热冷流体交换和效率显示",version:"1.0.0"},shape:"heat-exchanger-3d-vue",width:160,height:140,label:"",attrs:{body:{fill:"transparent",stroke:"transparent"}},data:{type:"heat-exchanger",state:!1,hotTempIn:80,hotTempOut:50,coldTempIn:20,coldTempOut:40,heatTransferArea:10,deviceId:"",property:""},ports:{groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-top",group:"top"},{id:"port-bottom",group:"bottom"},{id:"port-left",group:"left"},{id:"port-right",group:"right"}]},props:[{key:"state",label:"运行状态",type:"select",path:"data.state",defaultValue:!1,options:[{label:"停止",value:!1},{label:"运行",value:"working"}],description:"换热器运行状态"},{key:"hotTempIn",label:"热侧进口(°C)",type:"number",path:"data.hotTempIn",defaultValue:80,description:"热流体进口温度"},{key:"hotTempOut",label:"热侧出口(°C)",type:"number",path:"data.hotTempOut",defaultValue:50,description:"热流体出口温度"},{key:"coldTempIn",label:"冷侧进口(°C)",type:"number",path:"data.coldTempIn",defaultValue:20,description:"冷流体进口温度"},{key:"coldTempOut",label:"冷侧出口(°C)",type:"number",path:"data.coldTempOut",defaultValue:40,description:"冷流体出口温度"},{key:"heatTransferArea",label:"换热面积(m²)",type:"number",path:"data.heatTransferArea",defaultValue:10,min:1,description:"换热器换热面积"},{key:"deviceId",label:"设备ID",type:"text",path:"data.deviceId",defaultValue:"",description:"绑定的设备ID"},{key:"property",label:"设备属性",type:"text",path:"data.property",defaultValue:"",description:"绑定的设备属性名称"}]},yt={metadata:{id:"tee-3d",name:"3D三通",category:"iot",icon:"⛓️",description:"3D仿真三通管件,支持流体分流和汇流",version:"1.0.0"},shape:"tee-3d-vue",width:120,height:120,label:"",attrs:{body:{fill:"transparent",stroke:"transparent"}},data:{type:"tee",state:!1,fluidColor:"#3b82f6",topFlowEnabled:!0,bottomFlowEnabled:!0,deviceId:"",property:""},ports:{groups:{left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-left",group:"left"},{id:"port-right",group:"right"},{id:"port-top",group:"top"},{id:"port-bottom",group:"bottom"}]},props:[{key:"state",label:"流动状态",type:"select",path:"data.state",defaultValue:!1,options:[{label:"关闭",value:!1},{label:"流动",value:"flowing"}],description:"三通管件流动状态"},{key:"fluidColor",label:"流体颜色",type:"color",path:"data.fluidColor",defaultValue:"#3b82f6",description:"流体显示颜色"},{key:"topFlowEnabled",label:"上方分流",type:"boolean",path:"data.topFlowEnabled",defaultValue:!0,description:"是否启用上方分流"},{key:"bottomFlowEnabled",label:"下方分流",type:"boolean",path:"data.bottomFlowEnabled",defaultValue:!0,description:"是否启用下方分流"},{key:"deviceId",label:"设备ID",type:"text",path:"data.deviceId",defaultValue:"",description:"绑定的设备ID"},{key:"property",label:"设备属性",type:"text",path:"data.property",defaultValue:"",description:"绑定的设备属性名称"}]},mo=Object.freeze(Object.defineProperty({__proto__:null,AlarmLight3DComponent:pt,Conveyor3DComponent:ct,Cylinder3DComponent:ft,EChartsGaugeComponent:lt,EChartsLineComponent:at,Filter3DComponent:gt,HeatExchanger3DComponent:ht,LightComponent:et,Motor3DComponent:rt,Pipe3DComponent:ut,Pump3DComponent:dt,SwitchComponent:tt,Tank3DComponent:st,Tee3DComponent:yt,TemperatureSensor3DComponent:mt,Valve3DComponent:it},Symbol.toStringTag,{value:"Module"}));class fo{constructor(){be(this,"registry",{});this.registerDefaultComponents()}registerDefaultComponents(){this.register(Ke),this.register(Qe),this.register(Ze),this.register(et),this.register(tt),this.register(lt),this.register(at),this.register(rt),this.register(it),this.register(st),this.register(dt),this.register(ct),this.register(pt),this.register(mt),this.register(ft),this.register(ut),this.register(gt),this.register(ht),this.register(yt)}register(l){const{id:o}=l.metadata;this.registry[o]&&console.warn(`组件 ${o} 已存在,将被覆盖`),this.registry[o]=l,console.log(`✓ 组件注册成功: ${l.metadata.name} (${o})`)}registerBatch(l){l.forEach(o=>this.register(o))}getComponent(l){return this.registry[l]}getAllComponents(){return{...this.registry}}getComponentsByCategory(l){return Object.values(this.registry).filter(o=>o.metadata.category===l)}getComponentList(){return Object.values(this.registry)}hasComponent(l){return l in this.registry}unregister(l){return this.registry[l]?(delete this.registry[l],console.log(`✓ 组件注销成功: ${l}`),!0):(console.warn(`组件 ${l} 不存在`),!1)}getCount(){return Object.keys(this.registry).length}clear(){this.registry={},console.log("✓ 组件注册表已清空")}}const me=new fo,Be={size:{width:1920,height:1080,preset:"1920*1080"},zoom:{scale:1,min:.1,max:5},offset:{x:0,y:0},background:{color:"#1e293b",size:"origin",repeat:"repeat"},grid:{enabled:!0,size:10,color:"#475569",type:"dot"},snap:{enabled:!0,threshold:10},guides:{enabled:!1,color:"#3b82f6"},magnetism:{enabled:!0,threshold:10}},uo=[{key:"sizePreset",label:"画布尺寸",type:"select",category:"basic",path:"size.preset",defaultValue:"1920*1080",options:[{label:"1920*1080",value:"1920*1080"},{label:"1366*768",value:"1366*768"},{label:"1280*720",value:"1280*720"},{label:"800*600",value:"800*600"}],description:"预设画布尺寸"},{key:"scale",label:"缩放倍数",type:"slider",category:"transform",path:"zoom.scale",defaultValue:1,min:.1,max:5,step:.1,description:"画布缩放比例"},{key:"offsetX",label:"画布X轴偏移",type:"number",category:"transform",path:"offset.x",defaultValue:0,description:"X轴偏移量"},{key:"offsetY",label:"画布Y轴偏移",type:"number",category:"transform",path:"offset.y",defaultValue:0,description:"Y轴偏移量"},{key:"backgroundColor",label:"背景颜色",type:"color",category:"background",path:"background.color",defaultValue:"#1e293b",description:"画布背景颜色"},{key:"backgroundImage",label:"背景图片",type:"image",category:"background",path:"background.image",defaultValue:"",description:"背景图片URL"},{key:"backgroundSize",label:"背景大小",type:"select",category:"background",path:"background.size",defaultValue:"origin",options:[{label:"原始",value:"origin"},{label:"包含",value:"contain"},{label:"覆盖",value:"cover"},{label:"拉伸",value:"stretch"}],description:"背景图片尺寸模式"},{key:"backgroundRepeat",label:"图像重复",type:"select",category:"background",path:"background.repeat",defaultValue:"repeat",options:[{label:"重复",value:"repeat"},{label:"X轴重复",value:"repeat-x"},{label:"Y轴重复",value:"repeat-y"},{label:"不重复",value:"no-repeat"}],description:"背景图片重复模式"},{key:"gridEnabled",label:"网格",type:"boolean",category:"assist",path:"grid.enabled",defaultValue:!0,description:"显示网格"},{key:"gridSize",label:"网格大小",type:"number",category:"assist",path:"grid.size",defaultValue:10,min:5,max:50,description:"网格单元格大小"},{key:"snapEnabled",label:"网格对齐",type:"boolean",category:"assist",path:"snap.enabled",defaultValue:!0,description:"启用网格对齐"},{key:"guidesEnabled",label:"参考线",type:"boolean",category:"assist",path:"guides.enabled",defaultValue:!0,description:"显示参考线"},{key:"magnetismEnabled",label:"吸附",type:"boolean",category:"assist",path:"magnetism.enabled",defaultValue:!0,description:"启用吸附功能"}],fe={"1920*1080":{width:1920,height:1080},"1366*768":{width:1366,height:768},"1280*720":{width:1280,height:720},"800*600":{width:800,height:600}};class go{constructor(){be(this,"config");this.config=e.reactive({...Be})}getConfig(){return this.config}updateConfig(l){Object.assign(this.config,l)}updateByPath(l,o){const s=l.split(".");let t=this.config;for(let r=0;r<s.length-1;r++)t=t[s[r]];if(t[s[s.length-1]]=o,l==="size.preset"&&o in fe){const{width:r,height:p}=fe[o];this.config.size.width=r,this.config.size.height=p}}getByPath(l){const o=l.split(".");let s=this.config;for(const t of o)s=s==null?void 0:s[t];return s}setSize(l,o,s){this.config.size.width=l,this.config.size.height=o,s&&(this.config.size.preset=s)}updateSize(l){this.config.size.width=l.width,this.config.size.height=l.height}setZoom(l){const{min:o=.1,max:s=5}=this.config.zoom;this.config.zoom.scale=Math.max(o,Math.min(s,l))}setOffset(l,o){this.config.offset.x=l,this.config.offset.y=o}setBackgroundColor(l){this.config.background.color=l}updateBackground(l){l.color!==void 0&&(this.config.background.color=l.color),l.image!==void 0&&(this.config.background.image=l.image),l.size!==void 0&&(this.config.background.size=l.size),l.repeat!==void 0&&(this.config.background.repeat=l.repeat)}setBackgroundImage(l){this.config.background.image=l}toggleGrid(l){this.config.grid.enabled=l??!this.config.grid.enabled}setGridSize(l){this.config.grid.size=l}toggleSnap(l){this.config.snap.enabled=l??!this.config.snap.enabled}toggleGuides(l){this.config.guides.enabled=l??!this.config.guides.enabled}toggleMagnetism(l){this.config.magnetism.enabled=l??!this.config.magnetism.enabled}reset(){Object.assign(this.config,Be)}export(){return JSON.stringify(this.config,null,2)}import(l){try{const o=JSON.parse(l);Object.assign(this.config,o)}catch(o){console.error("导入画布配置失败:",o)}}}const W=new go,ho={class:"component-library"},yo={class:"library-content"},bo={key:0,class:"component-section"},ko={class:"component-grid"},Eo=["onClick","title"],No={class:"component-icon"},Vo={class:"component-name"},xo={key:1,class:"component-section"},wo={class:"component-grid"},$o=["onClick","title"],Co={class:"component-icon"},_o={class:"component-name"},Se=A(e.defineComponent({__name:"ComponentLibrary",emits:["addComponent"],setup(i,{emit:l}){const o=l,s=e.computed(()=>me.getComponentsByCategory("basic")),t=e.computed(()=>me.getComponentsByCategory("iot")),r=p=>{o("addComponent",p.metadata.id)};return(p,d)=>(e.openBlock(),e.createElementBlock("aside",ho,[d[2]||(d[2]=e.createElementVNode("div",{class:"library-header"},[e.createElementVNode("h3",null,"组件库")],-1)),e.createElementVNode("div",yo,[s.value.length>0?(e.openBlock(),e.createElementBlock("div",bo,[d[0]||(d[0]=e.createElementVNode("h4",{class:"section-title"},"基础组件",-1)),e.createElementVNode("div",ko,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,c=>(e.openBlock(),e.createElementBlock("div",{key:c.metadata.id,class:"component-item",onClick:f=>r(c),title:c.metadata.description||c.metadata.name},[e.createElementVNode("span",No,e.toDisplayString(c.metadata.icon),1),e.createElementVNode("span",Vo,e.toDisplayString(c.metadata.name),1)],8,Eo))),128))])])):e.createCommentVNode("",!0),t.value.length>0?(e.openBlock(),e.createElementBlock("div",xo,[d[1]||(d[1]=e.createElementVNode("h4",{class:"section-title"},"IoT组件",-1)),e.createElementVNode("div",wo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,c=>(e.openBlock(),e.createElementBlock("div",{key:c.metadata.id,class:"component-item",onClick:f=>r(c),title:c.metadata.description||c.metadata.name},[e.createElementVNode("span",Co,e.toDisplayString(c.metadata.icon),1),e.createElementVNode("span",_o,e.toDisplayString(c.metadata.name),1)],8,$o))),128))])])):e.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-92bb4e17"]]),vo={class:"canvas-area"},Bo=A(e.defineComponent({__name:"CanvasArea",setup(i,{expose:l}){const o=e.ref();return l({containerRef:o}),(s,t)=>(e.openBlock(),e.createElementBlock("div",vo,[e.createElementVNode("div",{ref_key:"containerRef",ref:o,class:"canvas-container"},null,512)]))}}),[["__scopeId","data-v-a869f6aa"]]),So={class:"canvas-config-panel"},Do={class:"panel-content"},Io={class:"config-section"},To={class:"config-item"},zo={class:"config-section"},Mo={class:"config-item"},Ao={class:"slider-group"},Po={class:"value-display"},Oo={class:"config-item"},Lo={class:"number-input-group"},Ro={class:"config-item"},Uo={class:"number-input-group"},Wo={class:"config-section"},Fo={class:"config-item"},Go={class:"config-item"},jo={class:"image-upload"},Ho={class:"config-item"},qo={class:"config-item"},Jo={class:"config-section"},Yo={class:"config-item"},Xo={class:"switch"},Ko={class:"config-item"},Qo={class:"switch"},Zo={class:"config-item"},el={class:"switch"},tl={key:0,class:"config-item"},ol={class:"number-input-group"},De=A(e.defineComponent({__name:"CanvasConfigPanel",setup(i){const l=e.computed(()=>W.getConfig()),o=e.ref(),s=()=>{const f=l.value.size.preset;if(f&&f in fe){const{width:a,height:n}=fe[f];W.setSize(a,n,f)}},t=(f,a)=>{const n=l.value.offset[f];W.setOffset(f==="x"?n+a:l.value.offset.x,f==="y"?n+a:l.value.offset.y)},r=f=>{const a=Math.max(5,Math.min(50,l.value.grid.size+f));W.setGridSize(a)},p=()=>{var f;(f=o.value)==null||f.click()},d=f=>{var u;const n=(u=f.target.files)==null?void 0:u[0];if(n){const g=new FileReader;g.onload=m=>{var B;const k=(B=m.target)==null?void 0:B.result;W.updateByPath("background.image",k)},g.readAsDataURL(n)}},c=()=>{W.updateByPath("background.image",""),o.value&&(o.value.value="")};return(f,a)=>(e.openBlock(),e.createElementBlock("div",So,[a[40]||(a[40]=e.createElementVNode("div",{class:"panel-header"},[e.createElementVNode("h3",null,"画布配置")],-1)),e.createElementVNode("div",Do,[e.createElementVNode("div",Io,[a[19]||(a[19]=e.createElementVNode("h4",{class:"section-title"},"基础配置",-1)),e.createElementVNode("div",To,[a[18]||(a[18]=e.createElementVNode("label",null,"画布尺寸",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":a[0]||(a[0]=n=>l.value.size.preset=n),onChange:s,class:"config-select"},[...a[17]||(a[17]=[e.createElementVNode("option",{value:"1920*1080"},"1920*1080",-1),e.createElementVNode("option",{value:"1366*768"},"1366*768",-1),e.createElementVNode("option",{value:"1280*720"},"1280*720",-1),e.createElementVNode("option",{value:"800*600"},"800*600",-1)])],544),[[e.vModelSelect,l.value.size.preset]])])]),e.createElementVNode("div",zo,[a[23]||(a[23]=e.createElementVNode("h4",{class:"section-title"},"变换",-1)),e.createElementVNode("div",Mo,[a[20]||(a[20]=e.createElementVNode("label",null,"缩放倍数",-1)),e.createElementVNode("div",Ao,[e.withDirectives(e.createElementVNode("input",{type:"range","onUpdate:modelValue":a[1]||(a[1]=n=>l.value.zoom.scale=n),min:.1,max:5,step:.1,class:"config-slider"},null,512),[[e.vModelText,l.value.zoom.scale,void 0,{number:!0}]]),e.createElementVNode("span",Po,e.toDisplayString(l.value.zoom.scale.toFixed(1)),1)])]),e.createElementVNode("div",Oo,[a[21]||(a[21]=e.createElementVNode("label",null,"画布X轴偏移",-1)),e.createElementVNode("div",Lo,[e.createElementVNode("button",{onClick:a[2]||(a[2]=n=>t("x",-10)),class:"adjust-btn"},"-"),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":a[3]||(a[3]=n=>l.value.offset.x=n),class:"config-number"},null,512),[[e.vModelText,l.value.offset.x,void 0,{number:!0}]]),e.createElementVNode("button",{onClick:a[4]||(a[4]=n=>t("x",10)),class:"adjust-btn"},"+")])]),e.createElementVNode("div",Ro,[a[22]||(a[22]=e.createElementVNode("label",null,"画布Y轴偏移",-1)),e.createElementVNode("div",Uo,[e.createElementVNode("button",{onClick:a[5]||(a[5]=n=>t("y",-10)),class:"adjust-btn"},"-"),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":a[6]||(a[6]=n=>l.value.offset.y=n),class:"config-number"},null,512),[[e.vModelText,l.value.offset.y,void 0,{number:!0}]]),e.createElementVNode("button",{onClick:a[7]||(a[7]=n=>t("y",10)),class:"adjust-btn"},"+")])])]),e.createElementVNode("div",Wo,[a[31]||(a[31]=e.createElementVNode("h4",{class:"section-title"},"背景",-1)),e.createElementVNode("div",Fo,[a[24]||(a[24]=e.createElementVNode("label",null,"背景颜色",-1)),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":a[8]||(a[8]=n=>l.value.background.color=n),class:"config-color"},null,512),[[e.vModelText,l.value.background.color]])]),e.createElementVNode("div",Go,[a[26]||(a[26]=e.createElementVNode("label",null,"背景图片",-1)),e.createElementVNode("div",jo,[e.createElementVNode("input",{type:"file",accept:"image/*",onChange:d,ref_key:"fileInput",ref:o,style:{display:"none"}},null,544),e.createElementVNode("button",{onClick:p,class:"upload-btn"},[...a[25]||(a[25]=[e.createElementVNode("span",null,"📄",-1)])]),l.value.background.image?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:c,class:"clear-btn",title:"清除背景图"}," ✕ ")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Ho,[a[28]||(a[28]=e.createElementVNode("label",null,"背景大小",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":a[9]||(a[9]=n=>l.value.background.size=n),class:"config-select"},[...a[27]||(a[27]=[e.createElementVNode("option",{value:"origin"},"原始",-1),e.createElementVNode("option",{value:"contain"},"包含",-1),e.createElementVNode("option",{value:"cover"},"覆盖",-1),e.createElementVNode("option",{value:"stretch"},"拉伸",-1)])],512),[[e.vModelSelect,l.value.background.size]])]),e.createElementVNode("div",qo,[a[30]||(a[30]=e.createElementVNode("label",null,"图像重复",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":a[10]||(a[10]=n=>l.value.background.repeat=n),class:"config-select"},[...a[29]||(a[29]=[e.createElementVNode("option",{value:"repeat"},"重复",-1),e.createElementVNode("option",{value:"repeat-x"},"X轴重复",-1),e.createElementVNode("option",{value:"repeat-y"},"Y轴重复",-1),e.createElementVNode("option",{value:"no-repeat"},"不重复",-1)])],512),[[e.vModelSelect,l.value.background.repeat]])])]),e.createElementVNode("div",Jo,[a[39]||(a[39]=e.createElementVNode("h4",{class:"section-title"},"辅助",-1)),e.createElementVNode("div",Yo,[a[33]||(a[33]=e.createElementVNode("label",null,"吸附",-1)),e.createElementVNode("label",Xo,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":a[11]||(a[11]=n=>l.value.magnetism.enabled=n)},null,512),[[e.vModelCheckbox,l.value.magnetism.enabled]]),a[32]||(a[32]=e.createElementVNode("span",{class:"slider"},null,-1))])]),e.createElementVNode("div",Ko,[a[35]||(a[35]=e.createElementVNode("label",null,"网格",-1)),e.createElementVNode("label",Qo,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":a[12]||(a[12]=n=>l.value.grid.enabled=n)},null,512),[[e.vModelCheckbox,l.value.grid.enabled]]),a[34]||(a[34]=e.createElementVNode("span",{class:"slider"},null,-1))])]),e.createElementVNode("div",Zo,[a[37]||(a[37]=e.createElementVNode("label",null,"网格对齐",-1)),e.createElementVNode("label",el,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":a[13]||(a[13]=n=>l.value.snap.enabled=n)},null,512),[[e.vModelCheckbox,l.value.snap.enabled]]),a[36]||(a[36]=e.createElementVNode("span",{class:"slider"},null,-1))])]),l.value.grid.enabled?(e.openBlock(),e.createElementBlock("div",tl,[a[38]||(a[38]=e.createElementVNode("label",null,"网格大小",-1)),e.createElementVNode("div",ol,[e.createElementVNode("button",{onClick:a[14]||(a[14]=n=>r(-5)),class:"adjust-btn"},"-"),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":a[15]||(a[15]=n=>l.value.grid.size=n),min:5,max:50,class:"config-number"},null,512),[[e.vModelText,l.value.grid.size,void 0,{number:!0}]]),e.createElementVNode("button",{onClick:a[16]||(a[16]=n=>r(5)),class:"adjust-btn"},"+")])])):e.createCommentVNode("",!0)])])]))}}),[["__scopeId","data-v-f309895b"]]),ll={class:"tab-pane"},nl={class:"property-section"},al={class:"property-item-inline"},rl=["value"],il={class:"property-item-inline"},sl=["value"],dl={class:"property-item-inline"},cl=["value"],pl={class:"property-section"},ml={class:"property-row"},fl={class:"property-item"},ul=["value"],gl={class:"property-item"},hl=["value"],yl={class:"property-row"},bl={class:"property-item"},kl=["value"],El={class:"property-item"},Nl=["value"],Vl={class:"property-section"},xl={class:"property-item-inline"},wl=["value"],$l={class:"property-item-inline"},Cl={class:"color-input-wrapper"},_l=["value"],vl={class:"color-value"},Bl={class:"property-item-inline"},Sl={class:"color-input-wrapper"},Dl=["value"],Il={class:"color-value"},Tl={class:"property-item-inline"},zl=["value"],Ml={class:"property-item-inline"},Al=["value"],Pl={key:0,class:"property-section"},Ol={key:0,class:"property-hint"},Ll=["value","onInput","placeholder"],Rl=["value","onInput","min","max","step"],Ul={key:2,class:"color-input-wrapper"},Wl=["value","onInput"],Fl={class:"color-value"},Gl={key:3,class:"checkbox-wrapper"},jl=["checked","onChange"],Hl={class:"checkbox-label"},ql=["value","onChange"],Jl=["value"],Ie=A(e.defineComponent({__name:"BasicPropertiesTab",props:{selectedNode:{},nodePosition:{},nodeSize:{},nodeAttrs:{}},emits:["update-position","update-size","update-label","update-fill","update-stroke","update-stroke-width","update-opacity","update-component-name","update-dynamic-prop"],setup(i,{emit:l}){const o=i,s=l,t=e.computed(()=>{var c,f;if(!((f=(c=o.selectedNode)==null?void 0:c.data)!=null&&f.props))return[];const d=["label","fill","stroke","strokeWidth","opacity"];return o.selectedNode.data.props.filter(a=>!d.includes(a.key))}),r=d=>{if(!d.path)return d.defaultValue;const c=d.path.split(".");let f=o.selectedNode;for(const a of c)if(f&&typeof f=="object")f=f[a];else return d.defaultValue;return f!==void 0?f:d.defaultValue},p=(d,c)=>{var n;const f=c.target;let a;if(d.type==="number")a=Number(f.value);else if(d.type==="boolean")a=f.checked;else if(d.type==="select"){const u=(n=d.options)==null?void 0:n.find(g=>String(g.value)===f.value);a=u?u.value:f.value}else a=f.value;s("update-dynamic-prop",d.path,a)};return(d,c)=>{var f,a,n,u,g,m,k,B,T,E,b,h,N,V,z,R,O;return e.openBlock(),e.createElementBlock("div",ll,[e.createElementVNode("div",nl,[c[13]||(c[13]=e.createElementVNode("h4",null,"基础信息",-1)),e.createElementVNode("div",al,[c[10]||(c[10]=e.createElementVNode("label",null,"组件名称",-1)),e.createElementVNode("input",{type:"text",value:((f=i.selectedNode.getData())==null?void 0:f.componentName)||"",onInput:c[0]||(c[0]=_=>d.$emit("update-component-name",_)),placeholder:"请输入组件名称"},null,40,rl)]),e.createElementVNode("div",il,[c[11]||(c[11]=e.createElementVNode("label",null,"ID",-1)),e.createElementVNode("input",{type:"text",value:i.selectedNode.id,disabled:""},null,8,sl)]),e.createElementVNode("div",dl,[c[12]||(c[12]=e.createElementVNode("label",null,"类型",-1)),e.createElementVNode("input",{type:"text",value:i.selectedNode.shape,disabled:""},null,8,cl)])]),e.createElementVNode("div",pl,[c[18]||(c[18]=e.createElementVNode("h4",null,"位置和尺寸",-1)),e.createElementVNode("div",ml,[e.createElementVNode("div",fl,[c[14]||(c[14]=e.createElementVNode("label",null,"X",-1)),e.createElementVNode("input",{type:"number",value:i.nodePosition.x,onInput:c[1]||(c[1]=_=>d.$emit("update-position","x",_))},null,40,ul)]),e.createElementVNode("div",gl,[c[15]||(c[15]=e.createElementVNode("label",null,"Y",-1)),e.createElementVNode("input",{type:"number",value:i.nodePosition.y,onInput:c[2]||(c[2]=_=>d.$emit("update-position","y",_))},null,40,hl)])]),e.createElementVNode("div",yl,[e.createElementVNode("div",bl,[c[16]||(c[16]=e.createElementVNode("label",null,"宽度",-1)),e.createElementVNode("input",{type:"number",value:i.nodeSize.width,onInput:c[3]||(c[3]=_=>d.$emit("update-size","width",_))},null,40,kl)]),e.createElementVNode("div",El,[c[17]||(c[17]=e.createElementVNode("label",null,"高度",-1)),e.createElementVNode("input",{type:"number",value:i.nodeSize.height,onInput:c[4]||(c[4]=_=>d.$emit("update-size","height",_))},null,40,Nl)])])]),e.createElementVNode("div",Vl,[c[24]||(c[24]=e.createElementVNode("h4",null,"样式",-1)),e.createElementVNode("div",xl,[c[19]||(c[19]=e.createElementVNode("label",null,"初始文本",-1)),e.createElementVNode("input",{type:"text",value:((n=(a=i.nodeAttrs)==null?void 0:a.text)==null?void 0:n.text)||((g=(u=i.nodeAttrs)==null?void 0:u.label)==null?void 0:g.text)||i.selectedNode.getProp("label")||"",onInput:c[5]||(c[5]=_=>d.$emit("update-label",_)),placeholder:"设置默认显示文本"},null,40,wl)]),e.createElementVNode("div",$l,[c[20]||(c[20]=e.createElementVNode("label",null,"填充颜色",-1)),e.createElementVNode("div",Cl,[e.createElementVNode("input",{type:"color",value:((k=(m=i.nodeAttrs)==null?void 0:m.body)==null?void 0:k.fill)||"#3b82f6",onInput:c[6]||(c[6]=_=>d.$emit("update-fill",_))},null,40,_l),e.createElementVNode("span",vl,e.toDisplayString(((T=(B=i.nodeAttrs)==null?void 0:B.body)==null?void 0:T.fill)||"#3b82f6"),1)])]),e.createElementVNode("div",Bl,[c[21]||(c[21]=e.createElementVNode("label",null,"边框颜色",-1)),e.createElementVNode("div",Sl,[e.createElementVNode("input",{type:"color",value:((b=(E=i.nodeAttrs)==null?void 0:E.body)==null?void 0:b.stroke)||"#2563eb",onInput:c[7]||(c[7]=_=>d.$emit("update-stroke",_))},null,40,Dl),e.createElementVNode("span",Il,e.toDisplayString(((N=(h=i.nodeAttrs)==null?void 0:h.body)==null?void 0:N.stroke)||"#2563eb"),1)])]),e.createElementVNode("div",Tl,[c[22]||(c[22]=e.createElementVNode("label",null,"边框宽度",-1)),e.createElementVNode("input",{type:"number",min:"0",max:"10",value:((z=(V=i.nodeAttrs)==null?void 0:V.body)==null?void 0:z.strokeWidth)||2,onInput:c[8]||(c[8]=_=>d.$emit("update-stroke-width",_))},null,40,zl)]),e.createElementVNode("div",Ml,[c[23]||(c[23]=e.createElementVNode("label",null,"透明度",-1)),e.createElementVNode("input",{type:"number",min:"0",max:"1",step:"0.1",value:((O=(R=i.nodeAttrs)==null?void 0:R.body)==null?void 0:O.opacity)!==void 0?i.nodeAttrs.body.opacity:1,onInput:c[9]||(c[9]=_=>d.$emit("update-opacity",_))},null,40,Al)])]),t.value.length>0?(e.openBlock(),e.createElementBlock("div",Pl,[c[25]||(c[25]=e.createElementVNode("h4",null,"组件属性",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,_=>(e.openBlock(),e.createElementBlock("div",{key:_.key,class:"property-item-inline"},[e.createElementVNode("label",null,[e.createTextVNode(e.toDisplayString(_.label)+" ",1),_.description?(e.openBlock(),e.createElementBlock("span",Ol,e.toDisplayString(_.description),1)):e.createCommentVNode("",!0)]),_.type==="text"?(e.openBlock(),e.createElementBlock("input",{key:0,type:"text",value:r(_),onInput:v=>p(_,v),placeholder:_.defaultValue},null,40,Ll)):_.type==="number"?(e.openBlock(),e.createElementBlock("input",{key:1,type:"number",value:r(_),onInput:v=>p(_,v),min:_.min,max:_.max,step:_.step},null,40,Rl)):_.type==="color"?(e.openBlock(),e.createElementBlock("div",Ul,[e.createElementVNode("input",{type:"color",value:r(_),onInput:v=>p(_,v)},null,40,Wl),e.createElementVNode("span",Fl,e.toDisplayString(r(_)),1)])):_.type==="boolean"?(e.openBlock(),e.createElementBlock("div",Gl,[e.createElementVNode("input",{type:"checkbox",checked:r(_),onChange:v=>p(_,v)},null,40,jl),e.createElementVNode("span",Hl,e.toDisplayString(r(_)?"是":"否"),1)])):_.type==="select"?(e.openBlock(),e.createElementBlock("select",{key:4,value:r(_),onChange:v=>p(_,v)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.options,v=>(e.openBlock(),e.createElementBlock("option",{key:v.value,value:v.value},e.toDisplayString(v.label),9,Jl))),128))],40,ql)):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-e63074f3"]]),Yl={class:"tab-pane"},Xl={class:"property-section"},Kl={class:"property-item-inline"},Ql=["value"],Zl={key:0,class:"property-section"},en={class:"property-item-inline"},tn=["value"],on={class:"property-item-inline"},ln=["value"],nn={class:"property-item-inline"},an=["value"],rn={class:"property-item-inline"},sn=["value"],dn={class:"property-item-inline"},cn=["value"],pn={class:"property-item-inline"},mn=["value"],fn={key:1,class:"property-section"},un={class:"property-item-inline"},gn=["value"],hn={class:"property-item-inline"},yn=["value"],bn={class:"property-item-inline"},kn=["value"],En={class:"property-item-inline"},Nn=["value"],Vn={class:"property-item-inline"},xn=["value"],wn={class:"property-item-inline"},$n=["value"],Cn={key:2,class:"property-section"},_n={class:"property-item-inline"},vn=["value"],Bn={class:"property-item-inline"},Sn=["value"],Dn={class:"property-item-inline"},In=["value"],Tn={class:"property-item-inline"},zn=["value"],Mn={class:"property-item-inline"},An={class:"checkbox-wrapper"},Pn=["checked"],On={class:"checkbox-label"},Ln={key:3,class:"property-section"},Rn={class:"property-item-inline"},Un=["value"],Wn={class:"property-item-inline"},Fn=["value"],Gn={class:"property-item-inline"},jn=["value"],Hn={key:4,class:"property-section"},qn={class:"property-item-inline"},Jn=["value"],Yn={class:"property-item-inline"},Xn=["value"],Kn={key:5,class:"property-section"},Qn={class:"property-item-inline"},Zn={class:"checkbox-wrapper"},ea=["checked"],ta={class:"checkbox-label"},oa={class:"property-item-inline"},la=["value"],na=A(e.defineComponent({__name:"DataPropertiesTab",props:{selectedNode:{}},emits:["update-data-source"],setup(i,{emit:l}){const o=i,s=l,t=e.ref({type:"none",enabled:!0,retryCount:3});e.watch(()=>o.selectedNode,a=>{if(a){const n=a.getData();n!=null&&n.dataSource?t.value={...n.dataSource}:t.value={type:"none",enabled:!0,retryCount:3}}},{immediate:!0});const r=a=>{const n=a.target.value;let u={type:n,enabled:!0,retryCount:3};n==="http"?(u.pollInterval=5e3,u.method="GET"):n==="sse"&&(u.autoReconnect=!0),t.value=u,f()},p=(a,n)=>{const u=n.target;let g;u.type==="number"?g=Number(u.value):g=u.value,t.value={...t.value,[a]:g},f()},d=(a,n)=>{const u=n.target.checked;t.value={...t.value,[a]:u},f()},c=a=>{const n=a.target.checked;t.value={...t.value,enabled:n},f()},f=()=>{s("update-data-source",t.value)};return(a,n)=>(e.openBlock(),e.createElementBlock("div",Yl,[e.createElementVNode("div",Xl,[n[25]||(n[25]=e.createElementVNode("h4",null,"数据来源",-1)),e.createElementVNode("div",Kl,[n[24]||(n[24]=e.createElementVNode("label",null,"来源类型",-1)),e.createElementVNode("select",{value:t.value.type,onChange:r},[...n[23]||(n[23]=[e.createStaticVNode('<option value="none" data-v-5b515f8a>无数据源</option><option value="mqtt" data-v-5b515f8a>MQTT</option><option value="websocket" data-v-5b515f8a>WebSocket</option><option value="http" data-v-5b515f8a>HTTP</option><option value="sse" data-v-5b515f8a>SSE</option><option value="static" data-v-5b515f8a>静态数据</option>',6)])],40,Ql)])]),t.value.type==="mqtt"?(e.openBlock(),e.createElementBlock("div",Zl,[n[32]||(n[32]=e.createElementVNode("h4",null,"MQTT配置",-1)),e.createElementVNode("div",en,[n[26]||(n[26]=e.createElementVNode("label",null,"服务器",-1)),e.createElementVNode("input",{type:"text",value:t.value.broker||"",onInput:n[0]||(n[0]=u=>p("broker",u)),placeholder:"mqtt://localhost:1883"},null,40,tn)]),e.createElementVNode("div",on,[n[27]||(n[27]=e.createElementVNode("label",null,"客户端ID",-1)),e.createElementVNode("input",{type:"text",value:t.value.clientId||"",onInput:n[1]||(n[1]=u=>p("clientId",u)),placeholder:"自动生成"},null,40,ln)]),e.createElementVNode("div",nn,[n[28]||(n[28]=e.createElementVNode("label",null,"订阅主题",-1)),e.createElementVNode("input",{type:"text",value:t.value.topic||"",onInput:n[2]||(n[2]=u=>p("topic",u)),placeholder:"例如: sensor/temperature"},null,40,an)]),e.createElementVNode("div",rn,[n[29]||(n[29]=e.createElementVNode("label",null,"用户名",-1)),e.createElementVNode("input",{type:"text",value:t.value.username||"",onInput:n[3]||(n[3]=u=>p("username",u)),placeholder:"可选"},null,40,sn)]),e.createElementVNode("div",dn,[n[30]||(n[30]=e.createElementVNode("label",null,"密码",-1)),e.createElementVNode("input",{type:"password",value:t.value.password||"",onInput:n[4]||(n[4]=u=>p("password",u)),placeholder:"可选"},null,40,cn)]),e.createElementVNode("div",pn,[n[31]||(n[31]=e.createElementVNode("label",null,"数据路径",-1)),e.createElementVNode("input",{type:"text",value:t.value.dataPath||"",onInput:n[5]||(n[5]=u=>p("dataPath",u)),placeholder:"例如: value"},null,40,mn)])])):e.createCommentVNode("",!0),t.value.type==="http"?(e.openBlock(),e.createElementBlock("div",fn,[n[40]||(n[40]=e.createElementVNode("h4",null,"HTTP配置",-1)),e.createElementVNode("div",un,[n[33]||(n[33]=e.createElementVNode("label",null,"接口地址",-1)),e.createElementVNode("input",{type:"text",value:t.value.url||"",onInput:n[6]||(n[6]=u=>p("url",u)),placeholder:"https://api.example.com/data"},null,40,gn)]),e.createElementVNode("div",hn,[n[35]||(n[35]=e.createElementVNode("label",null,"请求方法",-1)),e.createElementVNode("select",{value:t.value.method||"GET",onChange:n[7]||(n[7]=u=>p("method",u))},[...n[34]||(n[34]=[e.createElementVNode("option",{value:"GET"},"GET",-1),e.createElementVNode("option",{value:"POST"},"POST",-1),e.createElementVNode("option",{value:"PUT"},"PUT",-1),e.createElementVNode("option",{value:"DELETE"},"DELETE",-1)])],40,yn)]),e.createElementVNode("div",bn,[n[36]||(n[36]=e.createElementVNode("label",null,"请求头",-1)),e.createElementVNode("input",{type:"text",value:t.value.headers||"",onInput:n[8]||(n[8]=u=>p("headers",u)),placeholder:"JSON格式"},null,40,kn)]),e.createElementVNode("div",En,[n[37]||(n[37]=e.createElementVNode("label",null,"请求体",-1)),e.createElementVNode("input",{type:"text",value:t.value.body||"",onInput:n[9]||(n[9]=u=>p("body",u)),placeholder:"POST/PUT请求的数据"},null,40,Nn)]),e.createElementVNode("div",Vn,[n[38]||(n[38]=e.createElementVNode("label",null,"数据路径",-1)),e.createElementVNode("input",{type:"text",value:t.value.dataPath||"",onInput:n[10]||(n[10]=u=>p("dataPath",u)),placeholder:"例如: data.value"},null,40,xn)]),e.createElementVNode("div",wn,[n[39]||(n[39]=e.createElementVNode("label",null,"轮询间隔(ms)",-1)),e.createElementVNode("input",{type:"number",value:t.value.pollInterval||5e3,onInput:n[11]||(n[11]=u=>p("pollInterval",u)),min:"1000",step:"1000"},null,40,$n)])])):e.createCommentVNode("",!0),t.value.type==="sse"?(e.openBlock(),e.createElementBlock("div",Cn,[n[46]||(n[46]=e.createElementVNode("h4",null,"SSE配置",-1)),e.createElementVNode("div",_n,[n[41]||(n[41]=e.createElementVNode("label",null,"服务地址",-1)),e.createElementVNode("input",{type:"text",value:t.value.sseUrl||"",onInput:n[12]||(n[12]=u=>p("sseUrl",u)),placeholder:"https://api.example.com/events"},null,40,vn)]),e.createElementVNode("div",Bn,[n[42]||(n[42]=e.createElementVNode("label",null,"事件类型",-1)),e.createElementVNode("input",{type:"text",value:t.value.eventType||"",onInput:n[13]||(n[13]=u=>p("eventType",u)),placeholder:"留空表示所有事件"},null,40,Sn)]),e.createElementVNode("div",Dn,[n[43]||(n[43]=e.createElementVNode("label",null,"请求头",-1)),e.createElementVNode("input",{type:"text",value:t.value.headers||"",onInput:n[14]||(n[14]=u=>p("headers",u)),placeholder:"JSON格式"},null,40,In)]),e.createElementVNode("div",Tn,[n[44]||(n[44]=e.createElementVNode("label",null,"数据路径",-1)),e.createElementVNode("input",{type:"text",value:t.value.dataPath||"",onInput:n[15]||(n[15]=u=>p("dataPath",u)),placeholder:"例如: data.value"},null,40,zn)]),e.createElementVNode("div",Mn,[n[45]||(n[45]=e.createElementVNode("label",null,"自动重连",-1)),e.createElementVNode("div",An,[e.createElementVNode("input",{type:"checkbox",checked:t.value.autoReconnect!==!1,onChange:n[16]||(n[16]=u=>d("autoReconnect",u))},null,40,Pn),e.createElementVNode("span",On,e.toDisplayString(t.value.autoReconnect!==!1?"是":"否"),1)])])])):e.createCommentVNode("",!0),t.value.type==="websocket"?(e.openBlock(),e.createElementBlock("div",Ln,[n[50]||(n[50]=e.createElementVNode("h4",null,"WebSocket配置",-1)),e.createElementVNode("div",Rn,[n[47]||(n[47]=e.createElementVNode("label",null,"服务地址",-1)),e.createElementVNode("input",{type:"text",value:t.value.wsUrl||"",onInput:n[17]||(n[17]=u=>p("wsUrl",u)),placeholder:"ws://localhost:8080"},null,40,Un)]),e.createElementVNode("div",Wn,[n[48]||(n[48]=e.createElementVNode("label",null,"订阅主题",-1)),e.createElementVNode("input",{type:"text",value:t.value.topic||"",onInput:n[18]||(n[18]=u=>p("topic",u)),placeholder:"例如: device/status"},null,40,Fn)]),e.createElementVNode("div",Gn,[n[49]||(n[49]=e.createElementVNode("label",null,"数据路径",-1)),e.createElementVNode("input",{type:"text",value:t.value.dataPath||"",onInput:n[19]||(n[19]=u=>p("dataPath",u)),placeholder:"例如: payload.value"},null,40,jn)])])):e.createCommentVNode("",!0),t.value.type==="static"?(e.openBlock(),e.createElementBlock("div",Hn,[n[54]||(n[54]=e.createElementVNode("h4",null,"静态数据配置",-1)),e.createElementVNode("div",qn,[n[51]||(n[51]=e.createElementVNode("label",null,"数据值",-1)),e.createElementVNode("input",{type:"text",value:t.value.value||"",onInput:n[20]||(n[20]=u=>p("value",u)),placeholder:"请输入数据值"},null,40,Jn)]),e.createElementVNode("div",Yn,[n[53]||(n[53]=e.createElementVNode("label",null,"数据类型",-1)),e.createElementVNode("select",{value:t.value.valueType||"string",onChange:n[21]||(n[21]=u=>p("valueType",u))},[...n[52]||(n[52]=[e.createElementVNode("option",{value:"string"},"字符串",-1),e.createElementVNode("option",{value:"number"},"数字",-1),e.createElementVNode("option",{value:"boolean"},"布尔值",-1),e.createElementVNode("option",{value:"json"},"JSON对象",-1)])],40,Xn)])])):e.createCommentVNode("",!0),t.value.type!=="none"?(e.openBlock(),e.createElementBlock("div",Kn,[n[57]||(n[57]=e.createElementVNode("h4",null,"通用配置",-1)),e.createElementVNode("div",Qn,[n[55]||(n[55]=e.createElementVNode("label",null,"启用状态",-1)),e.createElementVNode("div",Zn,[e.createElementVNode("input",{type:"checkbox",checked:t.value.enabled!==!1,onChange:c},null,40,ea),e.createElementVNode("span",ta,e.toDisplayString(t.value.enabled!==!1?"启用":"禁用"),1)])]),e.createElementVNode("div",oa,[n[56]||(n[56]=e.createElementVNode("label",null,"错误重试",-1)),e.createElementVNode("input",{type:"number",value:t.value.retryCount||3,onInput:n[22]||(n[22]=u=>p("retryCount",u)),min:"0",max:"10"},null,40,la)])])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-5b515f8a"]]),aa={class:"edge-properties-tab"},ra={class:"property-section"},ia={class:"property-item"},sa={class:"color-input-wrapper"},da=["value"],ca=["value"],pa={class:"property-item"},ma={class:"number-input-wrapper"},fa=["value"],ua={class:"property-item"},ga=["value"],ha={class:"property-item"},ya={class:"slider-wrapper"},ba=["value"],ka={class:"slider-value"},Ea={class:"property-item"},Na=["value"],Va={key:0,class:"property-item"},xa={class:"number-input-wrapper"},wa=["value"],$a={class:"property-section"},Ca={class:"property-item"},_a=["value"],va={class:"property-item"},Ba=["value"],Sa={class:"property-section"},Da={class:"property-item"},Ia=["value"],Ta={class:"property-item"},za=["value"],Ma=A(e.defineComponent({__name:"EdgePropertiesTab",props:{selectedEdge:{}},emits:["updateEdge","deleteEdge"],setup(i,{emit:l}){const o=i,s=l,t=e.computed(()=>{var N;return((N=o.selectedEdge)==null?void 0:N.getAttrs())||{}}),r=N=>{const V=N.target.value;s("updateEdge",{attrs:{line:{stroke:V}}})},p=N=>{const V=Number(N.target.value);s("updateEdge",{attrs:{line:{strokeWidth:V}}})},d=()=>{var V;const N=(V=t.value.line)==null?void 0:V.strokeDasharray;return N?N==="5,5"?"5,5":N==="2,2"?"2,2":N==="10,5,2,5"?"10,5,2,5":"none":"none"},c=N=>{const V=N.target.value;s("updateEdge",{attrs:{line:{strokeDasharray:V==="none"?void 0:V}}})},f=N=>{const V=Number(N.target.value);s("updateEdge",{attrs:{line:{opacity:V}}})},a=N=>{var z;const V=(z=t.value.line)==null?void 0:z[`${N}Marker`];return!V||typeof V!="object"||!V.name?"none":V.name},n=()=>{var z;const N=(z=t.value.line)==null?void 0:z.opacity;return((N!==void 0&&typeof N=="number"?N:1)*100).toFixed(0)},u=N=>{const V=N.target.value;s("updateEdge",{attrs:{line:{sourceMarker:V==="none"?void 0:{name:V,width:8,height:6}}}})},g=N=>{const V=N.target.value;s("updateEdge",{attrs:{line:{targetMarker:V==="none"?void 0:{name:V,width:8,height:6}}}})},m=N=>{const V=N.target.value;s("updateEdge",{router:V})},k=N=>{const V=N.target.value;s("updateEdge",{connector:{name:V,args:V==="rounded"?{radius:8}:void 0}})},B=()=>{s("deleteEdge")},T=()=>{var V,z;const N=(z=(V=o.selectedEdge)==null?void 0:V.data)==null?void 0:z.animation;return N!=null&&N.enabled?"true":"false"},E=()=>{var V,z;const N=(z=(V=o.selectedEdge)==null?void 0:V.data)==null?void 0:z.animation;return N!=null&&N.duration?N.duration/1e3:2},b=N=>{if(!(N.target.value==="true"))s("updateEdge",{data:{animation:{enabled:!1}},animation:{enabled:!1}});else{const z=E()*1e3;s("updateEdge",{data:{animation:{enabled:!0,duration:z}},animation:{enabled:!0,duration:z}})}},h=N=>{const z=Number(N.target.value)*1e3;s("updateEdge",{data:{animation:{enabled:!0,duration:z}},animation:{enabled:!0,duration:z}})};return(N,V)=>{var z,R,O,_,v,M,K,le;return e.openBlock(),e.createElementBlock("div",aa,[e.createElementVNode("div",ra,[V[10]||(V[10]=e.createElementVNode("h4",{class:"section-title"},"线条样式",-1)),e.createElementVNode("div",ia,[V[0]||(V[0]=e.createElementVNode("label",{class:"property-label"},"线条颜色",-1)),e.createElementVNode("div",sa,[e.createElementVNode("input",{type:"color",class:"color-input",value:((z=t.value.line)==null?void 0:z.stroke)||"#10b981",onInput:r},null,40,da),e.createElementVNode("input",{type:"text",class:"color-text",value:((R=t.value.line)==null?void 0:R.stroke)||"#10b981",onInput:r},null,40,ca)])]),e.createElementVNode("div",pa,[V[2]||(V[2]=e.createElementVNode("label",{class:"property-label"},"线条粗细",-1)),e.createElementVNode("div",ma,[e.createElementVNode("input",{type:"number",class:"property-input",min:"1",max:"20",step:"1",value:((O=t.value.line)==null?void 0:O.strokeWidth)||2,onInput:p},null,40,fa),V[1]||(V[1]=e.createElementVNode("span",{class:"input-unit"},"px",-1))])]),e.createElementVNode("div",ua,[V[4]||(V[4]=e.createElementVNode("label",{class:"property-label"},"线条样式",-1)),e.createElementVNode("select",{class:"property-select",value:d(),onChange:c},[...V[3]||(V[3]=[e.createElementVNode("option",{value:"none"},"实线",-1),e.createElementVNode("option",{value:"5,5"},"虚线",-1),e.createElementVNode("option",{value:"2,2"},"点线",-1),e.createElementVNode("option",{value:"10,5,2,5"},"点划线",-1)])],40,ga)]),e.createElementVNode("div",ha,[V[5]||(V[5]=e.createElementVNode("label",{class:"property-label"},"透明度",-1)),e.createElementVNode("div",ya,[e.createElementVNode("input",{type:"range",class:"property-slider",min:"0",max:"1",step:"0.1",value:((_=t.value.line)==null?void 0:_.opacity)!==void 0?t.value.line.opacity:1,onInput:f},null,40,ba),e.createElementVNode("span",ka,e.toDisplayString(n())+"%",1)])]),e.createElementVNode("div",Ea,[V[7]||(V[7]=e.createElementVNode("label",{class:"property-label"},"流动动画",-1)),e.createElementVNode("select",{class:"property-select",value:T(),onChange:b},[...V[6]||(V[6]=[e.createElementVNode("option",{value:"false"},"关闭",-1),e.createElementVNode("option",{value:"true"},"开启",-1)])],40,Na)]),T()==="true"?(e.openBlock(),e.createElementBlock("div",Va,[V[9]||(V[9]=e.createElementVNode("label",{class:"property-label"},"动画速度",-1)),e.createElementVNode("div",xa,[e.createElementVNode("input",{type:"number",class:"property-input",min:"0.5",max:"10",step:"0.5",value:E(),onInput:h},null,40,wa),V[8]||(V[8]=e.createElementVNode("span",{class:"input-unit"},"秒",-1))])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",$a,[V[15]||(V[15]=e.createElementVNode("h4",{class:"section-title"},"箭头样式",-1)),e.createElementVNode("div",Ca,[V[12]||(V[12]=e.createElementVNode("label",{class:"property-label"},"起点箭头",-1)),e.createElementVNode("select",{class:"property-select",value:a("source"),onChange:u},[...V[11]||(V[11]=[e.createStaticVNode('<option value="none" data-v-e47f1784>无</option><option value="block" data-v-e47f1784>实心箭头</option><option value="classic" data-v-e47f1784>经典箭头</option><option value="diamond" data-v-e47f1784>菱形</option><option value="circle" data-v-e47f1784>圆形</option>',5)])],40,_a)]),e.createElementVNode("div",va,[V[14]||(V[14]=e.createElementVNode("label",{class:"property-label"},"终点箭头",-1)),e.createElementVNode("select",{class:"property-select",value:a("target"),onChange:g},[...V[13]||(V[13]=[e.createStaticVNode('<option value="none" data-v-e47f1784>无</option><option value="block" data-v-e47f1784>实心箭头</option><option value="classic" data-v-e47f1784>经典箭头</option><option value="diamond" data-v-e47f1784>菱形</option><option value="circle" data-v-e47f1784>圆形</option>',5)])],40,Ba)])]),e.createElementVNode("div",Sa,[V[20]||(V[20]=e.createElementVNode("h4",{class:"section-title"},"连接器",-1)),e.createElementVNode("div",Da,[V[17]||(V[17]=e.createElementVNode("label",{class:"property-label"},"路由方式",-1)),e.createElementVNode("select",{class:"property-select",value:((M=(v=i.selectedEdge)==null?void 0:v.getRouter())==null?void 0:M.name)||"manhattan",onChange:m},[...V[16]||(V[16]=[e.createElementVNode("option",{value:"manhattan"},"曼哈顿",-1),e.createElementVNode("option",{value:"orth"},"正交",-1),e.createElementVNode("option",{value:"normal"},"直线",-1)])],40,Ia)]),e.createElementVNode("div",Ta,[V[19]||(V[19]=e.createElementVNode("label",{class:"property-label"},"连接器类型",-1)),e.createElementVNode("select",{class:"property-select",value:((le=(K=i.selectedEdge)==null?void 0:K.getConnector())==null?void 0:le.name)||"rounded",onChange:k},[...V[18]||(V[18]=[e.createElementVNode("option",{value:"rounded"},"圆角",-1),e.createElementVNode("option",{value:"smooth"},"平滑",-1),e.createElementVNode("option",{value:"normal"},"普通",-1)])],40,za)])]),e.createElementVNode("div",{class:"property-section"},[e.createElementVNode("button",{class:"delete-btn",onClick:B}," 删除连线 ")])])}}}),[["__scopeId","data-v-e47f1784"]]),Aa={class:"event-card"},Pa={class:"header-left"},Oa={class:"collapse-icon"},La={class:"event-title"},Ra={class:"event-card-body"},Ua={class:"event-field"},Wa=["value"],Fa={class:"event-field"},Ga=["value"],ja={class:"event-field"},Ha=["value"],qa={class:"condition-config"},Ja=["value"],Ya=["value"],Xa=["value"],Ka=["value"],Qa={key:0,class:"config-section"},Za={key:1,class:"config-section"},er={key:2,class:"config-section"},tr={key:0,class:"selected-workflow-info"},or={class:"info-row"},lr={class:"info-value"},nr={class:"event-field"},ar=["value"],Te=A(e.defineComponent({__name:"EventCard",props:{event:{},index:{},isCollapsed:{type:Boolean},nodeProperties:{}},emits:["toggle-collapse","remove","update-field","update-condition","update-params","open-attribute-config","open-custom-code","open-workflow-selector"],setup(i){return(l,o)=>{var s,t,r,p,d,c,f;return e.openBlock(),e.createElementBlock("div",Aa,[e.createElementVNode("div",{class:"event-card-header",onClick:o[1]||(o[1]=a=>l.$emit("toggle-collapse"))},[e.createElementVNode("div",Pa,[e.createElementVNode("span",Oa,e.toDisplayString(i.isCollapsed?"▶":"▼"),1),e.createElementVNode("span",La,"事件"+e.toDisplayString(i.index+1),1)]),e.createElementVNode("button",{class:"btn-remove",onClick:o[0]||(o[0]=e.withModifiers(a=>l.$emit("remove"),["stop"])),title:"删除事件"},"🗑")]),e.withDirectives(e.createElementVNode("div",Ra,[e.createElementVNode("div",Ua,[o[12]||(o[12]=e.createElementVNode("label",null,"事件名称",-1)),e.createElementVNode("input",{type:"text",value:i.event.name||"",onInput:o[2]||(o[2]=a=>l.$emit("update-field","name",a)),placeholder:"输入事件名称,如:温度报警、湿度预警"},null,40,Wa)]),e.createElementVNode("div",Fa,[o[14]||(o[14]=e.createElementVNode("label",null,"事件类型",-1)),e.createElementVNode("select",{value:i.event.type,onChange:o[3]||(o[3]=a=>l.$emit("update-field","type",a))},[...o[13]||(o[13]=[e.createStaticVNode('<option value="click" data-v-af7c633a>单击</option><option value="dblclick" data-v-af7c633a>双击</option><option value="mouseenter" data-v-af7c633a>鼠标移入</option><option value="mouseleave" data-v-af7c633a>鼠标移出</option><option value="focus" data-v-af7c633a>获取焦点</option><option value="blur" data-v-af7c633a>失去焦点</option><option value="input" data-v-af7c633a>输入</option><option value="change" data-v-af7c633a>值变化</option>',8)])],40,Ga)]),e.createElementVNode("div",ja,[o[16]||(o[16]=e.createElementVNode("label",null,"事件行为",-1)),e.createElementVNode("select",{value:i.event.action,onChange:o[4]||(o[4]=a=>l.$emit("update-field","action",a))},[...o[15]||(o[15]=[e.createElementVNode("option",{value:"attributeChange"},"更改属性",-1),e.createElementVNode("option",{value:"customCode"},"自定义代码",-1),e.createElementVNode("option",{value:"callProcess"},"调用流程",-1)])],40,Ha)]),o[30]||(o[30]=e.createElementVNode("div",{class:"section-title"},"形参配置",-1)),o[31]||(o[31]=e.createElementVNode("div",{class:"field-hint"},"(不填直接触发)",-1)),o[32]||(o[32]=e.createElementVNode("div",{class:"section-title"},"触发规则",-1)),o[33]||(o[33]=e.createElementVNode("div",{class:"field-hint"},"(不填写条件则直接触发,填写后按条件触发)",-1)),e.createElementVNode("div",qa,[o[19]||(o[19]=e.createElementVNode("div",{class:"condition-label"},"当",-1)),o[20]||(o[20]=e.createElementVNode("div",{class:"condition-label"},"当前节点属性",-1)),e.createElementVNode("select",{class:"condition-select",value:((s=i.event.condition)==null?void 0:s.attribute)||"",onChange:o[5]||(o[5]=a=>l.$emit("update-condition","attribute",a))},[o[17]||(o[17]=e.createElementVNode("option",{value:""},"选择属性",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.nodeProperties,a=>(e.openBlock(),e.createElementBlock("option",{key:a.key,value:a.key},e.toDisplayString(a.label),9,Ya))),128))],40,Ja),o[21]||(o[21]=e.createElementVNode("div",{class:"condition-label"},"运算符",-1)),e.createElementVNode("select",{class:"condition-select",value:((t=i.event.condition)==null?void 0:t.operator)||"==",onChange:o[6]||(o[6]=a=>l.$emit("update-condition","operator",a))},[...o[18]||(o[18]=[e.createStaticVNode('<option value="==" data-v-af7c633a>等于</option><option value="!=" data-v-af7c633a>不等于</option><option value=">" data-v-af7c633a>大于</option><option value=">=" data-v-af7c633a>大于等于</option><option value="<" data-v-af7c633a>小于</option><option value="<=" data-v-af7c633a>小于等于</option><option value="contains" data-v-af7c633a>包含</option>',7)])],40,Xa),o[22]||(o[22]=e.createElementVNode("div",{class:"condition-label"},"值",-1)),e.createElementVNode("input",{type:"text",class:"condition-input",value:((r=i.event.condition)==null?void 0:r.value)||"",onInput:o[7]||(o[7]=a=>l.$emit("update-condition","value",a)),placeholder:"输入值"},null,40,Ka),o[23]||(o[23]=e.createElementVNode("div",{class:"condition-label"},"时",-1)),o[24]||(o[24]=e.createElementVNode("div",{class:"condition-label"},"触发该事件",-1))]),i.event.action==="attributeChange"?(e.openBlock(),e.createElementBlock("div",Qa,[o[25]||(o[25]=e.createElementVNode("div",{class:"section-title"},"属性更改",-1)),e.createElementVNode("button",{class:"btn-config",onClick:o[8]||(o[8]=a=>l.$emit("open-attribute-config"))},"点击配置")])):e.createCommentVNode("",!0),i.event.action==="customCode"?(e.openBlock(),e.createElementBlock("div",Za,[o[26]||(o[26]=e.createElementVNode("div",{class:"section-title"},"自定义代码",-1)),e.createElementVNode("button",{class:"btn-config",onClick:o[9]||(o[9]=a=>l.$emit("open-custom-code"))},"点击配置")])):e.createCommentVNode("",!0),i.event.action==="callProcess"?(e.openBlock(),e.createElementBlock("div",er,[o[29]||(o[29]=e.createElementVNode("div",{class:"section-title"},"调用流程",-1)),e.createElementVNode("button",{class:"btn-config",onClick:o[10]||(o[10]=a=>l.$emit("open-workflow-selector"))},"选择流程"),(p=i.event.params)!=null&&p.processId?(e.openBlock(),e.createElementBlock("div",tr,[e.createElementVNode("div",or,[o[27]||(o[27]=e.createElementVNode("span",{class:"info-label"},"已选择:",-1)),e.createElementVNode("span",lr,e.toDisplayString(((d=i.event.params)==null?void 0:d.processName)||((c=i.event.params)==null?void 0:c.processId)),1)]),e.createElementVNode("div",nr,[o[28]||(o[28]=e.createElementVNode("label",null,"传入参数",-1)),e.createElementVNode("textarea",{value:((f=i.event.params)==null?void 0:f.processParams)||"",onInput:o[11]||(o[11]=a=>l.$emit("update-params","processParams",a)),placeholder:'JSON格式: {"param1":"value1","param2":"value2"}',rows:"3"},null,40,ar)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],512),[[e.vShow,!i.isCollapsed]])])}}}),[["__scopeId","data-v-af7c633a"]]);var ee=(i=>(i.BOOLEAN="boolean",i.NUMBER="number",i.STRING="string",i))(ee||{}),te=(i=>(i.READ="read",i.WRITE="write",i.READ_WRITE="readWrite",i))(te||{}),ue=(i=>(i.ONLINE="online",i.OFFLINE="offline",i.ERROR="error",i.MAINTENANCE="maintenance",i))(ue||{}),ge=(i=>(i.PLC="plc",i.SENSOR="sensor",i.ACTUATOR="actuator",i.METER="meter",i.CAMERA="camera",i.OTHER="other",i))(ge||{});const ze=[{id:"device_001",name:"1号温控设备",code:"TC-001",type:ge.PLC,description:"车间1号温控PLC",status:ue.ONLINE,ipAddress:"192.168.1.101",port:502,protocol:"Modbus TCP",enabled:!0,tags:["车间1","温控","PLC"],points:[{id:"point_001_01",name:"当前温度",code:"40001",description:"实时温度采集",dataType:ee.NUMBER,accessMode:te.READ,value:25.5,unit:"°C",minValue:-20,maxValue:100,precision:1,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_001_02",name:"设定温度",code:"40002",description:"目标温度设定值",dataType:ee.NUMBER,accessMode:te.READ_WRITE,value:28,unit:"°C",minValue:0,maxValue:50,precision:1,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_001_03",name:"加热状态",code:"40003",description:"加热器运行状态",dataType:ee.BOOLEAN,accessMode:te.READ,value:!0,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_001_04",name:"告警状态",code:"40004",description:"设备告警状态",dataType:ee.BOOLEAN,accessMode:te.READ,value:!1,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"}],createTime:"2025-01-01 00:00:00",updateTime:"2025-12-17 08:15:00"},{id:"device_002",name:"主管道压力传感器",code:"PS-001",type:ge.SENSOR,description:"主管道压力监测",status:ue.ONLINE,ipAddress:"192.168.1.102",port:502,protocol:"Modbus TCP",enabled:!0,tags:["管道","压力","传感器"],points:[{id:"point_002_01",name:"当前压力",code:"40001",description:"实时压力值",dataType:ee.NUMBER,accessMode:te.READ,value:1.25,unit:"MPa",minValue:0,maxValue:5,precision:2,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_002_02",name:"压力上限",code:"40002",description:"压力告警上限",dataType:ee.NUMBER,accessMode:te.READ_WRITE,value:2,unit:"MPa",minValue:0,maxValue:5,precision:2,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_002_03",name:"压力下限",code:"40003",description:"压力告警下限",dataType:ee.NUMBER,accessMode:te.READ_WRITE,value:.5,unit:"MPa",minValue:0,maxValue:5,precision:2,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"}],createTime:"2025-01-01 00:00:00",updateTime:"2025-12-17 08:15:00"},{id:"device_003",name:"1号电机控制器",code:"MC-001",type:ge.ACTUATOR,description:"主传送带电机控制",status:ue.ONLINE,ipAddress:"192.168.1.103",port:502,protocol:"Modbus TCP",enabled:!0,tags:["电机","控制器","传送带"],points:[{id:"point_003_01",name:"运行状态",code:"40001",description:"电机运行状态",dataType:ee.BOOLEAN,accessMode:te.READ,value:!0,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_003_02",name:"启动命令",code:"40002",description:"电机启动控制",dataType:ee.BOOLEAN,accessMode:te.WRITE,value:!1,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_003_03",name:"停止命令",code:"40003",description:"电机停止控制",dataType:ee.BOOLEAN,accessMode:te.WRITE,value:!1,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_003_04",name:"当前转速",code:"40004",description:"电机实时转速",dataType:ee.NUMBER,accessMode:te.READ,value:1450,unit:"RPM",minValue:0,maxValue:3e3,precision:0,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_003_05",name:"设定转速",code:"40005",description:"目标转速设定",dataType:ee.NUMBER,accessMode:te.READ_WRITE,value:1500,unit:"RPM",minValue:0,maxValue:3e3,precision:0,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_003_06",name:"电流",code:"40006",description:"电机运行电流",dataType:ee.NUMBER,accessMode:te.READ,value:12.5,unit:"A",minValue:0,maxValue:50,precision:1,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"}],createTime:"2025-01-01 00:00:00",updateTime:"2025-12-17 08:15:00"},{id:"device_004",name:"进水流量计",code:"FM-001",type:ge.METER,description:"进水管道流量监测",status:ue.OFFLINE,ipAddress:"192.168.1.104",port:502,protocol:"Modbus TCP",enabled:!0,tags:["流量","仪表","进水"],points:[{id:"point_004_01",name:"瞬时流量",code:"40001",description:"当前流量值",dataType:ee.NUMBER,accessMode:te.READ,value:0,unit:"m³/h",minValue:0,maxValue:100,precision:2,enabled:!0,quality:"bad",updateTime:"2025-12-17 07:30:00"},{id:"point_004_02",name:"累计流量",code:"40002",description:"累计流量统计",dataType:ee.NUMBER,accessMode:te.READ,value:12345.67,unit:"m³",minValue:0,maxValue:999999,precision:2,enabled:!0,quality:"bad",updateTime:"2025-12-17 07:30:00"}],createTime:"2025-01-01 00:00:00",updateTime:"2025-12-17 07:30:00"}];ze.length;const bt=i=>ze.find(l=>l.id===i),rr=(i,l)=>{const o=bt(i);if(o)return o.points.find(s=>s.id===l)},ir={class:"device-point-selector"},sr={class:"device-list-panel"},dr={class:"panel-header"},cr={class:"device-count"},pr={class:"search-box"},mr={class:"device-list"},fr=["onClick"],ur={class:"device-info"},gr={class:"device-name"},hr={class:"device-meta"},yr={class:"device-code"},br={class:"point-count"},kr={key:0,class:"empty-hint"},Er={class:"point-list-panel"},Nr={class:"panel-header"},Vr={key:0,class:"point-count"},xr={key:0,class:"search-box"},wr={class:"point-list"},$r={key:0,class:"empty-hint"},Cr={key:1,class:"empty-hint"},_r=["onClick"],vr={class:"point-info"},Br={class:"point-name"},Sr={class:"point-meta"},Dr={class:"point-code"},Ir={key:0,class:"point-unit"},Tr={class:"point-type"},zr={key:0,class:"point-value"},Mr={class:"value"},Ar={class:"modal-footer"},Pr=["disabled"],Or=A(e.defineComponent({__name:"DevicePointSelector",props:{visible:{type:Boolean},modelValue:{}},emits:["update:visible","update:modelValue","confirm"],setup(i,{emit:l}){const o=i,s=l,t=e.ref(ze),r=e.ref(null),p=e.ref(null),d=e.ref(""),c=e.ref("");if(o.modelValue){const[E,b]=o.modelValue.split(":"),h=t.value.find(N=>N.id===E);h&&(r.value=h,p.value=h.points.find(N=>N.id===b)||null)}const f=e.computed(()=>{if(!d.value)return t.value;const E=d.value.toLowerCase();return t.value.filter(b=>b.name.toLowerCase().includes(E)||b.code.toLowerCase().includes(E))}),a=e.computed(()=>{if(!r.value)return[];if(!c.value)return r.value.points;const E=c.value.toLowerCase();return r.value.points.filter(b=>b.name.toLowerCase().includes(E)||b.code.toLowerCase().includes(E))}),n=E=>{r.value=E,p.value=null,c.value=""},u=E=>{E.enabled&&(p.value=E)},g=()=>{s("update:visible",!1)},m=()=>{if(!r.value||!p.value)return;const E=`${r.value.id}:${p.value.id}`;s("update:modelValue",E),s("confirm",r.value.id,p.value.id,r.value,p.value),s("update:visible",!1)},k=E=>({read:"只读",write:"只写",readWrite:"读写"})[E]||E,B=E=>({boolean:"布尔",number:"数值",string:"字符",json:"JSON"})[E]||E,T=E=>E.value===void 0||E.value===null?"-":E.dataType==="boolean"?E.value?"是":"否":E.dataType==="number"&&E.precision!==void 0?Number(E.value).toFixed(E.precision):String(E.value);return(E,b)=>i.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal-overlay",onClick:g},[e.createElementVNode("div",{class:"modal-container",onClick:b[2]||(b[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"modal-header"},[b[3]||(b[3]=e.createElementVNode("h3",null,"选择设备点位",-1)),e.createElementVNode("button",{class:"btn-close",onClick:g},"✕")]),e.createElementVNode("div",ir,[e.createElementVNode("div",sr,[e.createElementVNode("div",dr,[b[4]||(b[4]=e.createElementVNode("h4",null,"设备列表",-1)),e.createElementVNode("span",cr,e.toDisplayString(t.value.length),1)]),e.createElementVNode("div",pr,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":b[0]||(b[0]=h=>d.value=h),type:"text",placeholder:"搜索设备...",class:"search-input"},null,512),[[e.vModelText,d.value]])]),e.createElementVNode("div",mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,h=>{var N;return e.openBlock(),e.createElementBlock("div",{key:h.id,class:e.normalizeClass(["device-item",{active:((N=r.value)==null?void 0:N.id)===h.id,offline:h.status==="offline"}]),onClick:V=>n(h)},[e.createElementVNode("div",ur,[e.createElementVNode("div",gr,[e.createElementVNode("span",{class:e.normalizeClass(["status-dot",h.status])},null,2),e.createTextVNode(" "+e.toDisplayString(h.name),1)]),e.createElementVNode("div",hr,[e.createElementVNode("span",yr,e.toDisplayString(h.code),1),e.createElementVNode("span",br,e.toDisplayString(h.points.length)+" 点",1)])]),b[5]||(b[5]=e.createElementVNode("div",{class:"device-arrow"},"›",-1))],10,fr)}),128)),f.value.length===0?(e.openBlock(),e.createElementBlock("div",kr," 暂无设备 ")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Er,[e.createElementVNode("div",Nr,[e.createElementVNode("h4",null,e.toDisplayString(r.value?r.value.name:"点位列表"),1),r.value?(e.openBlock(),e.createElementBlock("span",Vr,e.toDisplayString(a.value.length),1)):e.createCommentVNode("",!0)]),r.value?(e.openBlock(),e.createElementBlock("div",xr,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":b[1]||(b[1]=h=>c.value=h),type:"text",placeholder:"搜索点位...",class:"search-input"},null,512),[[e.vModelText,c.value]])])):e.createCommentVNode("",!0),e.createElementVNode("div",wr,[r.value?a.value.length===0?(e.openBlock(),e.createElementBlock("div",Cr," 暂无点位 ")):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(a.value,h=>{var N;return e.openBlock(),e.createElementBlock("div",{key:h.id,class:e.normalizeClass(["point-item",{active:((N=p.value)==null?void 0:N.id)===h.id,disabled:!h.enabled}]),onClick:V=>u(h)},[e.createElementVNode("div",vr,[e.createElementVNode("div",Br,[e.createTextVNode(e.toDisplayString(h.name)+" ",1),e.createElementVNode("span",{class:e.normalizeClass(["access-mode",h.accessMode])},e.toDisplayString(k(h.accessMode)),3)]),e.createElementVNode("div",Sr,[e.createElementVNode("span",Dr,e.toDisplayString(h.code),1),h.unit?(e.openBlock(),e.createElementBlock("span",Ir,e.toDisplayString(h.unit),1)):e.createCommentVNode("",!0),e.createElementVNode("span",Tr,e.toDisplayString(B(h.dataType)),1)]),h.value!==void 0?(e.openBlock(),e.createElementBlock("div",zr,[b[6]||(b[6]=e.createTextVNode(" 当前值: ",-1)),e.createElementVNode("span",Mr,e.toDisplayString(T(h)),1),e.createElementVNode("span",{class:e.normalizeClass(["quality",h.quality])},e.toDisplayString(h.quality),3)])):e.createCommentVNode("",!0)])],10,_r)}),128)):(e.openBlock(),e.createElementBlock("div",$r," ← 请先选择设备 "))])])]),e.createElementVNode("div",Ar,[e.createElementVNode("button",{class:"btn-cancel",onClick:g},"取消"),e.createElementVNode("button",{class:"btn-confirm",disabled:!p.value,onClick:m}," 确定 ",8,Pr)])])])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-7884b850"]]);var se=(i=>(i.DIRECT="direct",i.BOOLEAN="boolean",i.RANGE="range",i.ENUM="enum",i))(se||{}),he=(i=>(i.BOOLEAN="boolean",i.NUMBER="number",i.STRING="string",i))(he||{});const Lr={class:"mapping-configurator"},Rr={class:"config-item"},Ur={key:0,class:"field-hint error"},Wr={key:1,class:"field-hint"},Fr={class:"config-item"},Gr={key:0,class:"field-hint error"},jr={key:1,class:"field-hint"},Hr={key:0,class:"config-item"},qr={class:"unit-config"},Jr={class:"checkbox-label"},Yr={key:0,class:"custom-unit"},Xr={key:1,class:"mapping-details"},Kr={class:"config-item"},Qr={class:"config-item"},Zr={key:2,class:"mapping-details"},ei={class:"range-rules"},ti=["onUpdate:modelValue"],oi=["onUpdate:modelValue"],li=["onUpdate:modelValue"],ni=["onClick"],ai={key:3,class:"mapping-details"},ri={class:"enum-mappings"},ii=["value","onInput"],si=["onUpdate:modelValue"],di=["onClick"],ci={key:4,class:"mapping-preview"},pi={class:"preview-content"},mi={class:"preview-item"},fi={class:"preview-output"},ui={class:"preview-item"},gi={class:"preview-output"},hi={class:"preview-input"},yi={class:"preview-output"},bi={class:"preview-input"},ki={class:"preview-output"},Ei=A(e.defineComponent({__name:"MappingConfigurator",props:{visible:{type:Boolean},modelValue:{}},emits:["update:visible","update:modelValue","confirm"],setup(i,{emit:l}){const o=i,s=l,t=e.ref(o.modelValue||{type:"",valueType:""});e.watch(()=>o.modelValue,T=>{T&&(t.value={...T})},{deep:!0});const r=()=>{t.value.type||(t.value.valueType===he.BOOLEAN?t.value.type=se.BOOLEAN:t.value.valueType===he.NUMBER?t.value.type=se.RANGE:t.value.type=se.DIRECT),t.value.valueType!==he.NUMBER&&(delete t.value.keepOriginalUnit,delete t.value.customUnit)},p=T=>({boolean:"适用于开关状态、是否判断等场景",number:"适用于温度、压力、流量等数值型数据",string:"适用于文本、状态码等字符型数据"})[T]||"",d=T=>({direct:"不做任何转换,直接使用原始值",boolean:"根据 true/false 转换为不同的值",range:"根据数值范围转换为对应值",enum:"根据枚举键值对转换"})[T]||"",c=()=>{const T=t.value.valueType;t.value={type:t.value.type,valueType:T},t.value.type===se.RANGE?t.value.rangeRules=[]:t.value.type===se.ENUM&&(t.value.enumMappings={})},f=()=>{t.value.rangeRules||(t.value.rangeRules=[]),t.value.rangeRules.push({min:0,max:100,value:""})},a=T=>{var E;(E=t.value.rangeRules)==null||E.splice(T,1)},n=()=>{t.value.enumMappings||(t.value.enumMappings={});const T=`key_${Object.keys(t.value.enumMappings).length+1}`;t.value.enumMappings[T]=""},u=T=>{t.value.enumMappings&&delete t.value.enumMappings[T]},g=(T,E)=>{const b=T.target.value;if(!t.value.enumMappings||b===E)return;const h=t.value.enumMappings[E];delete t.value.enumMappings[E],t.value.enumMappings[b]=h},m=()=>{},k=()=>{s("update:visible",!1)},B=()=>{if(!t.value.valueType){alert("请选择值类型!");return}if(!t.value.type){alert("请选择映射类型!");return}s("update:modelValue",{...t.value}),s("confirm",{...t.value}),s("update:visible",!1)};return(T,E)=>i.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal-overlay",onClick:k},[e.createElementVNode("div",{class:"modal-container",onClick:E[6]||(E[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"modal-header"},[E[7]||(E[7]=e.createElementVNode("h3",null,"值映射配置",-1)),e.createElementVNode("button",{class:"btn-close",onClick:k},"✕")]),e.createElementVNode("div",Lr,[e.createElementVNode("div",Rr,[E[9]||(E[9]=e.createElementVNode("label",null,[e.createTextVNode("值类型 "),e.createElementVNode("span",{class:"required"},"*")],-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":E[0]||(E[0]=b=>t.value.valueType=b),onChange:r},[...E[8]||(E[8]=[e.createElementVNode("option",{value:""},"请选择值类型",-1),e.createElementVNode("option",{value:"boolean"},"布尔型 (true/false)",-1),e.createElementVNode("option",{value:"number"},"数值型 (123, 45.6)",-1),e.createElementVNode("option",{value:"string"},'字符串型 ("abc")',-1)])],544),[[e.vModelSelect,t.value.valueType]]),t.value.valueType?(e.openBlock(),e.createElementBlock("div",Wr,e.toDisplayString(p(t.value.valueType)),1)):(e.openBlock(),e.createElementBlock("div",Ur," 值类型为必填项 "))]),e.createElementVNode("div",Fr,[E[11]||(E[11]=e.createElementVNode("label",null,[e.createTextVNode("映射类型 "),e.createElementVNode("span",{class:"required"},"*")],-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":E[1]||(E[1]=b=>t.value.type=b),onChange:c},[...E[10]||(E[10]=[e.createStaticVNode('<option value="" data-v-ef9e0ee1>请选择映射类型</option><option value="direct" data-v-ef9e0ee1>直接映射(无转换)</option><option value="boolean" data-v-ef9e0ee1>布尔映射</option><option value="range" data-v-ef9e0ee1>范围映射</option><option value="enum" data-v-ef9e0ee1>枚举映射</option>',5)])],544),[[e.vModelSelect,t.value.type]]),t.value.type?(e.openBlock(),e.createElementBlock("div",jr,e.toDisplayString(d(t.value.type)),1)):(e.openBlock(),e.createElementBlock("div",Gr," 映射类型为必填项 "))]),t.value.valueType==="number"?(e.openBlock(),e.createElementBlock("div",Hr,[E[13]||(E[13]=e.createElementVNode("label",null,"单位配置",-1)),e.createElementVNode("div",qr,[e.createElementVNode("label",Jr,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":E[2]||(E[2]=b=>t.value.keepOriginalUnit=b),onChange:m},null,544),[[e.vModelCheckbox,t.value.keepOriginalUnit]]),E[12]||(E[12]=e.createTextVNode(" 保留点位原始单位 ",-1))]),t.value.keepOriginalUnit?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Yr,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":E[3]||(E[3]=b=>t.value.customUnit=b),type:"text",placeholder:"自定义单位,如: °C, MPa, %",onInput:m},null,544),[[e.vModelText,t.value.customUnit]])]))])])):e.createCommentVNode("",!0),t.value.type==="boolean"?(e.openBlock(),e.createElementBlock("div",Xr,[e.createElementVNode("div",Kr,[E[14]||(E[14]=e.createElementVNode("label",null,"True 时的值",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":E[4]||(E[4]=b=>t.value.trueValue=b),type:"text",placeholder:"例如: 运行、#00ff00",onInput:m},null,544),[[e.vModelText,t.value.trueValue]])]),e.createElementVNode("div",Qr,[E[15]||(E[15]=e.createElementVNode("label",null,"False 时的值",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":E[5]||(E[5]=b=>t.value.falseValue=b),type:"text",placeholder:"例如: 停止、#ff0000",onInput:m},null,544),[[e.vModelText,t.value.falseValue]])])])):e.createCommentVNode("",!0),t.value.type==="range"?(e.openBlock(),e.createElementBlock("div",Zr,[e.createElementVNode("div",ei,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value.rangeRules,(b,h)=>(e.openBlock(),e.createElementBlock("div",{key:h,class:"range-rule"},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":N=>b.min=N,type:"number",placeholder:"最小值",onInput:m},null,40,ti),[[e.vModelText,b.min,void 0,{number:!0}]]),E[16]||(E[16]=e.createElementVNode("span",{class:"range-separator"},"~",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":N=>b.max=N,type:"number",placeholder:"最大值",onInput:m},null,40,oi),[[e.vModelText,b.max,void 0,{number:!0}]]),E[17]||(E[17]=e.createElementVNode("span",{class:"range-arrow"},"→",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":N=>b.value=N,type:"text",placeholder:"映射值",onInput:m},null,40,li),[[e.vModelText,b.value]]),e.createElementVNode("button",{class:"btn-remove-rule",onClick:N=>a(h),title:"删除规则"}," ✕ ",8,ni)]))),128))]),e.createElementVNode("button",{class:"btn-add-rule",onClick:f}," + 添加范围规则 ")])):e.createCommentVNode("",!0),t.value.type==="enum"?(e.openBlock(),e.createElementBlock("div",ai,[e.createElementVNode("div",ri,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value.enumMappings,(b,h,N)=>(e.openBlock(),e.createElementBlock("div",{key:N,class:"enum-mapping"},[e.createElementVNode("input",{value:h,type:"text",placeholder:"原始值",onInput:V=>g(V,h)},null,40,ii),E[18]||(E[18]=e.createElementVNode("span",{class:"enum-arrow"},"→",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":V=>t.value.enumMappings[h]=V,type:"text",placeholder:"映射值",onInput:m},null,40,si),[[e.vModelText,t.value.enumMappings[h]]]),e.createElementVNode("button",{class:"btn-remove-rule",onClick:V=>u(h),title:"删除映射"}," ✕ ",8,di)]))),128))]),e.createElementVNode("button",{class:"btn-add-rule",onClick:n}," + 添加枚举映射 ")])):e.createCommentVNode("",!0),t.value.type!=="direct"?(e.openBlock(),e.createElementBlock("div",ci,[E[25]||(E[25]=e.createElementVNode("label",null,"映射预览",-1)),e.createElementVNode("div",pi,[t.value.type==="boolean"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",mi,[E[19]||(E[19]=e.createElementVNode("span",{class:"preview-input"},"true",-1)),E[20]||(E[20]=e.createElementVNode("span",{class:"preview-arrow"},"→",-1)),e.createElementVNode("span",fi,e.toDisplayString(t.value.trueValue||"true"),1)]),e.createElementVNode("div",ui,[E[21]||(E[21]=e.createElementVNode("span",{class:"preview-input"},"false",-1)),E[22]||(E[22]=e.createElementVNode("span",{class:"preview-arrow"},"→",-1)),e.createElementVNode("span",gi,e.toDisplayString(t.value.falseValue||"false"),1)])],64)):t.value.type==="range"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.value.rangeRules,(b,h)=>(e.openBlock(),e.createElementBlock("div",{key:h,class:"preview-item"},[e.createElementVNode("span",hi,"["+e.toDisplayString(b.min)+" ~ "+e.toDisplayString(b.max)+"]",1),E[23]||(E[23]=e.createElementVNode("span",{class:"preview-arrow"},"→",-1)),e.createElementVNode("span",yi,e.toDisplayString(b.value),1)]))),128)):t.value.type==="enum"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(t.value.enumMappings,(b,h)=>(e.openBlock(),e.createElementBlock("div",{key:h,class:"preview-item"},[e.createElementVNode("span",bi,e.toDisplayString(h),1),E[24]||(E[24]=e.createElementVNode("span",{class:"preview-arrow"},"→",-1)),e.createElementVNode("span",ki,e.toDisplayString(b),1)]))),128)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:"modal-footer"},[e.createElementVNode("button",{class:"btn-cancel",onClick:k},"取消"),e.createElementVNode("button",{class:"btn-confirm",onClick:B},"确定")])])])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-ef9e0ee1"]]),Ni={class:"event-card"},Vi={class:"header-left"},xi={class:"collapse-icon"},wi={class:"event-title"},$i={class:"event-card-body"},Ci={class:"property-item"},_i={key:0,class:"selected-point"},vi={class:"point-main"},Bi={class:"device-name"},Si={class:"point-name"},Di={class:"point-details"},Ii={class:"point-code"},Ti={key:0,class:"point-unit"},zi={key:1,class:"placeholder"},Mi={class:"property-item"},Ai=["value"],Pi=["value"],Oi={class:"property-item"},Li={key:0,class:"mapping-summary"},Ri={class:"mapping-type-label"},Ui={class:"mapping-detail"},Wi={key:1,class:"placeholder"},Me=A(e.defineComponent({__name:"BindingCard",props:{binding:{},index:{},isCollapsed:{type:Boolean},nodeProperties:{}},emits:["toggle-collapse","remove","update-field"],setup(i,{emit:l}){const o=i,s=l,t=e.ref(o.binding.devicePointId||""),r=e.ref(!1),p=e.ref(!1),d=e.ref(o.binding.mapping||{type:se.DIRECT,valueType:he.NUMBER});e.watch(()=>o.binding.devicePointId,g=>{t.value=g||""}),e.watch(()=>o.binding.mapping,g=>{g&&(d.value=g)},{deep:!0});const c=e.computed(()=>{if(!t.value)return null;const[g,m]=t.value.split(":");if(!g||!m)return null;const k=bt(g),B=k?rr(g,m):null;return!k||!B?null:{deviceName:k.name,pointName:B.name,pointCode:B.code,pointUnit:B.unit}}),f=(g,m,k,B)=>{const T=new Event("change");Object.defineProperty(T,"target",{value:{value:`${g}:${m}`},writable:!1}),s("update-field","devicePointId",T),console.log("选择了点位:",{device:k.name,point:B.name,dataType:B.dataType,accessMode:B.accessMode})},a=g=>{const m=new Event("change");Object.defineProperty(m,"target",{value:{value:g},writable:!1}),s("update-field","mapping",m)},n=g=>({direct:"直接映射",boolean:"布尔映射",range:"范围映射",enum:"枚举映射"})[g]||g,u=()=>{const g=d.value;return g.type==="boolean"?`True:${g.trueValue||"true"} / False:${g.falseValue||"false"}`:g.type==="range"&&g.rangeRules?`${g.rangeRules.length} 个范围规则`:g.type==="enum"&&g.enumMappings?`${Object.keys(g.enumMappings).length} 个枚举映射`:""};return(g,m)=>(e.openBlock(),e.createElementBlock("div",Ni,[e.createElementVNode("div",{class:"event-card-header",onClick:m[1]||(m[1]=k=>g.$emit("toggle-collapse"))},[e.createElementVNode("div",Vi,[e.createElementVNode("span",xi,e.toDisplayString(i.isCollapsed?"▶":"▼"),1),e.createElementVNode("span",wi,"绑定"+e.toDisplayString(i.index+1),1)]),e.createElementVNode("button",{class:"btn-remove",onClick:m[0]||(m[0]=e.withModifiers(k=>g.$emit("remove"),["stop"])),title:"删除绑定"},"🗑")]),e.withDirectives(e.createElementVNode("div",$i,[e.createElementVNode("div",Ci,[m[10]||(m[10]=e.createElementVNode("label",null,"设备点位",-1)),e.createElementVNode("div",{class:"point-selector-trigger",onClick:m[2]||(m[2]=k=>r.value=!0)},[c.value?(e.openBlock(),e.createElementBlock("div",_i,[e.createElementVNode("div",vi,[e.createElementVNode("span",Bi,e.toDisplayString(c.value.deviceName),1),e.createElementVNode("span",Si,e.toDisplayString(c.value.pointName),1)]),e.createElementVNode("div",Di,[e.createElementVNode("span",Ii,e.toDisplayString(c.value.pointCode),1),c.value.pointUnit?(e.openBlock(),e.createElementBlock("span",Ti,e.toDisplayString(c.value.pointUnit),1)):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createElementBlock("div",zi," 点击选择设备点位 ")),m[9]||(m[9]=e.createElementVNode("span",{class:"selector-arrow"},"›",-1))])]),e.createVNode(Or,{visible:r.value,"onUpdate:visible":m[3]||(m[3]=k=>r.value=k),modelValue:t.value,"onUpdate:modelValue":m[4]||(m[4]=k=>t.value=k),onConfirm:f},null,8,["visible","modelValue"]),e.createElementVNode("div",Mi,[m[12]||(m[12]=e.createElementVNode("label",null,"目标属性",-1)),e.createElementVNode("select",{value:i.binding.targetProperty||"",onChange:m[5]||(m[5]=k=>g.$emit("update-field","targetProperty",k))},[m[11]||(m[11]=e.createElementVNode("option",{value:""},"选择属性",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.nodeProperties,k=>(e.openBlock(),e.createElementBlock("option",{key:k.key,value:k.key},e.toDisplayString(k.label),9,Pi))),128))],40,Ai)]),e.createElementVNode("div",Oi,[m[14]||(m[14]=e.createElementVNode("label",null,"值映射配置",-1)),e.createElementVNode("div",{class:"mapping-trigger",onClick:m[6]||(m[6]=k=>p.value=!0)},[d.value.type!=="direct"?(e.openBlock(),e.createElementBlock("div",Li,[e.createElementVNode("span",Ri,e.toDisplayString(n(d.value.type)),1),e.createElementVNode("span",Ui,e.toDisplayString(u()),1)])):(e.openBlock(),e.createElementBlock("div",Wi," 点击配置值映射 ")),m[13]||(m[13]=e.createElementVNode("span",{class:"selector-arrow"},"›",-1))])]),e.createVNode(Ei,{visible:p.value,"onUpdate:visible":m[7]||(m[7]=k=>p.value=k),modelValue:d.value,"onUpdate:modelValue":m[8]||(m[8]=k=>d.value=k),onConfirm:a},null,8,["visible","modelValue"])],512),[[e.vShow,!i.isCollapsed]])]))}}),[["__scopeId","data-v-3731c19a"]]),Fi={class:"dialog-content"},Gi={class:"dialog-header"},ji={class:"dialog-body"},Hi={class:"group-row"},qi={class:"group-field"},Ji=["value","onChange"],Yi=["value"],Xi={class:"group-field group-field-value"},Ki=["value","onInput"],Qi=["value","onInput"],Zi={key:2,class:"color-input-wrapper"},es=["value","onInput"],ts={class:"color-value"},os=["value","onChange"],ls=["onClick"],ns={key:0,class:"empty-hint"},as={class:"dialog-footer"},Ae=A(e.defineComponent({__name:"AttributeConfigDialog",props:{attributeGroups:{},nodeProperties:{}},emits:["close","save","add-group","remove-group","update-group"],setup(i,{emit:l}){const o=i,s=l,t=d=>{const c=o.nodeProperties.find(f=>f.key===d);return(c==null?void 0:c.type)||"text"},r=(d,c,f)=>{const a=f.target.value;s("update-group",d,c,a)},p=()=>{for(const d of o.attributeGroups)if(!d.property){alert("请为每组配置选择目标属性");return}s("save")};return(d,c)=>(e.openBlock(),e.createElementBlock("div",{class:"dialog-overlay",onClick:c[3]||(c[3]=e.withModifiers(f=>d.$emit("close"),["self"]))},[e.createElementVNode("div",Fi,[e.createElementVNode("div",Gi,[c[4]||(c[4]=e.createElementVNode("h3",null,"事件属性更改配置",-1)),e.createElementVNode("button",{class:"btn-close",onClick:c[0]||(c[0]=f=>d.$emit("close"))},"×")]),e.createElementVNode("div",ji,[e.createElementVNode("button",{class:"btn-add-group",onClick:c[1]||(c[1]=f=>d.$emit("add-group"))},"新增一组"),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.attributeGroups,(f,a)=>(e.openBlock(),e.createElementBlock("div",{key:a,class:"attribute-group"},[e.createElementVNode("div",Hi,[e.createElementVNode("div",qi,[c[6]||(c[6]=e.createElementVNode("label",null,"目标属性",-1)),e.createElementVNode("select",{value:f.property,onChange:n=>r(a,"property",n)},[c[5]||(c[5]=e.createElementVNode("option",{value:""},"选择目标属性",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.nodeProperties,n=>(e.openBlock(),e.createElementBlock("option",{key:n.key,value:n.key},e.toDisplayString(n.label),9,Yi))),128))],40,Ji)]),e.createElementVNode("div",Xi,[c[8]||(c[8]=e.createElementVNode("label",null,"期望值",-1)),!f.property||t(f.property)==="text"?(e.openBlock(),e.createElementBlock("input",{key:0,value:f.value,type:"text",onInput:n=>r(a,"value",n),placeholder:"输入值"},null,40,Ki)):t(f.property)==="number"?(e.openBlock(),e.createElementBlock("input",{key:1,value:f.value,type:"number",onInput:n=>r(a,"value",n),placeholder:"输入数字"},null,40,Qi)):t(f.property)==="color"?(e.openBlock(),e.createElementBlock("div",Zi,[e.createElementVNode("input",{value:f.value,type:"color",onInput:n=>r(a,"value",n)},null,40,es),e.createElementVNode("span",ts,e.toDisplayString(f.value||"#000000"),1)])):t(f.property)==="boolean"?(e.openBlock(),e.createElementBlock("select",{key:3,value:f.value,onChange:n=>r(a,"value",n)},[...c[7]||(c[7]=[e.createElementVNode("option",{value:"true"},"是",-1),e.createElementVNode("option",{value:"false"},"否",-1)])],40,os)):e.createCommentVNode("",!0)]),e.createElementVNode("button",{class:"btn-delete-group",onClick:n=>d.$emit("remove-group",a),title:"删除"}," 🗑 ",8,ls)])]))),128)),i.attributeGroups.length===0?(e.openBlock(),e.createElementBlock("div",ns,' 请点击"新增一组"按钮添加属性配置 ')):e.createCommentVNode("",!0)]),e.createElementVNode("div",as,[e.createElementVNode("button",{class:"btn-cancel",onClick:c[2]||(c[2]=f=>d.$emit("close"))},"取消"),e.createElementVNode("button",{class:"btn-confirm",onClick:p},"确定")])])]))}}),[["__scopeId","data-v-90af9944"]]),rs={class:"dialog-content dialog-large"},is={class:"dialog-header"},ss={class:"dialog-body dialog-body-split"},ds={class:"code-editor-section"},cs=["value"],ps={class:"code-preview-section"},ms={class:"section-header"},fs={class:"preview-status"},us={key:0,class:"status-success"},gs={key:1,class:"status-error"},hs={class:"preview-canvas"},ys={key:0,class:"preview-empty"},bs={key:1,class:"preview-error-box"},ks={class:"error-message"},Es={key:2,class:"preview-node-container"},Ns={key:0,class:"console-output"},Vs={class:"console-logs"},xs={class:"dialog-footer"},ws=`function execute(node) {
|
|
7
7
|
// 修改节点填充颜色为红色
|
|
8
8
|
node.attr('body/fill', '#ff0000');
|
|
9
9
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
// 获取当前节点位置
|
|
14
14
|
const pos = node.getPosition();
|
|
15
15
|
console.log('X:', pos.x, 'Y:', pos.y);
|
|
16
|
-
}`,
|
|
16
|
+
}`,Pe=A(e.defineComponent({__name:"CustomCodeDialog",props:{code:{},selectedNode:{}},emits:["update:code","close","save"],setup(i,{expose:l}){const o=i,s=e.ref(null),t=e.ref(null);let r=null,p=null;const d=async()=>{var u;if(!o.selectedNode){t.value={success:!1,logs:[],error:"没有选中的节点"};return}const f=(u=o.selectedNode.model)==null?void 0:u.graph;if(!f){t.value={success:!1,logs:[],error:"无法获取画布对象"};return}t.value={success:!0,logs:[],result:void 0};const a=[],n=console.log;try{if(await e.nextTick(),await c(),!p||!r){t.value={success:!1,logs:[],error:"预览画布初始化失败"};return}console.log=(...T)=>{a.push(T.map(E=>typeof E=="object"?JSON.stringify(E,null,2):String(E)).join(" ")),n(...T)};let g=o.code.trim();g.startsWith("function")&&(g=`${g}; execute(node, graph, event);`);const m=new Function("node","graph","event",g),k=new Proxy(o.selectedNode,{get(T,E){return E==="attr"?function(...b){return b.length===1?T.attr(b[0]):p?p.attr(b[0],b[1]):void 0}:T[E]}}),B=m(k,f,{});p&&r&&(p.removeTools(),r.drawBackground(),p.toJSON()),t.value={success:!0,logs:a,result:B!==void 0?typeof B=="object"?JSON.stringify(B,null,2):String(B):void 0}}catch(g){t.value={success:!1,logs:a,error:g.message||String(g)}}finally{console.log=n}},c=async()=>{var u;if(!s.value||!o.selectedNode)return;await e.nextTick();const f=s.value.clientWidth,a=s.value.clientHeight;if(f===0||a===0)return;s.value.innerHTML="",r&&(r.dispose(),r=null,p=null),r=new Q.Graph({container:s.value,width:f,height:Math.max(a-100,300),background:{color:"#0f172a"},grid:{size:10,visible:!0,type:"dot",args:{color:"#1e293b",thickness:1}},interacting:!1});const n=o.selectedNode.toJSON();try{p=r.addNode({...n,position:{x:f/2-(((u=n.size)==null?void 0:u.width)||100)/2,y:100}})}catch(g){console.error("添加预览节点失败:",g)}};return l({previewContainer:s,DEFAULT_CODE:ws}),(f,a)=>{var n,u;return e.openBlock(),e.createElementBlock("div",{class:"dialog-overlay",onClick:a[4]||(a[4]=e.withModifiers(g=>f.$emit("close"),["self"]))},[e.createElementVNode("div",rs,[e.createElementVNode("div",is,[a[5]||(a[5]=e.createElementVNode("h3",null,"自定义代码配置",-1)),e.createElementVNode("button",{class:"btn-close",onClick:a[0]||(a[0]=g=>f.$emit("close"))},"×")]),e.createElementVNode("div",ss,[e.createElementVNode("div",ds,[e.createElementVNode("div",{class:"section-header"},[a[6]||(a[6]=e.createElementVNode("label",null,"JavaScript代码",-1)),e.createElementVNode("button",{class:"btn-test",onClick:d},"测试执行")]),e.createElementVNode("textarea",{value:i.code,onInput:a[1]||(a[1]=g=>f.$emit("update:code",g.target.value)),placeholder:`function execute(node) {
|
|
17
17
|
// 修改节点填充颜色为红色
|
|
18
18
|
node.attr('body/fill', '#ff0000');
|
|
19
19
|
|
|
@@ -23,23 +23,23 @@
|
|
|
23
23
|
// 获取当前节点位置
|
|
24
24
|
const pos = node.getPosition();
|
|
25
25
|
console.log('X:', pos.x, 'Y:', pos.y);
|
|
26
|
-
}`,class:"code-textarea code-textarea-full"},null,40,Ui)]),e.createElementVNode("div",Ri,[e.createElementVNode("div",Li,[a[7]||(a[7]=e.createElementVNode("label",null,"组件预览",-1)),e.createElementVNode("div",Wi,[(o=t.value)!=null&&o.success?(e.openBlock(),e.createElementBlock("span",Fi,"✓ 执行成功")):(u=t.value)!=null&&u.error?(e.openBlock(),e.createElementBlock("span",ji,"✗ 执行失败")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Gi,[t.value?t.value.error?(e.openBlock(),e.createElementBlock("div",Ji,[a[8]||(a[8]=e.createElementVNode("div",{class:"error-title"},"错误信息:",-1)),e.createElementVNode("div",qi,e.toDisplayString(t.value.error),1)])):(e.openBlock(),e.createElementBlock("div",Yi,[e.createElementVNode("div",{ref_key:"previewContainer",ref:r,class:"node-preview"},null,512),t.value.logs.length>0?(e.openBlock(),e.createElementBlock("div",Xi,[a[9]||(a[9]=e.createElementVNode("div",{class:"console-title"},"控制台输出:",-1)),e.createElementVNode("div",Ki,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value.logs,(f,b)=>(e.openBlock(),e.createElementBlock("div",{key:b,class:"log-item"},e.toDisplayString(f),1))),128))])])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Hi,' 点击"测试执行"按钮查看组件预览效果 '))])])]),e.createElementVNode("div",Zi,[e.createElementVNode("button",{class:"btn-cancel",onClick:a[2]||(a[2]=f=>g.$emit("close"))},"取消"),e.createElementVNode("button",{class:"btn-confirm",onClick:a[3]||(a[3]=f=>g.$emit("save"))},"确定")])])])}}}),[["__scopeId","data-v-add3567b"]]),er={class:"dialog-container"},tr={class:"dialog-header"},or={class:"dialog-body"},nr={key:0,class:"empty-state"},lr={key:1,class:"workflow-list"},ar=["onClick"],sr={class:"workflow-info"},ir={class:"workflow-name"},rr={class:"workflow-meta"},dr={class:"workflow-id"},cr={class:"workflow-date"},pr={class:"workflow-actions"},mr=["onClick"],ur={class:"dialog-footer"},gr=["disabled"],fr=H(e.defineComponent({__name:"WorkflowSelectorDialog",emits:["close","select"],setup(i,{emit:l}){const n=l,r=e.ref([]),t=e.ref(null),s=()=>{try{const a=localStorage.getItem("saved-workflows");a&&(r.value=JSON.parse(a))}catch(a){console.error("加载流程列表失败:",a)}},d=a=>{t.value=a},c=a=>{console.log("预览流程:",a)},p=()=>{t.value&&n("select",t.value)},g=a=>new Date(a).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"});return e.onMounted(()=>{s()}),(a,o)=>(e.openBlock(),e.createElementBlock("div",{class:"dialog-overlay",onClick:o[2]||(o[2]=e.withModifiers(u=>a.$emit("close"),["self"]))},[e.createElementVNode("div",er,[e.createElementVNode("div",tr,[o[3]||(o[3]=e.createElementVNode("h3",null,"选择流程",-1)),e.createElementVNode("button",{class:"btn-close",onClick:o[0]||(o[0]=u=>a.$emit("close"))},"×")]),e.createElementVNode("div",or,[r.value.length===0?(e.openBlock(),e.createElementBlock("div",nr,[...o[4]||(o[4]=[e.createElementVNode("p",null,"暂无已保存的流程",-1),e.createElementVNode("p",{class:"hint"},"请先在流程编辑器中创建并保存流程",-1)])])):(e.openBlock(),e.createElementBlock("div",lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,u=>{var f;return e.openBlock(),e.createElementBlock("div",{key:u.id,class:e.normalizeClass(["workflow-item",{selected:((f=t.value)==null?void 0:f.id)===u.id}]),onClick:b=>d(u)},[e.createElementVNode("div",sr,[e.createElementVNode("div",ir,e.toDisplayString(u.name),1),e.createElementVNode("div",rr,[e.createElementVNode("span",dr,"ID: "+e.toDisplayString(u.id),1),e.createElementVNode("span",cr,e.toDisplayString(g(u.createdAt)),1)])]),e.createElementVNode("div",pr,[e.createElementVNode("button",{class:"btn-icon",onClick:e.withModifiers(b=>c(u),["stop"]),title:"预览"}," 👁️ ",8,mr)])],10,ar)}),128))]))]),e.createElementVNode("div",ur,[e.createElementVNode("button",{class:"btn-secondary",onClick:o[1]||(o[1]=u=>a.$emit("close"))},"取消"),e.createElementVNode("button",{class:"btn-primary",disabled:!t.value,onClick:p}," 确定 ",8,gr)])])]))}}),[["__scopeId","data-v-c9a88e33"]]),de={SCADA_EDITOR_DATA:"scada_editor_data",SCADA_PREVIEW_DATA:"scada_preview_data"},Me=(i,l)=>{try{const n=JSON.stringify(l);return sessionStorage.setItem(i,n),!0}catch(n){return console.error(`保存到 sessionStorage 失败 [${i}]:`,n),!1}},Qe=i=>{try{const l=sessionStorage.getItem(i);return l?JSON.parse(l):null}catch(l){return console.error(`从 sessionStorage 读取失败 [${i}]:`,l),null}},et=i=>{try{sessionStorage.removeItem(i)}catch(l){console.error(`从 sessionStorage 删除失败 [${i}]:`,l)}},Er=(i,l)=>{try{const n=JSON.stringify(l);return localStorage.setItem(i,n),!0}catch(n){return console.error(`保存到 localStorage 失败 [${i}]:`,n),!1}},yr=i=>{try{const l=localStorage.getItem(i);return l?JSON.parse(l):null}catch(l){return console.error(`从 localStorage 读取失败 [${i}]:`,l),null}},br=i=>{try{localStorage.removeItem(i)}catch(l){console.error(`从 localStorage 删除失败 [${i}]:`,l)}},tt=(i,l)=>{try{const n=JSON.stringify(i,null,2),r=new Blob([n],{type:"application/json;charset=utf-8"}),t=URL.createObjectURL(r),s=document.createElement("a");return s.href=t,s.download=`${l}.json`,s.click(),URL.revokeObjectURL(t),!0}catch(n){return console.error("导出 JSON 文件失败:",n),!1}},ze=(i="")=>{const l=Date.now(),n=Math.random().toString(36).substring(2,11);return i?`${i}_${l}_${n}`:`${l}_${n}`},ot=()=>ze("evt"),Nr=()=>ze("node"),Oe=(i,l="YYYY-MM-DD HH:mm:ss")=>{const n=new Date(i),r=n.getFullYear(),t=String(n.getMonth()+1).padStart(2,"0"),s=String(n.getDate()).padStart(2,"0"),d=String(n.getHours()).padStart(2,"0"),c=String(n.getMinutes()).padStart(2,"0"),p=String(n.getSeconds()).padStart(2,"0");return l.replace("YYYY",String(r)).replace("MM",t).replace("DD",s).replace("HH",d).replace("mm",c).replace("ss",p)},Ue=()=>Date.now(),nt=(i=50,l=50,n=400,r=300)=>({x:Math.random()*n+i,y:Math.random()*r+l}),Y=(i,l="info",n=3e3)=>{const r=document.createElement("div");r.className=`scada-toast scada-toast-${l}`,r.textContent=i,Object.assign(r.style,{position:"fixed",top:"20px",left:"50%",transform:"translateX(-50%)",padding:"12px 24px",borderRadius:"6px",fontSize:"14px",fontWeight:"500",zIndex:"10000",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",maxWidth:"80%",wordBreak:"break-word",opacity:"0",transition:"opacity 0.3s ease, transform 0.3s ease"});const s={success:{bg:"#10b981",text:"#fff"},error:{bg:"#ef4444",text:"#fff"},warning:{bg:"#f59e0b",text:"#fff"},info:{bg:"#3b82f6",text:"#fff"}}[l];r.style.backgroundColor=s.bg,r.style.color=s.text,document.body.appendChild(r),requestAnimationFrame(()=>{r.style.opacity="1"}),setTimeout(()=>{r.style.opacity="0",setTimeout(()=>{r.parentNode&&document.body.removeChild(r)},300)},n)},hr={class:"property-panel"},Vr={key:1,class:"properties"},kr={key:2,class:"properties"},Cr={class:"tabs"},$r={class:"tab-content"},vr={class:"tab-pane"},wr={class:"property-section"},Br={key:0,class:"empty-hint"},Sr={class:"event-list"},_r={class:"tab-pane"},xr={class:"property-section"},Ir={key:0,class:"empty-hint"},Dr={class:"event-list"},Re=H(e.defineComponent({__name:"PropertyPanel",props:{selectedNode:{},selectedEdge:{}},emits:["updateNode","deleteNode","updateEdge","deleteEdge"],setup(i,{emit:l}){const n=i,r=l,t=e.ref("basic"),s=e.ref([]),d=e.ref(new Set),c=e.ref([]),p=e.ref(new Set);e.watch(()=>n.selectedNode,C=>{var v,x;if((v=C==null?void 0:C.data)!=null&&v.events){const P=JSON.parse(JSON.stringify(C.data.events));P.forEach(U=>{U.id||(U.id=B())}),s.value=P}else s.value=[];d.value.clear(),(x=C==null?void 0:C.data)!=null&&x.bindings?c.value=JSON.parse(JSON.stringify(C.data.bindings)):c.value=[],p.value.clear()},{immediate:!0});const g=e.ref(0),a=e.ref(0);let o=null,u={x:0,y:0},f={width:0,height:0};e.watch(()=>n.selectedNode,C=>{if(o&&(clearInterval(o),o=null),C){const v=C.getPosition(),x=C.getSize();v&&typeof v.x=="number"&&typeof v.y=="number"?u=v:(u={x:0,y:0},console.warn("节点位置数据异常:",v)),x&&typeof x.width=="number"&&typeof x.height=="number"?f=x:(f={width:0,height:0},console.warn("节点尺寸数据异常:",x)),o=setInterval(()=>{if(n.selectedNode){const P=n.selectedNode.getPosition(),U=n.selectedNode.getSize();P&&typeof P.x=="number"&&typeof P.y=="number"&&(P.x!==u.x||P.y!==u.y)&&(u=P,g.value++),U&&typeof U.width=="number"&&typeof U.height=="number"&&(U.width!==f.width||U.height!==f.height)&&(f=U,a.value++)}},50)}}),e.onUnmounted(()=>{o&&clearInterval(o)});const b=e.computed(()=>{var v;return g.value,((v=n.selectedNode)==null?void 0:v.getPosition())||{x:0,y:0}}),S=e.computed(()=>{var v;return a.value,((v=n.selectedNode)==null?void 0:v.getSize())||{width:0,height:0}}),F=e.computed(()=>{var v;return((v=n.selectedNode)==null?void 0:v.getAttrs())||{}}),z=(C,v)=>{const x=Number(v.target.value),P=n.selectedNode.getPosition(),U=C==="x"?{x,y:P.y}:{x:P.x,y:x};r("updateNode",{position:U})},h=(C,v)=>{const x=Number(v.target.value),P=n.selectedNode.getSize(),U=C==="width"?{width:x,height:P.height}:{width:P.width,height:x};r("updateNode",{size:U})},N=C=>{const v=C.target.value;r("updateNode",{attrs:{text:{text:v},label:{text:v}}})},E=C=>{const v=C.target.value;r("updateNode",{attrs:{body:{fill:v}}})},V=C=>{const v=C.target.value;r("updateNode",{attrs:{body:{stroke:v}}})},y=C=>{const v=Number(C.target.value);r("updateNode",{attrs:{body:{strokeWidth:v}}})},D=C=>{const v=Number(C.target.value);r("updateNode",{attrs:{body:{opacity:v}}})},O=C=>{const v=C.target.value,x={...n.selectedNode.data,componentName:v};r("updateNode",{data:x})},A=(C,v)=>{if(!n.selectedNode)return;const x=C.split(".");if(x[0]==="attrs"){const P=x.slice(1).join("/");r("updateNode",{attrs:{[P]:v}})}else if(x[0]==="data"){const P=JSON.parse(JSON.stringify(n.selectedNode.data||{}));let U=P;for(let ne=1;ne<x.length-1;ne++){const je=x[ne];U[je]||(U[je]={}),U=U[je]}U[x[x.length-1]]=v,r("updateNode",{data:P})}},w=C=>{if(!n.selectedNode)return;const v={...n.selectedNode.data,dataSource:C};r("updateNode",{data:v})},B=ot,T=()=>{const C={id:B(),name:"",type:"click",conditionType:"always",action:"attributeChange",params:{}};s.value.push(C),le()},K=C=>{s.value.splice(C,1),le()},te=(C,v,x)=>{const P=x.target.value;s.value[C][v]=P,le()},ce=(C,v,x)=>{const U=x.target.value;s.value[C].condition||(s.value[C].condition={}),s.value[C].condition[v]=U,le()},Ne=(C,v,x)=>{const U=x.target.value;s.value[C].params||(s.value[C].params={}),s.value[C].params[v]=U,le()},le=()=>{s.value.forEach(v=>{v.id||(v.id=B())});const C={...n.selectedNode.data,events:s.value};r("updateNode",{data:C})},he=C=>{d.value.has(C)?d.value.delete(C):d.value.add(C)},Ve=C=>d.value.has(C),ke=()=>{const C={devicePointId:"",targetProperty:"",enabled:!0};c.value.push(C),$()},m=C=>{c.value.splice(C,1),$()},k=(C,v,x)=>{const U=x.target.value;c.value[C][v]=U,$()},$=()=>{const C={...n.selectedNode.data,bindings:c.value};r("updateNode",{data:C})},_=C=>{p.value.has(C)?p.value.delete(C):p.value.add(C)},j=C=>p.value.has(C),q=e.ref(!1),G=e.ref(-1),L=e.ref([]),M=C=>{var x;G.value=C;const v=s.value[C];(x=v.params)!=null&&x.attributeGroups&&Array.isArray(v.params.attributeGroups)?L.value=JSON.parse(JSON.stringify(v.params.attributeGroups)):L.value=[{target:"current",property:"",value:""}],q.value=!0},W=()=>{q.value=!1},J=()=>{L.value.push({target:"current",property:"",value:""})},ee=C=>{L.value.splice(C,1)},X=(C,v,x)=>{L.value[C][v]=x},pe=()=>{for(const C of L.value)if(!C.property){alert("请为每组配置选择目标属性");return}s.value[G.value].params||(s.value[G.value].params={}),s.value[G.value].params.attributeGroups=JSON.parse(JSON.stringify(L.value)),le(),W()},ye=e.ref(!1),Ce=e.ref(""),$e=e.ref(-1),jc=C=>{var x;$e.value=C;const v=s.value[C];Ce.value=((x=v.params)==null?void 0:x.code)||"",ye.value=!0},dt=()=>{ye.value=!1},Gc=()=>{s.value[$e.value].params||(s.value[$e.value].params={}),s.value[$e.value].params.code=Ce.value,le(),dt()},We=e.ref(!1),ve=e.ref(-1),Hc=C=>{ve.value=C,We.value=!0},ct=()=>{We.value=!1},Jc=C=>{s.value[ve.value].params||(s.value[ve.value].params={});const v=s.value[ve.value].params;v.processId=C.id,v.processName=C.name,v.processData=C.data,le(),ct()},Fe=()=>{var v;if(!n.selectedNode)return[];const C=[];return(v=n.selectedNode.data)!=null&&v.props&&Array.isArray(n.selectedNode.data.props)&&n.selectedNode.data.props.forEach(x=>{x.bindable!==!1&&C.push({key:x.key,label:x.label,type:x.type||"text"})}),C},qc=C=>{r("updateEdge",C)},Yc=()=>{r("deleteEdge")};return(C,v)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",hr,[!i.selectedNode&&!i.selectedEdge?(e.openBlock(),e.createBlock(_e,{key:0})):i.selectedEdge?(e.openBlock(),e.createElementBlock("div",Vr,[v[5]||(v[5]=e.createElementVNode("h3",{class:"panel-title"},"连线属性",-1)),e.createVNode(ca,{"selected-edge":i.selectedEdge,onUpdateEdge:qc,onDeleteEdge:Yc},null,8,["selected-edge"])])):i.selectedNode?(e.openBlock(),e.createElementBlock("div",kr,[v[10]||(v[10]=e.createElementVNode("h3",{class:"panel-title"},"节点属性",-1)),e.createElementVNode("div",Cr,[e.createElementVNode("button",{class:e.normalizeClass(["tab-btn",{active:t.value==="basic"}]),onClick:v[0]||(v[0]=x=>t.value="basic")}," 基础 ",2),e.createElementVNode("button",{class:e.normalizeClass(["tab-btn",{active:t.value==="data"}]),onClick:v[1]||(v[1]=x=>t.value="data")}," 数据 ",2),e.createElementVNode("button",{class:e.normalizeClass(["tab-btn",{active:t.value==="binding"}]),onClick:v[2]||(v[2]=x=>t.value="binding")}," 绑定 ",2),e.createElementVNode("button",{class:e.normalizeClass(["tab-btn",{active:t.value==="event"}]),onClick:v[3]||(v[3]=x=>t.value="event")}," 事件 ",2)]),e.createElementVNode("div",$r,[e.withDirectives(e.createVNode(xe,{"selected-node":i.selectedNode,"node-position":b.value,"node-size":S.value,"node-attrs":F.value,onUpdatePosition:z,onUpdateSize:h,onUpdateLabel:N,onUpdateFill:E,onUpdateStroke:V,onUpdateStrokeWidth:y,onUpdateOpacity:D,onUpdateComponentName:O,onUpdateDynamicProp:A},null,8,["selected-node","node-position","node-size","node-attrs"]),[[e.vShow,t.value==="basic"]]),e.withDirectives(e.createVNode(Tl,{"selected-node":i.selectedNode,onUpdateDataSource:w},null,8,["selected-node"]),[[e.vShow,t.value==="data"]]),e.withDirectives(e.createElementVNode("div",vr,[e.createElementVNode("div",wr,[e.createElementVNode("div",{class:"section-header"},[v[6]||(v[6]=e.createElementVNode("h4",null,"节点事件",-1)),e.createElementVNode("button",{class:"btn-add",onClick:T},"+ 添加事件")]),s.value.length===0?(e.openBlock(),e.createElementBlock("div",Br,[...v[7]||(v[7]=[e.createElementVNode("span",null,"暂无事件,点击上方按钮添加",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",Sr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(x,P)=>(e.openBlock(),e.createBlock(Ie,{key:P,event:x,index:P,"is-collapsed":Ve(P),"node-properties":Fe(),onToggleCollapse:U=>he(P),onRemove:U=>K(P),onUpdateField:(U,ne)=>te(P,U,ne),onUpdateCondition:(U,ne)=>ce(P,U,ne),onUpdateParams:(U,ne)=>Ne(P,U,ne),onOpenAttributeConfig:U=>M(P),onOpenCustomCode:U=>jc(P),onOpenWorkflowSelector:U=>Hc(P)},null,8,["event","index","is-collapsed","node-properties","onToggleCollapse","onRemove","onUpdateField","onUpdateCondition","onUpdateParams","onOpenAttributeConfig","onOpenCustomCode","onOpenWorkflowSelector"]))),128))])])],512),[[e.vShow,t.value==="event"]]),e.withDirectives(e.createElementVNode("div",_r,[e.createElementVNode("div",xr,[e.createElementVNode("div",{class:"section-header"},[v[8]||(v[8]=e.createElementVNode("h4",null,"数据绑定",-1)),e.createElementVNode("button",{class:"btn-add",onClick:ke},"+ 添加绑定")]),c.value.length===0?(e.openBlock(),e.createElementBlock("div",Ir,[...v[9]||(v[9]=[e.createElementVNode("span",null,"暂无绑定,点击上方按钮添加",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",Dr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(x,P)=>(e.openBlock(),e.createBlock(Te,{key:P,binding:x,index:P,"is-collapsed":j(P),"node-properties":Fe(),"event-list":s.value,onToggleCollapse:U=>_(P),onRemove:U=>m(P),onUpdateField:(U,ne)=>k(P,U,ne)},null,8,["binding","index","is-collapsed","node-properties","event-list","onToggleCollapse","onRemove","onUpdateField"]))),128))])])],512),[[e.vShow,t.value==="binding"]])])])):e.createCommentVNode("",!0)]),q.value?(e.openBlock(),e.createBlock(Pe,{key:0,"attribute-groups":L.value,"node-properties":Fe(),onClose:W,onSave:pe,onAddGroup:J,onRemoveGroup:ee,onUpdateGroup:X},null,8,["attribute-groups","node-properties"])):e.createCommentVNode("",!0),ye.value?(e.openBlock(),e.createBlock(Ae,{key:1,code:Ce.value,"onUpdate:code":v[4]||(v[4]=x=>Ce.value=x),"selected-node":i.selectedNode,onClose:dt,onSave:Gc},null,8,["code","selected-node"])):e.createCommentVNode("",!0),We.value?(e.openBlock(),e.createBlock(fr,{key:2,onClose:ct,onSelect:Jc})):e.createCommentVNode("",!0)],64))}}),[["__scopeId","data-v-7d3281c0"]]);function Le(i){const l=i.replace(/-/g,"+").replace(/_/g,"/"),n=l.length%4?"=".repeat(4-l.length%4):"",r=l+n,t=(typeof atob<"u"?atob:d=>Buffer.from(d,"base64").toString("binary"))(r),s=new Uint8Array(t.length);for(let d=0;d<t.length;d++)s[d]=t.charCodeAt(d);return s}function lt(i){const l=new ArrayBuffer(i.byteLength);return new Uint8Array(l).set(i),l}function Tr(i){const l=i.replace("-----BEGIN PUBLIC KEY-----","").replace("-----END PUBLIC KEY-----","").replace(/\s+/g,""),n=(typeof atob<"u"?atob:t=>Buffer.from(t,"base64").toString("binary"))(l),r=new Uint8Array(n.length);for(let t=0;t<n.length;t++)r[t]=n.charCodeAt(t);return r.buffer}async function Pr(i){const l=Tr(i);return await crypto.subtle.importKey("spki",l,{name:"ECDSA",namedCurve:"P-256"},!1,["verify"])}async function Ar(i,l){try{const[n,r]=i.split(".");if(!n||!r)return!1;const t=await Pr(l),s=Le(n),d=Le(r),c=lt(s),p=lt(d);return await crypto.subtle.verify({name:"ECDSA",hash:{name:"SHA-256"}},t,p,c)}catch{return!1}}async function Mr(i,l){const n=await Ar(i,l);if(!n)return null;const r=i.split(".")[0],t=Le(r),s=new TextDecoder().decode(t),d=JSON.parse(s),c=d.expiryDate?new Date().getTime()<=new Date(d.expiryDate).getTime():!0;return{company:d.company||"未知",expiryDate:d.expiryDate,isValid:!!(n&&c)}}const zr={key:0,class:"scada-footer"},Or={key:1,class:"scada-footer"},Ur={class:"footer-content"},Rr={class:"footer-left"},Lr={class:"copyright",style:{color:"#94a3b8 !important"}},Wr={key:0,class:"divider",style:{color:"#475569 !important"}},Fr={key:1,class:"license",style:{color:"#94a3b8 !important"}},jr={key:0,class:"footer-right"},Gr={class:"text",style:{color:"#94a3b8 !important"}},Hr={key:2,class:"scada-footer"},Jr={class:"footer-content"},qr={class:"footer-left"},Yr={class:"authorized-text",style:{color:"#10b981 !important"}},Xr={class:"footer-right"},Kr={key:0,class:"expiry-text",style:{color:"#94a3b8 !important"}},Zr={key:1,class:"expiry-text",style:{color:"#94a3b8 !important"}},Qr=H(e.defineComponent({__name:"Footer",props:{authCode:{default:""},publicKeyPem:{default:void 0},customFooter:{default:void 0}},setup(i){const l=i,n=e.ref(null),r=e.ref(!1);e.watch(()=>[l.authCode,l.publicKeyPem],async()=>{if(!l.authCode||!l.publicKeyPem){r.value=!1,n.value=null;return}const s=await Mr(l.authCode,l.publicKeyPem);r.value=!!(s!=null&&s.isValid),n.value=s||null},{immediate:!0});const t=e.computed(()=>r.value);return(s,d)=>{var c,p;return t.value?i.customFooter?(e.openBlock(),e.createElementBlock("footer",Or,[e.createElementVNode("div",Ur,[e.createElementVNode("div",Rr,[e.createElementVNode("span",Lr,e.toDisplayString(i.customFooter.copyright),1),i.customFooter.license?(e.openBlock(),e.createElementBlock("span",Wr,"|")):e.createCommentVNode("",!0),i.customFooter.license?(e.openBlock(),e.createElementBlock("span",Fr,e.toDisplayString(i.customFooter.license),1)):e.createCommentVNode("",!0)]),i.customFooter.contact?(e.openBlock(),e.createElementBlock("div",jr,[e.createElementVNode("span",Gr,e.toDisplayString(i.customFooter.contact),1)])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createElementBlock("footer",Hr,[e.createElementVNode("div",Jr,[e.createElementVNode("div",qr,[d[1]||(d[1]=e.createElementVNode("span",{class:"authorized-icon"},"✅",-1)),e.createElementVNode("span",Yr,"已授权: "+e.toDisplayString(((c=n.value)==null?void 0:c.company)||"未知"),1)]),e.createElementVNode("div",Xr,[(p=n.value)!=null&&p.expiryDate?(e.openBlock(),e.createElementBlock("span",Kr," 📅 有效期至: "+e.toDisplayString(n.value.expiryDate),1)):(e.openBlock(),e.createElementBlock("span",Zr," ∞ 永久授权 "))])])])):(e.openBlock(),e.createElementBlock("footer",zr,[...d[0]||(d[0]=[e.createStaticVNode('<div class="footer-content" data-v-7fd5ce26><div class="footer-left" data-v-7fd5ce26><span class="copyright" style="color:#94a3b8 !important;" data-v-7fd5ce26>© 2025 leoncheng</span><span class="divider" style="color:#475569 !important;" data-v-7fd5ce26>|</span><span class="license" style="color:#94a3b8 !important;" data-v-7fd5ce26>仅供学习研究使用,禁止商业用途</span></div><div class="footer-right" data-v-7fd5ce26><div class="contact-item" data-v-7fd5ce26><span class="icon" data-v-7fd5ce26>📧</span><span class="text" style="color:#94a3b8 !important;" data-v-7fd5ce26>nywqs@outlook.com</span></div><span class="divider" style="color:#475569 !important;" data-v-7fd5ce26>|</span><div class="contact-item" data-v-7fd5ce26><span class="icon" data-v-7fd5ce26>📱</span><span class="text" style="color:#94a3b8 !important;" data-v-7fd5ce26>18637762001</span></div></div></div>',1)])]))}}}),[["__scopeId","data-v-7fd5ce26"]]);var ae=(i=>(i.START="start",i.END="end",i.GET_PROPERTY="getProperty",i.SET_PROPERTY="setProperty",i.CONDITION="condition",i.HTTP_REQUEST="httpRequest",i.CUSTOM_CODE="customCode",i.TIMER="timer",i.CLEAR_TIMER="clearTimer",i))(ae||{});const ed={class:"dialog-body"},td={class:"search-box"},od={class:"element-list"},nd=["onClick"],ld={class:"element-icon"},ad={class:"element-info"},sd={class:"element-name"},id={class:"element-type"},rd={key:0,class:"element-check"},dd={key:0,class:"empty-state"},cd={class:"dialog-footer"},pd=["disabled"],at=H(e.defineComponent({__name:"ElementSelector",props:{visible:{type:Boolean},elements:{default:()=>[]}},emits:["close","select"],setup(i,{emit:l}){const n=i,r=l,t=e.ref(""),s=e.ref(null),d=e.computed(()=>{if(!t.value)return n.elements;const a=t.value.toLowerCase();return n.elements.filter(o=>o.name.toLowerCase().includes(a)||o.id.toLowerCase().includes(a)||o.type.toLowerCase().includes(a))}),c=a=>{s.value=a},p=()=>{t.value="",s.value=null,r("close")},g=()=>{s.value&&(r("select",s.value),p())};return(a,o)=>i.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"element-selector-overlay",onClick:p},[e.createElementVNode("div",{class:"element-selector-dialog",onClick:o[1]||(o[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dialog-header"},[o[2]||(o[2]=e.createElementVNode("h3",null,"选择图元",-1)),e.createElementVNode("button",{class:"btn-close",onClick:p},"×")]),e.createElementVNode("div",ed,[e.createElementVNode("div",td,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=u=>t.value=u),type:"text",placeholder:"搜索图元名称或ID..."},null,512),[[e.vModelText,t.value]])]),e.createElementVNode("div",od,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,u=>{var f,b;return e.openBlock(),e.createElementBlock("div",{key:u.id,class:e.normalizeClass(["element-item",{active:((f=s.value)==null?void 0:f.id)===u.id}]),onClick:S=>c(u)},[e.createElementVNode("div",ld,e.toDisplayString(u.icon),1),e.createElementVNode("div",ad,[e.createElementVNode("div",sd,e.toDisplayString(u.name),1),e.createElementVNode("div",id,e.toDisplayString(u.type),1)]),((b=s.value)==null?void 0:b.id)===u.id?(e.openBlock(),e.createElementBlock("div",rd," ✓ ")):e.createCommentVNode("",!0)],10,nd)}),128)),d.value.length===0?(e.openBlock(),e.createElementBlock("div",dd,[...o[3]||(o[3]=[e.createElementVNode("p",null,"未找到图元",-1),e.createElementVNode("p",{class:"empty-hint"},"请尝试其他搜索关键词",-1)])])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",cd,[e.createElementVNode("button",{class:"btn-secondary",onClick:p},"取消"),e.createElementVNode("button",{class:"btn-primary",disabled:!s.value,onClick:g}," 确定 ",8,pd)])])])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-882704dd"]]),md={class:"node-config"},ud={class:"config-group"},gd={class:"element-selector"},fd={class:"config-group"},Ed=["disabled"],yd=["value"],bd=H(e.defineComponent({__name:"GetPropertyConfig",props:{modelValue:{}},emits:["update:modelValue"],setup(i,{emit:l}){const n=i,r=l,t=e.reactive({elementId:n.modelValue.elementId||"",propertyName:n.modelValue.propertyName||""}),s=e.ref(""),d=e.ref(!1),c=e.ref([]),p=e.inject("canvasElementService"),g=e.computed(()=>{if(!t.elementId)return[];const f=c.value.find(b=>b.id===t.elementId);return(f==null?void 0:f.properties)||[]}),a=()=>{r("update:modelValue",{...t})},o=()=>{p&&(c.value=p.getElements()),d.value=!0},u=f=>{t.elementId=f.id,s.value=f.name,t.propertyName="",a()};return e.onMounted(()=>{if(p&&(c.value=p.getElements()),t.elementId){const f=c.value.find(b=>b.id===t.elementId);f&&(s.value=f.name)}}),(f,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",md,[e.createElementVNode("div",ud,[b[3]||(b[3]=e.createElementVNode("label",null,"图元选择",-1)),e.createElementVNode("div",gd,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":b[0]||(b[0]=S=>s.value=S),type:"text",placeholder:"点击选择按钮从画布中选择图元",readonly:""},null,512),[[e.vModelText,s.value]]),e.createElementVNode("button",{class:"btn-select",onClick:o}," 选择图元 ")])]),e.createElementVNode("div",fd,[b[5]||(b[5]=e.createElementVNode("label",null,"属性选择",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":b[1]||(b[1]=S=>t.propertyName=S),onChange:a,disabled:!t.elementId},[b[4]||(b[4]=e.createElementVNode("option",{value:""},"请先选择图元",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,S=>(e.openBlock(),e.createElementBlock("option",{key:S.key,value:S.key},e.toDisplayString(S.label),9,yd))),128))],40,Ed),[[e.vModelSelect,t.propertyName]])])]),e.createVNode(at,{visible:d.value,elements:c.value,onClose:b[2]||(b[2]=S=>d.value=!1),onSelect:u},null,8,["visible","elements"])],64))}}),[["__scopeId","data-v-fa65eb56"]]),Nd={class:"node-config"},hd={class:"config-group"},Vd={class:"element-selector"},kd={class:"config-group"},Cd=["disabled"],$d=["value"],vd={class:"config-group"},wd=H(e.defineComponent({__name:"SetPropertyConfig",props:{modelValue:{}},emits:["update:modelValue"],setup(i,{emit:l}){const n=i,r=l,t=e.reactive({elementId:n.modelValue.elementId||"",propertyName:n.modelValue.propertyName||"",value:n.modelValue.value||""}),s=e.ref(""),d=e.ref(!1),c=e.ref([]),p=e.inject("canvasElementService"),g=e.computed(()=>{if(!t.elementId)return[];const f=c.value.find(b=>b.id===t.elementId);return(f==null?void 0:f.properties)||[]}),a=()=>{r("update:modelValue",{...t})},o=()=>{p&&(c.value=p.getElements()),d.value=!0},u=f=>{t.elementId=f.id,s.value=f.name,t.propertyName="",a()};return e.onMounted(()=>{if(p&&(c.value=p.getElements()),t.elementId){const f=c.value.find(b=>b.id===t.elementId);f&&(s.value=f.name)}}),(f,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Nd,[e.createElementVNode("div",hd,[b[4]||(b[4]=e.createElementVNode("label",null,"图元选择",-1)),e.createElementVNode("div",Vd,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":b[0]||(b[0]=S=>s.value=S),type:"text",placeholder:"点击选择按钮从画布中选择图元",readonly:""},null,512),[[e.vModelText,s.value]]),e.createElementVNode("button",{class:"btn-select",onClick:o}," 选择图元 ")])]),e.createElementVNode("div",kd,[b[6]||(b[6]=e.createElementVNode("label",null,"属性选择",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":b[1]||(b[1]=S=>t.propertyName=S),onChange:a,disabled:!t.elementId},[b[5]||(b[5]=e.createElementVNode("option",{value:""},"请先选择图元",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,S=>(e.openBlock(),e.createElementBlock("option",{key:S.key,value:S.key},e.toDisplayString(S.label),9,$d))),128))],40,Cd),[[e.vModelSelect,t.propertyName]])]),e.createElementVNode("div",vd,[b[7]||(b[7]=e.createElementVNode("label",null,"属性值",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":b[2]||(b[2]=S=>t.value=S),type:"text",placeholder:"请输入属性值",onInput:a},null,544),[[e.vModelText,t.value]])])]),e.createVNode(at,{visible:d.value,elements:c.value,onClose:b[3]||(b[3]=S=>d.value=!1),onSelect:u},null,8,["visible","elements"])],64))}}),[["__scopeId","data-v-42e029d4"]]),Bd={class:"node-config"},Sd={class:"config-group"},_d={class:"config-group"},xd={class:"branches-section"},Id={class:"branch-list"},Dd={class:"branch-header"},Td={class:"branch-number"},Pd=["onClick"],Ad={key:0,class:"branch-config"},Md={class:"config-row"},zd=["onUpdate:modelValue"],Od={key:0,class:"config-row"},Ud=["onUpdate:modelValue"],Rd={key:1,class:"config-row"},Ld=["onUpdate:modelValue","type"],Wd={key:1,class:"default-branch-label"},Fd=H(e.defineComponent({__name:"ConditionConfig",props:{modelValue:{}},emits:["update:modelValue"],setup(i,{emit:l}){const n=i,r=l,t=()=>`branch_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,s=()=>n.modelValue.branches&&n.modelValue.branches.length>0?n.modelValue.branches:(n.modelValue.dataType||"boolean")==="boolean"?[{id:t(),label:"True",value:!0},{id:t(),label:"False",value:!1,isDefault:!0}]:[{id:t(),label:"分支1",operator:"eq",value:""},{id:t(),label:"默认",isDefault:!0}],d=e.reactive({sourceNodeId:n.modelValue.sourceNodeId||"prev",dataType:n.modelValue.dataType||"boolean",branches:s()}),c=()=>{r("update:modelValue",{...d})},p=()=>{d.dataType==="boolean"?d.branches=[{id:t(),label:"True",value:!0},{id:t(),label:"False",value:!1,isDefault:!0}]:d.branches=[{id:t(),label:"分支1",operator:"eq",value:""},{id:t(),label:"默认",isDefault:!0}],c()},g=()=>{const o={id:t(),label:`分支${d.branches.length}`,operator:"eq",value:""},u=d.branches.findIndex(f=>f.isDefault);u>-1?d.branches.splice(u,0,o):d.branches.push(o),c()},a=o=>{d.branches.length>2&&(d.branches.splice(o,1),c())};return(o,u)=>(e.openBlock(),e.createElementBlock("div",Bd,[e.createElementVNode("div",Sd,[u[3]||(u[3]=e.createElementVNode("label",null,"数据来源节点",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":u[0]||(u[0]=f=>d.sourceNodeId=f),onChange:c},[...u[2]||(u[2]=[e.createElementVNode("option",{value:""},"请选择数据来源节点",-1),e.createElementVNode("option",{value:"prev"},"上一个节点",-1)])],544),[[e.vModelSelect,d.sourceNodeId]])]),e.createElementVNode("div",_d,[u[5]||(u[5]=e.createElementVNode("label",null,"数据类型",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":u[1]||(u[1]=f=>d.dataType=f),onChange:p},[...u[4]||(u[4]=[e.createElementVNode("option",{value:"boolean"},"布尔类型",-1),e.createElementVNode("option",{value:"number"},"数字类型",-1),e.createElementVNode("option",{value:"string"},"字符串类型",-1),e.createElementVNode("option",{value:"any"},"自定义",-1)])],544),[[e.vModelSelect,d.dataType]])]),e.createElementVNode("div",xd,[e.createElementVNode("div",{class:"section-header"},[u[6]||(u[6]=e.createElementVNode("label",null,"条件分支",-1)),e.createElementVNode("button",{class:"btn-add",onClick:g},"添加分支")]),e.createElementVNode("div",Id,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.branches,(f,b)=>(e.openBlock(),e.createElementBlock("div",{key:f.id,class:"branch-item"},[e.createElementVNode("div",Dd,[e.createElementVNode("span",Td,"分支 "+e.toDisplayString(b+1),1),!f.isDefault&&d.branches&&d.branches.length>1?(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn-remove",onClick:S=>a(b)},"×",8,Pd)):e.createCommentVNode("",!0)]),f.isDefault?(e.openBlock(),e.createElementBlock("div",Wd," 默认分支(其他情况) ")):(e.openBlock(),e.createElementBlock("div",Ad,[e.createElementVNode("div",Md,[u[7]||(u[7]=e.createElementVNode("label",null,"分支标签",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":S=>f.label=S,type:"text",placeholder:"如: >10, =A, True",onInput:c},null,40,zd),[[e.vModelText,f.label]])]),d.dataType!=="boolean"?(e.openBlock(),e.createElementBlock("div",Od,[u[9]||(u[9]=e.createElementVNode("label",null,"运算符",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":S=>f.operator=S,onChange:c},[...u[8]||(u[8]=[e.createStaticVNode('<option value="eq" data-v-15975920>等于 (==)</option><option value="ne" data-v-15975920>不等于 (!=)</option><option value="gt" data-v-15975920>大于 (>)</option><option value="gte" data-v-15975920>大于等于 (>=)</option><option value="lt" data-v-15975920>小于 (<)</option><option value="lte" data-v-15975920>小于等于 (<=)</option><option value="contains" data-v-15975920>包含</option><option value="notContains" data-v-15975920>不包含</option>',8)])],40,Ud),[[e.vModelSelect,f.operator]])])):e.createCommentVNode("",!0),d.dataType!=="boolean"?(e.openBlock(),e.createElementBlock("div",Rd,[u[10]||(u[10]=e.createElementVNode("label",null,"比较值",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":S=>f.value=S,type:d.dataType==="number"?"number":"text",placeholder:"请输入比较值",onInput:c},null,40,Ld),[[e.vModelDynamic,f.value]])])):e.createCommentVNode("",!0)]))]))),128))])])]))}}),[["__scopeId","data-v-15975920"]]),jd={class:"node-config"},Gd={class:"config-group"},Hd={class:"config-group"},Jd={class:"config-group"},qd={class:"config-group"},Yd={class:"config-group"},Xd=H(e.defineComponent({__name:"HttpRequestConfig",props:{modelValue:{}},emits:["update:modelValue"],setup(i,{emit:l}){const n=i,r=l,t=e.reactive({url:n.modelValue.url||"",method:n.modelValue.method||"GET",headers:n.modelValue.headers||{},body:n.modelValue.body||"",outputVariable:n.modelValue.outputVariable||""}),s=e.ref(JSON.stringify(t.headers,null,2)),d=()=>{r("update:modelValue",{...t})},c=()=>{try{t.headers=JSON.parse(s.value),d()}catch{}};return e.watch(()=>n.modelValue.headers,p=>{p&&(s.value=JSON.stringify(p,null,2))}),(p,g)=>(e.openBlock(),e.createElementBlock("div",jd,[e.createElementVNode("div",Gd,[g[5]||(g[5]=e.createElementVNode("label",null,"请求URL",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":g[0]||(g[0]=a=>t.url=a),type:"text",placeholder:"请输入请求URL",onInput:d},null,544),[[e.vModelText,t.url]])]),e.createElementVNode("div",Hd,[g[7]||(g[7]=e.createElementVNode("label",null,"请求方法",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":g[1]||(g[1]=a=>t.method=a),onChange:d},[...g[6]||(g[6]=[e.createElementVNode("option",{value:"GET"},"GET",-1),e.createElementVNode("option",{value:"POST"},"POST",-1),e.createElementVNode("option",{value:"PUT"},"PUT",-1),e.createElementVNode("option",{value:"DELETE"},"DELETE",-1)])],544),[[e.vModelSelect,t.method]])]),e.createElementVNode("div",Jd,[g[8]||(g[8]=e.createElementVNode("label",null,"请求头 (JSON格式)",-1)),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":g[2]||(g[2]=a=>s.value=a),rows:"3",placeholder:'{"Content-Type": "application/json"}',onInput:c},null,544),[[e.vModelText,s.value]])]),e.createElementVNode("div",qd,[g[9]||(g[9]=e.createElementVNode("label",null,"请求体",-1)),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":g[3]||(g[3]=a=>t.body=a),rows:"4",placeholder:"请输入请求体内容",onInput:d},null,544),[[e.vModelText,t.body]])]),e.createElementVNode("div",Yd,[g[10]||(g[10]=e.createElementVNode("label",null,"输出变量",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":g[4]||(g[4]=a=>t.outputVariable=a),type:"text",placeholder:"请输入输出变量名",onInput:d},null,544),[[e.vModelText,t.outputVariable]])])]))}}),[["__scopeId","data-v-4c312eea"]]),Kd={class:"node-config"},Zd={class:"config-group"},Qd=H(e.defineComponent({__name:"CustomCodeConfig",props:{modelValue:{}},emits:["update:modelValue"],setup(i,{emit:l}){const n=i,r=l,t=e.reactive({code:n.modelValue.code||""}),s=()=>{r("update:modelValue",{...t})};return(d,c)=>(e.openBlock(),e.createElementBlock("div",Kd,[e.createElementVNode("div",Zd,[c[1]||(c[1]=e.createElementVNode("label",null,"JavaScript代码",-1)),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":c[0]||(c[0]=p=>t.code=p),rows:"10",placeholder:"请输入JavaScript代码",onInput:s},null,544),[[e.vModelText,t.code]])]),c[2]||(c[2]=e.createElementVNode("div",{class:"code-hint"},[e.createElementVNode("p",null,"提示:"),e.createElementVNode("ul",null,[e.createElementVNode("li",null,"可以使用 context 对象访问上下文变量"),e.createElementVNode("li",null,"使用 return 返回结果")])],-1))]))}}),[["__scopeId","data-v-f7115383"]]),ec={class:"node-config"},tc={class:"config-group"},oc={class:"config-group"},nc=H(e.defineComponent({__name:"TimerConfig",props:{modelValue:{}},emits:["update:modelValue"],setup(i,{emit:l}){const n=i,r=l,t=e.reactive({interval:n.modelValue.interval||1e3,unit:n.modelValue.unit||"ms"}),s=()=>{r("update:modelValue",{...t})};return(d,c)=>(e.openBlock(),e.createElementBlock("div",ec,[e.createElementVNode("div",tc,[c[2]||(c[2]=e.createElementVNode("label",null,"时间间隔",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":c[0]||(c[0]=p=>t.interval=p),type:"number",min:"1",placeholder:"请输入时间间隔",onInput:s},null,544),[[e.vModelText,t.interval,void 0,{number:!0}]])]),e.createElementVNode("div",oc,[c[4]||(c[4]=e.createElementVNode("label",null,"时间单位",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":c[1]||(c[1]=p=>t.unit=p),onChange:s},[...c[3]||(c[3]=[e.createElementVNode("option",{value:"ms"},"毫秒 (ms)",-1),e.createElementVNode("option",{value:"s"},"秒 (s)",-1),e.createElementVNode("option",{value:"m"},"分钟 (m)",-1),e.createElementVNode("option",{value:"h"},"小时 (h)",-1)])],544),[[e.vModelSelect,t.unit]])])]))}}),[["__scopeId","data-v-323381bc"]]),lc={class:"node-config"},ac={class:"config-group"},sc=["value"],ic={key:0,class:"timer-hint warning"},rc={key:1,class:"timer-hint"},dc=H(e.defineComponent({__name:"ClearTimerConfig",props:{modelValue:{}},emits:["update:modelValue"],setup(i,{emit:l}){const n=i,r=l,t=e.reactive({timerId:n.modelValue.timerId||""}),s=e.ref([]),d=e.inject("getGraph"),c=()=>{if(!d)return[];const g=d();if(!g)return[];const a=g.getNodes(),o=[];return a.forEach(u=>{const f=u.getData();if((f==null?void 0:f.nodeType)==="timer"){const b=u.getAttrByPath("label/text")||"定时器";o.push({id:u.id,label:b})}}),o};e.onMounted(()=>{s.value=c()}),e.watch(()=>n.modelValue,()=>{s.value=c()},{deep:!0});const p=()=>{r("update:modelValue",{...t})};return(g,a)=>(e.openBlock(),e.createElementBlock("div",lc,[e.createElementVNode("div",ac,[a[2]||(a[2]=e.createElementVNode("label",null,"选择定时器节点",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":a[0]||(a[0]=o=>t.timerId=o),onChange:p},[a[1]||(a[1]=e.createElementVNode("option",{value:""},"请选择要清除的定时器",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,o=>(e.openBlock(),e.createElementBlock("option",{key:o.id,value:o.id},e.toDisplayString(o.label),9,sc))),128))],544),[[e.vModelSelect,t.timerId]])]),s.value.length===0?(e.openBlock(),e.createElementBlock("div",ic,[...a[3]||(a[3]=[e.createElementVNode("p",null,"提示:当前流程中没有定时器节点",-1)])])):(e.openBlock(),e.createElementBlock("div",rc,[...a[4]||(a[4]=[e.createElementVNode("p",null,"提示:选择要清除的定时器节点",-1)])]))]))}}),[["__scopeId","data-v-d102fb63"]]),cc={[ae.GET_PROPERTY]:bd,[ae.SET_PROPERTY]:wd,[ae.CONDITION]:Fd,[ae.HTTP_REQUEST]:Xd,[ae.CUSTOM_CODE]:Qd,[ae.TIMER]:nc,[ae.CLEAR_TIMER]:dc};function pc(i){return cc[i]||null}const mc={class:"property-panel"},uc={key:0,class:"property-content"},gc={class:"property-group"},fc=["value"],Ec={class:"property-group"},yc=["value"],bc={key:0,class:"divider"},Nc={key:1,class:"property-empty"},hc=H(e.defineComponent({__name:"PropertyPanel",props:{selectedCell:{}},emits:["update:label","update:config"],setup(i,{emit:l}){const n=i,r=l,t=()=>{var a,o,u;return((u=(o=(a=n.selectedCell)==null?void 0:a.cell)==null?void 0:o.model)==null?void 0:u.graph)||null};e.provide("getGraph",t);const s=e.ref({}),d=e.computed(()=>n.selectedCell?pc(n.selectedCell.nodeType):null);e.watch(()=>n.selectedCell,a=>{if(a!=null&&a.cell){const o=a.cell.getData();s.value=(o==null?void 0:o.config)||{}}else s.value={}},{immediate:!0});const c=a=>{const o=a.target;r("update:label",o.value)},p=a=>{var o;if(s.value=a,(o=n.selectedCell)!=null&&o.cell){const u=n.selectedCell.cell.getData()||{};n.selectedCell.cell.setData({...u,config:a}),n.selectedCell.nodeType==="condition"&&a.branches&&g(a.branches)}r("update:config",a)},g=a=>{var A,w;if(!((A=n.selectedCell)!=null&&A.cell))return;const o=n.selectedCell.cell,u=(w=o.model)==null?void 0:w.graph;if(!u)return;const f=[];u.getConnectedEdges(o,{outgoing:!0}).forEach(B=>{const T=B.getSourcePortId(),K=B.getTargetCell(),te=B.getTargetPortId();T&&K&&f.push({sourcePortId:T,targetCell:K,targetPortId:te})});const S=f.length>0?f[0].targetCell:null,F=f.length>0?f[0].targetPortId:"port-in";o.getPorts().forEach(B=>{B.group==="out"&&o.removePort(B.id)});const h=30,N=60,E=Math.max(a.length,1),V=Math.max(N,E*h),y=o.size(),D=o.position(),O=V-y.height;O!==0&&o.position(D.x,D.y-O/2),o.resize(y.width,V),a.forEach((B,T)=>{o.addPort({id:`port-out-${T}`,group:"out",attrs:{circle:{r:5,magnet:!0,stroke:"#34d399",strokeWidth:2,fill:"#1e293b"},portLabel:{text:B.label||`分支${T+1}`,fontSize:10,fill:"#94a3b8"}}})}),setTimeout(()=>{S&&a.forEach((B,T)=>{u.addEdge({source:{cell:o,port:`port-out-${T}`},target:{cell:S,port:F},labels:[{attrs:{label:{text:B.label||`分支${T+1}`,fill:"#e2e8f0",fontSize:12},rect:{fill:"#334155",stroke:"#34d399",strokeWidth:1,rx:4,ry:4}},position:.5}]})})},100)};return(a,o)=>(e.openBlock(),e.createElementBlock("div",mc,[o[4]||(o[4]=e.createElementVNode("h3",null,"属性配置",-1)),i.selectedCell?(e.openBlock(),e.createElementBlock("div",uc,[e.createElementVNode("div",gc,[o[1]||(o[1]=e.createElementVNode("label",null,"节点名称",-1)),e.createElementVNode("input",{value:i.selectedCell.label,type:"text",placeholder:"输入节点名称",onInput:c},null,40,fc)]),e.createElementVNode("div",Ec,[o[2]||(o[2]=e.createElementVNode("label",null,"节点类型",-1)),e.createElementVNode("input",{value:i.selectedCell.nodeType,type:"text",readonly:"",disabled:""},null,8,yc)]),d.value?(e.openBlock(),e.createElementBlock("div",bc)):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.value),{key:1,modelValue:s.value,"onUpdate:modelValue":[o[0]||(o[0]=u=>s.value=u),p]},null,8,["modelValue"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Nc,[...o[3]||(o[3]=[e.createElementVNode("div",{class:"empty-text"},"选择节点以配置属性",-1)])]))]))}}),[["__scopeId","data-v-8304acbc"]]),Vc={class:"toolbar"},kc={class:"toolbar-right"},Cc=H(e.defineComponent({__name:"WorkflowToolbar",props:{showClose:{type:Boolean}},emits:["clear","validate","save","close"],setup(i){return(l,n)=>(e.openBlock(),e.createElementBlock("div",Vc,[n[5]||(n[5]=e.createElementVNode("div",{class:"toolbar-left"},[e.createElementVNode("h2",null,"流程编排")],-1)),e.createElementVNode("div",kc,[e.createElementVNode("button",{class:"btn-secondary",onClick:n[0]||(n[0]=r=>l.$emit("clear"))},"清空"),e.createElementVNode("button",{class:"btn-secondary",onClick:n[1]||(n[1]=r=>l.$emit("validate"))},"验证"),e.createElementVNode("button",{class:"btn-primary",onClick:n[2]||(n[2]=r=>l.$emit("save"))},"保存"),i.showClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn-close",onClick:n[3]||(n[3]=r=>l.$emit("close")),title:"关闭"},[...n[4]||(n[4]=[e.createElementVNode("span",{class:"close-icon"},"×",-1)])])):e.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-b3e0a4fc"]]),$c={class:"menu-header"},vc={class:"menu-list"},wc=["onClick"],Bc={class:"menu-item-info"},Sc={class:"menu-item-name"},_c={class:"menu-item-desc"},xc=H(e.defineComponent({__name:"AddNodeMenu",props:{visible:{type:Boolean},position:{},nodeTypes:{}},emits:["close","select"],setup(i,{emit:l}){const n=i,r=l,t=e.computed(()=>n.nodeTypes.filter(d=>d.type!=="start"&&d.type!=="end")),s=d=>{r("select",d)};return(d,c)=>(e.openBlock(),e.createElementBlock("div",null,[i.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"menu-overlay",onClick:c[0]||(c[0]=p=>d.$emit("close"))})):e.createCommentVNode("",!0),i.visible?(e.openBlock(),e.createElementBlock("div",{key:1,class:"add-node-menu",style:e.normalizeStyle({left:i.position.x+"px",top:i.position.y+"px"})},[e.createElementVNode("div",$c,[c[2]||(c[2]=e.createElementVNode("span",null,"选择节点类型",-1)),e.createElementVNode("button",{class:"btn-close",onClick:c[1]||(c[1]=p=>d.$emit("close"))},"×")]),e.createElementVNode("div",vc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,p=>(e.openBlock(),e.createElementBlock("div",{key:p.type,class:"menu-item",onClick:g=>s(p)},[e.createElementVNode("div",{class:e.normalizeClass(["menu-item-icon",`node-icon-${p.type}`])},e.toDisplayString(p.icon),3),e.createElementVNode("div",Bc,[e.createElementVNode("div",Sc,e.toDisplayString(p.name),1),e.createElementVNode("div",_c,e.toDisplayString(p.description),1)])],8,wc))),128))])],4)):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-aa6fccf8"]]);class Ic{constructor(){be(this,"graph",null)}setGraph(l){this.graph=l}getElements(){return this.graph?this.graph.getNodes().map(n=>{const r=n.getData()||{},t=r.type||n.shape,s=me.getComponent(t),d=this.getElementProperties(n,s);return{id:n.id,name:r.componentName||n.getAttrByPath("label/text")||`图元_${n.id.slice(0,8)}`,type:(s==null?void 0:s.metadata.name)||t,icon:(s==null?void 0:s.metadata.icon)||"📦",properties:d}}):(console.warn("画布实例未初始化"),[])}getElementProperties(l,n){const r=[],t=new Set;return n!=null&&n.props&&n.props.forEach(s=>{const d=s.path.split("."),c=d[d.length-1];c&&!t.has(c)&&(r.push({key:c,label:s.label||c}),t.add(c))}),r}getElementById(l){return this.getElements().find(r=>r.id===l)||null}searchElements(l){const n=this.getElements(),r=l.toLowerCase();return n.filter(t=>t.name.toLowerCase().includes(r)||t.id.toLowerCase().includes(r)||t.type.toLowerCase().includes(r))}}const st=new Ic,Dc={class:"workflow-editor"},Tc={class:"editor-main"},Pc={class:"canvas-area"},Ac=H(e.defineComponent({__name:"WorkflowEditor",props:{scadaGraph:{default:null},showClose:{type:Boolean,default:!1}},emits:["close"],setup(i){const l=i,n=e.ref([{type:"start",name:"开始",icon:"▶",description:"流程起点",color:"#52c41a"},{type:"end",name:"结束",icon:"⏹",description:"流程终点",color:"#ff4d4f"},{type:"getProperty",name:"获取图元属性",icon:"📥",description:"获取图元的属性值",color:"#1890ff"},{type:"setProperty",name:"设置图元属性",icon:"📤",description:"设置图元的属性值",color:"#13c2c2"},{type:"condition",name:"条件节点",icon:"◆",description:"条件分支判断",color:"#faad14"},{type:"httpRequest",name:"http请求",icon:"🌐",description:"HTTP网络请求",color:"#722ed1"},{type:"customCode",name:"自定义代码",icon:"💻",description:"执行自定义JavaScript代码",color:"#eb2f96"},{type:"timer",name:"定时器节点",icon:"⏰",description:"设置定时执行",color:"#52c41a"},{type:"clearTimer",name:"清除定时器",icon:"🗑",description:"清除定时器",color:"#ff4d4f"}]),r=e.ref();let t=null;l.scadaGraph&&st.setGraph(l.scadaGraph),e.provide("canvasElementService",st);const s=e.ref(null),d=e.ref(!1),c=e.ref({x:0,y:0});let p=null;const g=()=>{n.value.forEach(N=>{const E={inherit:"rect",width:150,height:60,markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"icon"},{tagName:"text",selector:"label"}],attrs:{body:{strokeWidth:1,stroke:N.color,fill:"#ffffff",rx:6,ry:6},icon:{text:N.icon,fontSize:24,fill:N.color,refX:20,refY:"50%",textAnchor:"middle",textVerticalAnchor:"middle"},label:{text:N.name,fontSize:14,fill:"#333333",refX:75,refY:"50%",textAnchor:"middle",textVerticalAnchor:"middle"}},ports:{groups:{in:{position:"left",attrs:{circle:{r:5,magnet:!0,stroke:"#10b981",strokeWidth:2,fill:"#1e293b"}}},out:{position:{name:"right"},attrs:{circle:{r:5,magnet:!0,stroke:"#10b981",strokeWidth:2,fill:"#1e293b"},portLabel:{fontSize:10,fill:"#94a3b8"}},markup:[{tagName:"circle",selector:"circle"},{tagName:"text",selector:"portLabel"}],label:{position:{name:"right",args:{x:10,y:0}}}}},items:[]},data:{nodeType:N.type}};N.type==="start"?E.ports.items=[{id:"port-out",group:"out"}]:N.type==="end"?E.ports.items=[{id:"port-in",group:"in"}]:N.type==="condition"?E.ports.items=[{id:"port-in",group:"in"},{id:"port-out-0",group:"out",args:{text:"True"}},{id:"port-out-1",group:"out",args:{text:"False"}}]:E.ports.items=[{id:"port-in",group:"in"},{id:"port-out",group:"out"}],oe.Graph.registerNode(N.type,E,!0)})},a=()=>{if(!r.value)return;g(),t=new oe.Graph({container:r.value,width:r.value.clientWidth,height:r.value.clientHeight,grid:{size:10,visible:!0,type:"dot",args:{color:"#333",thickness:1}},panning:{enabled:!0,modifiers:"shift"},mousewheel:{enabled:!0,modifiers:["ctrl","meta"]},connecting:{router:"manhattan",connector:{name:"rounded",args:{radius:8}},anchor:"center",connectionPoint:"anchor",snap:{radius:20},allowBlank:!1,allowLoop:!1,allowNode:!1,createEdge(){return new oe.Shape.Edge({attrs:{line:{stroke:"#64748b",strokeWidth:3,targetMarker:{name:"block",width:12,height:8,fill:"#64748b"}}},zIndex:0})},validateConnection({targetMagnet:E}){return!!E}},highlighting:{magnetAvailable:{name:"stroke",args:{attrs:{fill:"#34d399",stroke:"#34d399"}}}}}),t.use(new Ge.Selection({enabled:!0,rubberband:!1,showNodeSelectionBox:!0,showEdgeSelectionBox:!0,multiple:!0,movable:!0,strict:!1}));const N=E=>{var V;if(console.log("键盘事件触发:",E.key,"selectedCell存在:",!!s.value),E.key==="Delete"||E.key==="Backspace"){if(!t){console.log("graph不存在,无法删除");return}if((V=s.value)!=null&&V.cell){E.preventDefault();const D=s.value.cell;console.log("删除选中的节点:",s.value.label);const O=t.getIncomingEdges(D),A=t.getOutgoingEdges(D);O&&O.length>0&&A&&A.length>0&&O.forEach(w=>{const B=w.getSourceCell(),T=w.getSourcePortId();A.forEach(K=>{const te=K.getTargetCell(),ce=K.getTargetPortId();B&&te&&t&&(t.addEdge({source:{cell:B,port:T},target:{cell:te,port:ce}}),console.log("已连接前后节点"))})}),t.removeCells([D]),s.value=null,console.log("已删除节点");return}const y=t.getSelectedCells();console.log("选中的cells数量:",y.length,y),y.length?(E.preventDefault(),t.removeCells(y),console.log("已删除cells")):console.log("没有选中的cells")}};document.addEventListener("keydown",N),t.on("node:click",({node:E})=>{var D;const V=E.getAttrByPath("label/text")||"",y=((D=E.getData())==null?void 0:D.nodeType)||E.shape||"";s.value={label:V,nodeType:y,cell:E},console.log("节点已点击,保存到selectedCell:",V)}),t.on("blank:click",()=>{s.value=null,t&&t.cleanSelection()}),t.on("edge:mouseenter",({edge:E})=>{E.setAttrs({line:{stroke:"#10b981",strokeWidth:4}}),E.addTools([{name:"button",args:{markup:[{tagName:"circle",selector:"button",attrs:{r:12,stroke:"#10b981",strokeWidth:2,fill:"#1e293b",cursor:"pointer"}},{tagName:"path",selector:"icon",attrs:{d:"M -5 0 L 5 0 M 0 -5 L 0 5",stroke:"#10b981",strokeWidth:2,fill:"none",pointerEvents:"none"}}],distance:.5,onClick:({e:V,view:y})=>{p=y.cell,d.value=!0,c.value={x:V.clientX,y:V.clientY}}}},{name:"vertices"}])}),t.on("edge:mouseleave",({edge:E})=>{E.setAttrs({line:{stroke:"#64748b",strokeWidth:3}}),E.removeTools()}),t.on("edge:connected",({isNew:E,edge:V})=>{E&&V.setAttrs({line:{stroke:"#64748b",strokeWidth:3}})}),t.on("node:selected",({node:E})=>{E.toFront()}),t.on("edge:selected",({edge:E})=>{E.toFront()}),o()},o=()=>{if(!t)return;const N=t.addNode({shape:"start",x:100,y:200,label:"开始",data:{nodeType:"start"}}),E=t.addNode({shape:"end",x:500,y:200,label:"结束",data:{nodeType:"end"}});t.addEdge({source:{cell:N,port:"port-out"},target:{cell:E,port:"port-in"}})},u=N=>{var E;(E=s.value)!=null&&E.cell&&(s.value.label=N,s.value.cell.setAttrByPath("label/text",N))},f=N=>{if(!t||!p)return;const E=p.getSourceCell(),V=p.getTargetCell();if(!E||!V)return;const y=E.position(),D=V.position(),O=(y.x+D.x)/2,A=(y.y+D.y)/2,w=t.addNode({shape:N.type,x:O,y:A,label:N.name,data:{nodeType:N.type}});p.remove(),t.addEdge({source:{cell:E,port:"port-out"},target:{cell:w,port:"port-in"}}),N.type==="condition"?(t.addEdge({source:{cell:w,port:"port-out-0"},target:{cell:V,port:"port-in"},labels:[{attrs:{label:{text:"True",fill:"#e2e8f0",fontSize:12},rect:{fill:"#334155",stroke:"#64748b",strokeWidth:1,rx:4,ry:4}},position:.5}]}),t.addEdge({source:{cell:w,port:"port-out-1"},target:{cell:V,port:"port-in"},labels:[{attrs:{label:{text:"False",fill:"#e2e8f0",fontSize:12},rect:{fill:"#334155",stroke:"#64748b",strokeWidth:1,rx:4,ry:4}},position:.5}]})):t.addEdge({source:{cell:w,port:"port-out"},target:{cell:V,port:"port-in"}}),d.value=!1,p=null},b=()=>{t&&t.clearCells()},S=()=>{if(!t)return console.log("画布不存在"),{errors:["画布不存在"],warnings:[]};const N=[],E=[],V=t.getNodes(),y=V.filter(O=>{var A;return((A=O.getData())==null?void 0:A.nodeType)==="start"});return y.length===0?N.push("流程中缺少开始节点"):y.length>1&&E.push("流程中有多个开始节点"),V.filter(O=>{var A;return((A=O.getData())==null?void 0:A.nodeType)==="end"}).length===0&&E.push("流程中缺少结束节点"),V.forEach(O=>{const A=O.getData(),w=A==null?void 0:A.nodeType,B=(A==null?void 0:A.config)||{},T=O.getAttrByPath("label/text")||"未命名节点";(w==="getProperty"||w==="setProperty")&&(B.elementId||N.push(`节点「${T}」未配置图元`),B.propertyName||N.push(`节点「${T}」未配置属性`),w==="setProperty"&&!B.value&&E.push(`节点「${T}」未配置属性值`)),w==="httpRequest"&&(B.url||N.push(`节点「${T}」未配置请求URL`)),w==="condition"&&(!B.branches||B.branches.length===0)&&N.push(`节点「${T}」未配置条件分支`),w==="timer"&&(!B.interval||B.interval<=0)&&N.push(`节点「${T}」未配置有效的时间间隔`),w==="clearTimer"&&(B.timerId||N.push(`节点「${T}」未选择定时器`)),w==="customCode"&&(B.code||E.push(`节点「${T}」未编写代码`))}),V.forEach(O=>{var B;const A=(B=O.getData())==null?void 0:B.nodeType,w=O.getAttrByPath("label/text")||"未命名节点";if(A==="start"&&t){const T=t.getOutgoingEdges(O);(!T||T.length===0)&&N.push(`开始节点「${w}」没有连接到下一个节点`)}if(A==="end"&&t){const T=t.getOutgoingEdges(O);T&&T.length>0&&E.push(`结束节点「${w}」不应该有输出连线`)}if(A!=="start"&&A!=="end"&&t){const T=t.getIncomingEdges(O),K=t.getOutgoingEdges(O);(!T||T.length===0)&&E.push(`节点「${w}」没有输入连线`),A!=="clearTimer"&&(!K||K.length===0)&&E.push(`节点「${w}」没有输出连线`)}}),t&&V.forEach(O=>{var K;const A=t.getIncomingEdges(O),w=t.getOutgoingEdges(O),B=(K=O.getData())==null?void 0:K.nodeType,T=O.getAttrByPath("label/text")||"未命名节点";B!=="start"&&(!A||A.length===0)&&(!w||w.length===0)&&E.push(`节点「${T}」是孤立节点`)}),{errors:N,warnings:E}},F=()=>{const{errors:N,warnings:E}=S();if(N.length===0&&E.length===0)alert("✓ 流程验证通过!"),console.log("流程验证通过");else{let V="";N.length>0&&(V+=`错误:
|
|
27
|
-
`+
|
|
28
|
-
`)),
|
|
26
|
+
}`,class:"code-textarea code-textarea-full"},null,40,cs)]),e.createElementVNode("div",ps,[e.createElementVNode("div",ms,[a[7]||(a[7]=e.createElementVNode("label",null,"组件预览",-1)),e.createElementVNode("div",fs,[(n=t.value)!=null&&n.success?(e.openBlock(),e.createElementBlock("span",us,"✓ 执行成功")):(u=t.value)!=null&&u.error?(e.openBlock(),e.createElementBlock("span",gs,"✗ 执行失败")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",hs,[t.value?t.value.error?(e.openBlock(),e.createElementBlock("div",bs,[a[8]||(a[8]=e.createElementVNode("div",{class:"error-title"},"错误信息:",-1)),e.createElementVNode("div",ks,e.toDisplayString(t.value.error),1)])):(e.openBlock(),e.createElementBlock("div",Es,[e.createElementVNode("div",{ref_key:"previewContainer",ref:s,class:"node-preview"},null,512),t.value.logs.length>0?(e.openBlock(),e.createElementBlock("div",Ns,[a[9]||(a[9]=e.createElementVNode("div",{class:"console-title"},"控制台输出:",-1)),e.createElementVNode("div",Vs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value.logs,(g,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"log-item"},e.toDisplayString(g),1))),128))])])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",ys,' 点击"测试执行"按钮查看组件预览效果 '))])])]),e.createElementVNode("div",xs,[e.createElementVNode("button",{class:"btn-cancel",onClick:a[2]||(a[2]=g=>f.$emit("close"))},"取消"),e.createElementVNode("button",{class:"btn-confirm",onClick:a[3]||(a[3]=g=>f.$emit("save"))},"确定")])])])}}}),[["__scopeId","data-v-add3567b"]]),$s={class:"dialog-container"},Cs={class:"dialog-header"},_s={class:"dialog-body"},vs={key:0,class:"empty-state"},Bs={key:1,class:"workflow-list"},Ss=["onClick"],Ds={class:"workflow-info"},Is={class:"workflow-name"},Ts={class:"workflow-meta"},zs={class:"workflow-id"},Ms={class:"workflow-date"},As={class:"workflow-actions"},Ps=["onClick"],Os={class:"dialog-footer"},Ls=["disabled"],Rs=A(e.defineComponent({__name:"WorkflowSelectorDialog",emits:["close","select"],setup(i,{emit:l}){const o=l,s=e.ref([]),t=e.ref(null),r=()=>{try{const a=localStorage.getItem("saved-workflows");a&&(s.value=JSON.parse(a))}catch(a){console.error("加载流程列表失败:",a)}},p=a=>{t.value=a},d=a=>{console.log("预览流程:",a)},c=()=>{t.value&&o("select",t.value)},f=a=>new Date(a).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"});return e.onMounted(()=>{r()}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:"dialog-overlay",onClick:n[2]||(n[2]=e.withModifiers(u=>a.$emit("close"),["self"]))},[e.createElementVNode("div",$s,[e.createElementVNode("div",Cs,[n[3]||(n[3]=e.createElementVNode("h3",null,"选择流程",-1)),e.createElementVNode("button",{class:"btn-close",onClick:n[0]||(n[0]=u=>a.$emit("close"))},"×")]),e.createElementVNode("div",_s,[s.value.length===0?(e.openBlock(),e.createElementBlock("div",vs,[...n[4]||(n[4]=[e.createElementVNode("p",null,"暂无已保存的流程",-1),e.createElementVNode("p",{class:"hint"},"请先在流程编辑器中创建并保存流程",-1)])])):(e.openBlock(),e.createElementBlock("div",Bs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,u=>{var g;return e.openBlock(),e.createElementBlock("div",{key:u.id,class:e.normalizeClass(["workflow-item",{selected:((g=t.value)==null?void 0:g.id)===u.id}]),onClick:m=>p(u)},[e.createElementVNode("div",Ds,[e.createElementVNode("div",Is,e.toDisplayString(u.name),1),e.createElementVNode("div",Ts,[e.createElementVNode("span",zs,"ID: "+e.toDisplayString(u.id),1),e.createElementVNode("span",Ms,e.toDisplayString(f(u.createdAt)),1)])]),e.createElementVNode("div",As,[e.createElementVNode("button",{class:"btn-icon",onClick:e.withModifiers(m=>d(u),["stop"]),title:"预览"}," 👁️ ",8,Ps)])],10,Ss)}),128))]))]),e.createElementVNode("div",Os,[e.createElementVNode("button",{class:"btn-secondary",onClick:n[1]||(n[1]=u=>a.$emit("close"))},"取消"),e.createElementVNode("button",{class:"btn-primary",disabled:!t.value,onClick:c}," 确定 ",8,Ls)])])]))}}),[["__scopeId","data-v-c9a88e33"]]),de={SCADA_EDITOR_DATA:"scada_editor_data",SCADA_PREVIEW_DATA:"scada_preview_data"},Oe=(i,l)=>{try{const o=JSON.stringify(l);return sessionStorage.setItem(i,o),!0}catch(o){return console.error(`保存到 sessionStorage 失败 [${i}]:`,o),!1}},kt=i=>{try{const l=sessionStorage.getItem(i);return l?JSON.parse(l):null}catch(l){return console.error(`从 sessionStorage 读取失败 [${i}]:`,l),null}},Et=i=>{try{sessionStorage.removeItem(i)}catch(l){console.error(`从 sessionStorage 删除失败 [${i}]:`,l)}},Us=(i,l)=>{try{const o=JSON.stringify(l);return localStorage.setItem(i,o),!0}catch(o){return console.error(`保存到 localStorage 失败 [${i}]:`,o),!1}},Ws=i=>{try{const l=localStorage.getItem(i);return l?JSON.parse(l):null}catch(l){return console.error(`从 localStorage 读取失败 [${i}]:`,l),null}},Fs=i=>{try{localStorage.removeItem(i)}catch(l){console.error(`从 localStorage 删除失败 [${i}]:`,l)}},Nt=(i,l)=>{try{const o=JSON.stringify(i,null,2),s=new Blob([o],{type:"application/json;charset=utf-8"}),t=URL.createObjectURL(s),r=document.createElement("a");return r.href=t,r.download=`${l}.json`,r.click(),URL.revokeObjectURL(t),!0}catch(o){return console.error("导出 JSON 文件失败:",o),!1}},Le=(i="")=>{const l=Date.now(),o=Math.random().toString(36).substring(2,11);return i?`${i}_${l}_${o}`:`${l}_${o}`},Vt=()=>Le("evt"),Gs=()=>Le("node"),Re=(i,l="YYYY-MM-DD HH:mm:ss")=>{const o=new Date(i),s=o.getFullYear(),t=String(o.getMonth()+1).padStart(2,"0"),r=String(o.getDate()).padStart(2,"0"),p=String(o.getHours()).padStart(2,"0"),d=String(o.getMinutes()).padStart(2,"0"),c=String(o.getSeconds()).padStart(2,"0");return l.replace("YYYY",String(s)).replace("MM",t).replace("DD",r).replace("HH",p).replace("mm",d).replace("ss",c)},Ue=()=>Date.now(),xt=(i=50,l=50,o=400,s=300)=>({x:Math.random()*o+i,y:Math.random()*s+l}),Y=(i,l="info",o=3e3)=>{const s=document.createElement("div");s.className=`scada-toast scada-toast-${l}`,s.textContent=i,Object.assign(s.style,{position:"fixed",top:"20px",left:"50%",transform:"translateX(-50%)",padding:"12px 24px",borderRadius:"6px",fontSize:"14px",fontWeight:"500",zIndex:"10000",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",maxWidth:"80%",wordBreak:"break-word",opacity:"0",transition:"opacity 0.3s ease, transform 0.3s ease"});const r={success:{bg:"#10b981",text:"#fff"},error:{bg:"#ef4444",text:"#fff"},warning:{bg:"#f59e0b",text:"#fff"},info:{bg:"#3b82f6",text:"#fff"}}[l];s.style.backgroundColor=r.bg,s.style.color=r.text,document.body.appendChild(s),requestAnimationFrame(()=>{s.style.opacity="1"}),setTimeout(()=>{s.style.opacity="0",setTimeout(()=>{s.parentNode&&document.body.removeChild(s)},300)},o)},js={class:"property-panel"},Hs={key:1,class:"properties"},qs={key:2,class:"properties"},Js={class:"tabs"},Ys={class:"tab-content"},Xs={class:"tab-pane"},Ks={class:"property-section"},Qs={key:0,class:"empty-hint"},Zs={class:"event-list"},ed={class:"tab-pane"},td={class:"property-section"},od={key:0,class:"empty-hint"},ld={class:"event-list"},We=A(e.defineComponent({__name:"PropertyPanel",props:{selectedNode:{},selectedEdge:{}},emits:["updateNode","deleteNode","updateEdge","deleteEdge"],setup(i,{emit:l}){const o=i,s=l,t=e.ref("basic"),r=e.ref([]),p=e.ref(new Set),d=e.ref([]),c=e.ref(new Set);e.watch(()=>o.selectedNode,w=>{var C,D;if((C=w==null?void 0:w.data)!=null&&C.events){const P=JSON.parse(JSON.stringify(w.data.events));P.forEach(U=>{U.id||(U.id=v())}),r.value=P}else r.value=[];p.value.clear(),(D=w==null?void 0:w.data)!=null&&D.bindings?d.value=JSON.parse(JSON.stringify(w.data.bindings)):d.value=[],c.value.clear()},{immediate:!0});const f=e.ref(0),a=e.ref(0);let n=null,u={x:0,y:0},g={width:0,height:0};e.watch(()=>o.selectedNode,w=>{if(n&&(clearInterval(n),n=null),w){const C=w.getPosition(),D=w.getSize();C&&typeof C.x=="number"&&typeof C.y=="number"?u=C:(u={x:0,y:0},console.warn("节点位置数据异常:",C)),D&&typeof D.width=="number"&&typeof D.height=="number"?g=D:(g={width:0,height:0},console.warn("节点尺寸数据异常:",D)),n=setInterval(()=>{if(o.selectedNode){const P=o.selectedNode.getPosition(),U=o.selectedNode.getSize();P&&typeof P.x=="number"&&typeof P.y=="number"&&(P.x!==u.x||P.y!==u.y)&&(u=P,f.value++),U&&typeof U.width=="number"&&typeof U.height=="number"&&(U.width!==g.width||U.height!==g.height)&&(g=U,a.value++)}},50)}}),e.onUnmounted(()=>{n&&clearInterval(n)});const m=e.computed(()=>{var C;return f.value,((C=o.selectedNode)==null?void 0:C.getPosition())||{x:0,y:0}}),k=e.computed(()=>{var C;return a.value,((C=o.selectedNode)==null?void 0:C.getSize())||{width:0,height:0}}),B=e.computed(()=>{var C;return((C=o.selectedNode)==null?void 0:C.getAttrs())||{}}),T=(w,C)=>{const D=Number(C.target.value),P=o.selectedNode.getPosition(),U=w==="x"?{x:D,y:P.y}:{x:P.x,y:D};s("updateNode",{position:U})},E=(w,C)=>{const D=Number(C.target.value),P=o.selectedNode.getSize(),U=w==="width"?{width:D,height:P.height}:{width:P.width,height:D};s("updateNode",{size:U})},b=w=>{const C=w.target.value;s("updateNode",{attrs:{text:{text:C},label:{text:C}}})},h=w=>{const C=w.target.value;s("updateNode",{attrs:{body:{fill:C}}})},N=w=>{const C=w.target.value;s("updateNode",{attrs:{body:{stroke:C}}})},V=w=>{const C=Number(w.target.value);s("updateNode",{attrs:{body:{strokeWidth:C}}})},z=w=>{const C=Number(w.target.value);s("updateNode",{attrs:{body:{opacity:C}}})},R=w=>{const C=w.target.value,D={...o.selectedNode.data,componentName:C};s("updateNode",{data:D})},O=(w,C)=>{if(!o.selectedNode)return;const D=w.split(".");if(D[0]==="attrs"){const P=D.slice(1).join("/");s("updateNode",{attrs:{[P]:C}})}else if(D[0]==="data"){const P=JSON.parse(JSON.stringify(o.selectedNode.data||{}));let U=P;for(let ne=1;ne<D.length-1;ne++){const He=D[ne];U[He]||(U[He]={}),U=U[He]}U[D[D.length-1]]=C,console.log("[PropertyPanel] 更新属性:",w,"=",C),console.log("[PropertyPanel] 节点类型:",o.selectedNode.shape),w==="data.presetId"&&o.selectedNode.shape==="echarts-vue"&&console.log("[PropertyPanel] 检测到预设切换,只更新 presetId"),s("updateNode",{data:P})}},_=w=>{if(!o.selectedNode)return;const C={...o.selectedNode.data,dataSource:w};s("updateNode",{data:C})},v=Vt,M=()=>{const w={id:v(),name:"",type:"click",conditionType:"always",action:"attributeChange",params:{}};r.value.push(w),ae()},K=w=>{r.value.splice(w,1),ae()},le=(w,C,D)=>{const P=D.target.value;r.value[w][C]=P,ae()},ce=(w,C,D)=>{const U=D.target.value;r.value[w].condition||(r.value[w].condition={}),r.value[w].condition[C]=U,ae()},Ee=(w,C,D)=>{const U=D.target.value;r.value[w].params||(r.value[w].params={}),r.value[w].params[C]=U,ae()},ae=()=>{r.value.forEach(C=>{C.id||(C.id=v())});const w={...o.selectedNode.data,events:r.value};s("updateNode",{data:w})},Ne=w=>{p.value.has(w)?p.value.delete(w):p.value.add(w)},Ve=w=>p.value.has(w),xe=()=>{const w={devicePointId:"",targetProperty:"",enabled:!0};d.value.push(w),$()},y=w=>{d.value.splice(w,1),$()},x=(w,C,D)=>{const U=D.target.value;d.value[w][C]=U,$()},$=()=>{const w={...o.selectedNode.data,bindings:d.value};s("updateNode",{data:w})},S=w=>{c.value.has(w)?c.value.delete(w):c.value.add(w)},j=w=>c.value.has(w),J=e.ref(!1),H=e.ref(-1),F=e.ref([]),L=w=>{var D;H.value=w;const C=r.value[w];(D=C.params)!=null&&D.attributeGroups&&Array.isArray(C.params.attributeGroups)?F.value=JSON.parse(JSON.stringify(C.params.attributeGroups)):F.value=[{target:"current",property:"",value:""}],J.value=!0},G=()=>{J.value=!1},q=()=>{F.value.push({target:"current",property:"",value:""})},oe=w=>{F.value.splice(w,1)},X=(w,C,D)=>{F.value[w][C]=D},pe=()=>{for(const w of F.value)if(!w.property){alert("请为每组配置选择目标属性");return}r.value[H.value].params||(r.value[H.value].params={}),r.value[H.value].params.attributeGroups=JSON.parse(JSON.stringify(F.value)),ae(),G()},ye=e.ref(!1),we=e.ref(""),$e=e.ref(-1),bu=w=>{var D;$e.value=w;const C=r.value[w];we.value=((D=C.params)==null?void 0:D.code)||"",ye.value=!0},Bt=()=>{ye.value=!1},ku=()=>{r.value[$e.value].params||(r.value[$e.value].params={}),r.value[$e.value].params.code=we.value,ae(),Bt()},Ge=e.ref(!1),Ce=e.ref(-1),Eu=w=>{Ce.value=w,Ge.value=!0},St=()=>{Ge.value=!1},Nu=w=>{r.value[Ce.value].params||(r.value[Ce.value].params={});const C=r.value[Ce.value].params;C.processId=w.id,C.processName=w.name,C.processData=w.data,ae(),St()},je=()=>{var C;if(!o.selectedNode)return[];const w=[];return(C=o.selectedNode.data)!=null&&C.props&&Array.isArray(o.selectedNode.data.props)&&o.selectedNode.data.props.forEach(D=>{D.bindable!==!1&&w.push({key:D.key,label:D.label,type:D.type||"text"})}),w},Vu=w=>{s("updateEdge",w)},xu=()=>{s("deleteEdge")};return(w,C)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",js,[!i.selectedNode&&!i.selectedEdge?(e.openBlock(),e.createBlock(De,{key:0})):i.selectedEdge?(e.openBlock(),e.createElementBlock("div",Hs,[C[5]||(C[5]=e.createElementVNode("h3",{class:"panel-title"},"连线属性",-1)),e.createVNode(Ma,{"selected-edge":i.selectedEdge,onUpdateEdge:Vu,onDeleteEdge:xu},null,8,["selected-edge"])])):i.selectedNode?(e.openBlock(),e.createElementBlock("div",qs,[C[10]||(C[10]=e.createElementVNode("h3",{class:"panel-title"},"节点属性",-1)),e.createElementVNode("div",Js,[e.createElementVNode("button",{class:e.normalizeClass(["tab-btn",{active:t.value==="basic"}]),onClick:C[0]||(C[0]=D=>t.value="basic")}," 基础 ",2),e.createElementVNode("button",{class:e.normalizeClass(["tab-btn",{active:t.value==="data"}]),onClick:C[1]||(C[1]=D=>t.value="data")}," 数据 ",2),e.createElementVNode("button",{class:e.normalizeClass(["tab-btn",{active:t.value==="binding"}]),onClick:C[2]||(C[2]=D=>t.value="binding")}," 绑定 ",2),e.createElementVNode("button",{class:e.normalizeClass(["tab-btn",{active:t.value==="event"}]),onClick:C[3]||(C[3]=D=>t.value="event")}," 事件 ",2)]),e.createElementVNode("div",Ys,[e.withDirectives(e.createVNode(Ie,{"selected-node":i.selectedNode,"node-position":m.value,"node-size":k.value,"node-attrs":B.value,onUpdatePosition:T,onUpdateSize:E,onUpdateLabel:b,onUpdateFill:h,onUpdateStroke:N,onUpdateStrokeWidth:V,onUpdateOpacity:z,onUpdateComponentName:R,onUpdateDynamicProp:O},null,8,["selected-node","node-position","node-size","node-attrs"]),[[e.vShow,t.value==="basic"]]),e.withDirectives(e.createVNode(na,{"selected-node":i.selectedNode,onUpdateDataSource:_},null,8,["selected-node"]),[[e.vShow,t.value==="data"]]),e.withDirectives(e.createElementVNode("div",Xs,[e.createElementVNode("div",Ks,[e.createElementVNode("div",{class:"section-header"},[C[6]||(C[6]=e.createElementVNode("h4",null,"节点事件",-1)),e.createElementVNode("button",{class:"btn-add",onClick:M},"+ 添加事件")]),r.value.length===0?(e.openBlock(),e.createElementBlock("div",Qs,[...C[7]||(C[7]=[e.createElementVNode("span",null,"暂无事件,点击上方按钮添加",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",Zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(D,P)=>(e.openBlock(),e.createBlock(Te,{key:P,event:D,index:P,"is-collapsed":Ve(P),"node-properties":je(),onToggleCollapse:U=>Ne(P),onRemove:U=>K(P),onUpdateField:(U,ne)=>le(P,U,ne),onUpdateCondition:(U,ne)=>ce(P,U,ne),onUpdateParams:(U,ne)=>Ee(P,U,ne),onOpenAttributeConfig:U=>L(P),onOpenCustomCode:U=>bu(P),onOpenWorkflowSelector:U=>Eu(P)},null,8,["event","index","is-collapsed","node-properties","onToggleCollapse","onRemove","onUpdateField","onUpdateCondition","onUpdateParams","onOpenAttributeConfig","onOpenCustomCode","onOpenWorkflowSelector"]))),128))])])],512),[[e.vShow,t.value==="event"]]),e.withDirectives(e.createElementVNode("div",ed,[e.createElementVNode("div",td,[e.createElementVNode("div",{class:"section-header"},[C[8]||(C[8]=e.createElementVNode("h4",null,"数据绑定",-1)),e.createElementVNode("button",{class:"btn-add",onClick:xe},"+ 添加绑定")]),d.value.length===0?(e.openBlock(),e.createElementBlock("div",od,[...C[9]||(C[9]=[e.createElementVNode("span",null,"暂无绑定,点击上方按钮添加",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",ld,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(D,P)=>(e.openBlock(),e.createBlock(Me,{key:P,binding:D,index:P,"is-collapsed":j(P),"node-properties":je(),"event-list":r.value,onToggleCollapse:U=>S(P),onRemove:U=>y(P),onUpdateField:(U,ne)=>x(P,U,ne)},null,8,["binding","index","is-collapsed","node-properties","event-list","onToggleCollapse","onRemove","onUpdateField"]))),128))])])],512),[[e.vShow,t.value==="binding"]])])])):e.createCommentVNode("",!0)]),J.value?(e.openBlock(),e.createBlock(Ae,{key:0,"attribute-groups":F.value,"node-properties":je(),onClose:G,onSave:pe,onAddGroup:q,onRemoveGroup:oe,onUpdateGroup:X},null,8,["attribute-groups","node-properties"])):e.createCommentVNode("",!0),ye.value?(e.openBlock(),e.createBlock(Pe,{key:1,code:we.value,"onUpdate:code":C[4]||(C[4]=D=>we.value=D),"selected-node":i.selectedNode,onClose:Bt,onSave:ku},null,8,["code","selected-node"])):e.createCommentVNode("",!0),Ge.value?(e.openBlock(),e.createBlock(Rs,{key:2,onClose:St,onSelect:Nu})):e.createCommentVNode("",!0)],64))}}),[["__scopeId","data-v-78ade73d"]]);function Fe(i){const l=i.replace(/-/g,"+").replace(/_/g,"/"),o=l.length%4?"=".repeat(4-l.length%4):"",s=l+o,t=(typeof atob<"u"?atob:p=>Buffer.from(p,"base64").toString("binary"))(s),r=new Uint8Array(t.length);for(let p=0;p<t.length;p++)r[p]=t.charCodeAt(p);return r}function wt(i){const l=new ArrayBuffer(i.byteLength);return new Uint8Array(l).set(i),l}function nd(i){const l=i.replace("-----BEGIN PUBLIC KEY-----","").replace("-----END PUBLIC KEY-----","").replace(/\s+/g,""),o=(typeof atob<"u"?atob:t=>Buffer.from(t,"base64").toString("binary"))(l),s=new Uint8Array(o.length);for(let t=0;t<o.length;t++)s[t]=o.charCodeAt(t);return s.buffer}async function ad(i){const l=nd(i);return await crypto.subtle.importKey("spki",l,{name:"ECDSA",namedCurve:"P-256"},!1,["verify"])}async function rd(i,l){try{const[o,s]=i.split(".");if(!o||!s)return!1;const t=await ad(l),r=Fe(o),p=Fe(s),d=wt(r),c=wt(p);return await crypto.subtle.verify({name:"ECDSA",hash:{name:"SHA-256"}},t,c,d)}catch{return!1}}async function id(i,l){const o=await rd(i,l);if(!o)return null;const s=i.split(".")[0],t=Fe(s),r=new TextDecoder().decode(t),p=JSON.parse(r),d=p.expiryDate?new Date().getTime()<=new Date(p.expiryDate).getTime():!0;return{company:p.company||"未知",expiryDate:p.expiryDate,isValid:!!(o&&d)}}const sd={key:0,class:"scada-footer"},dd={key:1,class:"scada-footer"},cd={class:"footer-content"},pd={class:"footer-left"},md={class:"copyright",style:{color:"#94a3b8 !important"}},fd={key:0,class:"divider",style:{color:"#475569 !important"}},ud={key:1,class:"license",style:{color:"#94a3b8 !important"}},gd={key:0,class:"footer-right"},hd={class:"text",style:{color:"#94a3b8 !important"}},yd={key:2,class:"scada-footer"},bd={class:"footer-content"},kd={class:"footer-left"},Ed={class:"authorized-text",style:{color:"#10b981 !important"}},Nd={class:"footer-right"},Vd={key:0,class:"expiry-text",style:{color:"#94a3b8 !important"}},xd={key:1,class:"expiry-text",style:{color:"#94a3b8 !important"}},wd=A(e.defineComponent({__name:"Footer",props:{authCode:{default:""},publicKeyPem:{default:void 0},customFooter:{default:void 0}},setup(i){const l=i,o=e.ref(null),s=e.ref(!1);e.watch(()=>[l.authCode,l.publicKeyPem],async()=>{if(!l.authCode||!l.publicKeyPem){s.value=!1,o.value=null;return}const r=await id(l.authCode,l.publicKeyPem);s.value=!!(r!=null&&r.isValid),o.value=r||null},{immediate:!0});const t=e.computed(()=>s.value);return(r,p)=>{var d,c;return t.value?i.customFooter?(e.openBlock(),e.createElementBlock("footer",dd,[e.createElementVNode("div",cd,[e.createElementVNode("div",pd,[e.createElementVNode("span",md,e.toDisplayString(i.customFooter.copyright),1),i.customFooter.license?(e.openBlock(),e.createElementBlock("span",fd,"|")):e.createCommentVNode("",!0),i.customFooter.license?(e.openBlock(),e.createElementBlock("span",ud,e.toDisplayString(i.customFooter.license),1)):e.createCommentVNode("",!0)]),i.customFooter.contact?(e.openBlock(),e.createElementBlock("div",gd,[e.createElementVNode("span",hd,e.toDisplayString(i.customFooter.contact),1)])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createElementBlock("footer",yd,[e.createElementVNode("div",bd,[e.createElementVNode("div",kd,[p[1]||(p[1]=e.createElementVNode("span",{class:"authorized-icon"},"✅",-1)),e.createElementVNode("span",Ed,"已授权: "+e.toDisplayString(((d=o.value)==null?void 0:d.company)||"未知"),1)]),e.createElementVNode("div",Nd,[(c=o.value)!=null&&c.expiryDate?(e.openBlock(),e.createElementBlock("span",Vd," 📅 有效期至: "+e.toDisplayString(o.value.expiryDate),1)):(e.openBlock(),e.createElementBlock("span",xd," ∞ 永久授权 "))])])])):(e.openBlock(),e.createElementBlock("footer",sd,[...p[0]||(p[0]=[e.createStaticVNode('<div class="footer-content" data-v-7fd5ce26><div class="footer-left" data-v-7fd5ce26><span class="copyright" style="color:#94a3b8 !important;" data-v-7fd5ce26>© 2025 leoncheng</span><span class="divider" style="color:#475569 !important;" data-v-7fd5ce26>|</span><span class="license" style="color:#94a3b8 !important;" data-v-7fd5ce26>仅供学习研究使用,禁止商业用途</span></div><div class="footer-right" data-v-7fd5ce26><div class="contact-item" data-v-7fd5ce26><span class="icon" data-v-7fd5ce26>📧</span><span class="text" style="color:#94a3b8 !important;" data-v-7fd5ce26>nywqs@outlook.com</span></div><span class="divider" style="color:#475569 !important;" data-v-7fd5ce26>|</span><div class="contact-item" data-v-7fd5ce26><span class="icon" data-v-7fd5ce26>📱</span><span class="text" style="color:#94a3b8 !important;" data-v-7fd5ce26>18637762001</span></div></div></div>',1)])]))}}}),[["__scopeId","data-v-7fd5ce26"]]);var re=(i=>(i.START="start",i.END="end",i.GET_PROPERTY="getProperty",i.SET_PROPERTY="setProperty",i.CONDITION="condition",i.HTTP_REQUEST="httpRequest",i.CUSTOM_CODE="customCode",i.TIMER="timer",i.CLEAR_TIMER="clearTimer",i))(re||{});const $d={class:"dialog-body"},Cd={class:"search-box"},_d={class:"element-list"},vd=["onClick"],Bd={class:"element-icon"},Sd={class:"element-info"},Dd={class:"element-name"},Id={class:"element-type"},Td={key:0,class:"element-check"},zd={key:0,class:"empty-state"},Md={class:"dialog-footer"},Ad=["disabled"],$t=A(e.defineComponent({__name:"ElementSelector",props:{visible:{type:Boolean},elements:{default:()=>[]}},emits:["close","select"],setup(i,{emit:l}){const o=i,s=l,t=e.ref(""),r=e.ref(null),p=e.computed(()=>{if(!t.value)return o.elements;const a=t.value.toLowerCase();return o.elements.filter(n=>n.name.toLowerCase().includes(a)||n.id.toLowerCase().includes(a)||n.type.toLowerCase().includes(a))}),d=a=>{r.value=a},c=()=>{t.value="",r.value=null,s("close")},f=()=>{r.value&&(s("select",r.value),c())};return(a,n)=>i.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"element-selector-overlay",onClick:c},[e.createElementVNode("div",{class:"element-selector-dialog",onClick:n[1]||(n[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dialog-header"},[n[2]||(n[2]=e.createElementVNode("h3",null,"选择图元",-1)),e.createElementVNode("button",{class:"btn-close",onClick:c},"×")]),e.createElementVNode("div",$d,[e.createElementVNode("div",Cd,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=u=>t.value=u),type:"text",placeholder:"搜索图元名称或ID..."},null,512),[[e.vModelText,t.value]])]),e.createElementVNode("div",_d,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,u=>{var g,m;return e.openBlock(),e.createElementBlock("div",{key:u.id,class:e.normalizeClass(["element-item",{active:((g=r.value)==null?void 0:g.id)===u.id}]),onClick:k=>d(u)},[e.createElementVNode("div",Bd,e.toDisplayString(u.icon),1),e.createElementVNode("div",Sd,[e.createElementVNode("div",Dd,e.toDisplayString(u.name),1),e.createElementVNode("div",Id,e.toDisplayString(u.type),1)]),((m=r.value)==null?void 0:m.id)===u.id?(e.openBlock(),e.createElementBlock("div",Td," ✓ ")):e.createCommentVNode("",!0)],10,vd)}),128)),p.value.length===0?(e.openBlock(),e.createElementBlock("div",zd,[...n[3]||(n[3]=[e.createElementVNode("p",null,"未找到图元",-1),e.createElementVNode("p",{class:"empty-hint"},"请尝试其他搜索关键词",-1)])])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Md,[e.createElementVNode("button",{class:"btn-secondary",onClick:c},"取消"),e.createElementVNode("button",{class:"btn-primary",disabled:!r.value,onClick:f}," 确定 ",8,Ad)])])])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-882704dd"]]),Pd={class:"node-config"},Od={class:"config-group"},Ld={class:"element-selector"},Rd={class:"config-group"},Ud=["disabled"],Wd=["value"],Fd=A(e.defineComponent({__name:"GetPropertyConfig",props:{modelValue:{}},emits:["update:modelValue"],setup(i,{emit:l}){const o=i,s=l,t=e.reactive({elementId:o.modelValue.elementId||"",propertyName:o.modelValue.propertyName||""}),r=e.ref(""),p=e.ref(!1),d=e.ref([]),c=e.inject("canvasElementService"),f=e.computed(()=>{if(!t.elementId)return[];const g=d.value.find(m=>m.id===t.elementId);return(g==null?void 0:g.properties)||[]}),a=()=>{s("update:modelValue",{...t})},n=()=>{c&&(d.value=c.getElements()),p.value=!0},u=g=>{t.elementId=g.id,r.value=g.name,t.propertyName="",a()};return e.onMounted(()=>{if(c&&(d.value=c.getElements()),t.elementId){const g=d.value.find(m=>m.id===t.elementId);g&&(r.value=g.name)}}),(g,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Pd,[e.createElementVNode("div",Od,[m[3]||(m[3]=e.createElementVNode("label",null,"图元选择",-1)),e.createElementVNode("div",Ld,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[0]||(m[0]=k=>r.value=k),type:"text",placeholder:"点击选择按钮从画布中选择图元",readonly:""},null,512),[[e.vModelText,r.value]]),e.createElementVNode("button",{class:"btn-select",onClick:n}," 选择图元 ")])]),e.createElementVNode("div",Rd,[m[5]||(m[5]=e.createElementVNode("label",null,"属性选择",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":m[1]||(m[1]=k=>t.propertyName=k),onChange:a,disabled:!t.elementId},[m[4]||(m[4]=e.createElementVNode("option",{value:""},"请先选择图元",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,k=>(e.openBlock(),e.createElementBlock("option",{key:k.key,value:k.key},e.toDisplayString(k.label),9,Wd))),128))],40,Ud),[[e.vModelSelect,t.propertyName]])])]),e.createVNode($t,{visible:p.value,elements:d.value,onClose:m[2]||(m[2]=k=>p.value=!1),onSelect:u},null,8,["visible","elements"])],64))}}),[["__scopeId","data-v-fa65eb56"]]),Gd={class:"node-config"},jd={class:"config-group"},Hd={class:"element-selector"},qd={class:"config-group"},Jd=["disabled"],Yd=["value"],Xd={class:"config-group"},Kd=A(e.defineComponent({__name:"SetPropertyConfig",props:{modelValue:{}},emits:["update:modelValue"],setup(i,{emit:l}){const o=i,s=l,t=e.reactive({elementId:o.modelValue.elementId||"",propertyName:o.modelValue.propertyName||"",value:o.modelValue.value||""}),r=e.ref(""),p=e.ref(!1),d=e.ref([]),c=e.inject("canvasElementService"),f=e.computed(()=>{if(!t.elementId)return[];const g=d.value.find(m=>m.id===t.elementId);return(g==null?void 0:g.properties)||[]}),a=()=>{s("update:modelValue",{...t})},n=()=>{c&&(d.value=c.getElements()),p.value=!0},u=g=>{t.elementId=g.id,r.value=g.name,t.propertyName="",a()};return e.onMounted(()=>{if(c&&(d.value=c.getElements()),t.elementId){const g=d.value.find(m=>m.id===t.elementId);g&&(r.value=g.name)}}),(g,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Gd,[e.createElementVNode("div",jd,[m[4]||(m[4]=e.createElementVNode("label",null,"图元选择",-1)),e.createElementVNode("div",Hd,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[0]||(m[0]=k=>r.value=k),type:"text",placeholder:"点击选择按钮从画布中选择图元",readonly:""},null,512),[[e.vModelText,r.value]]),e.createElementVNode("button",{class:"btn-select",onClick:n}," 选择图元 ")])]),e.createElementVNode("div",qd,[m[6]||(m[6]=e.createElementVNode("label",null,"属性选择",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":m[1]||(m[1]=k=>t.propertyName=k),onChange:a,disabled:!t.elementId},[m[5]||(m[5]=e.createElementVNode("option",{value:""},"请先选择图元",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,k=>(e.openBlock(),e.createElementBlock("option",{key:k.key,value:k.key},e.toDisplayString(k.label),9,Yd))),128))],40,Jd),[[e.vModelSelect,t.propertyName]])]),e.createElementVNode("div",Xd,[m[7]||(m[7]=e.createElementVNode("label",null,"属性值",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":m[2]||(m[2]=k=>t.value=k),type:"text",placeholder:"请输入属性值",onInput:a},null,544),[[e.vModelText,t.value]])])]),e.createVNode($t,{visible:p.value,elements:d.value,onClose:m[3]||(m[3]=k=>p.value=!1),onSelect:u},null,8,["visible","elements"])],64))}}),[["__scopeId","data-v-42e029d4"]]),Qd={class:"node-config"},Zd={class:"config-group"},ec={class:"config-group"},tc={class:"branches-section"},oc={class:"branch-list"},lc={class:"branch-header"},nc={class:"branch-number"},ac=["onClick"],rc={key:0,class:"branch-config"},ic={class:"config-row"},sc=["onUpdate:modelValue"],dc={key:0,class:"config-row"},cc=["onUpdate:modelValue"],pc={key:1,class:"config-row"},mc=["onUpdate:modelValue","type"],fc={key:1,class:"default-branch-label"},uc=A(e.defineComponent({__name:"ConditionConfig",props:{modelValue:{}},emits:["update:modelValue"],setup(i,{emit:l}){const o=i,s=l,t=()=>`branch_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,r=()=>o.modelValue.branches&&o.modelValue.branches.length>0?o.modelValue.branches:(o.modelValue.dataType||"boolean")==="boolean"?[{id:t(),label:"True",value:!0},{id:t(),label:"False",value:!1,isDefault:!0}]:[{id:t(),label:"分支1",operator:"eq",value:""},{id:t(),label:"默认",isDefault:!0}],p=e.reactive({sourceNodeId:o.modelValue.sourceNodeId||"prev",dataType:o.modelValue.dataType||"boolean",branches:r()}),d=()=>{s("update:modelValue",{...p})},c=()=>{p.dataType==="boolean"?p.branches=[{id:t(),label:"True",value:!0},{id:t(),label:"False",value:!1,isDefault:!0}]:p.branches=[{id:t(),label:"分支1",operator:"eq",value:""},{id:t(),label:"默认",isDefault:!0}],d()},f=()=>{const n={id:t(),label:`分支${p.branches.length}`,operator:"eq",value:""},u=p.branches.findIndex(g=>g.isDefault);u>-1?p.branches.splice(u,0,n):p.branches.push(n),d()},a=n=>{p.branches.length>2&&(p.branches.splice(n,1),d())};return(n,u)=>(e.openBlock(),e.createElementBlock("div",Qd,[e.createElementVNode("div",Zd,[u[3]||(u[3]=e.createElementVNode("label",null,"数据来源节点",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":u[0]||(u[0]=g=>p.sourceNodeId=g),onChange:d},[...u[2]||(u[2]=[e.createElementVNode("option",{value:""},"请选择数据来源节点",-1),e.createElementVNode("option",{value:"prev"},"上一个节点",-1)])],544),[[e.vModelSelect,p.sourceNodeId]])]),e.createElementVNode("div",ec,[u[5]||(u[5]=e.createElementVNode("label",null,"数据类型",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":u[1]||(u[1]=g=>p.dataType=g),onChange:c},[...u[4]||(u[4]=[e.createElementVNode("option",{value:"boolean"},"布尔类型",-1),e.createElementVNode("option",{value:"number"},"数字类型",-1),e.createElementVNode("option",{value:"string"},"字符串类型",-1),e.createElementVNode("option",{value:"any"},"自定义",-1)])],544),[[e.vModelSelect,p.dataType]])]),e.createElementVNode("div",tc,[e.createElementVNode("div",{class:"section-header"},[u[6]||(u[6]=e.createElementVNode("label",null,"条件分支",-1)),e.createElementVNode("button",{class:"btn-add",onClick:f},"添加分支")]),e.createElementVNode("div",oc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.branches,(g,m)=>(e.openBlock(),e.createElementBlock("div",{key:g.id,class:"branch-item"},[e.createElementVNode("div",lc,[e.createElementVNode("span",nc,"分支 "+e.toDisplayString(m+1),1),!g.isDefault&&p.branches&&p.branches.length>1?(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn-remove",onClick:k=>a(m)},"×",8,ac)):e.createCommentVNode("",!0)]),g.isDefault?(e.openBlock(),e.createElementBlock("div",fc," 默认分支(其他情况) ")):(e.openBlock(),e.createElementBlock("div",rc,[e.createElementVNode("div",ic,[u[7]||(u[7]=e.createElementVNode("label",null,"分支标签",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":k=>g.label=k,type:"text",placeholder:"如: >10, =A, True",onInput:d},null,40,sc),[[e.vModelText,g.label]])]),p.dataType!=="boolean"?(e.openBlock(),e.createElementBlock("div",dc,[u[9]||(u[9]=e.createElementVNode("label",null,"运算符",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":k=>g.operator=k,onChange:d},[...u[8]||(u[8]=[e.createStaticVNode('<option value="eq" data-v-15975920>等于 (==)</option><option value="ne" data-v-15975920>不等于 (!=)</option><option value="gt" data-v-15975920>大于 (>)</option><option value="gte" data-v-15975920>大于等于 (>=)</option><option value="lt" data-v-15975920>小于 (<)</option><option value="lte" data-v-15975920>小于等于 (<=)</option><option value="contains" data-v-15975920>包含</option><option value="notContains" data-v-15975920>不包含</option>',8)])],40,cc),[[e.vModelSelect,g.operator]])])):e.createCommentVNode("",!0),p.dataType!=="boolean"?(e.openBlock(),e.createElementBlock("div",pc,[u[10]||(u[10]=e.createElementVNode("label",null,"比较值",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":k=>g.value=k,type:p.dataType==="number"?"number":"text",placeholder:"请输入比较值",onInput:d},null,40,mc),[[e.vModelDynamic,g.value]])])):e.createCommentVNode("",!0)]))]))),128))])])]))}}),[["__scopeId","data-v-15975920"]]),gc={class:"node-config"},hc={class:"config-group"},yc={class:"config-group"},bc={class:"config-group"},kc={class:"config-group"},Ec={class:"config-group"},Nc=A(e.defineComponent({__name:"HttpRequestConfig",props:{modelValue:{}},emits:["update:modelValue"],setup(i,{emit:l}){const o=i,s=l,t=e.reactive({url:o.modelValue.url||"",method:o.modelValue.method||"GET",headers:o.modelValue.headers||{},body:o.modelValue.body||"",outputVariable:o.modelValue.outputVariable||""}),r=e.ref(JSON.stringify(t.headers,null,2)),p=()=>{s("update:modelValue",{...t})},d=()=>{try{t.headers=JSON.parse(r.value),p()}catch{}};return e.watch(()=>o.modelValue.headers,c=>{c&&(r.value=JSON.stringify(c,null,2))}),(c,f)=>(e.openBlock(),e.createElementBlock("div",gc,[e.createElementVNode("div",hc,[f[5]||(f[5]=e.createElementVNode("label",null,"请求URL",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=a=>t.url=a),type:"text",placeholder:"请输入请求URL",onInput:p},null,544),[[e.vModelText,t.url]])]),e.createElementVNode("div",yc,[f[7]||(f[7]=e.createElementVNode("label",null,"请求方法",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":f[1]||(f[1]=a=>t.method=a),onChange:p},[...f[6]||(f[6]=[e.createElementVNode("option",{value:"GET"},"GET",-1),e.createElementVNode("option",{value:"POST"},"POST",-1),e.createElementVNode("option",{value:"PUT"},"PUT",-1),e.createElementVNode("option",{value:"DELETE"},"DELETE",-1)])],544),[[e.vModelSelect,t.method]])]),e.createElementVNode("div",bc,[f[8]||(f[8]=e.createElementVNode("label",null,"请求头 (JSON格式)",-1)),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":f[2]||(f[2]=a=>r.value=a),rows:"3",placeholder:'{"Content-Type": "application/json"}',onInput:d},null,544),[[e.vModelText,r.value]])]),e.createElementVNode("div",kc,[f[9]||(f[9]=e.createElementVNode("label",null,"请求体",-1)),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":f[3]||(f[3]=a=>t.body=a),rows:"4",placeholder:"请输入请求体内容",onInput:p},null,544),[[e.vModelText,t.body]])]),e.createElementVNode("div",Ec,[f[10]||(f[10]=e.createElementVNode("label",null,"输出变量",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[4]||(f[4]=a=>t.outputVariable=a),type:"text",placeholder:"请输入输出变量名",onInput:p},null,544),[[e.vModelText,t.outputVariable]])])]))}}),[["__scopeId","data-v-4c312eea"]]),Vc={class:"node-config"},xc={class:"config-group"},wc=A(e.defineComponent({__name:"CustomCodeConfig",props:{modelValue:{}},emits:["update:modelValue"],setup(i,{emit:l}){const o=i,s=l,t=e.reactive({code:o.modelValue.code||""}),r=()=>{s("update:modelValue",{...t})};return(p,d)=>(e.openBlock(),e.createElementBlock("div",Vc,[e.createElementVNode("div",xc,[d[1]||(d[1]=e.createElementVNode("label",null,"JavaScript代码",-1)),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":d[0]||(d[0]=c=>t.code=c),rows:"10",placeholder:"请输入JavaScript代码",onInput:r},null,544),[[e.vModelText,t.code]])]),d[2]||(d[2]=e.createElementVNode("div",{class:"code-hint"},[e.createElementVNode("p",null,"提示:"),e.createElementVNode("ul",null,[e.createElementVNode("li",null,"可以使用 context 对象访问上下文变量"),e.createElementVNode("li",null,"使用 return 返回结果")])],-1))]))}}),[["__scopeId","data-v-f7115383"]]),$c={class:"node-config"},Cc={class:"config-group"},_c={class:"config-group"},vc=A(e.defineComponent({__name:"TimerConfig",props:{modelValue:{}},emits:["update:modelValue"],setup(i,{emit:l}){const o=i,s=l,t=e.reactive({interval:o.modelValue.interval||1e3,unit:o.modelValue.unit||"ms"}),r=()=>{s("update:modelValue",{...t})};return(p,d)=>(e.openBlock(),e.createElementBlock("div",$c,[e.createElementVNode("div",Cc,[d[2]||(d[2]=e.createElementVNode("label",null,"时间间隔",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":d[0]||(d[0]=c=>t.interval=c),type:"number",min:"1",placeholder:"请输入时间间隔",onInput:r},null,544),[[e.vModelText,t.interval,void 0,{number:!0}]])]),e.createElementVNode("div",_c,[d[4]||(d[4]=e.createElementVNode("label",null,"时间单位",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":d[1]||(d[1]=c=>t.unit=c),onChange:r},[...d[3]||(d[3]=[e.createElementVNode("option",{value:"ms"},"毫秒 (ms)",-1),e.createElementVNode("option",{value:"s"},"秒 (s)",-1),e.createElementVNode("option",{value:"m"},"分钟 (m)",-1),e.createElementVNode("option",{value:"h"},"小时 (h)",-1)])],544),[[e.vModelSelect,t.unit]])])]))}}),[["__scopeId","data-v-323381bc"]]),Bc={class:"node-config"},Sc={class:"config-group"},Dc=["value"],Ic={key:0,class:"timer-hint warning"},Tc={key:1,class:"timer-hint"},zc=A(e.defineComponent({__name:"ClearTimerConfig",props:{modelValue:{}},emits:["update:modelValue"],setup(i,{emit:l}){const o=i,s=l,t=e.reactive({timerId:o.modelValue.timerId||""}),r=e.ref([]),p=e.inject("getGraph"),d=()=>{if(!p)return[];const f=p();if(!f)return[];const a=f.getNodes(),n=[];return a.forEach(u=>{const g=u.getData();if((g==null?void 0:g.nodeType)==="timer"){const m=u.getAttrByPath("label/text")||"定时器";n.push({id:u.id,label:m})}}),n};e.onMounted(()=>{r.value=d()}),e.watch(()=>o.modelValue,()=>{r.value=d()},{deep:!0});const c=()=>{s("update:modelValue",{...t})};return(f,a)=>(e.openBlock(),e.createElementBlock("div",Bc,[e.createElementVNode("div",Sc,[a[2]||(a[2]=e.createElementVNode("label",null,"选择定时器节点",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":a[0]||(a[0]=n=>t.timerId=n),onChange:c},[a[1]||(a[1]=e.createElementVNode("option",{value:""},"请选择要清除的定时器",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,n=>(e.openBlock(),e.createElementBlock("option",{key:n.id,value:n.id},e.toDisplayString(n.label),9,Dc))),128))],544),[[e.vModelSelect,t.timerId]])]),r.value.length===0?(e.openBlock(),e.createElementBlock("div",Ic,[...a[3]||(a[3]=[e.createElementVNode("p",null,"提示:当前流程中没有定时器节点",-1)])])):(e.openBlock(),e.createElementBlock("div",Tc,[...a[4]||(a[4]=[e.createElementVNode("p",null,"提示:选择要清除的定时器节点",-1)])]))]))}}),[["__scopeId","data-v-d102fb63"]]),Mc={[re.GET_PROPERTY]:Fd,[re.SET_PROPERTY]:Kd,[re.CONDITION]:uc,[re.HTTP_REQUEST]:Nc,[re.CUSTOM_CODE]:wc,[re.TIMER]:vc,[re.CLEAR_TIMER]:zc};function Ac(i){return Mc[i]||null}const Pc={class:"property-panel"},Oc={key:0,class:"property-content"},Lc={class:"property-group"},Rc=["value"],Uc={class:"property-group"},Wc=["value"],Fc={key:0,class:"divider"},Gc={key:1,class:"property-empty"},jc=A(e.defineComponent({__name:"PropertyPanel",props:{selectedCell:{}},emits:["update:label","update:config"],setup(i,{emit:l}){const o=i,s=l,t=()=>{var a,n,u;return((u=(n=(a=o.selectedCell)==null?void 0:a.cell)==null?void 0:n.model)==null?void 0:u.graph)||null};e.provide("getGraph",t);const r=e.ref({}),p=e.computed(()=>o.selectedCell?Ac(o.selectedCell.nodeType):null);e.watch(()=>o.selectedCell,a=>{if(a!=null&&a.cell){const n=a.cell.getData();r.value=(n==null?void 0:n.config)||{}}else r.value={}},{immediate:!0});const d=a=>{const n=a.target;s("update:label",n.value)},c=a=>{var n;if(r.value=a,(n=o.selectedCell)!=null&&n.cell){const u=o.selectedCell.cell.getData()||{};o.selectedCell.cell.setData({...u,config:a}),o.selectedCell.nodeType==="condition"&&a.branches&&f(a.branches)}s("update:config",a)},f=a=>{var O,_;if(!((O=o.selectedCell)!=null&&O.cell))return;const n=o.selectedCell.cell,u=(_=n.model)==null?void 0:_.graph;if(!u)return;const g=[];u.getConnectedEdges(n,{outgoing:!0}).forEach(v=>{const M=v.getSourcePortId(),K=v.getTargetCell(),le=v.getTargetPortId();M&&K&&g.push({sourcePortId:M,targetCell:K,targetPortId:le})});const k=g.length>0?g[0].targetCell:null,B=g.length>0?g[0].targetPortId:"port-in";n.getPorts().forEach(v=>{v.group==="out"&&n.removePort(v.id)});const E=30,b=60,h=Math.max(a.length,1),N=Math.max(b,h*E),V=n.size(),z=n.position(),R=N-V.height;R!==0&&n.position(z.x,z.y-R/2),n.resize(V.width,N),a.forEach((v,M)=>{n.addPort({id:`port-out-${M}`,group:"out",attrs:{circle:{r:5,magnet:!0,stroke:"#34d399",strokeWidth:2,fill:"#1e293b"},portLabel:{text:v.label||`分支${M+1}`,fontSize:10,fill:"#94a3b8"}}})}),setTimeout(()=>{k&&a.forEach((v,M)=>{u.addEdge({source:{cell:n,port:`port-out-${M}`},target:{cell:k,port:B},labels:[{attrs:{label:{text:v.label||`分支${M+1}`,fill:"#e2e8f0",fontSize:12},rect:{fill:"#334155",stroke:"#34d399",strokeWidth:1,rx:4,ry:4}},position:.5}]})})},100)};return(a,n)=>(e.openBlock(),e.createElementBlock("div",Pc,[n[4]||(n[4]=e.createElementVNode("h3",null,"属性配置",-1)),i.selectedCell?(e.openBlock(),e.createElementBlock("div",Oc,[e.createElementVNode("div",Lc,[n[1]||(n[1]=e.createElementVNode("label",null,"节点名称",-1)),e.createElementVNode("input",{value:i.selectedCell.label,type:"text",placeholder:"输入节点名称",onInput:d},null,40,Rc)]),e.createElementVNode("div",Uc,[n[2]||(n[2]=e.createElementVNode("label",null,"节点类型",-1)),e.createElementVNode("input",{value:i.selectedCell.nodeType,type:"text",readonly:"",disabled:""},null,8,Wc)]),p.value?(e.openBlock(),e.createElementBlock("div",Fc)):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p.value),{key:1,modelValue:r.value,"onUpdate:modelValue":[n[0]||(n[0]=u=>r.value=u),c]},null,8,["modelValue"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Gc,[...n[3]||(n[3]=[e.createElementVNode("div",{class:"empty-text"},"选择节点以配置属性",-1)])]))]))}}),[["__scopeId","data-v-8304acbc"]]),Hc={class:"toolbar"},qc={class:"toolbar-right"},Jc=A(e.defineComponent({__name:"WorkflowToolbar",props:{showClose:{type:Boolean}},emits:["clear","validate","save","close"],setup(i){return(l,o)=>(e.openBlock(),e.createElementBlock("div",Hc,[o[5]||(o[5]=e.createElementVNode("div",{class:"toolbar-left"},[e.createElementVNode("h2",null,"流程编排")],-1)),e.createElementVNode("div",qc,[e.createElementVNode("button",{class:"btn-secondary",onClick:o[0]||(o[0]=s=>l.$emit("clear"))},"清空"),e.createElementVNode("button",{class:"btn-secondary",onClick:o[1]||(o[1]=s=>l.$emit("validate"))},"验证"),e.createElementVNode("button",{class:"btn-primary",onClick:o[2]||(o[2]=s=>l.$emit("save"))},"保存"),i.showClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn-close",onClick:o[3]||(o[3]=s=>l.$emit("close")),title:"关闭"},[...o[4]||(o[4]=[e.createElementVNode("span",{class:"close-icon"},"×",-1)])])):e.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-b3e0a4fc"]]),Yc={class:"menu-header"},Xc={class:"menu-list"},Kc=["onClick"],Qc={class:"menu-item-info"},Zc={class:"menu-item-name"},ep={class:"menu-item-desc"},tp=A(e.defineComponent({__name:"AddNodeMenu",props:{visible:{type:Boolean},position:{},nodeTypes:{}},emits:["close","select"],setup(i,{emit:l}){const o=i,s=l,t=e.computed(()=>o.nodeTypes.filter(p=>p.type!=="start"&&p.type!=="end")),r=p=>{s("select",p)};return(p,d)=>(e.openBlock(),e.createElementBlock("div",null,[i.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"menu-overlay",onClick:d[0]||(d[0]=c=>p.$emit("close"))})):e.createCommentVNode("",!0),i.visible?(e.openBlock(),e.createElementBlock("div",{key:1,class:"add-node-menu",style:e.normalizeStyle({left:i.position.x+"px",top:i.position.y+"px"})},[e.createElementVNode("div",Yc,[d[2]||(d[2]=e.createElementVNode("span",null,"选择节点类型",-1)),e.createElementVNode("button",{class:"btn-close",onClick:d[1]||(d[1]=c=>p.$emit("close"))},"×")]),e.createElementVNode("div",Xc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,c=>(e.openBlock(),e.createElementBlock("div",{key:c.type,class:"menu-item",onClick:f=>r(c)},[e.createElementVNode("div",{class:e.normalizeClass(["menu-item-icon",`node-icon-${c.type}`])},e.toDisplayString(c.icon),3),e.createElementVNode("div",Qc,[e.createElementVNode("div",Zc,e.toDisplayString(c.name),1),e.createElementVNode("div",ep,e.toDisplayString(c.description),1)])],8,Kc))),128))])],4)):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-aa6fccf8"]]);class op{constructor(){be(this,"graph",null)}setGraph(l){this.graph=l}getElements(){return this.graph?this.graph.getNodes().map(o=>{const s=o.getData()||{},t=s.type||o.shape,r=me.getComponent(t),p=this.getElementProperties(o,r);return{id:o.id,name:s.componentName||o.getAttrByPath("label/text")||`图元_${o.id.slice(0,8)}`,type:(r==null?void 0:r.metadata.name)||t,icon:(r==null?void 0:r.metadata.icon)||"📦",properties:p}}):(console.warn("画布实例未初始化"),[])}getElementProperties(l,o){const s=[],t=new Set;return o!=null&&o.props&&o.props.forEach(r=>{const p=r.path.split("."),d=p[p.length-1];d&&!t.has(d)&&(s.push({key:d,label:r.label||d}),t.add(d))}),s}getElementById(l){return this.getElements().find(s=>s.id===l)||null}searchElements(l){const o=this.getElements(),s=l.toLowerCase();return o.filter(t=>t.name.toLowerCase().includes(s)||t.id.toLowerCase().includes(s)||t.type.toLowerCase().includes(s))}}const Ct=new op,lp={class:"workflow-editor"},np={class:"editor-main"},ap={class:"canvas-area"},rp=A(e.defineComponent({__name:"WorkflowEditor",props:{scadaGraph:{default:null},showClose:{type:Boolean,default:!1}},emits:["close"],setup(i){const l=i,o=e.ref([{type:"start",name:"开始",icon:"▶",description:"流程起点",color:"#52c41a"},{type:"end",name:"结束",icon:"⏹",description:"流程终点",color:"#ff4d4f"},{type:"getProperty",name:"获取图元属性",icon:"📥",description:"获取图元的属性值",color:"#1890ff"},{type:"setProperty",name:"设置图元属性",icon:"📤",description:"设置图元的属性值",color:"#13c2c2"},{type:"condition",name:"条件节点",icon:"◆",description:"条件分支判断",color:"#faad14"},{type:"httpRequest",name:"http请求",icon:"🌐",description:"HTTP网络请求",color:"#722ed1"},{type:"customCode",name:"自定义代码",icon:"💻",description:"执行自定义JavaScript代码",color:"#eb2f96"},{type:"timer",name:"定时器节点",icon:"⏰",description:"设置定时执行",color:"#52c41a"},{type:"clearTimer",name:"清除定时器",icon:"🗑",description:"清除定时器",color:"#ff4d4f"}]),s=e.ref();let t=null;l.scadaGraph&&Ct.setGraph(l.scadaGraph),e.provide("canvasElementService",Ct);const r=e.ref(null),p=e.ref(!1),d=e.ref({x:0,y:0});let c=null;const f=()=>{o.value.forEach(b=>{const h={inherit:"rect",width:150,height:60,markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"icon"},{tagName:"text",selector:"label"}],attrs:{body:{strokeWidth:1,stroke:b.color,fill:"#ffffff",rx:6,ry:6},icon:{text:b.icon,fontSize:24,fill:b.color,refX:20,refY:"50%",textAnchor:"middle",textVerticalAnchor:"middle"},label:{text:b.name,fontSize:14,fill:"#333333",refX:75,refY:"50%",textAnchor:"middle",textVerticalAnchor:"middle"}},ports:{groups:{in:{position:"left",attrs:{circle:{r:5,magnet:!0,stroke:"#10b981",strokeWidth:2,fill:"#1e293b"}}},out:{position:{name:"right"},attrs:{circle:{r:5,magnet:!0,stroke:"#10b981",strokeWidth:2,fill:"#1e293b"},portLabel:{fontSize:10,fill:"#94a3b8"}},markup:[{tagName:"circle",selector:"circle"},{tagName:"text",selector:"portLabel"}],label:{position:{name:"right",args:{x:10,y:0}}}}},items:[]},data:{nodeType:b.type}};b.type==="start"?h.ports.items=[{id:"port-out",group:"out"}]:b.type==="end"?h.ports.items=[{id:"port-in",group:"in"}]:b.type==="condition"?h.ports.items=[{id:"port-in",group:"in"},{id:"port-out-0",group:"out",args:{text:"True"}},{id:"port-out-1",group:"out",args:{text:"False"}}]:h.ports.items=[{id:"port-in",group:"in"},{id:"port-out",group:"out"}],Q.Graph.registerNode(b.type,h,!0)})},a=()=>{if(!s.value)return;f(),t=new Q.Graph({container:s.value,width:s.value.clientWidth,height:s.value.clientHeight,grid:{size:10,visible:!0,type:"dot",args:{color:"#333",thickness:1}},panning:{enabled:!0,modifiers:"shift"},mousewheel:{enabled:!0,modifiers:["ctrl","meta"]},connecting:{router:"manhattan",connector:{name:"rounded",args:{radius:8}},anchor:"center",connectionPoint:"anchor",snap:{radius:20},allowBlank:!1,allowLoop:!1,allowNode:!1,createEdge(){return new Q.Shape.Edge({attrs:{line:{stroke:"#64748b",strokeWidth:3,targetMarker:{name:"block",width:12,height:8,fill:"#64748b"}}},zIndex:0})},validateConnection({targetMagnet:h}){return!!h}},highlighting:{magnetAvailable:{name:"stroke",args:{attrs:{fill:"#34d399",stroke:"#34d399"}}}}}),t.use(new qe.Selection({enabled:!0,rubberband:!1,showNodeSelectionBox:!0,showEdgeSelectionBox:!0,multiple:!0,movable:!0,strict:!1}));const b=h=>{var N;if(console.log("键盘事件触发:",h.key,"selectedCell存在:",!!r.value),h.key==="Delete"||h.key==="Backspace"){if(!t){console.log("graph不存在,无法删除");return}if((N=r.value)!=null&&N.cell){h.preventDefault();const z=r.value.cell;console.log("删除选中的节点:",r.value.label);const R=t.getIncomingEdges(z),O=t.getOutgoingEdges(z);R&&R.length>0&&O&&O.length>0&&R.forEach(_=>{const v=_.getSourceCell(),M=_.getSourcePortId();O.forEach(K=>{const le=K.getTargetCell(),ce=K.getTargetPortId();v&&le&&t&&(t.addEdge({source:{cell:v,port:M},target:{cell:le,port:ce}}),console.log("已连接前后节点"))})}),t.removeCells([z]),r.value=null,console.log("已删除节点");return}const V=t.getSelectedCells();console.log("选中的cells数量:",V.length,V),V.length?(h.preventDefault(),t.removeCells(V),console.log("已删除cells")):console.log("没有选中的cells")}};document.addEventListener("keydown",b),t.on("node:click",({node:h})=>{var z;const N=h.getAttrByPath("label/text")||"",V=((z=h.getData())==null?void 0:z.nodeType)||h.shape||"";r.value={label:N,nodeType:V,cell:h},console.log("节点已点击,保存到selectedCell:",N)}),t.on("blank:click",()=>{r.value=null,t&&t.cleanSelection()}),t.on("edge:mouseenter",({edge:h})=>{h.setAttrs({line:{stroke:"#10b981",strokeWidth:4}}),h.addTools([{name:"button",args:{markup:[{tagName:"circle",selector:"button",attrs:{r:12,stroke:"#10b981",strokeWidth:2,fill:"#1e293b",cursor:"pointer"}},{tagName:"path",selector:"icon",attrs:{d:"M -5 0 L 5 0 M 0 -5 L 0 5",stroke:"#10b981",strokeWidth:2,fill:"none",pointerEvents:"none"}}],distance:.5,onClick:({e:N,view:V})=>{c=V.cell,p.value=!0,d.value={x:N.clientX,y:N.clientY}}}},{name:"vertices"}])}),t.on("edge:mouseleave",({edge:h})=>{h.setAttrs({line:{stroke:"#64748b",strokeWidth:3}}),h.removeTools()}),t.on("edge:connected",({isNew:h,edge:N})=>{h&&N.setAttrs({line:{stroke:"#64748b",strokeWidth:3}})}),t.on("node:selected",({node:h})=>{h.toFront()}),t.on("edge:selected",({edge:h})=>{h.toFront()}),n()},n=()=>{if(!t)return;const b=t.addNode({shape:"start",x:100,y:200,label:"开始",data:{nodeType:"start"}}),h=t.addNode({shape:"end",x:500,y:200,label:"结束",data:{nodeType:"end"}});t.addEdge({source:{cell:b,port:"port-out"},target:{cell:h,port:"port-in"}})},u=b=>{var h;(h=r.value)!=null&&h.cell&&(r.value.label=b,r.value.cell.setAttrByPath("label/text",b))},g=b=>{if(!t||!c)return;const h=c.getSourceCell(),N=c.getTargetCell();if(!h||!N)return;const V=h.position(),z=N.position(),R=(V.x+z.x)/2,O=(V.y+z.y)/2,_=t.addNode({shape:b.type,x:R,y:O,label:b.name,data:{nodeType:b.type}});c.remove(),t.addEdge({source:{cell:h,port:"port-out"},target:{cell:_,port:"port-in"}}),b.type==="condition"?(t.addEdge({source:{cell:_,port:"port-out-0"},target:{cell:N,port:"port-in"},labels:[{attrs:{label:{text:"True",fill:"#e2e8f0",fontSize:12},rect:{fill:"#334155",stroke:"#64748b",strokeWidth:1,rx:4,ry:4}},position:.5}]}),t.addEdge({source:{cell:_,port:"port-out-1"},target:{cell:N,port:"port-in"},labels:[{attrs:{label:{text:"False",fill:"#e2e8f0",fontSize:12},rect:{fill:"#334155",stroke:"#64748b",strokeWidth:1,rx:4,ry:4}},position:.5}]})):t.addEdge({source:{cell:_,port:"port-out"},target:{cell:N,port:"port-in"}}),p.value=!1,c=null},m=()=>{t&&t.clearCells()},k=()=>{if(!t)return console.log("画布不存在"),{errors:["画布不存在"],warnings:[]};const b=[],h=[],N=t.getNodes(),V=N.filter(R=>{var O;return((O=R.getData())==null?void 0:O.nodeType)==="start"});return V.length===0?b.push("流程中缺少开始节点"):V.length>1&&h.push("流程中有多个开始节点"),N.filter(R=>{var O;return((O=R.getData())==null?void 0:O.nodeType)==="end"}).length===0&&h.push("流程中缺少结束节点"),N.forEach(R=>{const O=R.getData(),_=O==null?void 0:O.nodeType,v=(O==null?void 0:O.config)||{},M=R.getAttrByPath("label/text")||"未命名节点";(_==="getProperty"||_==="setProperty")&&(v.elementId||b.push(`节点「${M}」未配置图元`),v.propertyName||b.push(`节点「${M}」未配置属性`),_==="setProperty"&&!v.value&&h.push(`节点「${M}」未配置属性值`)),_==="httpRequest"&&(v.url||b.push(`节点「${M}」未配置请求URL`)),_==="condition"&&(!v.branches||v.branches.length===0)&&b.push(`节点「${M}」未配置条件分支`),_==="timer"&&(!v.interval||v.interval<=0)&&b.push(`节点「${M}」未配置有效的时间间隔`),_==="clearTimer"&&(v.timerId||b.push(`节点「${M}」未选择定时器`)),_==="customCode"&&(v.code||h.push(`节点「${M}」未编写代码`))}),N.forEach(R=>{var v;const O=(v=R.getData())==null?void 0:v.nodeType,_=R.getAttrByPath("label/text")||"未命名节点";if(O==="start"&&t){const M=t.getOutgoingEdges(R);(!M||M.length===0)&&b.push(`开始节点「${_}」没有连接到下一个节点`)}if(O==="end"&&t){const M=t.getOutgoingEdges(R);M&&M.length>0&&h.push(`结束节点「${_}」不应该有输出连线`)}if(O!=="start"&&O!=="end"&&t){const M=t.getIncomingEdges(R),K=t.getOutgoingEdges(R);(!M||M.length===0)&&h.push(`节点「${_}」没有输入连线`),O!=="clearTimer"&&(!K||K.length===0)&&h.push(`节点「${_}」没有输出连线`)}}),t&&N.forEach(R=>{var K;const O=t.getIncomingEdges(R),_=t.getOutgoingEdges(R),v=(K=R.getData())==null?void 0:K.nodeType,M=R.getAttrByPath("label/text")||"未命名节点";v!=="start"&&(!O||O.length===0)&&(!_||_.length===0)&&h.push(`节点「${M}」是孤立节点`)}),{errors:b,warnings:h}},B=()=>{const{errors:b,warnings:h}=k();if(b.length===0&&h.length===0)alert("✓ 流程验证通过!"),console.log("流程验证通过");else{let N="";b.length>0&&(N+=`错误:
|
|
27
|
+
`+b.map(V=>" • "+V).join(`
|
|
28
|
+
`)),h.length>0&&(N&&(N+=`
|
|
29
29
|
|
|
30
|
-
`),
|
|
31
|
-
`+
|
|
32
|
-
`)),alert(
|
|
30
|
+
`),N+=`警告:
|
|
31
|
+
`+h.map(V=>" • "+V).join(`
|
|
32
|
+
`)),alert(N),console.log("验证结果:",{errors:b,warnings:h})}},T=()=>{if(!t)return;const{errors:b,warnings:h}=k();if(b.length>0){let v=`流程验证失败,无法保存!
|
|
33
33
|
|
|
34
|
-
`;
|
|
35
|
-
`+
|
|
36
|
-
`),
|
|
34
|
+
`;v+=`错误:
|
|
35
|
+
`+b.map(M=>" • "+M).join(`
|
|
36
|
+
`),h.length>0&&(v+=`
|
|
37
37
|
|
|
38
38
|
警告:
|
|
39
|
-
`+
|
|
40
|
-
`)),alert(
|
|
39
|
+
`+h.map(M=>" • "+M).join(`
|
|
40
|
+
`)),alert(v);return}if(h.length>0){let v=`流程存在以下警告:
|
|
41
41
|
|
|
42
|
-
`;if(
|
|
43
|
-
`),
|
|
42
|
+
`;if(v+=h.map(M=>" • "+M).join(`
|
|
43
|
+
`),v+=`
|
|
44
44
|
|
|
45
|
-
是否继续保存?`,!confirm(B))return}const V=prompt("请输入流程名称:","未命名流程");if(!V||!V.trim())return;const y=t.toJSON(),D=t.getNodes().map(B=>({id:B.id,shape:B.shape,position:B.getPosition(),size:B.getSize(),attrs:B.getAttrs(),data:B.getData()})),O=t.getEdges().map(B=>({id:B.id,source:B.getSourceCellId(),target:B.getTargetCellId(),attrs:B.getAttrs(),data:B.getData()})),w={id:"workflow_"+Date.now(),name:V.trim(),data:{...y,nodes:D,edges:O},createdAt:Date.now(),updatedAt:Date.now()};try{const B=localStorage.getItem("saved-workflows"),T=B?JSON.parse(B):[];T.push(w),localStorage.setItem("saved-workflows",JSON.stringify(T)),alert("✓ 流程保存成功!"),console.log("流程已保存:",w)}catch(B){console.error("保存流程失败:",B),alert("保存失败,请重试")}};e.onMounted(()=>{a(),window.addEventListener("resize",h)});const h=()=>{!t||!r.value||t.resize(r.value.clientWidth,r.value.clientHeight)};return e.onBeforeUnmount(()=>{window.removeEventListener("resize",h);const N=E=>{if(E.key==="Delete"||E.key==="Backspace"){if(!t)return;const V=t.getSelectedCells();V.length&&(E.preventDefault(),t.removeCells(V),s.value&&V.includes(s.value.cell)&&(s.value=null))}};document.removeEventListener("keydown",N),t&&t.dispose()}),(N,E)=>(e.openBlock(),e.createElementBlock("div",Dc,[e.createVNode(Cc,{"show-close":i.showClose,onClear:b,onValidate:F,onSave:z,onClose:E[0]||(E[0]=V=>N.$emit("close"))},null,8,["show-close"]),e.createElementVNode("div",Tc,[e.createElementVNode("div",Pc,[e.createElementVNode("div",{id:"workflow-container",ref_key:"containerRef",ref:r},null,512)]),e.createVNode(hc,{"selected-cell":s.value,"onUpdate:label":u},null,8,["selected-cell"])]),e.createVNode(xc,{visible:d.value,position:c.value,"node-types":n.value,onClose:E[1]||(E[1]=V=>d.value=!1),onSelect:f},null,8,["visible","position","node-types"])]))}}),[["__scopeId","data-v-649349a2"]]),Mc={key:0,class:"workflow-dialog-overlay"},zc={class:"workflow-dialog"},Oc=H(e.defineComponent({__name:"WorkflowDialog",props:{visible:{type:Boolean},scadaGraph:{default:null}},emits:["update:visible","close"],setup(i,{emit:l}){const n=i,r=l;e.watch(()=>n.visible,d=>{d?document.body.style.overflow="hidden":document.body.style.overflow=""});const t=()=>{r("update:visible",!1),r("close")},s=d=>{d.key==="Escape"&&n.visible&&t()};return typeof window<"u"&&window.addEventListener("keydown",s),(d,c)=>i.visible?(e.openBlock(),e.createElementBlock("div",Mc,[e.createElementVNode("div",zc,[e.createVNode(Ac,{"scada-graph":i.scadaGraph,"show-close":!0,onClose:t},null,8,["scada-graph"])])])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-4e7f6ab7"]]);class Uc{constructor(){be(this,"animations",new Map)}startAnimation(l,n){if(!l||n.type==="none")return;this.stopAnimation(l.id);const r=l.id;let t=null;switch(n.type){case"blink":t=this.createBlinkAnimation(l,n);break;case"scale":t=this.createScaleAnimation(l,n);break;case"rotate":t=this.createRotateAnimation(l,n);break;case"float":t=this.createFloatAnimation(l,n);break;case"pulse":t=this.createPulseAnimation(l,n);break}t&&this.animations.set(r,t)}stopAnimation(l){const n=this.animations.get(l);n&&(n.stop&&n.stop(),n.intervalId&&clearInterval(n.intervalId),this.animations.delete(l))}createBlinkAnimation(l,n){const r=l.getAttrByPath("body/opacity")||1;let t=!0;const s=setInterval(()=>{t=!t,l.setAttrByPath("body/opacity",t?r:.2),n.loop||(clearInterval(s),l.setAttrByPath("body/opacity",r))},n.duration/2);return{intervalId:s,stop:()=>{clearInterval(s),l.setAttrByPath("body/opacity",r)}}}createScaleAnimation(l,n){const r=l.getSize();let t=!0;const s=.05;let d=1;const c=setInterval(()=>{t?(d+=s,d>=1.2&&(t=!1)):(d-=s,d<=.8&&(t=!0)),l.resize(r.width*d,r.height*d),!n.loop&&d>=.99&&d<=1.01&&(clearInterval(c),l.resize(r.width,r.height))},n.duration/20);return{intervalId:c,stop:()=>{clearInterval(c),l.resize(r.width,r.height)}}}createRotateAnimation(l,n){let r=0;const t=360/(n.duration/50),s=setInterval(()=>{r=(r+t)%360,l.rotate(r,{absolute:!0}),!n.loop&&r>=360&&(clearInterval(s),l.rotate(0,{absolute:!0}))},50);return{intervalId:s,stop:()=>{clearInterval(s),l.rotate(0,{absolute:!0})}}}createFloatAnimation(l,n){const r=l.position();let t=!0;const s=2;let d=r.y;const c=setInterval(()=>{t?(d-=s,d<=r.y-10&&(t=!1)):(d+=s,d>=r.y+10&&(t=!0)),l.position(r.x,d),!n.loop&&Math.abs(d-r.y)<1&&(clearInterval(c),l.position(r.x,r.y))},n.duration/40);return{intervalId:c,stop:()=>{clearInterval(c),l.position(r.x,r.y)}}}createPulseAnimation(l,n){const r=l.getAttrByPath("body/fill"),t=l.getAttrByPath("body/stroke");let s=0,d=!0;const c=setInterval(()=>{d?(s+=.1,s>=1&&(d=!1)):(s-=.1,s<=0&&(d=!0)),l.setAttrByPath("body/opacity",.5+s*.5),!n.loop&&s<=.05&&(clearInterval(c),l.setAttrByPath("body/fill",r),l.setAttrByPath("body/stroke",t),l.setAttrByPath("body/opacity",1))},n.duration/20);return{intervalId:c,stop:()=>{clearInterval(c),l.setAttrByPath("body/fill",r),l.setAttrByPath("body/stroke",t),l.setAttrByPath("body/opacity",1)}}}clearAll(){this.animations.forEach((l,n)=>{this.stopAnimation(n)}),this.animations.clear()}}const se=new Uc,Rc={class:"scada-layout","data-scada-theme":"dark"},Lc={class:"scada-canvas-container"},it=H(e.defineComponent({name:"ScadaCanvas",inheritAttrs:!0,__name:"ScadaCanvas",props:{authCode:{default:""},customFooter:{default:void 0},previewMode:{type:Boolean,default:!1},onSave:{type:Function,default:void 0}},emits:["preview"],setup(i,{expose:l,emit:n}){const r=i,t=n,s=e.ref(null),d=e.ref(null),c=e.ref(null),p=e.ref(0),g=e.ref(null),a=e.ref(!1);let o=null;e.onMounted(()=>{var G,L;if(!((G=s.value)!=null&&G.containerRef))return;const m=R.getConfig();oe.Graph.registerEdge("animated-edge",{inherit:"edge",markup:[{tagName:"path",selector:"line",attrs:{fill:"none"}},{tagName:"path",selector:"wrap",attrs:{fill:"none",stroke:"transparent",strokeWidth:20}},{tagName:"circle",selector:"circle"}],attrs:{line:{connection:!0,stroke:"#10b981",strokeWidth:2,targetMarker:{name:"block",width:8,height:6}},wrap:{connection:!0,strokeLinecap:"round",strokeLinejoin:"round"}}},!0);const k=s.value.containerRef,$=m.size.width,_=m.size.height;if((M=>{k.style.width=`${$}px`,k.style.height=`${_}px`,k.style.transform=`scale(${M})`,k.style.transformOrigin="center center"})(m.zoom.scale),o=new oe.Graph({container:k,width:$,height:_,background:m.background.image?{color:m.background.color||"#1e293b",image:m.background.image,size:m.background.size||"cover",repeat:m.background.repeat||"no-repeat",position:"center"}:{color:m.background.color||"#1e293b"},grid:m.grid.enabled?{size:m.grid.size,visible:!0,type:m.grid.type||"dot",args:{color:m.grid.color||"#475569",thickness:1}}:!1,interacting:{nodeMovable:!r.previewMode},panning:{enabled:!0,modifiers:"shift"},mousewheel:{enabled:!0,modifiers:["ctrl","meta"]},connecting:{router:{name:"orth",args:{padding:10}},connector:{name:"rounded",args:{radius:8}},snap:m.magnetism.enabled?{radius:m.magnetism.threshold||10}:!1,allowBlank:!1,allowLoop:!1,allowNode:!1,allowEdge:!1,highlight:!0,createEdge(){return o.createEdge({shape:"animated-edge",zIndex:0})},validateConnection({targetMagnet:M}){return!!M}}}),r.previewMode||o.use(new Ge.Selection({enabled:!0,movable:!0,rubberband:!0,showNodeSelectionBox:!1,showEdgeSelectionBox:!1,multiple:!0,pointerEvents:"none"})),m.guides.enabled&&o.use(new pt.Snapline({enabled:!0,sharp:!0,clean:!0})),!r.previewMode){const M=Qe(de.SCADA_EDITOR_DATA);if(((L=M==null?void 0:M.cells)==null?void 0:L.length)>0)try{const W=M.cells.map(J=>{var ee;return J.position&&typeof J.position=="object"&&(typeof J.position.x!="number"||typeof J.position.y!="number")&&(J.position={x:100,y:100}),(J.shape==="edge"||J.shape==="animated-edge")&&(J.router==="manhattan"||((ee=J.router)==null?void 0:ee.name)==="manhattan")&&(J.router={name:"orth",args:{padding:10}}),J});o.fromJSON({cells:W}),o.getEdges().forEach(J=>{var X;const ee=J.getData();(X=ee==null?void 0:ee.animation)!=null&&X.enabled&&N(J,ee.animation)})}catch(W){console.error("恢复画布数据失败,清空缓存:",W),sessionStorage.removeItem(de.SCADA_EDITOR_DATA)}}o.on("selection:changed",({selected:M})=>{var J,ee;const W=M?M.filter(X=>X.isNode()):[];if(p.value=W.length,M&&M.length>0){const X=M[0];if(X.isNode())d.value=X,c.value=null;else if(X.isEdge()){c.value=X,d.value=null;const pe=X.getAttrs();X.data={...X.data,originalAttrs:pe},X.attr("line/stroke","#3b82f6")}}else{if(c.value&&((J=c.value.data)!=null&&J.originalAttrs)){const X=c.value.data.originalAttrs;c.value.attr("line/stroke",((ee=X.line)==null?void 0:ee.stroke)||"#10b981")}d.value=null,c.value=null}}),o.on("edge:click",({edge:M})=>{o.select(M)}),o.on("blank:click",()=>{c.value=null,d.value=null}),o.on("node:change:position",()=>{}),o.on("node:change:size",()=>{}),o.on("node:change:data",({node:M})=>{const W=M.getData();if(W.animation)if(W.animation.enabled===!0){const J={type:W.animation.type||"none",duration:W.animation.duration||1e3,loop:W.animation.loop!==!1};se.startAnimation(M,J)}else se.stopAnimation(M.id)}),o.on("edge:change:data",({edge:M})=>{const W=M.getData();W!=null&&W.animation&&N(M,W.animation)});const q=M=>{if(M.key==="Delete"&&o){if(d.value){const W=d.value.id;se.stopAnimation(W),o.removeNode(W),d.value=null}else if(c.value){const W=c.value.id;o.removeEdge(W),c.value=null}}};document.addEventListener("keydown",q),e.onUnmounted(()=>{document.removeEventListener("keydown",q)})}),e.onUnmounted(()=>{if(o){se.clearAll();const m={cells:o.toJSON().cells};Me(de.SCADA_EDITOR_DATA,m),o.dispose()}}),e.watch(()=>R.getConfig(),m=>{var $;if(!o)return;m.background.image?o.drawBackground({color:m.background.color||"#1e293b",image:m.background.image,size:m.background.size||"cover",repeat:m.background.repeat||"no-repeat",position:"center"}):o.drawBackground({color:m.background.color||"#1e293b"});const k=($=s.value)==null?void 0:$.containerRef;k&&(k.style.transform=`scale(${m.zoom.scale})`,k.style.transformOrigin="center center",o.resize(m.size.width,m.size.height),k.style.width=`${m.size.width}px`,k.style.height=`${m.size.height}px`),m.grid.enabled?(o.drawGrid({type:m.grid.type||"dot",args:{color:m.grid.color||"#475569",thickness:1}}),o.showGrid()):o.hideGrid(),m.grid.enabled&&m.grid.size&&o.setGridSize(m.grid.size),o.translate(m.offset.x,m.offset.y)},{deep:!0});const u=e.ref({}),f=(m,k)=>(u.value[m]||(u.value[m]=0),u.value[m]++,`${k}_${u.value[m]}`),b=m=>{var L,M,W,J;if(!o)return;const k=me.getComponent(m);if(!k){console.error(`未找到组件配置: ${m}`);return}const $=f(m,k.metadata.name),_={enabled:!1,type:"none",duration:1e3,loop:!0},j=nt(50,50,400,300),q={x:j.x,y:j.y,shape:k.shape,width:k.width,height:k.height,label:k.label,attrs:k.attrs,ports:k.ports,data:{...k.data,componentType:m,componentName:$,props:k.props,animation:_,originalStroke:((M=(L=k.attrs)==null?void 0:L.body)==null?void 0:M.stroke)||"#2563eb",originalStrokeWidth:((J=(W=k.attrs)==null?void 0:W.body)==null?void 0:J.strokeWidth)||2}},G=o.addNode(q);o.cleanSelection(),o.select(G)},S=m=>{if(d.value&&(m.attrs&&Object.keys(m.attrs).forEach(k=>{const $=m.attrs[k];typeof $=="object"?Object.keys($).forEach(_=>{d.value.attr(`${k}/${_}`,$[_])}):d.value.attr(k,$)}),m.position&&(typeof m.position.x=="number"&&typeof m.position.y=="number"?d.value.setPosition(m.position):console.error("position 数据格式错误:",m.position)),m.size&&(typeof m.size.width=="number"&&typeof m.size.height=="number"?d.value.setSize(m.size):console.error("size 数据格式错误:",m.size)),m.data)){const k={...m.data};delete k.position,delete k.size,d.value.store.set("data",k)}},F=()=>{if(!d.value||!o)return;const m=d.value.id;se.stopAnimation(m),o.removeNode(m),d.value=null},z=m=>{if(c.value){if(m.attrs){Object.keys(m.attrs).forEach($=>{const _=m.attrs[$];typeof _=="object"?Object.keys(_).forEach(j=>{var q,G;c.value.attr(`${$}/${j}`,_[j]),(G=(q=c.value.data)==null?void 0:q.originalAttrs)!=null&&G[$]&&(c.value.data.originalAttrs[$][j]=_[j])}):c.value.attr($,_)});const k=c.value.getAttrs();c.value.data={...c.value.data,originalAttrs:k},c.value.attr("line/stroke","#3b82f6")}m.router&&c.value.setRouter(m.router),m.connector&&c.value.setConnector(m.connector),m.animation&&N(c.value,m.animation),m.data&&c.value.setData({...c.value.data,...m.data})}},h=()=>{!c.value||!o||(o.removeEdge(c.value.id),c.value=null)},N=(m,k)=>{if(!m||typeof m.attr!="function"){console.warn("applyEdgeAnimation: edge 对象无效",m);return}if(!k||!k.enabled){m.attr("line/strokeDasharray",void 0),typeof m.removeAttr=="function"&&m.removeAttr("line/class"),m.attr("circle",void 0),typeof m.stopTransition=="function"&&m.stopTransition("attrs/circle/atConnectionRatio");return}const $=k.duration||2e3;m.attr("circle",{r:4,atConnectionRatio:0,fill:{type:"radialGradient",stops:[{offset:"0%",color:"#FFF"},{offset:"100%",color:m.attr("line/stroke")||"#10b981"}]},stroke:m.attr("line/stroke")||"#10b981",strokeWidth:1});const _=()=>{m.attr("circle/atConnectionRatio",0,{silent:!0}),m.transition("attrs/circle/atConnectionRatio",1,{delay:0,duration:$,timing:"linear",complete:()=>{_()}})};_()},E=()=>{o&&confirm("确定要清空画布吗?")&&(se.clearAll(),o.clearCells(),d.value=null,et(de.SCADA_EDITOR_DATA))},V=()=>{if(!o)return;const m=R.getConfig().zoom.scale,k=Math.min(5,m+.1);R.setZoom(k)},y=()=>{if(!o)return;const m=R.getConfig().zoom.scale,k=Math.max(.1,m-.1);R.setZoom(k)},D=()=>{if(!o)return;const m=o.getSelectedCells().filter($=>$.isNode());if(m.length<2){Y("请选择至少两个节点","warning");return}const k=Math.min(...m.map($=>$.getPosition().x));m.forEach($=>{$.setPosition({x:k,y:$.getPosition().y})})},O=()=>{if(!o)return;const m=o.getSelectedCells().filter(_=>_.isNode());if(m.length<2){Y("请选择至少两个节点","warning");return}const k=m.map(_=>_.getPosition().x+_.getSize().width/2),$=k.reduce((_,j)=>_+j,0)/k.length;m.forEach(_=>{const j=$-_.getSize().width/2;_.setPosition({x:j,y:_.getPosition().y})})},A=()=>{if(!o)return;const m=o.getSelectedCells().filter($=>$.isNode());if(m.length<2){Y("请选择至少两个节点","warning");return}const k=Math.max(...m.map($=>$.getPosition().x+$.getSize().width));m.forEach($=>{const _=k-$.getSize().width;$.setPosition({x:_,y:$.getPosition().y})})},w=()=>{if(!o)return;const m=o.getSelectedCells().filter($=>$.isNode());if(m.length<2){Y("请选择至少两个节点","warning");return}const k=Math.min(...m.map($=>$.getPosition().y));m.forEach($=>{$.setPosition({x:$.getPosition().x,y:k})})},B=()=>{if(!o)return;const m=o.getSelectedCells().filter(_=>_.isNode());if(m.length<2){Y("请选择至少两个节点","warning");return}const k=m.map(_=>_.getPosition().y+_.getSize().height/2),$=k.reduce((_,j)=>_+j,0)/k.length;m.forEach(_=>{const j=$-_.getSize().height/2;_.setPosition({x:_.getPosition().x,y:j})})},T=()=>{if(!o)return;const m=o.getSelectedCells().filter($=>$.isNode());if(m.length<2){Y("请选择至少两个节点","warning");return}const k=Math.max(...m.map($=>$.getPosition().y+$.getSize().height));m.forEach($=>{const _=k-$.getSize().height;$.setPosition({x:$.getPosition().x,y:_})})},K=()=>{if(!o)return;const m=o.getSelectedCells().filter(G=>G.isNode());if(m.length<3){Y("请选择至少三个节点","warning");return}const k=m.sort((G,L)=>G.getPosition().x-L.getPosition().x),$=k[0],q=(k[k.length-1].getPosition().x-$.getPosition().x)/(k.length-1);k.forEach((G,L)=>{if(L===0||L===k.length-1)return;const M=$.getPosition().x+q*L;G.setPosition({x:M,y:G.getPosition().y})})},te=()=>{if(!o)return;const m=o.getSelectedCells().filter(G=>G.isNode());if(m.length<3){Y("请选择至少三个节点","warning");return}const k=m.sort((G,L)=>G.getPosition().y-L.getPosition().y),$=k[0],q=(k[k.length-1].getPosition().y-$.getPosition().y)/(k.length-1);k.forEach((G,L)=>{if(L===0||L===k.length-1)return;const M=$.getPosition().y+q*L;G.setPosition({x:G.getPosition().x,y:M})})},ce=async()=>{if(!o){Y("画布未初始化","error");return}try{if(console.log("[ScadaCanvas] handleSave 被调用"),console.log("[ScadaCanvas] props.onSave:",r.onSave),r.onSave){console.log("[ScadaCanvas] 调用自定义 onSave 回调"),await r.onSave(),console.log("[ScadaCanvas] 自定义 onSave 回调执行完成");return}console.log("[ScadaCanvas] 没有自定义回调,执行默认下载");const m={version:"1.0.0",timestamp:new Date().toISOString(),config:{size:R.getConfig().size,background:R.getConfig().background,grid:R.getConfig().grid,guides:R.getConfig().guides,magnetism:R.getConfig().magnetism,zoom:R.getConfig().zoom},cells:o.toJSON().cells},k=new Blob([JSON.stringify(m,null,2)],{type:"application/json"}),$=URL.createObjectURL(k),_=document.createElement("a"),j=`scada-canvas-${new Date().getTime()}.json`;_.href=$,_.download=j,_.click(),URL.revokeObjectURL($),Y("保存成功","success")}catch(m){console.error("保存失败",m),Y("保存失败,请查看控制台","error")}},Ne=()=>{g.value&&g.value.click()},le=m=>{var j;const $=(j=m.target.files)==null?void 0:j[0];if(!$){Y("请选择文件","error");return}const _=new FileReader;_.onload=q=>{var G;try{const L=JSON.parse((G=q.target)==null?void 0:G.result);if(!L.cells){Y("无效的JSON文件格式","error");return}if(!confirm("导入将清空当前画布,是否继续?"))return;if(o){if(o.clearCells(),o.fromJSON({cells:L.cells}),o.getEdges().forEach(M=>{var J;const W=M.getData();(J=W==null?void 0:W.animation)!=null&&J.enabled&&N(M,W.animation)}),L.config&&R.updateConfig(L.config),L.workflows&&Array.isArray(L.workflows)&&L.workflows.length>0)try{const M=localStorage.getItem("saved-workflows"),W=M?JSON.parse(M):[];let J=0,ee=0;L.workflows.forEach(X=>{const pe=W.findIndex(ye=>ye.id===X.id);pe>=0?(W[pe]={...X,updatedAt:Date.now()},ee++):(W.push(X),J++)}),localStorage.setItem("saved-workflows",JSON.stringify(W)),Y(`导入成功 画布已加载,流程: 新增${J}个,更新${ee}个`,"success")}catch(M){console.error("导入流程数据失败:",M),Y("画布导入成功, 但流程数据导入失败","warning")}else Y("导入成功","success");g.value&&(g.value.value="")}}catch(L){console.error("导入失败",L),Y("导入失败,JSON格式错误","error"),g.value&&(g.value.value="")}},_.readAsText($)},he=()=>{if(console.log("🎬 [ScadaCanvas] handlePreview 被调用"),!o){console.error("⚠️ [ScadaCanvas] graph 不存在");return}const m={cells:o.toJSON().cells,config:{width:R.getConfig().size.width,height:R.getConfig().size.height,background:R.getConfig().background,grid:R.getConfig().grid}};Me(de.SCADA_PREVIEW_DATA,m),console.log("✅ [ScadaCanvas] 数据已保存到 sessionStorage"),console.log("📤 [ScadaCanvas] 即将触发 preview 事件"),t("preview"),console.log("✅ [ScadaCanvas] preview 事件已触发")},Ve=()=>{a.value=!0},ke=()=>{if(!o){Y("画布未初始化","error");return}try{const m={version:"1.0.0",timestamp:Oe(Ue()),config:{size:R.getConfig().size,background:R.getConfig().background,grid:R.getConfig().grid,guides:R.getConfig().guides,magnetism:R.getConfig().magnetism,zoom:R.getConfig().zoom},cells:o.toJSON().cells,nodes:o.getNodes().map(_=>({id:_.id,type:_.shape,position:_.getPosition(),size:_.getSize(),label:_.attr("label/text"),data:_.getData()})),edges:o.getEdges().map(_=>({id:_.id,source:_.getSourceCellId(),target:_.getTargetCellId()})),workflows:[]},k=new Set;if(o.getNodes().forEach(_=>{const j=_.getData();j!=null&&j.events&&Array.isArray(j.events)&&j.events.forEach(q=>{var G;q.action==="callProcess"&&((G=q.params)!=null&&G.processId)&&k.add(q.params.processId)})}),k.size>0)try{const _=localStorage.getItem("saved-workflows");if(_){const j=JSON.parse(_);m.workflows=j.filter(q=>k.has(q.id))}}catch(_){console.error("加载流程数据失败:",_)}const $=tt(m,"scada-export");Y(`已导出为 ${$}`,"success")}catch(m){console.error("导出失败",m),Y("导出失败,请查看控制台","error")}};return l({save:ce,import:Ne,export:ke,preview:he,workflow:Ve,zoomIn:V,zoomOut:y,clearAll:E,alignLeft:D,alignCenter:O,alignRight:A,alignTop:w,alignMiddle:B,alignBottom:T,distributeHorizontal:K,distributeVertical:te,addNode:b,updateNode:S,deleteNode:F,getSelectedNode:()=>d.value,selectNode:m=>{if(!o)return!1;const k=o.getCellById(m);return k?(o.select(k),!0):!1},clearSelection:()=>{o&&(o.unselect(o.getSelectedCells()),d.value=null)},getGraph:()=>o,getCanvasData:()=>o?{version:"1.0.0",timestamp:Oe(Ue()),config:R.getConfig(),cells:o.toJSON().cells,nodes:o.getNodes().map(m=>({id:m.id,type:m.shape,position:m.getPosition(),size:m.getSize(),label:m.attr("label/text"),data:m.getData()})),edges:o.getEdges().map(m=>({id:m.id,source:m.getSourceCellId(),target:m.getTargetCellId()}))}:null,loadCanvasData:m=>{if(!o)return!1;try{return o.clearCells(),o.fromJSON({cells:m.cells}),m.config&&R.updateConfig(m.config),o.getEdges().forEach(k=>{var _;const $=k.getData();(_=$==null?void 0:$.animation)!=null&&_.enabled&&N(k,$.animation)}),!0}catch(k){return console.error("加载画布数据失败:",k),!1}},getAllNodes:()=>o?o.getNodes().map(m=>({id:m.id,type:m.shape,position:m.getPosition(),size:m.getSize(),label:m.attr("label/text"),data:m.getData()})):[],getNodeById:m=>{if(!o)return null;const k=o.getCellById(m);if(!k||!k.isNode())return null;const $=k;return{id:$.id,type:$.shape,position:$.getPosition(),size:$.getSize(),label:$.attr("label/text"),data:$.getData()}},getConfigManager:()=>R,updateCanvasConfig:m=>{R.updateConfig(m)},setZoom:m=>{R.setZoom(m)},setCanvasSize:(m,k)=>{R.updateSize({width:m,height:k})},setBackgroundColor:m=>{R.updateBackground({color:m})},getAnimationEngine:()=>se}),(m,k)=>(e.openBlock(),e.createElementBlock("div",Rc,[r.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(we,{key:0,"selected-nodes-count":p.value,onSave:ce,onImport:Ne,onWorkflow:Ve,onPreview:he,onExport:ke,onZoomIn:V,onZoomOut:y,onClearAll:E,onAlignLeft:D,onAlignCenter:O,onAlignRight:A,onAlignTop:w,onAlignMiddle:B,onAlignBottom:T,onDistributeHorizontal:K,onDistributeVertical:te},null,8,["selected-nodes-count"])),r.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("input",{key:1,ref_key:"fileInputRef",ref:g,type:"file",accept:".json",style:{display:"none"},onChange:le},null,544)),e.createElementVNode("div",Lc,[r.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Se,{key:0,onAddComponent:b})),e.createVNode(no,{ref_key:"canvasAreaRef",ref:s},null,512),r.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Re,{key:1,ref:"propertyPanelRef","selected-node":d.value,"selected-edge":c.value,onUpdateNode:S,onDeleteNode:F,onUpdateEdge:z,onDeleteEdge:h},null,8,["selected-node","selected-edge"]))]),e.createVNode(Qr,{"auth-code":i.authCode,"custom-footer":i.customFooter},null,8,["auth-code","custom-footer"]),r.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Oc,{key:2,visible:a.value,"onUpdate:visible":k[0]||(k[0]=$=>a.value=$),"scada-graph":e.unref(o),onClose:k[1]||(k[1]=$=>a.value=!1)},null,8,["visible","scada-graph"]))]))}}),[["__scopeId","data-v-dd826323"]]),Wc={ScadaCanvas:it,PropertyPanel:Re,Header:we,ComponentLibrary:Se,CanvasConfigPanel:_e,BindingCard:Te,EventCard:Ie,BasicPropertiesTab:xe,AttributeConfigDialog:Pe,CustomCodeDialog:Ae},rt=i=>{Object.entries(Wc).forEach(([l,n])=>{i.component(l,n)})},Fc={install:rt,version:"1.0.0"};I.AttributeConfigDialog=Pe,I.BasicComponents=Ut,I.BasicPropertiesTab=xe,I.BindingCard=Te,I.CanvasConfigPanel=_e,I.ComponentLibrary=Se,I.CustomCodeDialog=Ae,I.EventCard=Ie,I.Header=we,I.IoTComponents=Rt,I.PropertyPanel=Re,I.STORAGE_KEYS=de,I.ScadaCanvas=it,I.animationEngine=se,I.canvasConfigItems=Wt,I.canvasConfigManager=R,I.componentRegistry=me,I.default=Fc,I.defaultCanvasConfig=Be,I.exportToJSON=tt,I.formatTimestamp=Oe,I.generateEventId=ot,I.generateNodeId=Nr,I.generateUniqueId=ze,I.getCurrentTimestamp=Ue,I.install=rt,I.loadFromLocal=yr,I.loadFromSession=Qe,I.randomPosition=nt,I.removeFromLocal=br,I.removeFromSession=et,I.saveToLocal=Er,I.saveToSession=Me,I.showMessage=Y,I.sizePresetMap=ue,Object.defineProperties(I,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
45
|
+
是否继续保存?`,!confirm(v))return}const N=prompt("请输入流程名称:","未命名流程");if(!N||!N.trim())return;const V=t.toJSON(),z=t.getNodes().map(v=>({id:v.id,shape:v.shape,position:v.getPosition(),size:v.getSize(),attrs:v.getAttrs(),data:v.getData()})),R=t.getEdges().map(v=>({id:v.id,source:v.getSourceCellId(),target:v.getTargetCellId(),attrs:v.getAttrs(),data:v.getData()})),_={id:"workflow_"+Date.now(),name:N.trim(),data:{...V,nodes:z,edges:R},createdAt:Date.now(),updatedAt:Date.now()};try{const v=localStorage.getItem("saved-workflows"),M=v?JSON.parse(v):[];M.push(_),localStorage.setItem("saved-workflows",JSON.stringify(M)),alert("✓ 流程保存成功!"),console.log("流程已保存:",_)}catch(v){console.error("保存流程失败:",v),alert("保存失败,请重试")}};e.onMounted(()=>{a(),window.addEventListener("resize",E)});const E=()=>{!t||!s.value||t.resize(s.value.clientWidth,s.value.clientHeight)};return e.onBeforeUnmount(()=>{window.removeEventListener("resize",E);const b=h=>{if(h.key==="Delete"||h.key==="Backspace"){if(!t)return;const N=t.getSelectedCells();N.length&&(h.preventDefault(),t.removeCells(N),r.value&&N.includes(r.value.cell)&&(r.value=null))}};document.removeEventListener("keydown",b),t&&t.dispose()}),(b,h)=>(e.openBlock(),e.createElementBlock("div",lp,[e.createVNode(Jc,{"show-close":i.showClose,onClear:m,onValidate:B,onSave:T,onClose:h[0]||(h[0]=N=>b.$emit("close"))},null,8,["show-close"]),e.createElementVNode("div",np,[e.createElementVNode("div",ap,[e.createElementVNode("div",{id:"workflow-container",ref_key:"containerRef",ref:s},null,512)]),e.createVNode(jc,{"selected-cell":r.value,"onUpdate:label":u},null,8,["selected-cell"])]),e.createVNode(tp,{visible:p.value,position:d.value,"node-types":o.value,onClose:h[1]||(h[1]=N=>p.value=!1),onSelect:g},null,8,["visible","position","node-types"])]))}}),[["__scopeId","data-v-649349a2"]]),ip={key:0,class:"workflow-dialog-overlay"},sp={class:"workflow-dialog"},dp=A(e.defineComponent({__name:"WorkflowDialog",props:{visible:{type:Boolean},scadaGraph:{default:null}},emits:["update:visible","close"],setup(i,{emit:l}){const o=i,s=l;e.watch(()=>o.visible,p=>{p?document.body.style.overflow="hidden":document.body.style.overflow=""});const t=()=>{s("update:visible",!1),s("close")},r=p=>{p.key==="Escape"&&o.visible&&t()};return typeof window<"u"&&window.addEventListener("keydown",r),(p,d)=>i.visible?(e.openBlock(),e.createElementBlock("div",ip,[e.createElementVNode("div",sp,[e.createVNode(rp,{"scada-graph":i.scadaGraph,"show-close":!0,onClose:t},null,8,["scada-graph"])])])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-4e7f6ab7"]]),cp=A(e.defineComponent({__name:"EChartsGauge",props:{node:{}},setup(i){const l=i,o=e.ref();let s=null;const t=()=>l.node?l.node.getData?l.node.getData():l.node.data||{}:{},r=()=>{o.value&&(s&&s.dispose(),s=Je.init(o.value),p())},p=()=>{if(!s)return;const d=t(),c=d.presetId||"basic",f=co(c);console.log("[EChartsGauge] 预设ID:",c),console.log("[EChartsGauge] 预设配置:",f),console.log("[EChartsGauge] 节点数据:",d);const a={tooltip:{formatter:"{a} <br/>{b} : {c}%"},series:[{name:d.name||"Pressure",type:"gauge",data:[{value:d.value??50,name:d.title||"SCORE"}]}]};f&&f.config?(Object.assign(a.series[0],f.config),console.log("[EChartsGauge] 最终配置:",a)):console.warn("[EChartsGauge] 预设未找到或配置为空"),s.setOption(a,!0)};return e.watch(()=>{var d;return(d=l.node)==null?void 0:d.data},(d,c)=>{console.log("[EChartsGauge] data 变化:",d),console.log("[EChartsGauge] 旧数据:",c),p()},{deep:!0}),e.watch(()=>{var d,c;return(c=(d=l.node)==null?void 0:d.data)==null?void 0:c.presetId},(d,c)=>{console.log("[EChartsGauge] presetId 变化:",c,"->",d),d!==c&&p()}),e.watch(()=>{var d;return(d=l.node)==null?void 0:d.size},()=>{if(s&&l.node){const d=l.node.getSize?l.node.getSize():l.node.size||{width:200,height:200};s.resize({width:d.width,height:d.height})}},{deep:!0}),e.onMounted(()=>{setTimeout(()=>{r(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",({current:d})=>{console.log("[EChartsGauge] X6 data 变化事件:",d),p()})},100)}),e.onUnmounted(()=>{s&&(s.dispose(),s=null)}),(d,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"chartRef",ref:o,class:"echarts-gauge-component",style:{width:"100%",height:"100%"}},null,512))}}),[["__scopeId","data-v-9a90f768"]]),pp=e.defineComponent({__name:"EChartsLine",props:{node:{}},setup(i){const l=i,o=e.ref();let s=null;const t=()=>l.node?l.node.getData?l.node.getData():l.node.data||{}:{},r=()=>{o.value&&(s=Je.init(o.value),p())},p=()=>{if(!s)return;const d=t(),c=d.presetId||"basic",f=po(c),a={title:{text:d.title||"数据趋势",left:"center",top:10,textStyle:{color:"#fff",fontSize:14}},tooltip:{trigger:"axis",backgroundColor:"rgba(0, 0, 0, 0.7)",borderColor:"#333",textStyle:{color:"#fff"}},grid:{left:"10%",right:"10%",top:"20%",bottom:"15%",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:d.xAxisData||["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],axisLine:{lineStyle:{color:"#999"}},axisLabel:{color:"#999"}},yAxis:{type:"value",axisLine:{lineStyle:{color:"#999"}},axisLabel:{color:"#999"},splitLine:{lineStyle:{color:"rgba(255, 255, 255, 0.1)"}}},series:[{name:d.seriesName||"Data",type:"line",data:d.seriesData||[120,200,150,80,70,110,130]}]};f&&f.config&&Object.assign(a.series[0],f.config),s.setOption(a,!0)};return e.onMounted(()=>{setTimeout(()=>{r(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",({current:d})=>{p()})},100)}),e.onUnmounted(()=>{s&&(s.dispose(),s=null)}),(d,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"chartContainer",ref:o,style:{width:"100%",height:"100%"}},null,512))}}),mp={class:"light-3d-container"},fp={viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg"},up=["id"],gp=["stop-color"],hp=["stop-color"],yp=["stop-color"],bp=["id"],kp=["id"],Ep=["id"],Np=["flood-color"],Vp=["fill","filter"],xp=["fill","filter"],wp=["opacity"],$p={key:1,opacity:"0.8"},Cp=["fill"],_p=["fill"],vp=["fill"],Bp=["fill"],Sp=["fill"],Dp=A(e.defineComponent({__name:"Light3D",props:{node:{}},setup(i){const l=i,o=e.ref(`light-${Math.random().toString(36).substr(2,9)}`),s=()=>l.node?l.node.getData?l.node.getData():l.node.data||{}:{},t=e.ref(!1),r=e.ref("#fbbf24"),p=(c,f)=>{const a=c.replace("#",""),n=parseInt(a.substring(0,2),16),u=parseInt(a.substring(2,4),16),g=parseInt(a.substring(4,6),16),m=Math.max(0,Math.floor(n*(1-f))),k=Math.max(0,Math.floor(u*(1-f))),B=Math.max(0,Math.floor(g*(1-f)));return`#${m.toString(16).padStart(2,"0")}${k.toString(16).padStart(2,"0")}${B.toString(16).padStart(2,"0")}`},d=()=>{const c=s();t.value=c.state===!0||c.state==="on",r.value=c.color||"#fbbf24"};return e.watch(()=>l.node,()=>{d()},{deep:!0}),e.onMounted(()=>{d(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{d()})}),(c,f)=>(e.openBlock(),e.createElementBlock("div",mp,[(e.openBlock(),e.createElementBlock("svg",fp,[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`bulb-gradient-${o.value}`,cx:"40%",cy:"30%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value?"#fff9e6":"#e5e7eb"},null,8,gp),e.createElementVNode("stop",{offset:"50%","stop-color":t.value?r.value:"#d1d5db"},null,8,hp),e.createElementVNode("stop",{offset:"100%","stop-color":t.value?p(r.value,.3):"#9ca3af"},null,8,yp)],8,up),e.createElementVNode("linearGradient",{id:`base-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[...f[0]||(f[0]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#94a3b8"},null,-1),e.createElementVNode("stop",{offset:"50%","stop-color":"#64748b"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#475569"},null,-1)])],8,bp),e.createElementVNode("filter",{id:`glow-${o.value}`},[...f[1]||(f[1]=[e.createElementVNode("feGaussianBlur",{stdDeviation:"3",result:"coloredBlur"},null,-1),e.createElementVNode("feMerge",null,[e.createElementVNode("feMergeNode",{in:"coloredBlur"}),e.createElementVNode("feMergeNode",{in:"SourceGraphic"})],-1)])],8,kp),e.createElementVNode("filter",{id:`outer-glow-${o.value}`},[f[2]||(f[2]=e.createElementVNode("feGaussianBlur",{stdDeviation:"5",result:"blur"},null,-1)),e.createElementVNode("feFlood",{"flood-color":r.value,"flood-opacity":"0.6",result:"color"},null,8,Np),f[3]||(f[3]=e.createElementVNode("feComposite",{in:"color",in2:"blur",operator:"in",result:"glow"},null,-1)),f[4]||(f[4]=e.createElementVNode("feMerge",null,[e.createElementVNode("feMergeNode",{in:"glow"}),e.createElementVNode("feMergeNode",{in:"SourceGraphic"})],-1))],8,Ep)]),t.value?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:"50",cy:"35",r:"32",fill:r.value,opacity:"0.3",filter:`url(#outer-glow-${o.value})`},null,8,Vp)):e.createCommentVNode("",!0),e.createElementVNode("ellipse",{cx:"50",cy:"35",rx:"25",ry:"28",fill:`url(#bulb-gradient-${o.value})`,stroke:"#cbd5e1","stroke-width":"0.5",filter:t.value?`url(#glow-${o.value})`:"none"},null,8,xp),e.createElementVNode("ellipse",{cx:"42",cy:"25",rx:"8",ry:"10",fill:"#ffffff",opacity:t.value?.7:.3},null,8,wp),t.value?(e.openBlock(),e.createElementBlock("g",$p,[...f[5]||(f[5]=[e.createElementVNode("path",{d:"M 45 30 Q 47 35 45 40",stroke:"#ff9500","stroke-width":"1.5",fill:"none"},null,-1),e.createElementVNode("path",{d:"M 55 30 Q 53 35 55 40",stroke:"#ff9500","stroke-width":"1.5",fill:"none"},null,-1)])])):e.createCommentVNode("",!0),f[10]||(f[10]=e.createElementVNode("ellipse",{cx:"50",cy:"60",rx:"15",ry:"4",fill:"#94a3b8"},null,-1)),e.createElementVNode("g",null,[e.createElementVNode("rect",{x:"40",y:"63",width:"20",height:"3",fill:`url(#base-gradient-${o.value})`,rx:"1"},null,8,Cp),e.createElementVNode("rect",{x:"40",y:"67",width:"20",height:"3",fill:`url(#base-gradient-${o.value})`,rx:"1"},null,8,_p),e.createElementVNode("rect",{x:"40",y:"71",width:"20",height:"3",fill:`url(#base-gradient-${o.value})`,rx:"1"},null,8,vp),e.createElementVNode("rect",{x:"40",y:"75",width:"20",height:"3",fill:`url(#base-gradient-${o.value})`,rx:"1"},null,8,Bp),f[6]||(f[6]=e.createElementVNode("rect",{x:"40",y:"66",width:"20",height:"1",fill:"#1e293b",opacity:"0.3"},null,-1)),f[7]||(f[7]=e.createElementVNode("rect",{x:"40",y:"70",width:"20",height:"1",fill:"#1e293b",opacity:"0.3"},null,-1)),f[8]||(f[8]=e.createElementVNode("rect",{x:"40",y:"74",width:"20",height:"1",fill:"#1e293b",opacity:"0.3"},null,-1)),f[9]||(f[9]=e.createElementVNode("rect",{x:"40",y:"78",width:"20",height:"1",fill:"#1e293b",opacity:"0.3"},null,-1))]),e.createElementVNode("ellipse",{cx:"50",cy:"80",rx:"12",ry:"5",fill:`url(#base-gradient-${o.value})`},null,8,Sp),f[11]||(f[11]=e.createElementVNode("ellipse",{cx:"50",cy:"83",rx:"8",ry:"3",fill:"#334155"},null,-1)),f[12]||(f[12]=e.createElementVNode("circle",{cx:"50",cy:"85",r:"2",fill:"#475569"},null,-1))])),e.createElementVNode("div",{class:e.normalizeClass(["status-text",{"is-on":t.value}])},e.toDisplayString(t.value?"开启":"关闭"),3)]))}}),[["__scopeId","data-v-7237b5fc"]]),Ip={class:"switch-3d-container"},Tp={viewBox:"0 0 120 80",xmlns:"http://www.w3.org/2000/svg"},zp=["id"],Mp=["id"],Ap=["id"],Pp=["id"],Op=["fill"],Lp=["fill"],Rp=["fill"],Up=["transform"],Wp=["fill"],Fp=["fill","filter"],Gp=["opacity"],jp=["fill","filter"],Hp=["opacity"],qp=A(e.defineComponent({__name:"Switch3D",props:{node:{}},setup(i){const l=i,o=e.ref(`switch-${Math.random().toString(36).substr(2,9)}`),s=()=>l.node?l.node.getData?l.node.getData():l.node.data||{}:{},t=e.ref(!1),r=e.computed(()=>t.value?72:48),p=()=>{const d=s();t.value=d.state===!0||d.state==="on"};return e.watch(()=>l.node,()=>{p()},{deep:!0}),e.onMounted(()=>{p(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{p()})}),(d,c)=>(e.openBlock(),e.createElementBlock("div",Ip,[(e.openBlock(),e.createElementBlock("svg",Tp,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`base-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[...c[0]||(c[0]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#475569"},null,-1),e.createElementVNode("stop",{offset:"50%","stop-color":"#334155"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#1e293b"},null,-1)])],8,zp),e.createElementVNode("linearGradient",{id:`track-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[...c[1]||(c[1]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#1e293b"},null,-1),e.createElementVNode("stop",{offset:"50%","stop-color":"#0f172a"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#1e293b"},null,-1)])],8,Mp),e.createElementVNode("linearGradient",{id:`handle-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[...c[2]||(c[2]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#e2e8f0"},null,-1),e.createElementVNode("stop",{offset:"50%","stop-color":"#cbd5e1"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#94a3b8"},null,-1)])],8,Ap),e.createElementVNode("filter",{id:`indicator-glow-${o.value}`},[...c[3]||(c[3]=[e.createElementVNode("feGaussianBlur",{stdDeviation:"3",result:"coloredBlur"},null,-1),e.createElementVNode("feMerge",null,[e.createElementVNode("feMergeNode",{in:"coloredBlur"}),e.createElementVNode("feMergeNode",{in:"SourceGraphic"})],-1)])],8,Pp)]),e.createElementVNode("rect",{x:"20",y:"25",width:"80",height:"50",rx:"8",fill:`url(#base-gradient-${o.value})`,stroke:"#0f172a","stroke-width":"1"},null,8,Op),c[6]||(c[6]=e.createStaticVNode('<g data-v-09d0019e><circle cx="30" cy="35" r="3" fill="#0f172a" data-v-09d0019e></circle><circle cx="30" cy="35" r="1.5" fill="#475569" data-v-09d0019e></circle><line x1="28" y1="35" x2="32" y2="35" stroke="#1e293b" stroke-width="0.5" data-v-09d0019e></line><circle cx="90" cy="35" r="3" fill="#0f172a" data-v-09d0019e></circle><circle cx="90" cy="35" r="1.5" fill="#475569" data-v-09d0019e></circle><line x1="88" y1="35" x2="92" y2="35" stroke="#1e293b" stroke-width="0.5" data-v-09d0019e></line><circle cx="30" cy="65" r="3" fill="#0f172a" data-v-09d0019e></circle><circle cx="30" cy="65" r="1.5" fill="#475569" data-v-09d0019e></circle><line x1="28" y1="65" x2="32" y2="65" stroke="#1e293b" stroke-width="0.5" data-v-09d0019e></line><circle cx="90" cy="65" r="3" fill="#0f172a" data-v-09d0019e></circle><circle cx="90" cy="65" r="1.5" fill="#475569" data-v-09d0019e></circle><line x1="88" y1="65" x2="92" y2="65" stroke="#1e293b" stroke-width="0.5" data-v-09d0019e></line></g>',1)),e.createElementVNode("rect",{x:"40",y:"38",width:"40",height:"24",rx:"12",fill:`url(#track-gradient-${o.value})`,stroke:"#0f172a","stroke-width":"1"},null,8,Lp),c[7]||(c[7]=e.createElementVNode("text",{x:"48",y:"53","font-size":"8",fill:"#64748b","text-anchor":"middle","font-weight":"bold"},"OFF",-1)),e.createElementVNode("text",{x:"72",y:"53","font-size":"8",fill:t.value?"#22c55e":"#64748b","text-anchor":"middle","font-weight":"bold"},"ON",8,Rp),e.createElementVNode("g",{transform:`translate(${r.value}, 0)`,style:{transition:"transform 0.3s ease"}},[c[4]||(c[4]=e.createElementVNode("ellipse",{cx:"0",cy:"52",rx:"10",ry:"3",fill:"#000",opacity:"0.3"},null,-1)),e.createElementVNode("rect",{x:"-8",y:"40",width:"16",height:"20",rx:"8",fill:`url(#handle-gradient-${o.value})`,stroke:"#94a3b8","stroke-width":"1"},null,8,Wp),c[5]||(c[5]=e.createStaticVNode('<g opacity="0.3" data-v-09d0019e><line x1="-4" y1="43" x2="-4" y2="57" stroke="#64748b" stroke-width="0.5" data-v-09d0019e></line><line x1="0" y1="43" x2="0" y2="57" stroke="#64748b" stroke-width="0.5" data-v-09d0019e></line><line x1="4" y1="43" x2="4" y2="57" stroke="#64748b" stroke-width="0.5" data-v-09d0019e></line></g><rect x="-6" y="42" width="4" height="8" rx="2" fill="#ffffff" opacity="0.4" data-v-09d0019e></rect>',2))],8,Up),e.createElementVNode("g",null,[e.createElementVNode("circle",{cx:"35",cy:"50",r:"3",fill:t.value?"#334155":"#ef4444",filter:t.value?"none":`url(#indicator-glow-${o.value})`},null,8,Fp),e.createElementVNode("circle",{cx:"35",cy:"50",r:"1.5",fill:"#ffffff",opacity:t.value?.1:.6},null,8,Gp),e.createElementVNode("circle",{cx:"85",cy:"50",r:"3",fill:t.value?"#22c55e":"#334155",filter:t.value?`url(#indicator-glow-${o.value})`:"none"},null,8,jp),e.createElementVNode("circle",{cx:"85",cy:"50",r:"1.5",fill:"#ffffff",opacity:t.value?.6:.1},null,8,Hp)]),c[8]||(c[8]=e.createStaticVNode('<g data-v-09d0019e><rect x="15" y="47" width="8" height="6" rx="1" fill="#64748b" stroke="#475569" stroke-width="0.5" data-v-09d0019e></rect><circle cx="19" cy="50" r="1.5" fill="#94a3b8" data-v-09d0019e></circle><rect x="97" y="47" width="8" height="6" rx="1" fill="#64748b" stroke="#475569" stroke-width="0.5" data-v-09d0019e></rect><circle cx="101" cy="50" r="1.5" fill="#94a3b8" data-v-09d0019e></circle></g><rect x="50" y="67" width="20" height="6" rx="1" fill="#0f172a" opacity="0.7" data-v-09d0019e></rect><text x="60" y="71" font-size="3" fill="#64748b" text-anchor="middle" font-family="monospace" data-v-09d0019e>KCD1-101</text>',3))])),e.createElementVNode("div",{class:e.normalizeClass(["status-text",{"is-on":t.value}])},e.toDisplayString(t.value?"开启":"关闭"),3)]))}}),[["__scopeId","data-v-09d0019e"]]),Jp={class:"motor-3d-container"},Yp={viewBox:"0 0 120 100",xmlns:"http://www.w3.org/2000/svg"},Xp=["id"],Kp=["id"],Qp=["id"],Zp=["fill"],em=["fill"],tm=["fill"],om=["transform"],lm=["fill","filter"],nm=["opacity"],am={x:"60",y:"61","font-size":"4",fill:"#cbd5e1","text-anchor":"middle","font-family":"monospace"},rm=A(e.defineComponent({__name:"Motor3D",props:{node:{}},setup(i){const l=i,o=e.ref(`motor-${Math.random().toString(36).substr(2,9)}`),s=()=>l.node?l.node.getData?l.node.getData():l.node.data||{}:{},t=e.ref(!1),r=e.ref(1500),p=e.ref(7.5),d=e.ref(0);let c=null;const f=()=>{if(t.value){const n=r.value/300;d.value=(d.value+n)%360}c=requestAnimationFrame(f)},a=()=>{const n=s();t.value=n.state==="running"||n.state===!0,r.value=n.speed||1500,p.value=n.power||7.5};return e.watch(()=>l.node,()=>{a()},{deep:!0}),e.onMounted(()=>{a(),t.value&&f(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{const n=t.value;a(),t.value&&!n?f():!t.value&&n&&c&&(cancelAnimationFrame(c),c=null)})}),e.onUnmounted(()=>{c&&cancelAnimationFrame(c)}),(n,u)=>(e.openBlock(),e.createElementBlock("div",Jp,[(e.openBlock(),e.createElementBlock("svg",Yp,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`motor-body-${o.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[...u[0]||(u[0]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#94a3b8"},null,-1),e.createElementVNode("stop",{offset:"50%","stop-color":"#64748b"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#475569"},null,-1)])],8,Xp),e.createElementVNode("linearGradient",{id:`shaft-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[...u[1]||(u[1]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#94a3b8"},null,-1),e.createElementVNode("stop",{offset:"50%","stop-color":"#cbd5e1"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#64748b"},null,-1)])],8,Kp),e.createElementVNode("filter",{id:`indicator-glow-${o.value}`},[...u[2]||(u[2]=[e.createElementVNode("feGaussianBlur",{stdDeviation:"2",result:"coloredBlur"},null,-1),e.createElementVNode("feMerge",null,[e.createElementVNode("feMergeNode",{in:"coloredBlur"}),e.createElementVNode("feMergeNode",{in:"SourceGraphic"})],-1)])],8,Qp)]),e.createElementVNode("rect",{x:"20",y:"70",width:"80",height:"25",rx:"3",fill:`url(#motor-body-${o.value})`},null,8,Zp),u[4]||(u[4]=e.createStaticVNode('<rect x="20" y="70" width="80" height="3" fill="#1e293b" opacity="0.3" data-v-14ee96e9></rect><circle cx="30" cy="82" r="3" fill="#334155" data-v-14ee96e9></circle><circle cx="30" cy="82" r="1.5" fill="#64748b" data-v-14ee96e9></circle><circle cx="90" cy="82" r="3" fill="#334155" data-v-14ee96e9></circle><circle cx="90" cy="82" r="1.5" fill="#64748b" data-v-14ee96e9></circle>',5)),e.createElementVNode("ellipse",{cx:"60",cy:"45",rx:"35",ry:"25",fill:`url(#motor-body-${o.value})`,stroke:"#334155","stroke-width":"1"},null,8,em),u[5]||(u[5]=e.createStaticVNode('<g opacity="0.3" data-v-14ee96e9><line x1="30" y1="30" x2="30" y2="60" stroke="#1e293b" stroke-width="1" data-v-14ee96e9></line><line x1="40" y1="25" x2="40" y2="65" stroke="#1e293b" stroke-width="1" data-v-14ee96e9></line><line x1="50" y1="22" x2="50" y2="68" stroke="#1e293b" stroke-width="1" data-v-14ee96e9></line><line x1="60" y1="20" x2="60" y2="70" stroke="#1e293b" stroke-width="1" data-v-14ee96e9></line><line x1="70" y1="22" x2="70" y2="68" stroke="#1e293b" stroke-width="1" data-v-14ee96e9></line><line x1="80" y1="25" x2="80" y2="65" stroke="#1e293b" stroke-width="1" data-v-14ee96e9></line><line x1="90" y1="30" x2="90" y2="60" stroke="#1e293b" stroke-width="1" data-v-14ee96e9></line></g><rect x="25" y="40" width="2" height="10" fill="#475569" opacity="0.6" data-v-14ee96e9></rect><rect x="30" y="38" width="2" height="14" fill="#475569" opacity="0.6" data-v-14ee96e9></rect><rect x="35" y="36" width="2" height="18" fill="#475569" opacity="0.6" data-v-14ee96e9></rect>',4)),e.createElementVNode("rect",{x:"95",y:"42",width:"20",height:"6",rx:"1",fill:`url(#shaft-gradient-${o.value})`,stroke:"#475569","stroke-width":"0.5"},null,8,tm),e.createElementVNode("g",{transform:`rotate(${d.value} 105 45)`},[...u[3]||(u[3]=[e.createStaticVNode('<g opacity="0.8" data-v-14ee96e9><rect x="103" y="40" width="4" height="10" rx="1" fill="#94a3b8" data-v-14ee96e9></rect><rect x="100" y="43" width="10" height="4" rx="1" fill="#94a3b8" data-v-14ee96e9></rect><line x1="102" y1="42" x2="108" y2="48" stroke="#94a3b8" stroke-width="3" stroke-linecap="round" data-v-14ee96e9></line><line x1="108" y1="42" x2="102" y2="48" stroke="#94a3b8" stroke-width="3" stroke-linecap="round" data-v-14ee96e9></line></g>',1)])],8,om),u[6]||(u[6]=e.createStaticVNode('<circle cx="105" cy="45" r="3" fill="#334155" stroke="#64748b" stroke-width="1" data-v-14ee96e9></circle><rect x="45" y="15" width="15" height="10" rx="1" fill="#334155" stroke="#475569" stroke-width="0.5" data-v-14ee96e9></rect><circle cx="48" cy="20" r="1" fill="#dc2626" data-v-14ee96e9></circle><circle cx="52" cy="20" r="1" fill="#22c55e" data-v-14ee96e9></circle><circle cx="56" cy="20" r="1" fill="#3b82f6" data-v-14ee96e9></circle>',5)),e.createElementVNode("circle",{cx:"15",cy:"45",r:"4",fill:t.value?"#22c55e":"#ef4444",filter:t.value?`url(#indicator-glow-${o.value})`:"none"},null,8,lm),e.createElementVNode("circle",{cx:"15",cy:"45",r:"2",fill:"#ffffff",opacity:t.value?.6:.2},null,8,nm),u[7]||(u[7]=e.createElementVNode("rect",{x:"40",y:"55",width:"40",height:"8",rx:"1",fill:"#1e293b",opacity:"0.7"},null,-1)),e.createElementVNode("text",am,e.toDisplayString(p.value)+"kW "+e.toDisplayString(r.value)+"rpm ",1)])),e.createElementVNode("div",{class:e.normalizeClass(["status-text",{"is-running":t.value}])},e.toDisplayString(t.value?"运行中":"已停止"),3)]))}}),[["__scopeId","data-v-14ee96e9"]]),im={class:"valve-3d-container"},sm={viewBox:"0 0 100 120",xmlns:"http://www.w3.org/2000/svg"},dm=["id"],cm=["id"],pm=["fill"],mm=["fill"],fm=["fill"],um=["fill"],gm={transform:"translate(50, 60)"},hm=["fill","transform"],ym=["transform"],bm=["fill"],km=["fill"],Em={x:"12.5",y:"62","font-size":"6",fill:"#ffffff","text-anchor":"middle","font-weight":"bold"},Nm={x:"85",y:"62","font-size":"8",fill:"#cbd5e1","text-anchor":"middle","font-family":"monospace"},Vm=A(e.defineComponent({__name:"Valve3D",props:{node:{}},setup(i){const l=i,o=e.ref(`valve-${Math.random().toString(36).substr(2,9)}`),s=()=>l.node?l.node.getData?l.node.getData():l.node.data||{}:{},t=e.ref(!1),r=e.ref(0),p=e.computed(()=>r.value/100*720),d=()=>{const c=s();t.value=c.state==="open"||c.state===!0,r.value=c.openness!==void 0?c.openness:t.value?100:0};return e.watch(()=>l.node,()=>{d()},{deep:!0}),e.onMounted(()=>{d(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{d()})}),(c,f)=>(e.openBlock(),e.createElementBlock("div",im,[(e.openBlock(),e.createElementBlock("svg",sm,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`valve-body-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[...f[0]||(f[0]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#64748b"},null,-1),e.createElementVNode("stop",{offset:"50%","stop-color":"#94a3b8"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#64748b"},null,-1)])],8,dm),e.createElementVNode("linearGradient",{id:`handle-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[...f[1]||(f[1]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#ef4444"},null,-1),e.createElementVNode("stop",{offset:"50%","stop-color":"#dc2626"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#b91c1c"},null,-1)])],8,cm)]),e.createElementVNode("rect",{x:"40",y:"85",width:"20",height:"30",fill:`url(#valve-body-${o.value})`,stroke:"#475569","stroke-width":"1"},null,8,pm),f[3]||(f[3]=e.createElementVNode("ellipse",{cx:"50",cy:"85",rx:"10",ry:"5",fill:"#94a3b8",stroke:"#475569","stroke-width":"1"},null,-1)),f[4]||(f[4]=e.createElementVNode("ellipse",{cx:"50",cy:"115",rx:"10",ry:"5",fill:"#64748b",stroke:"#475569","stroke-width":"1"},null,-1)),e.createElementVNode("ellipse",{cx:"50",cy:"60",rx:"25",ry:"15",fill:`url(#valve-body-${o.value})`,stroke:"#475569","stroke-width":"1"},null,8,mm),e.createElementVNode("rect",{x:"25",y:"50",width:"50",height:"20",fill:`url(#valve-body-${o.value})`,stroke:"#475569","stroke-width":"1"},null,8,fm),f[5]||(f[5]=e.createStaticVNode('<ellipse cx="50" cy="50" rx="25" ry="15" fill="#94a3b8" stroke="#475569" stroke-width="1" data-v-9c6b9014></ellipse><g data-v-9c6b9014><circle cx="30" cy="55" r="2" fill="#334155" data-v-9c6b9014></circle><circle cx="30" cy="65" r="2" fill="#334155" data-v-9c6b9014></circle><circle cx="70" cy="55" r="2" fill="#334155" data-v-9c6b9014></circle><circle cx="70" cy="65" r="2" fill="#334155" data-v-9c6b9014></circle></g>',2)),e.createElementVNode("rect",{x:"40",y:"10",width:"20",height:"30",fill:`url(#valve-body-${o.value})`,stroke:"#475569","stroke-width":"1"},null,8,um),f[6]||(f[6]=e.createElementVNode("ellipse",{cx:"50",cy:"10",rx:"10",ry:"5",fill:"#94a3b8",stroke:"#475569","stroke-width":"1"},null,-1)),f[7]||(f[7]=e.createElementVNode("ellipse",{cx:"50",cy:"40",rx:"10",ry:"5",fill:"#64748b",stroke:"#475569","stroke-width":"1"},null,-1)),e.createElementVNode("g",gm,[e.createElementVNode("rect",{x:"-3",y:"-20",width:"6",height:"40",rx:"3",fill:t.value?"#22c55e":"#ef4444",transform:`rotate(${t.value?0:90})`,style:{transition:"transform 0.5s ease"}},null,8,hm)]),f[8]||(f[8]=e.createElementVNode("rect",{x:"47",y:"40",width:"6",height:"40",rx:"1",fill:"#475569",stroke:"#334155","stroke-width":"0.5"},null,-1)),e.createElementVNode("g",{transform:`rotate(${p.value} 50 25)`,style:{transformOrigin:"50px 25px"}},[e.createElementVNode("circle",{cx:"50",cy:"25",r:"15",fill:`url(#handle-gradient-${o.value})`,stroke:"#991b1b","stroke-width":"1"},null,8,bm),f[2]||(f[2]=e.createStaticVNode('<circle cx="50" cy="25" r="12" fill="none" stroke="#7f1d1d" stroke-width="2" data-v-9c6b9014></circle><circle cx="50" cy="25" r="5" fill="#7f1d1d" data-v-9c6b9014></circle><line x1="50" y1="25" x2="50" y2="12" stroke="#7f1d1d" stroke-width="2" data-v-9c6b9014></line><line x1="50" y1="25" x2="50" y2="38" stroke="#7f1d1d" stroke-width="2" data-v-9c6b9014></line><line x1="50" y1="25" x2="37" y2="25" stroke="#7f1d1d" stroke-width="2" data-v-9c6b9014></line><line x1="50" y1="25" x2="63" y2="25" stroke="#7f1d1d" stroke-width="2" data-v-9c6b9014></line><rect x="63" y="23" width="8" height="4" rx="2" fill="#991b1b" data-v-9c6b9014></rect>',7))],8,ym),e.createElementVNode("g",null,[e.createElementVNode("rect",{x:"5",y:"55",width:"15",height:"10",rx:"2",fill:t.value?"#22c55e":"#ef4444",opacity:"0.9"},null,8,km),e.createElementVNode("text",Em,e.toDisplayString(t.value?"ON":"OFF"),1)]),e.createElementVNode("text",Nm,e.toDisplayString(r.value)+"% ",1)])),e.createElementVNode("div",{class:e.normalizeClass(["status-text",{"is-open":t.value}])},e.toDisplayString(t.value?"开启":"关闭")+" - "+e.toDisplayString(r.value)+"% ",3)]))}}),[["__scopeId","data-v-9c6b9014"]]),xm={class:"tank-3d-container"},wm={viewBox:"0 0 100 140",xmlns:"http://www.w3.org/2000/svg"},$m=["id"],Cm=["id"],_m=["stop-color"],vm=["stop-color"],Bm=["id"],Sm=["fill"],Dm=["y","height","fill","filter"],Im=["cy","fill"],Tm=["fill"],zm=["height"],Mm={x:"65",y:"38","font-size":"5",fill:"#22c55e","text-anchor":"middle"},Am=["height"],Pm={x:"50",y:"127","font-size":"6",fill:"#22c55e","text-anchor":"middle","font-family":"monospace"},Om={class:"status-text"},Lm=A(e.defineComponent({__name:"Tank3D",props:{node:{}},setup(i){const l=i,o=e.ref(`tank-${Math.random().toString(36).substr(2,9)}`),s=()=>l.node?l.node.getData?l.node.getData():l.node.data||{}:{},t=e.ref(50),r=e.ref(100),p=e.ref(25),d=e.ref(101),c=e.ref("#3b82f6"),f=e.computed(()=>(t.value/100*r.value).toFixed(1)),a=e.computed(()=>90*t.value/100),n=e.computed(()=>110-a.value),u=()=>{const g=s();t.value=Math.max(0,Math.min(100,g.level||50)),r.value=g.capacity||100,p.value=g.temperature||25,d.value=g.pressure||101,c.value=g.liquidColor||"#3b82f6"};return e.watch(()=>l.node,()=>{u()},{deep:!0}),e.onMounted(()=>{u(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{u()})}),(g,m)=>(e.openBlock(),e.createElementBlock("div",xm,[(e.openBlock(),e.createElementBlock("svg",wm,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`tank-body-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[...m[0]||(m[0]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#64748b"},null,-1),e.createElementVNode("stop",{offset:"50%","stop-color":"#cbd5e1"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#64748b"},null,-1)])],8,$m),e.createElementVNode("linearGradient",{id:`liquid-${o.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":c.value,"stop-opacity":"0.9"},null,8,_m),e.createElementVNode("stop",{offset:"100%","stop-color":c.value,"stop-opacity":"0.7"},null,8,vm)],8,Cm),e.createElementVNode("filter",{id:`wave-${o.value}`},[...m[1]||(m[1]=[e.createElementVNode("feTurbulence",{type:"fractalNoise",baseFrequency:"0.02",numOctaves:"2",result:"turbulence"},null,-1),e.createElementVNode("feDisplacementMap",{in:"SourceGraphic",in2:"turbulence",scale:"2",xChannelSelector:"R",yChannelSelector:"G"},null,-1)])],8,Bm)]),m[2]||(m[2]=e.createElementVNode("ellipse",{cx:"50",cy:"20",rx:"30",ry:"8",fill:"#94a3b8",stroke:"#475569","stroke-width":"1"},null,-1)),m[3]||(m[3]=e.createElementVNode("ellipse",{cx:"50",cy:"20",rx:"25",ry:"6",fill:"#cbd5e1"},null,-1)),e.createElementVNode("rect",{x:"20",y:"20",width:"60",height:"90",fill:`url(#tank-body-${o.value})`,stroke:"#475569","stroke-width":"1"},null,8,Sm),m[4]||(m[4]=e.createStaticVNode('<g opacity="0.6" data-v-13c65d9d><line x1="15" y1="30" x2="20" y2="30" stroke="#94a3b8" stroke-width="1" data-v-13c65d9d></line><text x="12" y="32" font-size="5" fill="#94a3b8" text-anchor="end" data-v-13c65d9d>100%</text><line x1="15" y1="52.5" x2="20" y2="52.5" stroke="#94a3b8" stroke-width="1" data-v-13c65d9d></line><text x="12" y="54.5" font-size="5" fill="#94a3b8" text-anchor="end" data-v-13c65d9d>75%</text><line x1="15" y1="75" x2="20" y2="75" stroke="#94a3b8" stroke-width="1" data-v-13c65d9d></line><text x="12" y="77" font-size="5" fill="#94a3b8" text-anchor="end" data-v-13c65d9d>50%</text><line x1="15" y1="97.5" x2="20" y2="97.5" stroke="#94a3b8" stroke-width="1" data-v-13c65d9d></line><text x="12" y="99.5" font-size="5" fill="#94a3b8" text-anchor="end" data-v-13c65d9d>25%</text><line x1="15" y1="110" x2="20" y2="110" stroke="#94a3b8" stroke-width="1" data-v-13c65d9d></line><text x="12" y="112" font-size="5" fill="#94a3b8" text-anchor="end" data-v-13c65d9d>0%</text></g>',1)),e.createElementVNode("rect",{x:"20",y:n.value,width:"60",height:a.value,fill:`url(#liquid-${o.value})`,filter:`url(#wave-${o.value})`,opacity:"0.85"},null,8,Dm),t.value>0?(e.openBlock(),e.createElementBlock("ellipse",{key:0,cx:"50",cy:n.value,rx:"30",ry:"5",fill:c.value,opacity:"0.6"},null,8,Im)):e.createCommentVNode("",!0),e.createElementVNode("ellipse",{cx:"50",cy:"110",rx:"30",ry:"8",fill:`url(#tank-body-${o.value})`,stroke:"#475569","stroke-width":"1"},null,8,Tm),m[5]||(m[5]=e.createStaticVNode('<g data-v-13c65d9d><rect x="23" y="110" width="4" height="15" fill="#475569" data-v-13c65d9d></rect><rect x="73" y="110" width="4" height="15" fill="#475569" data-v-13c65d9d></rect><rect x="20" y="123" width="10" height="3" rx="1" fill="#64748b" data-v-13c65d9d></rect><rect x="70" y="123" width="10" height="3" rx="1" fill="#64748b" data-v-13c65d9d></rect></g><rect x="45" y="12" width="10" height="8" rx="1" fill="#64748b" stroke="#475569" stroke-width="0.5" data-v-13c65d9d></rect><ellipse cx="50" cy="12" rx="5" ry="3" fill="#94a3b8" data-v-13c65d9d></ellipse><rect x="75" y="105" width="8" height="4" rx="1" fill="#64748b" stroke="#475569" stroke-width="0.5" data-v-13c65d9d></rect><rect x="82" y="30" width="6" height="80" rx="1" fill="#334155" opacity="0.7" data-v-13c65d9d></rect>',5)),e.createElementVNode("rect",{x:"84",y:"32",width:"2",height:76*(t.value/100),fill:"#22c55e"},null,8,zm),m[6]||(m[6]=e.createElementVNode("circle",{cx:"65",cy:"35",r:"8",fill:"#1e293b",stroke:"#475569","stroke-width":"1"},null,-1)),e.createElementVNode("text",Mm,e.toDisplayString(d.value),1),m[7]||(m[7]=e.createElementVNode("text",{x:"65",y:"42","font-size":"3",fill:"#94a3b8","text-anchor":"middle"},"kPa",-1)),m[8]||(m[8]=e.createElementVNode("rect",{x:"32",y:"35",width:"4",height:"15",rx:"2",fill:"#1e293b",stroke:"#475569","stroke-width":"0.5"},null,-1)),e.createElementVNode("rect",{x:"33",y:"37",width:"2",height:p.value/10,fill:"#ef4444"},null,8,Am),m[9]||(m[9]=e.createElementVNode("circle",{cx:"34",cy:"52",r:"2",fill:"#ef4444"},null,-1)),m[10]||(m[10]=e.createElementVNode("rect",{x:"25",y:"120",width:"50",height:"12",rx:"2",fill:"#1e293b",opacity:"0.9"},null,-1)),e.createElementVNode("text",Pm,e.toDisplayString(t.value)+"% | "+e.toDisplayString(f.value)+"m³ ",1)])),e.createElementVNode("div",Om," 液位: "+e.toDisplayString(t.value)+"% | 容量: "+e.toDisplayString(f.value)+"m³ ",1)]))}}),[["__scopeId","data-v-13c65d9d"]]),Rm={class:"pump-3d-container"},Um={viewBox:"0 0 140 100",xmlns:"http://www.w3.org/2000/svg"},Wm=["id"],Fm=["id"],Gm=["id"],jm={key:0,attributeName:"x1",values:"-100%;100%",dur:"1s",repeatCount:"indefinite"},Hm={key:1,attributeName:"x2",values:"0%;200%",dur:"1s",repeatCount:"indefinite"},qm=["fill"],Jm=["fill"],Ym=["fill"],Xm=["fill"],Km=["transform"],Qm=["fill"],Zm={transform:"translate(100, 25)"},ef={x:"0",y:"2","font-size":"5",fill:"#22c55e","text-anchor":"middle"},tf={transform:"translate(115, 35)"},of={x:"0",y:"1","font-size":"4",fill:"#3b82f6","text-anchor":"middle"},lf=["fill"],nf=["opacity"],af={x:"60",y:"68","font-size":"4",fill:"#cbd5e1","text-anchor":"middle","font-family":"monospace"},rf=A(e.defineComponent({__name:"Pump3D",props:{node:{}},setup(i){const l=i,o=e.ref(`pump-${Math.random().toString(36).substr(2,9)}`),s=()=>l.node?l.node.getData?l.node.getData():l.node.data||{}:{},t=e.ref(!1),r=e.ref(2900),p=e.ref(5.5),d=e.ref(0),c=e.ref(0),f=e.ref(0);let a=null;const n=()=>{if(t.value){const g=r.value/360;f.value=(f.value+g)%360}a=requestAnimationFrame(n)},u=()=>{const g=s();t.value=g.state==="running"||g.state===!0,r.value=g.speed||2900,p.value=g.power||5.5,d.value=t.value?g.flowRate||15:0,c.value=t.value?(g.pressure||3.5).toFixed(1):0};return e.watch(()=>l.node,()=>{u()},{deep:!0}),e.onMounted(()=>{u(),t.value&&n(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{const g=t.value;u(),t.value&&!g?n():!t.value&&g&&a&&(cancelAnimationFrame(a),a=null)})}),e.onUnmounted(()=>{a&&cancelAnimationFrame(a)}),(g,m)=>(e.openBlock(),e.createElementBlock("div",Rm,[(e.openBlock(),e.createElementBlock("svg",Um,[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`pump-body-${o.value}`,cx:"50%",cy:"50%"},[...m[0]||(m[0]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#cbd5e1"},null,-1),e.createElementVNode("stop",{offset:"70%","stop-color":"#94a3b8"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#64748b"},null,-1)])],8,Wm),e.createElementVNode("linearGradient",{id:`motor-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[...m[1]||(m[1]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#94a3b8"},null,-1),e.createElementVNode("stop",{offset:"50%","stop-color":"#64748b"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#475569"},null,-1)])],8,Fm),e.createElementVNode("linearGradient",{id:`flow-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[m[2]||(m[2]=e.createElementVNode("stop",{offset:"0%","stop-color":"#3b82f6","stop-opacity":"0.3"},null,-1)),m[3]||(m[3]=e.createElementVNode("stop",{offset:"50%","stop-color":"#60a5fa","stop-opacity":"0.6"},null,-1)),m[4]||(m[4]=e.createElementVNode("stop",{offset:"100%","stop-color":"#3b82f6","stop-opacity":"0.3"},null,-1)),t.value?(e.openBlock(),e.createElementBlock("animate",jm)):e.createCommentVNode("",!0),t.value?(e.openBlock(),e.createElementBlock("animate",Hm)):e.createCommentVNode("",!0)],8,Gm)]),e.createElementVNode("rect",{x:"30",y:"75",width:"60",height:"20",rx:"2",fill:`url(#motor-gradient-${o.value})`},null,8,qm),m[15]||(m[15]=e.createElementVNode("rect",{x:"30",y:"75",width:"60",height:"2",fill:"#1e293b",opacity:"0.4"},null,-1)),m[16]||(m[16]=e.createElementVNode("circle",{cx:"35",cy:"85",r:"2",fill:"#334155"},null,-1)),m[17]||(m[17]=e.createElementVNode("circle",{cx:"85",cy:"85",r:"2",fill:"#334155"},null,-1)),e.createElementVNode("ellipse",{cx:"60",cy:"50",rx:"28",ry:"25",fill:`url(#pump-body-${o.value})`,stroke:"#475569","stroke-width":"1.5"},null,8,Jm),m[18]||(m[18]=e.createElementVNode("g",null,[e.createElementVNode("circle",{cx:"40",cy:"40",r:"3",fill:"#334155"}),e.createElementVNode("circle",{cx:"40",cy:"60",r:"3",fill:"#334155"}),e.createElementVNode("circle",{cx:"80",cy:"40",r:"3",fill:"#334155"}),e.createElementVNode("circle",{cx:"80",cy:"60",r:"3",fill:"#334155"})],-1)),e.createElementVNode("g",null,[m[5]||(m[5]=e.createElementVNode("rect",{x:"5",y:"45",width:"28",height:"10",rx:"2",fill:"#64748b",stroke:"#475569","stroke-width":"1"},null,-1)),m[6]||(m[6]=e.createElementVNode("ellipse",{cx:"5",cy:"50",rx:"5",ry:"5",fill:"#94a3b8",stroke:"#475569","stroke-width":"1"},null,-1)),t.value?(e.openBlock(),e.createElementBlock("rect",{key:0,x:"5",y:"46",width:"28",height:"8",fill:`url(#flow-gradient-${o.value})`,opacity:"0.7"},null,8,Ym)):e.createCommentVNode("",!0)]),e.createElementVNode("g",null,[m[7]||(m[7]=e.createElementVNode("rect",{x:"87",y:"45",width:"48",height:"10",rx:"2",fill:"#64748b",stroke:"#475569","stroke-width":"1"},null,-1)),m[8]||(m[8]=e.createElementVNode("ellipse",{cx:"135",cy:"50",rx:"5",ry:"5",fill:"#94a3b8",stroke:"#475569","stroke-width":"1"},null,-1)),t.value?(e.openBlock(),e.createElementBlock("rect",{key:0,x:"87",y:"46",width:"48",height:"8",fill:`url(#flow-gradient-${o.value})`,opacity:"0.7"},null,8,Xm)):e.createCommentVNode("",!0)]),e.createElementVNode("g",{transform:`rotate(${f.value} 60 50)`},[...m[9]||(m[9]=[e.createStaticVNode('<circle cx="60" cy="50" r="15" fill="#475569" opacity="0.6" data-v-71be9db7></circle><path d="M 60 50 L 70 35 Q 75 40 70 50 Z" fill="#64748b" data-v-71be9db7></path><path d="M 60 50 L 75 50 Q 75 55 65 60 Z" fill="#64748b" data-v-71be9db7></path><path d="M 60 50 L 60 65 Q 55 65 50 60 Z" fill="#64748b" data-v-71be9db7></path><path d="M 60 50 L 45 50 Q 45 45 50 40 Z" fill="#64748b" data-v-71be9db7></path>',5)])],8,Km),m[19]||(m[19]=e.createElementVNode("circle",{cx:"60",cy:"50",r:"5",fill:"#334155",stroke:"#64748b","stroke-width":"1"},null,-1)),e.createElementVNode("rect",{x:"50",y:"20",width:"20",height:"10",rx:"2",fill:`url(#motor-gradient-${o.value})`,stroke:"#475569","stroke-width":"1"},null,8,Qm),m[20]||(m[20]=e.createElementVNode("rect",{x:"58",y:"30",width:"4",height:"20",fill:"#475569"},null,-1)),e.createElementVNode("g",Zm,[m[10]||(m[10]=e.createElementVNode("circle",{cx:"0",cy:"0",r:"10",fill:"#1e293b",stroke:"#475569","stroke-width":"1"},null,-1)),m[11]||(m[11]=e.createElementVNode("circle",{cx:"0",cy:"0",r:"8",fill:"none",stroke:"#64748b","stroke-width":"0.5"},null,-1)),e.createElementVNode("text",ef,e.toDisplayString(c.value),1),m[12]||(m[12]=e.createElementVNode("text",{x:"0",y:"6","font-size":"2.5",fill:"#94a3b8","text-anchor":"middle"},"bar",-1))]),e.createElementVNode("g",tf,[m[13]||(m[13]=e.createElementVNode("rect",{x:"-8",y:"-6",width:"16",height:"12",rx:"1",fill:"#1e293b",stroke:"#475569","stroke-width":"0.5"},null,-1)),e.createElementVNode("text",of,e.toDisplayString(d.value),1),m[14]||(m[14]=e.createElementVNode("text",{x:"0",y:"4.5","font-size":"2",fill:"#94a3b8","text-anchor":"middle"},"m³/h",-1))]),e.createElementVNode("circle",{cx:"25",cy:"30",r:"4",fill:t.value?"#22c55e":"#ef4444"},null,8,lf),e.createElementVNode("circle",{cx:"25",cy:"30",r:"2",fill:"#ffffff",opacity:t.value?.6:.2},null,8,nf),m[21]||(m[21]=e.createElementVNode("rect",{x:"45",y:"62",width:"30",height:"8",rx:"1",fill:"#1e293b",opacity:"0.7"},null,-1)),e.createElementVNode("text",af,e.toDisplayString(p.value)+"kW "+e.toDisplayString(r.value)+"rpm ",1)])),e.createElementVNode("div",{class:e.normalizeClass(["status-text",{"is-running":t.value}])},e.toDisplayString(t.value?"运行中":"已停止")+" | "+e.toDisplayString(d.value)+"m³/h ",3)]))}}),[["__scopeId","data-v-71be9db7"]]),sf={class:"conveyor-3d-container"},df={viewBox:"0 0 200 80",xmlns:"http://www.w3.org/2000/svg"},cf=["id"],pf=["id"],mf=["id"],ff=["fill","transform"],uf=["transform"],gf=["fill","transform"],hf=["transform"],yf=["fill"],bf=["x1","x2"],kf=["x","fill"],Ef=["fill","opacity"],Nf={key:0,attributeName:"opacity",values:"1;0.4;1",dur:"1s",repeatCount:"indefinite"},Vf={x:"100",y:"20","font-size":"10",fill:"#94a3b8","text-anchor":"middle","font-family":"monospace"},xf=A(e.defineComponent({__name:"Conveyor3D",props:{node:{}},setup(i){const l=i,o=e.ref(`conveyor-${Math.random().toString(36).substr(2,9)}`),s=()=>l.node?l.node.getData?l.node.getData():l.node.data||{}:{},t=e.ref(!1),r=e.ref(10),p=e.ref("forward"),d=e.ref(0),c=e.ref(0),f=e.ref(30);let a=null;const n=()=>{if(t.value){const g=r.value/10,m=r.value/5;p.value==="forward"?(d.value=(d.value+g)%360,c.value=(c.value+m)%15,f.value=f.value+m,f.value>180&&(f.value=20)):(d.value=(d.value-g+360)%360,c.value=(c.value-m+15)%15,f.value=f.value-m,f.value<20&&(f.value=180))}a=requestAnimationFrame(n)},u=()=>{const g=s();t.value=g.state==="running"||g.state===!0,r.value=g.speed||10,p.value=g.direction||"forward"};return e.watch(()=>l.node,()=>{u()},{deep:!0}),e.onMounted(()=>{u(),n(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{u()})}),e.onUnmounted(()=>{a&&cancelAnimationFrame(a)}),(g,m)=>(e.openBlock(),e.createElementBlock("div",sf,[(e.openBlock(),e.createElementBlock("svg",df,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`belt-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[...m[0]||(m[0]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#1e293b"},null,-1),e.createElementVNode("stop",{offset:"50%","stop-color":"#334155"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#1e293b"},null,-1)])],8,cf),e.createElementVNode("radialGradient",{id:`roller-gradient-${o.value}`},[...m[1]||(m[1]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#64748b"},null,-1),e.createElementVNode("stop",{offset:"70%","stop-color":"#475569"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#334155"},null,-1)])],8,pf),e.createElementVNode("linearGradient",{id:`cargo-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[...m[2]||(m[2]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#3b82f6"},null,-1),e.createElementVNode("stop",{offset:"50%","stop-color":"#60a5fa"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#3b82f6"},null,-1)])],8,mf)]),m[3]||(m[3]=e.createElementVNode("rect",{x:"10",y:"45",width:"180",height:"25",rx:"3",fill:"#0f172a",stroke:"#475569","stroke-width":"1"},null,-1)),e.createElementVNode("circle",{cx:"25",cy:"50",r:"12",fill:`url(#roller-gradient-${o.value})`,stroke:"#1e293b","stroke-width":"2",transform:`rotate(${d.value}, 25, 50)`},null,8,ff),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(8,k=>e.createElementVNode("g",{key:`left-${k}`},[e.createElementVNode("line",{x1:25,y1:38,x2:25,y2:42,stroke:"#1e293b","stroke-width":"1.5",transform:`rotate(${d.value+k*45}, 25, 50)`},null,8,uf)])),64)),e.createElementVNode("circle",{cx:"175",cy:"50",r:"12",fill:`url(#roller-gradient-${o.value})`,stroke:"#1e293b","stroke-width":"2",transform:`rotate(${d.value}, 175, 50)`},null,8,gf),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(8,k=>e.createElementVNode("g",{key:`right-${k}`},[e.createElementVNode("line",{x1:175,y1:38,x2:175,y2:42,stroke:"#1e293b","stroke-width":"1.5",transform:`rotate(${d.value+k*45}, 175, 50)`},null,8,hf)])),64)),e.createElementVNode("rect",{x:"25",y:"38",width:"150",height:"24",fill:`url(#belt-gradient-${o.value})`},null,8,yf),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(10,k=>e.createElementVNode("g",{key:`line-${k}`},[e.createElementVNode("line",{x1:25+k*15+c.value,y1:38,x2:25+k*15+c.value,y2:62,stroke:"#475569","stroke-width":"1.5",opacity:"0.5"},null,8,bf)])),64)),t.value?(e.openBlock(),e.createElementBlock("rect",{key:0,x:f.value,y:"30",width:"30",height:"20",rx:"2",fill:`url(#cargo-gradient-${o.value})`,stroke:"#2563eb","stroke-width":"1",opacity:"0.9"},null,8,kf)):e.createCommentVNode("",!0),m[4]||(m[4]=e.createStaticVNode('<g data-v-eb26bad8><rect x="20" y="68" width="4" height="8" fill="#475569" data-v-eb26bad8></rect><rect x="96" y="68" width="4" height="8" fill="#475569" data-v-eb26bad8></rect><rect x="172" y="68" width="4" height="8" fill="#475569" data-v-eb26bad8></rect><rect x="18" y="74" width="8" height="2" rx="1" fill="#64748b" data-v-eb26bad8></rect><rect x="94" y="74" width="8" height="2" rx="1" fill="#64748b" data-v-eb26bad8></rect><rect x="170" y="74" width="8" height="2" rx="1" fill="#64748b" data-v-eb26bad8></rect></g><rect x="180" y="52" width="15" height="18" rx="2" fill="#334155" stroke="#475569" stroke-width="1" data-v-eb26bad8></rect><circle cx="187.5" cy="61" r="3" fill="#64748b" data-v-eb26bad8></circle>',3)),e.createElementVNode("circle",{cx:"15",cy:"55",r:"3",fill:t.value?"#22c55e":"#ef4444",opacity:t.value?1:.5},[t.value?(e.openBlock(),e.createElementBlock("animate",Nf)):e.createCommentVNode("",!0)],8,Ef),e.createElementVNode("text",Vf,e.toDisplayString(r.value)+" m/min ",1)])),e.createElementVNode("div",{class:e.normalizeClass(["status-text",{"is-running":t.value}])},e.toDisplayString(t.value?"运行中":"停止")+" | "+e.toDisplayString(r.value)+" m/min ",3)]))}}),[["__scopeId","data-v-eb26bad8"]]),wf={class:"alarm-light-3d-container"},$f={viewBox:"0 0 80 100",xmlns:"http://www.w3.org/2000/svg"},Cf=["id"],_f=["stop-color"],vf=["stop-color"],Bf=["stop-color"],Sf=["id"],Df=["stop-color"],If=["stop-color"],Tf=["stop-color"],zf=["id"],Mf=["fill","opacity"],Af=["transform"],Pf=["fill","opacity"],Of=["fill"],Lf=["fill"],Rf=["fill"],Uf=["fill"],Wf={x:"40",y:"85","font-size":"4",fill:"#64748b","text-anchor":"middle","font-family":"Arial"},Ff=A(e.defineComponent({__name:"AlarmLight3D",props:{node:{}},setup(i){const l=i,o=e.ref(`alarm-${Math.random().toString(36).substr(2,9)}`),s=()=>l.node?l.node.getData?l.node.getData():l.node.data||{}:{},t=e.ref(!1),r=e.ref("rotating"),p=e.ref("#ef4444"),d=e.ref(0),c=e.ref(.8);let f=null;const a=e.computed(()=>t.value?p.value:"#475569"),n=e.computed(()=>t.value?r.value==="rotating"?"旋转报警":r.value==="flashing"?"闪烁报警":"持续报警":"正常"),u=()=>{t.value?r.value==="rotating"?(d.value=(d.value+5)%360,c.value=.8):r.value==="flashing"?c.value=Math.abs(Math.sin(Date.now()/300)):c.value=.8:c.value=0,f=requestAnimationFrame(u)},g=()=>{const m=s();t.value=m.state==="active"||m.state===!0,r.value=m.mode||"rotating",p.value=m.color||"#ef4444"};return e.watch(()=>l.node,()=>{g()},{deep:!0}),e.onMounted(()=>{g(),u(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{g()})}),e.onUnmounted(()=>{f&&cancelAnimationFrame(f)}),(m,k)=>(e.openBlock(),e.createElementBlock("div",wf,[(e.openBlock(),e.createElementBlock("svg",$f,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`dome-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":a.value,"stop-opacity":"0.9"},null,8,_f),e.createElementVNode("stop",{offset:"50%","stop-color":a.value,"stop-opacity":"0.7"},null,8,vf),e.createElementVNode("stop",{offset:"100%","stop-color":a.value,"stop-opacity":"0.5"},null,8,Bf)],8,Cf),e.createElementVNode("radialGradient",{id:`glow-${o.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":a.value,"stop-opacity":"0.8"},null,8,Df),e.createElementVNode("stop",{offset:"50%","stop-color":a.value,"stop-opacity":"0.3"},null,8,If),e.createElementVNode("stop",{offset:"100%","stop-color":a.value,"stop-opacity":"0"},null,8,Tf)],8,Sf),e.createElementVNode("linearGradient",{id:`base-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[...k[0]||(k[0]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#1e293b"},null,-1),e.createElementVNode("stop",{offset:"50%","stop-color":"#334155"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#1e293b"},null,-1)])],8,zf)]),t.value?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:"40",cy:"35",r:"35",fill:`url(#glow-${o.value})`,opacity:c.value},null,8,Mf)):e.createCommentVNode("",!0),k[3]||(k[3]=e.createElementVNode("ellipse",{cx:"40",cy:"35",rx:"25",ry:"22",fill:"#1e293b",stroke:"#475569","stroke-width":"1.5",opacity:"0.3"},null,-1)),e.createElementVNode("g",{transform:`rotate(${d.value}, 40, 35)`},[e.createElementVNode("ellipse",{cx:"40",cy:"35",rx:"23",ry:"20",fill:`url(#dome-gradient-${o.value})`,opacity:t.value?1:.3},null,8,Pf),k[1]||(k[1]=e.createElementVNode("path",{d:"M 17,35 Q 40,25 63,35",stroke:"#ffffff","stroke-width":"1",fill:"none",opacity:"0.3"},null,-1)),k[2]||(k[2]=e.createElementVNode("path",{d:"M 17,35 Q 40,45 63,35",stroke:"#000000","stroke-width":"1",fill:"none",opacity:"0.2"},null,-1))],8,Af),k[4]||(k[4]=e.createElementVNode("rect",{x:"35",y:"55",width:"10",height:"8",rx:"2",fill:"#334155",stroke:"#475569","stroke-width":"1"},null,-1)),e.createElementVNode("ellipse",{cx:"40",cy:"63",rx:"18",ry:"5",fill:`url(#base-gradient-${o.value})`,stroke:"#475569","stroke-width":"1"},null,8,Of),e.createElementVNode("rect",{x:"22",y:"63",width:"36",height:"12",fill:`url(#base-gradient-${o.value})`,stroke:"#475569","stroke-width":"1"},null,8,Lf),e.createElementVNode("ellipse",{cx:"40",cy:"75",rx:"18",ry:"5",fill:`url(#base-gradient-${o.value})`,stroke:"#475569","stroke-width":"1"},null,8,Rf),k[5]||(k[5]=e.createElementVNode("circle",{cx:"28",cy:"69",r:"2",fill:"#64748b",stroke:"#1e293b","stroke-width":"0.5"},null,-1)),k[6]||(k[6]=e.createElementVNode("circle",{cx:"52",cy:"69",r:"2",fill:"#64748b",stroke:"#1e293b","stroke-width":"0.5"},null,-1)),k[7]||(k[7]=e.createElementVNode("line",{x1:"27",y1:"68",x2:"29",y2:"70",stroke:"#1e293b","stroke-width":"0.5"},null,-1)),k[8]||(k[8]=e.createElementVNode("line",{x1:"51",y1:"68",x2:"53",y2:"70",stroke:"#1e293b","stroke-width":"0.5"},null,-1)),e.createElementVNode("circle",{cx:"40",cy:"69",r:"1.5",fill:t.value?"#22c55e":"#64748b"},null,8,Uf),e.createElementVNode("text",Wf," AL-"+e.toDisplayString(r.value.toUpperCase()),1)])),e.createElementVNode("div",{class:e.normalizeClass(["status-text",{"is-active":t.value}])},e.toDisplayString(n.value),3)]))}}),[["__scopeId","data-v-80aba40a"]]),Gf={class:"temperature-sensor-3d-container"},jf={viewBox:"0 0 80 120",xmlns:"http://www.w3.org/2000/svg"},Hf=["id"],qf=["id"],Jf=["stop-color"],Yf=["stop-color"],Xf=["id"],Kf=["stop-color"],Qf=["stop-color"],Zf=["fill"],e0=["y","height","fill"],t0=["fill"],o0=["fill"],l0=["fill","opacity"],n0={key:0,attributeName:"opacity",values:"1;0.3;1",dur:"0.8s",repeatCount:"indefinite"},a0=A(e.defineComponent({__name:"TemperatureSensor3D",props:{node:{}},setup(i){const l=i,o=e.ref(`temp-sensor-${Math.random().toString(36).substr(2,9)}`),s=()=>l.node?l.node.getData?l.node.getData():l.node.data||{}:{},t=e.ref(25),r=e.ref(100),p=e.ref(0),d=e.ref(80),c=e.ref(10),f=e.computed(()=>{const k=r.value-p.value;return Math.max(0,Math.min(1,(t.value-p.value)/k))*45}),a=e.computed(()=>65-f.value),n=e.computed(()=>t.value>=d.value?"#ef4444":t.value<=c.value?"#3b82f6":t.value>=60?"#f97316":t.value>=40?"#fbbf24":"#22c55e"),u=e.computed(()=>t.value>=d.value?"#ef4444":t.value<=c.value?"#3b82f6":"#22c55e"),g=e.computed(()=>t.value>=d.value||t.value<=c.value),m=()=>{const k=s();t.value=Math.round(k.temperature??25),r.value=k.maxTemp||100,p.value=k.minTemp||0,d.value=k.alarmHighLimit||80,c.value=k.alarmLowLimit||10};return e.watch(()=>l.node,()=>{m()},{deep:!0}),e.onMounted(()=>{m(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{m()})}),(k,B)=>(e.openBlock(),e.createElementBlock("div",Gf,[(e.openBlock(),e.createElementBlock("svg",jf,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`shell-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[...B[0]||(B[0]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#64748b"},null,-1),e.createElementVNode("stop",{offset:"50%","stop-color":"#cbd5e1"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#64748b"},null,-1)])],8,Hf),e.createElementVNode("linearGradient",{id:`liquid-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":n.value},null,8,Jf),e.createElementVNode("stop",{offset:"100%","stop-color":n.value,"stop-opacity":"0.7"},null,8,Yf)],8,qf),e.createElementVNode("radialGradient",{id:`bulb-gradient-${o.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":n.value,"stop-opacity":"0.9"},null,8,Kf),e.createElementVNode("stop",{offset:"70%","stop-color":n.value},null,8,Qf),B[1]||(B[1]=e.createElementVNode("stop",{offset:"100%","stop-color":"#991b1b"},null,-1))],8,Xf)]),e.createElementVNode("rect",{x:"30",y:"15",width:"20",height:"60",rx:"10",fill:`url(#shell-gradient-${o.value})`,stroke:"#475569","stroke-width":"1.5"},null,8,Zf),B[2]||(B[2]=e.createStaticVNode('<rect x="35" y="20" width="10" height="50" rx="5" fill="#f8fafc" stroke="#cbd5e1" stroke-width="1" opacity="0.8" data-v-1b4c4bcc></rect><g opacity="0.6" data-v-1b4c4bcc><line x1="32" y1="25" x2="35" y2="25" stroke="#64748b" stroke-width="0.8" data-v-1b4c4bcc></line><text x="29" y="27" font-size="5" fill="#64748b" text-anchor="end" data-v-1b4c4bcc>100</text><line x1="32" y1="35" x2="35" y2="35" stroke="#64748b" stroke-width="0.8" data-v-1b4c4bcc></line><text x="29" y="37" font-size="5" fill="#64748b" text-anchor="end" data-v-1b4c4bcc>75</text><line x1="32" y1="45" x2="35" y2="45" stroke="#64748b" stroke-width="0.8" data-v-1b4c4bcc></line><text x="29" y="47" font-size="5" fill="#64748b" text-anchor="end" data-v-1b4c4bcc>50</text><line x1="32" y1="55" x2="35" y2="55" stroke="#64748b" stroke-width="0.8" data-v-1b4c4bcc></line><text x="29" y="57" font-size="5" fill="#64748b" text-anchor="end" data-v-1b4c4bcc>25</text><line x1="32" y1="65" x2="35" y2="65" stroke="#64748b" stroke-width="0.8" data-v-1b4c4bcc></line><text x="29" y="67" font-size="5" fill="#64748b" text-anchor="end" data-v-1b4c4bcc>0</text></g>',2)),e.createElementVNode("rect",{x:"37",y:a.value,width:"6",height:f.value,rx:"3",fill:`url(#liquid-gradient-${o.value})`},null,8,e0),e.createElementVNode("circle",{cx:"40",cy:"75",r:"10",fill:`url(#bulb-gradient-${o.value})`,stroke:"#991b1b","stroke-width":"1.5"},null,8,t0),B[3]||(B[3]=e.createStaticVNode('<ellipse cx="37" cy="72" rx="3" ry="4" fill="#ffffff" opacity="0.4" data-v-1b4c4bcc></ellipse><path d="M 40,85 Q 45,90 45,95 L 45,105" stroke="#1e293b" stroke-width="3" fill="none" stroke-linecap="round" data-v-1b4c4bcc></path><path d="M 40,85 Q 35,90 35,95 L 35,105" stroke="#ef4444" stroke-width="3" fill="none" stroke-linecap="round" data-v-1b4c4bcc></path><rect x="32" y="103" width="6" height="8" rx="1" fill="#fbbf24" stroke="#b45309" stroke-width="0.5" data-v-1b4c4bcc></rect><rect x="42" y="103" width="6" height="8" rx="1" fill="#1e293b" stroke="#475569" stroke-width="0.5" data-v-1b4c4bcc></rect><rect x="50" y="35" width="25" height="18" rx="2" fill="#0f172a" stroke="#334155" stroke-width="1" data-v-1b4c4bcc></rect>',6)),e.createElementVNode("text",{x:"62.5",y:"47","font-size":"10",fill:u.value,"text-anchor":"middle","font-family":"monospace"},e.toDisplayString(t.value),9,o0),B[4]||(B[4]=e.createElementVNode("text",{x:"62.5",y:"51","font-size":"4",fill:"#64748b","text-anchor":"middle"},"°C",-1)),e.createElementVNode("circle",{cx:"58",cy:"29",r:"2.5",fill:g.value?"#ef4444":"#64748b",opacity:g.value?1:.3},[g.value?(e.openBlock(),e.createElementBlock("animate",n0)):e.createCommentVNode("",!0)],8,l0),B[5]||(B[5]=e.createElementVNode("text",{x:"40",y:"115","font-size":"5",fill:"#64748b","text-anchor":"middle","font-family":"Arial"}," PT100 ",-1))])),e.createElementVNode("div",{class:e.normalizeClass(["status-text",{"is-alarm":g.value}])},e.toDisplayString(t.value)+"°C "+e.toDisplayString(g.value?"- 超限":""),3)]))}}),[["__scopeId","data-v-1b4c4bcc"]]),r0={class:"cylinder-3d-container"},i0={viewBox:"0 0 60 140",xmlns:"http://www.w3.org/2000/svg"},s0=["id"],d0=["id"],c0=["id"],p0=["fill"],m0=["fill"],f0=["fill"],u0=["y","height","fill"],g0=["cy"],h0=["cy"],y0=["x","fill"],b0=["x","fill"],k0={x:"30",y:"125","font-size":"5",fill:"#64748b","text-anchor":"middle","font-family":"Arial"},E0={x:"30",y:"18","font-size":"8",fill:"#22c55e","text-anchor":"middle","font-family":"monospace"},N0=A(e.defineComponent({__name:"Cylinder3D",props:{node:{}},setup(i){const l=i,o=e.ref(`cylinder-${Math.random().toString(36).substr(2,9)}`),s=()=>l.node?l.node.getData?l.node.getData():l.node.data||{}:{},t=e.ref(0),r=e.ref(50),p=e.ref(200),d=e.ref("stop");let c=null,f=Date.now();const a=e.computed(()=>t.value>=r.value),n=e.computed(()=>t.value<=0),u=e.computed(()=>30+t.value/r.value*40),g=e.computed(()=>50-u.value),m=e.computed(()=>110-t.value/r.value*60),k=e.computed(()=>a.value?"伸出到位":n.value?"缩回到位":d.value==="extend"?"正在伸出":d.value==="retract"?"正在缩回":"停止"),B=e.computed(()=>a.value||n.value?"is-positioned":d.value!=="stop"?"is-moving":""),T=()=>{const b=Date.now(),h=(b-f)/1e3;f=b,d.value==="extend"&&t.value<r.value?t.value=Math.min(r.value,t.value+p.value*h):d.value==="retract"&&t.value>0&&(t.value=Math.max(0,t.value-p.value*h)),t.value=Math.round(t.value),c=requestAnimationFrame(T)},E=()=>{const b=s();d.value=b.action||"stop",r.value=b.stroke||50,p.value=b.speed||200,typeof b.position=="number"&&(t.value=Math.max(0,Math.min(r.value,b.position)))};return e.watch(()=>l.node,()=>{E()},{deep:!0}),e.onMounted(()=>{E(),f=Date.now(),T(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{E()})}),e.onUnmounted(()=>{c&&cancelAnimationFrame(c)}),(b,h)=>(e.openBlock(),e.createElementBlock("div",r0,[(e.openBlock(),e.createElementBlock("svg",i0,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`cylinder-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[...h[0]||(h[0]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#475569"},null,-1),e.createElementVNode("stop",{offset:"30%","stop-color":"#94a3b8"},null,-1),e.createElementVNode("stop",{offset:"70%","stop-color":"#cbd5e1"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#475569"},null,-1)])],8,s0),e.createElementVNode("linearGradient",{id:`rod-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[...h[1]||(h[1]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#64748b"},null,-1),e.createElementVNode("stop",{offset:"50%","stop-color":"#94a3b8"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#64748b"},null,-1)])],8,d0),e.createElementVNode("radialGradient",{id:`cap-gradient-${o.value}`},[...h[2]||(h[2]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#64748b"},null,-1),e.createElementVNode("stop",{offset:"70%","stop-color":"#475569"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#334155"},null,-1)])],8,c0)]),e.createElementVNode("ellipse",{cx:"30",cy:"80",rx:"15",ry:"8",fill:`url(#cap-gradient-${o.value})`,stroke:"#1e293b","stroke-width":"1"},null,8,p0),e.createElementVNode("rect",{x:"15",y:"50",width:"30",height:"60",fill:`url(#cylinder-gradient-${o.value})`,stroke:"#334155","stroke-width":"1"},null,8,m0),h[3]||(h[3]=e.createStaticVNode('<g opacity="0.2" data-v-7429604c><line x1="15" y1="55" x2="45" y2="55" stroke="#1e293b" stroke-width="0.5" data-v-7429604c></line><line x1="15" y1="65" x2="45" y2="65" stroke="#1e293b" stroke-width="0.5" data-v-7429604c></line><line x1="15" y1="75" x2="45" y2="75" stroke="#1e293b" stroke-width="0.5" data-v-7429604c></line><line x1="15" y1="85" x2="45" y2="85" stroke="#1e293b" stroke-width="0.5" data-v-7429604c></line><line x1="15" y1="95" x2="45" y2="95" stroke="#1e293b" stroke-width="0.5" data-v-7429604c></line><line x1="15" y1="105" x2="45" y2="105" stroke="#1e293b" stroke-width="0.5" data-v-7429604c></line></g>',1)),e.createElementVNode("ellipse",{cx:"30",cy:"50",rx:"15",ry:"8",fill:`url(#cap-gradient-${o.value})`,stroke:"#1e293b","stroke-width":"1"},null,8,f0),e.createElementVNode("rect",{x:"26",y:g.value,width:"8",height:u.value,fill:`url(#rod-gradient-${o.value})`,stroke:"#475569","stroke-width":"0.5"},null,8,u0),e.createElementVNode("ellipse",{cx:"30",cy:g.value,rx:"4",ry:"2",fill:"#94a3b8",stroke:"#64748b","stroke-width":"0.5"},null,8,g0),e.createElementVNode("ellipse",{cx:"30",cy:m.value,rx:"13",ry:"6",fill:"#64748b",stroke:"#334155","stroke-width":"1"},null,8,h0),h[4]||(h[4]=e.createElementVNode("circle",{cx:"48",cy:"58",r:"3",fill:"#3b82f6",stroke:"#1e40af","stroke-width":"1"},null,-1)),h[5]||(h[5]=e.createElementVNode("text",{x:"55",y:"60","font-size":"6",fill:"#3b82f6","font-weight":"bold"},"A",-1)),h[6]||(h[6]=e.createElementVNode("circle",{cx:"48",cy:"102",r:"3",fill:"#ef4444",stroke:"#991b1b","stroke-width":"1"},null,-1)),h[7]||(h[7]=e.createElementVNode("text",{x:"55",y:"104","font-size":"6",fill:"#ef4444","font-weight":"bold"},"B",-1)),e.createElementVNode("rect",{x:a.value?48:50,y:"52",width:"6",height:"4",rx:"1",fill:a.value?"#22c55e":"#64748b",stroke:"#334155","stroke-width":"0.5"},null,8,y0),e.createElementVNode("rect",{x:n.value?48:50,y:"104",width:"6",height:"4",rx:"1",fill:n.value?"#22c55e":"#64748b",stroke:"#334155","stroke-width":"0.5"},null,8,b0),h[8]||(h[8]=e.createElementVNode("g",null,[e.createElementVNode("rect",{x:"5",y:"78",width:"8",height:"4",rx:"1",fill:"#334155"}),e.createElementVNode("circle",{cx:"7",cy:"80",r:"2",fill:"#64748b",stroke:"#1e293b","stroke-width":"0.5"}),e.createElementVNode("rect",{x:"47",y:"78",width:"8",height:"4",rx:"1",fill:"#334155"}),e.createElementVNode("circle",{cx:"53",cy:"80",r:"2",fill:"#64748b",stroke:"#1e293b","stroke-width":"0.5"})],-1)),e.createElementVNode("text",k0,e.toDisplayString(r.value)+"mm ",1),e.createElementVNode("text",E0,e.toDisplayString(t.value)+"mm ",1)])),e.createElementVNode("div",{class:e.normalizeClass(["status-text",B.value])},e.toDisplayString(k.value),3)]))}}),[["__scopeId","data-v-7429604c"]]),V0={class:"pipe-3d-container"},x0=["viewBox"],w0=["id"],$0=["id"],C0=["stop-color"],_0=["stop-color"],v0=["stop-color"],B0={key:0},S0=["y","width","height","fill"],D0=["y","width","height"],I0=["x","y","width","height","fill"],T0=["cy","rx","ry"],z0=["cx","cy","rx","ry"],M0=["cy"],A0=["cy"],P0=["cx","cy"],O0=["cx","cy"],L0={key:1},R0=["x","width","height","fill"],U0=["x","width","height"],W0=["x","y","width","height","fill"],F0=["cx","rx","ry"],G0=["cx","cy","rx","ry"],j0=["cx"],H0=["cx"],q0=["cx","cy"],J0=["cx","cy"],Y0={key:2},X0=["id"],K0=["fill"],Q0=["x1","y1","x2","y2","stroke","marker-end"],Z0=["x1","y1","x2","y2","stroke","marker-end"],e1=A(e.defineComponent({__name:"Pipe3D",props:{node:{}},setup(i){const l=i,o=e.ref(`pipe-${Math.random().toString(36).substr(2,9)}`),s=()=>l.node?l.node.getData?l.node.getData():l.node.data||{}:{},t=e.ref(!1),r=e.ref(10),p=e.ref("horizontal"),d=e.ref("#3b82f6"),c=e.ref(40),f=e.ref(200),a=e.computed(()=>c.value/2),n=e.computed(()=>f.value),u=e.computed(()=>p.value==="horizontal"?`0 0 ${n.value} ${c.value+10}`:`0 0 ${c.value+10} ${n.value}`),g=e.computed(()=>(c.value+10)/2),m=e.computed(()=>(c.value+10)/2),k=e.ref(0);let B=null;const T=()=>{if(t.value){const b=r.value/5;k.value=(k.value+b)%n.value}B=requestAnimationFrame(T)},E=()=>{const b=s();t.value=b.state==="flowing"||b.state===!0,r.value=b.flowRate||10,p.value=b.direction||"horizontal",d.value=b.fluidColor||"#3b82f6",c.value=b.diameter||40,f.value=b.length||200};return e.watch(()=>l.node,()=>{E()},{deep:!0}),e.onMounted(()=>{E(),T(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{E()})}),e.onUnmounted(()=>{B&&cancelAnimationFrame(B)}),(b,h)=>(e.openBlock(),e.createElementBlock("div",V0,[(e.openBlock(),e.createElementBlock("svg",{viewBox:u.value,xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`pipe-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[...h[0]||(h[0]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#475569"},null,-1),e.createElementVNode("stop",{offset:"30%","stop-color":"#94a3b8"},null,-1),e.createElementVNode("stop",{offset:"70%","stop-color":"#cbd5e1"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#475569"},null,-1)])],8,w0),e.createElementVNode("linearGradient",{id:`flow-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":d.value,"stop-opacity":"0.3"},null,8,C0),e.createElementVNode("stop",{offset:"50%","stop-color":d.value,"stop-opacity":"0.8"},null,8,_0),e.createElementVNode("stop",{offset:"100%","stop-color":d.value,"stop-opacity":"0.3"},null,8,v0)],8,$0)]),p.value==="horizontal"?(e.openBlock(),e.createElementBlock("g",B0,[e.createElementVNode("rect",{x:"0",y:g.value-a.value,width:n.value,height:a.value*2,fill:`url(#pipe-gradient-${o.value})`,stroke:"#334155","stroke-width":"1"},null,8,S0),e.createElementVNode("rect",{x:"0",y:g.value-a.value+3,width:n.value,height:a.value*2-6,fill:"#0f172a"},null,8,D0),t.value?(e.openBlock(),e.createElementBlock("rect",{key:0,x:k.value,y:g.value-a.value+5,width:n.value/2,height:a.value*2-10,fill:`url(#flow-gradient-${o.value})`},null,8,I0)):e.createCommentVNode("",!0),e.createElementVNode("g",null,[e.createElementVNode("ellipse",{cx:0,cy:g.value,rx:a.value+2,ry:a.value+2,fill:"#64748b",stroke:"#334155","stroke-width":"1"},null,8,T0),e.createElementVNode("ellipse",{cx:n.value,cy:g.value,rx:a.value+2,ry:a.value+2,fill:"#64748b",stroke:"#334155","stroke-width":"1"},null,8,z0),e.createElementVNode("circle",{cx:0,cy:g.value-a.value-2,r:"1.5",fill:"#1e293b"},null,8,M0),e.createElementVNode("circle",{cx:0,cy:g.value+a.value+2,r:"1.5",fill:"#1e293b"},null,8,A0),e.createElementVNode("circle",{cx:n.value,cy:g.value-a.value-2,r:"1.5",fill:"#1e293b"},null,8,P0),e.createElementVNode("circle",{cx:n.value,cy:g.value+a.value+2,r:"1.5",fill:"#1e293b"},null,8,O0)])])):(e.openBlock(),e.createElementBlock("g",L0,[e.createElementVNode("rect",{x:m.value-a.value,y:"0",width:a.value*2,height:n.value,fill:`url(#pipe-gradient-${o.value})`,stroke:"#334155","stroke-width":"1"},null,8,R0),e.createElementVNode("rect",{x:m.value-a.value+3,y:"0",width:a.value*2-6,height:n.value,fill:"#0f172a"},null,8,U0),t.value?(e.openBlock(),e.createElementBlock("rect",{key:0,x:m.value-a.value+5,y:k.value,width:a.value*2-10,height:n.value/2,fill:`url(#flow-gradient-${o.value})`},null,8,W0)):e.createCommentVNode("",!0),e.createElementVNode("g",null,[e.createElementVNode("ellipse",{cx:m.value,cy:0,rx:a.value+2,ry:a.value+2,fill:"#64748b",stroke:"#334155","stroke-width":"1"},null,8,F0),e.createElementVNode("ellipse",{cx:m.value,cy:n.value,rx:a.value+2,ry:a.value+2,fill:"#64748b",stroke:"#334155","stroke-width":"1"},null,8,G0),e.createElementVNode("circle",{cx:m.value-a.value-2,cy:0,r:"1.5",fill:"#1e293b"},null,8,j0),e.createElementVNode("circle",{cx:m.value+a.value+2,cy:0,r:"1.5",fill:"#1e293b"},null,8,H0),e.createElementVNode("circle",{cx:m.value-a.value-2,cy:n.value,r:"1.5",fill:"#1e293b"},null,8,q0),e.createElementVNode("circle",{cx:m.value+a.value+2,cy:n.value,r:"1.5",fill:"#1e293b"},null,8,J0)])])),t.value?(e.openBlock(),e.createElementBlock("g",Y0,[e.createElementVNode("defs",null,[e.createElementVNode("marker",{id:`arrow-${o.value}`,markerWidth:"10",markerHeight:"10",refX:"8",refY:"3",orient:"auto",markerUnits:"strokeWidth"},[e.createElementVNode("path",{d:"M0,0 L0,6 L9,3 z",fill:d.value},null,8,K0)],8,X0)]),p.value==="horizontal"?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.value/2-20,y1:g.value,x2:n.value/2+20,y2:g.value,stroke:d.value,"stroke-width":"2","marker-end":`url(#arrow-${o.value})`},null,8,Q0)):(e.openBlock(),e.createElementBlock("line",{key:1,x1:m.value,y1:n.value/2-20,x2:m.value,y2:n.value/2+20,stroke:d.value,"stroke-width":"2","marker-end":`url(#arrow-${o.value})`},null,8,Z0))])):e.createCommentVNode("",!0)],8,x0)),e.createElementVNode("div",{class:e.normalizeClass(["status-text",{"is-flowing":t.value}])},e.toDisplayString(t.value?"流动中":"停止")+" | "+e.toDisplayString(r.value)+" m³/h ",3)]))}}),[["__scopeId","data-v-5c3ec02f"]]),t1={class:"filter-3d-container"},o1={viewBox:"0 0 120 100",xmlns:"http://www.w3.org/2000/svg"},l1=["id"],n1=["id"],a1=["stop-color"],r1=["stop-color"],i1=["fill"],s1=["fill"],d1={opacity:"0.5"},c1=["x1","x2"],p1=["y1","y2"],m1=["y","height"],f1={transform:"translate(80, 30)"},u1=["fill"],g1=["fill","opacity"],h1={key:0,attributeName:"opacity",values:"1;0.3;1",dur:"0.8s",repeatCount:"indefinite"},y1={x:"60",y:"95","font-size":"5",fill:"#64748b","text-anchor":"middle","font-family":"Arial"},b1=A(e.defineComponent({__name:"Filter3D",props:{node:{}},setup(i){const l=i,o=e.ref(`filter-${Math.random().toString(36).substr(2,9)}`),s=()=>l.node?l.node.getData?l.node.getData():l.node.data||{}:{},t=e.ref(20),r=e.ref(5),p=e.ref(50),d=e.ref(70),c=e.computed(()=>t.value>=d.value?"#7f1d1d":t.value>=50?"#b45309":"#15803d"),f=e.computed(()=>t.value>=d.value?"#991b1b":t.value>=50?"#d97706":"#166534"),a=e.computed(()=>r.value>=15?"#ef4444":r.value>=10?"#f97316":"#22c55e"),n=e.computed(()=>t.value>=d.value),u=()=>{const g=s();t.value=Math.max(0,Math.min(100,g.clogLevel||20)),r.value=g.pressureDrop||5,p.value=g.diameter||50,d.value=g.alarmThreshold||70};return e.watch(()=>l.node,()=>{u()},{deep:!0}),e.onMounted(()=>{u(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{u()})}),(g,m)=>(e.openBlock(),e.createElementBlock("div",t1,[(e.openBlock(),e.createElementBlock("svg",o1,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`shell-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[...m[0]||(m[0]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#475569"},null,-1),e.createElementVNode("stop",{offset:"50%","stop-color":"#94a3b8"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#475569"},null,-1)])],8,l1),e.createElementVNode("linearGradient",{id:`filter-element-${o.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":c.value},null,8,a1),e.createElementVNode("stop",{offset:"100%","stop-color":f.value},null,8,r1)],8,n1)]),m[3]||(m[3]=e.createElementVNode("rect",{x:"0",y:"43",width:"25",height:"14",fill:"#64748b",stroke:"#334155","stroke-width":"1"},null,-1)),e.createElementVNode("rect",{x:"25",y:"20",width:"70",height:"60",rx:"5",fill:`url(#shell-gradient-${o.value})`,stroke:"#334155","stroke-width":"2"},null,8,i1),m[4]||(m[4]=e.createElementVNode("ellipse",{cx:"60",cy:"50",rx:"15",ry:"20",fill:"#1e293b",stroke:"#64748b","stroke-width":"2",opacity:"0.7"},null,-1)),e.createElementVNode("g",null,[e.createElementVNode("rect",{x:"50",y:"30",width:"20",height:"40",rx:"2",fill:`url(#filter-element-${o.value})`,stroke:"#475569","stroke-width":"1"},null,8,s1),e.createElementVNode("g",d1,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(8,k=>e.createElementVNode("line",{key:`v-${k}`,x1:50+k*2.5,y1:"30",x2:50+k*2.5,y2:"70",stroke:"#1e293b","stroke-width":"0.5"},null,8,c1)),64)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(8,k=>e.createElementVNode("line",{key:`h-${k}`,x1:"50",y1:30+k*5,x2:"70",y2:30+k*5,stroke:"#1e293b","stroke-width":"0.5"},null,8,p1)),64))]),e.createElementVNode("rect",{x:"52",y:70-t.value*.4,width:"16",height:t.value*.4,fill:"#ef4444",opacity:"0.6"},null,8,m1)]),m[5]||(m[5]=e.createElementVNode("rect",{x:"95",y:"43",width:"25",height:"14",fill:"#64748b",stroke:"#334155","stroke-width":"1"},null,-1)),m[6]||(m[6]=e.createElementVNode("rect",{x:"55",y:"78",width:"10",height:"8",rx:"1",fill:"#334155",stroke:"#1e293b","stroke-width":"1"},null,-1)),m[7]||(m[7]=e.createElementVNode("path",{d:"M 57,86 L 60,90 L 63,86",stroke:"#64748b","stroke-width":"1.5",fill:"none"},null,-1)),e.createElementVNode("g",f1,[m[1]||(m[1]=e.createElementVNode("circle",{cx:"0",cy:"0",r:"12",fill:"#0f172a",stroke:"#475569","stroke-width":"1.5"},null,-1)),e.createElementVNode("text",{x:"0",y:"4","font-size":"7",fill:a.value,"text-anchor":"middle","font-family":"monospace"},e.toDisplayString(r.value),9,u1),m[2]||(m[2]=e.createElementVNode("text",{x:"0",y:"10","font-size":"3",fill:"#64748b","text-anchor":"middle"},"kPa",-1))]),e.createElementVNode("circle",{cx:"35",cy:"28",r:"3",fill:n.value?"#ef4444":"#64748b",opacity:n.value?1:.3},[n.value?(e.openBlock(),e.createElementBlock("animate",h1)):e.createCommentVNode("",!0)],8,g1),e.createElementVNode("text",y1," FLT-"+e.toDisplayString(p.value),1)])),e.createElementVNode("div",{class:e.normalizeClass(["status-text",{"is-alarm":n.value}])}," 堵塞度: "+e.toDisplayString(t.value)+"% | 压差: "+e.toDisplayString(r.value)+" kPa ",3)]))}}),[["__scopeId","data-v-1bb1c80a"]]),k1={class:"heat-exchanger-3d-container"},E1={viewBox:"0 0 140 120",xmlns:"http://www.w3.org/2000/svg"},N1=["id"],V1=["id"],x1=["id"],w1=["fill"],$1={opacity:"0.6"},C1=["y1","y2"],_1=["y","fill"],v1=["y","fill"],B1=["x","fill"],S1=["x","fill"],D1={transform:"translate(70, 60)"},I1=["fill"],T1={transform:"translate(95, 50)"},z1={x:"0",y:"-1","font-size":"6",fill:"#ef4444","text-anchor":"middle"},M1={x:"0",y:"6","font-size":"5",fill:"#f97316","text-anchor":"middle"},A1={transform:"translate(45, 70)"},P1={x:"0",y:"-1","font-size":"6",fill:"#3b82f6","text-anchor":"middle"},O1={x:"0",y:"6","font-size":"5",fill:"#60a5fa","text-anchor":"middle"},L1=["fill","opacity"],R1={key:0,attributeName:"opacity",values:"1;0.5;1",dur:"1.5s",repeatCount:"indefinite"},U1={x:"70",y:"115","font-size":"5",fill:"#64748b","text-anchor":"middle","font-family":"Arial"},W1=A(e.defineComponent({__name:"HeatExchanger3D",props:{node:{}},setup(i){const l=i,o=e.ref(`hex-${Math.random().toString(36).substr(2,9)}`),s=()=>l.node?l.node.getData?l.node.getData():l.node.data||{}:{},t=e.ref(!1),r=e.ref(80),p=e.ref(50),d=e.ref(20),c=e.ref(40),f=e.ref(10),a=e.computed(()=>{if(r.value<=p.value)return 0;const b=r.value-d.value,h=r.value-p.value,N=Math.round(h/b*100);return Math.max(0,Math.min(100,N))}),n=e.computed(()=>a.value>=80?"#22c55e":a.value>=60?"#fbbf24":a.value>=40?"#f97316":"#ef4444"),u=e.ref(0),g=e.ref(0),m=e.ref(0),k=e.ref(0);let B=null;const T=()=>{t.value&&(u.value=(u.value+.5)%20,g.value=(g.value+.5)%20,m.value=(m.value+.5)%20,k.value=(k.value+.5)%20),B=requestAnimationFrame(T)},E=()=>{const b=s();t.value=b.state==="working"||b.state===!0,r.value=b.hotTempIn||80,p.value=b.hotTempOut||50,d.value=b.coldTempIn||20,c.value=b.coldTempOut||40,f.value=b.heatTransferArea||10};return e.watch(()=>l.node,()=>{E()},{deep:!0}),e.onMounted(()=>{E(),T(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{E()})}),e.onUnmounted(()=>{B&&cancelAnimationFrame(B)}),(b,h)=>(e.openBlock(),e.createElementBlock("div",k1,[(e.openBlock(),e.createElementBlock("svg",E1,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`shell-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[...h[0]||(h[0]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#475569"},null,-1),e.createElementVNode("stop",{offset:"50%","stop-color":"#94a3b8"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#475569"},null,-1)])],8,N1),e.createElementVNode("linearGradient",{id:`hot-fluid-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[...h[1]||(h[1]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#ef4444","stop-opacity":"0.3"},null,-1),e.createElementVNode("stop",{offset:"50%","stop-color":"#ef4444","stop-opacity":"0.7"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#ef4444","stop-opacity":"0.3"},null,-1)])],8,V1),e.createElementVNode("linearGradient",{id:`cold-fluid-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[...h[2]||(h[2]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#3b82f6","stop-opacity":"0.3"},null,-1),e.createElementVNode("stop",{offset:"50%","stop-color":"#3b82f6","stop-opacity":"0.7"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#3b82f6","stop-opacity":"0.3"},null,-1)])],8,x1)]),e.createElementVNode("rect",{x:"20",y:"30",width:"100",height:"60",rx:"8",fill:`url(#shell-gradient-${o.value})`,stroke:"#334155","stroke-width":"2"},null,8,w1),h[15]||(h[15]=e.createElementVNode("line",{x1:"70",y1:"30",x2:"70",y2:"90",stroke:"#64748b","stroke-width":"2"},null,-1)),e.createElementVNode("g",$1,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(8,N=>e.createElementVNode("line",{key:`tube-${N}`,x1:"25",y1:35+N*7,x2:"115",y2:35+N*7,stroke:"#475569","stroke-width":"1.5"},null,8,C1)),64))]),e.createElementVNode("g",null,[h[3]||(h[3]=e.createElementVNode("rect",{x:"60",y:"10",width:"20",height:"20",rx:"2",fill:"#64748b",stroke:"#334155","stroke-width":"1"},null,-1)),h[4]||(h[4]=e.createElementVNode("text",{x:"70",y:"23","font-size":"6",fill:"#ef4444","text-anchor":"middle","font-weight":"bold"},"H-IN",-1)),t.value?(e.openBlock(),e.createElementBlock("rect",{key:0,x:"65",y:10+u.value,width:"10",height:"8",fill:`url(#hot-fluid-${o.value})`},null,8,_1)):e.createCommentVNode("",!0)]),e.createElementVNode("g",null,[h[5]||(h[5]=e.createElementVNode("rect",{x:"60",y:"90",width:"20",height:"20",rx:"2",fill:"#64748b",stroke:"#334155","stroke-width":"1"},null,-1)),h[6]||(h[6]=e.createElementVNode("text",{x:"70",y:"103","font-size":"6",fill:"#f97316","text-anchor":"middle","font-weight":"bold"},"H-OUT",-1)),t.value?(e.openBlock(),e.createElementBlock("rect",{key:0,x:"65",y:90+g.value,width:"10",height:"8",fill:`url(#hot-fluid-${o.value})`,opacity:"0.7"},null,8,v1)):e.createCommentVNode("",!0)]),e.createElementVNode("g",null,[h[7]||(h[7]=e.createElementVNode("rect",{x:"0",y:"53",width:"20",height:"14",rx:"2",fill:"#64748b",stroke:"#334155","stroke-width":"1"},null,-1)),h[8]||(h[8]=e.createElementVNode("text",{x:"10",y:"62","font-size":"5",fill:"#3b82f6","text-anchor":"middle","font-weight":"bold"},"C-IN",-1)),t.value?(e.openBlock(),e.createElementBlock("rect",{key:0,x:m.value,y:"56",width:"8",height:"8",fill:`url(#cold-fluid-${o.value})`},null,8,B1)):e.createCommentVNode("",!0)]),e.createElementVNode("g",null,[h[9]||(h[9]=e.createElementVNode("rect",{x:"120",y:"53",width:"20",height:"14",rx:"2",fill:"#64748b",stroke:"#334155","stroke-width":"1"},null,-1)),h[10]||(h[10]=e.createElementVNode("text",{x:"130",y:"62","font-size":"5",fill:"#60a5fa","text-anchor":"middle","font-weight":"bold"},"C-OUT",-1)),t.value?(e.openBlock(),e.createElementBlock("rect",{key:0,x:120+k.value,y:"56",width:"8",height:"8",fill:`url(#cold-fluid-${o.value})`,opacity:"0.7"},null,8,S1)):e.createCommentVNode("",!0)]),e.createElementVNode("g",D1,[h[11]||(h[11]=e.createElementVNode("circle",{cx:"0",cy:"0",r:"15",fill:"#0f172a",stroke:"#475569","stroke-width":"2"},null,-1)),e.createElementVNode("text",{x:"0",y:"2","font-size":"10",fill:n.value,"text-anchor":"middle","font-family":"monospace","font-weight":"bold"},e.toDisplayString(a.value),9,I1),h[12]||(h[12]=e.createElementVNode("text",{x:"0",y:"8","font-size":"4",fill:"#64748b","text-anchor":"middle"},"%",-1))]),e.createElementVNode("g",T1,[h[13]||(h[13]=e.createElementVNode("rect",{x:"-15",y:"-8",width:"30",height:"16",rx:"2",fill:"#1e293b",stroke:"#ef4444","stroke-width":"1"},null,-1)),e.createElementVNode("text",z1,e.toDisplayString(r.value)+"°C",1),e.createElementVNode("text",M1,"→"+e.toDisplayString(p.value)+"°C",1)]),e.createElementVNode("g",A1,[h[14]||(h[14]=e.createElementVNode("rect",{x:"-15",y:"-8",width:"30",height:"16",rx:"2",fill:"#1e293b",stroke:"#3b82f6","stroke-width":"1"},null,-1)),e.createElementVNode("text",P1,e.toDisplayString(d.value)+"°C",1),e.createElementVNode("text",O1,"→"+e.toDisplayString(c.value)+"°C",1)]),e.createElementVNode("circle",{cx:"30",cy:"38",r:"3",fill:t.value?"#22c55e":"#64748b",opacity:t.value?1:.3},[t.value?(e.openBlock(),e.createElementBlock("animate",R1)):e.createCommentVNode("",!0)],8,L1),e.createElementVNode("text",U1," HEX-"+e.toDisplayString(f.value)+"m² ",1)])),e.createElementVNode("div",{class:e.normalizeClass(["status-text",{"is-working":t.value}])},e.toDisplayString(t.value?"运行中":"停止")+" | 效率: "+e.toDisplayString(a.value)+"% ",3)]))}}),[["__scopeId","data-v-ed672204"]]),F1={class:"tee-3d-container"},G1={viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg"},j1=["id"],H1=["id"],q1=["stop-color"],J1=["stop-color"],Y1=["fill"],X1=["fill"],K1=["fill"],Q1={key:0},Z1=["fill"],eu=["x","fill"],tu=["x","fill"],ou=["y","fill"],lu=["y","fill"],nu={key:1},au=["id"],ru=["fill"],iu=["stroke","marker-end"],su=["stroke","marker-end"],du=["stroke","marker-end"],cu={transform:"translate(50, 50)"},pu=["fill"],mu=A(e.defineComponent({__name:"Tee3D",props:{node:{}},setup(i){const l=i,o=e.ref(`tee-${Math.random().toString(36).substr(2,9)}`),s=()=>l.node?l.node.getData?l.node.getData():l.node.data||{}:{},t=e.ref(!1),r=e.ref("#3b82f6"),p=e.ref(!0),d=e.ref(!0),c=e.ref(0),f=e.ref(0),a=e.ref(0),n=e.ref(0);let u=null;const g=()=>{t.value&&(c.value=(c.value+1)%40,f.value=(f.value+1)%20,a.value=(a.value+1)%20,n.value=(n.value+1)%20),u=requestAnimationFrame(g)},m=()=>{const k=s();t.value=k.state==="flowing"||k.state===!0,r.value=k.fluidColor||"#3b82f6",p.value=k.topFlowEnabled!==!1,d.value=k.bottomFlowEnabled!==!1};return e.watch(()=>l.node,()=>{m()},{deep:!0}),e.onMounted(()=>{m(),g(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{m()})}),e.onUnmounted(()=>{u&&cancelAnimationFrame(u)}),(k,B)=>(e.openBlock(),e.createElementBlock("div",F1,[(e.openBlock(),e.createElementBlock("svg",G1,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`pipe-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[...B[0]||(B[0]=[e.createElementVNode("stop",{offset:"0%","stop-color":"#475569"},null,-1),e.createElementVNode("stop",{offset:"50%","stop-color":"#94a3b8"},null,-1),e.createElementVNode("stop",{offset:"100%","stop-color":"#475569"},null,-1)])],8,j1),e.createElementVNode("radialGradient",{id:`flow-gradient-${o.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":r.value,"stop-opacity":"0.8"},null,8,q1),e.createElementVNode("stop",{offset:"100%","stop-color":r.value,"stop-opacity":"0.2"},null,8,J1)],8,H1)]),e.createElementVNode("rect",{x:"0",y:"40",width:"100",height:"20",fill:`url(#pipe-gradient-${o.value})`,stroke:"#334155","stroke-width":"1.5"},null,8,Y1),e.createElementVNode("rect",{x:"40",y:"0",width:"20",height:"100",fill:`url(#pipe-gradient-${o.value})`,stroke:"#334155","stroke-width":"1.5"},null,8,X1),e.createElementVNode("circle",{cx:"50",cy:"50",r:"18",fill:`url(#pipe-gradient-${o.value})`,stroke:"#334155","stroke-width":"2"},null,8,K1),B[3]||(B[3]=e.createElementVNode("rect",{x:"0",y:"43",width:"100",height:"14",fill:"#0f172a"},null,-1)),B[4]||(B[4]=e.createElementVNode("rect",{x:"43",y:"0",width:"14",height:"100",fill:"#0f172a"},null,-1)),B[5]||(B[5]=e.createElementVNode("circle",{cx:"50",cy:"50",r:"15",fill:"#0f172a"},null,-1)),t.value?(e.openBlock(),e.createElementBlock("g",Q1,[e.createElementVNode("circle",{cx:"50",cy:"50",r:"12",fill:`url(#flow-gradient-${o.value})`},[...B[1]||(B[1]=[e.createElementVNode("animate",{attributeName:"r",values:"8;14;8",dur:"1.5s",repeatCount:"indefinite"},null,-1)])],8,Z1),e.createElementVNode("rect",{x:c.value,y:"45",width:"20",height:"10",fill:r.value,opacity:"0.6"},null,8,eu),e.createElementVNode("rect",{x:60+f.value,y:"45",width:"20",height:"10",fill:r.value,opacity:"0.4"},null,8,tu),e.createElementVNode("rect",{x:"45",y:a.value,width:"10",height:"20",fill:r.value,opacity:"0.4"},null,8,ou),e.createElementVNode("rect",{x:"45",y:60+n.value,width:"10",height:"20",fill:r.value,opacity:"0.4"},null,8,lu)])):e.createCommentVNode("",!0),B[6]||(B[6]=e.createStaticVNode('<g data-v-cd328987><ellipse cx="0" cy="50" rx="3" ry="10" fill="#64748b" stroke="#334155" stroke-width="1" data-v-cd328987></ellipse><circle cx="0" cy="45" r="1" fill="#1e293b" data-v-cd328987></circle><circle cx="0" cy="55" r="1" fill="#1e293b" data-v-cd328987></circle><ellipse cx="100" cy="50" rx="3" ry="10" fill="#64748b" stroke="#334155" stroke-width="1" data-v-cd328987></ellipse><circle cx="100" cy="45" r="1" fill="#1e293b" data-v-cd328987></circle><circle cx="100" cy="55" r="1" fill="#1e293b" data-v-cd328987></circle><ellipse cx="50" cy="0" rx="10" ry="3" fill="#64748b" stroke="#334155" stroke-width="1" data-v-cd328987></ellipse><circle cx="45" cy="0" r="1" fill="#1e293b" data-v-cd328987></circle><circle cx="55" cy="0" r="1" fill="#1e293b" data-v-cd328987></circle><ellipse cx="50" cy="100" rx="10" ry="3" fill="#64748b" stroke="#334155" stroke-width="1" data-v-cd328987></ellipse><circle cx="45" cy="100" r="1" fill="#1e293b" data-v-cd328987></circle><circle cx="55" cy="100" r="1" fill="#1e293b" data-v-cd328987></circle></g>',1)),t.value?(e.openBlock(),e.createElementBlock("g",nu,[e.createElementVNode("defs",null,[e.createElementVNode("marker",{id:`arrow-${o.value}`,markerWidth:"8",markerHeight:"8",refX:"6",refY:"3",orient:"auto"},[e.createElementVNode("path",{d:"M0,0 L0,6 L6,3 z",fill:r.value},null,8,ru)],8,au)]),e.createElementVNode("line",{x1:"20",y1:"50",x2:"35",y2:"50",stroke:r.value,"stroke-width":"2","marker-end":`url(#arrow-${o.value})`},null,8,iu),p.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:"50",y1:"35",x2:"50",y2:"20",stroke:r.value,"stroke-width":"2","marker-end":`url(#arrow-${o.value})`},null,8,su)):e.createCommentVNode("",!0),d.value?(e.openBlock(),e.createElementBlock("line",{key:1,x1:"50",y1:"65",x2:"50",y2:"80",stroke:r.value,"stroke-width":"2","marker-end":`url(#arrow-${o.value})`},null,8,du)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("g",cu,[B[2]||(B[2]=e.createElementVNode("circle",{cx:"0",cy:"0",r:"6",fill:"#0f172a",stroke:"#475569","stroke-width":"1"},null,-1)),e.createElementVNode("circle",{cx:"0",cy:"0",r:"3",fill:t.value?"#22c55e":"#64748b"},null,8,pu)])])),e.createElementVNode("div",{class:e.normalizeClass(["status-text",{"is-flowing":t.value}])},e.toDisplayString(t.value?"流动中":"关闭"),3)]))}}),[["__scopeId","data-v-cd328987"]]);class fu{constructor(){be(this,"animations",new Map)}startAnimation(l,o){if(!l||o.type==="none")return;this.stopAnimation(l.id);const s=l.id;let t=null;switch(o.type){case"blink":t=this.createBlinkAnimation(l,o);break;case"scale":t=this.createScaleAnimation(l,o);break;case"rotate":t=this.createRotateAnimation(l,o);break;case"float":t=this.createFloatAnimation(l,o);break;case"pulse":t=this.createPulseAnimation(l,o);break}t&&this.animations.set(s,t)}stopAnimation(l){const o=this.animations.get(l);o&&(o.stop&&o.stop(),o.intervalId&&clearInterval(o.intervalId),this.animations.delete(l))}createBlinkAnimation(l,o){const s=l.getAttrByPath("body/opacity")||1;let t=!0;const r=setInterval(()=>{t=!t,l.setAttrByPath("body/opacity",t?s:.2),o.loop||(clearInterval(r),l.setAttrByPath("body/opacity",s))},o.duration/2);return{intervalId:r,stop:()=>{clearInterval(r),l.setAttrByPath("body/opacity",s)}}}createScaleAnimation(l,o){const s=l.getSize();let t=!0;const r=.05;let p=1;const d=setInterval(()=>{t?(p+=r,p>=1.2&&(t=!1)):(p-=r,p<=.8&&(t=!0)),l.resize(s.width*p,s.height*p),!o.loop&&p>=.99&&p<=1.01&&(clearInterval(d),l.resize(s.width,s.height))},o.duration/20);return{intervalId:d,stop:()=>{clearInterval(d),l.resize(s.width,s.height)}}}createRotateAnimation(l,o){let s=0;const t=360/(o.duration/50),r=setInterval(()=>{s=(s+t)%360,l.rotate(s,{absolute:!0}),!o.loop&&s>=360&&(clearInterval(r),l.rotate(0,{absolute:!0}))},50);return{intervalId:r,stop:()=>{clearInterval(r),l.rotate(0,{absolute:!0})}}}createFloatAnimation(l,o){const s=l.position();let t=!0;const r=2;let p=s.y;const d=setInterval(()=>{t?(p-=r,p<=s.y-10&&(t=!1)):(p+=r,p>=s.y+10&&(t=!0)),l.position(s.x,p),!o.loop&&Math.abs(p-s.y)<1&&(clearInterval(d),l.position(s.x,s.y))},o.duration/40);return{intervalId:d,stop:()=>{clearInterval(d),l.position(s.x,s.y)}}}createPulseAnimation(l,o){const s=l.getAttrByPath("body/fill"),t=l.getAttrByPath("body/stroke");let r=0,p=!0;const d=setInterval(()=>{p?(r+=.1,r>=1&&(p=!1)):(r-=.1,r<=0&&(p=!0)),l.setAttrByPath("body/opacity",.5+r*.5),!o.loop&&r<=.05&&(clearInterval(d),l.setAttrByPath("body/fill",s),l.setAttrByPath("body/stroke",t),l.setAttrByPath("body/opacity",1))},o.duration/20);return{intervalId:d,stop:()=>{clearInterval(d),l.setAttrByPath("body/fill",s),l.setAttrByPath("body/stroke",t),l.setAttrByPath("body/opacity",1)}}}clearAll(){this.animations.forEach((l,o)=>{this.stopAnimation(o)}),this.animations.clear()}}const ie=new fu,uu={class:"scada-layout","data-scada-theme":"dark"},gu={class:"scada-canvas-container"},_t=A(e.defineComponent({name:"ScadaCanvas",inheritAttrs:!0,__name:"ScadaCanvas",props:{authCode:{default:""},customFooter:{default:void 0},previewMode:{type:Boolean,default:!1},onSave:{type:Function,default:void 0}},emits:["preview"],setup(i,{expose:l,emit:o}){const s=i,t=o,r=e.ref(null),p=e.ref(null),d=e.ref(null),c=e.ref(0),f=e.ref(null),a=e.ref(!1);let n=null;e.onMounted(()=>{var H,F;if(!((H=r.value)!=null&&H.containerRef))return;const y=W.getConfig();Q.Graph.registerEdge("animated-edge",{inherit:"edge",markup:[{tagName:"path",selector:"line",attrs:{fill:"none"}},{tagName:"path",selector:"wrap",attrs:{fill:"none",stroke:"transparent",strokeWidth:20}},{tagName:"circle",selector:"circle"}],attrs:{line:{connection:!0,stroke:"#10b981",strokeWidth:2,targetMarker:{name:"block",width:8,height:6}},wrap:{connection:!0,strokeLinecap:"round",strokeLinejoin:"round"}}},!0),Z({shape:"echarts-vue",width:300,height:300,component:cp,ports:{groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-top",group:"top"},{id:"port-right",group:"right"},{id:"port-bottom",group:"bottom"},{id:"port-left",group:"left"}]}}),Z({shape:"echarts-line-vue",width:400,height:300,component:pp,ports:{groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-top",group:"top"},{id:"port-right",group:"right"},{id:"port-bottom",group:"bottom"},{id:"port-left",group:"left"}]}}),Z({shape:"light-3d-vue",width:100,height:120,component:Dp,ports:{groups:{left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-left",group:"left"},{id:"port-right",group:"right"}]}}),Z({shape:"switch-3d-vue",width:140,height:100,component:qp,ports:{groups:{left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-left",group:"left"},{id:"port-right",group:"right"}]}}),Z({shape:"motor-3d-vue",width:140,height:110,component:rm,ports:{groups:{left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-left",group:"left"},{id:"port-right",group:"right"}]}}),Z({shape:"valve-3d-vue",width:100,height:140,component:Vm,ports:{groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-top",group:"top"},{id:"port-bottom",group:"bottom"}]}}),Z({shape:"tank-3d-vue",width:120,height:160,component:Lm,ports:{groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-top",group:"top"},{id:"port-right",group:"right"},{id:"port-bottom",group:"bottom"}]}}),Z({shape:"pump-3d-vue",width:160,height:120,component:rf,ports:{groups:{left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-left",group:"left"},{id:"port-right",group:"right"}]}}),Z({shape:"conveyor-3d-vue",width:220,height:100,component:xf,ports:{groups:{left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-left",group:"left"},{id:"port-right",group:"right"}]}}),Z({shape:"alarm-light-3d-vue",width:100,height:120,component:Ff,ports:{groups:{bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-bottom",group:"bottom"}]}}),Z({shape:"temperature-sensor-3d-vue",width:100,height:140,component:a0,ports:{groups:{bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-bottom",group:"bottom"}]}}),Z({shape:"cylinder-3d-vue",width:80,height:160,component:N0,ports:{groups:{left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-left",group:"left"},{id:"port-right",group:"right"}]}}),Z({shape:"pipe-3d-vue",width:220,height:60,component:e1,ports:{groups:{left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-left",group:"left"},{id:"port-right",group:"right"}]}}),Z({shape:"filter-3d-vue",width:140,height:120,component:b1,ports:{groups:{left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-left",group:"left"},{id:"port-right",group:"right"}]}}),Z({shape:"heat-exchanger-3d-vue",width:160,height:140,component:W1,ports:{groups:{top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-top",group:"top"},{id:"port-bottom",group:"bottom"},{id:"port-left",group:"left"},{id:"port-right",group:"right"}]}}),Z({shape:"tee-3d-vue",width:120,height:120,component:mu,ports:{groups:{left:{position:"left",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},right:{position:"right",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},top:{position:"top",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}},bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-left",group:"left"},{id:"port-right",group:"right"},{id:"port-top",group:"top"},{id:"port-bottom",group:"bottom"}]}}),console.log("[Vue Shape] 所有3D仿真组件节点注册成功");const x=r.value.containerRef,$=y.size.width,S=y.size.height;if((L=>{x.style.width=`${$}px`,x.style.height=`${S}px`,x.style.transform=`scale(${L})`,x.style.transformOrigin="center center"})(y.zoom.scale),n=new Q.Graph({container:x,width:$,height:S,background:y.background.image?{color:y.background.color||"#1e293b",image:y.background.image,size:y.background.size||"cover",repeat:y.background.repeat||"no-repeat",position:"center"}:{color:y.background.color||"#1e293b"},grid:y.grid.enabled?{size:y.grid.size,visible:!0,type:y.grid.type||"dot",args:{color:y.grid.color||"#475569",thickness:1}}:!1,interacting:{nodeMovable:!s.previewMode},panning:{enabled:!0,modifiers:"shift"},mousewheel:{enabled:!0,modifiers:["ctrl","meta"]},connecting:{router:{name:"orth",args:{padding:10}},connector:{name:"rounded",args:{radius:8}},snap:y.magnetism.enabled?{radius:y.magnetism.threshold||10}:!1,allowBlank:!1,allowLoop:!1,allowNode:!1,allowEdge:!1,highlight:!0,createEdge(){return n.createEdge({shape:"animated-edge",zIndex:0})},validateConnection({targetMagnet:L}){return!!L}}}),s.previewMode||n.use(new qe.Selection({enabled:!0,movable:!0,rubberband:!0,showNodeSelectionBox:!1,showEdgeSelectionBox:!1,multiple:!0,pointerEvents:"none"})),y.guides.enabled&&n.use(new Dt.Snapline({enabled:!0,sharp:!0,clean:!0})),!s.previewMode){const L=kt(de.SCADA_EDITOR_DATA);if(((F=L==null?void 0:L.cells)==null?void 0:F.length)>0)try{const G=L.cells.map(q=>{var oe;return q.position&&typeof q.position=="object"&&(typeof q.position.x!="number"||typeof q.position.y!="number")&&(q.position={x:100,y:100}),(q.shape==="edge"||q.shape==="animated-edge")&&(q.router==="manhattan"||((oe=q.router)==null?void 0:oe.name)==="manhattan")&&(q.router={name:"orth",args:{padding:10}}),q});n.fromJSON({cells:G}),n.getEdges().forEach(q=>{var X;const oe=q.getData();(X=oe==null?void 0:oe.animation)!=null&&X.enabled&&b(q,oe.animation)})}catch(G){console.error("恢复画布数据失败,清空缓存:",G),sessionStorage.removeItem(de.SCADA_EDITOR_DATA)}}n.on("selection:changed",({selected:L})=>{var q,oe;const G=L?L.filter(X=>X.isNode()):[];if(c.value=G.length,L&&L.length>0){const X=L[0];if(X.isNode())p.value=X,d.value=null;else if(X.isEdge()){d.value=X,p.value=null;const pe=X.getAttrs();X.data={...X.data,originalAttrs:pe},X.attr("line/stroke","#3b82f6")}}else{if(d.value&&((q=d.value.data)!=null&&q.originalAttrs)){const X=d.value.data.originalAttrs;d.value.attr("line/stroke",((oe=X.line)==null?void 0:oe.stroke)||"#10b981")}p.value=null,d.value=null}}),n.on("edge:click",({edge:L})=>{n.select(L)}),n.on("blank:click",()=>{d.value=null,p.value=null}),n.on("node:change:position",()=>{}),n.on("node:change:size",()=>{}),n.on("node:change:data",({node:L})=>{const G=L.getData();if(G.animation)if(G.animation.enabled===!0){const q={type:G.animation.type||"none",duration:G.animation.duration||1e3,loop:G.animation.loop!==!1};ie.startAnimation(L,q)}else ie.stopAnimation(L.id)}),n.on("edge:change:data",({edge:L})=>{const G=L.getData();G!=null&&G.animation&&b(L,G.animation)});const J=L=>{if(L.key==="Delete"&&n){if(p.value){const G=p.value.id;ie.stopAnimation(G),n.removeNode(G),p.value=null}else if(d.value){const G=d.value.id;n.removeEdge(G),d.value=null}}};document.addEventListener("keydown",J),e.onUnmounted(()=>{document.removeEventListener("keydown",J)})}),e.onUnmounted(()=>{if(n){ie.clearAll();const y={cells:n.toJSON().cells};Oe(de.SCADA_EDITOR_DATA,y),n.dispose()}}),e.watch(()=>W.getConfig(),y=>{var $;if(!n)return;y.background.image?n.drawBackground({color:y.background.color||"#1e293b",image:y.background.image,size:y.background.size||"cover",repeat:y.background.repeat||"no-repeat",position:"center"}):n.drawBackground({color:y.background.color||"#1e293b"});const x=($=r.value)==null?void 0:$.containerRef;x&&(x.style.transform=`scale(${y.zoom.scale})`,x.style.transformOrigin="center center",n.resize(y.size.width,y.size.height),x.style.width=`${y.size.width}px`,x.style.height=`${y.size.height}px`),y.grid.enabled?(n.drawGrid({type:y.grid.type||"dot",args:{color:y.grid.color||"#475569",thickness:1}}),n.showGrid()):n.hideGrid(),y.grid.enabled&&y.grid.size&&n.setGridSize(y.grid.size),n.translate(y.offset.x,y.offset.y)},{deep:!0});const u=e.ref({}),g=(y,x)=>(u.value[y]||(u.value[y]=0),u.value[y]++,`${x}_${u.value[y]}`),m=y=>{var F,L,G,q;if(!n)return;const x=me.getComponent(y);if(!x){console.error(`未找到组件配置: ${y}`);return}const $=g(y,x.metadata.name),S={enabled:!1,type:"none",duration:1e3,loop:!0},j=xt(50,50,400,300),J={x:j.x,y:j.y,shape:x.shape,width:x.width,height:x.height,label:x.label,attrs:x.attrs,ports:x.ports,data:{...x.data,componentType:y,componentName:$,props:x.props,animation:S,originalStroke:((L=(F=x.attrs)==null?void 0:F.body)==null?void 0:L.stroke)||"#2563eb",originalStrokeWidth:((q=(G=x.attrs)==null?void 0:G.body)==null?void 0:q.strokeWidth)||2}},H=n.addNode(J);console.log("[Node] 添加节点:",x.shape,H.id,J),n.cleanSelection(),n.select(H)},k=y=>{if(p.value&&(y.attrs&&Object.keys(y.attrs).forEach(x=>{const $=y.attrs[x];typeof $=="object"?Object.keys($).forEach(S=>{p.value.attr(`${x}/${S}`,$[S])}):p.value.attr(x,$)}),y.position&&(typeof y.position.x=="number"&&typeof y.position.y=="number"?p.value.setPosition(y.position):console.error("position 数据格式错误:",y.position)),y.size&&(typeof y.size.width=="number"&&typeof y.size.height=="number"?p.value.setSize(y.size):console.error("size 数据格式错误:",y.size)),y.data)){const x={...y.data};delete x.position,delete x.size,p.value.setData(x)}},B=()=>{if(!p.value||!n)return;const y=p.value.id;ie.stopAnimation(y),n.removeNode(y),p.value=null},T=y=>{if(d.value){if(y.attrs){Object.keys(y.attrs).forEach($=>{const S=y.attrs[$];typeof S=="object"?Object.keys(S).forEach(j=>{var J,H;d.value.attr(`${$}/${j}`,S[j]),(H=(J=d.value.data)==null?void 0:J.originalAttrs)!=null&&H[$]&&(d.value.data.originalAttrs[$][j]=S[j])}):d.value.attr($,S)});const x=d.value.getAttrs();d.value.data={...d.value.data,originalAttrs:x},d.value.attr("line/stroke","#3b82f6")}y.router&&d.value.setRouter(y.router),y.connector&&d.value.setConnector(y.connector),y.animation&&b(d.value,y.animation),y.data&&d.value.setData({...d.value.data,...y.data})}},E=()=>{!d.value||!n||(n.removeEdge(d.value.id),d.value=null)},b=(y,x)=>{if(!y||typeof y.attr!="function"){console.warn("applyEdgeAnimation: edge 对象无效",y);return}if(!x||!x.enabled){y.attr("line/strokeDasharray",void 0),typeof y.removeAttr=="function"&&y.removeAttr("line/class"),y.attr("circle",void 0),typeof y.stopTransition=="function"&&y.stopTransition("attrs/circle/atConnectionRatio");return}const $=x.duration||2e3;y.attr("circle",{r:4,atConnectionRatio:0,fill:{type:"radialGradient",stops:[{offset:"0%",color:"#FFF"},{offset:"100%",color:y.attr("line/stroke")||"#10b981"}]},stroke:y.attr("line/stroke")||"#10b981",strokeWidth:1});const S=()=>{y.attr("circle/atConnectionRatio",0,{silent:!0}),y.transition("attrs/circle/atConnectionRatio",1,{delay:0,duration:$,timing:"linear",complete:()=>{S()}})};S()},h=()=>{n&&confirm("确定要清空画布吗?")&&(ie.clearAll(),n.clearCells(),p.value=null,Et(de.SCADA_EDITOR_DATA))},N=()=>{if(!n)return;const y=W.getConfig().zoom.scale,x=Math.min(5,y+.1);W.setZoom(x)},V=()=>{if(!n)return;const y=W.getConfig().zoom.scale,x=Math.max(.1,y-.1);W.setZoom(x)},z=()=>{if(!n)return;const y=n.getSelectedCells().filter($=>$.isNode());if(y.length<2){Y("请选择至少两个节点","warning");return}const x=Math.min(...y.map($=>$.getPosition().x));y.forEach($=>{$.setPosition({x,y:$.getPosition().y})})},R=()=>{if(!n)return;const y=n.getSelectedCells().filter(S=>S.isNode());if(y.length<2){Y("请选择至少两个节点","warning");return}const x=y.map(S=>S.getPosition().x+S.getSize().width/2),$=x.reduce((S,j)=>S+j,0)/x.length;y.forEach(S=>{const j=$-S.getSize().width/2;S.setPosition({x:j,y:S.getPosition().y})})},O=()=>{if(!n)return;const y=n.getSelectedCells().filter($=>$.isNode());if(y.length<2){Y("请选择至少两个节点","warning");return}const x=Math.max(...y.map($=>$.getPosition().x+$.getSize().width));y.forEach($=>{const S=x-$.getSize().width;$.setPosition({x:S,y:$.getPosition().y})})},_=()=>{if(!n)return;const y=n.getSelectedCells().filter($=>$.isNode());if(y.length<2){Y("请选择至少两个节点","warning");return}const x=Math.min(...y.map($=>$.getPosition().y));y.forEach($=>{$.setPosition({x:$.getPosition().x,y:x})})},v=()=>{if(!n)return;const y=n.getSelectedCells().filter(S=>S.isNode());if(y.length<2){Y("请选择至少两个节点","warning");return}const x=y.map(S=>S.getPosition().y+S.getSize().height/2),$=x.reduce((S,j)=>S+j,0)/x.length;y.forEach(S=>{const j=$-S.getSize().height/2;S.setPosition({x:S.getPosition().x,y:j})})},M=()=>{if(!n)return;const y=n.getSelectedCells().filter($=>$.isNode());if(y.length<2){Y("请选择至少两个节点","warning");return}const x=Math.max(...y.map($=>$.getPosition().y+$.getSize().height));y.forEach($=>{const S=x-$.getSize().height;$.setPosition({x:$.getPosition().x,y:S})})},K=()=>{if(!n)return;const y=n.getSelectedCells().filter(H=>H.isNode());if(y.length<3){Y("请选择至少三个节点","warning");return}const x=y.sort((H,F)=>H.getPosition().x-F.getPosition().x),$=x[0],J=(x[x.length-1].getPosition().x-$.getPosition().x)/(x.length-1);x.forEach((H,F)=>{if(F===0||F===x.length-1)return;const L=$.getPosition().x+J*F;H.setPosition({x:L,y:H.getPosition().y})})},le=()=>{if(!n)return;const y=n.getSelectedCells().filter(H=>H.isNode());if(y.length<3){Y("请选择至少三个节点","warning");return}const x=y.sort((H,F)=>H.getPosition().y-F.getPosition().y),$=x[0],J=(x[x.length-1].getPosition().y-$.getPosition().y)/(x.length-1);x.forEach((H,F)=>{if(F===0||F===x.length-1)return;const L=$.getPosition().y+J*F;H.setPosition({x:H.getPosition().x,y:L})})},ce=async()=>{if(!n){Y("画布未初始化","error");return}try{if(console.log("[ScadaCanvas] handleSave 被调用"),console.log("[ScadaCanvas] props.onSave:",s.onSave),s.onSave){console.log("[ScadaCanvas] 调用自定义 onSave 回调"),await s.onSave(),console.log("[ScadaCanvas] 自定义 onSave 回调执行完成");return}console.log("[ScadaCanvas] 没有自定义回调,执行默认下载");const y={version:"1.0.0",timestamp:new Date().toISOString(),config:{size:W.getConfig().size,background:W.getConfig().background,grid:W.getConfig().grid,guides:W.getConfig().guides,magnetism:W.getConfig().magnetism,zoom:W.getConfig().zoom},cells:n.toJSON().cells},x=new Blob([JSON.stringify(y,null,2)],{type:"application/json"}),$=URL.createObjectURL(x),S=document.createElement("a"),j=`scada-canvas-${new Date().getTime()}.json`;S.href=$,S.download=j,S.click(),URL.revokeObjectURL($),Y("保存成功","success")}catch(y){console.error("保存失败",y),Y("保存失败,请查看控制台","error")}},Ee=()=>{f.value&&f.value.click()},ae=y=>{var j;const $=(j=y.target.files)==null?void 0:j[0];if(!$){Y("请选择文件","error");return}const S=new FileReader;S.onload=J=>{var H;try{const F=JSON.parse((H=J.target)==null?void 0:H.result);if(!F.cells){Y("无效的JSON文件格式","error");return}if(!confirm("导入将清空当前画布,是否继续?"))return;if(n){if(n.clearCells(),n.fromJSON({cells:F.cells}),n.getEdges().forEach(L=>{var q;const G=L.getData();(q=G==null?void 0:G.animation)!=null&&q.enabled&&b(L,G.animation)}),F.config&&W.updateConfig(F.config),F.workflows&&Array.isArray(F.workflows)&&F.workflows.length>0)try{const L=localStorage.getItem("saved-workflows"),G=L?JSON.parse(L):[];let q=0,oe=0;F.workflows.forEach(X=>{const pe=G.findIndex(ye=>ye.id===X.id);pe>=0?(G[pe]={...X,updatedAt:Date.now()},oe++):(G.push(X),q++)}),localStorage.setItem("saved-workflows",JSON.stringify(G)),Y(`导入成功 画布已加载,流程: 新增${q}个,更新${oe}个`,"success")}catch(L){console.error("导入流程数据失败:",L),Y("画布导入成功, 但流程数据导入失败","warning")}else Y("导入成功","success");f.value&&(f.value.value="")}}catch(F){console.error("导入失败",F),Y("导入失败,JSON格式错误","error"),f.value&&(f.value.value="")}},S.readAsText($)},Ne=()=>{if(console.log("🎬 [ScadaCanvas] handlePreview 被调用"),!n){console.error("⚠️ [ScadaCanvas] graph 不存在");return}const y={cells:n.toJSON().cells,config:{width:W.getConfig().size.width,height:W.getConfig().size.height,background:W.getConfig().background,grid:W.getConfig().grid}};Oe(de.SCADA_PREVIEW_DATA,y),console.log("✅ [ScadaCanvas] 数据已保存到 sessionStorage"),console.log("📤 [ScadaCanvas] 即将触发 preview 事件"),t("preview"),console.log("✅ [ScadaCanvas] preview 事件已触发")},Ve=()=>{a.value=!0},xe=()=>{if(!n){Y("画布未初始化","error");return}try{const y={version:"1.0.0",timestamp:Re(Ue()),config:{size:W.getConfig().size,background:W.getConfig().background,grid:W.getConfig().grid,guides:W.getConfig().guides,magnetism:W.getConfig().magnetism,zoom:W.getConfig().zoom},cells:n.toJSON().cells,nodes:n.getNodes().map(S=>({id:S.id,type:S.shape,position:S.getPosition(),size:S.getSize(),label:S.attr("label/text"),data:S.getData()})),edges:n.getEdges().map(S=>({id:S.id,source:S.getSourceCellId(),target:S.getTargetCellId()})),workflows:[]},x=new Set;if(n.getNodes().forEach(S=>{const j=S.getData();j!=null&&j.events&&Array.isArray(j.events)&&j.events.forEach(J=>{var H;J.action==="callProcess"&&((H=J.params)!=null&&H.processId)&&x.add(J.params.processId)})}),x.size>0)try{const S=localStorage.getItem("saved-workflows");if(S){const j=JSON.parse(S);y.workflows=j.filter(J=>x.has(J.id))}}catch(S){console.error("加载流程数据失败:",S)}const $=Nt(y,"scada-export");Y(`已导出为 ${$}`,"success")}catch(y){console.error("导出失败",y),Y("导出失败,请查看控制台","error")}};return l({save:ce,import:Ee,export:xe,preview:Ne,workflow:Ve,zoomIn:N,zoomOut:V,clearAll:h,alignLeft:z,alignCenter:R,alignRight:O,alignTop:_,alignMiddle:v,alignBottom:M,distributeHorizontal:K,distributeVertical:le,addNode:m,updateNode:k,deleteNode:B,getSelectedNode:()=>p.value,selectNode:y=>{if(!n)return!1;const x=n.getCellById(y);return x?(n.select(x),!0):!1},clearSelection:()=>{n&&(n.unselect(n.getSelectedCells()),p.value=null)},getGraph:()=>n,getCanvasData:()=>n?{version:"1.0.0",timestamp:Re(Ue()),config:W.getConfig(),cells:n.toJSON().cells,nodes:n.getNodes().map(y=>({id:y.id,type:y.shape,position:y.getPosition(),size:y.getSize(),label:y.attr("label/text"),data:y.getData()})),edges:n.getEdges().map(y=>({id:y.id,source:y.getSourceCellId(),target:y.getTargetCellId()}))}:null,loadCanvasData:y=>{if(!n)return!1;try{return n.clearCells(),n.fromJSON({cells:y.cells}),y.config&&W.updateConfig(y.config),n.getEdges().forEach(x=>{var S;const $=x.getData();(S=$==null?void 0:$.animation)!=null&&S.enabled&&b(x,$.animation)}),!0}catch(x){return console.error("加载画布数据失败:",x),!1}},getAllNodes:()=>n?n.getNodes().map(y=>({id:y.id,type:y.shape,position:y.getPosition(),size:y.getSize(),label:y.attr("label/text"),data:y.getData()})):[],getNodeById:y=>{if(!n)return null;const x=n.getCellById(y);if(!x||!x.isNode())return null;const $=x;return{id:$.id,type:$.shape,position:$.getPosition(),size:$.getSize(),label:$.attr("label/text"),data:$.getData()}},getConfigManager:()=>W,updateCanvasConfig:y=>{W.updateConfig(y)},setZoom:y=>{W.setZoom(y)},setCanvasSize:(y,x)=>{W.updateSize({width:y,height:x})},setBackgroundColor:y=>{W.updateBackground({color:y})},getAnimationEngine:()=>ie}),(y,x)=>(e.openBlock(),e.createElementBlock("div",uu,[s.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(_e,{key:0,"selected-nodes-count":c.value,onSave:ce,onImport:Ee,onWorkflow:Ve,onPreview:Ne,onExport:xe,onZoomIn:N,onZoomOut:V,onClearAll:h,onAlignLeft:z,onAlignCenter:R,onAlignRight:O,onAlignTop:_,onAlignMiddle:v,onAlignBottom:M,onDistributeHorizontal:K,onDistributeVertical:le},null,8,["selected-nodes-count"])),s.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("input",{key:1,ref_key:"fileInputRef",ref:f,type:"file",accept:".json",style:{display:"none"},onChange:ae},null,544)),e.createElementVNode("div",gu,[s.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Se,{key:0,onAddComponent:m})),e.createVNode(Bo,{ref_key:"canvasAreaRef",ref:r},null,512),s.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(We,{key:1,ref:"propertyPanelRef","selected-node":p.value,"selected-edge":d.value,onUpdateNode:k,onDeleteNode:B,onUpdateEdge:T,onDeleteEdge:E},null,8,["selected-node","selected-edge"]))]),e.createVNode(wd,{"auth-code":i.authCode,"custom-footer":i.customFooter},null,8,["auth-code","custom-footer"]),s.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(dp,{key:2,visible:a.value,"onUpdate:visible":x[0]||(x[0]=$=>a.value=$),"scada-graph":e.unref(n),onClose:x[1]||(x[1]=$=>a.value=!1)},null,8,["visible","scada-graph"]))]))}}),[["__scopeId","data-v-cc662d3b"]]),hu={ScadaCanvas:_t,PropertyPanel:We,Header:_e,ComponentLibrary:Se,CanvasConfigPanel:De,BindingCard:Me,EventCard:Te,BasicPropertiesTab:Ie,AttributeConfigDialog:Ae,CustomCodeDialog:Pe},vt=i=>{Object.entries(hu).forEach(([l,o])=>{i.component(l,o)})},yu={install:vt,version:"1.0.0"};I.AttributeConfigDialog=Ae,I.BasicComponents=so,I.BasicPropertiesTab=Ie,I.BindingCard=Me,I.CanvasConfigPanel=De,I.ComponentLibrary=Se,I.CustomCodeDialog=Pe,I.EventCard=Te,I.Header=_e,I.IoTComponents=mo,I.PropertyPanel=We,I.STORAGE_KEYS=de,I.ScadaCanvas=_t,I.animationEngine=ie,I.canvasConfigItems=uo,I.canvasConfigManager=W,I.componentRegistry=me,I.default=yu,I.defaultCanvasConfig=Be,I.exportToJSON=Nt,I.formatTimestamp=Re,I.generateEventId=Vt,I.generateNodeId=Gs,I.generateUniqueId=Le,I.getCurrentTimestamp=Ue,I.install=vt,I.loadFromLocal=Ws,I.loadFromSession=kt,I.randomPosition=xt,I.removeFromLocal=Fs,I.removeFromSession=Et,I.saveToLocal=Us,I.saveToSession=Oe,I.showMessage=Y,I.sizePresetMap=fe,Object.defineProperties(I,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|