@nywqs/scada-engine 1.1.23 → 1.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/scada-engine.css +1 -1
- package/dist/scada-engine.es.js +1059 -1077
- package/dist/scada-engine.umd.js +6 -6
- package/dist/views/preview/PreviewView.d.ts +1 -0
- package/package.json +1 -1
package/dist/scada-engine.umd.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(I,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@antv/x6"),require("@antv/x6-plugin-selection"),require("@antv/x6-plugin-snapline"),require("echarts")
|
|
2
|
-
* @nywqs/scada-engine v1.1.
|
|
1
|
+
(function(I,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@antv/x6"),require("@antv/x6-plugin-selection"),require("@antv/x6-plugin-snapline"),require("echarts")):typeof define=="function"&&define.amd?define(["exports","vue","@antv/x6","@antv/x6-plugin-selection","@antv/x6-plugin-snapline","echarts"],e):(I=typeof globalThis<"u"?globalThis:I||self,e(I.ScadaEngine={},I.Vue,I.X6,I.X6PluginSelection,I.X6PluginSnapline,I.echarts))})(this,function(I,e,ee,Ke,zt,Mt){"use strict";var U1=Object.defineProperty;var W1=(I,e,ee)=>e in I?U1(I,e,{enumerable:!0,configurable:!0,writable:!0,value:ee}):I[e]=ee;var ke=(I,e,ee)=>W1(I,typeof e!="symbol"?e+"":e,ee);/*!
|
|
2
|
+
* @nywqs/scada-engine v1.1.25
|
|
3
3
|
* Copyright (c) 2025 leoncheng
|
|
4
4
|
* Licensed under proprietary license - see LICENSE file
|
|
5
5
|
* Contact: nywqs@outlook.com
|
|
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=">" data-v-af7c633a>大于</option><option value=">=" data-v-af7c633a>大于等于</option><option value="<" data-v-af7c633a>小于</option><option value="<=" data-v-af7c633a>小于等于</option><option value="contains" data-v-af7c633a>包含</option>',7)])],40,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) {
|
|
6
|
+
*/function At(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=At(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 Pt=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=Pt(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 Ot={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Lt=e.defineComponent({name:"AlignHorizontalCenter",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ot,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)]))}}),Rt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ut=e.defineComponent({name:"AlignHorizontalLeft",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Rt,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)]))}}),Wt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Ft=e.defineComponent({name:"AlignHorizontalRight",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Wt,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)]))}}),Gt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},jt=e.defineComponent({name:"AlignVerticalBottom",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Gt,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)]))}}),Ht={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},qt=e.defineComponent({name:"AlignVerticalCenter",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Ht,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"},Yt=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)]))}}),Xt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Kt=e.defineComponent({name:"DistributeHorizontalCenter",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Xt,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)]))}}),Qt={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},Zt=e.defineComponent({name:"DistributeVerticalCenter",render:function(l,o){return e.openBlock(),e.createElementBlock("svg",Qt,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)]))}}),eo={class:"scada-header"},to={class:"header-left"},oo={class:"header-center"},lo={class:"tool-group"},no={key:0,class:"divider"},ao={key:1,class:"tool-group"},ro={key:2,class:"divider"},io={key:3,class:"tool-group"},so={class:"header-right"},co={class:"tool-group"},po=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",eo,[e.createElementVNode("div",to,[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",oo,[e.createElementVNode("div",lo,[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",no)):e.createCommentVNode("",!0),o.selectedNodesCount>=2?(e.openBlock(),e.createElementBlock("div",ao,[e.createElementVNode("button",{class:"toolbar-btn",onClick:a[3]||(a[3]=c=>r("alignLeft")),title:"左对齐"},[e.createVNode(e.unref(Ut),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:a[4]||(a[4]=c=>r("alignCenter")),title:"水平居中"},[e.createVNode(e.unref(Lt),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:a[5]||(a[5]=c=>r("alignRight")),title:"右对齐"},[e.createVNode(e.unref(Ft),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:a[6]||(a[6]=c=>r("alignTop")),title:"顶部对齐"},[e.createVNode(e.unref(Yt),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:a[7]||(a[7]=c=>r("alignMiddle")),title:"垂直居中"},[e.createVNode(e.unref(qt),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:a[8]||(a[8]=c=>r("alignBottom")),title:"底部对齐"},[e.createVNode(e.unref(jt),{class:"icon-svg"})])])):e.createCommentVNode("",!0),o.selectedNodesCount>=3?(e.openBlock(),e.createElementBlock("div",ro)):e.createCommentVNode("",!0),o.selectedNodesCount>=3?(e.openBlock(),e.createElementBlock("div",io,[e.createElementVNode("button",{class:"toolbar-btn",onClick:a[9]||(a[9]=c=>r("distributeHorizontal")),title:"横向分布"},[e.createVNode(e.unref(Kt),{class:"icon-svg"})]),e.createElementVNode("button",{class:"toolbar-btn",onClick:a[10]||(a[10]=c=>r("distributeVertical")),title:"纵向分布"},[e.createVNode(e.unref(Zt),{class:"icon-svg"})])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",so,[e.createElementVNode("div",co,[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(po,[["__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]},mo=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 fo(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 uo(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:"绑定的设备属性名称"}]},go=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 ho{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 ho,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}},yo=[{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 bo{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 bo,ko={class:"component-library"},Eo={class:"library-content"},No={key:0,class:"component-section"},Vo={class:"component-grid"},xo=["onClick","title"],wo={class:"component-icon"},$o={class:"component-name"},Co={key:1,class:"component-section"},_o={class:"component-grid"},vo=["onClick","title"],Bo={class:"component-icon"},So={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",ko,[f[4]||(f[4]=e.createElementVNode("div",{class:"library-header"},[e.createElementVNode("h3",null,"组件库")],-1)),e.createElementVNode("div",Eo,[a.value.length>0?(e.openBlock(),e.createElementBlock("div",No,[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",Vo,[(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",wo,e.toDisplayString(m.metadata.icon),1),e.createElementVNode("span",$o,e.toDisplayString(m.metadata.name),1)],8,xo))),128))],512),[[e.vShow,!r.basic]])])):e.createCommentVNode("",!0),c.value.length>0?(e.openBlock(),e.createElementBlock("div",Co,[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",_o,[(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",Bo,e.toDisplayString(m.metadata.icon),1),e.createElementVNode("span",So,e.toDisplayString(m.metadata.name),1)],8,vo))),128))],512),[[e.vShow,!r.iot]])])):e.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-7e281fd3"]]),Do={class:"canvas-area"},Io=P(e.defineComponent({__name:"CanvasArea",setup(s,{expose:l}){const o=e.ref();return l({containerRef:o}),(r,t)=>(e.openBlock(),e.createElementBlock("div",Do,[e.createElementVNode("div",{ref_key:"containerRef",ref:o,class:"canvas-container"},null,512)]))}}),[["__scopeId","data-v-a869f6aa"]]),To={class:"canvas-config-panel"},zo={class:"panel-content"},Mo={class:"config-section"},Ao={class:"config-item"},Po={key:0,class:"config-item"},Oo={class:"number-input-group"},Lo={key:1,class:"config-item"},Ro={class:"number-input-group"},Uo={class:"config-section"},Wo={class:"config-item"},Fo={class:"slider-group"},Go={class:"value-display"},jo={class:"config-item"},Ho={class:"number-input-group"},qo={class:"config-item"},Jo={class:"number-input-group"},Yo={class:"config-section"},Xo={class:"config-item"},Ko={class:"config-item"},Qo={class:"image-upload"},Zo={class:"config-item"},el={class:"config-item"},tl={class:"config-section"},ol={class:"config-item"},ll={class:"switch"},nl={class:"config-item"},al={class:"switch"},rl={class:"config-item"},il={class:"switch"},sl={key:0,class:"config-item"},dl={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",To,[i[48]||(i[48]=e.createElementVNode("div",{class:"panel-header"},[e.createElementVNode("h3",null,"画布配置")],-1)),e.createElementVNode("div",zo,[e.createElementVNode("div",Mo,[i[27]||(i[27]=e.createElementVNode("h4",{class:"section-title"},"基础配置",-1)),e.createElementVNode("div",Ao,[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",Po,[i[25]||(i[25]=e.createElementVNode("label",null,"宽度",-1)),e.createElementVNode("div",Oo,[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",Lo,[i[26]||(i[26]=e.createElementVNode("label",null,"高度",-1)),e.createElementVNode("div",Ro,[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",Uo,[i[31]||(i[31]=e.createElementVNode("h4",{class:"section-title"},"变换",-1)),e.createElementVNode("div",Wo,[i[28]||(i[28]=e.createElementVNode("label",null,"缩放倍数",-1)),e.createElementVNode("div",Fo,[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",Go,e.toDisplayString(l.value.zoom.scale.toFixed(1)),1)])]),e.createElementVNode("div",jo,[i[29]||(i[29]=e.createElementVNode("label",null,"画布X轴偏移",-1)),e.createElementVNode("div",Ho,[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",qo,[i[30]||(i[30]=e.createElementVNode("label",null,"画布Y轴偏移",-1)),e.createElementVNode("div",Jo,[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",Yo,[i[39]||(i[39]=e.createElementVNode("h4",{class:"section-title"},"背景",-1)),e.createElementVNode("div",Xo,[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",Ko,[i[34]||(i[34]=e.createElementVNode("label",null,"背景图片",-1)),e.createElementVNode("div",Qo,[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",Zo,[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",el,[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",tl,[i[47]||(i[47]=e.createElementVNode("h4",{class:"section-title"},"辅助",-1)),e.createElementVNode("div",ol,[i[41]||(i[41]=e.createElementVNode("label",null,"吸附",-1)),e.createElementVNode("label",ll,[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",nl,[i[43]||(i[43]=e.createElementVNode("label",null,"网格",-1)),e.createElementVNode("label",al,[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",rl,[i[45]||(i[45]=e.createElementVNode("label",null,"网格对齐",-1)),e.createElementVNode("label",il,[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",sl,[i[46]||(i[46]=e.createElementVNode("label",null,"网格大小",-1)),e.createElementVNode("div",dl,[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"]]),cl={class:"tab-pane"},pl={class:"property-section"},ml={class:"property-item-inline"},fl=["value"],ul={class:"property-item-inline"},gl=["value"],hl={class:"property-item-inline"},yl=["value"],bl={class:"property-section"},kl={class:"property-row"},El={class:"property-item"},Nl=["value"],Vl={class:"property-item"},xl=["value"],wl={class:"property-row"},$l={class:"property-item"},Cl=["value"],_l={class:"property-item"},vl=["value"],Bl={class:"property-section"},Sl={class:"property-item-inline"},Dl=["value"],Il={class:"property-item-inline"},Tl={class:"color-input-wrapper"},zl=["value"],Ml={class:"color-value"},Al={class:"property-item-inline"},Pl={class:"color-input-wrapper"},Ol=["value"],Ll={class:"color-value"},Rl={class:"property-item-inline"},Ul=["value"],Wl={class:"property-item-inline"},Fl=["value"],Gl={key:0,class:"property-section"},jl={key:0,class:"property-hint"},Hl=["value","onInput","placeholder"],ql=["value","onInput","min","max","step"],Jl={key:2,class:"color-input-wrapper"},Yl=["value","onInput"],Xl={class:"color-value"},Kl={key:3,class:"checkbox-wrapper"},Ql=["checked","onChange"],Zl={class:"checkbox-label"},en=["value","onChange"],tn=["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",cl,[e.createElementVNode("div",pl,[p[13]||(p[13]=e.createElementVNode("h4",null,"基础信息",-1)),e.createElementVNode("div",ml,[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,fl)]),e.createElementVNode("div",ul,[p[11]||(p[11]=e.createElementVNode("label",null,"ID",-1)),e.createElementVNode("input",{type:"text",value:s.selectedNode.id,disabled:""},null,8,gl)]),e.createElementVNode("div",hl,[p[12]||(p[12]=e.createElementVNode("label",null,"类型",-1)),e.createElementVNode("input",{type:"text",value:s.selectedNode.shape,disabled:""},null,8,yl)])]),e.createElementVNode("div",bl,[p[18]||(p[18]=e.createElementVNode("h4",null,"位置和尺寸",-1)),e.createElementVNode("div",kl,[e.createElementVNode("div",El,[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,Nl)]),e.createElementVNode("div",Vl,[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,xl)])]),e.createElementVNode("div",wl,[e.createElementVNode("div",$l,[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,Cl)]),e.createElementVNode("div",_l,[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,vl)])])]),e.createElementVNode("div",Bl,[p[24]||(p[24]=e.createElementVNode("h4",null,"样式",-1)),e.createElementVNode("div",Sl,[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,Dl)]),e.createElementVNode("div",Il,[p[20]||(p[20]=e.createElementVNode("label",null,"填充颜色",-1)),e.createElementVNode("div",Tl,[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,zl),e.createElementVNode("span",Ml,e.toDisplayString(((D=($=s.nodeAttrs)==null?void 0:$.body)==null?void 0:D.fill)||"#3b82f6"),1)])]),e.createElementVNode("div",Al,[p[21]||(p[21]=e.createElementVNode("label",null,"边框颜色",-1)),e.createElementVNode("div",Pl,[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,Ol),e.createElementVNode("span",Ll,e.toDisplayString(((E=(y=s.nodeAttrs)==null?void 0:y.body)==null?void 0:E.stroke)||"#2563eb"),1)])]),e.createElementVNode("div",Rl,[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,Ul)]),e.createElementVNode("div",Wl,[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,Fl)])]),t.value.length>0?(e.openBlock(),e.createElementBlock("div",Gl,[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",jl,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,Hl)):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,ql)):v.type==="color"?(e.openBlock(),e.createElementBlock("div",Jl,[e.createElementVNode("input",{type:"color",value:a(v),onInput:S=>c(v,S)},null,40,Yl),e.createElementVNode("span",Xl,e.toDisplayString(a(v)),1)])):v.type==="boolean"?(e.openBlock(),e.createElementBlock("div",Kl,[e.createElementVNode("input",{type:"checkbox",checked:a(v),onChange:S=>c(v,S)},null,40,Ql),e.createElementVNode("span",Zl,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,tn))),128))],40,en)):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-e63074f3"]]),on={class:"tab-pane"},ln={class:"property-section"},nn={class:"property-item-inline"},an=["value"],rn={key:0,class:"property-section"},sn={class:"property-item-inline"},dn=["value"],cn={class:"property-item-inline"},pn=["value"],mn={class:"property-item-inline"},fn=["value"],un={class:"property-item-inline"},gn=["value"],hn={class:"property-item-inline"},yn=["value"],bn={class:"property-item-inline"},kn=["value"],En={key:1,class:"property-section"},Nn={class:"property-item-inline"},Vn=["value"],xn={class:"property-item-inline"},wn=["value"],$n={class:"property-item-inline"},Cn=["value"],_n={class:"property-item-inline"},vn=["value"],Bn={class:"property-item-inline"},Sn=["value"],Dn={class:"property-item-inline"},In=["value"],Tn={key:2,class:"property-section"},zn={class:"property-item-inline"},Mn=["value"],An={class:"property-item-inline"},Pn=["value"],On={class:"property-item-inline"},Ln=["value"],Rn={class:"property-item-inline"},Un=["value"],Wn={class:"property-item-inline"},Fn={class:"checkbox-wrapper"},Gn=["checked"],jn={class:"checkbox-label"},Hn={key:3,class:"property-section"},qn={class:"property-item-inline"},Jn=["value"],Yn={class:"property-item-inline"},Xn=["value"],Kn={class:"property-item-inline"},Qn=["value"],Zn={key:4,class:"property-section"},ea={class:"property-item-inline"},ta=["value"],oa={class:"property-item-inline"},la=["value"],na={key:5,class:"property-section"},aa={class:"property-item-inline"},ra={class:"checkbox-wrapper"},ia=["checked"],sa={class:"checkbox-label"},da={class:"property-item-inline"},ca=["value"],pa=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",on,[e.createElementVNode("div",ln,[n[25]||(n[25]=e.createElementVNode("h4",null,"数据来源",-1)),e.createElementVNode("div",nn,[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,an)])]),t.value.type==="mqtt"?(e.openBlock(),e.createElementBlock("div",rn,[n[32]||(n[32]=e.createElementVNode("h4",null,"MQTT配置",-1)),e.createElementVNode("div",sn,[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,dn)]),e.createElementVNode("div",cn,[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,pn)]),e.createElementVNode("div",mn,[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,fn)]),e.createElementVNode("div",un,[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,gn)]),e.createElementVNode("div",hn,[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,yn)]),e.createElementVNode("div",bn,[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,kn)])])):e.createCommentVNode("",!0),t.value.type==="http"?(e.openBlock(),e.createElementBlock("div",En,[n[40]||(n[40]=e.createElementVNode("h4",null,"HTTP配置",-1)),e.createElementVNode("div",Nn,[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,Vn)]),e.createElementVNode("div",xn,[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,wn)]),e.createElementVNode("div",$n,[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,Cn)]),e.createElementVNode("div",_n,[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,vn)]),e.createElementVNode("div",Bn,[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,Sn)]),e.createElementVNode("div",Dn,[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,In)])])):e.createCommentVNode("",!0),t.value.type==="sse"?(e.openBlock(),e.createElementBlock("div",Tn,[n[46]||(n[46]=e.createElementVNode("h4",null,"SSE配置",-1)),e.createElementVNode("div",zn,[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,Mn)]),e.createElementVNode("div",An,[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,Pn)]),e.createElementVNode("div",On,[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,Ln)]),e.createElementVNode("div",Rn,[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,Un)]),e.createElementVNode("div",Wn,[n[45]||(n[45]=e.createElementVNode("label",null,"自动重连",-1)),e.createElementVNode("div",Fn,[e.createElementVNode("input",{type:"checkbox",checked:t.value.autoReconnect!==!1,onChange:n[16]||(n[16]=u=>d("autoReconnect",u))},null,40,Gn),e.createElementVNode("span",jn,e.toDisplayString(t.value.autoReconnect!==!1?"是":"否"),1)])])])):e.createCommentVNode("",!0),t.value.type==="websocket"?(e.openBlock(),e.createElementBlock("div",Hn,[n[50]||(n[50]=e.createElementVNode("h4",null,"WebSocket配置",-1)),e.createElementVNode("div",qn,[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,Jn)]),e.createElementVNode("div",Yn,[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,Xn)]),e.createElementVNode("div",Kn,[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,Qn)])])):e.createCommentVNode("",!0),t.value.type==="static"?(e.openBlock(),e.createElementBlock("div",Zn,[n[54]||(n[54]=e.createElementVNode("h4",null,"静态数据配置",-1)),e.createElementVNode("div",ea,[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,ta)]),e.createElementVNode("div",oa,[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,la)])])):e.createCommentVNode("",!0),t.value.type!=="none"?(e.openBlock(),e.createElementBlock("div",na,[n[57]||(n[57]=e.createElementVNode("h4",null,"通用配置",-1)),e.createElementVNode("div",aa,[n[55]||(n[55]=e.createElementVNode("label",null,"启用状态",-1)),e.createElementVNode("div",ra,[e.createElementVNode("input",{type:"checkbox",checked:t.value.enabled!==!1,onChange:p},null,40,ia),e.createElementVNode("span",sa,e.toDisplayString(t.value.enabled!==!1?"启用":"禁用"),1)])]),e.createElementVNode("div",da,[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,ca)])])):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-5b515f8a"]]),ma={class:"edge-properties-tab"},fa={class:"property-section"},ua={class:"property-item"},ga={class:"color-input-wrapper"},ha=["value"],ya=["value"],ba={class:"property-item"},ka={class:"number-input-wrapper"},Ea=["value"],Na={class:"property-item"},Va=["value"],xa={class:"property-item"},wa={class:"slider-wrapper"},$a=["value"],Ca={class:"slider-value"},_a={class:"property-item"},va=["value"],Ba={key:0,class:"property-item"},Sa={class:"number-input-wrapper"},Da=["value"],Ia={class:"property-section"},Ta={class:"property-item"},za=["value"],Ma={class:"property-item"},Aa=["value"],Pa={class:"property-section"},Oa={class:"property-item"},La=["value"],Ra={class:"property-item"},Ua=["value"],Wa=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",ma,[e.createElementVNode("div",fa,[N[10]||(N[10]=e.createElementVNode("h4",{class:"section-title"},"线条样式",-1)),e.createElementVNode("div",ua,[N[0]||(N[0]=e.createElementVNode("label",{class:"property-label"},"线条颜色",-1)),e.createElementVNode("div",ga,[e.createElementVNode("input",{type:"color",class:"color-input",value:((z=t.value.line)==null?void 0:z.stroke)||"#10b981",onInput:a},null,40,ha),e.createElementVNode("input",{type:"text",class:"color-text",value:((F=t.value.line)==null?void 0:F.stroke)||"#10b981",onInput:a},null,40,ya)])]),e.createElementVNode("div",ba,[N[2]||(N[2]=e.createElementVNode("label",{class:"property-label"},"线条粗细",-1)),e.createElementVNode("div",ka,[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,Ea),N[1]||(N[1]=e.createElementVNode("span",{class:"input-unit"},"px",-1))])]),e.createElementVNode("div",Na,[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,Va)]),e.createElementVNode("div",xa,[N[5]||(N[5]=e.createElementVNode("label",{class:"property-label"},"透明度",-1)),e.createElementVNode("div",wa,[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,$a),e.createElementVNode("span",Ca,e.toDisplayString(n())+"%",1)])]),e.createElementVNode("div",_a,[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,va)]),D()==="true"?(e.openBlock(),e.createElementBlock("div",Ba,[N[9]||(N[9]=e.createElementVNode("label",{class:"property-label"},"动画速度",-1)),e.createElementVNode("div",Sa,[e.createElementVNode("input",{type:"number",class:"property-input",min:"0.5",max:"10",step:"0.5",value:x(),onInput:y},null,40,Da),N[8]||(N[8]=e.createElementVNode("span",{class:"input-unit"},"秒",-1))])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ia,[N[15]||(N[15]=e.createElementVNode("h4",{class:"section-title"},"箭头样式",-1)),e.createElementVNode("div",Ta,[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,za)]),e.createElementVNode("div",Ma,[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,Aa)])]),e.createElementVNode("div",Pa,[N[20]||(N[20]=e.createElementVNode("h4",{class:"section-title"},"连接器",-1)),e.createElementVNode("div",Oa,[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,La)]),e.createElementVNode("div",Ra,[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,Ua)])]),e.createElementVNode("div",{class:"property-section"},[e.createElementVNode("button",{class:"delete-btn",onClick:$}," 删除连线 ")])])}}}),[["__scopeId","data-v-e47f1784"]]),Fa={class:"event-card"},Ga={class:"header-left"},ja={class:"collapse-icon"},Ha={class:"event-title"},qa={class:"event-card-body"},Ja={class:"event-field"},Ya=["value"],Xa={class:"event-field"},Ka=["value"],Qa={class:"event-field"},Za=["value"],er={class:"condition-config"},tr=["value"],or=["value"],lr=["value"],nr=["value"],ar={key:0,class:"config-section"},rr={key:1,class:"config-section"},ir={key:2,class:"config-section"},sr={key:0,class:"selected-workflow-info"},dr={class:"info-row"},cr={class:"info-value"},pr={class:"event-field"},mr=["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",Fa,[e.createElementVNode("div",{class:"event-card-header",onClick:o[1]||(o[1]=m=>l.$emit("toggle-collapse"))},[e.createElementVNode("div",Ga,[e.createElementVNode("span",ja,e.toDisplayString(s.isCollapsed?"▶":"▼"),1),e.createElementVNode("span",Ha,"事件"+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",qa,[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,Ya)]),e.createElementVNode("div",Xa,[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,Ka)]),e.createElementVNode("div",Qa,[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,Za)]),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",er,[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,or))),128))],40,tr),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=">" data-v-af7c633a>大于</option><option value=">=" data-v-af7c633a>大于等于</option><option value="<" data-v-af7c633a>小于</option><option value="<=" data-v-af7c633a>小于等于</option><option value="contains" data-v-af7c633a>包含</option>',7)])],40,lr),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,nr),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",ar,[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",rr,[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",ir,[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",sr,[e.createElementVNode("div",dr,[o[27]||(o[27]=e.createElementVNode("span",{class:"info-label"},"已选择:",-1)),e.createElementVNode("span",cr,e.toDisplayString(((d=s.event.params)==null?void 0:d.processName)||((p=s.event.params)==null?void 0:p.processId)),1)]),e.createElementVNode("div",pr,[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,mr)])])):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),fr=(s,l)=>{const o=Vt(s);if(o)return o.points.find(r=>r.id===l)},ur={class:"device-point-selector"},gr={class:"device-list-panel"},hr={class:"panel-header"},yr={class:"device-count"},br={class:"search-box"},kr={class:"device-list"},Er=["onClick"],Nr={class:"device-info"},Vr={class:"device-name"},xr={class:"device-meta"},wr={class:"device-code"},$r={class:"point-count"},Cr={key:0,class:"empty-hint"},_r={class:"point-list-panel"},vr={class:"panel-header"},Br={key:0,class:"point-count"},Sr={key:0,class:"search-box"},Dr={class:"point-list"},Ir={key:0,class:"empty-hint"},Tr={key:1,class:"empty-hint"},zr=["onClick"],Mr={class:"point-info"},Ar={class:"point-name"},Pr={class:"point-meta"},Or={class:"point-code"},Lr={key:0,class:"point-unit"},Rr={class:"point-type"},Ur={key:0,class:"point-value"},Wr={class:"value"},Fr={class:"modal-footer"},Gr=["disabled"],jr=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",ur,[e.createElementVNode("div",gr,[e.createElementVNode("div",hr,[y[4]||(y[4]=e.createElementVNode("h4",null,"设备列表",-1)),e.createElementVNode("span",yr,e.toDisplayString(t.value.length),1)]),e.createElementVNode("div",br,[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",kr,[(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",Nr,[e.createElementVNode("div",Vr,[e.createElementVNode("span",{class:e.normalizeClass(["status-dot",E.status])},null,2),e.createTextVNode(" "+e.toDisplayString(E.name),1)]),e.createElementVNode("div",xr,[e.createElementVNode("span",wr,e.toDisplayString(E.code),1),e.createElementVNode("span",$r,e.toDisplayString(E.points.length)+" 点",1)])]),y[5]||(y[5]=e.createElementVNode("div",{class:"device-arrow"},"›",-1))],10,Er)}),128)),f.value.length===0?(e.openBlock(),e.createElementBlock("div",Cr," 暂无设备 ")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",_r,[e.createElementVNode("div",vr,[e.createElementVNode("h4",null,e.toDisplayString(a.value?a.value.name:"点位列表"),1),a.value?(e.openBlock(),e.createElementBlock("span",Br,e.toDisplayString(m.value.length),1)):e.createCommentVNode("",!0)]),a.value?(e.openBlock(),e.createElementBlock("div",Sr,[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",Dr,[a.value?m.value.length===0?(e.openBlock(),e.createElementBlock("div",Tr," 暂无点位 ")):(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",Mr,[e.createElementVNode("div",Ar,[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",Pr,[e.createElementVNode("span",Or,e.toDisplayString(E.code),1),E.unit?(e.openBlock(),e.createElementBlock("span",Lr,e.toDisplayString(E.unit),1)):e.createCommentVNode("",!0),e.createElementVNode("span",Rr,e.toDisplayString($(E.dataType)),1)]),E.value!==void 0?(e.openBlock(),e.createElementBlock("div",Ur,[y[6]||(y[6]=e.createTextVNode(" 当前值: ",-1)),e.createElementVNode("span",Wr,e.toDisplayString(D(E)),1),e.createElementVNode("span",{class:e.normalizeClass(["quality",E.quality])},e.toDisplayString(E.quality),3)])):e.createCommentVNode("",!0)])],10,zr)}),128)):(e.openBlock(),e.createElementBlock("div",Ir," ← 请先选择设备 "))])])]),e.createElementVNode("div",Fr,[e.createElementVNode("button",{class:"btn-cancel",onClick:h},"取消"),e.createElementVNode("button",{class:"btn-confirm",disabled:!c.value,onClick:i}," 确定 ",8,Gr)])])])):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 Hr={class:"mapping-configurator"},qr={class:"config-item"},Jr={key:0,class:"field-hint error"},Yr={key:1,class:"field-hint"},Xr={class:"config-item"},Kr={key:0,class:"field-hint error"},Qr={key:1,class:"field-hint"},Zr={key:0,class:"config-item"},ei={class:"unit-config"},ti={class:"checkbox-label"},oi={key:0,class:"custom-unit"},li={key:1,class:"mapping-details"},ni={class:"config-item"},ai={class:"config-item"},ri={key:2,class:"mapping-details"},ii={class:"range-rules"},si=["onUpdate:modelValue"],di=["onUpdate:modelValue"],ci=["onUpdate:modelValue"],pi=["onClick"],mi={key:3,class:"mapping-details"},fi={class:"enum-mappings"},ui=["value","onInput"],gi=["onUpdate:modelValue"],hi=["onClick"],yi={key:4,class:"mapping-preview"},bi={class:"preview-content"},ki={class:"preview-item"},Ei={class:"preview-output"},Ni={class:"preview-item"},Vi={class:"preview-output"},xi={class:"preview-input"},wi={class:"preview-output"},$i={class:"preview-input"},Ci={class:"preview-output"},_i=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",Hr,[e.createElementVNode("div",qr,[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",Yr,e.toDisplayString(c(t.value.valueType)),1)):(e.openBlock(),e.createElementBlock("div",Jr," 值类型为必填项 "))]),e.createElementVNode("div",Xr,[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",Qr,e.toDisplayString(d(t.value.type)),1)):(e.openBlock(),e.createElementBlock("div",Kr," 映射类型为必填项 "))]),t.value.valueType==="number"?(e.openBlock(),e.createElementBlock("div",Zr,[x[13]||(x[13]=e.createElementVNode("label",null,"单位配置",-1)),e.createElementVNode("div",ei,[e.createElementVNode("label",ti,[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",oi,[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",li,[e.createElementVNode("div",ni,[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",ai,[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",ri,[e.createElementVNode("div",ii,[(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,si),[[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,di),[[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,ci),[[e.vModelText,k.value]]),e.createElementVNode("button",{class:"btn-remove-rule",onClick:E=>m(y),title:"删除规则"}," ✕ ",8,pi)]))),128))]),e.createElementVNode("button",{class:"btn-add-rule",onClick:f}," + 添加范围规则 ")])):e.createCommentVNode("",!0),t.value.type==="enum"?(e.openBlock(),e.createElementBlock("div",mi,[e.createElementVNode("div",fi,[(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,ui),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,gi),[[e.vModelText,t.value.enumMappings[y]]]),e.createElementVNode("button",{class:"btn-remove-rule",onClick:N=>u(y),title:"删除映射"}," ✕ ",8,hi)]))),128))]),e.createElementVNode("button",{class:"btn-add-rule",onClick:n}," + 添加枚举映射 ")])):e.createCommentVNode("",!0),t.value.type!=="direct"?(e.openBlock(),e.createElementBlock("div",yi,[x[25]||(x[25]=e.createElementVNode("label",null,"映射预览",-1)),e.createElementVNode("div",bi,[t.value.type==="boolean"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",ki,[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",Ei,e.toDisplayString(t.value.trueValue||"true"),1)]),e.createElementVNode("div",Ni,[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",Vi,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",xi,"["+e.toDisplayString(k.min)+" ~ "+e.toDisplayString(k.max)+"]",1),x[23]||(x[23]=e.createElementVNode("span",{class:"preview-arrow"},"→",-1)),e.createElementVNode("span",wi,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",$i,e.toDisplayString(y),1),x[24]||(x[24]=e.createElementVNode("span",{class:"preview-arrow"},"→",-1)),e.createElementVNode("span",Ci,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"]]),vi={class:"event-card"},Bi={class:"header-left"},Si={class:"collapse-icon"},Di={class:"event-title"},Ii={class:"event-card-body"},Ti={class:"property-item"},zi={key:0,class:"selected-point"},Mi={class:"point-main"},Ai={class:"device-name"},Pi={class:"point-name"},Oi={class:"point-details"},Li={class:"point-code"},Ri={key:0,class:"point-unit"},Ui={key:1,class:"placeholder"},Wi={class:"property-item"},Fi=["value"],Gi=["value"],ji={class:"property-item"},Hi={key:0,class:"mapping-summary"},qi={class:"mapping-type-label"},Ji={class:"mapping-detail"},Yi={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=fr(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",vi,[e.createElementVNode("div",{class:"event-card-header",onClick:g[1]||(g[1]=$=>i.$emit("toggle-collapse"))},[e.createElementVNode("div",Bi,[e.createElementVNode("span",Si,e.toDisplayString(s.isCollapsed?"▶":"▼"),1),e.createElementVNode("span",Di,"绑定"+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",Ii,[e.createElementVNode("div",Ti,[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",zi,[e.createElementVNode("div",Mi,[e.createElementVNode("span",Ai,e.toDisplayString(f.value.deviceName),1),e.createElementVNode("span",Pi,e.toDisplayString(f.value.pointName),1)]),e.createElementVNode("div",Oi,[e.createElementVNode("span",Li,e.toDisplayString(f.value.pointCode),1),f.value.pointUnit?(e.openBlock(),e.createElementBlock("span",Ri,e.toDisplayString(f.value.pointUnit),1)):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createElementBlock("div",Ui," 点击选择设备点位 ")),g[9]||(g[9]=e.createElementVNode("span",{class:"selector-arrow"},"›",-1))])]),e.createVNode(jr,{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",Wi,[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,Gi))),128))],40,Fi)]),e.createElementVNode("div",ji,[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",Hi,[e.createElementVNode("span",qi,e.toDisplayString(u(d.value.type)),1),e.createElementVNode("span",Ji,e.toDisplayString(h()),1)])):(e.openBlock(),e.createElementBlock("div",Yi," 点击配置值映射 ")),g[13]||(g[13]=e.createElementVNode("span",{class:"selector-arrow"},"›",-1))])]),e.createVNode(_i,{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"]]),Xi={class:"dialog-content"},Ki={class:"dialog-header"},Qi={class:"dialog-body"},Zi={class:"group-row"},es={class:"group-field"},ts=["value","onChange"],os=["value"],ls={class:"group-field group-field-value"},ns=["value","onInput"],as=["value","onInput"],rs={key:2,class:"color-input-wrapper"},is=["value","onInput"],ss={class:"color-value"},ds=["value","onChange"],cs=["onClick"],ps={key:0,class:"empty-hint"},ms={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",Xi,[e.createElementVNode("div",Ki,[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",Qi,[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",Zi,[e.createElementVNode("div",es,[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,os))),128))],40,ts)]),e.createElementVNode("div",ls,[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,ns)):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,as)):t(f.property)==="color"?(e.openBlock(),e.createElementBlock("div",rs,[e.createElementVNode("input",{value:f.value,type:"color",onInput:n=>a(m,"value",n)},null,40,is),e.createElementVNode("span",ss,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,ds)):e.createCommentVNode("",!0)]),e.createElementVNode("button",{class:"btn-delete-group",onClick:n=>d.$emit("remove-group",m),title:"删除"}," 🗑 ",8,cs)])]))),128)),s.attributeGroups.length===0?(e.openBlock(),e.createElementBlock("div",ps,' 请点击"新增一组"按钮添加属性配置 ')):e.createCommentVNode("",!0)]),e.createElementVNode("div",ms,[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"]]),fs={class:"dialog-content dialog-large"},us={class:"dialog-header"},gs={class:"dialog-body dialog-body-split"},hs={class:"code-editor-section"},ys=["value"],bs={class:"code-preview-section"},ks={class:"section-header"},Es={class:"preview-status"},Ns={key:0,class:"status-success"},Vs={key:1,class:"status-error"},xs={class:"preview-canvas"},ws={key:0,class:"preview-empty"},$s={key:1,class:"preview-error-box"},Cs={class:"error-message"},_s={key:2,class:"preview-node-container"},vs={key:0,class:"console-output"},Bs={class:"console-logs"},Ss={class:"dialog-footer"},Ds=`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=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:
|
|
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:Ds}),(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",fs,[e.createElementVNode("div",us,[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",gs,[e.createElementVNode("div",hs,[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,7 +23,7 @@
|
|
|
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,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>大于 (>)</option><option value="gte" data-v-15975920>大于等于 (>=)</option><option value="lt" data-v-15975920>小于 (<)</option><option value="lte" data-v-15975920>小于等于 (<=)</option><option value="contains" data-v-15975920>包含</option><option value="notContains" data-v-15975920>不包含</option>',8)])],40,$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+=`错误:
|
|
26
|
+
}`,class:"code-textarea code-textarea-full"},null,40,ys)]),e.createElementVNode("div",bs,[e.createElementVNode("div",ks,[m[7]||(m[7]=e.createElementVNode("label",null,"组件预览",-1)),e.createElementVNode("div",Es,[(n=t.value)!=null&&n.success?(e.openBlock(),e.createElementBlock("span",Ns,"✓ 执行成功")):(u=t.value)!=null&&u.error?(e.openBlock(),e.createElementBlock("span",Vs,"✗ 执行失败")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",xs,[t.value?t.value.error?(e.openBlock(),e.createElementBlock("div",$s,[m[8]||(m[8]=e.createElementVNode("div",{class:"error-title"},"错误信息:",-1)),e.createElementVNode("div",Cs,e.toDisplayString(t.value.error),1)])):(e.openBlock(),e.createElementBlock("div",_s,[e.createElementVNode("div",{ref_key:"previewContainer",ref:r,class:"node-preview"},null,512),t.value.logs.length>0?(e.openBlock(),e.createElementBlock("div",vs,[m[9]||(m[9]=e.createElementVNode("div",{class:"console-title"},"控制台输出:",-1)),e.createElementVNode("div",Bs,[(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",ws,' 点击"测试执行"按钮查看组件预览效果 '))])])]),e.createElementVNode("div",Ss,[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"]]),Is={class:"dialog-container"},Ts={class:"dialog-header"},zs={class:"dialog-body"},Ms={key:0,class:"empty-state"},As={key:1,class:"workflow-list"},Ps=["onClick"],Os={class:"workflow-info"},Ls={class:"workflow-name"},Rs={class:"workflow-meta"},Us={class:"workflow-id"},Ws={class:"workflow-date"},Fs={class:"workflow-actions"},Gs=["onClick"],js={class:"dialog-footer"},Hs=["disabled"],qs=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",Is,[e.createElementVNode("div",Ts,[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",zs,[r.value.length===0?(e.openBlock(),e.createElementBlock("div",Ms,[...n[4]||(n[4]=[e.createElementVNode("p",null,"暂无已保存的流程",-1),e.createElementVNode("p",{class:"hint"},"请先在流程编辑器中创建并保存流程",-1)])])):(e.openBlock(),e.createElementBlock("div",As,[(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",Os,[e.createElementVNode("div",Ls,e.toDisplayString(u.name),1),e.createElementVNode("div",Rs,[e.createElementVNode("span",Us,"ID: "+e.toDisplayString(u.id),1),e.createElementVNode("span",Ws,e.toDisplayString(f(u.createdAt)),1)])]),e.createElementVNode("div",Fs,[e.createElementVNode("button",{class:"btn-icon",onClick:e.withModifiers(i=>d(u),["stop"]),title:"预览"}," 👁️ ",8,Gs)])],10,Ps)}),128))]))]),e.createElementVNode("div",js,[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,Hs)])])]))}}),[["__scopeId","data-v-c9a88e33"]]),Js=(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},Ys=(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},Xs=(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 Js(s.getData(),c)}},Ks=(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 Ys(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=Xs(s,l.condition.attribute),r=o===l.condition.value;return console.log(`条件检查: ${l.condition.attribute} = ${o}, 期望: ${l.condition.value}, 结果: ${r}`),r}return!1},Qs=(s,l)=>{l!=null&&l.attributeGroups&&l.attributeGroups.forEach(o=>{const r=o.target==="current"?s:null;r&&Ks(r,o.property,o.value)})},Zs=(s,l,o)=>{if(o!=null&&o.code)try{new Function("node","event",o.code)(s,l)}catch(r){console.error("自定义代码执行失败:",r)}},ed=(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":Qs(s,l.params);break;case"customCode":Zs(s,l,l.params);break;case"callProcess":ed(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)}},td=(s,l)=>{try{const o=JSON.stringify(l);return localStorage.setItem(s,o),!0}catch(o){return console.error(`保存到 localStorage 失败 [${s}]:`,o),!1}},od=s=>{try{const l=localStorage.getItem(s);return l?JSON.parse(l):null}catch(l){return console.error(`从 localStorage 读取失败 [${s}]:`,l),null}},ld=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"),nd=()=>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)},ad={class:"property-panel"},rd={key:1,class:"properties"},id={key:2,class:"properties"},sd={class:"tabs"},dd={class:"tab-content"},cd={class:"tab-pane"},pd={class:"property-section"},md={key:0,class:"empty-hint"},fd={class:"event-list"},ud={class:"tab-pane"},gd={class:"property-section"},hd={key:0,class:"empty-hint"},yd={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),M1=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},A1=()=>{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),P1=w=>{$e.value=w,Je.value=!0},Tt=()=>{Je.value=!1},O1=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},L1=w=>{r("updateEdge",w)},R1=()=>{r("deleteEdge")};return(w,C)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",ad,[!s.selectedNode&&!s.selectedEdge?(e.openBlock(),e.createBlock(Se,{key:0})):s.selectedEdge?(e.openBlock(),e.createElementBlock("div",rd,[C[5]||(C[5]=e.createElementVNode("h3",{class:"panel-title"},"连线属性",-1)),e.createVNode(Wa,{"selected-edge":s.selectedEdge,onUpdateEdge:L1,onDeleteEdge:R1},null,8,["selected-edge"])])):s.selectedNode?(e.openBlock(),e.createElementBlock("div",id,[C[10]||(C[10]=e.createElementVNode("h3",{class:"panel-title"},"节点属性",-1)),e.createElementVNode("div",sd,[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",dd,[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(pa,{"selected-node":s.selectedNode,onUpdateDataSource:v},null,8,["selected-node"]),[[e.vShow,t.value==="data"]]),e.withDirectives(e.createElementVNode("div",cd,[e.createElementVNode("div",pd,[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",md,[...C[7]||(C[7]=[e.createElementVNode("span",null,"暂无事件,点击上方按钮添加",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",fd,[(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=>M1(R),onOpenWorkflowSelector:G=>P1(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",ud,[e.createElementVNode("div",gd,[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",hd,[...C[9]||(C[9]=[e.createElementVNode("span",null,"暂无绑定,点击上方按钮添加",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",yd,[(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:A1},null,8,["code","selected-node"])):e.createCommentVNode("",!0),Je.value?(e.openBlock(),e.createBlock(qs,{key:2,onClose:Tt,onSelect:O1})):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 bd(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 kd(s){const l=bd(s);return await crypto.subtle.importKey("spki",l,{name:"ECDSA",namedCurve:"P-256"},!1,["verify"])}async function Ed(s,l){try{const[o,r]=s.split(".");if(!o||!r)return!1;const t=await kd(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 Nd(s,l){const o=await Ed(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 Vd={key:0,class:"scada-footer"},xd={key:1,class:"scada-footer"},wd={class:"footer-content"},$d={class:"footer-left"},Cd={class:"copyright",style:{color:"#94a3b8 !important"}},_d={key:0,class:"divider",style:{color:"#475569 !important"}},vd={key:1,class:"license",style:{color:"#94a3b8 !important"}},Bd={key:0,class:"footer-right"},Sd={class:"text",style:{color:"#94a3b8 !important"}},Dd={key:2,class:"scada-footer"},Id={class:"footer-content"},Td={class:"footer-left"},zd={class:"authorized-text",style:{color:"#10b981 !important"}},Md={class:"footer-right"},Ad={key:0,class:"expiry-text",style:{color:"#94a3b8 !important"}},Pd={key:1,class:"expiry-text",style:{color:"#94a3b8 !important"}},Od=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 Nd(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",xd,[e.createElementVNode("div",wd,[e.createElementVNode("div",$d,[e.createElementVNode("span",Cd,e.toDisplayString(s.customFooter.copyright),1),s.customFooter.license?(e.openBlock(),e.createElementBlock("span",_d,"|")):e.createCommentVNode("",!0),s.customFooter.license?(e.openBlock(),e.createElementBlock("span",vd,e.toDisplayString(s.customFooter.license),1)):e.createCommentVNode("",!0)]),s.customFooter.contact?(e.openBlock(),e.createElementBlock("div",Bd,[e.createElementVNode("span",Sd,e.toDisplayString(s.customFooter.contact),1)])):e.createCommentVNode("",!0)])])):(e.openBlock(),e.createElementBlock("footer",Dd,[e.createElementVNode("div",Id,[e.createElementVNode("div",Td,[c[1]||(c[1]=e.createElementVNode("span",{class:"authorized-icon"},"✅",-1)),e.createElementVNode("span",zd,"已授权: "+e.toDisplayString(((d=o.value)==null?void 0:d.company)||"未知"),1)]),e.createElementVNode("div",Md,[(p=o.value)!=null&&p.expiryDate?(e.openBlock(),e.createElementBlock("span",Ad," 📅 有效期至: "+e.toDisplayString(o.value.expiryDate),1)):(e.openBlock(),e.createElementBlock("span",Pd," ∞ 永久授权 "))])])])):(e.openBlock(),e.createElementBlock("footer",Vd,[...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 Ld={class:"dialog-body"},Rd={class:"search-box"},Ud={class:"element-list"},Wd=["onClick"],Fd={class:"element-icon"},Gd={class:"element-info"},jd={class:"element-name"},Hd={class:"element-type"},qd={key:0,class:"element-check"},Jd={key:0,class:"empty-state"},Yd={class:"dialog-footer"},Xd=["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",Ld,[e.createElementVNode("div",Rd,[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",Ud,[(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",Fd,e.toDisplayString(u.icon),1),e.createElementVNode("div",Gd,[e.createElementVNode("div",jd,e.toDisplayString(u.name),1),e.createElementVNode("div",Hd,e.toDisplayString(u.type),1)]),((i=a.value)==null?void 0:i.id)===u.id?(e.openBlock(),e.createElementBlock("div",qd," ✓ ")):e.createCommentVNode("",!0)],10,Wd)}),128)),c.value.length===0?(e.openBlock(),e.createElementBlock("div",Jd,[...n[3]||(n[3]=[e.createElementVNode("p",null,"未找到图元",-1),e.createElementVNode("p",{class:"empty-hint"},"请尝试其他搜索关键词",-1)])])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Yd,[e.createElementVNode("button",{class:"btn-secondary",onClick:p},"取消"),e.createElementVNode("button",{class:"btn-primary",disabled:!a.value,onClick:f}," 确定 ",8,Xd)])])])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-882704dd"]]),Kd={class:"node-config"},Qd={class:"config-group"},Zd={class:"element-selector"},ec={class:"config-group"},tc=["disabled"],oc=["value"],lc=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",Kd,[e.createElementVNode("div",Qd,[i[3]||(i[3]=e.createElementVNode("label",null,"图元选择",-1)),e.createElementVNode("div",Zd,[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",ec,[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,oc))),128))],40,tc),[[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"]]),nc={class:"node-config"},ac={class:"config-group"},rc={class:"element-selector"},ic={class:"config-group"},sc=["disabled"],dc=["value"],cc={class:"config-group"},pc=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",nc,[e.createElementVNode("div",ac,[i[4]||(i[4]=e.createElementVNode("label",null,"图元选择",-1)),e.createElementVNode("div",rc,[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",ic,[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,dc))),128))],40,sc),[[e.vModelSelect,t.propertyName]])]),e.createElementVNode("div",cc,[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"]]),mc={class:"node-config"},fc={class:"config-group"},uc={class:"config-group"},gc={class:"branches-section"},hc={class:"branch-list"},yc={class:"branch-header"},bc={class:"branch-number"},kc=["onClick"],Ec={key:0,class:"branch-config"},Nc={class:"config-row"},Vc=["onUpdate:modelValue"],xc={key:0,class:"config-row"},wc=["onUpdate:modelValue"],$c={key:1,class:"config-row"},Cc=["onUpdate:modelValue","type"],_c={key:1,class:"default-branch-label"},vc=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",mc,[e.createElementVNode("div",fc,[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",uc,[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",gc,[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",hc,[(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",yc,[e.createElementVNode("span",bc,"分支 "+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,kc)):e.createCommentVNode("",!0)]),h.isDefault?(e.openBlock(),e.createElementBlock("div",_c," 默认分支(其他情况) ")):(e.openBlock(),e.createElementBlock("div",Ec,[e.createElementVNode("div",Nc,[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,Vc),[[e.vModelText,h.label]])]),c.dataType!=="boolean"?(e.openBlock(),e.createElementBlock("div",xc,[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>大于 (>)</option><option value="gte" data-v-15975920>大于等于 (>=)</option><option value="lt" data-v-15975920>小于 (<)</option><option value="lte" data-v-15975920>小于等于 (<=)</option><option value="contains" data-v-15975920>包含</option><option value="notContains" data-v-15975920>不包含</option>',8)])],40,wc),[[e.vModelSelect,h.operator]])])):e.createCommentVNode("",!0),c.dataType!=="boolean"?(e.openBlock(),e.createElementBlock("div",$c,[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,Cc),[[e.vModelDynamic,h.value]])])):e.createCommentVNode("",!0)]))]))),128))])])]))}}),[["__scopeId","data-v-15975920"]]),Bc={class:"node-config"},Sc={class:"config-group"},Dc={class:"config-group"},Ic={class:"config-group"},Tc={class:"config-group"},zc={class:"config-group"},Mc=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",Bc,[e.createElementVNode("div",Sc,[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",Dc,[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",Ic,[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",Tc,[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",zc,[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"]]),Ac={class:"node-config"},Pc={class:"config-group"},Oc=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",Ac,[e.createElementVNode("div",Pc,[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"]]),Lc={class:"node-config"},Rc={class:"config-group"},Uc={class:"config-group"},Wc=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",Lc,[e.createElementVNode("div",Rc,[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",Uc,[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"]]),Fc={class:"node-config"},Gc={class:"config-group"},jc=["value"],Hc={key:0,class:"timer-hint warning"},qc={key:1,class:"timer-hint"},Jc=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",Fc,[e.createElementVNode("div",Gc,[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,jc))),128))],544),[[e.vModelSelect,t.timerId]])]),a.value.length===0?(e.openBlock(),e.createElementBlock("div",Hc,[...m[3]||(m[3]=[e.createElementVNode("p",null,"提示:当前流程中没有定时器节点",-1)])])):(e.openBlock(),e.createElementBlock("div",qc,[...m[4]||(m[4]=[e.createElementVNode("p",null,"提示:选择要清除的定时器节点",-1)])]))]))}}),[["__scopeId","data-v-d102fb63"]]),Yc={[ce.GET_PROPERTY]:lc,[ce.SET_PROPERTY]:pc,[ce.CONDITION]:vc,[ce.HTTP_REQUEST]:Mc,[ce.CUSTOM_CODE]:Oc,[ce.TIMER]:Wc,[ce.CLEAR_TIMER]:Jc};function Xc(s){return Yc[s]||null}const Kc={class:"property-panel"},Qc={key:0,class:"property-content"},Zc={class:"property-group"},ep=["value"],tp={class:"property-group"},op=["value"],lp={key:0,class:"divider"},np={key:1,class:"property-empty"},ap=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?Xc(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",Kc,[n[4]||(n[4]=e.createElementVNode("h3",null,"属性配置",-1)),s.selectedCell?(e.openBlock(),e.createElementBlock("div",Qc,[e.createElementVNode("div",Zc,[n[1]||(n[1]=e.createElementVNode("label",null,"节点名称",-1)),e.createElementVNode("input",{value:s.selectedCell.label,type:"text",placeholder:"输入节点名称",onInput:d},null,40,ep)]),e.createElementVNode("div",tp,[n[2]||(n[2]=e.createElementVNode("label",null,"节点类型",-1)),e.createElementVNode("input",{value:s.selectedCell.nodeType,type:"text",readonly:"",disabled:""},null,8,op)]),c.value?(e.openBlock(),e.createElementBlock("div",lp)):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",np,[...n[3]||(n[3]=[e.createElementVNode("div",{class:"empty-text"},"选择节点以配置属性",-1)])]))]))}}),[["__scopeId","data-v-8304acbc"]]),rp={class:"toolbar"},ip={class:"toolbar-right"},sp=P(e.defineComponent({__name:"WorkflowToolbar",props:{showClose:{type:Boolean}},emits:["clear","validate","save","close"],setup(s){return(l,o)=>(e.openBlock(),e.createElementBlock("div",rp,[o[5]||(o[5]=e.createElementVNode("div",{class:"toolbar-left"},[e.createElementVNode("h2",null,"流程编排")],-1)),e.createElementVNode("div",ip,[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"]]),dp={class:"menu-header"},cp={class:"menu-list"},pp=["onClick"],mp={class:"menu-item-info"},fp={class:"menu-item-name"},up={class:"menu-item-desc"},gp=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",dp,[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",cp,[(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",mp,[e.createElementVNode("div",fp,e.toDisplayString(p.name),1),e.createElementVNode("div",up,e.toDisplayString(p.description),1)])],8,pp))),128))])],4)):e.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-aa6fccf8"]]);class hp{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 hp,yp={class:"workflow-editor"},bp={class:"editor-main"},kp={class:"canvas-area"},Ep=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
27
|
`+k.map(N=>" • "+N).join(`
|
|
28
28
|
`)),y.length>0&&(E&&(E+=`
|
|
29
29
|
|
|
@@ -42,4 +42,4 @@
|
|
|
42
42
|
`;if(S+=y.map(M=>" • "+M).join(`
|
|
43
43
|
`),S+=`
|
|
44
44
|
|
|
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"}})});
|
|
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",yp,[e.createVNode(sp,{"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",bp,[e.createElementVNode("div",kp,[e.createElementVNode("div",{id:"workflow-container",ref_key:"containerRef",ref:r},null,512)]),e.createVNode(ap,{"selected-cell":a.value,"onUpdate:label":u},null,8,["selected-cell"])]),e.createVNode(gp,{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"]]),Np={key:0,class:"workflow-dialog-overlay"},Vp={class:"workflow-dialog"},xp=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",Np,[e.createElementVNode("div",Vp,[e.createVNode(Ep,{"scada-graph":s.scadaGraph,"show-close":!0,onClose:t},null,8,["scada-graph"])])])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-4e7f6ab7"]]),wp=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=fo(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"]]),$p=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=uo(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))}}),Cp={class:"light-3d-container"},_p={viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg"},vp=["id"],Bp=["stop-color"],Sp=["stop-color"],Dp=["stop-color"],Ip=["id"],Tp=["id"],zp=["id"],Mp=["flood-color"],Ap=["fill","filter"],Pp=["fill","filter"],Op=["opacity"],Lp={key:1,opacity:"0.8"},Rp=["fill"],Up=["fill"],Wp=["fill"],Fp=["fill"],Gp=["fill"],jp=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",Cp,[(e.openBlock(),e.createElementBlock("svg",_p,[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,Bp),e.createElementVNode("stop",{offset:"50%","stop-color":t.value?a.value:"#d1d5db"},null,8,Sp),e.createElementVNode("stop",{offset:"100%","stop-color":t.value?c(a.value,.3):"#9ca3af"},null,8,Dp)],8,vp),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,Ip),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,Tp),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,Mp),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,zp)]),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,Ap)):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,Pp),e.createElementVNode("ellipse",{cx:"42",cy:"25",rx:"8",ry:"10",fill:"#ffffff",opacity:t.value?.7:.3},null,8,Op),t.value?(e.openBlock(),e.createElementBlock("g",Lp,[...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,Rp),e.createElementVNode("rect",{x:"40",y:"67",width:"20",height:"3",fill:`url(#base-gradient-${o.value})`,rx:"1"},null,8,Up),e.createElementVNode("rect",{x:"40",y:"71",width:"20",height:"3",fill:`url(#base-gradient-${o.value})`,rx:"1"},null,8,Wp),e.createElementVNode("rect",{x:"40",y:"75",width:"20",height:"3",fill:`url(#base-gradient-${o.value})`,rx:"1"},null,8,Fp),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,Gp),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"]]),Hp={class:"switch-3d-container"},qp={viewBox:"0 0 120 80",xmlns:"http://www.w3.org/2000/svg"},Jp=["id"],Yp=["id"],Xp=["id"],Kp=["id"],Qp=["fill"],Zp=["fill"],em=["fill"],tm=["transform"],om=["fill"],lm=["fill","filter"],nm=["opacity"],am=["fill","filter"],rm=["opacity"],im=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",Hp,[(e.openBlock(),e.createElementBlock("svg",qp,[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,Jp),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,Yp),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,Xp),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,Kp)]),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,Qp),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,Zp),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,em),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,om),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,tm),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,lm),e.createElementVNode("circle",{cx:"35",cy:"50",r:"1.5",fill:"#ffffff",opacity:t.value?.1:.6},null,8,nm),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,am),e.createElementVNode("circle",{cx:"85",cy:"50",r:"1.5",fill:"#ffffff",opacity:t.value?.6:.1},null,8,rm)]),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"]]),sm={class:"motor-3d-container"},dm={viewBox:"0 0 120 100",xmlns:"http://www.w3.org/2000/svg"},cm=["id"],pm=["id"],mm=["id"],fm=["fill"],um=["fill"],gm=["fill"],hm=["transform"],ym=["fill","filter"],bm=["opacity"],km={x:"60",y:"61","font-size":"4",fill:"#cbd5e1","text-anchor":"middle","font-family":"monospace"},Em=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",sm,[(e.openBlock(),e.createElementBlock("svg",dm,[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,cm),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,pm),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,mm)]),e.createElementVNode("rect",{x:"20",y:"70",width:"80",height:"25",rx:"3",fill:`url(#motor-body-${o.value})`},null,8,fm),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,um),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,gm),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,hm),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,ym),e.createElementVNode("circle",{cx:"15",cy:"45",r:"2",fill:"#ffffff",opacity:t.value?.6:.2},null,8,bm),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",km,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"]]),Nm={class:"valve-3d-container"},Vm={viewBox:"0 0 100 120",xmlns:"http://www.w3.org/2000/svg"},xm=["id"],wm=["id"],$m=["fill"],Cm=["fill"],_m=["fill"],vm=["fill"],Bm={transform:"translate(50, 60)"},Sm=["fill","transform"],Dm=["transform"],Im=["fill"],Tm=["fill"],zm={x:"12.5",y:"62","font-size":"6",fill:"#ffffff","text-anchor":"middle","font-weight":"bold"},Mm={x:"85",y:"62","font-size":"8",fill:"#cbd5e1","text-anchor":"middle","font-family":"monospace"},Am=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",Nm,[(e.openBlock(),e.createElementBlock("svg",Vm,[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,xm),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,wm)]),e.createElementVNode("rect",{x:"40",y:"85",width:"20",height:"30",fill:`url(#valve-body-${o.value})`,stroke:"#475569","stroke-width":"1"},null,8,$m),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,Cm),e.createElementVNode("rect",{x:"25",y:"50",width:"50",height:"20",fill:`url(#valve-body-${o.value})`,stroke:"#475569","stroke-width":"1"},null,8,_m),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,vm),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",Bm,[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,Sm)]),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,Im),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,Dm),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,Tm),e.createElementVNode("text",zm,e.toDisplayString(t.value?"ON":"OFF"),1)]),e.createElementVNode("text",Mm,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"]]),Pm={class:"tank-3d-container"},Om={viewBox:"0 0 100 140",xmlns:"http://www.w3.org/2000/svg"},Lm=["id"],Rm=["id"],Um=["stop-color"],Wm=["stop-color"],Fm=["id"],Gm=["fill"],jm=["y","height","fill","filter"],Hm=["cy","fill"],qm=["fill"],Jm=["height"],Ym={x:"65",y:"38","font-size":"5",fill:"#22c55e","text-anchor":"middle"},Xm=["height"],Km={x:"50",y:"127","font-size":"6",fill:"#22c55e","text-anchor":"middle","font-family":"monospace"},Qm={class:"status-text"},Zm=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",Pm,[(e.openBlock(),e.createElementBlock("svg",Om,[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,Lm),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,Um),e.createElementVNode("stop",{offset:"100%","stop-color":p.value,"stop-opacity":"0.7"},null,8,Wm)],8,Rm),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,Fm)]),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,Gm),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,jm),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,Hm)):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,qm),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,Jm),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",Ym,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,Xm),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",Km,e.toDisplayString(t.value)+"% | "+e.toDisplayString(f.value)+"m³ ",1)])),e.createElementVNode("div",Qm," 液位: "+e.toDisplayString(t.value)+"% | 容量: "+e.toDisplayString(f.value)+"m³ ",1)]))}}),[["__scopeId","data-v-13c65d9d"]]),ef={class:"pump-3d-container"},tf={viewBox:"0 0 140 100",xmlns:"http://www.w3.org/2000/svg"},of=["id"],lf=["id"],nf=["id"],af={key:0,attributeName:"x1",values:"-100%;100%",dur:"1s",repeatCount:"indefinite"},rf={key:1,attributeName:"x2",values:"0%;200%",dur:"1s",repeatCount:"indefinite"},sf=["fill"],df=["fill"],cf=["fill"],pf=["fill"],mf=["transform"],ff=["fill"],uf={transform:"translate(100, 25)"},gf={x:"0",y:"2","font-size":"5",fill:"#22c55e","text-anchor":"middle"},hf={transform:"translate(115, 35)"},yf={x:"0",y:"1","font-size":"4",fill:"#3b82f6","text-anchor":"middle"},bf=["fill"],kf=["opacity"],Ef={x:"60",y:"68","font-size":"4",fill:"#cbd5e1","text-anchor":"middle","font-family":"monospace"},Nf=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",ef,[(e.openBlock(),e.createElementBlock("svg",tf,[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,of),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,lf),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",af)):e.createCommentVNode("",!0),t.value?(e.openBlock(),e.createElementBlock("animate",rf)):e.createCommentVNode("",!0)],8,nf)]),e.createElementVNode("rect",{x:"30",y:"75",width:"60",height:"20",rx:"2",fill:`url(#motor-gradient-${o.value})`},null,8,sf),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,df),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,cf)):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,pf)):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,mf),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,ff),i[20]||(i[20]=e.createElementVNode("rect",{x:"58",y:"30",width:"4",height:"20",fill:"#475569"},null,-1)),e.createElementVNode("g",uf,[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",gf,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",hf,[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",yf,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,bf),e.createElementVNode("circle",{cx:"25",cy:"30",r:"2",fill:"#ffffff",opacity:t.value?.6:.2},null,8,kf),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",Ef,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"]]),Vf={class:"conveyor-3d-container"},xf={viewBox:"0 0 200 80",xmlns:"http://www.w3.org/2000/svg"},wf=["id"],$f=["id"],Cf=["id"],_f=["fill","transform"],vf=["transform"],Bf=["fill","transform"],Sf=["transform"],Df=["fill"],If=["x1","x2"],Tf=["x","fill"],zf=["fill","opacity"],Mf={key:0,attributeName:"opacity",values:"1;0.4;1",dur:"1s",repeatCount:"indefinite"},Af={x:"100",y:"20","font-size":"10",fill:"#94a3b8","text-anchor":"middle","font-family":"monospace"},Pf=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",Vf,[(e.openBlock(),e.createElementBlock("svg",xf,[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,wf),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,$f),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,Cf)]),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,_f),(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,vf)])),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,Bf),(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,Sf)])),64)),e.createElementVNode("rect",{x:"25",y:"38",width:"150",height:"24",fill:`url(#belt-gradient-${o.value})`},null,8,Df),(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,If)])),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,Tf)):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",Mf)):e.createCommentVNode("",!0)],8,zf),e.createElementVNode("text",Af,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"]]),Of={class:"alarm-light-3d-container"},Lf={viewBox:"0 0 80 100",xmlns:"http://www.w3.org/2000/svg"},Rf=["id"],Uf=["stop-color"],Wf=["stop-color"],Ff=["stop-color"],Gf=["id"],jf=["stop-color"],Hf=["stop-color"],qf=["stop-color"],Jf=["id"],Yf=["fill","opacity"],Xf=["transform"],Kf=["fill","opacity"],Qf=["fill"],Zf=["fill"],e0=["fill"],t0=["fill"],o0={x:"40",y:"85","font-size":"4",fill:"#64748b","text-anchor":"middle","font-family":"Arial"},l0=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",Of,[(e.openBlock(),e.createElementBlock("svg",Lf,[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,Uf),e.createElementVNode("stop",{offset:"50%","stop-color":m.value,"stop-opacity":"0.7"},null,8,Wf),e.createElementVNode("stop",{offset:"100%","stop-color":m.value,"stop-opacity":"0.5"},null,8,Ff)],8,Rf),e.createElementVNode("radialGradient",{id:`glow-${o.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":m.value,"stop-opacity":"0.8"},null,8,jf),e.createElementVNode("stop",{offset:"50%","stop-color":m.value,"stop-opacity":"0.3"},null,8,Hf),e.createElementVNode("stop",{offset:"100%","stop-color":m.value,"stop-opacity":"0"},null,8,qf)],8,Gf),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,Jf)]),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,Yf)):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,Kf),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,Xf),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,Qf),e.createElementVNode("rect",{x:"22",y:"63",width:"36",height:"12",fill:`url(#base-gradient-${o.value})`,stroke:"#475569","stroke-width":"1"},null,8,Zf),e.createElementVNode("ellipse",{cx:"40",cy:"75",rx:"18",ry:"5",fill:`url(#base-gradient-${o.value})`,stroke:"#475569","stroke-width":"1"},null,8,e0),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,t0),e.createElementVNode("text",o0," 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"]]),n0={class:"temperature-sensor-3d-container"},a0={viewBox:"0 0 80 120",xmlns:"http://www.w3.org/2000/svg"},r0=["id"],i0=["id"],s0=["stop-color"],d0=["stop-color"],c0=["id"],p0=["stop-color"],m0=["stop-color"],f0=["fill"],u0=["y","height","fill"],g0=["fill"],h0=["fill"],y0=["fill","opacity"],b0={key:0,attributeName:"opacity",values:"1;0.3;1",dur:"0.8s",repeatCount:"indefinite"},k0=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",n0,[(e.openBlock(),e.createElementBlock("svg",a0,[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,r0),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,s0),e.createElementVNode("stop",{offset:"100%","stop-color":n.value,"stop-opacity":"0.7"},null,8,d0)],8,i0),e.createElementVNode("radialGradient",{id:`bulb-gradient-${o.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":n.value,"stop-opacity":"0.9"},null,8,p0),e.createElementVNode("stop",{offset:"70%","stop-color":n.value},null,8,m0),$[1]||($[1]=e.createElementVNode("stop",{offset:"100%","stop-color":"#991b1b"},null,-1))],8,c0)]),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,f0),$[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,u0),e.createElementVNode("circle",{cx:"40",cy:"75",r:"10",fill:`url(#bulb-gradient-${o.value})`,stroke:"#991b1b","stroke-width":"1.5"},null,8,g0),$[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,h0),$[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",b0)):e.createCommentVNode("",!0)],8,y0),$[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"]]),E0={class:"cylinder-3d-container"},N0={viewBox:"0 0 60 140",xmlns:"http://www.w3.org/2000/svg"},V0=["id"],x0=["id"],w0=["id"],$0=["fill"],C0=["fill"],_0=["fill"],v0=["y","height","fill"],B0=["cy"],S0=["cy"],D0=["x","fill"],I0=["x","fill"],T0={x:"30",y:"125","font-size":"5",fill:"#64748b","text-anchor":"middle","font-family":"Arial"},z0={x:"30",y:"18","font-size":"8",fill:"#22c55e","text-anchor":"middle","font-family":"monospace"},M0=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",E0,[(e.openBlock(),e.createElementBlock("svg",N0,[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,V0),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,x0),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,w0)]),e.createElementVNode("ellipse",{cx:"30",cy:"80",rx:"15",ry:"8",fill:`url(#cap-gradient-${o.value})`,stroke:"#1e293b","stroke-width":"1"},null,8,$0),e.createElementVNode("rect",{x:"15",y:"50",width:"30",height:"60",fill:`url(#cylinder-gradient-${o.value})`,stroke:"#334155","stroke-width":"1"},null,8,C0),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,_0),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,v0),e.createElementVNode("ellipse",{cx:"30",cy:h.value,rx:"4",ry:"2",fill:"#94a3b8",stroke:"#64748b","stroke-width":"0.5"},null,8,B0),e.createElementVNode("ellipse",{cx:"30",cy:i.value,rx:"13",ry:"6",fill:"#64748b",stroke:"#334155","stroke-width":"1"},null,8,S0),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,D0),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,I0),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",T0,e.toDisplayString(a.value)+"mm ",1),e.createElementVNode("text",z0,e.toDisplayString(t.value)+"mm ",1)])),e.createElementVNode("div",{class:e.normalizeClass(["status-text",$.value])},e.toDisplayString(g.value),3)]))}}),[["__scopeId","data-v-7429604c"]]),A0={class:"pipe-3d-container"},P0=["viewBox"],O0=["id"],L0=["id"],R0=["stop-color"],U0=["stop-color"],W0=["stop-color"],F0={key:0},G0=["y","width","height","fill"],j0=["y","width","height"],H0=["x","y","width","height","fill"],q0=["cy","rx","ry"],J0=["cx","cy","rx","ry"],Y0=["cy"],X0=["cy"],K0=["cx","cy"],Q0=["cx","cy"],Z0={key:1},eu=["x","width","height","fill"],tu=["x","width","height"],ou=["x","y","width","height","fill"],lu=["cx","rx","ry"],nu=["cx","cy","rx","ry"],au=["cx"],ru=["cx"],iu=["cx","cy"],su=["cx","cy"],du={key:2},cu=["id"],pu=["fill"],mu=["x1","y1","x2","y2","stroke","marker-end"],fu=["x1","y1","x2","y2","stroke","marker-end"],uu=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",A0,[(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,O0),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,R0),e.createElementVNode("stop",{offset:"50%","stop-color":d.value,"stop-opacity":"0.8"},null,8,U0),e.createElementVNode("stop",{offset:"100%","stop-color":d.value,"stop-opacity":"0.3"},null,8,W0)],8,L0)]),c.value==="horizontal"?(e.openBlock(),e.createElementBlock("g",F0,[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,G0),e.createElementVNode("rect",{x:"0",y:h.value-m.value+3,width:n.value,height:m.value*2-6,fill:"#0f172a"},null,8,j0),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,H0)):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,q0),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,J0),e.createElementVNode("circle",{cx:0,cy:h.value-m.value-2,r:"1.5",fill:"#1e293b"},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:n.value,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.openBlock(),e.createElementBlock("g",Z0,[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,eu),e.createElementVNode("rect",{x:i.value-m.value+3,y:"0",width:m.value*2-6,height:n.value,fill:"#0f172a"},null,8,tu),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,ou)):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,lu),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,nu),e.createElementVNode("circle",{cx:i.value-m.value-2,cy:0,r:"1.5",fill:"#1e293b"},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:n.value,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)])])),t.value?(e.openBlock(),e.createElementBlock("g",du,[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,pu)],8,cu)]),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,mu)):(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,fu))])):e.createCommentVNode("",!0)],8,P0)),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"]]),gu={class:"filter-3d-container"},hu={viewBox:"0 0 120 100",xmlns:"http://www.w3.org/2000/svg"},yu=["id"],bu=["id"],ku=["stop-color"],Eu=["stop-color"],Nu=["fill"],Vu=["fill"],xu={opacity:"0.5"},wu=["x1","x2"],$u=["y1","y2"],Cu=["y","height"],_u={transform:"translate(80, 30)"},vu=["fill"],Bu=["fill","opacity"],Su={key:0,attributeName:"opacity",values:"1;0.3;1",dur:"0.8s",repeatCount:"indefinite"},Du={x:"60",y:"95","font-size":"5",fill:"#64748b","text-anchor":"middle","font-family":"Arial"},Iu=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",gu,[(e.openBlock(),e.createElementBlock("svg",hu,[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,yu),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,ku),e.createElementVNode("stop",{offset:"100%","stop-color":f.value},null,8,Eu)],8,bu)]),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,Nu),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,Vu),e.createElementVNode("g",xu,[(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,wu)),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,$u)),64))]),e.createElementVNode("rect",{x:"52",y:70-t.value*.4,width:"16",height:t.value*.4,fill:"#ef4444",opacity:"0.6"},null,8,Cu)]),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",_u,[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,vu),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",Su)):e.createCommentVNode("",!0)],8,Bu),e.createElementVNode("text",Du," 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"]]),Tu={class:"heat-exchanger-3d-container"},zu={viewBox:"0 0 140 120",xmlns:"http://www.w3.org/2000/svg"},Mu=["id"],Au=["id"],Pu=["id"],Ou=["fill"],Lu={opacity:"0.6"},Ru=["y1","y2"],Uu=["y","fill"],Wu=["y","fill"],Fu=["x","fill"],Gu=["x","fill"],ju={transform:"translate(70, 60)"},Hu=["fill"],qu={transform:"translate(95, 50)"},Ju={x:"0",y:"-1","font-size":"6",fill:"#ef4444","text-anchor":"middle"},Yu={x:"0",y:"6","font-size":"5",fill:"#f97316","text-anchor":"middle"},Xu={transform:"translate(45, 70)"},Ku={x:"0",y:"-1","font-size":"6",fill:"#3b82f6","text-anchor":"middle"},Qu={x:"0",y:"6","font-size":"5",fill:"#60a5fa","text-anchor":"middle"},Zu=["fill","opacity"],e1={key:0,attributeName:"opacity",values:"1;0.5;1",dur:"1.5s",repeatCount:"indefinite"},t1={x:"70",y:"115","font-size":"5",fill:"#64748b","text-anchor":"middle","font-family":"Arial"},o1=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",Tu,[(e.openBlock(),e.createElementBlock("svg",zu,[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,Mu),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,Au),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,Pu)]),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,Ou),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",Lu,[(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,Ru)),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,Uu)):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,Wu)):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,Fu)):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,Gu)):e.createCommentVNode("",!0)]),e.createElementVNode("g",ju,[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,Hu),y[12]||(y[12]=e.createElementVNode("text",{x:"0",y:"8","font-size":"4",fill:"#64748b","text-anchor":"middle"},"%",-1))]),e.createElementVNode("g",qu,[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",Ju,e.toDisplayString(a.value)+"°C",1),e.createElementVNode("text",Yu,"→"+e.toDisplayString(c.value)+"°C",1)]),e.createElementVNode("g",Xu,[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",Ku,e.toDisplayString(d.value)+"°C",1),e.createElementVNode("text",Qu,"→"+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",e1)):e.createCommentVNode("",!0)],8,Zu),e.createElementVNode("text",t1," 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"]]),l1={class:"tee-3d-container"},n1={viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg"},a1=["id"],r1=["id"],i1=["stop-color"],s1=["stop-color"],d1=["fill"],c1=["fill"],p1=["fill"],m1={key:0},f1=["fill"],u1=["x","fill"],g1=["x","fill"],h1=["y","fill"],y1=["y","fill"],b1={key:1},k1=["id"],E1=["fill"],N1=["stroke","marker-end"],V1=["stroke","marker-end"],x1=["stroke","marker-end"],w1={transform:"translate(50, 50)"},$1=["fill"],C1=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",l1,[(e.openBlock(),e.createElementBlock("svg",n1,[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,a1),e.createElementVNode("radialGradient",{id:`flow-gradient-${o.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":a.value,"stop-opacity":"0.8"},null,8,i1),e.createElementVNode("stop",{offset:"100%","stop-color":a.value,"stop-opacity":"0.2"},null,8,s1)],8,r1)]),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,d1),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,c1),e.createElementVNode("circle",{cx:"50",cy:"50",r:"18",fill:`url(#pipe-gradient-${o.value})`,stroke:"#334155","stroke-width":"2"},null,8,p1),$[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",m1,[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,f1),e.createElementVNode("rect",{x:p.value,y:"45",width:"20",height:"10",fill:a.value,opacity:"0.6"},null,8,u1),e.createElementVNode("rect",{x:60+f.value,y:"45",width:"20",height:"10",fill:a.value,opacity:"0.4"},null,8,g1),e.createElementVNode("rect",{x:"45",y:m.value,width:"10",height:"20",fill:a.value,opacity:"0.4"},null,8,h1),e.createElementVNode("rect",{x:"45",y:60+n.value,width:"10",height:"20",fill:a.value,opacity:"0.4"},null,8,y1)])):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",b1,[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,E1)],8,k1)]),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,N1),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,V1)):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,x1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("g",w1,[$[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,$1)])])),e.createElementVNode("div",{class:e.normalizeClass(["status-text",{"is-flowing":t.value}])},e.toDisplayString(t.value?"流动中":"关闭"),3)]))}}),[["__scopeId","data-v-cd328987"]]);class _1{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 _1,v1={class:"scada-layout","data-scada-theme":"dark"},B1={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:wp,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:$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:"light-3d-vue",width:100,height:120,component:jp,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:im,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:Em,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:Am,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:Zm,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:Nf,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: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:"alarm-light-3d-vue",width:100,height:120,component:l0,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:k0,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:M0,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:uu,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:Iu,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:o1,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:C1,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",v1,[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",B1,[r.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Be,{key:0,onAddComponent:g})),e.createVNode(Io,{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(Od,{"auth-code":s.authCode,"custom-footer":s.customFooter},null,8,["auth-code","custom-footer"]),r.previewMode?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(xp,{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"]]),S1={class:"preview-container"},D1={class:"preview-canvas-wrapper"},I1=P(e.defineComponent({__name:"PreviewView",setup(s){const l=e.ref(null);let o=null;const r=()=>Re(de.SCADA_PREVIEW_DATA);return e.onMounted(()=>{var a,c,d,p;if(!l.value)return;const t=r();if(!t){console.error("没有找到预览数据");return}o=new ee.Graph({container:l.value,width:((a=t.config)==null?void 0:a.width)||1200,height:((c=t.config)==null?void 0:c.height)||800,background:((d=t.config)==null?void 0:d.background)||{color:"#1e293b"},grid:((p=t.config)==null?void 0:p.grid)||!1,interacting:{nodeMovable:!1,edgeMovable:!1,edgeLabelMovable:!1,arrowheadMovable:!1,vertexMovable:!1,vertexAddable:!1,vertexDeletable:!1},panning:!1,mousewheel:!1}),t.cells&&(o.fromJSON(t.cells),o.getNodes().forEach(m=>{xt(o,m);const n=m.getData();if(n&&n.animation&&n.animation.enabled===!0){const u={type:n.animation.type||"none",duration:n.animation.duration||1e3,loop:n.animation.loop!==!1};se.startAnimation(m,u)}})),console.log("预览模式已加载",t)}),e.onUnmounted(()=>{se.clearAll(),o&&o.dispose(),Ue(de.SCADA_PREVIEW_DATA)}),(t,a)=>(e.openBlock(),e.createElementBlock("div",S1,[e.createElementVNode("div",D1,[e.createElementVNode("div",{ref_key:"canvasContainer",ref:l,class:"preview-canvas"},null,512)])]))}}),[["__scopeId","data-v-782d1ed2"]]),T1={ScadaCanvas:St,PropertyPanel:je,Header:Ce,ComponentLibrary:Be,CanvasConfigPanel:Se,BindingCard:ze,EventCard:Ie,BasicPropertiesTab:De,AttributeConfigDialog:Me,CustomCodeDialog:Ae},Dt=s=>{Object.entries(T1).forEach(([l,o])=>{s.component(l,o)})},z1={install:Dt,version:"1.0.0"};I.AttributeConfigDialog=Me,I.BasicComponents=mo,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=go,I.PointAccessMode=le,I.PointDataType=oe,I.PreviewView=I1,I.PropertyPanel=je,I.STORAGE_KEYS=de,I.ScadaCanvas=St,I.animationEngine=se,I.canvasConfigItems=yo,I.canvasConfigManager=W,I.componentRegistry=he,I.default=z1,I.defaultCanvasConfig=ve,I.exportToJSON=wt,I.formatTimestamp=Fe,I.generateEventId=$t,I.generateNodeId=nd,I.generateUniqueId=We,I.getCurrentTimestamp=Ge,I.install=Dt,I.loadFromLocal=od,I.loadFromSession=Re,I.randomPosition=Ct,I.registerNodeEvents=xt,I.removeFromLocal=ld,I.removeFromSession=Ue,I.saveToLocal=td,I.saveToSession=Le,I.showMessage=Q,I.sizePresetMap=ye,Object.defineProperties(I,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|