@nywqs/scada-engine 1.1.19 → 1.1.21

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.
@@ -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"),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
1
+ (function(D,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):(D=typeof globalThis<"u"?globalThis:D||self,e(D.ScadaEngine={},D.Vue,D.X6,D.X6PluginSelection,D.X6PluginSnapline,D.echarts))})(this,function(D,e,te,qe,Dt,It){"use strict";var vu=Object.defineProperty;var Bu=(D,e,te)=>e in D?vu(D,e,{enumerable:!0,configurable:!0,writable:!0,value:te}):D[e]=te;var ke=(D,e,te)=>Bu(D,typeof e!="symbol"?e+"":e,te);/*!
2
+ * @nywqs/scada-engine v1.1.21
3
3
  * Copyright (c) 2025 leoncheng
4
4
  * Licensed under proprietary license - see LICENSE file
5
5
  * Contact: nywqs@outlook.com
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="&gt;" data-v-af7c633a>大于</option><option value="&gt;=" data-v-af7c633a>大于等于</option><option value="&lt;" data-v-af7c633a>小于</option><option value="&lt;=" 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) {
6
+ */function Tt(s){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const o in s)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(s,o);Object.defineProperty(l,o,i.get?i:{enumerable:!0,get:()=>s[o]})}}return l.default=s,Object.freeze(l)}const Je=Tt(It);class Ye extends te.Node{}(function(s){function l(o){const i=[],t=te.Markup.getForeignObjectMarkup();return o?i.push({tagName:o,selector:"body"},t):i.push(t),i}s.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 i=o.primer;if(i){o.markup=l(i);let t={};switch(i){case"circle":t={refCx:"50%",refCy:"50%",refR:"50%"};break;case"ellipse":t={refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"};break}o.attrs=te.ObjectExt.merge({},{body:Object.assign({refWidth:null,refHeight:null},t)},o.attrs||{})}}return o}}),te.Node.registry.register("vue-shape",s,!0)})(Ye||(Ye={}));var zt=function(s,l){var o={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&l.indexOf(i)<0&&(o[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,i=Object.getOwnPropertySymbols(s);t<i.length;t++)l.indexOf(i[t])<0&&Object.prototype.propertyIsEnumerable.call(s,i[t])&&(o[i[t]]=s[i[t]]);return o};const Xe={};function ne(s){const{shape:l,component:o,inherit:i}=s,t=zt(s,["shape","component","inherit"]);if(!l)throw new Error("should specify shape in config");Xe[l]={component:o},te.Graph.registerNode(l,Object.assign({inherit:i||"vue-shape"},t),!0)}e.reactive({});class Ee extends te.NodeView{getComponentContainer(){return this.selectors&&this.selectors.foContent}confirmUpdate(l){const o=super.confirmUpdate(l);return this.handleAction(o,Ee.action,()=>{this.renderVueComponent()})}targetId(){return`${this.graph.view.cid}:${this.cell.id}`}renderVueComponent(){this.unmountVueComponent();const l=this.getComponentContainer(),o=this.cell,i=this.graph;if(l){const{component:t}=Xe[o.shape];t&&(this.vm=e.createApp({render(){return e.h(t,{node:o,graph:i})},provide(){return{getNode:()=>o,getGraph:()=>i}}}),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,i){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,i)}unmount(){return this.unmountVueComponent(),super.unmount(),this}}(function(s){s.action="vue",s.config({bootstrap:[s.action],actions:{component:s.action}}),te.NodeView.registry.register("vue-shape-view",s,!0)})(Ee||(Ee={}));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(s,{emit:l}){const o=s,i=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=>i("zoomIn")),title:"放大"},[...r[18]||(r[18]=[e.createElementVNode("span",{class:"icon"},"+",-1)])]),e.createElementVNode("button",{class:"toolbar-btn",onClick:r[1]||(r[1]=p=>i("zoomOut")),title:"缩小"},[...r[19]||(r[19]=[e.createElementVNode("span",{class:"icon"},"-",-1)])]),e.createElementVNode("button",{class:"toolbar-btn",onClick:r[2]||(r[2]=p=>i("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=>i("alignLeft")),title:"左对齐"},[e.createVNode(e.unref(Ot),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:r[4]||(r[4]=p=>i("alignCenter")),title:"水平居中"},[e.createVNode(e.unref(At),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:r[5]||(r[5]=p=>i("alignRight")),title:"右对齐"},[e.createVNode(e.unref(Rt),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:r[6]||(r[6]=p=>i("alignTop")),title:"顶部对齐"},[e.createVNode(e.unref(Ht),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:r[7]||(r[7]=p=>i("alignMiddle")),title:"垂直居中"},[e.createVNode(e.unref(Gt),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:r[8]||(r[8]=p=>i("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=>i("distributeHorizontal")),title:"横向分布"},[e.createVNode(e.unref(Jt),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:r[10]||(r[10]=p=>i("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=>i("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=>i("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=>i("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=>i("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=>i("save")),title:"保存"},[...r[25]||(r[25]=[e.createElementVNode("span",{class:"icon"},"💾",-1),e.createElementVNode("span",null,"保存",-1)])])])])]))}}),O=(s,l)=>{const o=s.__vccOpts||s;for(const[i,t]of l)o[i]=t;return o},Ce=O(io,[["__scopeId","data-v-9bbedc41"]]),_e=[{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:"矩形透明度"},..._e]},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:"圆形透明度"},..._e]},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:"边框颜色"},..._e]},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(s){return ot.find(l=>l.id===s)}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(s=>({label:s.name,value:s.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(s){return nt.find(l=>l.id===s)}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(s=>({label:s.name,value:s.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(){ke(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 he=new fo,ve={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:"启用吸附功能"}],ye={"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(){ke(this,"config");this.config=e.reactive({...ve})}getConfig(){return this.config}updateConfig(l){Object.assign(this.config,l)}updateByPath(l,o){const i=l.split(".");let t=this.config;for(let r=0;r<i.length-1;r++)t=t[i[r]];if(t[i[i.length-1]]=o,l==="size.preset"&&o in ye){const{width:r,height:p}=ye[o];this.config.size.width=r,this.config.size.height=p}}getByPath(l){const o=l.split(".");let i=this.config;for(const t of o)i=i==null?void 0:i[t];return i}setSize(l,o,i){this.config.size.width=l,this.config.size.height=o,i&&(this.config.size.preset=i)}updateSize(l){this.config.size.width=l.width,this.config.size.height=l.height}setZoom(l){const{min:o=.1,max:i=5}=this.config.zoom;this.config.zoom.scale=Math.max(o,Math.min(i,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,ve)}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"},Be=O(e.defineComponent({__name:"ComponentLibrary",emits:["addComponent"],setup(s,{emit:l}){const o=l,i=e.reactive({basic:!1,iot:!1}),t=c=>{i[c]=!i[c]},r=e.computed(()=>he.getComponentsByCategory("basic")),p=e.computed(()=>he.getComponentsByCategory("iot")),d=c=>{o("addComponent",c.metadata.id)};return(c,f)=>(e.openBlock(),e.createElementBlock("aside",ho,[f[4]||(f[4]=e.createElementVNode("div",{class:"library-header"},[e.createElementVNode("h3",null,"组件库")],-1)),e.createElementVNode("div",yo,[r.value.length>0?(e.openBlock(),e.createElementBlock("div",bo,[e.createElementVNode("div",{class:"section-header",onClick:f[0]||(f[0]=m=>t("basic"))},[f[2]||(f[2]=e.createElementVNode("h4",{class:"section-title"},"基础组件",-1)),e.createElementVNode("span",{class:e.normalizeClass(["toggle-icon",{collapsed:i.basic}])},"▼",2)]),e.withDirectives(e.createElementVNode("div",ko,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,m=>(e.openBlock(),e.createElementBlock("div",{key:m.metadata.id,class:"component-item",onClick:n=>d(m),title:m.metadata.description||m.metadata.name},[e.createElementVNode("span",No,e.toDisplayString(m.metadata.icon),1),e.createElementVNode("span",Vo,e.toDisplayString(m.metadata.name),1)],8,Eo))),128))],512),[[e.vShow,!i.basic]])])):e.createCommentVNode("",!0),p.value.length>0?(e.openBlock(),e.createElementBlock("div",xo,[e.createElementVNode("div",{class:"section-header",onClick:f[1]||(f[1]=m=>t("iot"))},[f[3]||(f[3]=e.createElementVNode("h4",{class:"section-title"},"IoT组件",-1)),e.createElementVNode("span",{class:e.normalizeClass(["toggle-icon",{collapsed:i.iot}])},"▼",2)]),e.withDirectives(e.createElementVNode("div",wo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,m=>(e.openBlock(),e.createElementBlock("div",{key:m.metadata.id,class:"component-item",onClick:n=>d(m),title:m.metadata.description||m.metadata.name},[e.createElementVNode("span",Co,e.toDisplayString(m.metadata.icon),1),e.createElementVNode("span",_o,e.toDisplayString(m.metadata.name),1)],8,$o))),128))],512),[[e.vShow,!i.iot]])])):e.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-7e281fd3"]]),vo={class:"canvas-area"},Bo=O(e.defineComponent({__name:"CanvasArea",setup(s,{expose:l}){const o=e.ref();return l({containerRef:o}),(i,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={key:0,class:"config-item"},Mo={class:"number-input-group"},Ao={key:1,class:"config-item"},Po={class:"number-input-group"},Oo={class:"config-section"},Lo={class:"config-item"},Ro={class:"slider-group"},Uo={class:"value-display"},Wo={class:"config-item"},Fo={class:"number-input-group"},Go={class:"config-item"},jo={class:"number-input-group"},Ho={class:"config-section"},qo={class:"config-item"},Jo={class:"config-item"},Yo={class:"image-upload"},Xo={class:"config-item"},Ko={class:"config-item"},Qo={class:"config-section"},Zo={class:"config-item"},el={class:"switch"},tl={class:"config-item"},ol={class:"switch"},ll={class:"config-item"},nl={class:"switch"},al={key:0,class:"config-item"},rl={class:"number-input-group"},Se=O(e.defineComponent({__name:"CanvasConfigPanel",setup(s){const l=e.computed(()=>W.getConfig()),o=e.ref(),i=e.ref(l.value.size.width),t=e.ref(l.value.size.height),r=()=>{const u=l.value.size.preset;if(u==="custom")i.value=l.value.size.width,t.value=l.value.size.height;else if(u&&u in ye){const{width:a,height:y}=ye[u];W.setSize(a,y,u)}},p=()=>{l.value.size.preset==="custom"&&W.setSize(i.value,t.value,"custom")},d=(u,a)=>{u==="width"?i.value=Math.max(800,Math.min(7680,i.value+a)):t.value=Math.max(600,Math.min(4320,t.value+a)),p()},c=(u,a)=>{const y=l.value.offset[u];W.setOffset(u==="x"?y+a:l.value.offset.x,u==="y"?y+a:l.value.offset.y)},f=u=>{const a=Math.max(5,Math.min(50,l.value.grid.size+u));W.setGridSize(a)},m=()=>{var u;(u=o.value)==null||u.click()},n=u=>{var S;const y=(S=u.target.files)==null?void 0:S[0];if(y){const T=new FileReader;T.onload=E=>{var h;const k=(h=E.target)==null?void 0:h.result;W.updateByPath("background.image",k)},T.readAsDataURL(y)}},g=()=>{W.updateByPath("background.image",""),o.value&&(o.value.value="")};return(u,a)=>(e.openBlock(),e.createElementBlock("div",So,[a[48]||(a[48]=e.createElementVNode("div",{class:"panel-header"},[e.createElementVNode("h3",null,"画布配置")],-1)),e.createElementVNode("div",Do,[e.createElementVNode("div",Io,[a[27]||(a[27]=e.createElementVNode("h4",{class:"section-title"},"基础配置",-1)),e.createElementVNode("div",To,[a[24]||(a[24]=e.createElementVNode("label",null,"画布尺寸",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":a[0]||(a[0]=y=>l.value.size.preset=y),onChange:r,class:"config-select"},[...a[23]||(a[23]=[e.createStaticVNode('<option value="1920*1080" data-v-be44eb59>1920*1080</option><option value="1366*768" data-v-be44eb59>1366*768</option><option value="1280*720" data-v-be44eb59>1280*720</option><option value="800*600" data-v-be44eb59>800*600</option><option value="custom" data-v-be44eb59>自定义</option>',5)])],544),[[e.vModelSelect,l.value.size.preset]])]),l.value.size.preset==="custom"?(e.openBlock(),e.createElementBlock("div",zo,[a[25]||(a[25]=e.createElementVNode("label",null,"宽度",-1)),e.createElementVNode("div",Mo,[e.createElementVNode("button",{onClick:a[1]||(a[1]=y=>d("width",-100)),class:"adjust-btn"},"-"),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":a[2]||(a[2]=y=>i.value=y),onChange:p,min:800,max:7680,class:"config-number"},null,544),[[e.vModelText,i.value,void 0,{number:!0}]]),e.createElementVNode("button",{onClick:a[3]||(a[3]=y=>d("width",100)),class:"adjust-btn"},"+")])])):e.createCommentVNode("",!0),l.value.size.preset==="custom"?(e.openBlock(),e.createElementBlock("div",Ao,[a[26]||(a[26]=e.createElementVNode("label",null,"高度",-1)),e.createElementVNode("div",Po,[e.createElementVNode("button",{onClick:a[4]||(a[4]=y=>d("height",-100)),class:"adjust-btn"},"-"),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":a[5]||(a[5]=y=>t.value=y),onChange:p,min:600,max:4320,class:"config-number"},null,544),[[e.vModelText,t.value,void 0,{number:!0}]]),e.createElementVNode("button",{onClick:a[6]||(a[6]=y=>d("height",100)),class:"adjust-btn"},"+")])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Oo,[a[31]||(a[31]=e.createElementVNode("h4",{class:"section-title"},"变换",-1)),e.createElementVNode("div",Lo,[a[28]||(a[28]=e.createElementVNode("label",null,"缩放倍数",-1)),e.createElementVNode("div",Ro,[e.withDirectives(e.createElementVNode("input",{type:"range","onUpdate:modelValue":a[7]||(a[7]=y=>l.value.zoom.scale=y),min:.1,max:5,step:.1,class:"config-slider"},null,512),[[e.vModelText,l.value.zoom.scale,void 0,{number:!0}]]),e.createElementVNode("span",Uo,e.toDisplayString(l.value.zoom.scale.toFixed(1)),1)])]),e.createElementVNode("div",Wo,[a[29]||(a[29]=e.createElementVNode("label",null,"画布X轴偏移",-1)),e.createElementVNode("div",Fo,[e.createElementVNode("button",{onClick:a[8]||(a[8]=y=>c("x",-10)),class:"adjust-btn"},"-"),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":a[9]||(a[9]=y=>l.value.offset.x=y),class:"config-number"},null,512),[[e.vModelText,l.value.offset.x,void 0,{number:!0}]]),e.createElementVNode("button",{onClick:a[10]||(a[10]=y=>c("x",10)),class:"adjust-btn"},"+")])]),e.createElementVNode("div",Go,[a[30]||(a[30]=e.createElementVNode("label",null,"画布Y轴偏移",-1)),e.createElementVNode("div",jo,[e.createElementVNode("button",{onClick:a[11]||(a[11]=y=>c("y",-10)),class:"adjust-btn"},"-"),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":a[12]||(a[12]=y=>l.value.offset.y=y),class:"config-number"},null,512),[[e.vModelText,l.value.offset.y,void 0,{number:!0}]]),e.createElementVNode("button",{onClick:a[13]||(a[13]=y=>c("y",10)),class:"adjust-btn"},"+")])])]),e.createElementVNode("div",Ho,[a[39]||(a[39]=e.createElementVNode("h4",{class:"section-title"},"背景",-1)),e.createElementVNode("div",qo,[a[32]||(a[32]=e.createElementVNode("label",null,"背景颜色",-1)),e.withDirectives(e.createElementVNode("input",{type:"color","onUpdate:modelValue":a[14]||(a[14]=y=>l.value.background.color=y),class:"config-color"},null,512),[[e.vModelText,l.value.background.color]])]),e.createElementVNode("div",Jo,[a[34]||(a[34]=e.createElementVNode("label",null,"背景图片",-1)),e.createElementVNode("div",Yo,[e.createElementVNode("input",{type:"file",accept:"image/*",onChange:n,ref_key:"fileInput",ref:o,style:{display:"none"}},null,544),e.createElementVNode("button",{onClick:m,class:"upload-btn"},[...a[33]||(a[33]=[e.createElementVNode("span",null,"📄",-1)])]),l.value.background.image?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:g,class:"clear-btn",title:"清除背景图"}," ✕ ")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Xo,[a[36]||(a[36]=e.createElementVNode("label",null,"背景大小",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":a[15]||(a[15]=y=>l.value.background.size=y),class:"config-select"},[...a[35]||(a[35]=[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[38]||(a[38]=e.createElementVNode("label",null,"图像重复",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":a[16]||(a[16]=y=>l.value.background.repeat=y),class:"config-select"},[...a[37]||(a[37]=[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",Qo,[a[47]||(a[47]=e.createElementVNode("h4",{class:"section-title"},"辅助",-1)),e.createElementVNode("div",Zo,[a[41]||(a[41]=e.createElementVNode("label",null,"吸附",-1)),e.createElementVNode("label",el,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":a[17]||(a[17]=y=>l.value.magnetism.enabled=y)},null,512),[[e.vModelCheckbox,l.value.magnetism.enabled]]),a[40]||(a[40]=e.createElementVNode("span",{class:"slider"},null,-1))])]),e.createElementVNode("div",tl,[a[43]||(a[43]=e.createElementVNode("label",null,"网格",-1)),e.createElementVNode("label",ol,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":a[18]||(a[18]=y=>l.value.grid.enabled=y)},null,512),[[e.vModelCheckbox,l.value.grid.enabled]]),a[42]||(a[42]=e.createElementVNode("span",{class:"slider"},null,-1))])]),e.createElementVNode("div",ll,[a[45]||(a[45]=e.createElementVNode("label",null,"网格对齐",-1)),e.createElementVNode("label",nl,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":a[19]||(a[19]=y=>l.value.snap.enabled=y)},null,512),[[e.vModelCheckbox,l.value.snap.enabled]]),a[44]||(a[44]=e.createElementVNode("span",{class:"slider"},null,-1))])]),l.value.grid.enabled?(e.openBlock(),e.createElementBlock("div",al,[a[46]||(a[46]=e.createElementVNode("label",null,"网格大小",-1)),e.createElementVNode("div",rl,[e.createElementVNode("button",{onClick:a[20]||(a[20]=y=>f(-5)),class:"adjust-btn"},"-"),e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":a[21]||(a[21]=y=>l.value.grid.size=y),min:5,max:50,class:"config-number"},null,512),[[e.vModelText,l.value.grid.size,void 0,{number:!0}]]),e.createElementVNode("button",{onClick:a[22]||(a[22]=y=>f(5)),class:"adjust-btn"},"+")])])):e.createCommentVNode("",!0)])])]))}}),[["__scopeId","data-v-be44eb59"]]),il={class:"tab-pane"},sl={class:"property-section"},dl={class:"property-item-inline"},cl=["value"],pl={class:"property-item-inline"},ml=["value"],fl={class:"property-item-inline"},ul=["value"],gl={class:"property-section"},hl={class:"property-row"},yl={class:"property-item"},bl=["value"],kl={class:"property-item"},El=["value"],Nl={class:"property-row"},Vl={class:"property-item"},xl=["value"],wl={class:"property-item"},$l=["value"],Cl={class:"property-section"},_l={class:"property-item-inline"},vl=["value"],Bl={class:"property-item-inline"},Sl={class:"color-input-wrapper"},Dl=["value"],Il={class:"color-value"},Tl={class:"property-item-inline"},zl={class:"color-input-wrapper"},Ml=["value"],Al={class:"color-value"},Pl={class:"property-item-inline"},Ol=["value"],Ll={class:"property-item-inline"},Rl=["value"],Ul={key:0,class:"property-section"},Wl={key:0,class:"property-hint"},Fl=["value","onInput","placeholder"],Gl=["value","onInput","min","max","step"],jl={key:2,class:"color-input-wrapper"},Hl=["value","onInput"],ql={class:"color-value"},Jl={key:3,class:"checkbox-wrapper"},Yl=["checked","onChange"],Xl={class:"checkbox-label"},Kl=["value","onChange"],Ql=["value"],De=O(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(s,{emit:l}){const o=s,i=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(m=>!d.includes(m.key))}),r=d=>{if(!d.path)return d.defaultValue;const c=d.path.split(".");let f=o.selectedNode;for(const m of c)if(f&&typeof f=="object")f=f[m];else return d.defaultValue;return f!==void 0?f:d.defaultValue},p=(d,c)=>{var n;const f=c.target;let m;if(d.type==="number")m=Number(f.value);else if(d.type==="boolean")m=f.checked;else if(d.type==="select"){const g=(n=d.options)==null?void 0:n.find(u=>String(u.value)===f.value);m=g?g.value:f.value}else m=f.value;i("update-dynamic-prop",d.path,m)};return(d,c)=>{var f,m,n,g,u,a,y,S,T,E,k,h,N,V,z,F,U;return e.openBlock(),e.createElementBlock("div",il,[e.createElementVNode("div",sl,[c[13]||(c[13]=e.createElementVNode("h4",null,"基础信息",-1)),e.createElementVNode("div",dl,[c[10]||(c[10]=e.createElementVNode("label",null,"组件名称",-1)),e.createElementVNode("input",{type:"text",value:((f=s.selectedNode.getData())==null?void 0:f.componentName)||"",onInput:c[0]||(c[0]=_=>d.$emit("update-component-name",_)),placeholder:"请输入组件名称"},null,40,cl)]),e.createElementVNode("div",pl,[c[11]||(c[11]=e.createElementVNode("label",null,"ID",-1)),e.createElementVNode("input",{type:"text",value:s.selectedNode.id,disabled:""},null,8,ml)]),e.createElementVNode("div",fl,[c[12]||(c[12]=e.createElementVNode("label",null,"类型",-1)),e.createElementVNode("input",{type:"text",value:s.selectedNode.shape,disabled:""},null,8,ul)])]),e.createElementVNode("div",gl,[c[18]||(c[18]=e.createElementVNode("h4",null,"位置和尺寸",-1)),e.createElementVNode("div",hl,[e.createElementVNode("div",yl,[c[14]||(c[14]=e.createElementVNode("label",null,"X",-1)),e.createElementVNode("input",{type:"number",value:s.nodePosition.x,onInput:c[1]||(c[1]=_=>d.$emit("update-position","x",_))},null,40,bl)]),e.createElementVNode("div",kl,[c[15]||(c[15]=e.createElementVNode("label",null,"Y",-1)),e.createElementVNode("input",{type:"number",value:s.nodePosition.y,onInput:c[2]||(c[2]=_=>d.$emit("update-position","y",_))},null,40,El)])]),e.createElementVNode("div",Nl,[e.createElementVNode("div",Vl,[c[16]||(c[16]=e.createElementVNode("label",null,"宽度",-1)),e.createElementVNode("input",{type:"number",value:s.nodeSize.width,onInput:c[3]||(c[3]=_=>d.$emit("update-size","width",_))},null,40,xl)]),e.createElementVNode("div",wl,[c[17]||(c[17]=e.createElementVNode("label",null,"高度",-1)),e.createElementVNode("input",{type:"number",value:s.nodeSize.height,onInput:c[4]||(c[4]=_=>d.$emit("update-size","height",_))},null,40,$l)])])]),e.createElementVNode("div",Cl,[c[24]||(c[24]=e.createElementVNode("h4",null,"样式",-1)),e.createElementVNode("div",_l,[c[19]||(c[19]=e.createElementVNode("label",null,"初始文本",-1)),e.createElementVNode("input",{type:"text",value:((n=(m=s.nodeAttrs)==null?void 0:m.text)==null?void 0:n.text)||((u=(g=s.nodeAttrs)==null?void 0:g.label)==null?void 0:u.text)||s.selectedNode.getProp("label")||"",onInput:c[5]||(c[5]=_=>d.$emit("update-label",_)),placeholder:"设置默认显示文本"},null,40,vl)]),e.createElementVNode("div",Bl,[c[20]||(c[20]=e.createElementVNode("label",null,"填充颜色",-1)),e.createElementVNode("div",Sl,[e.createElementVNode("input",{type:"color",value:((y=(a=s.nodeAttrs)==null?void 0:a.body)==null?void 0:y.fill)||"#3b82f6",onInput:c[6]||(c[6]=_=>d.$emit("update-fill",_))},null,40,Dl),e.createElementVNode("span",Il,e.toDisplayString(((T=(S=s.nodeAttrs)==null?void 0:S.body)==null?void 0:T.fill)||"#3b82f6"),1)])]),e.createElementVNode("div",Tl,[c[21]||(c[21]=e.createElementVNode("label",null,"边框颜色",-1)),e.createElementVNode("div",zl,[e.createElementVNode("input",{type:"color",value:((k=(E=s.nodeAttrs)==null?void 0:E.body)==null?void 0:k.stroke)||"#2563eb",onInput:c[7]||(c[7]=_=>d.$emit("update-stroke",_))},null,40,Ml),e.createElementVNode("span",Al,e.toDisplayString(((N=(h=s.nodeAttrs)==null?void 0:h.body)==null?void 0:N.stroke)||"#2563eb"),1)])]),e.createElementVNode("div",Pl,[c[22]||(c[22]=e.createElementVNode("label",null,"边框宽度",-1)),e.createElementVNode("input",{type:"number",min:"0",max:"10",value:((z=(V=s.nodeAttrs)==null?void 0:V.body)==null?void 0:z.strokeWidth)||2,onInput:c[8]||(c[8]=_=>d.$emit("update-stroke-width",_))},null,40,Ol)]),e.createElementVNode("div",Ll,[c[23]||(c[23]=e.createElementVNode("label",null,"透明度",-1)),e.createElementVNode("input",{type:"number",min:"0",max:"1",step:"0.1",value:((U=(F=s.nodeAttrs)==null?void 0:F.body)==null?void 0:U.opacity)!==void 0?s.nodeAttrs.body.opacity:1,onInput:c[9]||(c[9]=_=>d.$emit("update-opacity",_))},null,40,Rl)])]),t.value.length>0?(e.openBlock(),e.createElementBlock("div",Ul,[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",Wl,e.toDisplayString(_.description),1)):e.createCommentVNode("",!0)]),_.type==="text"?(e.openBlock(),e.createElementBlock("input",{key:0,type:"text",value:r(_),onInput:B=>p(_,B),placeholder:_.defaultValue},null,40,Fl)):_.type==="number"?(e.openBlock(),e.createElementBlock("input",{key:1,type:"number",value:r(_),onInput:B=>p(_,B),min:_.min,max:_.max,step:_.step},null,40,Gl)):_.type==="color"?(e.openBlock(),e.createElementBlock("div",jl,[e.createElementVNode("input",{type:"color",value:r(_),onInput:B=>p(_,B)},null,40,Hl),e.createElementVNode("span",ql,e.toDisplayString(r(_)),1)])):_.type==="boolean"?(e.openBlock(),e.createElementBlock("div",Jl,[e.createElementVNode("input",{type:"checkbox",checked:r(_),onChange:B=>p(_,B)},null,40,Yl),e.createElementVNode("span",Xl,e.toDisplayString(r(_)?"是":"否"),1)])):_.type==="select"?(e.openBlock(),e.createElementBlock("select",{key:4,value:r(_),onChange:B=>p(_,B)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.options,B=>(e.openBlock(),e.createElementBlock("option",{key:B.value,value:B.value},e.toDisplayString(B.label),9,Ql))),128))],40,Kl)):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-e63074f3"]]),Zl={class:"tab-pane"},en={class:"property-section"},tn={class:"property-item-inline"},on=["value"],ln={key:0,class:"property-section"},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={class:"property-item-inline"},un=["value"],gn={class:"property-item-inline"},hn=["value"],yn={key:1,class:"property-section"},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={class:"property-item-inline"},_n=["value"],vn={class:"property-item-inline"},Bn=["value"],Sn={key:2,class:"property-section"},Dn={class:"property-item-inline"},In=["value"],Tn={class:"property-item-inline"},zn=["value"],Mn={class:"property-item-inline"},An=["value"],Pn={class:"property-item-inline"},On=["value"],Ln={class:"property-item-inline"},Rn={class:"checkbox-wrapper"},Un=["checked"],Wn={class:"checkbox-label"},Fn={key:3,class:"property-section"},Gn={class:"property-item-inline"},jn=["value"],Hn={class:"property-item-inline"},qn=["value"],Jn={class:"property-item-inline"},Yn=["value"],Xn={key:4,class:"property-section"},Kn={class:"property-item-inline"},Qn=["value"],Zn={class:"property-item-inline"},ea=["value"],ta={key:5,class:"property-section"},oa={class:"property-item-inline"},la={class:"checkbox-wrapper"},na=["checked"],aa={class:"checkbox-label"},ra={class:"property-item-inline"},ia=["value"],sa=O(e.defineComponent({__name:"DataPropertiesTab",props:{selectedNode:{}},emits:["update-data-source"],setup(s,{emit:l}){const o=s,i=l,t=e.ref({type:"none",enabled:!0,retryCount:3});e.watch(()=>o.selectedNode,m=>{if(m){const n=m.getData();n!=null&&n.dataSource?t.value={...n.dataSource}:t.value={type:"none",enabled:!0,retryCount:3}}},{immediate:!0});const r=m=>{const n=m.target.value;let g={type:n,enabled:!0,retryCount:3};n==="http"?(g.pollInterval=5e3,g.method="GET"):n==="sse"&&(g.autoReconnect=!0),t.value=g,f()},p=(m,n)=>{const g=n.target;let u;g.type==="number"?u=Number(g.value):u=g.value,t.value={...t.value,[m]:u},f()},d=(m,n)=>{const g=n.target.checked;t.value={...t.value,[m]:g},f()},c=m=>{const n=m.target.checked;t.value={...t.value,enabled:n},f()},f=()=>{i("update-data-source",t.value)};return(m,n)=>(e.openBlock(),e.createElementBlock("div",Zl,[e.createElementVNode("div",en,[n[25]||(n[25]=e.createElementVNode("h4",null,"数据来源",-1)),e.createElementVNode("div",tn,[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,on)])]),t.value.type==="mqtt"?(e.openBlock(),e.createElementBlock("div",ln,[n[32]||(n[32]=e.createElementVNode("h4",null,"MQTT配置",-1)),e.createElementVNode("div",nn,[n[26]||(n[26]=e.createElementVNode("label",null,"服务器",-1)),e.createElementVNode("input",{type:"text",value:t.value.broker||"",onInput:n[0]||(n[0]=g=>p("broker",g)),placeholder:"mqtt://localhost:1883"},null,40,an)]),e.createElementVNode("div",rn,[n[27]||(n[27]=e.createElementVNode("label",null,"客户端ID",-1)),e.createElementVNode("input",{type:"text",value:t.value.clientId||"",onInput:n[1]||(n[1]=g=>p("clientId",g)),placeholder:"自动生成"},null,40,sn)]),e.createElementVNode("div",dn,[n[28]||(n[28]=e.createElementVNode("label",null,"订阅主题",-1)),e.createElementVNode("input",{type:"text",value:t.value.topic||"",onInput:n[2]||(n[2]=g=>p("topic",g)),placeholder:"例如: sensor/temperature"},null,40,cn)]),e.createElementVNode("div",pn,[n[29]||(n[29]=e.createElementVNode("label",null,"用户名",-1)),e.createElementVNode("input",{type:"text",value:t.value.username||"",onInput:n[3]||(n[3]=g=>p("username",g)),placeholder:"可选"},null,40,mn)]),e.createElementVNode("div",fn,[n[30]||(n[30]=e.createElementVNode("label",null,"密码",-1)),e.createElementVNode("input",{type:"password",value:t.value.password||"",onInput:n[4]||(n[4]=g=>p("password",g)),placeholder:"可选"},null,40,un)]),e.createElementVNode("div",gn,[n[31]||(n[31]=e.createElementVNode("label",null,"数据路径",-1)),e.createElementVNode("input",{type:"text",value:t.value.dataPath||"",onInput:n[5]||(n[5]=g=>p("dataPath",g)),placeholder:"例如: value"},null,40,hn)])])):e.createCommentVNode("",!0),t.value.type==="http"?(e.openBlock(),e.createElementBlock("div",yn,[n[40]||(n[40]=e.createElementVNode("h4",null,"HTTP配置",-1)),e.createElementVNode("div",bn,[n[33]||(n[33]=e.createElementVNode("label",null,"接口地址",-1)),e.createElementVNode("input",{type:"text",value:t.value.url||"",onInput:n[6]||(n[6]=g=>p("url",g)),placeholder:"https://api.example.com/data"},null,40,kn)]),e.createElementVNode("div",En,[n[35]||(n[35]=e.createElementVNode("label",null,"请求方法",-1)),e.createElementVNode("select",{value:t.value.method||"GET",onChange:n[7]||(n[7]=g=>p("method",g))},[...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,Nn)]),e.createElementVNode("div",Vn,[n[36]||(n[36]=e.createElementVNode("label",null,"请求头",-1)),e.createElementVNode("input",{type:"text",value:t.value.headers||"",onInput:n[8]||(n[8]=g=>p("headers",g)),placeholder:"JSON格式"},null,40,xn)]),e.createElementVNode("div",wn,[n[37]||(n[37]=e.createElementVNode("label",null,"请求体",-1)),e.createElementVNode("input",{type:"text",value:t.value.body||"",onInput:n[9]||(n[9]=g=>p("body",g)),placeholder:"POST/PUT请求的数据"},null,40,$n)]),e.createElementVNode("div",Cn,[n[38]||(n[38]=e.createElementVNode("label",null,"数据路径",-1)),e.createElementVNode("input",{type:"text",value:t.value.dataPath||"",onInput:n[10]||(n[10]=g=>p("dataPath",g)),placeholder:"例如: data.value"},null,40,_n)]),e.createElementVNode("div",vn,[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]=g=>p("pollInterval",g)),min:"1000",step:"1000"},null,40,Bn)])])):e.createCommentVNode("",!0),t.value.type==="sse"?(e.openBlock(),e.createElementBlock("div",Sn,[n[46]||(n[46]=e.createElementVNode("h4",null,"SSE配置",-1)),e.createElementVNode("div",Dn,[n[41]||(n[41]=e.createElementVNode("label",null,"服务地址",-1)),e.createElementVNode("input",{type:"text",value:t.value.sseUrl||"",onInput:n[12]||(n[12]=g=>p("sseUrl",g)),placeholder:"https://api.example.com/events"},null,40,In)]),e.createElementVNode("div",Tn,[n[42]||(n[42]=e.createElementVNode("label",null,"事件类型",-1)),e.createElementVNode("input",{type:"text",value:t.value.eventType||"",onInput:n[13]||(n[13]=g=>p("eventType",g)),placeholder:"留空表示所有事件"},null,40,zn)]),e.createElementVNode("div",Mn,[n[43]||(n[43]=e.createElementVNode("label",null,"请求头",-1)),e.createElementVNode("input",{type:"text",value:t.value.headers||"",onInput:n[14]||(n[14]=g=>p("headers",g)),placeholder:"JSON格式"},null,40,An)]),e.createElementVNode("div",Pn,[n[44]||(n[44]=e.createElementVNode("label",null,"数据路径",-1)),e.createElementVNode("input",{type:"text",value:t.value.dataPath||"",onInput:n[15]||(n[15]=g=>p("dataPath",g)),placeholder:"例如: data.value"},null,40,On)]),e.createElementVNode("div",Ln,[n[45]||(n[45]=e.createElementVNode("label",null,"自动重连",-1)),e.createElementVNode("div",Rn,[e.createElementVNode("input",{type:"checkbox",checked:t.value.autoReconnect!==!1,onChange:n[16]||(n[16]=g=>d("autoReconnect",g))},null,40,Un),e.createElementVNode("span",Wn,e.toDisplayString(t.value.autoReconnect!==!1?"是":"否"),1)])])])):e.createCommentVNode("",!0),t.value.type==="websocket"?(e.openBlock(),e.createElementBlock("div",Fn,[n[50]||(n[50]=e.createElementVNode("h4",null,"WebSocket配置",-1)),e.createElementVNode("div",Gn,[n[47]||(n[47]=e.createElementVNode("label",null,"服务地址",-1)),e.createElementVNode("input",{type:"text",value:t.value.wsUrl||"",onInput:n[17]||(n[17]=g=>p("wsUrl",g)),placeholder:"ws://localhost:8080"},null,40,jn)]),e.createElementVNode("div",Hn,[n[48]||(n[48]=e.createElementVNode("label",null,"订阅主题",-1)),e.createElementVNode("input",{type:"text",value:t.value.topic||"",onInput:n[18]||(n[18]=g=>p("topic",g)),placeholder:"例如: device/status"},null,40,qn)]),e.createElementVNode("div",Jn,[n[49]||(n[49]=e.createElementVNode("label",null,"数据路径",-1)),e.createElementVNode("input",{type:"text",value:t.value.dataPath||"",onInput:n[19]||(n[19]=g=>p("dataPath",g)),placeholder:"例如: payload.value"},null,40,Yn)])])):e.createCommentVNode("",!0),t.value.type==="static"?(e.openBlock(),e.createElementBlock("div",Xn,[n[54]||(n[54]=e.createElementVNode("h4",null,"静态数据配置",-1)),e.createElementVNode("div",Kn,[n[51]||(n[51]=e.createElementVNode("label",null,"数据值",-1)),e.createElementVNode("input",{type:"text",value:t.value.value||"",onInput:n[20]||(n[20]=g=>p("value",g)),placeholder:"请输入数据值"},null,40,Qn)]),e.createElementVNode("div",Zn,[n[53]||(n[53]=e.createElementVNode("label",null,"数据类型",-1)),e.createElementVNode("select",{value:t.value.valueType||"string",onChange:n[21]||(n[21]=g=>p("valueType",g))},[...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,ea)])])):e.createCommentVNode("",!0),t.value.type!=="none"?(e.openBlock(),e.createElementBlock("div",ta,[n[57]||(n[57]=e.createElementVNode("h4",null,"通用配置",-1)),e.createElementVNode("div",oa,[n[55]||(n[55]=e.createElementVNode("label",null,"启用状态",-1)),e.createElementVNode("div",la,[e.createElementVNode("input",{type:"checkbox",checked:t.value.enabled!==!1,onChange:c},null,40,na),e.createElementVNode("span",aa,e.toDisplayString(t.value.enabled!==!1?"启用":"禁用"),1)])]),e.createElementVNode("div",ra,[n[56]||(n[56]=e.createElementVNode("label",null,"错误重试",-1)),e.createElementVNode("input",{type:"number",value:t.value.retryCount||3,onInput:n[22]||(n[22]=g=>p("retryCount",g)),min:"0",max:"10"},null,40,ia)])])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-5b515f8a"]]),da={class:"edge-properties-tab"},ca={class:"property-section"},pa={class:"property-item"},ma={class:"color-input-wrapper"},fa=["value"],ua=["value"],ga={class:"property-item"},ha={class:"number-input-wrapper"},ya=["value"],ba={class:"property-item"},ka=["value"],Ea={class:"property-item"},Na={class:"slider-wrapper"},Va=["value"],xa={class:"slider-value"},wa={class:"property-item"},$a=["value"],Ca={key:0,class:"property-item"},_a={class:"number-input-wrapper"},va=["value"],Ba={class:"property-section"},Sa={class:"property-item"},Da=["value"],Ia={class:"property-item"},Ta=["value"],za={class:"property-section"},Ma={class:"property-item"},Aa=["value"],Pa={class:"property-item"},Oa=["value"],La=O(e.defineComponent({__name:"EdgePropertiesTab",props:{selectedEdge:{}},emits:["updateEdge","deleteEdge"],setup(s,{emit:l}){const o=s,i=l,t=e.computed(()=>{var N;return((N=o.selectedEdge)==null?void 0:N.getAttrs())||{}}),r=N=>{const V=N.target.value;i("updateEdge",{attrs:{line:{stroke:V}}})},p=N=>{const V=Number(N.target.value);i("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;i("updateEdge",{attrs:{line:{strokeDasharray:V==="none"?void 0:V}}})},f=N=>{const V=Number(N.target.value);i("updateEdge",{attrs:{line:{opacity:V}}})},m=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)},g=N=>{const V=N.target.value;i("updateEdge",{attrs:{line:{sourceMarker:V==="none"?void 0:{name:V,width:8,height:6}}}})},u=N=>{const V=N.target.value;i("updateEdge",{attrs:{line:{targetMarker:V==="none"?void 0:{name:V,width:8,height:6}}}})},a=N=>{const V=N.target.value;i("updateEdge",{router:V})},y=N=>{const V=N.target.value;i("updateEdge",{connector:{name:V,args:V==="rounded"?{radius:8}:void 0}})},S=()=>{i("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},k=N=>{if(!(N.target.value==="true"))i("updateEdge",{data:{animation:{enabled:!1}},animation:{enabled:!1}});else{const z=E()*1e3;i("updateEdge",{data:{animation:{enabled:!0,duration:z}},animation:{enabled:!0,duration:z}})}},h=N=>{const z=Number(N.target.value)*1e3;i("updateEdge",{data:{animation:{enabled:!0,duration:z}},animation:{enabled:!0,duration:z}})};return(N,V)=>{var z,F,U,_,B,M,ee,ae;return e.openBlock(),e.createElementBlock("div",da,[e.createElementVNode("div",ca,[V[10]||(V[10]=e.createElementVNode("h4",{class:"section-title"},"线条样式",-1)),e.createElementVNode("div",pa,[V[0]||(V[0]=e.createElementVNode("label",{class:"property-label"},"线条颜色",-1)),e.createElementVNode("div",ma,[e.createElementVNode("input",{type:"color",class:"color-input",value:((z=t.value.line)==null?void 0:z.stroke)||"#10b981",onInput:r},null,40,fa),e.createElementVNode("input",{type:"text",class:"color-text",value:((F=t.value.line)==null?void 0:F.stroke)||"#10b981",onInput:r},null,40,ua)])]),e.createElementVNode("div",ga,[V[2]||(V[2]=e.createElementVNode("label",{class:"property-label"},"线条粗细",-1)),e.createElementVNode("div",ha,[e.createElementVNode("input",{type:"number",class:"property-input",min:"1",max:"20",step:"1",value:((U=t.value.line)==null?void 0:U.strokeWidth)||2,onInput:p},null,40,ya),V[1]||(V[1]=e.createElementVNode("span",{class:"input-unit"},"px",-1))])]),e.createElementVNode("div",ba,[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,ka)]),e.createElementVNode("div",Ea,[V[5]||(V[5]=e.createElementVNode("label",{class:"property-label"},"透明度",-1)),e.createElementVNode("div",Na,[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,Va),e.createElementVNode("span",xa,e.toDisplayString(n())+"%",1)])]),e.createElementVNode("div",wa,[V[7]||(V[7]=e.createElementVNode("label",{class:"property-label"},"流动动画",-1)),e.createElementVNode("select",{class:"property-select",value:T(),onChange:k},[...V[6]||(V[6]=[e.createElementVNode("option",{value:"false"},"关闭",-1),e.createElementVNode("option",{value:"true"},"开启",-1)])],40,$a)]),T()==="true"?(e.openBlock(),e.createElementBlock("div",Ca,[V[9]||(V[9]=e.createElementVNode("label",{class:"property-label"},"动画速度",-1)),e.createElementVNode("div",_a,[e.createElementVNode("input",{type:"number",class:"property-input",min:"0.5",max:"10",step:"0.5",value:E(),onInput:h},null,40,va),V[8]||(V[8]=e.createElementVNode("span",{class:"input-unit"},"秒",-1))])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ba,[V[15]||(V[15]=e.createElementVNode("h4",{class:"section-title"},"箭头样式",-1)),e.createElementVNode("div",Sa,[V[12]||(V[12]=e.createElementVNode("label",{class:"property-label"},"起点箭头",-1)),e.createElementVNode("select",{class:"property-select",value:m("source"),onChange:g},[...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,Da)]),e.createElementVNode("div",Ia,[V[14]||(V[14]=e.createElementVNode("label",{class:"property-label"},"终点箭头",-1)),e.createElementVNode("select",{class:"property-select",value:m("target"),onChange:u},[...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,Ta)])]),e.createElementVNode("div",za,[V[20]||(V[20]=e.createElementVNode("h4",{class:"section-title"},"连接器",-1)),e.createElementVNode("div",Ma,[V[17]||(V[17]=e.createElementVNode("label",{class:"property-label"},"路由方式",-1)),e.createElementVNode("select",{class:"property-select",value:((M=(B=s.selectedEdge)==null?void 0:B.getRouter())==null?void 0:M.name)||"manhattan",onChange:a},[...V[16]||(V[16]=[e.createElementVNode("option",{value:"manhattan"},"曼哈顿",-1),e.createElementVNode("option",{value:"orth"},"正交",-1),e.createElementVNode("option",{value:"normal"},"直线",-1)])],40,Aa)]),e.createElementVNode("div",Pa,[V[19]||(V[19]=e.createElementVNode("label",{class:"property-label"},"连接器类型",-1)),e.createElementVNode("select",{class:"property-select",value:((ae=(ee=s.selectedEdge)==null?void 0:ee.getConnector())==null?void 0:ae.name)||"rounded",onChange:y},[...V[18]||(V[18]=[e.createElementVNode("option",{value:"rounded"},"圆角",-1),e.createElementVNode("option",{value:"smooth"},"平滑",-1),e.createElementVNode("option",{value:"normal"},"普通",-1)])],40,Oa)])]),e.createElementVNode("div",{class:"property-section"},[e.createElementVNode("button",{class:"delete-btn",onClick:S}," 删除连线 ")])])}}}),[["__scopeId","data-v-e47f1784"]]),Ra={class:"event-card"},Ua={class:"header-left"},Wa={class:"collapse-icon"},Fa={class:"event-title"},Ga={class:"event-card-body"},ja={class:"event-field"},Ha=["value"],qa={class:"event-field"},Ja=["value"],Ya={class:"event-field"},Xa=["value"],Ka={class:"condition-config"},Qa=["value"],Za=["value"],er=["value"],tr=["value"],or={key:0,class:"config-section"},lr={key:1,class:"config-section"},nr={key:2,class:"config-section"},ar={key:0,class:"selected-workflow-info"},rr={class:"info-row"},ir={class:"info-value"},sr={class:"event-field"},dr=["value"],Ie=O(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(s){return(l,o)=>{var i,t,r,p,d,c,f;return e.openBlock(),e.createElementBlock("div",Ra,[e.createElementVNode("div",{class:"event-card-header",onClick:o[1]||(o[1]=m=>l.$emit("toggle-collapse"))},[e.createElementVNode("div",Ua,[e.createElementVNode("span",Wa,e.toDisplayString(s.isCollapsed?"▶":"▼"),1),e.createElementVNode("span",Fa,"事件"+e.toDisplayString(s.index+1),1)]),e.createElementVNode("button",{class:"btn-remove",onClick:o[0]||(o[0]=e.withModifiers(m=>l.$emit("remove"),["stop"])),title:"删除事件"},"🗑")]),e.withDirectives(e.createElementVNode("div",Ga,[e.createElementVNode("div",ja,[o[12]||(o[12]=e.createElementVNode("label",null,"事件名称",-1)),e.createElementVNode("input",{type:"text",value:s.event.name||"",onInput:o[2]||(o[2]=m=>l.$emit("update-field","name",m)),placeholder:"输入事件名称,如:温度报警、湿度预警"},null,40,Ha)]),e.createElementVNode("div",qa,[o[14]||(o[14]=e.createElementVNode("label",null,"事件类型",-1)),e.createElementVNode("select",{value:s.event.type,onChange:o[3]||(o[3]=m=>l.$emit("update-field","type",m))},[...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,Ja)]),e.createElementVNode("div",Ya,[o[16]||(o[16]=e.createElementVNode("label",null,"事件行为",-1)),e.createElementVNode("select",{value:s.event.action,onChange:o[4]||(o[4]=m=>l.$emit("update-field","action",m))},[...o[15]||(o[15]=[e.createElementVNode("option",{value:"attributeChange"},"更改属性",-1),e.createElementVNode("option",{value:"customCode"},"自定义代码",-1),e.createElementVNode("option",{value:"callProcess"},"调用流程",-1)])],40,Xa)]),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",Ka,[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:((i=s.event.condition)==null?void 0:i.attribute)||"",onChange:o[5]||(o[5]=m=>l.$emit("update-condition","attribute",m))},[o[17]||(o[17]=e.createElementVNode("option",{value:""},"选择属性",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.nodeProperties,m=>(e.openBlock(),e.createElementBlock("option",{key:m.key,value:m.key},e.toDisplayString(m.label),9,Za))),128))],40,Qa),o[21]||(o[21]=e.createElementVNode("div",{class:"condition-label"},"运算符",-1)),e.createElementVNode("select",{class:"condition-select",value:((t=s.event.condition)==null?void 0:t.operator)||"==",onChange:o[6]||(o[6]=m=>l.$emit("update-condition","operator",m))},[...o[18]||(o[18]=[e.createStaticVNode('<option value="==" data-v-af7c633a>等于</option><option value="!=" data-v-af7c633a>不等于</option><option value="&gt;" data-v-af7c633a>大于</option><option value="&gt;=" data-v-af7c633a>大于等于</option><option value="&lt;" data-v-af7c633a>小于</option><option value="&lt;=" data-v-af7c633a>小于等于</option><option value="contains" data-v-af7c633a>包含</option>',7)])],40,er),o[22]||(o[22]=e.createElementVNode("div",{class:"condition-label"},"值",-1)),e.createElementVNode("input",{type:"text",class:"condition-input",value:((r=s.event.condition)==null?void 0:r.value)||"",onInput:o[7]||(o[7]=m=>l.$emit("update-condition","value",m)),placeholder:"输入值"},null,40,tr),o[23]||(o[23]=e.createElementVNode("div",{class:"condition-label"},"时",-1)),o[24]||(o[24]=e.createElementVNode("div",{class:"condition-label"},"触发该事件",-1))]),s.event.action==="attributeChange"?(e.openBlock(),e.createElementBlock("div",or,[o[25]||(o[25]=e.createElementVNode("div",{class:"section-title"},"属性更改",-1)),e.createElementVNode("button",{class:"btn-config",onClick:o[8]||(o[8]=m=>l.$emit("open-attribute-config"))},"点击配置")])):e.createCommentVNode("",!0),s.event.action==="customCode"?(e.openBlock(),e.createElementBlock("div",lr,[o[26]||(o[26]=e.createElementVNode("div",{class:"section-title"},"自定义代码",-1)),e.createElementVNode("button",{class:"btn-config",onClick:o[9]||(o[9]=m=>l.$emit("open-custom-code"))},"点击配置")])):e.createCommentVNode("",!0),s.event.action==="callProcess"?(e.openBlock(),e.createElementBlock("div",nr,[o[29]||(o[29]=e.createElementVNode("div",{class:"section-title"},"调用流程",-1)),e.createElementVNode("button",{class:"btn-config",onClick:o[10]||(o[10]=m=>l.$emit("open-workflow-selector"))},"选择流程"),(p=s.event.params)!=null&&p.processId?(e.openBlock(),e.createElementBlock("div",ar,[e.createElementVNode("div",rr,[o[27]||(o[27]=e.createElementVNode("span",{class:"info-label"},"已选择:",-1)),e.createElementVNode("span",ir,e.toDisplayString(((d=s.event.params)==null?void 0:d.processName)||((c=s.event.params)==null?void 0:c.processId)),1)]),e.createElementVNode("div",sr,[o[28]||(o[28]=e.createElementVNode("label",null,"传入参数",-1)),e.createElementVNode("textarea",{value:((f=s.event.params)==null?void 0:f.processParams)||"",onInput:o[11]||(o[11]=m=>l.$emit("update-params","processParams",m)),placeholder:'JSON格式: {"param1":"value1","param2":"value2"}',rows:"3"},null,40,dr)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],512),[[e.vShow,!s.isCollapsed]])])}}}),[["__scopeId","data-v-af7c633a"]]);var oe=(s=>(s.BOOLEAN="boolean",s.NUMBER="number",s.STRING="string",s))(oe||{}),le=(s=>(s.READ="read",s.WRITE="write",s.READ_WRITE="readWrite",s))(le||{}),pe=(s=>(s.ONLINE="online",s.OFFLINE="offline",s.ERROR="error",s.MAINTENANCE="maintenance",s))(pe||{}),me=(s=>(s.PLC="plc",s.SENSOR="sensor",s.ACTUATOR="actuator",s.METER="meter",s.CAMERA="camera",s.OTHER="other",s))(me||{});const Te=[{id:"device_001",name:"1号温控设备",code:"TC-001",type:me.PLC,description:"车间1号温控PLC",status:pe.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:oe.NUMBER,accessMode:le.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:oe.NUMBER,accessMode:le.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:oe.BOOLEAN,accessMode:le.READ,value:!0,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_001_04",name:"告警状态",code:"40004",description:"设备告警状态",dataType:oe.BOOLEAN,accessMode:le.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:me.SENSOR,description:"主管道压力监测",status:pe.ONLINE,ipAddress:"192.168.1.102",port:502,protocol:"Modbus TCP",enabled:!0,tags:["管道","压力","传感器"],points:[{id:"point_002_01",name:"当前压力",code:"40001",description:"实时压力值",dataType:oe.NUMBER,accessMode:le.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:oe.NUMBER,accessMode:le.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:oe.NUMBER,accessMode:le.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:me.ACTUATOR,description:"主传送带电机控制",status:pe.ONLINE,ipAddress:"192.168.1.103",port:502,protocol:"Modbus TCP",enabled:!0,tags:["电机","控制器","传送带"],points:[{id:"point_003_01",name:"运行状态",code:"40001",description:"电机运行状态",dataType:oe.BOOLEAN,accessMode:le.READ,value:!0,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_003_02",name:"启动命令",code:"40002",description:"电机启动控制",dataType:oe.BOOLEAN,accessMode:le.WRITE,value:!1,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_003_03",name:"停止命令",code:"40003",description:"电机停止控制",dataType:oe.BOOLEAN,accessMode:le.WRITE,value:!1,enabled:!0,quality:"good",updateTime:"2025-12-17 08:15:00"},{id:"point_003_04",name:"当前转速",code:"40004",description:"电机实时转速",dataType:oe.NUMBER,accessMode:le.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:oe.NUMBER,accessMode:le.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:oe.NUMBER,accessMode:le.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:me.METER,description:"进水管道流量监测",status:pe.OFFLINE,ipAddress:"192.168.1.104",port:502,protocol:"Modbus TCP",enabled:!0,tags:["流量","仪表","进水"],points:[{id:"point_004_01",name:"瞬时流量",code:"40001",description:"当前流量值",dataType:oe.NUMBER,accessMode:le.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:oe.NUMBER,accessMode:le.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"}];Te.length;const bt=s=>Te.find(l=>l.id===s),cr=(s,l)=>{const o=bt(s);if(o)return o.points.find(i=>i.id===l)},pr={class:"device-point-selector"},mr={class:"device-list-panel"},fr={class:"panel-header"},ur={class:"device-count"},gr={class:"search-box"},hr={class:"device-list"},yr=["onClick"],br={class:"device-info"},kr={class:"device-name"},Er={class:"device-meta"},Nr={class:"device-code"},Vr={class:"point-count"},xr={key:0,class:"empty-hint"},wr={class:"point-list-panel"},$r={class:"panel-header"},Cr={key:0,class:"point-count"},_r={key:0,class:"search-box"},vr={class:"point-list"},Br={key:0,class:"empty-hint"},Sr={key:1,class:"empty-hint"},Dr=["onClick"],Ir={class:"point-info"},Tr={class:"point-name"},zr={class:"point-meta"},Mr={class:"point-code"},Ar={key:0,class:"point-unit"},Pr={class:"point-type"},Or={key:0,class:"point-value"},Lr={class:"value"},Rr={class:"modal-footer"},Ur=["disabled"],Wr=O(e.defineComponent({__name:"DevicePointSelector",props:{visible:{type:Boolean},modelValue:{}},emits:["update:visible","update:modelValue","confirm"],setup(s,{emit:l}){const o=s,i=l,t=e.ref(Te),r=e.ref(null),p=e.ref(null),d=e.ref(""),c=e.ref("");if(o.modelValue){const[E,k]=o.modelValue.split(":"),h=t.value.find(N=>N.id===E);h&&(r.value=h,p.value=h.points.find(N=>N.id===k)||null)}const f=e.computed(()=>{if(!d.value)return t.value;const E=d.value.toLowerCase();return t.value.filter(k=>k.name.toLowerCase().includes(E)||k.code.toLowerCase().includes(E))}),m=e.computed(()=>{if(!r.value)return[];if(!c.value)return r.value.points;const E=c.value.toLowerCase();return r.value.points.filter(k=>k.name.toLowerCase().includes(E)||k.code.toLowerCase().includes(E))}),n=E=>{r.value=E,p.value=null,c.value=""},g=E=>{E.enabled&&(p.value=E)},u=()=>{i("update:visible",!1)},a=()=>{if(!r.value||!p.value)return;const E=`${r.value.id}:${p.value.id}`;i("update:modelValue",E),i("confirm",r.value.id,p.value.id,r.value,p.value),i("update:visible",!1)},y=E=>({read:"只读",write:"只写",readWrite:"读写"})[E]||E,S=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,k)=>s.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal-overlay",onClick:u},[e.createElementVNode("div",{class:"modal-container",onClick:k[2]||(k[2]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"modal-header"},[k[3]||(k[3]=e.createElementVNode("h3",null,"选择设备点位",-1)),e.createElementVNode("button",{class:"btn-close",onClick:u},"✕")]),e.createElementVNode("div",pr,[e.createElementVNode("div",mr,[e.createElementVNode("div",fr,[k[4]||(k[4]=e.createElementVNode("h4",null,"设备列表",-1)),e.createElementVNode("span",ur,e.toDisplayString(t.value.length),1)]),e.createElementVNode("div",gr,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":k[0]||(k[0]=h=>d.value=h),type:"text",placeholder:"搜索设备...",class:"search-input"},null,512),[[e.vModelText,d.value]])]),e.createElementVNode("div",hr,[(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",br,[e.createElementVNode("div",kr,[e.createElementVNode("span",{class:e.normalizeClass(["status-dot",h.status])},null,2),e.createTextVNode(" "+e.toDisplayString(h.name),1)]),e.createElementVNode("div",Er,[e.createElementVNode("span",Nr,e.toDisplayString(h.code),1),e.createElementVNode("span",Vr,e.toDisplayString(h.points.length)+" 点",1)])]),k[5]||(k[5]=e.createElementVNode("div",{class:"device-arrow"},"›",-1))],10,yr)}),128)),f.value.length===0?(e.openBlock(),e.createElementBlock("div",xr," 暂无设备 ")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",wr,[e.createElementVNode("div",$r,[e.createElementVNode("h4",null,e.toDisplayString(r.value?r.value.name:"点位列表"),1),r.value?(e.openBlock(),e.createElementBlock("span",Cr,e.toDisplayString(m.value.length),1)):e.createCommentVNode("",!0)]),r.value?(e.openBlock(),e.createElementBlock("div",_r,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":k[1]||(k[1]=h=>c.value=h),type:"text",placeholder:"搜索点位...",class:"search-input"},null,512),[[e.vModelText,c.value]])])):e.createCommentVNode("",!0),e.createElementVNode("div",vr,[r.value?m.value.length===0?(e.openBlock(),e.createElementBlock("div",Sr," 暂无点位 ")):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(m.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=>g(h)},[e.createElementVNode("div",Ir,[e.createElementVNode("div",Tr,[e.createTextVNode(e.toDisplayString(h.name)+" ",1),e.createElementVNode("span",{class:e.normalizeClass(["access-mode",h.accessMode])},e.toDisplayString(y(h.accessMode)),3)]),e.createElementVNode("div",zr,[e.createElementVNode("span",Mr,e.toDisplayString(h.code),1),h.unit?(e.openBlock(),e.createElementBlock("span",Ar,e.toDisplayString(h.unit),1)):e.createCommentVNode("",!0),e.createElementVNode("span",Pr,e.toDisplayString(S(h.dataType)),1)]),h.value!==void 0?(e.openBlock(),e.createElementBlock("div",Or,[k[6]||(k[6]=e.createTextVNode(" 当前值: ",-1)),e.createElementVNode("span",Lr,e.toDisplayString(T(h)),1),e.createElementVNode("span",{class:e.normalizeClass(["quality",h.quality])},e.toDisplayString(h.quality),3)])):e.createCommentVNode("",!0)])],10,Dr)}),128)):(e.openBlock(),e.createElementBlock("div",Br," ← 请先选择设备 "))])])]),e.createElementVNode("div",Rr,[e.createElementVNode("button",{class:"btn-cancel",onClick:u},"取消"),e.createElementVNode("button",{class:"btn-confirm",disabled:!p.value,onClick:a}," 确定 ",8,Ur)])])])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-7884b850"]]);var ce=(s=>(s.DIRECT="direct",s.BOOLEAN="boolean",s.RANGE="range",s.ENUM="enum",s))(ce||{}),be=(s=>(s.BOOLEAN="boolean",s.NUMBER="number",s.STRING="string",s))(be||{});const Fr={class:"mapping-configurator"},Gr={class:"config-item"},jr={key:0,class:"field-hint error"},Hr={key:1,class:"field-hint"},qr={class:"config-item"},Jr={key:0,class:"field-hint error"},Yr={key:1,class:"field-hint"},Xr={key:0,class:"config-item"},Kr={class:"unit-config"},Qr={class:"checkbox-label"},Zr={key:0,class:"custom-unit"},ei={key:1,class:"mapping-details"},ti={class:"config-item"},oi={class:"config-item"},li={key:2,class:"mapping-details"},ni={class:"range-rules"},ai=["onUpdate:modelValue"],ri=["onUpdate:modelValue"],ii=["onUpdate:modelValue"],si=["onClick"],di={key:3,class:"mapping-details"},ci={class:"enum-mappings"},pi=["value","onInput"],mi=["onUpdate:modelValue"],fi=["onClick"],ui={key:4,class:"mapping-preview"},gi={class:"preview-content"},hi={class:"preview-item"},yi={class:"preview-output"},bi={class:"preview-item"},ki={class:"preview-output"},Ei={class:"preview-input"},Ni={class:"preview-output"},Vi={class:"preview-input"},xi={class:"preview-output"},wi=O(e.defineComponent({__name:"MappingConfigurator",props:{visible:{type:Boolean},modelValue:{}},emits:["update:visible","update:modelValue","confirm"],setup(s,{emit:l}){const o=s,i=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===be.BOOLEAN?t.value.type=ce.BOOLEAN:t.value.valueType===be.NUMBER?t.value.type=ce.RANGE:t.value.type=ce.DIRECT),t.value.valueType!==be.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===ce.RANGE?t.value.rangeRules=[]:t.value.type===ce.ENUM&&(t.value.enumMappings={})},f=()=>{t.value.rangeRules||(t.value.rangeRules=[]),t.value.rangeRules.push({min:0,max:100,value:""})},m=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]=""},g=T=>{t.value.enumMappings&&delete t.value.enumMappings[T]},u=(T,E)=>{const k=T.target.value;if(!t.value.enumMappings||k===E)return;const h=t.value.enumMappings[E];delete t.value.enumMappings[E],t.value.enumMappings[k]=h},a=()=>{},y=()=>{i("update:visible",!1)},S=()=>{if(!t.value.valueType){alert("请选择值类型!");return}if(!t.value.type){alert("请选择映射类型!");return}i("update:modelValue",{...t.value}),i("confirm",{...t.value}),i("update:visible",!1)};return(T,E)=>s.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"modal-overlay",onClick:y},[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:y},"✕")]),e.createElementVNode("div",Fr,[e.createElementVNode("div",Gr,[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]=k=>t.value.valueType=k),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",Hr,e.toDisplayString(p(t.value.valueType)),1)):(e.openBlock(),e.createElementBlock("div",jr," 值类型为必填项 "))]),e.createElementVNode("div",qr,[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]=k=>t.value.type=k),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",Yr,e.toDisplayString(d(t.value.type)),1)):(e.openBlock(),e.createElementBlock("div",Jr," 映射类型为必填项 "))]),t.value.valueType==="number"?(e.openBlock(),e.createElementBlock("div",Xr,[E[13]||(E[13]=e.createElementVNode("label",null,"单位配置",-1)),e.createElementVNode("div",Kr,[e.createElementVNode("label",Qr,[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":E[2]||(E[2]=k=>t.value.keepOriginalUnit=k),onChange:a},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",Zr,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":E[3]||(E[3]=k=>t.value.customUnit=k),type:"text",placeholder:"自定义单位,如: °C, MPa, %",onInput:a},null,544),[[e.vModelText,t.value.customUnit]])]))])])):e.createCommentVNode("",!0),t.value.type==="boolean"?(e.openBlock(),e.createElementBlock("div",ei,[e.createElementVNode("div",ti,[E[14]||(E[14]=e.createElementVNode("label",null,"True 时的值",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":E[4]||(E[4]=k=>t.value.trueValue=k),type:"text",placeholder:"例如: 运行、#00ff00",onInput:a},null,544),[[e.vModelText,t.value.trueValue]])]),e.createElementVNode("div",oi,[E[15]||(E[15]=e.createElementVNode("label",null,"False 时的值",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":E[5]||(E[5]=k=>t.value.falseValue=k),type:"text",placeholder:"例如: 停止、#ff0000",onInput:a},null,544),[[e.vModelText,t.value.falseValue]])])])):e.createCommentVNode("",!0),t.value.type==="range"?(e.openBlock(),e.createElementBlock("div",li,[e.createElementVNode("div",ni,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value.rangeRules,(k,h)=>(e.openBlock(),e.createElementBlock("div",{key:h,class:"range-rule"},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":N=>k.min=N,type:"number",placeholder:"最小值",onInput:a},null,40,ai),[[e.vModelText,k.min,void 0,{number:!0}]]),E[16]||(E[16]=e.createElementVNode("span",{class:"range-separator"},"~",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":N=>k.max=N,type:"number",placeholder:"最大值",onInput:a},null,40,ri),[[e.vModelText,k.max,void 0,{number:!0}]]),E[17]||(E[17]=e.createElementVNode("span",{class:"range-arrow"},"→",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":N=>k.value=N,type:"text",placeholder:"映射值",onInput:a},null,40,ii),[[e.vModelText,k.value]]),e.createElementVNode("button",{class:"btn-remove-rule",onClick:N=>m(h),title:"删除规则"}," ✕ ",8,si)]))),128))]),e.createElementVNode("button",{class:"btn-add-rule",onClick:f}," + 添加范围规则 ")])):e.createCommentVNode("",!0),t.value.type==="enum"?(e.openBlock(),e.createElementBlock("div",di,[e.createElementVNode("div",ci,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value.enumMappings,(k,h,N)=>(e.openBlock(),e.createElementBlock("div",{key:N,class:"enum-mapping"},[e.createElementVNode("input",{value:h,type:"text",placeholder:"原始值",onInput:V=>u(V,h)},null,40,pi),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:a},null,40,mi),[[e.vModelText,t.value.enumMappings[h]]]),e.createElementVNode("button",{class:"btn-remove-rule",onClick:V=>g(h),title:"删除映射"}," ✕ ",8,fi)]))),128))]),e.createElementVNode("button",{class:"btn-add-rule",onClick:n}," + 添加枚举映射 ")])):e.createCommentVNode("",!0),t.value.type!=="direct"?(e.openBlock(),e.createElementBlock("div",ui,[E[25]||(E[25]=e.createElementVNode("label",null,"映射预览",-1)),e.createElementVNode("div",gi,[t.value.type==="boolean"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",hi,[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",yi,e.toDisplayString(t.value.trueValue||"true"),1)]),e.createElementVNode("div",bi,[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",ki,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,(k,h)=>(e.openBlock(),e.createElementBlock("div",{key:h,class:"preview-item"},[e.createElementVNode("span",Ei,"["+e.toDisplayString(k.min)+" ~ "+e.toDisplayString(k.max)+"]",1),E[23]||(E[23]=e.createElementVNode("span",{class:"preview-arrow"},"→",-1)),e.createElementVNode("span",Ni,e.toDisplayString(k.value),1)]))),128)):t.value.type==="enum"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(t.value.enumMappings,(k,h)=>(e.openBlock(),e.createElementBlock("div",{key:h,class:"preview-item"},[e.createElementVNode("span",Vi,e.toDisplayString(h),1),E[24]||(E[24]=e.createElementVNode("span",{class:"preview-arrow"},"→",-1)),e.createElementVNode("span",xi,e.toDisplayString(k),1)]))),128)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:"modal-footer"},[e.createElementVNode("button",{class:"btn-cancel",onClick:y},"取消"),e.createElementVNode("button",{class:"btn-confirm",onClick:S},"确定")])])])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-ef9e0ee1"]]),$i={class:"event-card"},Ci={class:"header-left"},_i={class:"collapse-icon"},vi={class:"event-title"},Bi={class:"event-card-body"},Si={class:"property-item"},Di={key:0,class:"selected-point"},Ii={class:"point-main"},Ti={class:"device-name"},zi={class:"point-name"},Mi={class:"point-details"},Ai={class:"point-code"},Pi={key:0,class:"point-unit"},Oi={key:1,class:"placeholder"},Li={class:"property-item"},Ri=["value"],Ui=["value"],Wi={class:"property-item"},Fi={key:0,class:"mapping-summary"},Gi={class:"mapping-type-label"},ji={class:"mapping-detail"},Hi={key:1,class:"placeholder"},ze=O(e.defineComponent({__name:"BindingCard",props:{binding:{},index:{},isCollapsed:{type:Boolean},nodeProperties:{}},emits:["toggle-collapse","remove","update-field"],setup(s,{emit:l}){const o=s,i=l,t=e.ref(o.binding.devicePointId||""),r=e.ref(!1),p=e.ref(!1),d=e.ref(o.binding.mapping||{type:ce.DIRECT,valueType:be.NUMBER});e.watch(()=>o.binding.devicePointId,u=>{t.value=u||""}),e.watch(()=>o.binding.mapping,u=>{u&&(d.value=u)},{deep:!0});const c=e.computed(()=>{if(!t.value)return null;const[u,a]=t.value.split(":");if(!u||!a)return null;const y=bt(u),S=y?cr(u,a):null;return!y||!S?null:{deviceName:y.name,pointName:S.name,pointCode:S.code,pointUnit:S.unit}}),f=(u,a,y,S)=>{const T=new Event("change");Object.defineProperty(T,"target",{value:{value:`${u}:${a}`},writable:!1}),i("update-field","devicePointId",T),console.log("选择了点位:",{device:y.name,point:S.name,dataType:S.dataType,accessMode:S.accessMode})},m=u=>{const a=new Event("change");Object.defineProperty(a,"target",{value:{value:u},writable:!1}),i("update-field","mapping",a)},n=u=>({direct:"直接映射",boolean:"布尔映射",range:"范围映射",enum:"枚举映射"})[u]||u,g=()=>{const u=d.value;return u.type==="boolean"?`True:${u.trueValue||"true"} / False:${u.falseValue||"false"}`:u.type==="range"&&u.rangeRules?`${u.rangeRules.length} 个范围规则`:u.type==="enum"&&u.enumMappings?`${Object.keys(u.enumMappings).length} 个枚举映射`:""};return(u,a)=>(e.openBlock(),e.createElementBlock("div",$i,[e.createElementVNode("div",{class:"event-card-header",onClick:a[1]||(a[1]=y=>u.$emit("toggle-collapse"))},[e.createElementVNode("div",Ci,[e.createElementVNode("span",_i,e.toDisplayString(s.isCollapsed?"▶":"▼"),1),e.createElementVNode("span",vi,"绑定"+e.toDisplayString(s.index+1),1)]),e.createElementVNode("button",{class:"btn-remove",onClick:a[0]||(a[0]=e.withModifiers(y=>u.$emit("remove"),["stop"])),title:"删除绑定"},"🗑")]),e.withDirectives(e.createElementVNode("div",Bi,[e.createElementVNode("div",Si,[a[10]||(a[10]=e.createElementVNode("label",null,"设备点位",-1)),e.createElementVNode("div",{class:"point-selector-trigger",onClick:a[2]||(a[2]=y=>r.value=!0)},[c.value?(e.openBlock(),e.createElementBlock("div",Di,[e.createElementVNode("div",Ii,[e.createElementVNode("span",Ti,e.toDisplayString(c.value.deviceName),1),e.createElementVNode("span",zi,e.toDisplayString(c.value.pointName),1)]),e.createElementVNode("div",Mi,[e.createElementVNode("span",Ai,e.toDisplayString(c.value.pointCode),1),c.value.pointUnit?(e.openBlock(),e.createElementBlock("span",Pi,e.toDisplayString(c.value.pointUnit),1)):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createElementBlock("div",Oi," 点击选择设备点位 ")),a[9]||(a[9]=e.createElementVNode("span",{class:"selector-arrow"},"›",-1))])]),e.createVNode(Wr,{visible:r.value,"onUpdate:visible":a[3]||(a[3]=y=>r.value=y),modelValue:t.value,"onUpdate:modelValue":a[4]||(a[4]=y=>t.value=y),onConfirm:f},null,8,["visible","modelValue"]),e.createElementVNode("div",Li,[a[12]||(a[12]=e.createElementVNode("label",null,"目标属性",-1)),e.createElementVNode("select",{value:s.binding.targetProperty||"",onChange:a[5]||(a[5]=y=>u.$emit("update-field","targetProperty",y))},[a[11]||(a[11]=e.createElementVNode("option",{value:""},"选择属性",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.nodeProperties,y=>(e.openBlock(),e.createElementBlock("option",{key:y.key,value:y.key},e.toDisplayString(y.label),9,Ui))),128))],40,Ri)]),e.createElementVNode("div",Wi,[a[14]||(a[14]=e.createElementVNode("label",null,"值映射配置",-1)),e.createElementVNode("div",{class:"mapping-trigger",onClick:a[6]||(a[6]=y=>p.value=!0)},[d.value.type!=="direct"?(e.openBlock(),e.createElementBlock("div",Fi,[e.createElementVNode("span",Gi,e.toDisplayString(n(d.value.type)),1),e.createElementVNode("span",ji,e.toDisplayString(g()),1)])):(e.openBlock(),e.createElementBlock("div",Hi," 点击配置值映射 ")),a[13]||(a[13]=e.createElementVNode("span",{class:"selector-arrow"},"›",-1))])]),e.createVNode(wi,{visible:p.value,"onUpdate:visible":a[7]||(a[7]=y=>p.value=y),modelValue:d.value,"onUpdate:modelValue":a[8]||(a[8]=y=>d.value=y),onConfirm:m},null,8,["visible","modelValue"])],512),[[e.vShow,!s.isCollapsed]])]))}}),[["__scopeId","data-v-3731c19a"]]),qi={class:"dialog-content"},Ji={class:"dialog-header"},Yi={class:"dialog-body"},Xi={class:"group-row"},Ki={class:"group-field"},Qi=["value","onChange"],Zi=["value"],es={class:"group-field group-field-value"},ts=["value","onInput"],os=["value","onInput"],ls={key:2,class:"color-input-wrapper"},ns=["value","onInput"],as={class:"color-value"},rs=["value","onChange"],is=["onClick"],ss={key:0,class:"empty-hint"},ds={class:"dialog-footer"},Me=O(e.defineComponent({__name:"AttributeConfigDialog",props:{attributeGroups:{},nodeProperties:{}},emits:["close","save","add-group","remove-group","update-group"],setup(s,{emit:l}){const o=s,i=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 m=f.target.value;i("update-group",d,c,m)},p=()=>{for(const d of o.attributeGroups)if(!d.property){alert("请为每组配置选择目标属性");return}i("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",qi,[e.createElementVNode("div",Ji,[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",Yi,[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(s.attributeGroups,(f,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"attribute-group"},[e.createElementVNode("div",Xi,[e.createElementVNode("div",Ki,[c[6]||(c[6]=e.createElementVNode("label",null,"目标属性",-1)),e.createElementVNode("select",{value:f.property,onChange:n=>r(m,"property",n)},[c[5]||(c[5]=e.createElementVNode("option",{value:""},"选择目标属性",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.nodeProperties,n=>(e.openBlock(),e.createElementBlock("option",{key:n.key,value:n.key},e.toDisplayString(n.label),9,Zi))),128))],40,Qi)]),e.createElementVNode("div",es,[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(m,"value",n),placeholder:"输入值"},null,40,ts)):t(f.property)==="number"?(e.openBlock(),e.createElementBlock("input",{key:1,value:f.value,type:"number",onInput:n=>r(m,"value",n),placeholder:"输入数字"},null,40,os)):t(f.property)==="color"?(e.openBlock(),e.createElementBlock("div",ls,[e.createElementVNode("input",{value:f.value,type:"color",onInput:n=>r(m,"value",n)},null,40,ns),e.createElementVNode("span",as,e.toDisplayString(f.value||"#000000"),1)])):t(f.property)==="boolean"?(e.openBlock(),e.createElementBlock("select",{key:3,value:f.value,onChange:n=>r(m,"value",n)},[...c[7]||(c[7]=[e.createElementVNode("option",{value:"true"},"是",-1),e.createElementVNode("option",{value:"false"},"否",-1)])],40,rs)):e.createCommentVNode("",!0)]),e.createElementVNode("button",{class:"btn-delete-group",onClick:n=>d.$emit("remove-group",m),title:"删除"}," 🗑 ",8,is)])]))),128)),s.attributeGroups.length===0?(e.openBlock(),e.createElementBlock("div",ss,' 请点击"新增一组"按钮添加属性配置 ')):e.createCommentVNode("",!0)]),e.createElementVNode("div",ds,[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"]]),cs={class:"dialog-content dialog-large"},ps={class:"dialog-header"},ms={class:"dialog-body dialog-body-split"},fs={class:"code-editor-section"},us=["value"],gs={class:"code-preview-section"},hs={class:"section-header"},ys={class:"preview-status"},bs={key:0,class:"status-success"},ks={key:1,class:"status-error"},Es={class:"preview-canvas"},Ns={key:0,class:"preview-empty"},Vs={key:1,class:"preview-error-box"},xs={class:"error-message"},ws={key:2,class:"preview-node-container"},$s={key:0,class:"console-output"},Cs={class:"console-logs"},_s={class:"dialog-footer"},vs=`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
- }`,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) {
16
+ }`,Ae=O(e.defineComponent({__name:"CustomCodeDialog",props:{code:{},selectedNode:{}},emits:["update:code","close","save"],setup(s,{expose:l}){const o=s,i=e.ref(null),t=e.ref(null);let r=null,p=null;const d=async()=>{var g;if(!o.selectedNode){t.value={success:!1,logs:[],error:"没有选中的节点"};return}const f=(g=o.selectedNode.model)==null?void 0:g.graph;if(!f){t.value={success:!1,logs:[],error:"无法获取画布对象"};return}t.value={success:!0,logs:[],result:void 0};const m=[],n=console.log;try{if(await e.nextTick(),await c(),!p||!r){t.value={success:!1,logs:[],error:"预览画布初始化失败"};return}console.log=(...T)=>{m.push(T.map(E=>typeof E=="object"?JSON.stringify(E,null,2):String(E)).join(" ")),n(...T)};let u=o.code.trim();u.startsWith("function")&&(u=`${u}; execute(node, graph, event);`);const a=new Function("node","graph","event",u),y=new Proxy(o.selectedNode,{get(T,E){return E==="attr"?function(...k){return k.length===1?T.attr(k[0]):p?p.attr(k[0],k[1]):void 0}:T[E]}}),S=a(y,f,{});p&&r&&(p.removeTools(),r.drawBackground(),p.toJSON()),t.value={success:!0,logs:m,result:S!==void 0?typeof S=="object"?JSON.stringify(S,null,2):String(S):void 0}}catch(u){t.value={success:!1,logs:m,error:u.message||String(u)}}finally{console.log=n}},c=async()=>{var g;if(!i.value||!o.selectedNode)return;await e.nextTick();const f=i.value.clientWidth,m=i.value.clientHeight;if(f===0||m===0)return;i.value.innerHTML="",r&&(r.dispose(),r=null,p=null),r=new te.Graph({container:i.value,width:f,height:Math.max(m-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-(((g=n.size)==null?void 0:g.width)||100)/2,y:100}})}catch(u){console.error("添加预览节点失败:",u)}};return l({previewContainer:i,DEFAULT_CODE:vs}),(f,m)=>{var n,g;return e.openBlock(),e.createElementBlock("div",{class:"dialog-overlay",onClick:m[4]||(m[4]=e.withModifiers(u=>f.$emit("close"),["self"]))},[e.createElementVNode("div",cs,[e.createElementVNode("div",ps,[m[5]||(m[5]=e.createElementVNode("h3",null,"自定义代码配置",-1)),e.createElementVNode("button",{class:"btn-close",onClick:m[0]||(m[0]=u=>f.$emit("close"))},"×")]),e.createElementVNode("div",ms,[e.createElementVNode("div",fs,[e.createElementVNode("div",{class:"section-header"},[m[6]||(m[6]=e.createElementVNode("label",null,"JavaScript代码",-1)),e.createElementVNode("button",{class:"btn-test",onClick:d},"测试执行")]),e.createElementVNode("textarea",{value:s.code,onInput:m[1]||(m[1]=u=>f.$emit("update:code",u.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,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>大于 (&gt;)</option><option value="gte" data-v-15975920>大于等于 (&gt;=)</option><option value="lt" data-v-15975920>小于 (&lt;)</option><option value="lte" data-v-15975920>小于等于 (&lt;=)</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(`
26
+ }`,class:"code-textarea code-textarea-full"},null,40,us)]),e.createElementVNode("div",gs,[e.createElementVNode("div",hs,[m[7]||(m[7]=e.createElementVNode("label",null,"组件预览",-1)),e.createElementVNode("div",ys,[(n=t.value)!=null&&n.success?(e.openBlock(),e.createElementBlock("span",bs,"✓ 执行成功")):(g=t.value)!=null&&g.error?(e.openBlock(),e.createElementBlock("span",ks,"✗ 执行失败")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Es,[t.value?t.value.error?(e.openBlock(),e.createElementBlock("div",Vs,[m[8]||(m[8]=e.createElementVNode("div",{class:"error-title"},"错误信息:",-1)),e.createElementVNode("div",xs,e.toDisplayString(t.value.error),1)])):(e.openBlock(),e.createElementBlock("div",ws,[e.createElementVNode("div",{ref_key:"previewContainer",ref:i,class:"node-preview"},null,512),t.value.logs.length>0?(e.openBlock(),e.createElementBlock("div",$s,[m[9]||(m[9]=e.createElementVNode("div",{class:"console-title"},"控制台输出:",-1)),e.createElementVNode("div",Cs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value.logs,(u,a)=>(e.openBlock(),e.createElementBlock("div",{key:a,class:"log-item"},e.toDisplayString(u),1))),128))])])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Ns,' 点击"测试执行"按钮查看组件预览效果 '))])])]),e.createElementVNode("div",_s,[e.createElementVNode("button",{class:"btn-cancel",onClick:m[2]||(m[2]=u=>f.$emit("close"))},"取消"),e.createElementVNode("button",{class:"btn-confirm",onClick:m[3]||(m[3]=u=>f.$emit("save"))},"确定")])])])}}}),[["__scopeId","data-v-add3567b"]]),Bs={class:"dialog-container"},Ss={class:"dialog-header"},Ds={class:"dialog-body"},Is={key:0,class:"empty-state"},Ts={key:1,class:"workflow-list"},zs=["onClick"],Ms={class:"workflow-info"},As={class:"workflow-name"},Ps={class:"workflow-meta"},Os={class:"workflow-id"},Ls={class:"workflow-date"},Rs={class:"workflow-actions"},Us=["onClick"],Ws={class:"dialog-footer"},Fs=["disabled"],Gs=O(e.defineComponent({__name:"WorkflowSelectorDialog",emits:["close","select"],setup(s,{emit:l}){const o=l,i=e.ref([]),t=e.ref(null),r=()=>{try{const m=localStorage.getItem("saved-workflows");m&&(i.value=JSON.parse(m))}catch(m){console.error("加载流程列表失败:",m)}},p=m=>{t.value=m},d=m=>{console.log("预览流程:",m)},c=()=>{t.value&&o("select",t.value)},f=m=>new Date(m).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"});return e.onMounted(()=>{r()}),(m,n)=>(e.openBlock(),e.createElementBlock("div",{class:"dialog-overlay",onClick:n[2]||(n[2]=e.withModifiers(g=>m.$emit("close"),["self"]))},[e.createElementVNode("div",Bs,[e.createElementVNode("div",Ss,[n[3]||(n[3]=e.createElementVNode("h3",null,"选择流程",-1)),e.createElementVNode("button",{class:"btn-close",onClick:n[0]||(n[0]=g=>m.$emit("close"))},"×")]),e.createElementVNode("div",Ds,[i.value.length===0?(e.openBlock(),e.createElementBlock("div",Is,[...n[4]||(n[4]=[e.createElementVNode("p",null,"暂无已保存的流程",-1),e.createElementVNode("p",{class:"hint"},"请先在流程编辑器中创建并保存流程",-1)])])):(e.openBlock(),e.createElementBlock("div",Ts,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,g=>{var u;return e.openBlock(),e.createElementBlock("div",{key:g.id,class:e.normalizeClass(["workflow-item",{selected:((u=t.value)==null?void 0:u.id)===g.id}]),onClick:a=>p(g)},[e.createElementVNode("div",Ms,[e.createElementVNode("div",As,e.toDisplayString(g.name),1),e.createElementVNode("div",Ps,[e.createElementVNode("span",Os,"ID: "+e.toDisplayString(g.id),1),e.createElementVNode("span",Ls,e.toDisplayString(f(g.createdAt)),1)])]),e.createElementVNode("div",Rs,[e.createElementVNode("button",{class:"btn-icon",onClick:e.withModifiers(a=>d(g),["stop"]),title:"预览"}," 👁️ ",8,Us)])],10,zs)}),128))]))]),e.createElementVNode("div",Ws,[e.createElementVNode("button",{class:"btn-secondary",onClick:n[1]||(n[1]=g=>m.$emit("close"))},"取消"),e.createElementVNode("button",{class:"btn-primary",disabled:!t.value,onClick:c}," 确定 ",8,Fs)])])]))}}),[["__scopeId","data-v-c9a88e33"]]),fe={SCADA_EDITOR_DATA:"scada_editor_data",SCADA_PREVIEW_DATA:"scada_preview_data"},Pe=(s,l)=>{try{const o=JSON.stringify(l);return sessionStorage.setItem(s,o),!0}catch(o){return console.error(`保存到 sessionStorage 失败 [${s}]:`,o),!1}},kt=s=>{try{const l=sessionStorage.getItem(s);return l?JSON.parse(l):null}catch(l){return console.error(`从 sessionStorage 读取失败 [${s}]:`,l),null}},Et=s=>{try{sessionStorage.removeItem(s)}catch(l){console.error(`从 sessionStorage 删除失败 [${s}]:`,l)}},js=(s,l)=>{try{const o=JSON.stringify(l);return localStorage.setItem(s,o),!0}catch(o){return console.error(`保存到 localStorage 失败 [${s}]:`,o),!1}},Hs=s=>{try{const l=localStorage.getItem(s);return l?JSON.parse(l):null}catch(l){return console.error(`从 localStorage 读取失败 [${s}]:`,l),null}},qs=s=>{try{localStorage.removeItem(s)}catch(l){console.error(`从 localStorage 删除失败 [${s}]:`,l)}},Nt=(s,l)=>{try{const o=JSON.stringify(s,null,2),i=new Blob([o],{type:"application/json;charset=utf-8"}),t=URL.createObjectURL(i),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}},Oe=(s="")=>{const l=Date.now(),o=Math.random().toString(36).substring(2,11);return s?`${s}_${l}_${o}`:`${l}_${o}`},Vt=()=>Oe("evt"),Js=()=>Oe("node"),Le=(s,l="YYYY-MM-DD HH:mm:ss")=>{const o=new Date(s),i=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(i)).replace("MM",t).replace("DD",r).replace("HH",p).replace("mm",d).replace("ss",c)},Re=()=>Date.now(),xt=(s=50,l=50,o=400,i=300)=>({x:Math.random()*o+s,y:Math.random()*i+l}),Q=(s,l="info",o=3e3)=>{const i=document.createElement("div");i.className=`scada-toast scada-toast-${l}`,i.textContent=s,Object.assign(i.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];i.style.backgroundColor=r.bg,i.style.color=r.text,document.body.appendChild(i),requestAnimationFrame(()=>{i.style.opacity="1"}),setTimeout(()=>{i.style.opacity="0",setTimeout(()=>{i.parentNode&&document.body.removeChild(i)},300)},o)},Ys={class:"property-panel"},Xs={key:1,class:"properties"},Ks={key:2,class:"properties"},Qs={class:"tabs"},Zs={class:"tab-content"},ed={class:"tab-pane"},td={class:"property-section"},od={key:0,class:"empty-hint"},ld={class:"event-list"},nd={class:"tab-pane"},ad={class:"property-section"},rd={key:0,class:"empty-hint"},id={class:"event-list"},Ue=O(e.defineComponent({__name:"PropertyPanel",props:{selectedNode:{},selectedEdge:{}},emits:["updateNode","deleteNode","updateEdge","deleteEdge"],setup(s,{emit:l}){const o=s,i=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,I;if((C=w==null?void 0:w.data)!=null&&C.events){const R=JSON.parse(JSON.stringify(w.data.events));R.forEach(G=>{G.id||(G.id=B())}),r.value=R}else r.value=[];p.value.clear(),(I=w==null?void 0:w.data)!=null&&I.bindings?d.value=JSON.parse(JSON.stringify(w.data.bindings)):d.value=[],c.value.clear()},{immediate:!0});const f=e.ref(0),m=e.ref(0);let n=null,g={x:0,y:0},u={width:0,height:0};e.watch(()=>o.selectedNode,w=>{if(n&&(clearInterval(n),n=null),w){const C=w.getPosition(),I=w.getSize();C&&typeof C.x=="number"&&typeof C.y=="number"?g=C:(g={x:0,y:0},console.warn("节点位置数据异常:",C)),I&&typeof I.width=="number"&&typeof I.height=="number"?u=I:(u={width:0,height:0},console.warn("节点尺寸数据异常:",I)),n=setInterval(()=>{if(o.selectedNode){const R=o.selectedNode.getPosition(),G=o.selectedNode.getSize();R&&typeof R.x=="number"&&typeof R.y=="number"&&(R.x!==g.x||R.y!==g.y)&&(g=R,f.value++),G&&typeof G.width=="number"&&typeof G.height=="number"&&(G.width!==u.width||G.height!==u.height)&&(u=G,m.value++)}},50)}}),e.onUnmounted(()=>{n&&clearInterval(n)});const a=e.computed(()=>{var C;return f.value,((C=o.selectedNode)==null?void 0:C.getPosition())||{x:0,y:0}}),y=e.computed(()=>{var C;return m.value,((C=o.selectedNode)==null?void 0:C.getSize())||{width:0,height:0}}),S=e.computed(()=>{var C;return((C=o.selectedNode)==null?void 0:C.getAttrs())||{}}),T=(w,C)=>{const I=Number(C.target.value),R=o.selectedNode.getPosition(),G=w==="x"?{x:I,y:R.y}:{x:R.x,y:I};i("updateNode",{position:G})},E=(w,C)=>{const I=Number(C.target.value),R=o.selectedNode.getSize(),G=w==="width"?{width:I,height:R.height}:{width:R.width,height:I};i("updateNode",{size:G})},k=w=>{const C=w.target.value;i("updateNode",{attrs:{text:{text:C},label:{text:C}}})},h=w=>{const C=w.target.value;i("updateNode",{attrs:{body:{fill:C}}})},N=w=>{const C=w.target.value;i("updateNode",{attrs:{body:{stroke:C}}})},V=w=>{const C=Number(w.target.value);i("updateNode",{attrs:{body:{strokeWidth:C}}})},z=w=>{const C=Number(w.target.value);i("updateNode",{attrs:{body:{opacity:C}}})},F=w=>{const C=w.target.value,I={...o.selectedNode.data,componentName:C};i("updateNode",{data:I})},U=(w,C)=>{if(!o.selectedNode)return;const I=w.split(".");if(I[0]==="attrs"){const R=I.slice(1).join("/");i("updateNode",{attrs:{[R]:C}})}else if(I[0]==="data"){const R=JSON.parse(JSON.stringify(o.selectedNode.data||{}));let G=R;for(let ie=1;ie<I.length-1;ie++){const He=I[ie];G[He]||(G[He]={}),G=G[He]}G[I[I.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"),i("updateNode",{data:R})}},_=w=>{if(!o.selectedNode)return;const C={...o.selectedNode.data,dataSource:w};i("updateNode",{data:C})},B=Vt,M=()=>{const w={id:B(),name:"",type:"click",conditionType:"always",action:"attributeChange",params:{}};r.value.push(w),re()},ee=w=>{r.value.splice(w,1),re()},ae=(w,C,I)=>{const R=I.target.value;r.value[w][C]=R,re()},ue=(w,C,I)=>{const G=I.target.value;r.value[w].condition||(r.value[w].condition={}),r.value[w].condition[C]=G,re()},Ne=(w,C,I)=>{const G=I.target.value;r.value[w].params||(r.value[w].params={}),r.value[w].params[C]=G,re()},re=()=>{r.value.forEach(C=>{C.id||(C.id=B())});const w={...o.selectedNode.data,events:r.value};i("updateNode",{data:w})},Fe=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),x()},we=w=>{d.value.splice(w,1),x()},b=(w,C,I)=>{const G=I.target.value;d.value[w][C]=G,x()},x=()=>{const w={...o.selectedNode.data,bindings:d.value};i("updateNode",{data:w})},$=w=>{c.value.has(w)?c.value.delete(w):c.value.add(w)},v=w=>c.value.has(w),A=e.ref(!1),q=e.ref(-1),L=e.ref([]),j=w=>{var I;q.value=w;const C=r.value[w];(I=C.params)!=null&&I.attributeGroups&&Array.isArray(C.params.attributeGroups)?L.value=JSON.parse(JSON.stringify(C.params.attributeGroups)):L.value=[{target:"current",property:"",value:""}],A.value=!0},Y=()=>{A.value=!1},X=()=>{L.value.push({target:"current",property:"",value:""})},P=w=>{L.value.splice(w,1)},J=(w,C,I)=>{L.value[w][C]=I},H=()=>{for(const w of L.value)if(!w.property){alert("请为每组配置选择目标属性");return}r.value[q.value].params||(r.value[q.value].params={}),r.value[q.value].params.attributeGroups=JSON.parse(JSON.stringify(L.value)),re(),Y()},Z=e.ref(!1),K=e.ref(""),ge=e.ref(-1),Vu=w=>{var I;ge.value=w;const C=r.value[w];K.value=((I=C.params)==null?void 0:I.code)||"",Z.value=!0},Bt=()=>{Z.value=!1},xu=()=>{r.value[ge.value].params||(r.value[ge.value].params={}),r.value[ge.value].params.code=K.value,re(),Bt()},Ge=e.ref(!1),$e=e.ref(-1),wu=w=>{$e.value=w,Ge.value=!0},St=()=>{Ge.value=!1},$u=w=>{r.value[$e.value].params||(r.value[$e.value].params={});const C=r.value[$e.value].params;C.processId=w.id,C.processName=w.name,C.processData=w.data,re(),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(I=>{I.bindable!==!1&&w.push({key:I.key,label:I.label,type:I.type||"text"})}),w},Cu=w=>{i("updateEdge",w)},_u=()=>{i("deleteEdge")};return(w,C)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Ys,[!s.selectedNode&&!s.selectedEdge?(e.openBlock(),e.createBlock(Se,{key:0})):s.selectedEdge?(e.openBlock(),e.createElementBlock("div",Xs,[C[5]||(C[5]=e.createElementVNode("h3",{class:"panel-title"},"连线属性",-1)),e.createVNode(La,{"selected-edge":s.selectedEdge,onUpdateEdge:Cu,onDeleteEdge:_u},null,8,["selected-edge"])])):s.selectedNode?(e.openBlock(),e.createElementBlock("div",Ks,[C[10]||(C[10]=e.createElementVNode("h3",{class:"panel-title"},"节点属性",-1)),e.createElementVNode("div",Qs,[e.createElementVNode("button",{class:e.normalizeClass(["tab-btn",{active:t.value==="basic"}]),onClick:C[0]||(C[0]=I=>t.value="basic")}," 基础 ",2),e.createElementVNode("button",{class:e.normalizeClass(["tab-btn",{active:t.value==="data"}]),onClick:C[1]||(C[1]=I=>t.value="data")}," 数据 ",2),e.createElementVNode("button",{class:e.normalizeClass(["tab-btn",{active:t.value==="binding"}]),onClick:C[2]||(C[2]=I=>t.value="binding")}," 绑定 ",2),e.createElementVNode("button",{class:e.normalizeClass(["tab-btn",{active:t.value==="event"}]),onClick:C[3]||(C[3]=I=>t.value="event")}," 事件 ",2)]),e.createElementVNode("div",Zs,[e.withDirectives(e.createVNode(De,{"selected-node":s.selectedNode,"node-position":a.value,"node-size":y.value,"node-attrs":S.value,onUpdatePosition:T,onUpdateSize:E,onUpdateLabel:k,onUpdateFill:h,onUpdateStroke:N,onUpdateStrokeWidth:V,onUpdateOpacity:z,onUpdateComponentName:F,onUpdateDynamicProp:U},null,8,["selected-node","node-position","node-size","node-attrs"]),[[e.vShow,t.value==="basic"]]),e.withDirectives(e.createVNode(sa,{"selected-node":s.selectedNode,onUpdateDataSource:_},null,8,["selected-node"]),[[e.vShow,t.value==="data"]]),e.withDirectives(e.createElementVNode("div",ed,[e.createElementVNode("div",td,[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",od,[...C[7]||(C[7]=[e.createElementVNode("span",null,"暂无事件,点击上方按钮添加",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",ld,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(I,R)=>(e.openBlock(),e.createBlock(Ie,{key:R,event:I,index:R,"is-collapsed":Ve(R),"node-properties":je(),onToggleCollapse:G=>Fe(R),onRemove:G=>ee(R),onUpdateField:(G,ie)=>ae(R,G,ie),onUpdateCondition:(G,ie)=>ue(R,G,ie),onUpdateParams:(G,ie)=>Ne(R,G,ie),onOpenAttributeConfig:G=>j(R),onOpenCustomCode:G=>Vu(R),onOpenWorkflowSelector:G=>wu(R)},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",nd,[e.createElementVNode("div",ad,[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",rd,[...C[9]||(C[9]=[e.createElementVNode("span",null,"暂无绑定,点击上方按钮添加",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",id,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(I,R)=>(e.openBlock(),e.createBlock(ze,{key:R,binding:I,index:R,"is-collapsed":v(R),"node-properties":je(),"event-list":r.value,onToggleCollapse:G=>$(R),onRemove:G=>we(R),onUpdateField:(G,ie)=>b(R,G,ie)},null,8,["binding","index","is-collapsed","node-properties","event-list","onToggleCollapse","onRemove","onUpdateField"]))),128))])])],512),[[e.vShow,t.value==="binding"]])])])):e.createCommentVNode("",!0)]),A.value?(e.openBlock(),e.createBlock(Me,{key:0,"attribute-groups":L.value,"node-properties":je(),onClose:Y,onSave:H,onAddGroup:X,onRemoveGroup:P,onUpdateGroup:J},null,8,["attribute-groups","node-properties"])):e.createCommentVNode("",!0),Z.value?(e.openBlock(),e.createBlock(Ae,{key:1,code:K.value,"onUpdate:code":C[4]||(C[4]=I=>K.value=I),"selected-node":s.selectedNode,onClose:Bt,onSave:xu},null,8,["code","selected-node"])):e.createCommentVNode("",!0),Ge.value?(e.openBlock(),e.createBlock(Gs,{key:2,onClose:St,onSelect:$u})):e.createCommentVNode("",!0)],64))}}),[["__scopeId","data-v-78ade73d"]]);function We(s){const l=s.replace(/-/g,"+").replace(/_/g,"/"),o=l.length%4?"=".repeat(4-l.length%4):"",i=l+o,t=(typeof atob<"u"?atob:p=>Buffer.from(p,"base64").toString("binary"))(i),r=new Uint8Array(t.length);for(let p=0;p<t.length;p++)r[p]=t.charCodeAt(p);return r}function wt(s){const l=new ArrayBuffer(s.byteLength);return new Uint8Array(l).set(s),l}function sd(s){const l=s.replace("-----BEGIN PUBLIC KEY-----","").replace("-----END PUBLIC KEY-----","").replace(/\s+/g,""),o=(typeof atob<"u"?atob:t=>Buffer.from(t,"base64").toString("binary"))(l),i=new Uint8Array(o.length);for(let t=0;t<o.length;t++)i[t]=o.charCodeAt(t);return i.buffer}async function dd(s){const l=sd(s);return await crypto.subtle.importKey("spki",l,{name:"ECDSA",namedCurve:"P-256"},!1,["verify"])}async function cd(s,l){try{const[o,i]=s.split(".");if(!o||!i)return!1;const t=await dd(l),r=We(o),p=We(i),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 pd(s,l){const o=await cd(s,l);if(!o)return null;const i=s.split(".")[0],t=We(i),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 md={key:0,class:"scada-footer"},fd={key:1,class:"scada-footer"},ud={class:"footer-content"},gd={class:"footer-left"},hd={class:"copyright",style:{color:"#94a3b8 !important"}},yd={key:0,class:"divider",style:{color:"#475569 !important"}},bd={key:1,class:"license",style:{color:"#94a3b8 !important"}},kd={key:0,class:"footer-right"},Ed={class:"text",style:{color:"#94a3b8 !important"}},Nd={key:2,class:"scada-footer"},Vd={class:"footer-content"},xd={class:"footer-left"},wd={class:"authorized-text",style:{color:"#10b981 !important"}},$d={class:"footer-right"},Cd={key:0,class:"expiry-text",style:{color:"#94a3b8 !important"}},_d={key:1,class:"expiry-text",style:{color:"#94a3b8 !important"}},vd=O(e.defineComponent({__name:"Footer",props:{authCode:{default:""},publicKeyPem:{default:void 0},customFooter:{default:void 0}},setup(s){const l=s,o=e.ref(null),i=e.ref(!1);e.watch(()=>[l.authCode,l.publicKeyPem],async()=>{if(!l.authCode||!l.publicKeyPem){i.value=!1,o.value=null;return}const r=await pd(l.authCode,l.publicKeyPem);i.value=!!(r!=null&&r.isValid),o.value=r||null},{immediate:!0});const t=e.computed(()=>i.value);return(r,p)=>{var d,c;return t.value?s.customFooter?(e.openBlock(),e.createElementBlock("footer",fd,[e.createElementVNode("div",ud,[e.createElementVNode("div",gd,[e.createElementVNode("span",hd,e.toDisplayString(s.customFooter.copyright),1),s.customFooter.license?(e.openBlock(),e.createElementBlock("span",yd,"|")):e.createCommentVNode("",!0),s.customFooter.license?(e.openBlock(),e.createElementBlock("span",bd,e.toDisplayString(s.customFooter.license),1)):e.createCommentVNode("",!0)]),s.customFooter.contact?(e.openBlock(),e.createElementBlock("div",kd,[e.createElementVNode("span",Ed,e.toDisplayString(s.customFooter.contact),1)])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createElementBlock("footer",Nd,[e.createElementVNode("div",Vd,[e.createElementVNode("div",xd,[p[1]||(p[1]=e.createElementVNode("span",{class:"authorized-icon"},"✅",-1)),e.createElementVNode("span",wd,"已授权: "+e.toDisplayString(((d=o.value)==null?void 0:d.company)||"未知"),1)]),e.createElementVNode("div",$d,[(c=o.value)!=null&&c.expiryDate?(e.openBlock(),e.createElementBlock("span",Cd," 📅 有效期至: "+e.toDisplayString(o.value.expiryDate),1)):(e.openBlock(),e.createElementBlock("span",_d," ∞ 永久授权 "))])])])):(e.openBlock(),e.createElementBlock("footer",md,[...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 se=(s=>(s.START="start",s.END="end",s.GET_PROPERTY="getProperty",s.SET_PROPERTY="setProperty",s.CONDITION="condition",s.HTTP_REQUEST="httpRequest",s.CUSTOM_CODE="customCode",s.TIMER="timer",s.CLEAR_TIMER="clearTimer",s))(se||{});const Bd={class:"dialog-body"},Sd={class:"search-box"},Dd={class:"element-list"},Id=["onClick"],Td={class:"element-icon"},zd={class:"element-info"},Md={class:"element-name"},Ad={class:"element-type"},Pd={key:0,class:"element-check"},Od={key:0,class:"empty-state"},Ld={class:"dialog-footer"},Rd=["disabled"],$t=O(e.defineComponent({__name:"ElementSelector",props:{visible:{type:Boolean},elements:{default:()=>[]}},emits:["close","select"],setup(s,{emit:l}){const o=s,i=l,t=e.ref(""),r=e.ref(null),p=e.computed(()=>{if(!t.value)return o.elements;const m=t.value.toLowerCase();return o.elements.filter(n=>n.name.toLowerCase().includes(m)||n.id.toLowerCase().includes(m)||n.type.toLowerCase().includes(m))}),d=m=>{r.value=m},c=()=>{t.value="",r.value=null,i("close")},f=()=>{r.value&&(i("select",r.value),c())};return(m,n)=>s.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",Bd,[e.createElementVNode("div",Sd,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=g=>t.value=g),type:"text",placeholder:"搜索图元名称或ID..."},null,512),[[e.vModelText,t.value]])]),e.createElementVNode("div",Dd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,g=>{var u,a;return e.openBlock(),e.createElementBlock("div",{key:g.id,class:e.normalizeClass(["element-item",{active:((u=r.value)==null?void 0:u.id)===g.id}]),onClick:y=>d(g)},[e.createElementVNode("div",Td,e.toDisplayString(g.icon),1),e.createElementVNode("div",zd,[e.createElementVNode("div",Md,e.toDisplayString(g.name),1),e.createElementVNode("div",Ad,e.toDisplayString(g.type),1)]),((a=r.value)==null?void 0:a.id)===g.id?(e.openBlock(),e.createElementBlock("div",Pd," ✓ ")):e.createCommentVNode("",!0)],10,Id)}),128)),p.value.length===0?(e.openBlock(),e.createElementBlock("div",Od,[...n[3]||(n[3]=[e.createElementVNode("p",null,"未找到图元",-1),e.createElementVNode("p",{class:"empty-hint"},"请尝试其他搜索关键词",-1)])])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Ld,[e.createElementVNode("button",{class:"btn-secondary",onClick:c},"取消"),e.createElementVNode("button",{class:"btn-primary",disabled:!r.value,onClick:f}," 确定 ",8,Rd)])])])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-882704dd"]]),Ud={class:"node-config"},Wd={class:"config-group"},Fd={class:"element-selector"},Gd={class:"config-group"},jd=["disabled"],Hd=["value"],qd=O(e.defineComponent({__name:"GetPropertyConfig",props:{modelValue:{}},emits:["update:modelValue"],setup(s,{emit:l}){const o=s,i=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 u=d.value.find(a=>a.id===t.elementId);return(u==null?void 0:u.properties)||[]}),m=()=>{i("update:modelValue",{...t})},n=()=>{c&&(d.value=c.getElements()),p.value=!0},g=u=>{t.elementId=u.id,r.value=u.name,t.propertyName="",m()};return e.onMounted(()=>{if(c&&(d.value=c.getElements()),t.elementId){const u=d.value.find(a=>a.id===t.elementId);u&&(r.value=u.name)}}),(u,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Ud,[e.createElementVNode("div",Wd,[a[3]||(a[3]=e.createElementVNode("label",null,"图元选择",-1)),e.createElementVNode("div",Fd,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=y=>r.value=y),type:"text",placeholder:"点击选择按钮从画布中选择图元",readonly:""},null,512),[[e.vModelText,r.value]]),e.createElementVNode("button",{class:"btn-select",onClick:n}," 选择图元 ")])]),e.createElementVNode("div",Gd,[a[5]||(a[5]=e.createElementVNode("label",null,"属性选择",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":a[1]||(a[1]=y=>t.propertyName=y),onChange:m,disabled:!t.elementId},[a[4]||(a[4]=e.createElementVNode("option",{value:""},"请先选择图元",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,y=>(e.openBlock(),e.createElementBlock("option",{key:y.key,value:y.key},e.toDisplayString(y.label),9,Hd))),128))],40,jd),[[e.vModelSelect,t.propertyName]])])]),e.createVNode($t,{visible:p.value,elements:d.value,onClose:a[2]||(a[2]=y=>p.value=!1),onSelect:g},null,8,["visible","elements"])],64))}}),[["__scopeId","data-v-fa65eb56"]]),Jd={class:"node-config"},Yd={class:"config-group"},Xd={class:"element-selector"},Kd={class:"config-group"},Qd=["disabled"],Zd=["value"],ec={class:"config-group"},tc=O(e.defineComponent({__name:"SetPropertyConfig",props:{modelValue:{}},emits:["update:modelValue"],setup(s,{emit:l}){const o=s,i=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 u=d.value.find(a=>a.id===t.elementId);return(u==null?void 0:u.properties)||[]}),m=()=>{i("update:modelValue",{...t})},n=()=>{c&&(d.value=c.getElements()),p.value=!0},g=u=>{t.elementId=u.id,r.value=u.name,t.propertyName="",m()};return e.onMounted(()=>{if(c&&(d.value=c.getElements()),t.elementId){const u=d.value.find(a=>a.id===t.elementId);u&&(r.value=u.name)}}),(u,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Jd,[e.createElementVNode("div",Yd,[a[4]||(a[4]=e.createElementVNode("label",null,"图元选择",-1)),e.createElementVNode("div",Xd,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=y=>r.value=y),type:"text",placeholder:"点击选择按钮从画布中选择图元",readonly:""},null,512),[[e.vModelText,r.value]]),e.createElementVNode("button",{class:"btn-select",onClick:n}," 选择图元 ")])]),e.createElementVNode("div",Kd,[a[6]||(a[6]=e.createElementVNode("label",null,"属性选择",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":a[1]||(a[1]=y=>t.propertyName=y),onChange:m,disabled:!t.elementId},[a[5]||(a[5]=e.createElementVNode("option",{value:""},"请先选择图元",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,y=>(e.openBlock(),e.createElementBlock("option",{key:y.key,value:y.key},e.toDisplayString(y.label),9,Zd))),128))],40,Qd),[[e.vModelSelect,t.propertyName]])]),e.createElementVNode("div",ec,[a[7]||(a[7]=e.createElementVNode("label",null,"属性值",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":a[2]||(a[2]=y=>t.value=y),type:"text",placeholder:"请输入属性值",onInput:m},null,544),[[e.vModelText,t.value]])])]),e.createVNode($t,{visible:p.value,elements:d.value,onClose:a[3]||(a[3]=y=>p.value=!1),onSelect:g},null,8,["visible","elements"])],64))}}),[["__scopeId","data-v-42e029d4"]]),oc={class:"node-config"},lc={class:"config-group"},nc={class:"config-group"},ac={class:"branches-section"},rc={class:"branch-list"},ic={class:"branch-header"},sc={class:"branch-number"},dc=["onClick"],cc={key:0,class:"branch-config"},pc={class:"config-row"},mc=["onUpdate:modelValue"],fc={key:0,class:"config-row"},uc=["onUpdate:modelValue"],gc={key:1,class:"config-row"},hc=["onUpdate:modelValue","type"],yc={key:1,class:"default-branch-label"},bc=O(e.defineComponent({__name:"ConditionConfig",props:{modelValue:{}},emits:["update:modelValue"],setup(s,{emit:l}){const o=s,i=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=()=>{i("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:""},g=p.branches.findIndex(u=>u.isDefault);g>-1?p.branches.splice(g,0,n):p.branches.push(n),d()},m=n=>{p.branches.length>2&&(p.branches.splice(n,1),d())};return(n,g)=>(e.openBlock(),e.createElementBlock("div",oc,[e.createElementVNode("div",lc,[g[3]||(g[3]=e.createElementVNode("label",null,"数据来源节点",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":g[0]||(g[0]=u=>p.sourceNodeId=u),onChange:d},[...g[2]||(g[2]=[e.createElementVNode("option",{value:""},"请选择数据来源节点",-1),e.createElementVNode("option",{value:"prev"},"上一个节点",-1)])],544),[[e.vModelSelect,p.sourceNodeId]])]),e.createElementVNode("div",nc,[g[5]||(g[5]=e.createElementVNode("label",null,"数据类型",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":g[1]||(g[1]=u=>p.dataType=u),onChange:c},[...g[4]||(g[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",ac,[e.createElementVNode("div",{class:"section-header"},[g[6]||(g[6]=e.createElementVNode("label",null,"条件分支",-1)),e.createElementVNode("button",{class:"btn-add",onClick:f},"添加分支")]),e.createElementVNode("div",rc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.branches,(u,a)=>(e.openBlock(),e.createElementBlock("div",{key:u.id,class:"branch-item"},[e.createElementVNode("div",ic,[e.createElementVNode("span",sc,"分支 "+e.toDisplayString(a+1),1),!u.isDefault&&p.branches&&p.branches.length>1?(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn-remove",onClick:y=>m(a)},"×",8,dc)):e.createCommentVNode("",!0)]),u.isDefault?(e.openBlock(),e.createElementBlock("div",yc," 默认分支(其他情况) ")):(e.openBlock(),e.createElementBlock("div",cc,[e.createElementVNode("div",pc,[g[7]||(g[7]=e.createElementVNode("label",null,"分支标签",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y=>u.label=y,type:"text",placeholder:"如: >10, =A, True",onInput:d},null,40,mc),[[e.vModelText,u.label]])]),p.dataType!=="boolean"?(e.openBlock(),e.createElementBlock("div",fc,[g[9]||(g[9]=e.createElementVNode("label",null,"运算符",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":y=>u.operator=y,onChange:d},[...g[8]||(g[8]=[e.createStaticVNode('<option value="eq" data-v-15975920>等于 (==)</option><option value="ne" data-v-15975920>不等于 (!=)</option><option value="gt" data-v-15975920>大于 (&gt;)</option><option value="gte" data-v-15975920>大于等于 (&gt;=)</option><option value="lt" data-v-15975920>小于 (&lt;)</option><option value="lte" data-v-15975920>小于等于 (&lt;=)</option><option value="contains" data-v-15975920>包含</option><option value="notContains" data-v-15975920>不包含</option>',8)])],40,uc),[[e.vModelSelect,u.operator]])])):e.createCommentVNode("",!0),p.dataType!=="boolean"?(e.openBlock(),e.createElementBlock("div",gc,[g[10]||(g[10]=e.createElementVNode("label",null,"比较值",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y=>u.value=y,type:p.dataType==="number"?"number":"text",placeholder:"请输入比较值",onInput:d},null,40,hc),[[e.vModelDynamic,u.value]])])):e.createCommentVNode("",!0)]))]))),128))])])]))}}),[["__scopeId","data-v-15975920"]]),kc={class:"node-config"},Ec={class:"config-group"},Nc={class:"config-group"},Vc={class:"config-group"},xc={class:"config-group"},wc={class:"config-group"},$c=O(e.defineComponent({__name:"HttpRequestConfig",props:{modelValue:{}},emits:["update:modelValue"],setup(s,{emit:l}){const o=s,i=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=()=>{i("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",kc,[e.createElementVNode("div",Ec,[f[5]||(f[5]=e.createElementVNode("label",null,"请求URL",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=m=>t.url=m),type:"text",placeholder:"请输入请求URL",onInput:p},null,544),[[e.vModelText,t.url]])]),e.createElementVNode("div",Nc,[f[7]||(f[7]=e.createElementVNode("label",null,"请求方法",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":f[1]||(f[1]=m=>t.method=m),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",Vc,[f[8]||(f[8]=e.createElementVNode("label",null,"请求头 (JSON格式)",-1)),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":f[2]||(f[2]=m=>r.value=m),rows:"3",placeholder:'{"Content-Type": "application/json"}',onInput:d},null,544),[[e.vModelText,r.value]])]),e.createElementVNode("div",xc,[f[9]||(f[9]=e.createElementVNode("label",null,"请求体",-1)),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":f[3]||(f[3]=m=>t.body=m),rows:"4",placeholder:"请输入请求体内容",onInput:p},null,544),[[e.vModelText,t.body]])]),e.createElementVNode("div",wc,[f[10]||(f[10]=e.createElementVNode("label",null,"输出变量",-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[4]||(f[4]=m=>t.outputVariable=m),type:"text",placeholder:"请输入输出变量名",onInput:p},null,544),[[e.vModelText,t.outputVariable]])])]))}}),[["__scopeId","data-v-4c312eea"]]),Cc={class:"node-config"},_c={class:"config-group"},vc=O(e.defineComponent({__name:"CustomCodeConfig",props:{modelValue:{}},emits:["update:modelValue"],setup(s,{emit:l}){const o=s,i=l,t=e.reactive({code:o.modelValue.code||""}),r=()=>{i("update:modelValue",{...t})};return(p,d)=>(e.openBlock(),e.createElementBlock("div",Cc,[e.createElementVNode("div",_c,[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"]]),Bc={class:"node-config"},Sc={class:"config-group"},Dc={class:"config-group"},Ic=O(e.defineComponent({__name:"TimerConfig",props:{modelValue:{}},emits:["update:modelValue"],setup(s,{emit:l}){const o=s,i=l,t=e.reactive({interval:o.modelValue.interval||1e3,unit:o.modelValue.unit||"ms"}),r=()=>{i("update:modelValue",{...t})};return(p,d)=>(e.openBlock(),e.createElementBlock("div",Bc,[e.createElementVNode("div",Sc,[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",Dc,[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"]]),Tc={class:"node-config"},zc={class:"config-group"},Mc=["value"],Ac={key:0,class:"timer-hint warning"},Pc={key:1,class:"timer-hint"},Oc=O(e.defineComponent({__name:"ClearTimerConfig",props:{modelValue:{}},emits:["update:modelValue"],setup(s,{emit:l}){const o=s,i=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 m=f.getNodes(),n=[];return m.forEach(g=>{const u=g.getData();if((u==null?void 0:u.nodeType)==="timer"){const a=g.getAttrByPath("label/text")||"定时器";n.push({id:g.id,label:a})}}),n};e.onMounted(()=>{r.value=d()}),e.watch(()=>o.modelValue,()=>{r.value=d()},{deep:!0});const c=()=>{i("update:modelValue",{...t})};return(f,m)=>(e.openBlock(),e.createElementBlock("div",Tc,[e.createElementVNode("div",zc,[m[2]||(m[2]=e.createElementVNode("label",null,"选择定时器节点",-1)),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":m[0]||(m[0]=n=>t.timerId=n),onChange:c},[m[1]||(m[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,Mc))),128))],544),[[e.vModelSelect,t.timerId]])]),r.value.length===0?(e.openBlock(),e.createElementBlock("div",Ac,[...m[3]||(m[3]=[e.createElementVNode("p",null,"提示:当前流程中没有定时器节点",-1)])])):(e.openBlock(),e.createElementBlock("div",Pc,[...m[4]||(m[4]=[e.createElementVNode("p",null,"提示:选择要清除的定时器节点",-1)])]))]))}}),[["__scopeId","data-v-d102fb63"]]),Lc={[se.GET_PROPERTY]:qd,[se.SET_PROPERTY]:tc,[se.CONDITION]:bc,[se.HTTP_REQUEST]:$c,[se.CUSTOM_CODE]:vc,[se.TIMER]:Ic,[se.CLEAR_TIMER]:Oc};function Rc(s){return Lc[s]||null}const Uc={class:"property-panel"},Wc={key:0,class:"property-content"},Fc={class:"property-group"},Gc=["value"],jc={class:"property-group"},Hc=["value"],qc={key:0,class:"divider"},Jc={key:1,class:"property-empty"},Yc=O(e.defineComponent({__name:"PropertyPanel",props:{selectedCell:{}},emits:["update:label","update:config"],setup(s,{emit:l}){const o=s,i=l,t=()=>{var m,n,g;return((g=(n=(m=o.selectedCell)==null?void 0:m.cell)==null?void 0:n.model)==null?void 0:g.graph)||null};e.provide("getGraph",t);const r=e.ref({}),p=e.computed(()=>o.selectedCell?Rc(o.selectedCell.nodeType):null);e.watch(()=>o.selectedCell,m=>{if(m!=null&&m.cell){const n=m.cell.getData();r.value=(n==null?void 0:n.config)||{}}else r.value={}},{immediate:!0});const d=m=>{const n=m.target;i("update:label",n.value)},c=m=>{var n;if(r.value=m,(n=o.selectedCell)!=null&&n.cell){const g=o.selectedCell.cell.getData()||{};o.selectedCell.cell.setData({...g,config:m}),o.selectedCell.nodeType==="condition"&&m.branches&&f(m.branches)}i("update:config",m)},f=m=>{var U,_;if(!((U=o.selectedCell)!=null&&U.cell))return;const n=o.selectedCell.cell,g=(_=n.model)==null?void 0:_.graph;if(!g)return;const u=[];g.getConnectedEdges(n,{outgoing:!0}).forEach(B=>{const M=B.getSourcePortId(),ee=B.getTargetCell(),ae=B.getTargetPortId();M&&ee&&u.push({sourcePortId:M,targetCell:ee,targetPortId:ae})});const y=u.length>0?u[0].targetCell:null,S=u.length>0?u[0].targetPortId:"port-in";n.getPorts().forEach(B=>{B.group==="out"&&n.removePort(B.id)});const E=30,k=60,h=Math.max(m.length,1),N=Math.max(k,h*E),V=n.size(),z=n.position(),F=N-V.height;F!==0&&n.position(z.x,z.y-F/2),n.resize(V.width,N),m.forEach((B,M)=>{n.addPort({id:`port-out-${M}`,group:"out",attrs:{circle:{r:5,magnet:!0,stroke:"#34d399",strokeWidth:2,fill:"#1e293b"},portLabel:{text:B.label||`分支${M+1}`,fontSize:10,fill:"#94a3b8"}}})}),setTimeout(()=>{y&&m.forEach((B,M)=>{g.addEdge({source:{cell:n,port:`port-out-${M}`},target:{cell:y,port:S},labels:[{attrs:{label:{text:B.label||`分支${M+1}`,fill:"#e2e8f0",fontSize:12},rect:{fill:"#334155",stroke:"#34d399",strokeWidth:1,rx:4,ry:4}},position:.5}]})})},100)};return(m,n)=>(e.openBlock(),e.createElementBlock("div",Uc,[n[4]||(n[4]=e.createElementVNode("h3",null,"属性配置",-1)),s.selectedCell?(e.openBlock(),e.createElementBlock("div",Wc,[e.createElementVNode("div",Fc,[n[1]||(n[1]=e.createElementVNode("label",null,"节点名称",-1)),e.createElementVNode("input",{value:s.selectedCell.label,type:"text",placeholder:"输入节点名称",onInput:d},null,40,Gc)]),e.createElementVNode("div",jc,[n[2]||(n[2]=e.createElementVNode("label",null,"节点类型",-1)),e.createElementVNode("input",{value:s.selectedCell.nodeType,type:"text",readonly:"",disabled:""},null,8,Hc)]),p.value?(e.openBlock(),e.createElementBlock("div",qc)):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p.value),{key:1,modelValue:r.value,"onUpdate:modelValue":[n[0]||(n[0]=g=>r.value=g),c]},null,8,["modelValue"])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Jc,[...n[3]||(n[3]=[e.createElementVNode("div",{class:"empty-text"},"选择节点以配置属性",-1)])]))]))}}),[["__scopeId","data-v-8304acbc"]]),Xc={class:"toolbar"},Kc={class:"toolbar-right"},Qc=O(e.defineComponent({__name:"WorkflowToolbar",props:{showClose:{type:Boolean}},emits:["clear","validate","save","close"],setup(s){return(l,o)=>(e.openBlock(),e.createElementBlock("div",Xc,[o[5]||(o[5]=e.createElementVNode("div",{class:"toolbar-left"},[e.createElementVNode("h2",null,"流程编排")],-1)),e.createElementVNode("div",Kc,[e.createElementVNode("button",{class:"btn-secondary",onClick:o[0]||(o[0]=i=>l.$emit("clear"))},"清空"),e.createElementVNode("button",{class:"btn-secondary",onClick:o[1]||(o[1]=i=>l.$emit("validate"))},"验证"),e.createElementVNode("button",{class:"btn-primary",onClick:o[2]||(o[2]=i=>l.$emit("save"))},"保存"),s.showClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:"btn-close",onClick:o[3]||(o[3]=i=>l.$emit("close")),title:"关闭"},[...o[4]||(o[4]=[e.createElementVNode("span",{class:"close-icon"},"×",-1)])])):e.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-b3e0a4fc"]]),Zc={class:"menu-header"},ep={class:"menu-list"},tp=["onClick"],op={class:"menu-item-info"},lp={class:"menu-item-name"},np={class:"menu-item-desc"},ap=O(e.defineComponent({__name:"AddNodeMenu",props:{visible:{type:Boolean},position:{},nodeTypes:{}},emits:["close","select"],setup(s,{emit:l}){const o=s,i=l,t=e.computed(()=>o.nodeTypes.filter(p=>p.type!=="start"&&p.type!=="end")),r=p=>{i("select",p)};return(p,d)=>(e.openBlock(),e.createElementBlock("div",null,[s.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"menu-overlay",onClick:d[0]||(d[0]=c=>p.$emit("close"))})):e.createCommentVNode("",!0),s.visible?(e.openBlock(),e.createElementBlock("div",{key:1,class:"add-node-menu",style:e.normalizeStyle({left:s.position.x+"px",top:s.position.y+"px"})},[e.createElementVNode("div",Zc,[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",ep,[(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",op,[e.createElementVNode("div",lp,e.toDisplayString(c.name),1),e.createElementVNode("div",np,e.toDisplayString(c.description),1)])],8,tp))),128))])],4)):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-aa6fccf8"]]);class rp{constructor(){ke(this,"graph",null)}setGraph(l){this.graph=l}getElements(){return this.graph?this.graph.getNodes().map(o=>{const i=o.getData()||{},t=i.type||o.shape,r=he.getComponent(t),p=this.getElementProperties(o,r);return{id:o.id,name:i.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 i=[],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)&&(i.push({key:d,label:r.label||d}),t.add(d))}),i}getElementById(l){return this.getElements().find(i=>i.id===l)||null}searchElements(l){const o=this.getElements(),i=l.toLowerCase();return o.filter(t=>t.name.toLowerCase().includes(i)||t.id.toLowerCase().includes(i)||t.type.toLowerCase().includes(i))}}const Ct=new rp,ip={class:"workflow-editor"},sp={class:"editor-main"},dp={class:"canvas-area"},cp=O(e.defineComponent({__name:"WorkflowEditor",props:{scadaGraph:{default:null},showClose:{type:Boolean,default:!1}},emits:["close"],setup(s){const l=s,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"}]),i=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(k=>{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:k.color,fill:"#ffffff",rx:6,ry:6},icon:{text:k.icon,fontSize:24,fill:k.color,refX:20,refY:"50%",textAnchor:"middle",textVerticalAnchor:"middle"},label:{text:k.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:k.type}};k.type==="start"?h.ports.items=[{id:"port-out",group:"out"}]:k.type==="end"?h.ports.items=[{id:"port-in",group:"in"}]:k.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"}],te.Graph.registerNode(k.type,h,!0)})},m=()=>{if(!i.value)return;f(),t=new te.Graph({container:i.value,width:i.value.clientWidth,height:i.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 te.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 k=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 F=t.getIncomingEdges(z),U=t.getOutgoingEdges(z);F&&F.length>0&&U&&U.length>0&&F.forEach(_=>{const B=_.getSourceCell(),M=_.getSourcePortId();U.forEach(ee=>{const ae=ee.getTargetCell(),ue=ee.getTargetPortId();B&&ae&&t&&(t.addEdge({source:{cell:B,port:M},target:{cell:ae,port:ue}}),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",k),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 k=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:k,port:"port-out"},target:{cell:h,port:"port-in"}})},g=k=>{var h;(h=r.value)!=null&&h.cell&&(r.value.label=k,r.value.cell.setAttrByPath("label/text",k))},u=k=>{if(!t||!c)return;const h=c.getSourceCell(),N=c.getTargetCell();if(!h||!N)return;const V=h.position(),z=N.position(),F=(V.x+z.x)/2,U=(V.y+z.y)/2,_=t.addNode({shape:k.type,x:F,y:U,label:k.name,data:{nodeType:k.type}});c.remove(),t.addEdge({source:{cell:h,port:"port-out"},target:{cell:_,port:"port-in"}}),k.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},a=()=>{t&&t.clearCells()},y=()=>{if(!t)return console.log("画布不存在"),{errors:["画布不存在"],warnings:[]};const k=[],h=[],N=t.getNodes(),V=N.filter(F=>{var U;return((U=F.getData())==null?void 0:U.nodeType)==="start"});return V.length===0?k.push("流程中缺少开始节点"):V.length>1&&h.push("流程中有多个开始节点"),N.filter(F=>{var U;return((U=F.getData())==null?void 0:U.nodeType)==="end"}).length===0&&h.push("流程中缺少结束节点"),N.forEach(F=>{const U=F.getData(),_=U==null?void 0:U.nodeType,B=(U==null?void 0:U.config)||{},M=F.getAttrByPath("label/text")||"未命名节点";(_==="getProperty"||_==="setProperty")&&(B.elementId||k.push(`节点「${M}」未配置图元`),B.propertyName||k.push(`节点「${M}」未配置属性`),_==="setProperty"&&!B.value&&h.push(`节点「${M}」未配置属性值`)),_==="httpRequest"&&(B.url||k.push(`节点「${M}」未配置请求URL`)),_==="condition"&&(!B.branches||B.branches.length===0)&&k.push(`节点「${M}」未配置条件分支`),_==="timer"&&(!B.interval||B.interval<=0)&&k.push(`节点「${M}」未配置有效的时间间隔`),_==="clearTimer"&&(B.timerId||k.push(`节点「${M}」未选择定时器`)),_==="customCode"&&(B.code||h.push(`节点「${M}」未编写代码`))}),N.forEach(F=>{var B;const U=(B=F.getData())==null?void 0:B.nodeType,_=F.getAttrByPath("label/text")||"未命名节点";if(U==="start"&&t){const M=t.getOutgoingEdges(F);(!M||M.length===0)&&k.push(`开始节点「${_}」没有连接到下一个节点`)}if(U==="end"&&t){const M=t.getOutgoingEdges(F);M&&M.length>0&&h.push(`结束节点「${_}」不应该有输出连线`)}if(U!=="start"&&U!=="end"&&t){const M=t.getIncomingEdges(F),ee=t.getOutgoingEdges(F);(!M||M.length===0)&&h.push(`节点「${_}」没有输入连线`),U!=="clearTimer"&&(!ee||ee.length===0)&&h.push(`节点「${_}」没有输出连线`)}}),t&&N.forEach(F=>{var ee;const U=t.getIncomingEdges(F),_=t.getOutgoingEdges(F),B=(ee=F.getData())==null?void 0:ee.nodeType,M=F.getAttrByPath("label/text")||"未命名节点";B!=="start"&&(!U||U.length===0)&&(!_||_.length===0)&&h.push(`节点「${M}」是孤立节点`)}),{errors:k,warnings:h}},S=()=>{const{errors:k,warnings:h}=y();if(k.length===0&&h.length===0)alert("✓ 流程验证通过!"),console.log("流程验证通过");else{let N="";k.length>0&&(N+=`错误:
27
+ `+k.map(V=>" • "+V).join(`
28
28
  `)),h.length>0&&(N&&(N+=`
29
29
 
30
30
  `),N+=`警告:
31
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=`流程验证失败,无法保存!
32
+ `)),alert(N),console.log("验证结果:",{errors:k,warnings:h})}},T=()=>{if(!t)return;const{errors:k,warnings:h}=y();if(k.length>0){let B=`流程验证失败,无法保存!
33
33
 
34
- `;v+=`错误:
35
- `+b.map(M=>" • "+M).join(`
36
- `),h.length>0&&(v+=`
34
+ `;B+=`错误:
35
+ `+k.map(M=>" • "+M).join(`
36
+ `),h.length>0&&(B+=`
37
37
 
38
38
  警告:
39
39
  `+h.map(M=>" • "+M).join(`
40
- `)),alert(v);return}if(h.length>0){let v=`流程存在以下警告:
40
+ `)),alert(B);return}if(h.length>0){let B=`流程存在以下警告:
41
41
 
42
- `;if(v+=h.map(M=>" • "+M).join(`
43
- `),v+=`
42
+ `;if(B+=h.map(M=>" • "+M).join(`
43
+ `),B+=`
44
44
 
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"}})});
45
+ 是否继续保存?`,!confirm(B))return}const N=prompt("请输入流程名称:","未命名流程");if(!N||!N.trim())return;const V=t.toJSON(),z=t.getNodes().map(B=>({id:B.id,shape:B.shape,position:B.getPosition(),size:B.getSize(),attrs:B.getAttrs(),data:B.getData()})),F=t.getEdges().map(B=>({id:B.id,source:B.getSourceCellId(),target:B.getTargetCellId(),attrs:B.getAttrs(),data:B.getData()})),_={id:"workflow_"+Date.now(),name:N.trim(),data:{...V,nodes:z,edges:F},createdAt:Date.now(),updatedAt:Date.now()};try{const B=localStorage.getItem("saved-workflows"),M=B?JSON.parse(B):[];M.push(_),localStorage.setItem("saved-workflows",JSON.stringify(M)),alert("✓ 流程保存成功!"),console.log("流程已保存:",_)}catch(B){console.error("保存流程失败:",B),alert("保存失败,请重试")}};e.onMounted(()=>{m(),window.addEventListener("resize",E)});const E=()=>{!t||!i.value||t.resize(i.value.clientWidth,i.value.clientHeight)};return e.onBeforeUnmount(()=>{window.removeEventListener("resize",E);const k=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",k),t&&t.dispose()}),(k,h)=>(e.openBlock(),e.createElementBlock("div",ip,[e.createVNode(Qc,{"show-close":s.showClose,onClear:a,onValidate:S,onSave:T,onClose:h[0]||(h[0]=N=>k.$emit("close"))},null,8,["show-close"]),e.createElementVNode("div",sp,[e.createElementVNode("div",dp,[e.createElementVNode("div",{id:"workflow-container",ref_key:"containerRef",ref:i},null,512)]),e.createVNode(Yc,{"selected-cell":r.value,"onUpdate:label":g},null,8,["selected-cell"])]),e.createVNode(ap,{visible:p.value,position:d.value,"node-types":o.value,onClose:h[1]||(h[1]=N=>p.value=!1),onSelect:u},null,8,["visible","position","node-types"])]))}}),[["__scopeId","data-v-649349a2"]]),pp={key:0,class:"workflow-dialog-overlay"},mp={class:"workflow-dialog"},fp=O(e.defineComponent({__name:"WorkflowDialog",props:{visible:{type:Boolean},scadaGraph:{default:null}},emits:["update:visible","close"],setup(s,{emit:l}){const o=s,i=l;e.watch(()=>o.visible,p=>{p?document.body.style.overflow="hidden":document.body.style.overflow=""});const t=()=>{i("update:visible",!1),i("close")},r=p=>{p.key==="Escape"&&o.visible&&t()};return typeof window<"u"&&window.addEventListener("keydown",r),(p,d)=>s.visible?(e.openBlock(),e.createElementBlock("div",pp,[e.createElementVNode("div",mp,[e.createVNode(cp,{"scada-graph":s.scadaGraph,"show-close":!0,onClose:t},null,8,["scada-graph"])])])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-4e7f6ab7"]]),up=O(e.defineComponent({__name:"EChartsGauge",props:{node:{}},setup(s){const l=s,o=e.ref();let i=null;const t=()=>l.node?l.node.getData?l.node.getData():l.node.data||{}:{},r=()=>{o.value&&(i&&i.dispose(),i=Je.init(o.value),p())},p=()=>{if(!i)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 m={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(m.series[0],f.config),console.log("[EChartsGauge] 最终配置:",m)):console.warn("[EChartsGauge] 预设未找到或配置为空"),i.setOption(m,!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(i&&l.node){const d=l.node.getSize?l.node.getSize():l.node.size||{width:200,height:200};i.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(()=>{i&&(i.dispose(),i=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"]]),gp=e.defineComponent({__name:"EChartsLine",props:{node:{}},setup(s){const l=s,o=e.ref();let i=null;const t=()=>l.node?l.node.getData?l.node.getData():l.node.data||{}:{},r=()=>{o.value&&(i=Je.init(o.value),p())},p=()=>{if(!i)return;const d=t(),c=d.presetId||"basic",f=po(c),m={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(m.series[0],f.config),i.setOption(m,!0)};return e.onMounted(()=>{setTimeout(()=>{r(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",({current:d})=>{p()})},100)}),e.onUnmounted(()=>{i&&(i.dispose(),i=null)}),(d,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"chartContainer",ref:o,style:{width:"100%",height:"100%"}},null,512))}}),hp={class:"light-3d-container"},yp={viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg"},bp=["id"],kp=["stop-color"],Ep=["stop-color"],Np=["stop-color"],Vp=["id"],xp=["id"],wp=["id"],$p=["flood-color"],Cp=["fill","filter"],_p=["fill","filter"],vp=["opacity"],Bp={key:1,opacity:"0.8"},Sp=["fill"],Dp=["fill"],Ip=["fill"],Tp=["fill"],zp=["fill"],Mp=O(e.defineComponent({__name:"Light3D",props:{node:{}},setup(s){const l=s,o=e.ref(`light-${Math.random().toString(36).substr(2,9)}`),i=()=>l.node?l.node.getData?l.node.getData():l.node.data||{}:{},t=e.ref(!1),r=e.ref("#fbbf24"),p=(c,f)=>{const m=c.replace("#",""),n=parseInt(m.substring(0,2),16),g=parseInt(m.substring(2,4),16),u=parseInt(m.substring(4,6),16),a=Math.max(0,Math.floor(n*(1-f))),y=Math.max(0,Math.floor(g*(1-f))),S=Math.max(0,Math.floor(u*(1-f)));return`#${a.toString(16).padStart(2,"0")}${y.toString(16).padStart(2,"0")}${S.toString(16).padStart(2,"0")}`},d=()=>{const c=i();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",hp,[(e.openBlock(),e.createElementBlock("svg",yp,[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,kp),e.createElementVNode("stop",{offset:"50%","stop-color":t.value?r.value:"#d1d5db"},null,8,Ep),e.createElementVNode("stop",{offset:"100%","stop-color":t.value?p(r.value,.3):"#9ca3af"},null,8,Np)],8,bp),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,Vp),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,xp),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,$p),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,wp)]),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,Cp)):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,_p),e.createElementVNode("ellipse",{cx:"42",cy:"25",rx:"8",ry:"10",fill:"#ffffff",opacity:t.value?.7:.3},null,8,vp),t.value?(e.openBlock(),e.createElementBlock("g",Bp,[...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,Sp),e.createElementVNode("rect",{x:"40",y:"67",width:"20",height:"3",fill:`url(#base-gradient-${o.value})`,rx:"1"},null,8,Dp),e.createElementVNode("rect",{x:"40",y:"71",width:"20",height:"3",fill:`url(#base-gradient-${o.value})`,rx:"1"},null,8,Ip),e.createElementVNode("rect",{x:"40",y:"75",width:"20",height:"3",fill:`url(#base-gradient-${o.value})`,rx:"1"},null,8,Tp),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,zp),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"]]),Ap={class:"switch-3d-container"},Pp={viewBox:"0 0 120 80",xmlns:"http://www.w3.org/2000/svg"},Op=["id"],Lp=["id"],Rp=["id"],Up=["id"],Wp=["fill"],Fp=["fill"],Gp=["fill"],jp=["transform"],Hp=["fill"],qp=["fill","filter"],Jp=["opacity"],Yp=["fill","filter"],Xp=["opacity"],Kp=O(e.defineComponent({__name:"Switch3D",props:{node:{}},setup(s){const l=s,o=e.ref(`switch-${Math.random().toString(36).substr(2,9)}`),i=()=>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=i();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",Ap,[(e.openBlock(),e.createElementBlock("svg",Pp,[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,Op),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,Lp),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,Rp),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,Up)]),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,Wp),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,Fp),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,Gp),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,Hp),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,jp),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,qp),e.createElementVNode("circle",{cx:"35",cy:"50",r:"1.5",fill:"#ffffff",opacity:t.value?.1:.6},null,8,Jp),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,Yp),e.createElementVNode("circle",{cx:"85",cy:"50",r:"1.5",fill:"#ffffff",opacity:t.value?.6:.1},null,8,Xp)]),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"]]),Qp={class:"motor-3d-container"},Zp={viewBox:"0 0 120 100",xmlns:"http://www.w3.org/2000/svg"},em=["id"],tm=["id"],om=["id"],lm=["fill"],nm=["fill"],am=["fill"],rm=["transform"],im=["fill","filter"],sm=["opacity"],dm={x:"60",y:"61","font-size":"4",fill:"#cbd5e1","text-anchor":"middle","font-family":"monospace"},cm=O(e.defineComponent({__name:"Motor3D",props:{node:{}},setup(s){const l=s,o=e.ref(`motor-${Math.random().toString(36).substr(2,9)}`),i=()=>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)},m=()=>{const n=i();t.value=n.state==="running"||n.state===!0,r.value=n.speed||1500,p.value=n.power||7.5};return e.watch(()=>l.node,()=>{m()},{deep:!0}),e.onMounted(()=>{m(),t.value&&f(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{const n=t.value;m(),t.value&&!n?f():!t.value&&n&&c&&(cancelAnimationFrame(c),c=null)})}),e.onUnmounted(()=>{c&&cancelAnimationFrame(c)}),(n,g)=>(e.openBlock(),e.createElementBlock("div",Qp,[(e.openBlock(),e.createElementBlock("svg",Zp,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`motor-body-${o.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[...g[0]||(g[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,em),e.createElementVNode("linearGradient",{id:`shaft-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[...g[1]||(g[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,tm),e.createElementVNode("filter",{id:`indicator-glow-${o.value}`},[...g[2]||(g[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,om)]),e.createElementVNode("rect",{x:"20",y:"70",width:"80",height:"25",rx:"3",fill:`url(#motor-body-${o.value})`},null,8,lm),g[4]||(g[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,nm),g[5]||(g[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,am),e.createElementVNode("g",{transform:`rotate(${d.value} 105 45)`},[...g[3]||(g[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,rm),g[6]||(g[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,im),e.createElementVNode("circle",{cx:"15",cy:"45",r:"2",fill:"#ffffff",opacity:t.value?.6:.2},null,8,sm),g[7]||(g[7]=e.createElementVNode("rect",{x:"40",y:"55",width:"40",height:"8",rx:"1",fill:"#1e293b",opacity:"0.7"},null,-1)),e.createElementVNode("text",dm,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"]]),pm={class:"valve-3d-container"},mm={viewBox:"0 0 100 120",xmlns:"http://www.w3.org/2000/svg"},fm=["id"],um=["id"],gm=["fill"],hm=["fill"],ym=["fill"],bm=["fill"],km={transform:"translate(50, 60)"},Em=["fill","transform"],Nm=["transform"],Vm=["fill"],xm=["fill"],wm={x:"12.5",y:"62","font-size":"6",fill:"#ffffff","text-anchor":"middle","font-weight":"bold"},$m={x:"85",y:"62","font-size":"8",fill:"#cbd5e1","text-anchor":"middle","font-family":"monospace"},Cm=O(e.defineComponent({__name:"Valve3D",props:{node:{}},setup(s){const l=s,o=e.ref(`valve-${Math.random().toString(36).substr(2,9)}`),i=()=>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=i();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",pm,[(e.openBlock(),e.createElementBlock("svg",mm,[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,fm),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,um)]),e.createElementVNode("rect",{x:"40",y:"85",width:"20",height:"30",fill:`url(#valve-body-${o.value})`,stroke:"#475569","stroke-width":"1"},null,8,gm),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,hm),e.createElementVNode("rect",{x:"25",y:"50",width:"50",height:"20",fill:`url(#valve-body-${o.value})`,stroke:"#475569","stroke-width":"1"},null,8,ym),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,bm),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",km,[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,Em)]),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,Vm),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,Nm),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,xm),e.createElementVNode("text",wm,e.toDisplayString(t.value?"ON":"OFF"),1)]),e.createElementVNode("text",$m,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"]]),_m={class:"tank-3d-container"},vm={viewBox:"0 0 100 140",xmlns:"http://www.w3.org/2000/svg"},Bm=["id"],Sm=["id"],Dm=["stop-color"],Im=["stop-color"],Tm=["id"],zm=["fill"],Mm=["y","height","fill","filter"],Am=["cy","fill"],Pm=["fill"],Om=["height"],Lm={x:"65",y:"38","font-size":"5",fill:"#22c55e","text-anchor":"middle"},Rm=["height"],Um={x:"50",y:"127","font-size":"6",fill:"#22c55e","text-anchor":"middle","font-family":"monospace"},Wm={class:"status-text"},Fm=O(e.defineComponent({__name:"Tank3D",props:{node:{}},setup(s){const l=s,o=e.ref(`tank-${Math.random().toString(36).substr(2,9)}`),i=()=>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)),m=e.computed(()=>90*t.value/100),n=e.computed(()=>110-m.value),g=()=>{const u=i();t.value=Math.max(0,Math.min(100,u.level||50)),r.value=u.capacity||100,p.value=u.temperature||25,d.value=u.pressure||101,c.value=u.liquidColor||"#3b82f6"};return e.watch(()=>l.node,()=>{g()},{deep:!0}),e.onMounted(()=>{g(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{g()})}),(u,a)=>(e.openBlock(),e.createElementBlock("div",_m,[(e.openBlock(),e.createElementBlock("svg",vm,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`tank-body-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[...a[0]||(a[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,Bm),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,Dm),e.createElementVNode("stop",{offset:"100%","stop-color":c.value,"stop-opacity":"0.7"},null,8,Im)],8,Sm),e.createElementVNode("filter",{id:`wave-${o.value}`},[...a[1]||(a[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,Tm)]),a[2]||(a[2]=e.createElementVNode("ellipse",{cx:"50",cy:"20",rx:"30",ry:"8",fill:"#94a3b8",stroke:"#475569","stroke-width":"1"},null,-1)),a[3]||(a[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,zm),a[4]||(a[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:m.value,fill:`url(#liquid-${o.value})`,filter:`url(#wave-${o.value})`,opacity:"0.85"},null,8,Mm),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,Am)):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,Pm),a[5]||(a[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,Om),a[6]||(a[6]=e.createElementVNode("circle",{cx:"65",cy:"35",r:"8",fill:"#1e293b",stroke:"#475569","stroke-width":"1"},null,-1)),e.createElementVNode("text",Lm,e.toDisplayString(d.value),1),a[7]||(a[7]=e.createElementVNode("text",{x:"65",y:"42","font-size":"3",fill:"#94a3b8","text-anchor":"middle"},"kPa",-1)),a[8]||(a[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,Rm),a[9]||(a[9]=e.createElementVNode("circle",{cx:"34",cy:"52",r:"2",fill:"#ef4444"},null,-1)),a[10]||(a[10]=e.createElementVNode("rect",{x:"25",y:"120",width:"50",height:"12",rx:"2",fill:"#1e293b",opacity:"0.9"},null,-1)),e.createElementVNode("text",Um,e.toDisplayString(t.value)+"% | "+e.toDisplayString(f.value)+"m³ ",1)])),e.createElementVNode("div",Wm," 液位: "+e.toDisplayString(t.value)+"% | 容量: "+e.toDisplayString(f.value)+"m³ ",1)]))}}),[["__scopeId","data-v-13c65d9d"]]),Gm={class:"pump-3d-container"},jm={viewBox:"0 0 140 100",xmlns:"http://www.w3.org/2000/svg"},Hm=["id"],qm=["id"],Jm=["id"],Ym={key:0,attributeName:"x1",values:"-100%;100%",dur:"1s",repeatCount:"indefinite"},Xm={key:1,attributeName:"x2",values:"0%;200%",dur:"1s",repeatCount:"indefinite"},Km=["fill"],Qm=["fill"],Zm=["fill"],ef=["fill"],tf=["transform"],of=["fill"],lf={transform:"translate(100, 25)"},nf={x:"0",y:"2","font-size":"5",fill:"#22c55e","text-anchor":"middle"},af={transform:"translate(115, 35)"},rf={x:"0",y:"1","font-size":"4",fill:"#3b82f6","text-anchor":"middle"},sf=["fill"],df=["opacity"],cf={x:"60",y:"68","font-size":"4",fill:"#cbd5e1","text-anchor":"middle","font-family":"monospace"},pf=O(e.defineComponent({__name:"Pump3D",props:{node:{}},setup(s){const l=s,o=e.ref(`pump-${Math.random().toString(36).substr(2,9)}`),i=()=>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 m=null;const n=()=>{if(t.value){const u=r.value/360;f.value=(f.value+u)%360}m=requestAnimationFrame(n)},g=()=>{const u=i();t.value=u.state==="running"||u.state===!0,r.value=u.speed||2900,p.value=u.power||5.5,d.value=t.value?u.flowRate||15:0,c.value=t.value?(u.pressure||3.5).toFixed(1):0};return e.watch(()=>l.node,()=>{g()},{deep:!0}),e.onMounted(()=>{g(),t.value&&n(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{const u=t.value;g(),t.value&&!u?n():!t.value&&u&&m&&(cancelAnimationFrame(m),m=null)})}),e.onUnmounted(()=>{m&&cancelAnimationFrame(m)}),(u,a)=>(e.openBlock(),e.createElementBlock("div",Gm,[(e.openBlock(),e.createElementBlock("svg",jm,[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`pump-body-${o.value}`,cx:"50%",cy:"50%"},[...a[0]||(a[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,Hm),e.createElementVNode("linearGradient",{id:`motor-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[...a[1]||(a[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,qm),e.createElementVNode("linearGradient",{id:`flow-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[a[2]||(a[2]=e.createElementVNode("stop",{offset:"0%","stop-color":"#3b82f6","stop-opacity":"0.3"},null,-1)),a[3]||(a[3]=e.createElementVNode("stop",{offset:"50%","stop-color":"#60a5fa","stop-opacity":"0.6"},null,-1)),a[4]||(a[4]=e.createElementVNode("stop",{offset:"100%","stop-color":"#3b82f6","stop-opacity":"0.3"},null,-1)),t.value?(e.openBlock(),e.createElementBlock("animate",Ym)):e.createCommentVNode("",!0),t.value?(e.openBlock(),e.createElementBlock("animate",Xm)):e.createCommentVNode("",!0)],8,Jm)]),e.createElementVNode("rect",{x:"30",y:"75",width:"60",height:"20",rx:"2",fill:`url(#motor-gradient-${o.value})`},null,8,Km),a[15]||(a[15]=e.createElementVNode("rect",{x:"30",y:"75",width:"60",height:"2",fill:"#1e293b",opacity:"0.4"},null,-1)),a[16]||(a[16]=e.createElementVNode("circle",{cx:"35",cy:"85",r:"2",fill:"#334155"},null,-1)),a[17]||(a[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,Qm),a[18]||(a[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,[a[5]||(a[5]=e.createElementVNode("rect",{x:"5",y:"45",width:"28",height:"10",rx:"2",fill:"#64748b",stroke:"#475569","stroke-width":"1"},null,-1)),a[6]||(a[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,Zm)):e.createCommentVNode("",!0)]),e.createElementVNode("g",null,[a[7]||(a[7]=e.createElementVNode("rect",{x:"87",y:"45",width:"48",height:"10",rx:"2",fill:"#64748b",stroke:"#475569","stroke-width":"1"},null,-1)),a[8]||(a[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,ef)):e.createCommentVNode("",!0)]),e.createElementVNode("g",{transform:`rotate(${f.value} 60 50)`},[...a[9]||(a[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,tf),a[19]||(a[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,of),a[20]||(a[20]=e.createElementVNode("rect",{x:"58",y:"30",width:"4",height:"20",fill:"#475569"},null,-1)),e.createElementVNode("g",lf,[a[10]||(a[10]=e.createElementVNode("circle",{cx:"0",cy:"0",r:"10",fill:"#1e293b",stroke:"#475569","stroke-width":"1"},null,-1)),a[11]||(a[11]=e.createElementVNode("circle",{cx:"0",cy:"0",r:"8",fill:"none",stroke:"#64748b","stroke-width":"0.5"},null,-1)),e.createElementVNode("text",nf,e.toDisplayString(c.value),1),a[12]||(a[12]=e.createElementVNode("text",{x:"0",y:"6","font-size":"2.5",fill:"#94a3b8","text-anchor":"middle"},"bar",-1))]),e.createElementVNode("g",af,[a[13]||(a[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",rf,e.toDisplayString(d.value),1),a[14]||(a[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,sf),e.createElementVNode("circle",{cx:"25",cy:"30",r:"2",fill:"#ffffff",opacity:t.value?.6:.2},null,8,df),a[21]||(a[21]=e.createElementVNode("rect",{x:"45",y:"62",width:"30",height:"8",rx:"1",fill:"#1e293b",opacity:"0.7"},null,-1)),e.createElementVNode("text",cf,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"]]),mf={class:"conveyor-3d-container"},ff={viewBox:"0 0 200 80",xmlns:"http://www.w3.org/2000/svg"},uf=["id"],gf=["id"],hf=["id"],yf=["fill","transform"],bf=["transform"],kf=["fill","transform"],Ef=["transform"],Nf=["fill"],Vf=["x1","x2"],xf=["x","fill"],wf=["fill","opacity"],$f={key:0,attributeName:"opacity",values:"1;0.4;1",dur:"1s",repeatCount:"indefinite"},Cf={x:"100",y:"20","font-size":"10",fill:"#94a3b8","text-anchor":"middle","font-family":"monospace"},_f=O(e.defineComponent({__name:"Conveyor3D",props:{node:{}},setup(s){const l=s,o=e.ref(`conveyor-${Math.random().toString(36).substr(2,9)}`),i=()=>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 m=null;const n=()=>{if(t.value){const u=r.value/10,a=r.value/5;p.value==="forward"?(d.value=(d.value+u)%360,c.value=(c.value+a)%15,f.value=f.value+a,f.value>180&&(f.value=20)):(d.value=(d.value-u+360)%360,c.value=(c.value-a+15)%15,f.value=f.value-a,f.value<20&&(f.value=180))}m=requestAnimationFrame(n)},g=()=>{const u=i();t.value=u.state==="running"||u.state===!0,r.value=u.speed||10,p.value=u.direction||"forward"};return e.watch(()=>l.node,()=>{g()},{deep:!0}),e.onMounted(()=>{g(),n(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{g()})}),e.onUnmounted(()=>{m&&cancelAnimationFrame(m)}),(u,a)=>(e.openBlock(),e.createElementBlock("div",mf,[(e.openBlock(),e.createElementBlock("svg",ff,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`belt-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[...a[0]||(a[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,uf),e.createElementVNode("radialGradient",{id:`roller-gradient-${o.value}`},[...a[1]||(a[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,gf),e.createElementVNode("linearGradient",{id:`cargo-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[...a[2]||(a[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,hf)]),a[3]||(a[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,yf),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(8,y=>e.createElementVNode("g",{key:`left-${y}`},[e.createElementVNode("line",{x1:25,y1:38,x2:25,y2:42,stroke:"#1e293b","stroke-width":"1.5",transform:`rotate(${d.value+y*45}, 25, 50)`},null,8,bf)])),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,kf),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(8,y=>e.createElementVNode("g",{key:`right-${y}`},[e.createElementVNode("line",{x1:175,y1:38,x2:175,y2:42,stroke:"#1e293b","stroke-width":"1.5",transform:`rotate(${d.value+y*45}, 175, 50)`},null,8,Ef)])),64)),e.createElementVNode("rect",{x:"25",y:"38",width:"150",height:"24",fill:`url(#belt-gradient-${o.value})`},null,8,Nf),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(10,y=>e.createElementVNode("g",{key:`line-${y}`},[e.createElementVNode("line",{x1:25+y*15+c.value,y1:38,x2:25+y*15+c.value,y2:62,stroke:"#475569","stroke-width":"1.5",opacity:"0.5"},null,8,Vf)])),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,xf)):e.createCommentVNode("",!0),a[4]||(a[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",$f)):e.createCommentVNode("",!0)],8,wf),e.createElementVNode("text",Cf,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"]]),vf={class:"alarm-light-3d-container"},Bf={viewBox:"0 0 80 100",xmlns:"http://www.w3.org/2000/svg"},Sf=["id"],Df=["stop-color"],If=["stop-color"],Tf=["stop-color"],zf=["id"],Mf=["stop-color"],Af=["stop-color"],Pf=["stop-color"],Of=["id"],Lf=["fill","opacity"],Rf=["transform"],Uf=["fill","opacity"],Wf=["fill"],Ff=["fill"],Gf=["fill"],jf=["fill"],Hf={x:"40",y:"85","font-size":"4",fill:"#64748b","text-anchor":"middle","font-family":"Arial"},qf=O(e.defineComponent({__name:"AlarmLight3D",props:{node:{}},setup(s){const l=s,o=e.ref(`alarm-${Math.random().toString(36).substr(2,9)}`),i=()=>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 m=e.computed(()=>t.value?p.value:"#475569"),n=e.computed(()=>t.value?r.value==="rotating"?"旋转报警":r.value==="flashing"?"闪烁报警":"持续报警":"正常"),g=()=>{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(g)},u=()=>{const a=i();t.value=a.state==="active"||a.state===!0,r.value=a.mode||"rotating",p.value=a.color||"#ef4444"};return e.watch(()=>l.node,()=>{u()},{deep:!0}),e.onMounted(()=>{u(),g(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{u()})}),e.onUnmounted(()=>{f&&cancelAnimationFrame(f)}),(a,y)=>(e.openBlock(),e.createElementBlock("div",vf,[(e.openBlock(),e.createElementBlock("svg",Bf,[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":m.value,"stop-opacity":"0.9"},null,8,Df),e.createElementVNode("stop",{offset:"50%","stop-color":m.value,"stop-opacity":"0.7"},null,8,If),e.createElementVNode("stop",{offset:"100%","stop-color":m.value,"stop-opacity":"0.5"},null,8,Tf)],8,Sf),e.createElementVNode("radialGradient",{id:`glow-${o.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":m.value,"stop-opacity":"0.8"},null,8,Mf),e.createElementVNode("stop",{offset:"50%","stop-color":m.value,"stop-opacity":"0.3"},null,8,Af),e.createElementVNode("stop",{offset:"100%","stop-color":m.value,"stop-opacity":"0"},null,8,Pf)],8,zf),e.createElementVNode("linearGradient",{id:`base-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[...y[0]||(y[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,Of)]),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,Lf)):e.createCommentVNode("",!0),y[3]||(y[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,Uf),y[1]||(y[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)),y[2]||(y[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,Rf),y[4]||(y[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,Wf),e.createElementVNode("rect",{x:"22",y:"63",width:"36",height:"12",fill:`url(#base-gradient-${o.value})`,stroke:"#475569","stroke-width":"1"},null,8,Ff),e.createElementVNode("ellipse",{cx:"40",cy:"75",rx:"18",ry:"5",fill:`url(#base-gradient-${o.value})`,stroke:"#475569","stroke-width":"1"},null,8,Gf),y[5]||(y[5]=e.createElementVNode("circle",{cx:"28",cy:"69",r:"2",fill:"#64748b",stroke:"#1e293b","stroke-width":"0.5"},null,-1)),y[6]||(y[6]=e.createElementVNode("circle",{cx:"52",cy:"69",r:"2",fill:"#64748b",stroke:"#1e293b","stroke-width":"0.5"},null,-1)),y[7]||(y[7]=e.createElementVNode("line",{x1:"27",y1:"68",x2:"29",y2:"70",stroke:"#1e293b","stroke-width":"0.5"},null,-1)),y[8]||(y[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,jf),e.createElementVNode("text",Hf," 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"]]),Jf={class:"temperature-sensor-3d-container"},Yf={viewBox:"0 0 80 120",xmlns:"http://www.w3.org/2000/svg"},Xf=["id"],Kf=["id"],Qf=["stop-color"],Zf=["stop-color"],e0=["id"],t0=["stop-color"],o0=["stop-color"],l0=["fill"],n0=["y","height","fill"],a0=["fill"],r0=["fill"],i0=["fill","opacity"],s0={key:0,attributeName:"opacity",values:"1;0.3;1",dur:"0.8s",repeatCount:"indefinite"},d0=O(e.defineComponent({__name:"TemperatureSensor3D",props:{node:{}},setup(s){const l=s,o=e.ref(`temp-sensor-${Math.random().toString(36).substr(2,9)}`),i=()=>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 y=r.value-p.value;return Math.max(0,Math.min(1,(t.value-p.value)/y))*45}),m=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"),g=e.computed(()=>t.value>=d.value?"#ef4444":t.value<=c.value?"#3b82f6":"#22c55e"),u=e.computed(()=>t.value>=d.value||t.value<=c.value),a=()=>{const y=i();t.value=Math.round(y.temperature??25),r.value=y.maxTemp||100,p.value=y.minTemp||0,d.value=y.alarmHighLimit||80,c.value=y.alarmLowLimit||10};return e.watch(()=>l.node,()=>{a()},{deep:!0}),e.onMounted(()=>{a(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{a()})}),(y,S)=>(e.openBlock(),e.createElementBlock("div",Jf,[(e.openBlock(),e.createElementBlock("svg",Yf,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`shell-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[...S[0]||(S[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,Xf),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,Qf),e.createElementVNode("stop",{offset:"100%","stop-color":n.value,"stop-opacity":"0.7"},null,8,Zf)],8,Kf),e.createElementVNode("radialGradient",{id:`bulb-gradient-${o.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":n.value,"stop-opacity":"0.9"},null,8,t0),e.createElementVNode("stop",{offset:"70%","stop-color":n.value},null,8,o0),S[1]||(S[1]=e.createElementVNode("stop",{offset:"100%","stop-color":"#991b1b"},null,-1))],8,e0)]),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,l0),S[2]||(S[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:m.value,width:"6",height:f.value,rx:"3",fill:`url(#liquid-gradient-${o.value})`},null,8,n0),e.createElementVNode("circle",{cx:"40",cy:"75",r:"10",fill:`url(#bulb-gradient-${o.value})`,stroke:"#991b1b","stroke-width":"1.5"},null,8,a0),S[3]||(S[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:g.value,"text-anchor":"middle","font-family":"monospace"},e.toDisplayString(t.value),9,r0),S[4]||(S[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:u.value?"#ef4444":"#64748b",opacity:u.value?1:.3},[u.value?(e.openBlock(),e.createElementBlock("animate",s0)):e.createCommentVNode("",!0)],8,i0),S[5]||(S[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":u.value}])},e.toDisplayString(t.value)+"°C "+e.toDisplayString(u.value?"- 超限":""),3)]))}}),[["__scopeId","data-v-1b4c4bcc"]]),c0={class:"cylinder-3d-container"},p0={viewBox:"0 0 60 140",xmlns:"http://www.w3.org/2000/svg"},m0=["id"],f0=["id"],u0=["id"],g0=["fill"],h0=["fill"],y0=["fill"],b0=["y","height","fill"],k0=["cy"],E0=["cy"],N0=["x","fill"],V0=["x","fill"],x0={x:"30",y:"125","font-size":"5",fill:"#64748b","text-anchor":"middle","font-family":"Arial"},w0={x:"30",y:"18","font-size":"8",fill:"#22c55e","text-anchor":"middle","font-family":"monospace"},$0=O(e.defineComponent({__name:"Cylinder3D",props:{node:{}},setup(s){const l=s,o=e.ref(`cylinder-${Math.random().toString(36).substr(2,9)}`),i=()=>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 m=e.computed(()=>t.value>=r.value),n=e.computed(()=>t.value<=0),g=e.computed(()=>30+t.value/r.value*40),u=e.computed(()=>50-g.value),a=e.computed(()=>110-t.value/r.value*60),y=e.computed(()=>m.value?"伸出到位":n.value?"缩回到位":d.value==="extend"?"正在伸出":d.value==="retract"?"正在缩回":"停止"),S=e.computed(()=>m.value||n.value?"is-positioned":d.value!=="stop"?"is-moving":""),T=()=>{const k=Date.now(),h=(k-f)/1e3;f=k,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 k=i();d.value=k.action||"stop",r.value=k.stroke||50,p.value=k.speed||200,typeof k.position=="number"&&(t.value=Math.max(0,Math.min(r.value,k.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)}),(k,h)=>(e.openBlock(),e.createElementBlock("div",c0,[(e.openBlock(),e.createElementBlock("svg",p0,[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,m0),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,f0),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,u0)]),e.createElementVNode("ellipse",{cx:"30",cy:"80",rx:"15",ry:"8",fill:`url(#cap-gradient-${o.value})`,stroke:"#1e293b","stroke-width":"1"},null,8,g0),e.createElementVNode("rect",{x:"15",y:"50",width:"30",height:"60",fill:`url(#cylinder-gradient-${o.value})`,stroke:"#334155","stroke-width":"1"},null,8,h0),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,y0),e.createElementVNode("rect",{x:"26",y:u.value,width:"8",height:g.value,fill:`url(#rod-gradient-${o.value})`,stroke:"#475569","stroke-width":"0.5"},null,8,b0),e.createElementVNode("ellipse",{cx:"30",cy:u.value,rx:"4",ry:"2",fill:"#94a3b8",stroke:"#64748b","stroke-width":"0.5"},null,8,k0),e.createElementVNode("ellipse",{cx:"30",cy:a.value,rx:"13",ry:"6",fill:"#64748b",stroke:"#334155","stroke-width":"1"},null,8,E0),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:m.value?48:50,y:"52",width:"6",height:"4",rx:"1",fill:m.value?"#22c55e":"#64748b",stroke:"#334155","stroke-width":"0.5"},null,8,N0),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,V0),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",x0,e.toDisplayString(r.value)+"mm ",1),e.createElementVNode("text",w0,e.toDisplayString(t.value)+"mm ",1)])),e.createElementVNode("div",{class:e.normalizeClass(["status-text",S.value])},e.toDisplayString(y.value),3)]))}}),[["__scopeId","data-v-7429604c"]]),C0={class:"pipe-3d-container"},_0=["viewBox"],v0=["id"],B0=["id"],S0=["stop-color"],D0=["stop-color"],I0=["stop-color"],T0={key:0},z0=["y","width","height","fill"],M0=["y","width","height"],A0=["x","y","width","height","fill"],P0=["cy","rx","ry"],O0=["cx","cy","rx","ry"],L0=["cy"],R0=["cy"],U0=["cx","cy"],W0=["cx","cy"],F0={key:1},G0=["x","width","height","fill"],j0=["x","width","height"],H0=["x","y","width","height","fill"],q0=["cx","rx","ry"],J0=["cx","cy","rx","ry"],Y0=["cx"],X0=["cx"],K0=["cx","cy"],Q0=["cx","cy"],Z0={key:2},e1=["id"],t1=["fill"],o1=["x1","y1","x2","y2","stroke","marker-end"],l1=["x1","y1","x2","y2","stroke","marker-end"],n1=O(e.defineComponent({__name:"Pipe3D",props:{node:{}},setup(s){const l=s,o=e.ref(`pipe-${Math.random().toString(36).substr(2,9)}`),i=()=>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),m=e.computed(()=>c.value/2),n=e.computed(()=>f.value),g=e.computed(()=>p.value==="horizontal"?`0 0 ${n.value} ${c.value+10}`:`0 0 ${c.value+10} ${n.value}`),u=e.computed(()=>(c.value+10)/2),a=e.computed(()=>(c.value+10)/2),y=e.ref(0);let S=null;const T=()=>{if(t.value){const k=r.value/5;y.value=(y.value+k)%n.value}S=requestAnimationFrame(T)},E=()=>{const k=i();t.value=k.state==="flowing"||k.state===!0,r.value=k.flowRate||10,p.value=k.direction||"horizontal",d.value=k.fluidColor||"#3b82f6",c.value=k.diameter||40,f.value=k.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(()=>{S&&cancelAnimationFrame(S)}),(k,h)=>(e.openBlock(),e.createElementBlock("div",C0,[(e.openBlock(),e.createElementBlock("svg",{viewBox:g.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,v0),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,S0),e.createElementVNode("stop",{offset:"50%","stop-color":d.value,"stop-opacity":"0.8"},null,8,D0),e.createElementVNode("stop",{offset:"100%","stop-color":d.value,"stop-opacity":"0.3"},null,8,I0)],8,B0)]),p.value==="horizontal"?(e.openBlock(),e.createElementBlock("g",T0,[e.createElementVNode("rect",{x:"0",y:u.value-m.value,width:n.value,height:m.value*2,fill:`url(#pipe-gradient-${o.value})`,stroke:"#334155","stroke-width":"1"},null,8,z0),e.createElementVNode("rect",{x:"0",y:u.value-m.value+3,width:n.value,height:m.value*2-6,fill:"#0f172a"},null,8,M0),t.value?(e.openBlock(),e.createElementBlock("rect",{key:0,x:y.value,y:u.value-m.value+5,width:n.value/2,height:m.value*2-10,fill:`url(#flow-gradient-${o.value})`},null,8,A0)):e.createCommentVNode("",!0),e.createElementVNode("g",null,[e.createElementVNode("ellipse",{cx:0,cy:u.value,rx:m.value+2,ry:m.value+2,fill:"#64748b",stroke:"#334155","stroke-width":"1"},null,8,P0),e.createElementVNode("ellipse",{cx:n.value,cy:u.value,rx:m.value+2,ry:m.value+2,fill:"#64748b",stroke:"#334155","stroke-width":"1"},null,8,O0),e.createElementVNode("circle",{cx:0,cy:u.value-m.value-2,r:"1.5",fill:"#1e293b"},null,8,L0),e.createElementVNode("circle",{cx:0,cy:u.value+m.value+2,r:"1.5",fill:"#1e293b"},null,8,R0),e.createElementVNode("circle",{cx:n.value,cy:u.value-m.value-2,r:"1.5",fill:"#1e293b"},null,8,U0),e.createElementVNode("circle",{cx:n.value,cy:u.value+m.value+2,r:"1.5",fill:"#1e293b"},null,8,W0)])])):(e.openBlock(),e.createElementBlock("g",F0,[e.createElementVNode("rect",{x:a.value-m.value,y:"0",width:m.value*2,height:n.value,fill:`url(#pipe-gradient-${o.value})`,stroke:"#334155","stroke-width":"1"},null,8,G0),e.createElementVNode("rect",{x:a.value-m.value+3,y:"0",width:m.value*2-6,height:n.value,fill:"#0f172a"},null,8,j0),t.value?(e.openBlock(),e.createElementBlock("rect",{key:0,x:a.value-m.value+5,y:y.value,width:m.value*2-10,height:n.value/2,fill:`url(#flow-gradient-${o.value})`},null,8,H0)):e.createCommentVNode("",!0),e.createElementVNode("g",null,[e.createElementVNode("ellipse",{cx:a.value,cy:0,rx:m.value+2,ry:m.value+2,fill:"#64748b",stroke:"#334155","stroke-width":"1"},null,8,q0),e.createElementVNode("ellipse",{cx:a.value,cy:n.value,rx:m.value+2,ry:m.value+2,fill:"#64748b",stroke:"#334155","stroke-width":"1"},null,8,J0),e.createElementVNode("circle",{cx:a.value-m.value-2,cy:0,r:"1.5",fill:"#1e293b"},null,8,Y0),e.createElementVNode("circle",{cx:a.value+m.value+2,cy:0,r:"1.5",fill:"#1e293b"},null,8,X0),e.createElementVNode("circle",{cx:a.value-m.value-2,cy:n.value,r:"1.5",fill:"#1e293b"},null,8,K0),e.createElementVNode("circle",{cx:a.value+m.value+2,cy:n.value,r:"1.5",fill:"#1e293b"},null,8,Q0)])])),t.value?(e.openBlock(),e.createElementBlock("g",Z0,[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,t1)],8,e1)]),p.value==="horizontal"?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.value/2-20,y1:u.value,x2:n.value/2+20,y2:u.value,stroke:d.value,"stroke-width":"2","marker-end":`url(#arrow-${o.value})`},null,8,o1)):(e.openBlock(),e.createElementBlock("line",{key:1,x1:a.value,y1:n.value/2-20,x2:a.value,y2:n.value/2+20,stroke:d.value,"stroke-width":"2","marker-end":`url(#arrow-${o.value})`},null,8,l1))])):e.createCommentVNode("",!0)],8,_0)),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"]]),a1={class:"filter-3d-container"},r1={viewBox:"0 0 120 100",xmlns:"http://www.w3.org/2000/svg"},i1=["id"],s1=["id"],d1=["stop-color"],c1=["stop-color"],p1=["fill"],m1=["fill"],f1={opacity:"0.5"},u1=["x1","x2"],g1=["y1","y2"],h1=["y","height"],y1={transform:"translate(80, 30)"},b1=["fill"],k1=["fill","opacity"],E1={key:0,attributeName:"opacity",values:"1;0.3;1",dur:"0.8s",repeatCount:"indefinite"},N1={x:"60",y:"95","font-size":"5",fill:"#64748b","text-anchor":"middle","font-family":"Arial"},V1=O(e.defineComponent({__name:"Filter3D",props:{node:{}},setup(s){const l=s,o=e.ref(`filter-${Math.random().toString(36).substr(2,9)}`),i=()=>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"),m=e.computed(()=>r.value>=15?"#ef4444":r.value>=10?"#f97316":"#22c55e"),n=e.computed(()=>t.value>=d.value),g=()=>{const u=i();t.value=Math.max(0,Math.min(100,u.clogLevel||20)),r.value=u.pressureDrop||5,p.value=u.diameter||50,d.value=u.alarmThreshold||70};return e.watch(()=>l.node,()=>{g()},{deep:!0}),e.onMounted(()=>{g(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{g()})}),(u,a)=>(e.openBlock(),e.createElementBlock("div",a1,[(e.openBlock(),e.createElementBlock("svg",r1,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`shell-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[...a[0]||(a[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,i1),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,d1),e.createElementVNode("stop",{offset:"100%","stop-color":f.value},null,8,c1)],8,s1)]),a[3]||(a[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,p1),a[4]||(a[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,m1),e.createElementVNode("g",f1,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(8,y=>e.createElementVNode("line",{key:`v-${y}`,x1:50+y*2.5,y1:"30",x2:50+y*2.5,y2:"70",stroke:"#1e293b","stroke-width":"0.5"},null,8,u1)),64)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(8,y=>e.createElementVNode("line",{key:`h-${y}`,x1:"50",y1:30+y*5,x2:"70",y2:30+y*5,stroke:"#1e293b","stroke-width":"0.5"},null,8,g1)),64))]),e.createElementVNode("rect",{x:"52",y:70-t.value*.4,width:"16",height:t.value*.4,fill:"#ef4444",opacity:"0.6"},null,8,h1)]),a[5]||(a[5]=e.createElementVNode("rect",{x:"95",y:"43",width:"25",height:"14",fill:"#64748b",stroke:"#334155","stroke-width":"1"},null,-1)),a[6]||(a[6]=e.createElementVNode("rect",{x:"55",y:"78",width:"10",height:"8",rx:"1",fill:"#334155",stroke:"#1e293b","stroke-width":"1"},null,-1)),a[7]||(a[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",y1,[a[1]||(a[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:m.value,"text-anchor":"middle","font-family":"monospace"},e.toDisplayString(r.value),9,b1),a[2]||(a[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",E1)):e.createCommentVNode("",!0)],8,k1),e.createElementVNode("text",N1," 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"]]),x1={class:"heat-exchanger-3d-container"},w1={viewBox:"0 0 140 120",xmlns:"http://www.w3.org/2000/svg"},$1=["id"],C1=["id"],_1=["id"],v1=["fill"],B1={opacity:"0.6"},S1=["y1","y2"],D1=["y","fill"],I1=["y","fill"],T1=["x","fill"],z1=["x","fill"],M1={transform:"translate(70, 60)"},A1=["fill"],P1={transform:"translate(95, 50)"},O1={x:"0",y:"-1","font-size":"6",fill:"#ef4444","text-anchor":"middle"},L1={x:"0",y:"6","font-size":"5",fill:"#f97316","text-anchor":"middle"},R1={transform:"translate(45, 70)"},U1={x:"0",y:"-1","font-size":"6",fill:"#3b82f6","text-anchor":"middle"},W1={x:"0",y:"6","font-size":"5",fill:"#60a5fa","text-anchor":"middle"},F1=["fill","opacity"],G1={key:0,attributeName:"opacity",values:"1;0.5;1",dur:"1.5s",repeatCount:"indefinite"},j1={x:"70",y:"115","font-size":"5",fill:"#64748b","text-anchor":"middle","font-family":"Arial"},H1=O(e.defineComponent({__name:"HeatExchanger3D",props:{node:{}},setup(s){const l=s,o=e.ref(`hex-${Math.random().toString(36).substr(2,9)}`),i=()=>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),m=e.computed(()=>{if(r.value<=p.value)return 0;const k=r.value-d.value,h=r.value-p.value,N=Math.round(h/k*100);return Math.max(0,Math.min(100,N))}),n=e.computed(()=>m.value>=80?"#22c55e":m.value>=60?"#fbbf24":m.value>=40?"#f97316":"#ef4444"),g=e.ref(0),u=e.ref(0),a=e.ref(0),y=e.ref(0);let S=null;const T=()=>{t.value&&(g.value=(g.value+.5)%20,u.value=(u.value+.5)%20,a.value=(a.value+.5)%20,y.value=(y.value+.5)%20),S=requestAnimationFrame(T)},E=()=>{const k=i();t.value=k.state==="working"||k.state===!0,r.value=k.hotTempIn||80,p.value=k.hotTempOut||50,d.value=k.coldTempIn||20,c.value=k.coldTempOut||40,f.value=k.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(()=>{S&&cancelAnimationFrame(S)}),(k,h)=>(e.openBlock(),e.createElementBlock("div",x1,[(e.openBlock(),e.createElementBlock("svg",w1,[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,$1),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,C1),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,_1)]),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,v1),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",B1,[(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,S1)),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+g.value,width:"10",height:"8",fill:`url(#hot-fluid-${o.value})`},null,8,D1)):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+u.value,width:"10",height:"8",fill:`url(#hot-fluid-${o.value})`,opacity:"0.7"},null,8,I1)):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:a.value,y:"56",width:"8",height:"8",fill:`url(#cold-fluid-${o.value})`},null,8,T1)):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+y.value,y:"56",width:"8",height:"8",fill:`url(#cold-fluid-${o.value})`,opacity:"0.7"},null,8,z1)):e.createCommentVNode("",!0)]),e.createElementVNode("g",M1,[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(m.value),9,A1),h[12]||(h[12]=e.createElementVNode("text",{x:"0",y:"8","font-size":"4",fill:"#64748b","text-anchor":"middle"},"%",-1))]),e.createElementVNode("g",P1,[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",O1,e.toDisplayString(r.value)+"°C",1),e.createElementVNode("text",L1,"→"+e.toDisplayString(p.value)+"°C",1)]),e.createElementVNode("g",R1,[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",U1,e.toDisplayString(d.value)+"°C",1),e.createElementVNode("text",W1,"→"+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",G1)):e.createCommentVNode("",!0)],8,F1),e.createElementVNode("text",j1," 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(m.value)+"% ",3)]))}}),[["__scopeId","data-v-ed672204"]]),q1={class:"tee-3d-container"},J1={viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg"},Y1=["id"],X1=["id"],K1=["stop-color"],Q1=["stop-color"],Z1=["fill"],eu=["fill"],tu=["fill"],ou={key:0},lu=["fill"],nu=["x","fill"],au=["x","fill"],ru=["y","fill"],iu=["y","fill"],su={key:1},du=["id"],cu=["fill"],pu=["stroke","marker-end"],mu=["stroke","marker-end"],fu=["stroke","marker-end"],uu={transform:"translate(50, 50)"},gu=["fill"],hu=O(e.defineComponent({__name:"Tee3D",props:{node:{}},setup(s){const l=s,o=e.ref(`tee-${Math.random().toString(36).substr(2,9)}`),i=()=>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),m=e.ref(0),n=e.ref(0);let g=null;const u=()=>{t.value&&(c.value=(c.value+1)%40,f.value=(f.value+1)%20,m.value=(m.value+1)%20,n.value=(n.value+1)%20),g=requestAnimationFrame(u)},a=()=>{const y=i();t.value=y.state==="flowing"||y.state===!0,r.value=y.fluidColor||"#3b82f6",p.value=y.topFlowEnabled!==!1,d.value=y.bottomFlowEnabled!==!1};return e.watch(()=>l.node,()=>{a()},{deep:!0}),e.onMounted(()=>{a(),u(),l.node&&typeof l.node.on=="function"&&l.node.on("change:data",()=>{a()})}),e.onUnmounted(()=>{g&&cancelAnimationFrame(g)}),(y,S)=>(e.openBlock(),e.createElementBlock("div",q1,[(e.openBlock(),e.createElementBlock("svg",J1,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`pipe-gradient-${o.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[...S[0]||(S[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,Y1),e.createElementVNode("radialGradient",{id:`flow-gradient-${o.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":r.value,"stop-opacity":"0.8"},null,8,K1),e.createElementVNode("stop",{offset:"100%","stop-color":r.value,"stop-opacity":"0.2"},null,8,Q1)],8,X1)]),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,Z1),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,eu),e.createElementVNode("circle",{cx:"50",cy:"50",r:"18",fill:`url(#pipe-gradient-${o.value})`,stroke:"#334155","stroke-width":"2"},null,8,tu),S[3]||(S[3]=e.createElementVNode("rect",{x:"0",y:"43",width:"100",height:"14",fill:"#0f172a"},null,-1)),S[4]||(S[4]=e.createElementVNode("rect",{x:"43",y:"0",width:"14",height:"100",fill:"#0f172a"},null,-1)),S[5]||(S[5]=e.createElementVNode("circle",{cx:"50",cy:"50",r:"15",fill:"#0f172a"},null,-1)),t.value?(e.openBlock(),e.createElementBlock("g",ou,[e.createElementVNode("circle",{cx:"50",cy:"50",r:"12",fill:`url(#flow-gradient-${o.value})`},[...S[1]||(S[1]=[e.createElementVNode("animate",{attributeName:"r",values:"8;14;8",dur:"1.5s",repeatCount:"indefinite"},null,-1)])],8,lu),e.createElementVNode("rect",{x:c.value,y:"45",width:"20",height:"10",fill:r.value,opacity:"0.6"},null,8,nu),e.createElementVNode("rect",{x:60+f.value,y:"45",width:"20",height:"10",fill:r.value,opacity:"0.4"},null,8,au),e.createElementVNode("rect",{x:"45",y:m.value,width:"10",height:"20",fill:r.value,opacity:"0.4"},null,8,ru),e.createElementVNode("rect",{x:"45",y:60+n.value,width:"10",height:"20",fill:r.value,opacity:"0.4"},null,8,iu)])):e.createCommentVNode("",!0),S[6]||(S[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",su,[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,cu)],8,du)]),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,pu),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,mu)):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,fu)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("g",uu,[S[2]||(S[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,gu)])])),e.createElementVNode("div",{class:e.normalizeClass(["status-text",{"is-flowing":t.value}])},e.toDisplayString(t.value?"流动中":"关闭"),3)]))}}),[["__scopeId","data-v-cd328987"]]);class yu{constructor(){ke(this,"animations",new Map)}startAnimation(l,o){if(!l||o.type==="none")return;this.stopAnimation(l.id);const i=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(i,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 i=l.getAttrByPath("body/opacity")||1;let t=!0;const r=setInterval(()=>{t=!t,l.setAttrByPath("body/opacity",t?i:.2),o.loop||(clearInterval(r),l.setAttrByPath("body/opacity",i))},o.duration/2);return{intervalId:r,stop:()=>{clearInterval(r),l.setAttrByPath("body/opacity",i)}}}createScaleAnimation(l,o){const i=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(i.width*p,i.height*p),!o.loop&&p>=.99&&p<=1.01&&(clearInterval(d),l.resize(i.width,i.height))},o.duration/20);return{intervalId:d,stop:()=>{clearInterval(d),l.resize(i.width,i.height)}}}createRotateAnimation(l,o){let i=0;const t=360/(o.duration/50),r=setInterval(()=>{i=(i+t)%360,l.rotate(i,{absolute:!0}),!o.loop&&i>=360&&(clearInterval(r),l.rotate(0,{absolute:!0}))},50);return{intervalId:r,stop:()=>{clearInterval(r),l.rotate(0,{absolute:!0})}}}createFloatAnimation(l,o){const i=l.position();let t=!0;const r=2;let p=i.y;const d=setInterval(()=>{t?(p-=r,p<=i.y-10&&(t=!1)):(p+=r,p>=i.y+10&&(t=!0)),l.position(i.x,p),!o.loop&&Math.abs(p-i.y)<1&&(clearInterval(d),l.position(i.x,i.y))},o.duration/40);return{intervalId:d,stop:()=>{clearInterval(d),l.position(i.x,i.y)}}}createPulseAnimation(l,o){const i=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",i),l.setAttrByPath("body/stroke",t),l.setAttrByPath("body/opacity",1))},o.duration/20);return{intervalId:d,stop:()=>{clearInterval(d),l.setAttrByPath("body/fill",i),l.setAttrByPath("body/stroke",t),l.setAttrByPath("body/opacity",1)}}}clearAll(){this.animations.forEach((l,o)=>{this.stopAnimation(o)}),this.animations.clear()}}const de=new yu,bu={class:"scada-layout","data-scada-theme":"dark"},ku={class:"scada-canvas-container"},_t=O(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},deviceData:{default:()=>({})},dataSource:{default:()=>({})}},emits:["preview"],setup(s,{expose:l,emit:o}){const i=s,t=o,r=e.ref(null),p=e.ref(null),d=e.ref(null),c=e.ref(0),f=e.ref(null),m=e.ref(!1);let n=null;const g=()=>{var H,Z;const b=(Z=(H=r.value)==null?void 0:H.containerRef)==null?void 0:Z.parentElement;if(!b)return 1;const x=W.getConfig(),$=x.size.width,v=x.size.height,A=b.clientWidth,q=b.clientHeight,L=40,j=A-L,Y=q-L,X=j/$,P=Y/v;return Math.min(X,P,1)};e.onMounted(()=>{var Y,X;if(!((Y=r.value)!=null&&Y.containerRef))return;const b=W.getConfig();te.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),ne({shape:"echarts-vue",width:300,height:300,component:up,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"}]}}),ne({shape:"echarts-line-vue",width:400,height:300,component:gp,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"}]}}),ne({shape:"light-3d-vue",width:100,height:120,component:Mp,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"}]}}),ne({shape:"switch-3d-vue",width:140,height:100,component:Kp,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"}]}}),ne({shape:"motor-3d-vue",width:140,height:110,component:cm,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"}]}}),ne({shape:"valve-3d-vue",width:100,height:140,component:Cm,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"}]}}),ne({shape:"tank-3d-vue",width:120,height:160,component:Fm,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"}]}}),ne({shape:"pump-3d-vue",width:160,height:120,component:pf,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"}]}}),ne({shape:"conveyor-3d-vue",width:220,height:100,component:_f,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"}]}}),ne({shape:"alarm-light-3d-vue",width:100,height:120,component:qf,ports:{groups:{bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-bottom",group:"bottom"}]}}),ne({shape:"temperature-sensor-3d-vue",width:100,height:140,component:d0,ports:{groups:{bottom:{position:"bottom",attrs:{circle:{r:4,magnet:!0,stroke:"#31d0c6",strokeWidth:2,fill:"#fff"}}}},items:[{id:"port-bottom",group:"bottom"}]}}),ne({shape:"cylinder-3d-vue",width:80,height:160,component:$0,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"}]}}),ne({shape:"pipe-3d-vue",width:220,height:60,component:n1,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"}]}}),ne({shape:"filter-3d-vue",width:140,height:120,component:V1,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"}]}}),ne({shape:"heat-exchanger-3d-vue",width:160,height:140,component:H1,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"}]}}),ne({shape:"tee-3d-vue",width:120,height:120,component:hu,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,$=b.size.width,v=b.size.height,A=P=>{x.style.width=`${$}px`,x.style.height=`${v}px`,x.style.transform=`scale(${P})`,x.style.transformOrigin="center center",W.updateByPath("zoom.scale",Number(P.toFixed(2)))},q=g();A(q);const L=()=>{const P=g();A(P)};if(window.addEventListener("resize",L),n=new te.Graph({container:x,width:$,height:v,background:b.background.image?{color:b.background.color||"#1e293b",image:b.background.image,size:b.background.size||"cover",repeat:b.background.repeat||"no-repeat",position:"center"}:{color:b.background.color||"#1e293b"},grid:b.grid.enabled?{size:b.grid.size,visible:!0,type:b.grid.type||"dot",args:{color:b.grid.color||"#475569",thickness:1}}:!1,interacting:{nodeMovable:!i.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:b.magnetism.enabled?{radius:b.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:P}){return!!P}}}),i.previewMode||n.use(new qe.Selection({enabled:!0,movable:!0,rubberband:!0,showNodeSelectionBox:!1,showEdgeSelectionBox:!1,multiple:!0,pointerEvents:"none"})),b.guides.enabled&&n.use(new Dt.Snapline({enabled:!0,sharp:!0,clean:!0})),!i.previewMode){const P=kt(fe.SCADA_EDITOR_DATA);if(((X=P==null?void 0:P.cells)==null?void 0:X.length)>0)try{const J=P.cells.map(H=>{var Z;return H.position&&typeof H.position=="object"&&(typeof H.position.x!="number"||typeof H.position.y!="number")&&(H.position={x:100,y:100}),(H.shape==="edge"||H.shape==="animated-edge")&&(H.router==="manhattan"||((Z=H.router)==null?void 0:Z.name)==="manhattan")&&(H.router={name:"orth",args:{padding:10}}),H});n.fromJSON({cells:J}),n.getEdges().forEach(H=>{var K;const Z=H.getData();(K=Z==null?void 0:Z.animation)!=null&&K.enabled&&h(H,Z.animation)})}catch(J){console.error("恢复画布数据失败,清空缓存:",J),sessionStorage.removeItem(fe.SCADA_EDITOR_DATA)}}n.on("selection:changed",({selected:P})=>{var H,Z;const J=P?P.filter(K=>K.isNode()):[];if(c.value=J.length,P&&P.length>0){const K=P[0];if(K.isNode())p.value=K,d.value=null;else if(K.isEdge()){d.value=K,p.value=null;const ge=K.getAttrs();K.data={...K.data,originalAttrs:ge},K.attr("line/stroke","#3b82f6")}}else{if(d.value&&((H=d.value.data)!=null&&H.originalAttrs)){const K=d.value.data.originalAttrs;d.value.attr("line/stroke",((Z=K.line)==null?void 0:Z.stroke)||"#10b981")}p.value=null,d.value=null}}),n.on("edge:click",({edge:P})=>{n.select(P)}),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:P})=>{const J=P.getData();if(J.animation)if(J.animation.enabled===!0){const H={type:J.animation.type||"none",duration:J.animation.duration||1e3,loop:J.animation.loop!==!1};de.startAnimation(P,H)}else de.stopAnimation(P.id)}),n.on("edge:change:data",({edge:P})=>{const J=P.getData();J!=null&&J.animation&&h(P,J.animation)});const j=P=>{if(P.key==="Delete"&&n){if(p.value){const J=p.value.id;de.stopAnimation(J),n.removeNode(J),p.value=null}else if(d.value){const J=d.value.id;n.removeEdge(J),d.value=null}}};document.addEventListener("keydown",j),e.onUnmounted(()=>{document.removeEventListener("keydown",j),window.removeEventListener("resize",L)})}),e.onUnmounted(()=>{if(n){de.clearAll();const b={cells:n.toJSON().cells};Pe(fe.SCADA_EDITOR_DATA,b),n.dispose()}}),e.watch(()=>W.getConfig(),b=>{var $;if(!n)return;b.background.image?n.drawBackground({color:b.background.color||"#1e293b",image:b.background.image,size:b.background.size||"cover",repeat:b.background.repeat||"no-repeat",position:"center"}):n.drawBackground({color:b.background.color||"#1e293b"});const x=($=r.value)==null?void 0:$.containerRef;if(x){n.resize(b.size.width,b.size.height),x.style.width=`${b.size.width}px`,x.style.height=`${b.size.height}px`;const v=g(),A=b.zoom.scale>v?b.zoom.scale:v;x.style.transform=`scale(${A})`,x.style.transformOrigin="center center"}b.grid.enabled?(n.drawGrid({type:b.grid.type||"dot",args:{color:b.grid.color||"#475569",thickness:1}}),n.showGrid()):n.hideGrid(),b.grid.enabled&&b.grid.size&&n.setGridSize(b.grid.size),n.translate(b.offset.x,b.offset.y)},{deep:!0});const u=e.ref({}),a=(b,x)=>(u.value[b]||(u.value[b]=0),u.value[b]++,`${x}_${u.value[b]}`),y=b=>{var j,Y,X,P;if(!n)return;const x=he.getComponent(b);if(!x){console.error(`未找到组件配置: ${b}`);return}const $=a(b,x.metadata.name),v={enabled:!1,type:"none",duration:1e3,loop:!0},A=xt(50,50,400,300),q={x:A.x,y:A.y,shape:x.shape,width:x.width,height:x.height,label:x.label,attrs:x.attrs,ports:x.ports,data:{...x.data,componentType:b,componentName:$,props:x.props,animation:v,originalStroke:((Y=(j=x.attrs)==null?void 0:j.body)==null?void 0:Y.stroke)||"#2563eb",originalStrokeWidth:((P=(X=x.attrs)==null?void 0:X.body)==null?void 0:P.strokeWidth)||2}},L=n.addNode(q);console.log("[Node] 添加节点:",x.shape,L.id,q),n.cleanSelection(),n.select(L)},S=b=>{if(p.value&&(b.attrs&&Object.keys(b.attrs).forEach(x=>{const $=b.attrs[x];typeof $=="object"?Object.keys($).forEach(v=>{p.value.attr(`${x}/${v}`,$[v])}):p.value.attr(x,$)}),b.position&&(typeof b.position.x=="number"&&typeof b.position.y=="number"?p.value.setPosition(b.position):console.error("position 数据格式错误:",b.position)),b.size&&(typeof b.size.width=="number"&&typeof b.size.height=="number"?p.value.setSize(b.size):console.error("size 数据格式错误:",b.size)),b.data)){const x={...b.data};delete x.position,delete x.size,p.value.setData(x)}},T=()=>{if(!p.value||!n)return;const b=p.value.id;de.stopAnimation(b),n.removeNode(b),p.value=null},E=b=>{if(d.value){if(b.attrs){Object.keys(b.attrs).forEach($=>{const v=b.attrs[$];typeof v=="object"?Object.keys(v).forEach(A=>{var q,L;d.value.attr(`${$}/${A}`,v[A]),(L=(q=d.value.data)==null?void 0:q.originalAttrs)!=null&&L[$]&&(d.value.data.originalAttrs[$][A]=v[A])}):d.value.attr($,v)});const x=d.value.getAttrs();d.value.data={...d.value.data,originalAttrs:x},d.value.attr("line/stroke","#3b82f6")}b.router&&d.value.setRouter(b.router),b.connector&&d.value.setConnector(b.connector),b.animation&&h(d.value,b.animation),b.data&&d.value.setData({...d.value.data,...b.data})}},k=()=>{!d.value||!n||(n.removeEdge(d.value.id),d.value=null)},h=(b,x)=>{if(!b||typeof b.attr!="function"){console.warn("applyEdgeAnimation: edge 对象无效",b);return}if(!x||!x.enabled){b.attr("line/strokeDasharray",void 0),typeof b.removeAttr=="function"&&b.removeAttr("line/class"),b.attr("circle",void 0),typeof b.stopTransition=="function"&&b.stopTransition("attrs/circle/atConnectionRatio");return}const $=x.duration||2e3;b.attr("circle",{r:4,atConnectionRatio:0,fill:{type:"radialGradient",stops:[{offset:"0%",color:"#FFF"},{offset:"100%",color:b.attr("line/stroke")||"#10b981"}]},stroke:b.attr("line/stroke")||"#10b981",strokeWidth:1});const v=()=>{b.attr("circle/atConnectionRatio",0,{silent:!0}),b.transition("attrs/circle/atConnectionRatio",1,{delay:0,duration:$,timing:"linear",complete:()=>{v()}})};v()},N=()=>{n&&confirm("确定要清空画布吗?")&&(de.clearAll(),n.clearCells(),p.value=null,Et(fe.SCADA_EDITOR_DATA))},V=()=>{if(!n)return;const b=W.getConfig().zoom.scale,x=Math.min(5,b+.1);W.setZoom(x)},z=()=>{if(!n)return;const b=W.getConfig().zoom.scale,x=Math.max(.1,b-.1);W.setZoom(x)},F=()=>{if(!n)return;const b=n.getSelectedCells().filter($=>$.isNode());if(b.length<2){Q("请选择至少两个节点","warning");return}const x=Math.min(...b.map($=>$.getPosition().x));b.forEach($=>{$.setPosition({x,y:$.getPosition().y})})},U=()=>{if(!n)return;const b=n.getSelectedCells().filter(v=>v.isNode());if(b.length<2){Q("请选择至少两个节点","warning");return}const x=b.map(v=>v.getPosition().x+v.getSize().width/2),$=x.reduce((v,A)=>v+A,0)/x.length;b.forEach(v=>{const A=$-v.getSize().width/2;v.setPosition({x:A,y:v.getPosition().y})})},_=()=>{if(!n)return;const b=n.getSelectedCells().filter($=>$.isNode());if(b.length<2){Q("请选择至少两个节点","warning");return}const x=Math.max(...b.map($=>$.getPosition().x+$.getSize().width));b.forEach($=>{const v=x-$.getSize().width;$.setPosition({x:v,y:$.getPosition().y})})},B=()=>{if(!n)return;const b=n.getSelectedCells().filter($=>$.isNode());if(b.length<2){Q("请选择至少两个节点","warning");return}const x=Math.min(...b.map($=>$.getPosition().y));b.forEach($=>{$.setPosition({x:$.getPosition().x,y:x})})},M=()=>{if(!n)return;const b=n.getSelectedCells().filter(v=>v.isNode());if(b.length<2){Q("请选择至少两个节点","warning");return}const x=b.map(v=>v.getPosition().y+v.getSize().height/2),$=x.reduce((v,A)=>v+A,0)/x.length;b.forEach(v=>{const A=$-v.getSize().height/2;v.setPosition({x:v.getPosition().x,y:A})})},ee=()=>{if(!n)return;const b=n.getSelectedCells().filter($=>$.isNode());if(b.length<2){Q("请选择至少两个节点","warning");return}const x=Math.max(...b.map($=>$.getPosition().y+$.getSize().height));b.forEach($=>{const v=x-$.getSize().height;$.setPosition({x:$.getPosition().x,y:v})})},ae=()=>{if(!n)return;const b=n.getSelectedCells().filter(L=>L.isNode());if(b.length<3){Q("请选择至少三个节点","warning");return}const x=b.sort((L,j)=>L.getPosition().x-j.getPosition().x),$=x[0],q=(x[x.length-1].getPosition().x-$.getPosition().x)/(x.length-1);x.forEach((L,j)=>{if(j===0||j===x.length-1)return;const Y=$.getPosition().x+q*j;L.setPosition({x:Y,y:L.getPosition().y})})},ue=()=>{if(!n)return;const b=n.getSelectedCells().filter(L=>L.isNode());if(b.length<3){Q("请选择至少三个节点","warning");return}const x=b.sort((L,j)=>L.getPosition().y-j.getPosition().y),$=x[0],q=(x[x.length-1].getPosition().y-$.getPosition().y)/(x.length-1);x.forEach((L,j)=>{if(j===0||j===x.length-1)return;const Y=$.getPosition().y+q*j;L.setPosition({x:L.getPosition().x,y:Y})})},Ne=async()=>{if(!n){Q("画布未初始化","error");return}try{if(console.log("[ScadaCanvas] handleSave 被调用"),console.log("[ScadaCanvas] props.onSave:",i.onSave),i.onSave){console.log("[ScadaCanvas] 调用自定义 onSave 回调"),await i.onSave(),console.log("[ScadaCanvas] 自定义 onSave 回调执行完成");return}console.log("[ScadaCanvas] 没有自定义回调,执行默认下载");const b={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(b,null,2)],{type:"application/json"}),$=URL.createObjectURL(x),v=document.createElement("a"),A=`scada-canvas-${new Date().getTime()}.json`;v.href=$,v.download=A,v.click(),URL.revokeObjectURL($),Q("保存成功","success")}catch(b){console.error("保存失败",b),Q("保存失败,请查看控制台","error")}},re=()=>{f.value&&f.value.click()},Fe=b=>{var A;const $=(A=b.target.files)==null?void 0:A[0];if(!$){Q("请选择文件","error");return}const v=new FileReader;v.onload=q=>{var L;try{const j=JSON.parse((L=q.target)==null?void 0:L.result);if(!j.cells){Q("无效的JSON文件格式","error");return}if(!confirm("导入将清空当前画布,是否继续?"))return;if(n){if(n.clearCells(),n.fromJSON({cells:j.cells}),n.getEdges().forEach(Y=>{var P;const X=Y.getData();(P=X==null?void 0:X.animation)!=null&&P.enabled&&h(Y,X.animation)}),j.config&&W.updateConfig(j.config),j.workflows&&Array.isArray(j.workflows)&&j.workflows.length>0)try{const Y=localStorage.getItem("saved-workflows"),X=Y?JSON.parse(Y):[];let P=0,J=0;j.workflows.forEach(H=>{const Z=X.findIndex(K=>K.id===H.id);Z>=0?(X[Z]={...H,updatedAt:Date.now()},J++):(X.push(H),P++)}),localStorage.setItem("saved-workflows",JSON.stringify(X)),Q(`导入成功 画布已加载,流程: 新增${P}个,更新${J}个`,"success")}catch(Y){console.error("导入流程数据失败:",Y),Q("画布导入成功, 但流程数据导入失败","warning")}else Q("导入成功","success");f.value&&(f.value.value="")}}catch(j){console.error("导入失败",j),Q("导入失败,JSON格式错误","error"),f.value&&(f.value.value="")}},v.readAsText($)},Ve=()=>{if(console.log("🎬 [ScadaCanvas] handlePreview 被调用"),!n){console.error("⚠️ [ScadaCanvas] graph 不存在");return}const b={cells:n.toJSON().cells,config:{width:W.getConfig().size.width,height:W.getConfig().size.height,background:W.getConfig().background,grid:W.getConfig().grid}};Pe(fe.SCADA_PREVIEW_DATA,b),console.log("✅ [ScadaCanvas] 数据已保存到 sessionStorage"),console.log("📤 [ScadaCanvas] 即将触发 preview 事件"),t("preview"),console.log("✅ [ScadaCanvas] preview 事件已触发")},xe=()=>{m.value=!0},we=()=>{if(!n){Q("画布未初始化","error");return}try{const b={version:"1.0.0",timestamp:Le(Re()),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(v=>({id:v.id,type:v.shape,position:v.getPosition(),size:v.getSize(),label:v.attr("label/text"),data:v.getData()})),edges:n.getEdges().map(v=>({id:v.id,source:v.getSourceCellId(),target:v.getTargetCellId()})),workflows:[]},x=new Set;if(n.getNodes().forEach(v=>{const A=v.getData();A!=null&&A.events&&Array.isArray(A.events)&&A.events.forEach(q=>{var L;q.action==="callProcess"&&((L=q.params)!=null&&L.processId)&&x.add(q.params.processId)})}),x.size>0)try{const v=localStorage.getItem("saved-workflows");if(v){const A=JSON.parse(v);b.workflows=A.filter(q=>x.has(q.id))}}catch(v){console.error("加载流程数据失败:",v)}const $=Nt(b,"scada-export");Q(`已导出为 ${$}`,"success")}catch(b){console.error("导出失败",b),Q("导出失败,请查看控制台","error")}};return l({save:Ne,import:re,export:we,preview:Ve,workflow:xe,zoomIn:V,zoomOut:z,clearAll:N,alignLeft:F,alignCenter:U,alignRight:_,alignTop:B,alignMiddle:M,alignBottom:ee,distributeHorizontal:ae,distributeVertical:ue,addNode:y,updateNode:S,deleteNode:T,getSelectedNode:()=>p.value,selectNode:b=>{if(!n)return!1;const x=n.getCellById(b);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:Le(Re()),config:W.getConfig(),cells:n.toJSON().cells,nodes:n.getNodes().map(b=>({id:b.id,type:b.shape,position:b.getPosition(),size:b.getSize(),label:b.attr("label/text"),data:b.getData()})),edges:n.getEdges().map(b=>({id:b.id,source:b.getSourceCellId(),target:b.getTargetCellId()}))}:null,loadCanvasData:b=>{if(!n)return!1;try{return n.clearCells(),n.fromJSON({cells:b.cells}),b.config&&W.updateConfig(b.config),n.getEdges().forEach(x=>{var v;const $=x.getData();(v=$==null?void 0:$.animation)!=null&&v.enabled&&h(x,$.animation)}),!0}catch(x){return console.error("加载画布数据失败:",x),!1}},getAllNodes:()=>n?n.getNodes().map(b=>({id:b.id,type:b.shape,position:b.getPosition(),size:b.getSize(),label:b.attr("label/text"),data:b.getData()})):[],getNodeById:b=>{if(!n)return null;const x=n.getCellById(b);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:b=>{W.updateConfig(b)},setZoom:b=>{W.setZoom(b)},setCanvasSize:(b,x)=>{W.updateSize({width:b,height:x})},setBackgroundColor:b=>{W.updateBackground({color:b})},updateDeviceData:b=>{n&&(b!=null&&b.devices)&&b.devices.forEach(x=>{var $;($=x.points)==null||$.forEach(v=>{n&&n.getNodes().forEach(A=>{const q=A.getData();q!=null&&q.bindings&&Object.entries(q.bindings).forEach(([L,j])=>{if(j.deviceId===x.id&&j.dataPoint===v.id){const Y=v.value;if(L==="attrs/text/text")A.attr("text/text",Y);else if(L==="attrs/body/fill")A.attr("body/fill",Y);else{const X=L.split(".");let P=A;for(let H=0;H<X.length-1;H++)P=P[X[H]];const J=X[X.length-1];P&&J&&(P[J]=Y)}}})})})})},getAnimationEngine:()=>de}),(b,x)=>(e.openBlock(),e.createElementBlock("div",bu,[i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ce,{key:0,"selected-nodes-count":c.value,onSave:Ne,onImport:re,onWorkflow:xe,onPreview:Ve,onExport:we,onZoomIn:V,onZoomOut:z,onClearAll:N,onAlignLeft:F,onAlignCenter:U,onAlignRight:_,onAlignTop:B,onAlignMiddle:M,onAlignBottom:ee,onDistributeHorizontal:ae,onDistributeVertical:ue},null,8,["selected-nodes-count"])),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("input",{key:1,ref_key:"fileInputRef",ref:f,type:"file",accept:".json",style:{display:"none"},onChange:Fe},null,544)),e.createElementVNode("div",ku,[i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Be,{key:0,onAddComponent:y})),e.createVNode(Bo,{ref_key:"canvasAreaRef",ref:r},null,512),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ue,{key:1,ref:"propertyPanelRef","selected-node":p.value,"selected-edge":d.value,onUpdateNode:S,onDeleteNode:T,onUpdateEdge:E,onDeleteEdge:k},null,8,["selected-node","selected-edge"]))]),e.createVNode(vd,{"auth-code":s.authCode,"custom-footer":s.customFooter},null,8,["auth-code","custom-footer"]),i.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(fp,{key:2,visible:m.value,"onUpdate:visible":x[0]||(x[0]=$=>m.value=$),"scada-graph":e.unref(n),onClose:x[1]||(x[1]=$=>m.value=!1)},null,8,["visible","scada-graph"]))]))}}),[["__scopeId","data-v-8df52ee5"]]),Eu={ScadaCanvas:_t,PropertyPanel:Ue,Header:Ce,ComponentLibrary:Be,CanvasConfigPanel:Se,BindingCard:ze,EventCard:Ie,BasicPropertiesTab:De,AttributeConfigDialog:Me,CustomCodeDialog:Ae},vt=s=>{Object.entries(Eu).forEach(([l,o])=>{s.component(l,o)})},Nu={install:vt,version:"1.0.0"};D.AttributeConfigDialog=Me,D.BasicComponents=so,D.BasicPropertiesTab=De,D.BindingCard=ze,D.CanvasConfigPanel=Se,D.ComponentLibrary=Be,D.CustomCodeDialog=Ae,D.DeviceStatus=pe,D.DeviceType=me,D.EventCard=Ie,D.Header=Ce,D.IoTComponents=mo,D.PointAccessMode=le,D.PointDataType=oe,D.PropertyPanel=Ue,D.STORAGE_KEYS=fe,D.ScadaCanvas=_t,D.animationEngine=de,D.canvasConfigItems=uo,D.canvasConfigManager=W,D.componentRegistry=he,D.default=Nu,D.defaultCanvasConfig=ve,D.exportToJSON=Nt,D.formatTimestamp=Le,D.generateEventId=Vt,D.generateNodeId=Js,D.generateUniqueId=Oe,D.getCurrentTimestamp=Re,D.install=vt,D.loadFromLocal=Hs,D.loadFromSession=kt,D.randomPosition=xt,D.removeFromLocal=qs,D.removeFromSession=Et,D.saveToLocal=js,D.saveToSession=Pe,D.showMessage=Q,D.sizePresetMap=ye,Object.defineProperties(D,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});