@nywqs/scada-engine 1.1.21 → 1.1.23

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