@nywqs/scada-engine 1.1.24 → 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.
@@ -1,5 +1,5 @@
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.24
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
@@ -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",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-9ad415d1"]]),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"}})});
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"}})});