vue-wiring-diagram 1.0.18 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -36204,7 +36204,7 @@ const v6 = { class: "control-box" }, w6 = {
|
|
|
36204
36204
|
]);
|
|
36205
36205
|
};
|
|
36206
36206
|
}
|
|
36207
|
-
}), Y6 = /* @__PURE__ */ Qn(G6, [["__scopeId", "data-v-
|
|
36207
|
+
}), Y6 = /* @__PURE__ */ Qn(G6, [["__scopeId", "data-v-1890cc85"]]), W6 = [
|
|
36208
36208
|
Y6,
|
|
36209
36209
|
J0
|
|
36210
36210
|
], X0 = (n, e) => {
|
|
@@ -735,4 +735,4 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:s,curr
|
|
|
735
735
|
font-size: 12px;
|
|
736
736
|
background: 0 0;
|
|
737
737
|
}
|
|
738
|
-
`;var Fj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class li extends ye{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}constructor(e={}){super(),this.name="stencil",zr(this.name,zj),this.graphs={},this.groups={},this.options=Object.assign(Object.assign({},li.defaultOptions),e),this.init()}init(){this.dnd=new ks(this.options),this.onSearch=op(this.onSearch,200),this.initContainer(),this.initSearch(),this.initContent(),this.initGroups(),this.setTitle(),this.startListening()}load(e,t){return Array.isArray(e)?this.loadGroup(e,t):this.options.groups&&Object.keys(this.options.groups).forEach(s=>{e[s]&&this.loadGroup(e[s],s)}),this}unload(e,t){return Array.isArray(e)?this.loadGroup(e,t,!0):this.options.groups&&Object.keys(this.options.groups).forEach(s=>{e[s]&&this.loadGroup(e[s],s,!0)}),this}toggleGroup(e){return this.isGroupCollapsed(e)?this.expandGroup(e):this.collapseGroup(e),this}collapseGroup(e){if(this.isGroupCollapsable(e)){const t=this.groups[e];t&&!this.isGroupCollapsed(e)&&(this.trigger("group:collapse",{name:e}),K(t,"collapsed"))}return this}expandGroup(e){if(this.isGroupCollapsable(e)){const t=this.groups[e];t&&this.isGroupCollapsed(e)&&(this.trigger("group:expand",{name:e}),De(t,"collapsed"))}return this}isGroupCollapsable(e){const t=this.groups[e];return On(t,"collapsable")}isGroupCollapsed(e){const t=this.groups[e];return t&&On(t,"collapsed")}collapseGroups(){return Object.keys(this.groups).forEach(e=>this.collapseGroup(e)),this}expandGroups(){return Object.keys(this.groups).forEach(e=>this.expandGroup(e)),this}resizeGroup(e,t){const s=this.graphs[e];return s&&s.resize(t.width,t.height),this}addGroup(e){const t=Array.isArray(e)?e:[e];this.options.groups?this.options.groups.push(...t):this.options.groups=t,t.forEach(s=>this.initGroup(s))}removeGroup(e){const t=Array.isArray(e)?e:[e];this.options.groups&&(this.options.groups=this.options.groups.filter(s=>!t.includes(s.name)),t.forEach(s=>{const r=this.graphs[s];this.unregisterGraphEvents(r),r.dispose(),delete this.graphs[s];const i=this.groups[s];Ft(i),delete this.groups[s]}))}initContainer(){this.container=document.createElement("div"),K(this.container,this.prefixClassName(Ot.base)),fe(this.container,"data-not-found-text",this.options.notFoundText||"No matches found")}initContent(){this.content=document.createElement("div"),K(this.content,this.prefixClassName(Ot.content)),ws(this.content,this.container)}initSearch(){this.options.search&&(K(this.container,"searchable"),_t(this.container,this.renderSearch()))}initGroup(e){const t=this.options.stencilGraphOptions||{},s=document.createElement("div");K(s,this.prefixClassName(Ot.group)),fe(s,"data-name",e.name),(e.collapsable==null&&this.options.collapsable||e.collapsable!==!1)&&K(s,"collapsable"),un(s,"collapsed",e.collapsed===!0);const r=document.createElement("h3");K(r,this.prefixClassName(Ot.groupTitle)),r.innerHTML=e.title||e.name;const i=document.createElement("div");K(i,this.prefixClassName(Ot.groupContent));const o=e.graphOptions,a=new $(Object.assign(Object.assign(Object.assign({},t),o),{container:document.createElement("div"),model:t.model||new Qe,width:e.graphWidth||this.options.stencilGraphWidth,height:e.graphHeight||this.options.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));this.registerGraphEvents(a),_t(i,a.container),_t(s,[r,i]),ws(s,this.content),this.groups[e.name]=s,this.graphs[e.name]=a}initGroups(){if(this.clearGroups(),this.setCollapsableState(),this.options.groups&&this.options.groups.length)this.options.groups.forEach(e=>{this.initGroup(e)});else{const e=this.options.stencilGraphOptions||{},t=new $(Object.assign(Object.assign({},e),{container:document.createElement("div"),model:e.model||new Qe,width:this.options.stencilGraphWidth,height:this.options.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));_t(this.content,t.container),this.graphs[yo.defaultGroupName]=t}}setCollapsableState(){this.options.collapsable=this.options.collapsable&&this.options.groups&&this.options.groups.some(e=>e.collapsable!==!1),this.options.collapsable?(K(this.container,"collapsable"),this.options.groups&&this.options.groups.every(t=>t.collapsed||t.collapsable===!1)?K(this.container,"collapsed"):De(this.container,"collapsed")):De(this.container,"collapsable")}setTitle(){const e=document.createElement("div");K(e,this.prefixClassName(Ot.title)),e.innerHTML=this.options.title,ws(e,this.container)}renderSearch(){const e=document.createElement("div");K(e,this.prefixClassName(Ot.search));const t=document.createElement("input");return fe(t,{type:"search",placeholder:this.options.placeholder||"Search"}),K(t,this.prefixClassName(Ot.searchText)),_t(e,t),e}startListening(){const e=this.prefixClassName(Ot.title),t=this.prefixClassName(Ot.searchText),s=this.prefixClassName(Ot.groupTitle);this.delegateEvents({[`click .${e}`]:"onTitleClick",[`touchstart .${e}`]:"onTitleClick",[`click .${s}`]:"onGroupTitleClick",[`touchstart .${s}`]:"onGroupTitleClick",[`input .${t}`]:"onSearch",[`focusin .${t}`]:"onSearchFocusIn",[`focusout .${t}`]:"onSearchFocusOut"})}stopListening(){this.undelegateEvents()}registerGraphEvents(e){e.on("cell:mousedown",this.onDragStart,this)}unregisterGraphEvents(e){e.off("cell:mousedown",this.onDragStart,this)}loadGroup(e,t,s){const r=this.getModel(t);if(r){const c=e.map(u=>Ue.isNode(u)?u:Ue.create(u));s===!0?r.removeCells(c):r.resetCells(c)}const i=this.getGroup(t);let o=this.options.stencilGraphHeight;i&&i.graphHeight!=null&&(o=i.graphHeight);const a=i&&i.layout||this.options.layout;if(a&&r&&Q(a,this,r,i),!o){const c=this.getGraph(t);c.fitToContent({minWidth:c.options.width,gridHeight:1,padding:i&&i.graphPadding||this.options.stencilGraphPadding||10})}return this}onDragStart(e){const{e:t,node:s}=e,r=this.getGroupByNode(s);r&&r.nodeMovable===!1||this.dnd.start(s,t)}filter(e,t){const s=Object.keys(this.graphs).reduce((r,i)=>{const o=this.graphs[i],a=i===yo.defaultGroupName?null:i,c=o.model.getNodes().filter(f=>{let p=!1;typeof t=="function"?p=Q(t,this,f,e,a,this):typeof t=="boolean"?p=t:p=this.isCellMatched(f,e,t,e.toLowerCase()!==e);const g=o.renderer.findViewByCell(f);return g&&un(g.container,"unmatched",!p),p}),u=c.length>0,d=this.options,h=new Qe;return h.resetCells(c),d.layout&&Q(d.layout,this,h,this.getGroup(i)),this.groups[i]&&un(this.groups[i],"unmatched",!u),o.fitToContent({gridWidth:1,gridHeight:1,padding:d.stencilGraphPadding||10}),r||u},!1);un(this.container,"not-found",!s)}isCellMatched(e,t,s,r){return t&&s?Object.keys(s).some(i=>{if(i==="*"||e.shape===i){const o=s[i];return typeof o=="boolean"?o:(Array.isArray(o)?o:[o]).some(c=>{let u=e.getPropByPath(c);return u!=null?(u=`${u}`,r||(u=u.toLowerCase()),u.indexOf(t)>=0):!1})}return!1}):!0}onSearch(e){this.filter(e.target.value,this.options.search)}onSearchFocusIn(){K(this.container,"is-focused")}onSearchFocusOut(){De(this.container,"is-focused")}onTitleClick(){this.options.collapsable&&(un(this.container,"collapsed"),On(this.container,"collapsed")?this.collapseGroups():this.expandGroups())}onGroupTitleClick(e){const t=e.target.closest(`.${this.prefixClassName(Ot.group)}`);t&&this.toggleGroup(fe(t,"data-name")||"");const s=Object.keys(this.groups).every(r=>{const i=this.getGroup(r),o=this.groups[r];return i&&i.collapsable===!1||On(o,"collapsed")});un(this.container,"collapsed",s)}getModel(e){const t=this.getGraph(e);return t?t.model:null}getGraph(e){return this.graphs[e||yo.defaultGroupName]}getGroup(e){const t=this.options.groups;return e!=null&&t&&t.length?t.find(s=>s.name===e):null}getGroupByNode(e){const t=this.options.groups;return t?t.find(s=>{const r=this.getModel(s.name);return r?r.has(e.id):!1}):null}clearGroups(){Object.keys(this.graphs).forEach(e=>{const t=this.graphs[e];this.unregisterGraphEvents(t),t.dispose()}),Object.keys(this.groups).forEach(e=>{const t=this.groups[e];Ft(t)}),this.graphs={},this.groups={}}onRemove(){this.clearGroups(),this.dnd.remove(),this.stopListening(),this.undelegateDocumentEvents()}dispose(){this.remove(),Fr(this.name)}}Fj([ye.dispose()],li.prototype,"dispose",null),function(n){n.defaultOptions=Object.assign({stencilGraphWidth:200,stencilGraphHeight:800,title:"Stencil",collapsable:!1,placeholder:"Search",notFoundText:"No matches found",layout(e,t){const s={columnWidth:this.options.stencilGraphWidth/2-10,columns:2,rowHeight:80,resizeToFit:!1,dx:10,dy:10};$j(e,Object.assign(Object.assign(Object.assign({},s),this.options.layoutOptions),t?t.layoutOptions:{}))}},ks.defaults)}(li||(li={}));var Ot;(function(n){n.base="widget-stencil",n.title=`${n.base}-title`,n.search=`${n.base}-search`,n.searchText=`${n.search}-text`,n.content=`${n.base}-content`,n.group=`${n.base}-group`,n.groupTitle=`${n.group}-title`,n.groupContent=`${n.group}-content`})(Ot||(Ot={}));var yo;(function(n){n.defaultGroupName="__default__"})(yo||(yo={})),$.prototype.toSVG=function(n,e){const t=this.getPlugin("export");t&&t.toSVG(n,e)},$.prototype.toPNG=function(n,e){const t=this.getPlugin("export");t&&t.toPNG(n,e)},$.prototype.toJPEG=function(n,e){const t=this.getPlugin("export");t&&t.toJPEG(n,e)},$.prototype.exportPNG=function(n,e){const t=this.getPlugin("export");t&&t.exportPNG(n,e)},$.prototype.exportJPEG=function(n,e){const t=this.getPlugin("export");t&&t.exportJPEG(n,e)},$.prototype.exportSVG=function(n,e){const t=this.getPlugin("export");t&&t.exportSVG(n,e)};var Uj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class n0 extends Te{constructor(){super(),this.name="export"}get view(){return this.graph.view}init(e){this.graph=e}exportPNG(e="chart",t={}){this.toPNG(s=>{Js.downloadDataUri(s,e)},t)}exportJPEG(e="chart",t={}){this.toPNG(s=>{Js.downloadDataUri(s,e)},t)}exportSVG(e="chart",t={}){this.toSVG(s=>{Js.downloadDataUri(Js.svgToDataUrl(s),e)},t)}toSVG(e,t={}){this.notify("before:export",t);const s=this.view.svg,r=se.create(s).clone();let i=r.node;const o=r.findOne(`.${this.view.prefixClassName("graph-svg-stage")}`),a=t.viewBox||this.graph.graphToLocal(this.graph.getContentBBox()),c=t.preserveDimensions;if(c){const h=typeof c=="boolean"?a:c;r.attr({width:h.width,height:h.height})}if(r.removeAttribute("style").attr("viewBox",[a.x,a.y,a.width,a.height].join(" ")),o.removeAttribute("transform"),t.copyStyles!==!1){const h=s.ownerDocument,f=Array.from(s.querySelectorAll("*")),p=Array.from(i.querySelectorAll("*")),g=h.styleSheets.length,m=[];for(let w=g-1;w>=0;w-=1)m[w]=h.styleSheets[w],h.styleSheets[w].disabled=!0;const y={};f.forEach((w,x)=>{const v=window.getComputedStyle(w,null),S={};Object.keys(v).forEach(E=>{S[E]=v.getPropertyValue(E)}),y[x]=S}),g!==h.styleSheets.length&&m.forEach((w,x)=>{h.styleSheets[x]=w});for(let w=0;w<g;w+=1)h.styleSheets[w].disabled=!1;const b={};f.forEach((w,x)=>{const v=window.getComputedStyle(w,null),S=y[x],E={};Object.keys(v).forEach(C=>{!Mc(C)&&v.getPropertyValue(C)!==S[C]&&(E[C]=v.getPropertyValue(C))}),b[x]=E}),p.forEach((w,x)=>{Je(w,b[x])})}const u=t.stylesheet;if(typeof u=="string"){const h=s.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(u);r.prepend(se.create("style",{type:"text/css"},[h]))}const d=()=>{const h=t.beforeSerialize;if(typeof h=="function"){const p=Q(h,this.graph,i);p instanceof SVGSVGElement&&(i=p)}const f=new XMLSerializer().serializeToString(i).replace(/ /g," ");this.notify("after:export",t),e(f)};if(t.serializeImages){const h=r.find("image").map(f=>new Promise(p=>{const g=f.attr("xlink:href")||f.attr("href");Js.imageToDataUri(g,(m,y)=>{!m&&y&&f.attr("xlink:href",y),p()})}));Promise.all(h).then(d)}else d()}toDataURL(e,t){let s=t.viewBox||this.graph.getContentBBox();const r=ms(t.padding);t.width&&t.height&&(r.left+r.right>=t.width&&(r.left=r.right=0),r.top+r.bottom>=t.height&&(r.top=r.bottom=0));const i=new U(-r.left,-r.top,r.left+r.right,r.top+r.bottom);if(t.width&&t.height){const d=s.width+r.left+r.right,h=s.height+r.top+r.bottom;i.scale(d/t.width,h/t.height)}s=U.create(s).moveAndExpand(i);const o=typeof t.width=="number"&&typeof t.height=="number"?{width:t.width,height:t.height}:s;let a=t.ratio?parseFloat(t.ratio):1;(!Number.isFinite(a)||a===0)&&(a=1);const c={width:Math.max(Math.round(o.width*a),1),height:Math.max(Math.round(o.height*a),1)};{const d=document.createElement("canvas"),h=d.getContext("2d");d.width=c.width,d.height=c.height;const f=c.width-1,p=c.height-1;h.fillStyle="rgb(1,1,1)",h.fillRect(f,p,1,1);const g=h.getImageData(f,p,1,1).data;if(g[0]!==1||g[1]!==1||g[2]!==1)throw new Error("size exceeded")}const u=new Image;u.onload=()=>{const d=document.createElement("canvas");d.width=c.width,d.height=c.height;const h=d.getContext("2d");h.fillStyle=t.backgroundColor||"white",h.fillRect(0,0,c.width,c.height);try{h.drawImage(u,0,0,c.width,c.height);const f=d.toDataURL(t.type,t.quality);e(f)}catch{}},this.toSVG(d=>{u.src=`data:image/svg+xml,${encodeURIComponent(d)}`},Object.assign(Object.assign({},t),{viewBox:s,serializeImages:!0,preserveDimensions:Object.assign({},c)}))}toPNG(e,t={}){this.toDataURL(e,Object.assign(Object.assign({},t),{type:"image/png"}))}toJPEG(e,t={}){this.toDataURL(e,Object.assign(Object.assign({},t),{type:"image/jpeg"}))}notify(e,t){this.trigger(e,t),this.graph.trigger(e,t)}dispose(){this.off()}}Uj([Te.dispose()],n0.prototype,"dispose",null);const Hj={class:"control-box"},Gj=En({__name:"index",props:{payload:Object},setup(n){const e=n,t=l.ref("3"),s=l.ref([]),r=()=>{s.value=JSON.parse(JSON.stringify(e.payload.getPorts().map(u=>({id:u.id,attrs:u.attrs,args:{x:Number(u.args.x.replace("%","")),y:Number(u.args.y.replace("%",""))}}))))},i=()=>{const u=Cu;u.attrs.text.text=`${e.payload.getPorts().length+1}`,u.args.x="50%",u.args.y="50%",e.payload.addPorts([{group:"ports",...u}]),r()},o=()=>{qi("#drawing-board",!0)},a=(u,d,h)=>{e.payload.portProp(u,"args/"+d,h+"%"),r()},c=u=>{e.payload.removePort(u),r()};return l.onMounted(()=>{r()}),(u,d)=>{const h=l.resolveComponent("el-button"),f=l.resolveComponent("el-table-column"),p=l.resolveComponent("el-slider"),g=l.resolveComponent("el-icon"),m=l.resolveComponent("el-table"),y=l.resolveComponent("el-collapse-item"),b=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",Hj,[l.createVNode(b,{modelValue:t.value,"onUpdate:modelValue":d[0]||(d[0]=w=>t.value=w),accordion:""},{default:l.withCtx(()=>[l.createVNode(y,{title:"连接桩设置",name:"3"},{default:l.withCtx(()=>[l.createVNode(h,{type:"primary",onClick:i,size:"small"},{default:l.withCtx(()=>d[1]||(d[1]=[l.createTextVNode("添加连接桩")])),_:1}),l.createVNode(h,{type:"primary",onClick:o,size:"small"},{default:l.withCtx(()=>d[2]||(d[2]=[l.createTextVNode("显示连接桩")])),_:1}),l.createVNode(m,{data:s.value,border:"",size:"small",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[l.createVNode(f,{label:"ID",width:"50",align:"center"},{default:l.withCtx(({row:w})=>[l.createTextVNode(l.toDisplayString(w.attrs.text.text),1)]),_:1}),l.createVNode(f,{label:"x",width:"100",align:"center"},{default:l.withCtx(({row:w})=>[l.createVNode(p,{modelValue:w.args.x,"onUpdate:modelValue":x=>w.args.x=x,min:0,max:100,step:1,onInput:x=>a(w.id,"x",x)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(f,{label:"y",width:"100",align:"center"},{default:l.withCtx(({row:w})=>[l.createVNode(p,{modelValue:w.args.y,"onUpdate:modelValue":x=>w.args.y=x,min:0,max:100,step:1,onInput:x=>a(w.id,"y",x)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(f,{label:"操作",width:"70",align:"center"},{default:l.withCtx(({row:w})=>[l.createVNode(h,{type:"danger",size:"small",onClick:x=>c(w.id)},{default:l.withCtx(()=>[l.createVNode(g,null,{default:l.withCtx(()=>[l.createVNode(l.unref(Sp))]),_:1})]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-b280098c"]]),bl=[{shape:"rect",width:60,height:5,attrs:{body:{fill:"#ffffff",stroke:"#ffffff",strokeWidth:0}},data:{type:"base-shape"}},{shape:"rect",width:60,height:20,attrs:{body:{fill:"#ffffff",stroke:"#ffffff",strokeWidth:1}},data:{type:"base-shape",label:"母线"}},{shape:"circle",width:40,height:40,attrs:{body:{fill:"#ffffff",stroke:"#ffffff",strokeWidth:1}},data:{type:"base-shape"}},{shape:"ellipse",width:60,height:40,attrs:{body:{fill:"#ffffff",stroke:"#ffffff"}},data:{type:"base-shape"}}],s0={groups:{ports:{position:"absolute",args:{x:0,y:0},attrs:{circle:{magnet:!0,stroke:"#8f8f8f",r:4}},label:{position:"top"}}}},gd=Object.assign({name:"wiring-diagram-preview"},{__name:"index",props:{id:{type:String,default:""},background:{type:Object,default:()=>({})},grid:{type:Object,default:()=>({})},data:{type:Object,default:()=>({})}},setup(n){const e=n,t=l.ref(),s=()=>{const y=document.getElementById("preview-container");t.value=new $({container:y,autoResize:!0,panning:!0,mousewheel:!0,connecting:{router:"orth",connectionPoint:{name:"anchor"},anchor:"center"},interacting:{nodeMovable:!1,magnetConnectable:!1,edgeMovable:!1,edgeLabelMovable:!1,arrowheadMovable:!1,vertexMovable:!1,vertexAddable:!1,vertexDeletable:!1}}),t.value.on("blank:dblclick",()=>{d()})},r=async()=>{let y,b,w;if(e.id){const{background:x,grid:v,data:S}=await Im(e.id);y=x,b=v,w=S}else y=e.background,b={},w=e.data;t.value.drawBackground(y),t.value.drawGrid(b),t.value.fromJSON(w),c()},i=l.ref(null),o=l.ref([]),a=l.ref([]),c=()=>{o.value=t.value.getCells().filter(y=>{var b,w;return((b=y==null?void 0:y.data)==null?void 0:b.type)==="text"||((w=y==null?void 0:y.data)==null?void 0:w.type)==="pipe"}),o.value.forEach(y=>{var b,w;(w=(b=y==null?void 0:y.data)==null?void 0:b.fields)!=null&&w.length&&y.data.fields.forEach(x=>{x.field&&a.value.push({id:y==null?void 0:y.id,fields:y==null?void 0:y.data.fields})})}),console.log("所有字段",a.value),d()},u=l.ref(!0),d=async()=>{if(!a.value.length)return;if(!u.value){We.warning("数据正在更新中,请稍后再试");return}i.value&&clearInterval(i.value),u.value=!1;let y=await GD(a.value).catch(()=>{u.value=!0});u.value=!0,y==null||y.forEach(b=>{var x,v;const w=t.value.getCellById(b.id);w.data.type==="text"&&(w.label=h(w.data.content,b.fields)),w.data.type==="pipe"&&(console.log("管道详情",w,(x=b.fields)==null?void 0:x[0].value),f(w,(v=b.fields)==null?void 0:v[0].value))}),i.value=setTimeout(()=>{d()},1e4)},h=(y,b)=>{let w=0;return y.replace(yl,(x,v)=>{const S=b.find(E=>E.index===w);return w++,S?S.value:Qb})},f=(y,b)=>{if(!y.data.isCondition)return!1;for(let w=0;w<y.data.condition.length;w++)if(b>y.data.condition[w].min&&b<=y.data.condition[w].max)return y.attr("line2/style/animation",fd(y.data.condition[w].direction)),!1},p=()=>{t.value.zoomToFit({maxScale:1.4,padding:20})},g=l.shallowRef(),m=()=>{new ResizeObserver(()=>{p()}).observe(g.value)};return l.onMounted(()=>{s(),r(),setTimeout(()=>{qi("#preview-container",!1),p()},100),m()}),l.onUnmounted(()=>{clearInterval(i.value)}),(y,b)=>(l.openBlock(),l.createElementBlock("div",{id:"preview-container",ref_key:"previewRef",ref:g,onDblclick:p},null,544))}}),Yj={class:"form-container"},Wj={class:"footer"},qj=En({__name:"group-form",props:{payload:{type:Object,default:()=>({})}},emits:["close"],setup(n,{emit:e}){const t=n,s=e,r=l.reactive({groupName:"",sort:1,isShow:1}),i=l.reactive({groupName:[{required:!0,message:"请输入分组名称",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],sort:[{required:!0,message:"请输入排序",trigger:"blur"},{type:"number",message:"排序必须为数字值"}],isShow:[{required:!0,message:"请选择是否显示",trigger:"change"}]}),o=l.ref(),a=()=>{console.log(r),o.value.validate(u=>{if(u)r.id?za("/cny/custom/updateGroup",r).then(d=>{d!=null&&d.isOk?(We.success("保存成功"),s("close",!0)):We.error((d==null?void 0:d.msg)||"保存失败")}):za("/cny/custom/saveGroup",r).then(d=>{d!=null&&d.isOk?(We.success("保存成功"),s("close",!0)):We.error((d==null?void 0:d.msg)||"保存失败")});else return!1})},c=()=>{s("close",!1)};return l.onMounted(()=>{var u;(u=t.payload)!=null&&u.id&&(r.id=t.payload.id,r.groupName=t.payload.groupName,r.sort=t.payload.sort,r.isShow=t.payload.isShow)}),(u,d)=>{const h=l.resolveComponent("el-input"),f=l.resolveComponent("el-form-item"),p=l.resolveComponent("el-input-number"),g=l.resolveComponent("el-switch"),m=l.resolveComponent("el-button"),y=l.resolveComponent("el-form");return l.openBlock(),l.createElementBlock("div",Yj,[l.createVNode(y,{ref_key:"form",ref:o,model:r,rules:i,"label-width":"90px","label-suffix":":"},{default:l.withCtx(()=>[l.createVNode(f,{label:"分组名称",prop:"groupName"},{default:l.withCtx(()=>[l.createVNode(h,{modelValue:r.groupName,"onUpdate:modelValue":d[0]||(d[0]=b=>r.groupName=b),placeholder:"请输入分组名称",clearable:""},null,8,["modelValue"])]),_:1}),l.createVNode(f,{label:"排序",prop:"sort"},{default:l.withCtx(()=>[l.createVNode(p,{modelValue:r.sort,"onUpdate:modelValue":d[1]||(d[1]=b=>r.sort=b),min:0,max:999,step:1,"controls-position":"right"},null,8,["modelValue"])]),_:1}),l.createVNode(f,{label:"是否显示",prop:"isShow"},{default:l.withCtx(()=>[l.createVNode(g,{modelValue:r.isShow,"onUpdate:modelValue":d[2]||(d[2]=b=>r.isShow=b),"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},null,8,["modelValue"])]),_:1}),l.createElementVNode("div",Wj,[l.createVNode(m,{type:"primary",onClick:a},{default:l.withCtx(()=>d[3]||(d[3]=[l.createTextVNode("保存")])),_:1}),l.createVNode(m,{onClick:c},{default:l.withCtx(()=>d[4]||(d[4]=[l.createTextVNode("取消")])),_:1})])]),_:1},8,["model","rules"])])}}},[["__scopeId","data-v-a2a7ce25"]]),Jj={class:"form-container"},Xj={class:"footer"},Kj=En({__name:"image-form",props:{payload:{type:Object,default:()=>({})}},emits:["close"],setup(n,{emit:e}){const t=e,s=n,r=l.shallowRef(null),i=l.reactive({groupId:"",id:"",imageName:"",sort:0,isShow:1,imageUrl:""}),o={imageName:[{required:!0,message:"请输入图片名称",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],sort:[{required:!0,message:"请输入排序",trigger:"blur"},{type:"number",message:"排序必须为数字值"}]},a=l.ref(""),c=h=>{if(h.raw.type.indexOf("image")===-1){We.error("请上传图片格式的文件");return}const f=new FormData;f.append("file",h.raw),HD("/cny/file/fileUpload",f).then(p=>{p!=null&&p.isOk?(a.value=gs.defaults.baseURL+"/cny/upload/"+(p==null?void 0:p.data),i.imageUrl=p==null?void 0:p.data):We.error((p==null?void 0:p.msg)||"上传失败")})},u=()=>{console.log(i),r.value.validate(h=>{if(h)za("/cny/custom/savePicture",i).then(f=>{f!=null&&f.isOk?(We.success("保存成功"),t("close",!0)):We.error((f==null?void 0:f.msg)||"保存失败")});else return!1})},d=()=>{t("close",!1)};return l.onMounted(()=>{var h;(h=s.payload)!=null&&h.id&&(i.id=s.payload.id,i.imageName=s.payload.imageName,i.sort=s.payload.sort,i.isShow=s.payload.isShow,i.imageUrl=s.payload.imageUrl,a.value=i.imageUrl),i.groupId=s.payload.groupId}),(h,f)=>{const p=l.resolveComponent("el-input"),g=l.resolveComponent("el-form-item"),m=l.resolveComponent("el-input-number"),y=l.resolveComponent("el-switch"),b=l.resolveComponent("el-image"),w=l.resolveComponent("el-icon"),x=l.resolveComponent("el-upload"),v=l.resolveComponent("el-button"),S=l.resolveComponent("el-form");return l.openBlock(),l.createElementBlock("div",Jj,[l.createVNode(S,{ref_key:"form",ref:r,model:i,rules:o,"label-width":"90px","label-suffix":":"},{default:l.withCtx(()=>[l.createVNode(g,{label:"图片名称",prop:"imageName"},{default:l.withCtx(()=>[l.createVNode(p,{modelValue:i.imageName,"onUpdate:modelValue":f[0]||(f[0]=E=>i.imageName=E),placeholder:"请输入图片名称"},null,8,["modelValue"])]),_:1}),l.createVNode(g,{label:"排序",prop:"sort"},{default:l.withCtx(()=>[l.createVNode(m,{modelValue:i.sort,"onUpdate:modelValue":f[1]||(f[1]=E=>i.sort=E),min:0,max:999,step:1,"controls-position":"right"},null,8,["modelValue"])]),_:1}),l.createVNode(g,{label:"是否显示",prop:"isShow"},{default:l.withCtx(()=>[l.createVNode(y,{modelValue:i.isShow,"onUpdate:modelValue":f[2]||(f[2]=E=>i.isShow=E),"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},null,8,["modelValue"])]),_:1}),l.createVNode(g,{label:"上传",prop:"image"},{default:l.withCtx(()=>[l.createVNode(x,{action:"","list-type":"picture",class:"avatar-uploader","show-file-list":!1,"on-change":c,"auto-upload":!1},{default:l.withCtx(()=>[a.value?(l.openBlock(),l.createBlock(b,{key:0,src:a.value,fit:"cover",style:{width:"64px",height:"64px"}},null,8,["src"])):(l.openBlock(),l.createBlock(w,{key:1,class:"avatar-uploader-icon"},{default:l.withCtx(()=>[l.createVNode(l.unref(lA))]),_:1}))]),_:1})]),_:1}),l.createElementVNode("div",Xj,[l.createVNode(v,{type:"primary",onClick:u},{default:l.withCtx(()=>f[3]||(f[3]=[l.createTextVNode("保存")])),_:1}),l.createVNode(v,{onClick:d},{default:l.withCtx(()=>f[4]||(f[4]=[l.createTextVNode("取消")])),_:1})])]),_:1},8,["model"])])}}},[["__scopeId","data-v-c7d87a18"]]),Zj={class:"form-container"},Qj={style:{padding:"0 10px",display:"flex","flex-direction":"column",gap:"5px","align-items":"flex-start"}},e3=["src"],t3=En({__name:"image-management",setup(n){const e=l.reactive({items:[]}),t=()=>{Wi("/cny/custom/groupList").then(f=>{e.items=f.data})},s=l.reactive({show:!1,title:"新增图片分组",payload:null}),r=()=>{s.show=!0,s.title="新增图片分组",s.payload=null},i=f=>{s.show=!0,s.title="编辑图片分组",s.payload={id:f.id,groupName:f.groupName,sort:f.sort,isShow:f.isShow}},o=f=>{Dm("/cny/custom/removeGroup/"+f).then(p=>{p.code===200?(We.success("删除成功"),t()):We.error(p.msg||"删除失败")})},a=l.reactive({show:!1,title:"新增图片",payload:null}),c=f=>{a.show=!0,a.title="新增图片",a.payload={groupId:f}},u=f=>{a.show=!0,a.title="编辑图片",a.payload={id:f.id,groupId:f.groupId,imageName:f.imageName,sort:f.sort,isShow:f.isShow,imageUrl:f.imageUrl}},d=f=>{Dm("/cny/custom/removePicture/"+f).then(p=>{p.code===200?(We.success("删除成功"),t()):We.error(p.msg||"删除失败")})},h=f=>{s.show=!1,a.show=!1,f&&t()};return l.onMounted(()=>{t()}),(f,p)=>{const g=l.resolveComponent("el-button"),m=l.resolveComponent("el-table-column"),y=l.resolveComponent("el-table"),b=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",Zj,[l.createVNode(g,{type:"primary",onClick:r,size:"small"},{default:l.withCtx(()=>p[2]||(p[2]=[l.createTextVNode("新增图片分组")])),_:1}),l.createVNode(y,{data:e.items,border:"",height:"500"},{default:l.withCtx(()=>[l.createVNode(m,{type:"expand"},{default:l.withCtx(w=>[l.createElementVNode("div",Qj,[l.createVNode(g,{type:"primary",size:"small",onClick:x=>c(w.row.id)},{default:l.withCtx(()=>p[3]||(p[3]=[l.createTextVNode("新增图片")])),_:2},1032,["onClick"]),l.createVNode(y,{data:w.row.pictureList,border:"",size:"small"},{default:l.withCtx(()=>[l.createVNode(m,{label:"名称",prop:"imageName",align:"center"}),l.createVNode(m,{label:"图片",prop:"imageUrl",align:"center"},{default:l.withCtx(x=>[l.createElementVNode("img",{src:x.row.imageUrl,alt:"",style:{width:"64px",height:"64px"}},null,8,e3)]),_:1}),l.createVNode(m,{label:"排序",prop:"sort",align:"center"}),l.createVNode(m,{label:"是否显示",prop:"isShow",align:"center"},{default:l.withCtx(x=>[l.createTextVNode(l.toDisplayString(x.row.isShow===1?"是":"否"),1)]),_:1}),l.createVNode(m,{label:"操作",align:"center"},{default:l.withCtx(x=>[l.createVNode(g,{type:"primary",size:"small",onClick:v=>u(x.row)},{default:l.withCtx(()=>p[4]||(p[4]=[l.createTextVNode("编辑")])),_:2},1032,["onClick"]),l.createVNode(g,{type:"danger",size:"small",onClick:v=>d(x.row.id)},{default:l.withCtx(()=>p[5]||(p[5]=[l.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1})]),_:2},1032,["data"])])]),_:1}),l.createVNode(m,{label:"分组名称",prop:"groupName",align:"center"}),l.createVNode(m,{label:"排序",prop:"sort",align:"center"}),l.createVNode(m,{label:"是否显示",prop:"isShow",align:"center"},{default:l.withCtx(w=>[l.createTextVNode(l.toDisplayString(w.row.isShow===1?"是":"否"),1)]),_:1}),l.createVNode(m,{label:"操作",align:"center"},{default:l.withCtx(w=>[l.createVNode(g,{type:"primary",size:"small",onClick:x=>i(w.row)},{default:l.withCtx(()=>p[6]||(p[6]=[l.createTextVNode("编辑")])),_:2},1032,["onClick"]),l.createVNode(g,{type:"danger",size:"small",onClick:x=>o(w.row.id)},{default:l.withCtx(()=>p[7]||(p[7]=[l.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),l.createVNode(b,{modelValue:s.show,"onUpdate:modelValue":p[0]||(p[0]=w=>s.show=w),title:s.title,width:"300","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[s.show?(l.openBlock(),l.createBlock(qj,{key:0,payload:s.payload,onClose:h},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue","title"]),l.createVNode(b,{modelValue:a.show,"onUpdate:modelValue":p[1]||(p[1]=w=>a.show=w),title:a.title,width:"300","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[a.show?(l.openBlock(),l.createBlock(Kj,{key:0,payload:a.payload,onClose:h},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])])}}},[["__scopeId","data-v-75a537f2"]]),n3={class:"page-container"},s3={class:"tool-bar"},r3={class:"action"},i3={class:"el-dropdown-link"},o3={class:"action",style:{"margin-right":"50px"}},a3={class:"board"},l3={class:"drawing-board-box"},c3={id:"controls"},u3={key:0,class:"controls-label"},d3={style:{width:"100%",height:"100%",background:"black"}},r0=En(Object.assign({name:"editor"},{__name:"index",props:{id:{type:String,default:""}},emits:["getJson"],setup(n,{emit:e}){const t=n,s=l.ref(),r=l.reactive({label:"",component:l.shallowRef(null)}),i=l.ref(null),o=l.ref(null),a=()=>{const k=document.getElementById("drawing-board");s.value=new $({container:k,autoResize:!0,panning:!0,mousewheel:!0,connecting:{snap:!0,allowEdge:!0,highlight:!0,router:"orth",connectionPoint:{name:"anchor"},anchor:"center",createEdge(){return s.value.createEdge({inherit:"edge",...Wn,data:{type:Zb()},zIndex:0})}}}),s.value.use(dj()),s.value.use(hj()),s.value.use(fj()),s.value.use(pj()),s.value.use(mj()),s.value.use(yj()),s.value.bindKey(["delete","backspace"],()=>{bj(s.value)}),s.value.bindKey(["ctrl+c","cmd + c"],()=>{wj(s.value)}),s.value.bindKey(["ctrl+v","cmd + v"],()=>{xj(s.value)}),s.value.bindKey(["ctrl+z","cmd + z"],()=>{vj(s.value)}),s.value.bindKey(["ctrl+y","cmd + y"],()=>{Cj(s.value)});let R=null;s.value.on("edge:click",({cell:V})=>{o.value=V,r.component=t0,r.label="线段属性",i.value=pd()}),s.value.on("edge:mouseenter",({cell:V})=>{clearTimeout(R),V.toFront(),Sj(V)}),s.value.on("edge:mouseleave",({cell:V})=>{R=setTimeout(()=>{V.toBack(),V.removeTools()},300)}),s.value.on("node:mouseenter",()=>{qi("#drawing-board",!0)}),s.value.on("node:mouseleave",()=>{qi("#drawing-board",!1)}),s.value.use(new n0),s.value.on("blank:click",({e:V,x:A,y:P})=>{o.value=s,r.component=XD,r.label="画布属性",i.value=pd()}),s.value.on("cell:click",({cell:V})=>{var A,P;if(o.value=V,i.value=pd(),((A=V.data)==null?void 0:A.type)==="text"){r.component=e0,r.label="文本属性";return}if(((P=V.data)==null?void 0:P.type)==="base-shape"){r.component=e0,r.label="基础图形属性";return}if((V==null?void 0:V.shape)==="edge"){r.component=t0,r.label="连线属性";return}if((V==null?void 0:V.shape)==="image"){r.component=Gj,r.label="图片属性";return}r.component=null,r.label=null})},c=l.ref(),u=()=>{c.value=new li({target:s.value,...YD,groups:[{name:"基础组件",graphPadding:30}],search(V,A){var P;return((P=V.label)==null?void 0:P.indexOf(A))!==-1},placeholder:"搜索",notFoundText:"未找到匹配项",getDragNode:V=>{const A=V.clone({keepId:!0});return A.label!=="文本"&&(A.label=""),A}});const k=s.value.createNode({...WD}),R=bl.map(V=>(V.ports=s0,s.value.createNode(V)));c.value.load([k,...R],"基础组件"),Wi("/cny/custom/groupList").then(V=>{const A=(V==null?void 0:V.data)||[];A==null||A.forEach(P=>{c.value.addGroup({name:P==null?void 0:P.groupName,graphPadding:30});const j=P==null?void 0:P.pictureList.map(z=>{const Y={shape:"image",imageUrl:z==null?void 0:z.imageUrl,ports:s0,width:64,height:64,label:z.imageName};return s.value.createNode(Y)});c.value.load(j,P==null?void 0:P.groupName),document.getElementById("stencil").appendChild(c.value.container)})}).finally(()=>{setTimeout(()=>{c.value.container.querySelectorAll(".x6-node").forEach((A,P)=>{if(P>bl.length){const j=A.querySelector("text");A.style.position="relative",j&&(j.style.display="none",j.setAttribute("x","0%"),j.setAttribute("y","40"),j.style.fontSize="12px",j.style.fill="#ffffff")}A.addEventListener("mouseenter",j=>{if(P>bl.length){const z=A.querySelector("text");z&&(z.style.display="block")}}),A.addEventListener("mouseleave",j=>{if(P>bl.length){const z=A.querySelector("text");z&&(z.style.display="none")}})})},200)})},d=k=>{switch(k){case"snapLine":s.value.isSnaplineEnabled()?(s.value.disableSnapline(),We.warning("关闭对齐线")):(s.value.enableSnapline(),We.success("开启对齐线"));break;case"select":s.value.isSelectionEnabled()?(s.value.disableSelection(),We.warning("关闭框选")):(s.value.enableSelection(),We.success("开启框选"));break;case"drawLine":p();break;case"adaptive":g();break;case"shortcuts":y();break;case"image":w();break;case"clear":x();break;case"export":v();break}},h=l.ref(!1),f=l.ref(null),p=()=>{h.value=!0;const k=new Date;s.value.startBatch(k),s.value.disablePanning(),s.value.once("blank:mousedown",({e:R,x:V,y:A})=>{h.value&&(f.value=s.value.addEdge({source:{x:V,y:A},target:{x:V,y:A},...Wn,data:{type:Zb(),isConnector:!1},zIndex:0}))}),s.value.on("blank:mousemove",({e:R,x:V,y:A})=>{h.value&&f.value.setTarget({x:V,y:A})}),s.value.on("blank:mouseup",({e:R,x:V,y:A})=>{h.value=!1,s.value.enablePanning(),s.value.stopBatch(k)})},g=()=>{s.value.zoomToFit({maxScale:1,padding:20})},m=l.reactive({show:!1}),y=()=>{m.show=!0},b=l.reactive({show:!1}),w=()=>{b.show=!0},x=()=>{s.value.clearCells(),s.value.drawBackground(Vm),s.value.drawGrid(Bm),We.success("清空成功")},v=()=>{const k=W().format("YYYYMMDDHHmmss");s.value.exportPNG(k,{padding:10,quality:1,backgroundColor:s.value.options.background.color})},S=e,E=l.reactive({show:!1,background:null,grid:null,data:null}),C=()=>{E.background=s.value.options.background,E.grid=s.value.options.grid,E.data=s.value.toJSON(),E.show=!0},M=()=>{S("getJson",{background:s.value.options.background,grid:s.value.options.grid,data:s.value.toJSON()})},N=async()=>{if(!t.id){s.value.drawBackground(Vm),s.value.drawGrid(Bm),s.value.fromJSON({cells:[]});return}const{background:k,grid:R,data:V}=await Im(t.id);s.value.drawBackground(k),s.value.drawGrid(R),s.value.fromJSON(V),g()},_=l.shallowRef(null),T=()=>{new ResizeObserver(()=>{g()}).observe(_.value)};return l.onMounted(()=>{a(),u(),N(),T()}),(k,R)=>{const V=l.resolveComponent("el-icon"),A=l.resolveComponent("el-button"),P=l.resolveComponent("el-dropdown-item"),j=l.resolveComponent("el-dropdown-menu"),z=l.resolveComponent("el-dropdown"),Y=l.resolveComponent("el-scrollbar"),le=l.resolveComponent("el-dialog"),I=l.resolveComponent("el-drawer");return l.openBlock(),l.createElementBlock("div",n3,[l.createElementVNode("div",s3,[l.createElementVNode("div",r3,[l.createVNode(z,{onCommand:d},{dropdown:l.withCtx(()=>[l.createVNode(j,null,{default:l.withCtx(()=>[l.createVNode(P,{command:"snapLine"},{default:l.withCtx(()=>R[4]||(R[4]=[l.createTextVNode("对齐线")])),_:1}),l.createVNode(P,{command:"select"},{default:l.withCtx(()=>R[5]||(R[5]=[l.createTextVNode("框选")])),_:1}),l.createVNode(P,{command:"drawLine"},{default:l.withCtx(()=>R[6]||(R[6]=[l.createTextVNode("绘制直线")])),_:1}),l.createVNode(P,{command:"adaptive"},{default:l.withCtx(()=>R[7]||(R[7]=[l.createTextVNode("视图自适应")])),_:1}),l.createVNode(P,{command:"shortcuts"},{default:l.withCtx(()=>R[8]||(R[8]=[l.createTextVNode("查看快捷键")])),_:1}),l.createVNode(P,{command:"image"},{default:l.withCtx(()=>R[9]||(R[9]=[l.createTextVNode("图片管理")])),_:1}),l.createVNode(P,{command:"clear"},{default:l.withCtx(()=>R[10]||(R[10]=[l.createTextVNode("清空画布")])),_:1}),l.createVNode(P,{command:"export"},{default:l.withCtx(()=>R[11]||(R[11]=[l.createTextVNode("导出成图片")])),_:1})]),_:1})]),default:l.withCtx(()=>[l.createElementVNode("span",i3,[l.createVNode(A,{size:"small",text:""},{default:l.withCtx(()=>[R[3]||(R[3]=l.createTextVNode("工具 ")),l.createVNode(V,null,{default:l.withCtx(()=>[l.createVNode(l.unref(WP))]),_:1})]),_:1})])]),_:1})]),l.createElementVNode("div",o3,[l.createVNode(l.unref(Bg),{content:"预览",placement:"bottom"},{default:l.withCtx(()=>[l.createVNode(A,{size:"small",icon:l.unref(Mp),onClick:C},null,8,["icon"])]),_:1}),l.createVNode(l.unref(Bg),{content:"保存",placement:"bottom"},{default:l.withCtx(()=>[l.createVNode(A,{size:"small",icon:l.unref(nA),onClick:M},null,8,["icon"])]),_:1})])]),l.createElementVNode("div",a3,[R[12]||(R[12]=l.createElementVNode("div",{id:"stencil"},null,-1)),l.createElementVNode("div",l3,[l.createElementVNode("div",{id:"drawing-board",ref_key:"drawBoard",ref:_},null,512)]),l.createElementVNode("div",c3,[r.label?(l.openBlock(),l.createElementBlock("div",u3,l.toDisplayString(r.label),1)):l.createCommentVNode("",!0),l.createVNode(Y,null,{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.component),{graph:s.value,payload:o.value,key:i.value},null,8,["graph","payload"]))]),_:1})])]),l.createVNode(le,{modelValue:m.show,"onUpdate:modelValue":R[0]||(R[0]=B=>m.show=B),width:"400px",title:"快捷键","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[l.createVNode(Vj)]),_:1},8,["modelValue"]),l.createVNode(le,{modelValue:b.show,"onUpdate:modelValue":R[1]||(R[1]=B=>b.show=B),width:"800px",title:"图片管理","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[l.createVNode(t3)]),_:1},8,["modelValue"]),l.createVNode(I,{class:"no-border-drawer",modelValue:E.show,"onUpdate:modelValue":R[2]||(R[2]=B=>E.show=B),title:"预览",direction:"ttb",size:"100%"},{default:l.withCtx(()=>[l.createElementVNode("div",d3,[E.show?(l.openBlock(),l.createBlock(gd,{key:0,background:E.background,grid:E.grid,data:E.data},null,8,["background","grid","data"])):l.createCommentVNode("",!0)])]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-db92edb3"]]),h3=[r0,gd],i0=(n,e)=>{h3.forEach(t=>{n.component(t.name,t)})};typeof window<"u"&&window.Vue&&i0(window.Vue);const f3={install:i0};Re.WiringDiagramEditor=r0,Re.WiringDiagramPreview=gd,Re.default=f3,Re.setBaseURL=FD,Re.setToken=UD,Object.defineProperties(Re,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
738
|
+
`;var Fj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class li extends ye{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}constructor(e={}){super(),this.name="stencil",zr(this.name,zj),this.graphs={},this.groups={},this.options=Object.assign(Object.assign({},li.defaultOptions),e),this.init()}init(){this.dnd=new ks(this.options),this.onSearch=op(this.onSearch,200),this.initContainer(),this.initSearch(),this.initContent(),this.initGroups(),this.setTitle(),this.startListening()}load(e,t){return Array.isArray(e)?this.loadGroup(e,t):this.options.groups&&Object.keys(this.options.groups).forEach(s=>{e[s]&&this.loadGroup(e[s],s)}),this}unload(e,t){return Array.isArray(e)?this.loadGroup(e,t,!0):this.options.groups&&Object.keys(this.options.groups).forEach(s=>{e[s]&&this.loadGroup(e[s],s,!0)}),this}toggleGroup(e){return this.isGroupCollapsed(e)?this.expandGroup(e):this.collapseGroup(e),this}collapseGroup(e){if(this.isGroupCollapsable(e)){const t=this.groups[e];t&&!this.isGroupCollapsed(e)&&(this.trigger("group:collapse",{name:e}),K(t,"collapsed"))}return this}expandGroup(e){if(this.isGroupCollapsable(e)){const t=this.groups[e];t&&this.isGroupCollapsed(e)&&(this.trigger("group:expand",{name:e}),De(t,"collapsed"))}return this}isGroupCollapsable(e){const t=this.groups[e];return On(t,"collapsable")}isGroupCollapsed(e){const t=this.groups[e];return t&&On(t,"collapsed")}collapseGroups(){return Object.keys(this.groups).forEach(e=>this.collapseGroup(e)),this}expandGroups(){return Object.keys(this.groups).forEach(e=>this.expandGroup(e)),this}resizeGroup(e,t){const s=this.graphs[e];return s&&s.resize(t.width,t.height),this}addGroup(e){const t=Array.isArray(e)?e:[e];this.options.groups?this.options.groups.push(...t):this.options.groups=t,t.forEach(s=>this.initGroup(s))}removeGroup(e){const t=Array.isArray(e)?e:[e];this.options.groups&&(this.options.groups=this.options.groups.filter(s=>!t.includes(s.name)),t.forEach(s=>{const r=this.graphs[s];this.unregisterGraphEvents(r),r.dispose(),delete this.graphs[s];const i=this.groups[s];Ft(i),delete this.groups[s]}))}initContainer(){this.container=document.createElement("div"),K(this.container,this.prefixClassName(Ot.base)),fe(this.container,"data-not-found-text",this.options.notFoundText||"No matches found")}initContent(){this.content=document.createElement("div"),K(this.content,this.prefixClassName(Ot.content)),ws(this.content,this.container)}initSearch(){this.options.search&&(K(this.container,"searchable"),_t(this.container,this.renderSearch()))}initGroup(e){const t=this.options.stencilGraphOptions||{},s=document.createElement("div");K(s,this.prefixClassName(Ot.group)),fe(s,"data-name",e.name),(e.collapsable==null&&this.options.collapsable||e.collapsable!==!1)&&K(s,"collapsable"),un(s,"collapsed",e.collapsed===!0);const r=document.createElement("h3");K(r,this.prefixClassName(Ot.groupTitle)),r.innerHTML=e.title||e.name;const i=document.createElement("div");K(i,this.prefixClassName(Ot.groupContent));const o=e.graphOptions,a=new $(Object.assign(Object.assign(Object.assign({},t),o),{container:document.createElement("div"),model:t.model||new Qe,width:e.graphWidth||this.options.stencilGraphWidth,height:e.graphHeight||this.options.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));this.registerGraphEvents(a),_t(i,a.container),_t(s,[r,i]),ws(s,this.content),this.groups[e.name]=s,this.graphs[e.name]=a}initGroups(){if(this.clearGroups(),this.setCollapsableState(),this.options.groups&&this.options.groups.length)this.options.groups.forEach(e=>{this.initGroup(e)});else{const e=this.options.stencilGraphOptions||{},t=new $(Object.assign(Object.assign({},e),{container:document.createElement("div"),model:e.model||new Qe,width:this.options.stencilGraphWidth,height:this.options.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));_t(this.content,t.container),this.graphs[yo.defaultGroupName]=t}}setCollapsableState(){this.options.collapsable=this.options.collapsable&&this.options.groups&&this.options.groups.some(e=>e.collapsable!==!1),this.options.collapsable?(K(this.container,"collapsable"),this.options.groups&&this.options.groups.every(t=>t.collapsed||t.collapsable===!1)?K(this.container,"collapsed"):De(this.container,"collapsed")):De(this.container,"collapsable")}setTitle(){const e=document.createElement("div");K(e,this.prefixClassName(Ot.title)),e.innerHTML=this.options.title,ws(e,this.container)}renderSearch(){const e=document.createElement("div");K(e,this.prefixClassName(Ot.search));const t=document.createElement("input");return fe(t,{type:"search",placeholder:this.options.placeholder||"Search"}),K(t,this.prefixClassName(Ot.searchText)),_t(e,t),e}startListening(){const e=this.prefixClassName(Ot.title),t=this.prefixClassName(Ot.searchText),s=this.prefixClassName(Ot.groupTitle);this.delegateEvents({[`click .${e}`]:"onTitleClick",[`touchstart .${e}`]:"onTitleClick",[`click .${s}`]:"onGroupTitleClick",[`touchstart .${s}`]:"onGroupTitleClick",[`input .${t}`]:"onSearch",[`focusin .${t}`]:"onSearchFocusIn",[`focusout .${t}`]:"onSearchFocusOut"})}stopListening(){this.undelegateEvents()}registerGraphEvents(e){e.on("cell:mousedown",this.onDragStart,this)}unregisterGraphEvents(e){e.off("cell:mousedown",this.onDragStart,this)}loadGroup(e,t,s){const r=this.getModel(t);if(r){const c=e.map(u=>Ue.isNode(u)?u:Ue.create(u));s===!0?r.removeCells(c):r.resetCells(c)}const i=this.getGroup(t);let o=this.options.stencilGraphHeight;i&&i.graphHeight!=null&&(o=i.graphHeight);const a=i&&i.layout||this.options.layout;if(a&&r&&Q(a,this,r,i),!o){const c=this.getGraph(t);c.fitToContent({minWidth:c.options.width,gridHeight:1,padding:i&&i.graphPadding||this.options.stencilGraphPadding||10})}return this}onDragStart(e){const{e:t,node:s}=e,r=this.getGroupByNode(s);r&&r.nodeMovable===!1||this.dnd.start(s,t)}filter(e,t){const s=Object.keys(this.graphs).reduce((r,i)=>{const o=this.graphs[i],a=i===yo.defaultGroupName?null:i,c=o.model.getNodes().filter(f=>{let p=!1;typeof t=="function"?p=Q(t,this,f,e,a,this):typeof t=="boolean"?p=t:p=this.isCellMatched(f,e,t,e.toLowerCase()!==e);const g=o.renderer.findViewByCell(f);return g&&un(g.container,"unmatched",!p),p}),u=c.length>0,d=this.options,h=new Qe;return h.resetCells(c),d.layout&&Q(d.layout,this,h,this.getGroup(i)),this.groups[i]&&un(this.groups[i],"unmatched",!u),o.fitToContent({gridWidth:1,gridHeight:1,padding:d.stencilGraphPadding||10}),r||u},!1);un(this.container,"not-found",!s)}isCellMatched(e,t,s,r){return t&&s?Object.keys(s).some(i=>{if(i==="*"||e.shape===i){const o=s[i];return typeof o=="boolean"?o:(Array.isArray(o)?o:[o]).some(c=>{let u=e.getPropByPath(c);return u!=null?(u=`${u}`,r||(u=u.toLowerCase()),u.indexOf(t)>=0):!1})}return!1}):!0}onSearch(e){this.filter(e.target.value,this.options.search)}onSearchFocusIn(){K(this.container,"is-focused")}onSearchFocusOut(){De(this.container,"is-focused")}onTitleClick(){this.options.collapsable&&(un(this.container,"collapsed"),On(this.container,"collapsed")?this.collapseGroups():this.expandGroups())}onGroupTitleClick(e){const t=e.target.closest(`.${this.prefixClassName(Ot.group)}`);t&&this.toggleGroup(fe(t,"data-name")||"");const s=Object.keys(this.groups).every(r=>{const i=this.getGroup(r),o=this.groups[r];return i&&i.collapsable===!1||On(o,"collapsed")});un(this.container,"collapsed",s)}getModel(e){const t=this.getGraph(e);return t?t.model:null}getGraph(e){return this.graphs[e||yo.defaultGroupName]}getGroup(e){const t=this.options.groups;return e!=null&&t&&t.length?t.find(s=>s.name===e):null}getGroupByNode(e){const t=this.options.groups;return t?t.find(s=>{const r=this.getModel(s.name);return r?r.has(e.id):!1}):null}clearGroups(){Object.keys(this.graphs).forEach(e=>{const t=this.graphs[e];this.unregisterGraphEvents(t),t.dispose()}),Object.keys(this.groups).forEach(e=>{const t=this.groups[e];Ft(t)}),this.graphs={},this.groups={}}onRemove(){this.clearGroups(),this.dnd.remove(),this.stopListening(),this.undelegateDocumentEvents()}dispose(){this.remove(),Fr(this.name)}}Fj([ye.dispose()],li.prototype,"dispose",null),function(n){n.defaultOptions=Object.assign({stencilGraphWidth:200,stencilGraphHeight:800,title:"Stencil",collapsable:!1,placeholder:"Search",notFoundText:"No matches found",layout(e,t){const s={columnWidth:this.options.stencilGraphWidth/2-10,columns:2,rowHeight:80,resizeToFit:!1,dx:10,dy:10};$j(e,Object.assign(Object.assign(Object.assign({},s),this.options.layoutOptions),t?t.layoutOptions:{}))}},ks.defaults)}(li||(li={}));var Ot;(function(n){n.base="widget-stencil",n.title=`${n.base}-title`,n.search=`${n.base}-search`,n.searchText=`${n.search}-text`,n.content=`${n.base}-content`,n.group=`${n.base}-group`,n.groupTitle=`${n.group}-title`,n.groupContent=`${n.group}-content`})(Ot||(Ot={}));var yo;(function(n){n.defaultGroupName="__default__"})(yo||(yo={})),$.prototype.toSVG=function(n,e){const t=this.getPlugin("export");t&&t.toSVG(n,e)},$.prototype.toPNG=function(n,e){const t=this.getPlugin("export");t&&t.toPNG(n,e)},$.prototype.toJPEG=function(n,e){const t=this.getPlugin("export");t&&t.toJPEG(n,e)},$.prototype.exportPNG=function(n,e){const t=this.getPlugin("export");t&&t.exportPNG(n,e)},$.prototype.exportJPEG=function(n,e){const t=this.getPlugin("export");t&&t.exportJPEG(n,e)},$.prototype.exportSVG=function(n,e){const t=this.getPlugin("export");t&&t.exportSVG(n,e)};var Uj=function(n,e,t,s){var r=arguments.length,i=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,s);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(i=(r<3?o(i):r>3?o(e,t,i):o(e,t))||i);return r>3&&i&&Object.defineProperty(e,t,i),i};class n0 extends Te{constructor(){super(),this.name="export"}get view(){return this.graph.view}init(e){this.graph=e}exportPNG(e="chart",t={}){this.toPNG(s=>{Js.downloadDataUri(s,e)},t)}exportJPEG(e="chart",t={}){this.toPNG(s=>{Js.downloadDataUri(s,e)},t)}exportSVG(e="chart",t={}){this.toSVG(s=>{Js.downloadDataUri(Js.svgToDataUrl(s),e)},t)}toSVG(e,t={}){this.notify("before:export",t);const s=this.view.svg,r=se.create(s).clone();let i=r.node;const o=r.findOne(`.${this.view.prefixClassName("graph-svg-stage")}`),a=t.viewBox||this.graph.graphToLocal(this.graph.getContentBBox()),c=t.preserveDimensions;if(c){const h=typeof c=="boolean"?a:c;r.attr({width:h.width,height:h.height})}if(r.removeAttribute("style").attr("viewBox",[a.x,a.y,a.width,a.height].join(" ")),o.removeAttribute("transform"),t.copyStyles!==!1){const h=s.ownerDocument,f=Array.from(s.querySelectorAll("*")),p=Array.from(i.querySelectorAll("*")),g=h.styleSheets.length,m=[];for(let w=g-1;w>=0;w-=1)m[w]=h.styleSheets[w],h.styleSheets[w].disabled=!0;const y={};f.forEach((w,x)=>{const v=window.getComputedStyle(w,null),S={};Object.keys(v).forEach(E=>{S[E]=v.getPropertyValue(E)}),y[x]=S}),g!==h.styleSheets.length&&m.forEach((w,x)=>{h.styleSheets[x]=w});for(let w=0;w<g;w+=1)h.styleSheets[w].disabled=!1;const b={};f.forEach((w,x)=>{const v=window.getComputedStyle(w,null),S=y[x],E={};Object.keys(v).forEach(C=>{!Mc(C)&&v.getPropertyValue(C)!==S[C]&&(E[C]=v.getPropertyValue(C))}),b[x]=E}),p.forEach((w,x)=>{Je(w,b[x])})}const u=t.stylesheet;if(typeof u=="string"){const h=s.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(u);r.prepend(se.create("style",{type:"text/css"},[h]))}const d=()=>{const h=t.beforeSerialize;if(typeof h=="function"){const p=Q(h,this.graph,i);p instanceof SVGSVGElement&&(i=p)}const f=new XMLSerializer().serializeToString(i).replace(/ /g," ");this.notify("after:export",t),e(f)};if(t.serializeImages){const h=r.find("image").map(f=>new Promise(p=>{const g=f.attr("xlink:href")||f.attr("href");Js.imageToDataUri(g,(m,y)=>{!m&&y&&f.attr("xlink:href",y),p()})}));Promise.all(h).then(d)}else d()}toDataURL(e,t){let s=t.viewBox||this.graph.getContentBBox();const r=ms(t.padding);t.width&&t.height&&(r.left+r.right>=t.width&&(r.left=r.right=0),r.top+r.bottom>=t.height&&(r.top=r.bottom=0));const i=new U(-r.left,-r.top,r.left+r.right,r.top+r.bottom);if(t.width&&t.height){const d=s.width+r.left+r.right,h=s.height+r.top+r.bottom;i.scale(d/t.width,h/t.height)}s=U.create(s).moveAndExpand(i);const o=typeof t.width=="number"&&typeof t.height=="number"?{width:t.width,height:t.height}:s;let a=t.ratio?parseFloat(t.ratio):1;(!Number.isFinite(a)||a===0)&&(a=1);const c={width:Math.max(Math.round(o.width*a),1),height:Math.max(Math.round(o.height*a),1)};{const d=document.createElement("canvas"),h=d.getContext("2d");d.width=c.width,d.height=c.height;const f=c.width-1,p=c.height-1;h.fillStyle="rgb(1,1,1)",h.fillRect(f,p,1,1);const g=h.getImageData(f,p,1,1).data;if(g[0]!==1||g[1]!==1||g[2]!==1)throw new Error("size exceeded")}const u=new Image;u.onload=()=>{const d=document.createElement("canvas");d.width=c.width,d.height=c.height;const h=d.getContext("2d");h.fillStyle=t.backgroundColor||"white",h.fillRect(0,0,c.width,c.height);try{h.drawImage(u,0,0,c.width,c.height);const f=d.toDataURL(t.type,t.quality);e(f)}catch{}},this.toSVG(d=>{u.src=`data:image/svg+xml,${encodeURIComponent(d)}`},Object.assign(Object.assign({},t),{viewBox:s,serializeImages:!0,preserveDimensions:Object.assign({},c)}))}toPNG(e,t={}){this.toDataURL(e,Object.assign(Object.assign({},t),{type:"image/png"}))}toJPEG(e,t={}){this.toDataURL(e,Object.assign(Object.assign({},t),{type:"image/jpeg"}))}notify(e,t){this.trigger(e,t),this.graph.trigger(e,t)}dispose(){this.off()}}Uj([Te.dispose()],n0.prototype,"dispose",null);const Hj={class:"control-box"},Gj=En({__name:"index",props:{payload:Object},setup(n){const e=n,t=l.ref("3"),s=l.ref([]),r=()=>{s.value=JSON.parse(JSON.stringify(e.payload.getPorts().map(u=>({id:u.id,attrs:u.attrs,args:{x:Number(u.args.x.replace("%","")),y:Number(u.args.y.replace("%",""))}}))))},i=()=>{const u=Cu;u.attrs.text.text=`${e.payload.getPorts().length+1}`,u.args.x="50%",u.args.y="50%",e.payload.addPorts([{group:"ports",...u}]),r()},o=()=>{qi("#drawing-board",!0)},a=(u,d,h)=>{e.payload.portProp(u,"args/"+d,h+"%"),r()},c=u=>{e.payload.removePort(u),r()};return l.onMounted(()=>{r()}),(u,d)=>{const h=l.resolveComponent("el-button"),f=l.resolveComponent("el-table-column"),p=l.resolveComponent("el-slider"),g=l.resolveComponent("el-icon"),m=l.resolveComponent("el-table"),y=l.resolveComponent("el-collapse-item"),b=l.resolveComponent("el-collapse");return l.openBlock(),l.createElementBlock("div",Hj,[l.createVNode(b,{modelValue:t.value,"onUpdate:modelValue":d[0]||(d[0]=w=>t.value=w),accordion:""},{default:l.withCtx(()=>[l.createVNode(y,{title:"连接桩设置",name:"3"},{default:l.withCtx(()=>[l.createVNode(h,{type:"primary",onClick:i,size:"small"},{default:l.withCtx(()=>d[1]||(d[1]=[l.createTextVNode("添加连接桩")])),_:1}),l.createVNode(h,{type:"primary",onClick:o,size:"small"},{default:l.withCtx(()=>d[2]||(d[2]=[l.createTextVNode("显示连接桩")])),_:1}),l.createVNode(m,{data:s.value,border:"",size:"small",style:{"margin-top":"10px"}},{default:l.withCtx(()=>[l.createVNode(f,{label:"ID",width:"50",align:"center"},{default:l.withCtx(({row:w})=>[l.createTextVNode(l.toDisplayString(w.attrs.text.text),1)]),_:1}),l.createVNode(f,{label:"x",width:"100",align:"center"},{default:l.withCtx(({row:w})=>[l.createVNode(p,{modelValue:w.args.x,"onUpdate:modelValue":x=>w.args.x=x,min:0,max:100,step:1,onInput:x=>a(w.id,"x",x)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(f,{label:"y",width:"100",align:"center"},{default:l.withCtx(({row:w})=>[l.createVNode(p,{modelValue:w.args.y,"onUpdate:modelValue":x=>w.args.y=x,min:0,max:100,step:1,onInput:x=>a(w.id,"y",x)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1}),l.createVNode(f,{label:"操作",width:"70",align:"center"},{default:l.withCtx(({row:w})=>[l.createVNode(h,{type:"danger",size:"small",onClick:x=>c(w.id)},{default:l.withCtx(()=>[l.createVNode(g,null,{default:l.withCtx(()=>[l.createVNode(l.unref(Sp))]),_:1})]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-b280098c"]]),bl=[{shape:"rect",width:60,height:5,attrs:{body:{fill:"#ffffff",stroke:"#ffffff",strokeWidth:0}},data:{type:"base-shape"}},{shape:"rect",width:60,height:20,attrs:{body:{fill:"#ffffff",stroke:"#ffffff",strokeWidth:1}},data:{type:"base-shape",label:"母线"}},{shape:"circle",width:40,height:40,attrs:{body:{fill:"#ffffff",stroke:"#ffffff",strokeWidth:1}},data:{type:"base-shape"}},{shape:"ellipse",width:60,height:40,attrs:{body:{fill:"#ffffff",stroke:"#ffffff"}},data:{type:"base-shape"}}],s0={groups:{ports:{position:"absolute",args:{x:0,y:0},attrs:{circle:{magnet:!0,stroke:"#8f8f8f",r:4}},label:{position:"top"}}}},gd=Object.assign({name:"wiring-diagram-preview"},{__name:"index",props:{id:{type:String,default:""},background:{type:Object,default:()=>({})},grid:{type:Object,default:()=>({})},data:{type:Object,default:()=>({})}},setup(n){const e=n,t=l.ref(),s=()=>{const y=document.getElementById("preview-container");t.value=new $({container:y,autoResize:!0,panning:!0,mousewheel:!0,connecting:{router:"orth",connectionPoint:{name:"anchor"},anchor:"center"},interacting:{nodeMovable:!1,magnetConnectable:!1,edgeMovable:!1,edgeLabelMovable:!1,arrowheadMovable:!1,vertexMovable:!1,vertexAddable:!1,vertexDeletable:!1}}),t.value.on("blank:dblclick",()=>{d()})},r=async()=>{let y,b,w;if(e.id){const{background:x,grid:v,data:S}=await Im(e.id);y=x,b=v,w=S}else y=e.background,b={},w=e.data;t.value.drawBackground(y),t.value.drawGrid(b),t.value.fromJSON(w),c()},i=l.ref(null),o=l.ref([]),a=l.ref([]),c=()=>{o.value=t.value.getCells().filter(y=>{var b,w;return((b=y==null?void 0:y.data)==null?void 0:b.type)==="text"||((w=y==null?void 0:y.data)==null?void 0:w.type)==="pipe"}),o.value.forEach(y=>{var b,w;(w=(b=y==null?void 0:y.data)==null?void 0:b.fields)!=null&&w.length&&y.data.fields.forEach(x=>{x.field&&a.value.push({id:y==null?void 0:y.id,fields:y==null?void 0:y.data.fields})})}),console.log("所有字段",a.value),d()},u=l.ref(!0),d=async()=>{if(!a.value.length)return;if(!u.value){We.warning("数据正在更新中,请稍后再试");return}i.value&&clearInterval(i.value),u.value=!1;let y=await GD(a.value).catch(()=>{u.value=!0});u.value=!0,y==null||y.forEach(b=>{var x,v;const w=t.value.getCellById(b.id);w.data.type==="text"&&(w.label=h(w.data.content,b.fields)),w.data.type==="pipe"&&(console.log("管道详情",w,(x=b.fields)==null?void 0:x[0].value),f(w,(v=b.fields)==null?void 0:v[0].value))}),i.value=setTimeout(()=>{d()},1e4)},h=(y,b)=>{let w=0;return y.replace(yl,(x,v)=>{const S=b.find(E=>E.index===w);return w++,S?S.value:Qb})},f=(y,b)=>{if(!y.data.isCondition)return!1;for(let w=0;w<y.data.condition.length;w++)if(b>y.data.condition[w].min&&b<=y.data.condition[w].max)return y.attr("line2/style/animation",fd(y.data.condition[w].direction)),!1},p=()=>{t.value.zoomToFit({maxScale:1.4,padding:20})},g=l.shallowRef(),m=()=>{new ResizeObserver(()=>{p()}).observe(g.value)};return l.onMounted(()=>{s(),r(),setTimeout(()=>{qi("#preview-container",!1),p()},100),m()}),l.onUnmounted(()=>{clearInterval(i.value)}),(y,b)=>(l.openBlock(),l.createElementBlock("div",{id:"preview-container",ref_key:"previewRef",ref:g,onDblclick:p},null,544))}}),Yj={class:"form-container"},Wj={class:"footer"},qj=En({__name:"group-form",props:{payload:{type:Object,default:()=>({})}},emits:["close"],setup(n,{emit:e}){const t=n,s=e,r=l.reactive({groupName:"",sort:1,isShow:1}),i=l.reactive({groupName:[{required:!0,message:"请输入分组名称",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],sort:[{required:!0,message:"请输入排序",trigger:"blur"},{type:"number",message:"排序必须为数字值"}],isShow:[{required:!0,message:"请选择是否显示",trigger:"change"}]}),o=l.ref(),a=()=>{console.log(r),o.value.validate(u=>{if(u)r.id?za("/cny/custom/updateGroup",r).then(d=>{d!=null&&d.isOk?(We.success("保存成功"),s("close",!0)):We.error((d==null?void 0:d.msg)||"保存失败")}):za("/cny/custom/saveGroup",r).then(d=>{d!=null&&d.isOk?(We.success("保存成功"),s("close",!0)):We.error((d==null?void 0:d.msg)||"保存失败")});else return!1})},c=()=>{s("close",!1)};return l.onMounted(()=>{var u;(u=t.payload)!=null&&u.id&&(r.id=t.payload.id,r.groupName=t.payload.groupName,r.sort=t.payload.sort,r.isShow=t.payload.isShow)}),(u,d)=>{const h=l.resolveComponent("el-input"),f=l.resolveComponent("el-form-item"),p=l.resolveComponent("el-input-number"),g=l.resolveComponent("el-switch"),m=l.resolveComponent("el-button"),y=l.resolveComponent("el-form");return l.openBlock(),l.createElementBlock("div",Yj,[l.createVNode(y,{ref_key:"form",ref:o,model:r,rules:i,"label-width":"90px","label-suffix":":"},{default:l.withCtx(()=>[l.createVNode(f,{label:"分组名称",prop:"groupName"},{default:l.withCtx(()=>[l.createVNode(h,{modelValue:r.groupName,"onUpdate:modelValue":d[0]||(d[0]=b=>r.groupName=b),placeholder:"请输入分组名称",clearable:""},null,8,["modelValue"])]),_:1}),l.createVNode(f,{label:"排序",prop:"sort"},{default:l.withCtx(()=>[l.createVNode(p,{modelValue:r.sort,"onUpdate:modelValue":d[1]||(d[1]=b=>r.sort=b),min:0,max:999,step:1,"controls-position":"right"},null,8,["modelValue"])]),_:1}),l.createVNode(f,{label:"是否显示",prop:"isShow"},{default:l.withCtx(()=>[l.createVNode(g,{modelValue:r.isShow,"onUpdate:modelValue":d[2]||(d[2]=b=>r.isShow=b),"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},null,8,["modelValue"])]),_:1}),l.createElementVNode("div",Wj,[l.createVNode(m,{type:"primary",onClick:a},{default:l.withCtx(()=>d[3]||(d[3]=[l.createTextVNode("保存")])),_:1}),l.createVNode(m,{onClick:c},{default:l.withCtx(()=>d[4]||(d[4]=[l.createTextVNode("取消")])),_:1})])]),_:1},8,["model","rules"])])}}},[["__scopeId","data-v-a2a7ce25"]]),Jj={class:"form-container"},Xj={class:"footer"},Kj=En({__name:"image-form",props:{payload:{type:Object,default:()=>({})}},emits:["close"],setup(n,{emit:e}){const t=e,s=n,r=l.shallowRef(null),i=l.reactive({groupId:"",id:"",imageName:"",sort:0,isShow:1,imageUrl:""}),o={imageName:[{required:!0,message:"请输入图片名称",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],sort:[{required:!0,message:"请输入排序",trigger:"blur"},{type:"number",message:"排序必须为数字值"}]},a=l.ref(""),c=h=>{if(h.raw.type.indexOf("image")===-1){We.error("请上传图片格式的文件");return}const f=new FormData;f.append("file",h.raw),HD("/cny/file/fileUpload",f).then(p=>{p!=null&&p.isOk?(a.value=gs.defaults.baseURL+"/cny/upload/"+(p==null?void 0:p.data),i.imageUrl=p==null?void 0:p.data):We.error((p==null?void 0:p.msg)||"上传失败")})},u=()=>{console.log(i),r.value.validate(h=>{if(h)za("/cny/custom/savePicture",i).then(f=>{f!=null&&f.isOk?(We.success("保存成功"),t("close",!0)):We.error((f==null?void 0:f.msg)||"保存失败")});else return!1})},d=()=>{t("close",!1)};return l.onMounted(()=>{var h;(h=s.payload)!=null&&h.id&&(i.id=s.payload.id,i.imageName=s.payload.imageName,i.sort=s.payload.sort,i.isShow=s.payload.isShow,i.imageUrl=s.payload.imageUrl,a.value=i.imageUrl),i.groupId=s.payload.groupId}),(h,f)=>{const p=l.resolveComponent("el-input"),g=l.resolveComponent("el-form-item"),m=l.resolveComponent("el-input-number"),y=l.resolveComponent("el-switch"),b=l.resolveComponent("el-image"),w=l.resolveComponent("el-icon"),x=l.resolveComponent("el-upload"),v=l.resolveComponent("el-button"),S=l.resolveComponent("el-form");return l.openBlock(),l.createElementBlock("div",Jj,[l.createVNode(S,{ref_key:"form",ref:r,model:i,rules:o,"label-width":"90px","label-suffix":":"},{default:l.withCtx(()=>[l.createVNode(g,{label:"图片名称",prop:"imageName"},{default:l.withCtx(()=>[l.createVNode(p,{modelValue:i.imageName,"onUpdate:modelValue":f[0]||(f[0]=E=>i.imageName=E),placeholder:"请输入图片名称"},null,8,["modelValue"])]),_:1}),l.createVNode(g,{label:"排序",prop:"sort"},{default:l.withCtx(()=>[l.createVNode(m,{modelValue:i.sort,"onUpdate:modelValue":f[1]||(f[1]=E=>i.sort=E),min:0,max:999,step:1,"controls-position":"right"},null,8,["modelValue"])]),_:1}),l.createVNode(g,{label:"是否显示",prop:"isShow"},{default:l.withCtx(()=>[l.createVNode(y,{modelValue:i.isShow,"onUpdate:modelValue":f[2]||(f[2]=E=>i.isShow=E),"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},null,8,["modelValue"])]),_:1}),l.createVNode(g,{label:"上传",prop:"image"},{default:l.withCtx(()=>[l.createVNode(x,{action:"","list-type":"picture",class:"avatar-uploader","show-file-list":!1,"on-change":c,"auto-upload":!1},{default:l.withCtx(()=>[a.value?(l.openBlock(),l.createBlock(b,{key:0,src:a.value,fit:"cover",style:{width:"64px",height:"64px"}},null,8,["src"])):(l.openBlock(),l.createBlock(w,{key:1,class:"avatar-uploader-icon"},{default:l.withCtx(()=>[l.createVNode(l.unref(lA))]),_:1}))]),_:1})]),_:1}),l.createElementVNode("div",Xj,[l.createVNode(v,{type:"primary",onClick:u},{default:l.withCtx(()=>f[3]||(f[3]=[l.createTextVNode("保存")])),_:1}),l.createVNode(v,{onClick:d},{default:l.withCtx(()=>f[4]||(f[4]=[l.createTextVNode("取消")])),_:1})])]),_:1},8,["model"])])}}},[["__scopeId","data-v-c7d87a18"]]),Zj={class:"form-container"},Qj={style:{padding:"0 10px",display:"flex","flex-direction":"column",gap:"5px","align-items":"flex-start"}},e3=["src"],t3=En({__name:"image-management",setup(n){const e=l.reactive({items:[]}),t=()=>{Wi("/cny/custom/groupList").then(f=>{e.items=f.data})},s=l.reactive({show:!1,title:"新增图片分组",payload:null}),r=()=>{s.show=!0,s.title="新增图片分组",s.payload=null},i=f=>{s.show=!0,s.title="编辑图片分组",s.payload={id:f.id,groupName:f.groupName,sort:f.sort,isShow:f.isShow}},o=f=>{Dm("/cny/custom/removeGroup/"+f).then(p=>{p.code===200?(We.success("删除成功"),t()):We.error(p.msg||"删除失败")})},a=l.reactive({show:!1,title:"新增图片",payload:null}),c=f=>{a.show=!0,a.title="新增图片",a.payload={groupId:f}},u=f=>{a.show=!0,a.title="编辑图片",a.payload={id:f.id,groupId:f.groupId,imageName:f.imageName,sort:f.sort,isShow:f.isShow,imageUrl:f.imageUrl}},d=f=>{Dm("/cny/custom/removePicture/"+f).then(p=>{p.code===200?(We.success("删除成功"),t()):We.error(p.msg||"删除失败")})},h=f=>{s.show=!1,a.show=!1,f&&t()};return l.onMounted(()=>{t()}),(f,p)=>{const g=l.resolveComponent("el-button"),m=l.resolveComponent("el-table-column"),y=l.resolveComponent("el-table"),b=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",Zj,[l.createVNode(g,{type:"primary",onClick:r,size:"small"},{default:l.withCtx(()=>p[2]||(p[2]=[l.createTextVNode("新增图片分组")])),_:1}),l.createVNode(y,{data:e.items,border:"",height:"500"},{default:l.withCtx(()=>[l.createVNode(m,{type:"expand"},{default:l.withCtx(w=>[l.createElementVNode("div",Qj,[l.createVNode(g,{type:"primary",size:"small",onClick:x=>c(w.row.id)},{default:l.withCtx(()=>p[3]||(p[3]=[l.createTextVNode("新增图片")])),_:2},1032,["onClick"]),l.createVNode(y,{data:w.row.pictureList,border:"",size:"small"},{default:l.withCtx(()=>[l.createVNode(m,{label:"名称",prop:"imageName",align:"center"}),l.createVNode(m,{label:"图片",prop:"imageUrl",align:"center"},{default:l.withCtx(x=>[l.createElementVNode("img",{src:x.row.imageUrl,alt:"",style:{width:"64px",height:"64px"}},null,8,e3)]),_:1}),l.createVNode(m,{label:"排序",prop:"sort",align:"center"}),l.createVNode(m,{label:"是否显示",prop:"isShow",align:"center"},{default:l.withCtx(x=>[l.createTextVNode(l.toDisplayString(x.row.isShow===1?"是":"否"),1)]),_:1}),l.createVNode(m,{label:"操作",align:"center"},{default:l.withCtx(x=>[l.createVNode(g,{type:"primary",size:"small",onClick:v=>u(x.row)},{default:l.withCtx(()=>p[4]||(p[4]=[l.createTextVNode("编辑")])),_:2},1032,["onClick"]),l.createVNode(g,{type:"danger",size:"small",onClick:v=>d(x.row.id)},{default:l.withCtx(()=>p[5]||(p[5]=[l.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1})]),_:2},1032,["data"])])]),_:1}),l.createVNode(m,{label:"分组名称",prop:"groupName",align:"center"}),l.createVNode(m,{label:"排序",prop:"sort",align:"center"}),l.createVNode(m,{label:"是否显示",prop:"isShow",align:"center"},{default:l.withCtx(w=>[l.createTextVNode(l.toDisplayString(w.row.isShow===1?"是":"否"),1)]),_:1}),l.createVNode(m,{label:"操作",align:"center"},{default:l.withCtx(w=>[l.createVNode(g,{type:"primary",size:"small",onClick:x=>i(w.row)},{default:l.withCtx(()=>p[6]||(p[6]=[l.createTextVNode("编辑")])),_:2},1032,["onClick"]),l.createVNode(g,{type:"danger",size:"small",onClick:x=>o(w.row.id)},{default:l.withCtx(()=>p[7]||(p[7]=[l.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"]),l.createVNode(b,{modelValue:s.show,"onUpdate:modelValue":p[0]||(p[0]=w=>s.show=w),title:s.title,width:"300","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[s.show?(l.openBlock(),l.createBlock(qj,{key:0,payload:s.payload,onClose:h},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue","title"]),l.createVNode(b,{modelValue:a.show,"onUpdate:modelValue":p[1]||(p[1]=w=>a.show=w),title:a.title,width:"300","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[a.show?(l.openBlock(),l.createBlock(Kj,{key:0,payload:a.payload,onClose:h},null,8,["payload"])):l.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])])}}},[["__scopeId","data-v-75a537f2"]]),n3={class:"page-container"},s3={class:"tool-bar"},r3={class:"action"},i3={class:"el-dropdown-link"},o3={class:"action",style:{"margin-right":"50px"}},a3={class:"board"},l3={class:"drawing-board-box"},c3={id:"controls"},u3={key:0,class:"controls-label"},d3={style:{width:"100%",height:"100%",background:"black"}},r0=En(Object.assign({name:"editor"},{__name:"index",props:{id:{type:String,default:""}},emits:["getJson"],setup(n,{emit:e}){const t=n,s=l.ref(),r=l.reactive({label:"",component:l.shallowRef(null)}),i=l.ref(null),o=l.ref(null),a=()=>{const k=document.getElementById("drawing-board");s.value=new $({container:k,autoResize:!0,panning:!0,mousewheel:!0,connecting:{snap:!0,allowEdge:!0,highlight:!0,router:"orth",connectionPoint:{name:"anchor"},anchor:"center",createEdge(){return s.value.createEdge({inherit:"edge",...Wn,data:{type:Zb()},zIndex:0})}}}),s.value.use(dj()),s.value.use(hj()),s.value.use(fj()),s.value.use(pj()),s.value.use(mj()),s.value.use(yj()),s.value.bindKey(["delete","backspace"],()=>{bj(s.value)}),s.value.bindKey(["ctrl+c","cmd + c"],()=>{wj(s.value)}),s.value.bindKey(["ctrl+v","cmd + v"],()=>{xj(s.value)}),s.value.bindKey(["ctrl+z","cmd + z"],()=>{vj(s.value)}),s.value.bindKey(["ctrl+y","cmd + y"],()=>{Cj(s.value)});let R=null;s.value.on("edge:click",({cell:V})=>{o.value=V,r.component=t0,r.label="线段属性",i.value=pd()}),s.value.on("edge:mouseenter",({cell:V})=>{clearTimeout(R),V.toFront(),Sj(V)}),s.value.on("edge:mouseleave",({cell:V})=>{R=setTimeout(()=>{V.toBack(),V.removeTools()},300)}),s.value.on("node:mouseenter",()=>{qi("#drawing-board",!0)}),s.value.on("node:mouseleave",()=>{qi("#drawing-board",!1)}),s.value.use(new n0),s.value.on("blank:click",({e:V,x:A,y:P})=>{o.value=s,r.component=XD,r.label="画布属性",i.value=pd()}),s.value.on("cell:click",({cell:V})=>{var A,P;if(o.value=V,i.value=pd(),((A=V.data)==null?void 0:A.type)==="text"){r.component=e0,r.label="文本属性";return}if(((P=V.data)==null?void 0:P.type)==="base-shape"){r.component=e0,r.label="基础图形属性";return}if((V==null?void 0:V.shape)==="edge"){r.component=t0,r.label="连线属性";return}if((V==null?void 0:V.shape)==="image"){r.component=Gj,r.label="图片属性";return}r.component=null,r.label=null})},c=l.ref(),u=()=>{c.value=new li({target:s.value,...YD,groups:[{name:"基础组件",graphPadding:30}],search(V,A){var P;return((P=V.label)==null?void 0:P.indexOf(A))!==-1},placeholder:"搜索",notFoundText:"未找到匹配项",getDragNode:V=>{const A=V.clone({keepId:!0});return A.label!=="文本"&&(A.label=""),A}});const k=s.value.createNode({...WD}),R=bl.map(V=>(V.ports=s0,s.value.createNode(V)));c.value.load([k,...R],"基础组件"),Wi("/cny/custom/groupList").then(V=>{const A=(V==null?void 0:V.data)||[];A==null||A.forEach(P=>{c.value.addGroup({name:P==null?void 0:P.groupName,graphPadding:30});const j=P==null?void 0:P.pictureList.map(z=>{const Y={shape:"image",imageUrl:z==null?void 0:z.imageUrl,ports:s0,width:64,height:64,label:z.imageName};return s.value.createNode(Y)});c.value.load(j,P==null?void 0:P.groupName),document.getElementById("stencil").appendChild(c.value.container)})}).finally(()=>{setTimeout(()=>{c.value.container.querySelectorAll(".x6-node").forEach((A,P)=>{if(P>bl.length){const j=A.querySelector("text");A.style.position="relative",j&&(j.style.display="none",j.setAttribute("x","0%"),j.setAttribute("y","40"),j.style.fontSize="12px",j.style.fill="#ffffff")}A.addEventListener("mouseenter",j=>{if(P>bl.length){const z=A.querySelector("text");z&&(z.style.display="block")}}),A.addEventListener("mouseleave",j=>{if(P>bl.length){const z=A.querySelector("text");z&&(z.style.display="none")}})})},200)})},d=k=>{switch(k){case"snapLine":s.value.isSnaplineEnabled()?(s.value.disableSnapline(),We.warning("关闭对齐线")):(s.value.enableSnapline(),We.success("开启对齐线"));break;case"select":s.value.isSelectionEnabled()?(s.value.disableSelection(),We.warning("关闭框选")):(s.value.enableSelection(),We.success("开启框选"));break;case"drawLine":p();break;case"adaptive":g();break;case"shortcuts":y();break;case"image":w();break;case"clear":x();break;case"export":v();break}},h=l.ref(!1),f=l.ref(null),p=()=>{h.value=!0;const k=new Date;s.value.startBatch(k),s.value.disablePanning(),s.value.once("blank:mousedown",({e:R,x:V,y:A})=>{h.value&&(f.value=s.value.addEdge({source:{x:V,y:A},target:{x:V,y:A},...Wn,data:{type:Zb(),isConnector:!1},zIndex:0}))}),s.value.on("blank:mousemove",({e:R,x:V,y:A})=>{h.value&&f.value.setTarget({x:V,y:A})}),s.value.on("blank:mouseup",({e:R,x:V,y:A})=>{h.value=!1,s.value.enablePanning(),s.value.stopBatch(k)})},g=()=>{s.value.zoomToFit({maxScale:1,padding:20})},m=l.reactive({show:!1}),y=()=>{m.show=!0},b=l.reactive({show:!1}),w=()=>{b.show=!0},x=()=>{s.value.clearCells(),s.value.drawBackground(Vm),s.value.drawGrid(Bm),We.success("清空成功")},v=()=>{const k=W().format("YYYYMMDDHHmmss");s.value.exportPNG(k,{padding:10,quality:1,backgroundColor:s.value.options.background.color})},S=e,E=l.reactive({show:!1,background:null,grid:null,data:null}),C=()=>{E.background=s.value.options.background,E.grid=s.value.options.grid,E.data=s.value.toJSON(),E.show=!0},M=()=>{S("getJson",{background:s.value.options.background,grid:s.value.options.grid,data:s.value.toJSON()})},N=async()=>{if(!t.id){s.value.drawBackground(Vm),s.value.drawGrid(Bm),s.value.fromJSON({cells:[]});return}const{background:k,grid:R,data:V}=await Im(t.id);s.value.drawBackground(k),s.value.drawGrid(R),s.value.fromJSON(V),g()},_=l.shallowRef(null),T=()=>{new ResizeObserver(()=>{g()}).observe(_.value)};return l.onMounted(()=>{a(),u(),N(),T()}),(k,R)=>{const V=l.resolveComponent("el-icon"),A=l.resolveComponent("el-button"),P=l.resolveComponent("el-dropdown-item"),j=l.resolveComponent("el-dropdown-menu"),z=l.resolveComponent("el-dropdown"),Y=l.resolveComponent("el-scrollbar"),le=l.resolveComponent("el-dialog"),I=l.resolveComponent("el-drawer");return l.openBlock(),l.createElementBlock("div",n3,[l.createElementVNode("div",s3,[l.createElementVNode("div",r3,[l.createVNode(z,{onCommand:d},{dropdown:l.withCtx(()=>[l.createVNode(j,null,{default:l.withCtx(()=>[l.createVNode(P,{command:"snapLine"},{default:l.withCtx(()=>R[4]||(R[4]=[l.createTextVNode("对齐线")])),_:1}),l.createVNode(P,{command:"select"},{default:l.withCtx(()=>R[5]||(R[5]=[l.createTextVNode("框选")])),_:1}),l.createVNode(P,{command:"drawLine"},{default:l.withCtx(()=>R[6]||(R[6]=[l.createTextVNode("绘制直线")])),_:1}),l.createVNode(P,{command:"adaptive"},{default:l.withCtx(()=>R[7]||(R[7]=[l.createTextVNode("视图自适应")])),_:1}),l.createVNode(P,{command:"shortcuts"},{default:l.withCtx(()=>R[8]||(R[8]=[l.createTextVNode("查看快捷键")])),_:1}),l.createVNode(P,{command:"image"},{default:l.withCtx(()=>R[9]||(R[9]=[l.createTextVNode("图片管理")])),_:1}),l.createVNode(P,{command:"clear"},{default:l.withCtx(()=>R[10]||(R[10]=[l.createTextVNode("清空画布")])),_:1}),l.createVNode(P,{command:"export"},{default:l.withCtx(()=>R[11]||(R[11]=[l.createTextVNode("导出成图片")])),_:1})]),_:1})]),default:l.withCtx(()=>[l.createElementVNode("span",i3,[l.createVNode(A,{size:"small",text:""},{default:l.withCtx(()=>[R[3]||(R[3]=l.createTextVNode("工具 ")),l.createVNode(V,null,{default:l.withCtx(()=>[l.createVNode(l.unref(WP))]),_:1})]),_:1})])]),_:1})]),l.createElementVNode("div",o3,[l.createVNode(l.unref(Bg),{content:"预览",placement:"bottom"},{default:l.withCtx(()=>[l.createVNode(A,{size:"small",icon:l.unref(Mp),onClick:C},null,8,["icon"])]),_:1}),l.createVNode(l.unref(Bg),{content:"保存",placement:"bottom"},{default:l.withCtx(()=>[l.createVNode(A,{size:"small",icon:l.unref(nA),onClick:M},null,8,["icon"])]),_:1})])]),l.createElementVNode("div",a3,[R[12]||(R[12]=l.createElementVNode("div",{id:"stencil"},null,-1)),l.createElementVNode("div",l3,[l.createElementVNode("div",{id:"drawing-board",ref_key:"drawBoard",ref:_},null,512)]),l.createElementVNode("div",c3,[r.label?(l.openBlock(),l.createElementBlock("div",u3,l.toDisplayString(r.label),1)):l.createCommentVNode("",!0),l.createVNode(Y,null,{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.component),{graph:s.value,payload:o.value,key:i.value},null,8,["graph","payload"]))]),_:1})])]),l.createVNode(le,{modelValue:m.show,"onUpdate:modelValue":R[0]||(R[0]=B=>m.show=B),width:"400px",title:"快捷键","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[l.createVNode(Vj)]),_:1},8,["modelValue"]),l.createVNode(le,{modelValue:b.show,"onUpdate:modelValue":R[1]||(R[1]=B=>b.show=B),width:"800px",title:"图片管理","close-on-click-modal":!1,"close-on-press-escape":!1},{default:l.withCtx(()=>[l.createVNode(t3)]),_:1},8,["modelValue"]),l.createVNode(I,{class:"no-border-drawer",modelValue:E.show,"onUpdate:modelValue":R[2]||(R[2]=B=>E.show=B),title:"预览",direction:"ttb",size:"100%"},{default:l.withCtx(()=>[l.createElementVNode("div",d3,[E.show?(l.openBlock(),l.createBlock(gd,{key:0,background:E.background,grid:E.grid,data:E.data},null,8,["background","grid","data"])):l.createCommentVNode("",!0)])]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-1890cc85"]]),h3=[r0,gd],i0=(n,e)=>{h3.forEach(t=>{n.component(t.name,t)})};typeof window<"u"&&window.Vue&&i0(window.Vue);const f3={install:i0};Re.WiringDiagramEditor=r0,Re.WiringDiagramPreview=gd,Re.default=f3,Re.setBaseURL=FD,Re.setToken=UD,Object.defineProperties(Re,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED