mx-framework-plus 1.1.8 → 1.1.9
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.
|
@@ -6975,9 +6975,13 @@ const $e = {
|
|
|
6975
6975
|
handler(t, e) {
|
|
6976
6976
|
let l = this;
|
|
6977
6977
|
l.yhz && (l.yhz.isPreview(!t), l.$nextTick(() => {
|
|
6978
|
-
t ? (l.keys = Math.random().toString(36).substring(2), l.graph.refresh(), l.scheduleUpdateOverlay()
|
|
6978
|
+
t ? (l.keys = Math.random().toString(36).substring(2), l.graph.refresh(), l.scheduleUpdateOverlay(), l.timeLineMap.length > 0 && l.timeLineMap.forEach((o) => {
|
|
6979
|
+
o.cell.setVisible(!1);
|
|
6980
|
+
})) : (l.timeLineMap.length > 0 && l.timeLineMap.forEach((o) => {
|
|
6981
|
+
o.cell.setVisible(!0);
|
|
6982
|
+
}), l.centeredWindow && l.centeredWindow.forEach((r) => {
|
|
6979
6983
|
r && (r.setVisible(!1), r.destroy());
|
|
6980
|
-
});
|
|
6984
|
+
}));
|
|
6981
6985
|
}));
|
|
6982
6986
|
},
|
|
6983
6987
|
immediate: !0,
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
`),e+=` </mxCell>
|
|
11
11
|
`):e+=`/>
|
|
12
12
|
`}),e+=` </root>
|
|
13
|
-
`,e+="</mxGraphModel>",e}function fe(t){return typeof t!="string"&&(t=String(t)),t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function lt(t){let e=this,a=10,s="#dddddd",o="#ffffff00",m=1,h="square",x=1,S=0,b=0,y=1,C=null;e.createGrid=function(B,k,T){if(C=B,k){var P=document.createElement("canvas");if(!P)return;P.style.position="absolute";var F=C.getCellBounds(k);if(F){P.style.top=F.y+"px",P.style.left=F.x+"px",P.style.width=F.width+1+"px",P.style.height=F.height+1+"px",P.style.zIndex=-1,P.style.pointerEvents="none",P.id="gridCanvas_"+k.id,P.dataId=ae();let H=k.value.style||{};H.background&&H.background.indexOf("files/")>-1&&H["background-image"]?P.style.background=`${H["background-image"]} center center no-repeat`:P.style.background=""}let j=C.container.querySelector("#gridCanvas_"+k.id);j&&j.remove(),C.container.prepend(P),P.width=P.offsetWidth,P.height=P.offsetHeight,T?s="transparent":s="#dddddd",z(P),P.addEventListener("wheel",function(H){H.preventDefault();const I=P.getBoundingClientRect(),Z=H.clientX-I.left,K=H.clientY-I.top,ee=.1,ne=H.deltaY<0?1:-1,oe=Math.exp(ne*ee),re=Z/y,se=K/y;y*=oe,y=Math.min(Math.max(.5,y),5),S=re-Z/y,b=se-K/y,z(P),C&&(C.view.scale=y,C.refresh())}),C&&D()}};function D(){if(!C)return;C.snapPoint=function(k,T,P){if(!P&&this.snapToGrid&&a>0){const F=a/y,j=k.x-S,H=k.y-b;k.x=Math.round(j/F)*F+S,k.y=Math.round(H/F)*F+b}return k};const B=C.mouseUp;C.mouseUp=function(k,T){B.apply(this,arguments),this.selectedCells.length>0&&this.snapToGrid&&T.snapCellsToGrid(this.selectedCells)}}e.snapCellsToGrid=function(B){if(!(!B||B.length===0)){this.getModel().beginUpdate();try{for(let k=0;k<B.length;k++){const T=B[k],P=this.getCellGeometry(T);if(P){const F=P.clone(),j=this.snapPoint({x:F.x,y:F.y});F.x=j.x,F.y=j.y,this.getModel().setGeometry(T,F)}}}finally{this.getModel().endUpdate()}}};function z(B){y=C.view.scale;let k=B.getContext("2d");k.clearRect(0,0,B.width,B.height),k.fillStyle=o,k.fillRect(0,0,B.width,B.height);const T=a*y;if(T<2)return;k.strokeStyle=s,k.lineWidth=m,k.globalAlpha=x;const P=Math.floor(-S*y/T)*T,F=Math.floor(-b*y/T)*T,j=B.width+T,H=B.height+T;switch(h){case"dotted":k.fillStyle=s;for(let I=P;I<j;I+=T)for(let Z=F;Z<H;Z+=T)k.beginPath(),k.arc(I+.5,Z+.5,m,0,Math.PI*2),k.fill();break;case"dashed":k.setLineDash([5,3]),k.beginPath();for(let I=P;I<j;I+=T)k.moveTo(I+.5,0),k.lineTo(I+.5,B.height);for(let I=F;I<H;I+=T)k.moveTo(0,I+.5),k.lineTo(B.width,I+.5);k.stroke(),k.setLineDash([]);break;case"square":k.beginPath();for(let I=P;I<j;I+=T)k.moveTo(I+.5,0),k.lineTo(I+.5,B.height);for(let I=F;I<H;I+=T)k.moveTo(0,I+.5),k.lineTo(B.width,I+.5);k.stroke();break;default:k.beginPath();for(let I=P;I<j;I+=T)k.moveTo(I+.5,0),k.lineTo(I+.5,B.height);for(let I=F;I<H;I+=T)k.moveTo(0,I+.5),k.lineTo(B.width,I+.5);k.stroke()}k.globalAlpha=1}e.getGridConfig=function(){return{gridSize:a,scale:y,offsetX:S,offsetY:b}},e.setGridSize=function(B){a=B;const k=document.getElementById("canvas");k&&z(k)}}const nt=["src"],it={key:2,style:{"z-index":"0"}},ot={key:3},rt=["src"],st={key:2,style:{"z-index":"0"}},dt={key:3},ct=["src"],ut={key:2,style:{"z-index":"0"}},pt={key:3},he={__name:"btnIndex",props:{style:{type:Object,default:()=>({})}},setup(t){const e=t;return(a,s)=>t.style.btntype=="none"?(r.openBlock(),r.createElementBlock("div",{key:0,class:"btn-index-none",style:r.normalizeStyle(t.style)},[e.style.isIcon&&!e.style.imgUrl?(r.openBlock(),r.createElementBlock("i",{key:0,class:r.normalizeClass(["iconfont",e.style.iconName])},null,2)):r.createCommentVNode("",!0),e.style.imgUrl?(r.openBlock(),r.createElementBlock("img",{key:1,src:e.style.imgUrl,style:{"z-index":"0"},alt:" "},null,8,nt)):r.createCommentVNode("",!0),e.style.text?(r.openBlock(),r.createElementBlock("span",it,r.toDisplayString(e.style.text),1)):r.createCommentVNode("",!0),!e.style.imgUrl&&!e.style.text?(r.openBlock(),r.createElementBlock("span",ot)):r.createCommentVNode("",!0)],4)):t.style.btntype=="sq"?(r.openBlock(),r.createElementBlock("div",{key:1,class:"btn-index",style:r.normalizeStyle(t.style)},[e.style.isIcon&&!e.style.imgUrl?(r.openBlock(),r.createElementBlock("i",{key:0,class:r.normalizeClass(["iconfont",e.style.iconName])},null,2)):r.createCommentVNode("",!0),e.style.imgUrl?(r.openBlock(),r.createElementBlock("img",{key:1,src:e.style.imgUrl,style:{"z-index":"0"},alt:" "},null,8,rt)):r.createCommentVNode("",!0),e.style.text?(r.openBlock(),r.createElementBlock("span",st,r.toDisplayString(e.style.text),1)):r.createCommentVNode("",!0),!e.style.imgUrl&&!e.style.text?(r.openBlock(),r.createElementBlock("span",dt)):r.createCommentVNode("",!0)],4)):(r.openBlock(),r.createElementBlock("div",{key:2,class:"btn-bg-jd",style:r.normalizeStyle(t.style)},[e.style.isIcon&&!e.style.imgUrl?(r.openBlock(),r.createElementBlock("i",{key:0,class:r.normalizeClass(["iconfont",e.style.iconName])},null,2)):r.createCommentVNode("",!0),e.style.imgUrl?(r.openBlock(),r.createElementBlock("img",{key:1,src:e.style.imgUrl,style:{"z-index":"0"},alt:" "},null,8,ct)):r.createCommentVNode("",!0),e.style.text?(r.openBlock(),r.createElementBlock("span",ut,r.toDisplayString(e.style.text),1)):r.createCommentVNode("",!0),!e.style.imgUrl&&!e.style.text?(r.openBlock(),r.createElementBlock("span",pt)):r.createCommentVNode("",!0)],4))}},q=(t,e)=>{const a=t.__vccOpts||t;for(const[s,o]of e)a[s]=o;return a},mt={name:"VerticalRuler",props:{style:{type:Object,default:()=>({max:100,min:0,scales:10,value:0,layout:{height:400}})}},methods:{getNumber(t){if(typeof t=="number")return t;const e=parseFloat(t);return isNaN(e)?0:e},convertToStyleString(t){if(!t)return"";let e={};for(const a in t){if(!Object.hasOwn(t,a))continue;const s=t[a],o=a.replace(/([A-Z])/g,"-$1").toLowerCase();let m=s;o==="gap"&&(m=`${s}px`),(o==="fontSize"||o==="font-size")&&(m=`${s}px`),e[o]=m}return e}},computed:{getFontStyle(){let t=this,e=t.style,s={color:e.color,...e.valuefont};return t.convertToStyleString(s)},getScalesFontStyle(){let t=this,e=t.style,s={color:e.color,...e.scalefont};return t.convertToStyleString(s)},ywvalue(){const t=this,e=t.getNumber(t.style.value),a=t.getNumber(t.style.max),s=t.getNumber(t.style.min),o=t.getNumber(t.style.layout.height),m=Math.max(s,Math.min(e,a)),h=a-s;return h<=0?0:(m-s)/h*o-8},scaleInterval(){const t=this,e=t.getNumber(t.style.max),a=t.getNumber(t.style.min),s=t.getNumber(t.style.layout.height),o=Math.floor((e-a)/t.style.scales)+1;return o>1?s/(o-1):0},scaleValues(){const t=this,e=t.getNumber(t.style.max),a=t.getNumber(t.style.min),s=t.getNumber(t.style.scales)||10;let o=[];for(let m=e;m>=a;m-=s)o.push(m.toFixed(0));return o}},mounted(){}},gt={class:"ruler-container"};function ft(t,e,a,s,o,m){return r.openBlock(),r.createElementBlock("div",gt,[a.style.scalevisible||a.style.scalevisible==1?(r.openBlock(),r.createElementBlock("div",{key:0,class:"vertical-ruler",style:r.normalizeStyle(m.getScalesFontStyle)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.scaleValues,(h,x)=>(r.openBlock(),r.createElementBlock("div",{key:x,class:"scale-mark",style:r.normalizeStyle({top:`${x*m.scaleInterval}px`})},[x!=0?(r.openBlock(),r.createElementBlock("span",{key:0,class:"mark-value",style:r.normalizeStyle({color:a.style.color})},r.toDisplayString(h),5)):r.createCommentVNode("",!0),x!=0?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["mark-line",{"long-mark":x%5===0}]),style:r.normalizeStyle({background:a.style.color})},null,6)):r.createCommentVNode("",!0)],4))),128))],4)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"chart-bottom",style:r.normalizeStyle({height:`${m.ywvalue}px`,background:a.style.fillColor})},[a.style.valuevisible||a.style.valuevisible==1?(r.openBlock(),r.createElementBlock("span",{key:0,class:"value-text",style:r.normalizeStyle(m.getFontStyle)},r.toDisplayString(a.style.text),5)):r.createCommentVNode("",!0)],4)])}const ht=q(mt,[["render",ft],["__scopeId","data-v-b14d49d0"]]),yt={name:"VerticalRuler",props:{style:{type:Object,default:()=>({max:100,min:0,scales:10,value:0,layout:{height:400}})}},methods:{getNumber(t){if(typeof t=="number")return t;const e=parseFloat(t);return isNaN(e)?0:e},convertToStyleString(t){if(!t)return"";let e={};for(const a in t){if(!Object.hasOwn(t,a))continue;const s=t[a],o=a.replace(/([A-Z])/g,"-$1").toLowerCase();let m=s;o==="gap"&&(m=`${s}px`),(o==="fontSize"||o==="font-size")&&(m=`${s}px`),e[o]=m}return e}},computed:{getFontStyle(){let t=this,e=t.style,s={color:e.color,...e.valuefont};return t.convertToStyleString(s)},getScalesFontStyle(){let t=this,e=t.style,s={color:e.color,...e.scalefont};return t.convertToStyleString(s)},ywvalue(){const t=this,e=t.getNumber(t.style.value),a=t.getNumber(t.style.max),s=t.getNumber(t.style.min),o=t.getNumber(t.style.layout.width),m=Math.max(s,Math.min(e,a)),h=a-s;return h<=0?0:(m-s)/h*o},scaleInterval(){const t=this,e=t.getNumber(t.style.max),a=t.getNumber(t.style.min),s=t.getNumber(t.style.layout.width),o=Math.floor((e-a)/t.style.scales)+1;return o>1?s/(o-1):0},scaleValues(){const t=this,e=t.getNumber(t.style.max),a=t.getNumber(t.style.min),s=t.getNumber(t.style.scales)||10,o=[];for(let m=a;m<e;m+=s)o.push(m.toFixed(0));return o}}},bt={class:"ruler-h-container"};function xt(t,e,a,s,o,m){return r.openBlock(),r.createElementBlock("div",bt,[a.style.scalevisible||a.style.scalevisible==1?(r.openBlock(),r.createElementBlock("div",{key:0,class:"h-ruler",style:r.normalizeStyle(m.getScalesFontStyle)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.scaleValues,(h,x)=>(r.openBlock(),r.createElementBlock("div",{key:x,class:"scale-h-mark",style:r.normalizeStyle({left:`${x*m.scaleInterval}px`})},[x!=0?(r.openBlock(),r.createElementBlock("span",{key:0,class:"mark-h-value",style:r.normalizeStyle({color:a.style.color})},r.toDisplayString(h),5)):r.createCommentVNode("",!0),x!=0?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["mark-h-line",{"long-h-mark":x%5===0}]),style:r.normalizeStyle({background:a.style.color})},null,6)):r.createCommentVNode("",!0)],4))),128))],4)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"chart-h-bottom",style:r.normalizeStyle({width:`${m.ywvalue}px`,background:a.style.fillColor})},[a.style.valuevisible||a.style.valuevisible==1?(r.openBlock(),r.createElementBlock("span",{key:0,class:"value-h-text",style:r.normalizeStyle(m.getFontStyle)},r.toDisplayString(a.style.text),5)):r.createCommentVNode("",!0)],4)])}const vt={name:"VerticalRuler",components:{indexV:ht,indexH:q(yt,[["render",xt],["__scopeId","data-v-7f6aaa3d"]])},props:{style:{type:Object,default:()=>({})}},methods:{},computed:{getStyle(){let t=this.style;return t.borderColor=t.color||"#333333",t}}};function kt(t,e,a,s,o,m){const h=r.resolveComponent("index-v"),x=r.resolveComponent("index-h");return r.openBlock(),r.createElementBlock("div",{class:"chart-container",style:r.normalizeStyle(m.getStyle)},[a.style.orientation=="vertical"?(r.openBlock(),r.createBlock(h,{key:0,style:r.normalizeStyle(a.style)},null,8,["style"])):(r.openBlock(),r.createBlock(x,{key:1,style:r.normalizeStyle(a.style)},null,8,["style"]))],4)}const wt=q(vt,[["render",kt],["__scopeId","data-v-5f295dcb"]]),Ct={name:"VueSwitch",props:{modelValue:{type:Boolean,default:!1},style:{type:Object,default:()=>({})},size:{type:String,default:"default",validator:function(t){return["small","default","large"].includes(t)}},color:{type:String,default:"default",validator:function(t){return["default","primary","success","warning","danger","purple"].includes(t)}},withIcons:{type:Boolean,default:!1},withLabels:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],computed:{switchClasses(){return[`switch-${this.size}`,`switch-${this.color}`,{"switch-with-icons":this.withIcons,"switch-with-labels":this.withLabels,"switch-disabled":this.disabled}]}}},St=["checked","disabled"],At=["src"],Et={key:2,style:{"z-index":"0"}},zt={key:3};function Bt(t,e,a,s,o,m){return r.openBlock(),r.createElementBlock("label",{class:r.normalizeClass(["switch-jd",m.switchClasses])},[r.createElementVNode("input",{type:"checkbox",class:"switch-input",checked:a.modelValue,onChange:e[0]||(e[0]=h=>t.$emit("update:modelValue",h.target.checked)),disabled:a.disabled},null,40,St),r.createElementVNode("span",{class:"switch-jd-slider",style:r.normalizeStyle(a.style)},[a.style.isIcon&&!a.style.imgUrl?(r.openBlock(),r.createElementBlock("i",{key:0,class:r.normalizeClass(["iconfont",a.style.iconName])},null,2)):r.createCommentVNode("",!0),a.style.imgUrl?(r.openBlock(),r.createElementBlock("img",{key:1,src:a.style.imgUrl,style:{"z-index":"0"},alt:" "},null,8,At)):r.createCommentVNode("",!0),a.style.text?(r.openBlock(),r.createElementBlock("span",Et,r.toDisplayString(a.style.text),1)):r.createCommentVNode("",!0),!a.style.imgUrl&&!a.style.text?(r.openBlock(),r.createElementBlock("span",zt)):r.createCommentVNode("",!0)],4)],2)}const Dt=q(Ct,[["render",Bt],["__scopeId","data-v-3233cdae"]]),Tt={name:"VueSwitch",props:{style:{type:Object,default:()=>({})},modelValue:{type:Boolean,default:!0},size:{type:String,default:"default",validator:function(t){return["small","default","large"].includes(t)}},color:{type:String,default:"default",validator:function(t){return["default","primary","success","warning","danger","purple"].includes(t)}},withIcons:{type:Boolean,default:!1},withLabels:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],methods:{convertToStyleString(t){if(!t)return"";let e={};for(const a in t){if(!Object.hasOwn(t,a))continue;const s=t[a],o=a.replace(/([A-Z])/g,"-$1").toLowerCase();let m=s;o==="gap"&&(m=`${s}px`),(o==="fontSize"||o==="font-size")&&(m=`${s}px`),e[o]=m}return e}},computed:{getActiveStyle(){let t={};return t={background:this.style.background},t},switchClasses(){return[`switch-${this.size}`,`switch-${this.color}`,{"switch-with-icons":this.withIcons,"switch-with-labels":this.withLabels,"switch-disabled":this.disabled}]}}},Nt=["checked","disabled"];function It(t,e,a,s,o,m){return r.openBlock(),r.createElementBlock("label",{class:r.normalizeClass(["switch",m.switchClasses])},[r.createElementVNode("input",{type:"checkbox",class:"switch-input",checked:a.modelValue,onChange:e[0]||(e[0]=h=>t.$emit("update:modelValue",h.target.checked)),disabled:a.disabled},null,40,Nt),r.createElementVNode("span",{class:"switch-slider",style:r.normalizeStyle({background:a.style.background})},null,4)],2)}const Pt=q(Tt,[["render",It],["__scopeId","data-v-41ace2e4"]]),Ut=["src"],Lt={key:2,style:{"z-index":"0"}},Mt={key:3},Ot={__name:"switch",props:{style:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1}},setup(t){const e=t,a=r.ref(e.style.realValue==="true");return(s,o)=>t.style.btntype=="none"?(r.openBlock(),r.createElementBlock("div",{key:0,class:"switch-none",style:r.normalizeStyle(t.style)},[e.style.isIcon&&!e.style.imgUrl?(r.openBlock(),r.createElementBlock("i",{key:0,class:r.normalizeClass(["iconfont",e.style.iconName])},null,2)):r.createCommentVNode("",!0),e.style.imgUrl?(r.openBlock(),r.createElementBlock("img",{key:1,src:e.style.imgUrl,style:{"z-index":"0"},alt:" "},null,8,Ut)):r.createCommentVNode("",!0),e.style.text?(r.openBlock(),r.createElementBlock("span",Lt,r.toDisplayString(e.style.text),1)):r.createCommentVNode("",!0),!e.style.imgUrl&&!e.style.text?(r.openBlock(),r.createElementBlock("span",Mt)):r.createCommentVNode("",!0)],4)):t.style.btntype=="sq"?(r.openBlock(),r.createBlock(Pt,{key:1,modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=m=>a.value=m),style:r.normalizeStyle(t.style),disabled:t.disabled},null,8,["modelValue","style","disabled"])):(r.openBlock(),r.createBlock(Dt,{key:2,modelValue:a.value,"onUpdate:modelValue":o[1]||(o[1]=m=>a.value=m),style:r.normalizeStyle(t.style),disabled:t.disabled},null,8,["modelValue","style","disabled"]))}},Vt=q({__name:"circle",props:{style:{type:Object,default:()=>({})}},setup(t){const e=t,a=r.computed(()=>{let s=e.style.layout||{};return{width:s.width+"px",height:s.height+"px",borderWidth:(e.style.borderValue||1)+"px",padding:(e.style.borderValue||1)+"px",borderColor:e.style.stroke||"#000000",backgroundColor:e.style.background||"#D1E7FF"}});return(s,o)=>(r.openBlock(),r.createElementBlock("div",{class:"gr-circle",style:r.normalizeStyle(a.value)},[r.createElementVNode("div",{class:"gr-circle-text",style:r.normalizeStyle({color:e.style.stroke||"#000000"})},r.toDisplayString(e.style.text),5)],4))}},[["__scopeId","data-v-fa22a4c3"]]),Ft=q({__name:"rectangle",props:{style:{type:Object,default:()=>({})}},setup(t){const e=t,a=r.computed(()=>{let s=e.style.layout||{};return{width:s.width+"px",height:s.height+"px",borderWidth:(e.style.borderValue||1)+"px",padding:(e.style.borderValue||1)+"px",borderColor:e.style.stroke||"#000000",backgroundColor:e.style.background||"#D1E7FF"}});return(s,o)=>(r.openBlock(),r.createElementBlock("div",{class:"gr-rectangle",style:r.normalizeStyle(a.value)},[r.createElementVNode("div",{class:"gr-rectangle-text",style:r.normalizeStyle({color:e.style.stroke||"#000000"})},r.toDisplayString(e.style.text),5)],4))}},[["__scopeId","data-v-98efe4a0"]]),Rt=["innerHTML"],Wt=q({__name:"triangle",props:{style:{type:Object,default:()=>({})}},setup(t){const e=t,a=r.computed(()=>{let s=e.style.layout||{},{x:o,y:m,width:h,height:x}=s,S=e.style.borderValue/2,b=`${o+h/2},${m+S}`,y=`${o+S},${m+x-S}`,C=`${o+h-S},${m+x-S}`;return`
|
|
13
|
+
`,e+="</mxGraphModel>",e}function fe(t){return typeof t!="string"&&(t=String(t)),t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function lt(t){let e=this,a=10,s="#dddddd",o="#ffffff00",m=1,h="square",x=1,S=0,b=0,y=1,C=null;e.createGrid=function(B,k,T){if(C=B,k){var P=document.createElement("canvas");if(!P)return;P.style.position="absolute";var F=C.getCellBounds(k);if(F){P.style.top=F.y+"px",P.style.left=F.x+"px",P.style.width=F.width+1+"px",P.style.height=F.height+1+"px",P.style.zIndex=-1,P.style.pointerEvents="none",P.id="gridCanvas_"+k.id,P.dataId=ae();let H=k.value.style||{};H.background&&H.background.indexOf("files/")>-1&&H["background-image"]?P.style.background=`${H["background-image"]} center center no-repeat`:P.style.background=""}let j=C.container.querySelector("#gridCanvas_"+k.id);j&&j.remove(),C.container.prepend(P),P.width=P.offsetWidth,P.height=P.offsetHeight,T?s="transparent":s="#dddddd",z(P),P.addEventListener("wheel",function(H){H.preventDefault();const I=P.getBoundingClientRect(),Z=H.clientX-I.left,K=H.clientY-I.top,ee=.1,ne=H.deltaY<0?1:-1,oe=Math.exp(ne*ee),re=Z/y,se=K/y;y*=oe,y=Math.min(Math.max(.5,y),5),S=re-Z/y,b=se-K/y,z(P),C&&(C.view.scale=y,C.refresh())}),C&&D()}};function D(){if(!C)return;C.snapPoint=function(k,T,P){if(!P&&this.snapToGrid&&a>0){const F=a/y,j=k.x-S,H=k.y-b;k.x=Math.round(j/F)*F+S,k.y=Math.round(H/F)*F+b}return k};const B=C.mouseUp;C.mouseUp=function(k,T){B.apply(this,arguments),this.selectedCells.length>0&&this.snapToGrid&&T.snapCellsToGrid(this.selectedCells)}}e.snapCellsToGrid=function(B){if(!(!B||B.length===0)){this.getModel().beginUpdate();try{for(let k=0;k<B.length;k++){const T=B[k],P=this.getCellGeometry(T);if(P){const F=P.clone(),j=this.snapPoint({x:F.x,y:F.y});F.x=j.x,F.y=j.y,this.getModel().setGeometry(T,F)}}}finally{this.getModel().endUpdate()}}};function z(B){y=C.view.scale;let k=B.getContext("2d");k.clearRect(0,0,B.width,B.height),k.fillStyle=o,k.fillRect(0,0,B.width,B.height);const T=a*y;if(T<2)return;k.strokeStyle=s,k.lineWidth=m,k.globalAlpha=x;const P=Math.floor(-S*y/T)*T,F=Math.floor(-b*y/T)*T,j=B.width+T,H=B.height+T;switch(h){case"dotted":k.fillStyle=s;for(let I=P;I<j;I+=T)for(let Z=F;Z<H;Z+=T)k.beginPath(),k.arc(I+.5,Z+.5,m,0,Math.PI*2),k.fill();break;case"dashed":k.setLineDash([5,3]),k.beginPath();for(let I=P;I<j;I+=T)k.moveTo(I+.5,0),k.lineTo(I+.5,B.height);for(let I=F;I<H;I+=T)k.moveTo(0,I+.5),k.lineTo(B.width,I+.5);k.stroke(),k.setLineDash([]);break;case"square":k.beginPath();for(let I=P;I<j;I+=T)k.moveTo(I+.5,0),k.lineTo(I+.5,B.height);for(let I=F;I<H;I+=T)k.moveTo(0,I+.5),k.lineTo(B.width,I+.5);k.stroke();break;default:k.beginPath();for(let I=P;I<j;I+=T)k.moveTo(I+.5,0),k.lineTo(I+.5,B.height);for(let I=F;I<H;I+=T)k.moveTo(0,I+.5),k.lineTo(B.width,I+.5);k.stroke()}k.globalAlpha=1}e.getGridConfig=function(){return{gridSize:a,scale:y,offsetX:S,offsetY:b}},e.setGridSize=function(B){a=B;const k=document.getElementById("canvas");k&&z(k)}}const nt=["src"],it={key:2,style:{"z-index":"0"}},ot={key:3},rt=["src"],st={key:2,style:{"z-index":"0"}},dt={key:3},ct=["src"],ut={key:2,style:{"z-index":"0"}},pt={key:3},he={__name:"btnIndex",props:{style:{type:Object,default:()=>({})}},setup(t){const e=t;return(a,s)=>t.style.btntype=="none"?(r.openBlock(),r.createElementBlock("div",{key:0,class:"btn-index-none",style:r.normalizeStyle(t.style)},[e.style.isIcon&&!e.style.imgUrl?(r.openBlock(),r.createElementBlock("i",{key:0,class:r.normalizeClass(["iconfont",e.style.iconName])},null,2)):r.createCommentVNode("",!0),e.style.imgUrl?(r.openBlock(),r.createElementBlock("img",{key:1,src:e.style.imgUrl,style:{"z-index":"0"},alt:" "},null,8,nt)):r.createCommentVNode("",!0),e.style.text?(r.openBlock(),r.createElementBlock("span",it,r.toDisplayString(e.style.text),1)):r.createCommentVNode("",!0),!e.style.imgUrl&&!e.style.text?(r.openBlock(),r.createElementBlock("span",ot)):r.createCommentVNode("",!0)],4)):t.style.btntype=="sq"?(r.openBlock(),r.createElementBlock("div",{key:1,class:"btn-index",style:r.normalizeStyle(t.style)},[e.style.isIcon&&!e.style.imgUrl?(r.openBlock(),r.createElementBlock("i",{key:0,class:r.normalizeClass(["iconfont",e.style.iconName])},null,2)):r.createCommentVNode("",!0),e.style.imgUrl?(r.openBlock(),r.createElementBlock("img",{key:1,src:e.style.imgUrl,style:{"z-index":"0"},alt:" "},null,8,rt)):r.createCommentVNode("",!0),e.style.text?(r.openBlock(),r.createElementBlock("span",st,r.toDisplayString(e.style.text),1)):r.createCommentVNode("",!0),!e.style.imgUrl&&!e.style.text?(r.openBlock(),r.createElementBlock("span",dt)):r.createCommentVNode("",!0)],4)):(r.openBlock(),r.createElementBlock("div",{key:2,class:"btn-bg-jd",style:r.normalizeStyle(t.style)},[e.style.isIcon&&!e.style.imgUrl?(r.openBlock(),r.createElementBlock("i",{key:0,class:r.normalizeClass(["iconfont",e.style.iconName])},null,2)):r.createCommentVNode("",!0),e.style.imgUrl?(r.openBlock(),r.createElementBlock("img",{key:1,src:e.style.imgUrl,style:{"z-index":"0"},alt:" "},null,8,ct)):r.createCommentVNode("",!0),e.style.text?(r.openBlock(),r.createElementBlock("span",ut,r.toDisplayString(e.style.text),1)):r.createCommentVNode("",!0),!e.style.imgUrl&&!e.style.text?(r.openBlock(),r.createElementBlock("span",pt)):r.createCommentVNode("",!0)],4))}},q=(t,e)=>{const a=t.__vccOpts||t;for(const[s,o]of e)a[s]=o;return a},mt={name:"VerticalRuler",props:{style:{type:Object,default:()=>({max:100,min:0,scales:10,value:0,layout:{height:400}})}},methods:{getNumber(t){if(typeof t=="number")return t;const e=parseFloat(t);return isNaN(e)?0:e},convertToStyleString(t){if(!t)return"";let e={};for(const a in t){if(!Object.hasOwn(t,a))continue;const s=t[a],o=a.replace(/([A-Z])/g,"-$1").toLowerCase();let m=s;o==="gap"&&(m=`${s}px`),(o==="fontSize"||o==="font-size")&&(m=`${s}px`),e[o]=m}return e}},computed:{getFontStyle(){let t=this,e=t.style,s={color:e.color,...e.valuefont};return t.convertToStyleString(s)},getScalesFontStyle(){let t=this,e=t.style,s={color:e.color,...e.scalefont};return t.convertToStyleString(s)},ywvalue(){const t=this,e=t.getNumber(t.style.value),a=t.getNumber(t.style.max),s=t.getNumber(t.style.min),o=t.getNumber(t.style.layout.height),m=Math.max(s,Math.min(e,a)),h=a-s;return h<=0?0:(m-s)/h*o-8},scaleInterval(){const t=this,e=t.getNumber(t.style.max),a=t.getNumber(t.style.min),s=t.getNumber(t.style.layout.height),o=Math.floor((e-a)/t.style.scales)+1;return o>1?s/(o-1):0},scaleValues(){const t=this,e=t.getNumber(t.style.max),a=t.getNumber(t.style.min),s=t.getNumber(t.style.scales)||10;let o=[];for(let m=e;m>=a;m-=s)o.push(m.toFixed(0));return o}},mounted(){}},gt={class:"ruler-container"};function ft(t,e,a,s,o,m){return r.openBlock(),r.createElementBlock("div",gt,[a.style.scalevisible||a.style.scalevisible==1?(r.openBlock(),r.createElementBlock("div",{key:0,class:"vertical-ruler",style:r.normalizeStyle(m.getScalesFontStyle)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.scaleValues,(h,x)=>(r.openBlock(),r.createElementBlock("div",{key:x,class:"scale-mark",style:r.normalizeStyle({top:`${x*m.scaleInterval}px`})},[x!=0?(r.openBlock(),r.createElementBlock("span",{key:0,class:"mark-value",style:r.normalizeStyle({color:a.style.color})},r.toDisplayString(h),5)):r.createCommentVNode("",!0),x!=0?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["mark-line",{"long-mark":x%5===0}]),style:r.normalizeStyle({background:a.style.color})},null,6)):r.createCommentVNode("",!0)],4))),128))],4)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"chart-bottom",style:r.normalizeStyle({height:`${m.ywvalue}px`,background:a.style.fillColor})},[a.style.valuevisible||a.style.valuevisible==1?(r.openBlock(),r.createElementBlock("span",{key:0,class:"value-text",style:r.normalizeStyle(m.getFontStyle)},r.toDisplayString(a.style.text),5)):r.createCommentVNode("",!0)],4)])}const ht=q(mt,[["render",ft],["__scopeId","data-v-b14d49d0"]]),yt={name:"VerticalRuler",props:{style:{type:Object,default:()=>({max:100,min:0,scales:10,value:0,layout:{height:400}})}},methods:{getNumber(t){if(typeof t=="number")return t;const e=parseFloat(t);return isNaN(e)?0:e},convertToStyleString(t){if(!t)return"";let e={};for(const a in t){if(!Object.hasOwn(t,a))continue;const s=t[a],o=a.replace(/([A-Z])/g,"-$1").toLowerCase();let m=s;o==="gap"&&(m=`${s}px`),(o==="fontSize"||o==="font-size")&&(m=`${s}px`),e[o]=m}return e}},computed:{getFontStyle(){let t=this,e=t.style,s={color:e.color,...e.valuefont};return t.convertToStyleString(s)},getScalesFontStyle(){let t=this,e=t.style,s={color:e.color,...e.scalefont};return t.convertToStyleString(s)},ywvalue(){const t=this,e=t.getNumber(t.style.value),a=t.getNumber(t.style.max),s=t.getNumber(t.style.min),o=t.getNumber(t.style.layout.width),m=Math.max(s,Math.min(e,a)),h=a-s;return h<=0?0:(m-s)/h*o},scaleInterval(){const t=this,e=t.getNumber(t.style.max),a=t.getNumber(t.style.min),s=t.getNumber(t.style.layout.width),o=Math.floor((e-a)/t.style.scales)+1;return o>1?s/(o-1):0},scaleValues(){const t=this,e=t.getNumber(t.style.max),a=t.getNumber(t.style.min),s=t.getNumber(t.style.scales)||10,o=[];for(let m=a;m<e;m+=s)o.push(m.toFixed(0));return o}}},bt={class:"ruler-h-container"};function xt(t,e,a,s,o,m){return r.openBlock(),r.createElementBlock("div",bt,[a.style.scalevisible||a.style.scalevisible==1?(r.openBlock(),r.createElementBlock("div",{key:0,class:"h-ruler",style:r.normalizeStyle(m.getScalesFontStyle)},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.scaleValues,(h,x)=>(r.openBlock(),r.createElementBlock("div",{key:x,class:"scale-h-mark",style:r.normalizeStyle({left:`${x*m.scaleInterval}px`})},[x!=0?(r.openBlock(),r.createElementBlock("span",{key:0,class:"mark-h-value",style:r.normalizeStyle({color:a.style.color})},r.toDisplayString(h),5)):r.createCommentVNode("",!0),x!=0?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["mark-h-line",{"long-h-mark":x%5===0}]),style:r.normalizeStyle({background:a.style.color})},null,6)):r.createCommentVNode("",!0)],4))),128))],4)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"chart-h-bottom",style:r.normalizeStyle({width:`${m.ywvalue}px`,background:a.style.fillColor})},[a.style.valuevisible||a.style.valuevisible==1?(r.openBlock(),r.createElementBlock("span",{key:0,class:"value-h-text",style:r.normalizeStyle(m.getFontStyle)},r.toDisplayString(a.style.text),5)):r.createCommentVNode("",!0)],4)])}const vt={name:"VerticalRuler",components:{indexV:ht,indexH:q(yt,[["render",xt],["__scopeId","data-v-7f6aaa3d"]])},props:{style:{type:Object,default:()=>({})}},methods:{},computed:{getStyle(){let t=this.style;return t.borderColor=t.color||"#333333",t}}};function kt(t,e,a,s,o,m){const h=r.resolveComponent("index-v"),x=r.resolveComponent("index-h");return r.openBlock(),r.createElementBlock("div",{class:"chart-container",style:r.normalizeStyle(m.getStyle)},[a.style.orientation=="vertical"?(r.openBlock(),r.createBlock(h,{key:0,style:r.normalizeStyle(a.style)},null,8,["style"])):(r.openBlock(),r.createBlock(x,{key:1,style:r.normalizeStyle(a.style)},null,8,["style"]))],4)}const wt=q(vt,[["render",kt],["__scopeId","data-v-5f295dcb"]]),Ct={name:"VueSwitch",props:{modelValue:{type:Boolean,default:!1},style:{type:Object,default:()=>({})},size:{type:String,default:"default",validator:function(t){return["small","default","large"].includes(t)}},color:{type:String,default:"default",validator:function(t){return["default","primary","success","warning","danger","purple"].includes(t)}},withIcons:{type:Boolean,default:!1},withLabels:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],computed:{switchClasses(){return[`switch-${this.size}`,`switch-${this.color}`,{"switch-with-icons":this.withIcons,"switch-with-labels":this.withLabels,"switch-disabled":this.disabled}]}}},St=["checked","disabled"],At=["src"],Et={key:2,style:{"z-index":"0"}},zt={key:3};function Bt(t,e,a,s,o,m){return r.openBlock(),r.createElementBlock("label",{class:r.normalizeClass(["switch-jd",m.switchClasses])},[r.createElementVNode("input",{type:"checkbox",class:"switch-input",checked:a.modelValue,onChange:e[0]||(e[0]=h=>t.$emit("update:modelValue",h.target.checked)),disabled:a.disabled},null,40,St),r.createElementVNode("span",{class:"switch-jd-slider",style:r.normalizeStyle(a.style)},[a.style.isIcon&&!a.style.imgUrl?(r.openBlock(),r.createElementBlock("i",{key:0,class:r.normalizeClass(["iconfont",a.style.iconName])},null,2)):r.createCommentVNode("",!0),a.style.imgUrl?(r.openBlock(),r.createElementBlock("img",{key:1,src:a.style.imgUrl,style:{"z-index":"0"},alt:" "},null,8,At)):r.createCommentVNode("",!0),a.style.text?(r.openBlock(),r.createElementBlock("span",Et,r.toDisplayString(a.style.text),1)):r.createCommentVNode("",!0),!a.style.imgUrl&&!a.style.text?(r.openBlock(),r.createElementBlock("span",zt)):r.createCommentVNode("",!0)],4)],2)}const Dt=q(Ct,[["render",Bt],["__scopeId","data-v-3233cdae"]]),Tt={name:"VueSwitch",props:{style:{type:Object,default:()=>({})},modelValue:{type:Boolean,default:!0},size:{type:String,default:"default",validator:function(t){return["small","default","large"].includes(t)}},color:{type:String,default:"default",validator:function(t){return["default","primary","success","warning","danger","purple"].includes(t)}},withIcons:{type:Boolean,default:!1},withLabels:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],methods:{convertToStyleString(t){if(!t)return"";let e={};for(const a in t){if(!Object.hasOwn(t,a))continue;const s=t[a],o=a.replace(/([A-Z])/g,"-$1").toLowerCase();let m=s;o==="gap"&&(m=`${s}px`),(o==="fontSize"||o==="font-size")&&(m=`${s}px`),e[o]=m}return e}},computed:{getActiveStyle(){let t={};return t={background:this.style.background},t},switchClasses(){return[`switch-${this.size}`,`switch-${this.color}`,{"switch-with-icons":this.withIcons,"switch-with-labels":this.withLabels,"switch-disabled":this.disabled}]}}},Nt=["checked","disabled"];function It(t,e,a,s,o,m){return r.openBlock(),r.createElementBlock("label",{class:r.normalizeClass(["switch",m.switchClasses])},[r.createElementVNode("input",{type:"checkbox",class:"switch-input",checked:a.modelValue,onChange:e[0]||(e[0]=h=>t.$emit("update:modelValue",h.target.checked)),disabled:a.disabled},null,40,Nt),r.createElementVNode("span",{class:"switch-slider",style:r.normalizeStyle({background:a.style.background})},null,4)],2)}const Pt=q(Tt,[["render",It],["__scopeId","data-v-41ace2e4"]]),Lt=["src"],Ut={key:2,style:{"z-index":"0"}},Mt={key:3},Ot={__name:"switch",props:{style:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1}},setup(t){const e=t,a=r.ref(e.style.realValue==="true");return(s,o)=>t.style.btntype=="none"?(r.openBlock(),r.createElementBlock("div",{key:0,class:"switch-none",style:r.normalizeStyle(t.style)},[e.style.isIcon&&!e.style.imgUrl?(r.openBlock(),r.createElementBlock("i",{key:0,class:r.normalizeClass(["iconfont",e.style.iconName])},null,2)):r.createCommentVNode("",!0),e.style.imgUrl?(r.openBlock(),r.createElementBlock("img",{key:1,src:e.style.imgUrl,style:{"z-index":"0"},alt:" "},null,8,Lt)):r.createCommentVNode("",!0),e.style.text?(r.openBlock(),r.createElementBlock("span",Ut,r.toDisplayString(e.style.text),1)):r.createCommentVNode("",!0),!e.style.imgUrl&&!e.style.text?(r.openBlock(),r.createElementBlock("span",Mt)):r.createCommentVNode("",!0)],4)):t.style.btntype=="sq"?(r.openBlock(),r.createBlock(Pt,{key:1,modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=m=>a.value=m),style:r.normalizeStyle(t.style),disabled:t.disabled},null,8,["modelValue","style","disabled"])):(r.openBlock(),r.createBlock(Dt,{key:2,modelValue:a.value,"onUpdate:modelValue":o[1]||(o[1]=m=>a.value=m),style:r.normalizeStyle(t.style),disabled:t.disabled},null,8,["modelValue","style","disabled"]))}},Vt=q({__name:"circle",props:{style:{type:Object,default:()=>({})}},setup(t){const e=t,a=r.computed(()=>{let s=e.style.layout||{};return{width:s.width+"px",height:s.height+"px",borderWidth:(e.style.borderValue||1)+"px",padding:(e.style.borderValue||1)+"px",borderColor:e.style.stroke||"#000000",backgroundColor:e.style.background||"#D1E7FF"}});return(s,o)=>(r.openBlock(),r.createElementBlock("div",{class:"gr-circle",style:r.normalizeStyle(a.value)},[r.createElementVNode("div",{class:"gr-circle-text",style:r.normalizeStyle({color:e.style.stroke||"#000000"})},r.toDisplayString(e.style.text),5)],4))}},[["__scopeId","data-v-fa22a4c3"]]),Ft=q({__name:"rectangle",props:{style:{type:Object,default:()=>({})}},setup(t){const e=t,a=r.computed(()=>{let s=e.style.layout||{};return{width:s.width+"px",height:s.height+"px",borderWidth:(e.style.borderValue||1)+"px",padding:(e.style.borderValue||1)+"px",borderColor:e.style.stroke||"#000000",backgroundColor:e.style.background||"#D1E7FF"}});return(s,o)=>(r.openBlock(),r.createElementBlock("div",{class:"gr-rectangle",style:r.normalizeStyle(a.value)},[r.createElementVNode("div",{class:"gr-rectangle-text",style:r.normalizeStyle({color:e.style.stroke||"#000000"})},r.toDisplayString(e.style.text),5)],4))}},[["__scopeId","data-v-98efe4a0"]]),Rt=["innerHTML"],Wt=q({__name:"triangle",props:{style:{type:Object,default:()=>({})}},setup(t){const e=t,a=r.computed(()=>{let s=e.style.layout||{},{x:o,y:m,width:h,height:x}=s,S=e.style.borderValue/2,b=`${o+h/2},${m+S}`,y=`${o+S},${m+x-S}`,C=`${o+h-S},${m+x-S}`;return`
|
|
14
14
|
<svg width="${h}" height="${x}" xmlns="http://www.w3.org/2000/svg" viewBox="${o} ${m} ${h} ${x}">
|
|
15
15
|
<polygon points="${b} ${y} ${C}" fill="${e.style.fillColor||"#D1E7FF"}" stroke="${e.style.stroke||"#000000"}" stroke-width="${e.style.borderValue||1}"/>
|
|
16
16
|
<foreignObject x="${o}" y="${m}" width="100%" height="100%">
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
</div>
|
|
24
24
|
</foreignObject>
|
|
25
25
|
</svg>
|
|
26
|
-
`});return(s,o)=>(r.openBlock(),r.createElementBlock("div",{class:"gr-triangle",innerHTML:a.value},null,8,Rt))}},[["__scopeId","data-v-25fd969b"]]),jt=(t,e,a)=>{const s=document.createDocumentFragment();let m=Ht({},e.data);e.style.background==="transparent"&&delete e.style.background,e.style.color==="transparent"&&delete e.style.color,e.style={...e.style,...m};let h="";if(t=="btn")h=he,e.style.btntype=="none"&&(delete e.style.background,delete e.style["background-image"]),e.style.isIcon=!1;else if(t=="bar")h=wt;else if(t=="iconbtn")h=he,e.style.btntype=="none"&&(delete e.style.background,delete e.style["background-image"]),e.style.isIcon=!0,e.style.iconName=a;else if(t=="switch"){h=Ot,e.style.btntype=="none"&&(delete e.style.background,delete e.style["background-image"]);let y=e.data;if(y.children){let D=y.children.find(z=>z.key==="text");e.style.realValue=D.realValue,e.style.path=D.animate.value}}else t=="schedule"?(e.id=e.timeId+"",h=e.comp):t=="circle"?h=Vt:t=="rectangle"?h=Ft:t=="triangle"?h=Wt:h=he;const x={setup(){var y=()=>r.h(h,{...e,onClick:function(C){}});return y}};let S=r.createApp(x);return S.use(Oe),S.use(Ve),S.mount(s).$el.outerHTML};function Ht(t,e){if(!e.children)return"";let s=e.children.filter(o=>o.animate&&(o.animate.isShow||o.animate.isShow==1));return s&&s.length>0&&s.forEach(o=>{if(o.key==="background"||o.key==="color"||o.key==="image"){let m=o.animate.data,h=o.animate.mpType,x=null;if(h==="NumericToSimple"){let S=m.find(b=>Gt(o,b.min,b.max));S?x=S:o.key==="image"?x={value:o.animate.default,valueUrl:o.animate.defaultVal}:x={value:o.animate.default}}else h==="BooleanToSimple"&&(x=m.find(S=>S.key===o.value));x&&(t[o.key]=x.value,o.key==="image"&&(t.imgUrl=`${x.valueUrl}`))}else t[o.key]=o.value}),t}function Gt(t,e,a){let s=t.value,o=_t(s);return o>=e&&o<=a}function _t(t){const a=String(t).match(/\d+/);return a?Number(a[0]):null}function Yt(t){let e=this;e.initShapes=function(){function a(){mxActor.call(this)}mxUtils.extend(a,mxActor),a.prototype.arrowWidth=.3,a.prototype.arrowSize=.2,a.prototype.redrawPath=function(o,m,h,x,S){var b=S*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),y=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize)))),C=(S-b)/2,D=C+b,z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(o,[new mxPoint(0,C),new mxPoint(x-y,C),new mxPoint(x-y,0),new mxPoint(x,S/2),new mxPoint(x-y,S),new mxPoint(x-y,D),new mxPoint(0,D)],this.isRounded,z,!0),o.end()},mxCellRenderer.registerShape("singleArrow",a);function s(){mxActor.call(this)}mxUtils.extend(s,mxActor),s.prototype.redrawPath=function(o,m,h,x,S){var b=S*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",a.prototype.arrowWidth)))),y=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",a.prototype.arrowSize)))),C=(S-b)/2,D=C+b,z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(o,[new mxPoint(0,S/2),new mxPoint(y,0),new mxPoint(y,C),new mxPoint(x-y,C),new mxPoint(x-y,0),new mxPoint(x,S/2),new mxPoint(x-y,S),new mxPoint(x-y,D),new mxPoint(y,D),new mxPoint(y,S)],this.isRounded,z,!0),o.end()},mxCellRenderer.registerShape("doubleArrow",s)}}function ze(t){let e=this;e.editor=null,e.parent=null,e.graph=null,e.undoMng=null,e.preview=!0,e.pageShortcuts=!1,e.firstFlag=!0,e.container=null,e.keyUpdownEvt=null,e.vueInstances=new Map,e.setPageShortcuts=l=>{e.pageShortcuts=l},e.clearCanvas=()=>{let l=e.graph;const n=l.getChildCells(l.getDefaultParent());if(n.length>0){l.getModel().beginUpdate();try{l.removeCells(n)}finally{l.getModel().endUpdate()}}};function a(l,n){return[...l.parentNode.children].filter(c=>c!==l&&c.classList.contains(n))}e.isPreview=l=>{let n=e.graph;n.setCellsResizable(l),n.setCellsEditable(l),n.setCellsSelectable(l),n.setHtmlLabels(!0),n.setCellsMovable(l),n.setPanning(!l),e.preview=!l,e.changePageSize(),e.preview?e.keyUpdownEvt&&e.keyUpdownEvt.removeListener(n):e.keyUpdownEvt=new Ee(t);let c=a(n.container,"transparentRect");if(e.preview){if(c&&c.length>0)for(let u=0;u<c.length;u++){let d=c[u];d&&(d.classList.remove("is-hidden"),d.classList.add("is-block"))}}else if(c&&c.length>0)for(let u=0;u<c.length;u++){let d=c[u];d&&(d.classList.remove("is-block"),d.classList.add("is-hidden"))}if(e.preview&&n.clearSelection(),e.preview){const u=n.container.querySelectorAll(".bg-light");if(u)for(let d=0;d<u.length;d++)u[d].classList.replace("bg-light","main-text")}else{const u=n.container.querySelectorAll(".main-text");if(u)for(let d=0;d<u.length;d++)u[d].classList.replace("main-text","bg-light")}if(e.preview){const u=n.container.querySelectorAll(".bg-creat-comp");if(u)for(let d=0;d<u.length;d++){const i=u[d];i&&i.classList.add("svg-preview-gr")}}else{const u=n.container.querySelectorAll(".svg-preview-gr");if(u)for(let d=0;d<u.length;d++){const i=u[d];i&&i.classList.remove("svg-preview-gr")}}n.view.validate(),n.view.refresh(),e.preview},e.init=l=>{let{container:n}=l;return new Promise((c,u)=>{let d=new mxEditor,i=d.graph;n.setAttribute("tabindex","0"),n.style.outline="none",n.style.width="100%",n.style.height="100%",d.setGraphContainer(n),e.container=n,e.editor=d,Ze(d),mxEvent.disableContextMenu(n);const p=i.getStylesheet().getDefaultVertexStyle();Object.assign(p,{fillColor:"transparent",strokeColor:"transparent",strokeWidth:0,fontColor:"#333333",fontSize:12}),i.setConnectable(!1),i.setEnabled(!0),i.setPanning(!1),i.resizeContainer=!1,i.scrollbars=!1,i.setHtmlLabels(!0),i.setCellsResizable(!0),i.connectionHandler.setCreateTarget(!1),i.setDropEnabled(!1),i.setCellsDeletable(!0),i.setTooltips(!1),i.setMultigraph(!1),new mxRubberband(i),i.setAllowDanglingEdges(!1),i.setCellsEditable(!0),i.setCellsSelectable(!0),i.setCellsMovable(!0),i.setEdgeLabelsMovable(!1),i.setGridEnabled(!1),i.setGridEnabled(!1),i.gridEnabled=!0,i.gridSize=10,i.centerZoom=!1,e.changeRotationHandleStyle(i),i.snapTolerance=10,i.isCellEditable=function(w){return!1},i.isCellMovable=function(w){return w.type==="kitUI:CanvasWidget"?!1:w.isVertex()||w.isEdge()},i.isCellResizable=function(w){return w.type==="kitUI:CanvasWidget"?!1:w.isVertex()||w.isEdge()},i.isCellDeletable=function(w){return w.type==="kitUI:CanvasWidget"?!1:w.isVertex()||w.isEdge()},i.isCellSelectable=function(w){return w&&w.type==="kitUI:CanvasWidget"?!1:mxGraph.prototype.isCellSelectable.apply(this,arguments)},i.setResizeContainer(!1),i.autoExtend=!1,i.setAutoSizeCells(!1),i.swimlaneSelectionEnabled=!1;let f=new mxUndoManager;da(i,f),e.undoMng=f,z(i),sa(i),Ie(i),ua(i,n),ma(t.menus,i),ca(i),e.graph=i,h(i),i.autoSize=!1,i.model.validateGraph=!1,i.model.validateEdge=()=>!0,i.model.validateNode=()=>!0,i.removeListener(i.listeners),i.view.animate=!1,e.clearUndo(),new Yt().initShapes(),y(),mxConstants.INVALID_COLOR="transparent",mxConstants.DEFAULT_INVALID_COLOR="transparent",mxConstants.INVALID_CONNECT_TARGET_COLOR="transparent",e.keyUpdownEvt=new Ee(t),mxWindow.prototype.closeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAw0lEQVR4AZyS3RHCIBCEEyuxFO1E36EGsQZ419LsBHd3IHP8jTNmWH4u+x0HyWn78xEYY3xQv3LQk1J60SeQEyjwBcZpK0DIOX9oEOi9f2IRqBlMCMBt3/d38W4CAWwlMMAWcs7d6aUOkIseXkH0NiADFq7l2Z3ooQaQQZzlzJECrMvg3GoAbXkwDmdGTK0BLcTybNn9bR9gDyktuhUskNlwFn0n7gR/02awQLguUJhBiKtVuF6cQASvEP8emVYdPTX5FwAA//+rmaLTAAAABklEQVQDAD/igh3e/xFHAAAAAElFTkSuQmCC ",mxWindow.prototype.normalizeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAwElEQVR4AcRSwRHCIBAUKkknQidaALSgtgD8tRNIJ1YC7mYSRhgn5Gfmdg7udnNwhzytn/deASWE8FxD1THGHKC2YBVugaNe8i8EBGdg10opE7kEK0awiTv8rgkheA1yI4UJ7Iqc84x9Y6j0RqByuJbGGP0Na+0LicaQfwANjxUb0tHNH4Robexw64/rnLt0nKWrfA0VaPnUC6WUnHHlIK94R42FRsuv8CPjrBc+x5HQ6oRKnNVIOJNLsOKI/DP/AQAA///YhGxbAAAABklEQVQDANQlZDV28KsrAAAAAElFTkSuQmCC",mxWindow.prototype.minimizeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAwElEQVR4AcRSwRHCIBAUKkknQidaALSgtgD8tRNIJ1YC7mYSRhgn5Gfmdg7udnNwhzytn/deASWE8FxD1THGHKC2YBVugaNe8i8EBGdg10opE7kEK0awiTv8rgkheA1yI4UJ7Iqc84x9Y6j0RqByuJbGGP0Na+0LicaQfwANjxUb0tHNH4Robexw64/rnLt0nKWrfA0VaPnUC6WUnHHlIK94R42FRsuv8CPjrBc+x5HQ6oRKnNVIOJNLsOKI/DP/AQAA///YhGxbAAAABklEQVQDANQlZDV28KsrAAAAAElFTkSuQmCC",mxWindow.prototype.maximizeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAArklEQVR4AcSSUQrDIBBEG/Eg7U1yIT88QZoT+OGFepP2IEI6b4mwlkD6UWjwmc3MjgomXPSUUq4eScPwHjVmoIgxPj0YHu9Rk7Ed96aH3vcdvYbRdXrMGIIppRXMcRMaSDoMSv9+hJzzS6tNYj2L0SMmMv6oZ7nB/0OQO6m1bmIZznLwQY/YyPzkqLNWW+BzMzSQPgsbfkfE/oeY6aau02OyBVtrN485bvIeNff4BgAA//8HoCv8AAAABklEQVQDAFXqZFJqMF/zAAAAAElFTkSuQmCC",mxWindow.prototype.resizeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAtklEQVR4AZSS0Q2EIBBEF0MhVwqdnP5DEVZAAvyfnXidaCfcrBcTQFQkIWQ387I7Ezp6eEIIH+fc8gj03s8xxl4IMTWDDBGRYsgYMzaBKaS1HgjnFiwha+0LHvtLsIRQKynlgnXfpyBEMzbaPPF6qBVqDmfFW/cI0SmEaQPC+R4mtkCYSBnYAh0+QAvEmuwDcAPjq0HsnlINPI5d2ijTq0GswZC/RwimvcFNrLOit6XHNV/UmeYHAAD//4CpKLcAAAAGSURBVAMAuzSnSig8bRkAAAAASUVORK5CYII=";const A=i.getView().setTranslate;i.getView().setTranslate=function(w,E){const N=Math.max(0,Math.min(3e3,w)),M=Math.max(0,Math.min(3e3,E));A.call(this,N,M)},i.addListener(mxEvent.PAN,function(){const w=i.getView().getTranslate();let E=Math.min(0,w.x),N=Math.min(0,w.y);(E!==w.x||N!==w.y)&&i.getView().setTranslate(E,N)}),mxGraph.prototype.setCellStyles=function(w,E,N,M){N=N||this.getSelectionCells(),mxUtils.setCellStyles(this.model,N,w,E,M)},mxUtils.setCellStyles=function(w,E,N,M,O){if(E!=null&&E.length>0)if(e.firstStyle){w.beginUpdate();try{for(var U=0;U<E.length;U++)if(E[U]!=null)for(let W in O){var L=mxUtils.setStyle(w.getStyle(E[U]),W,O[W]);w.setStyle(E[U],L)}}finally{w.endUpdate()}}else{for(var U=0;U<E.length;U++)if(E[U]!=null)for(let V in O){var L=mxUtils.setStyle(w.getStyle(E[U]),V,O[V]);w.setStyle(E[U],L)}e.firstStyle=!1}},i.view.scaleGrid=!0,i.view.roundPoints=!0,mxSvgCanvas2D.prototype.updateTextNodes=function(w,E,N,M,O,U,L,V,W,R,Y){var G=this.state.scale;mxSvgCanvas2D.createCss(N+2,M,O,U,L,V,W,this.state.fontBackgroundColor!=null?this.state.fontBackgroundColor:null,this.state.fontBorderColor!=null?this.state.fontBorderColor:null,"display: flex; align-items: unsafe "+(U==mxConstants.ALIGN_TOP?"flex-start":U==mxConstants.ALIGN_BOTTOM?"flex-end":"center")+"; justify-content: unsafe "+(O==mxConstants.ALIGN_LEFT?"flex-start":O==mxConstants.ALIGN_RIGHT?"flex-end":"center")+"; ",this.getTextCss(),G,mxUtils.bind(this,function($,te,_,ie,Q){w+=this.state.dx,E+=this.state.dy;var ce=Y.firstChild,Pe=ce.firstChild,Ue=Pe.firstChild,ga=Ue.firstChild,Le=(this.rotateHtml?this.state.rotation:0)+(R??0),ye=(this.foOffset!=0?"translate("+this.foOffset+" "+this.foOffset+")":"")+(G!=1?"scale("+G+")":"");ga.setAttribute("style",Q),Ue.setAttribute("style",ie),ce.setAttribute("width",Math.ceil(1/Math.min(1,G)*100)+"%"),ce.setAttribute("height",Math.ceil(1/Math.min(1,G)*100)+"%");let ue=Math.round(E+te),fa=Math.round(w+$),ha=s(ue),ya=s(fa);if(ue<0)ce.setAttribute("y",ue);else{ce.removeAttribute("y");let Me=ue;ya||ha||(Me=ue-.5),_+="padding-top: "+Me+"px; "}_=_.replace("width: 1px","width: 0px"),_=_.replace("height: 1px","height: 0px");let ba=w+$;Pe.setAttribute("style",_+"margin-left: "+Math.round(ba)+"px;"),ye+=Le!=0?"rotate("+Le+" "+w+" "+E+")":"",ye!=""?Y.setAttribute("transform",ye):Y.removeAttribute("transform"),this.state.alpha!=1?Y.setAttribute("opacity",this.state.alpha):Y.removeAttribute("opacity")}))},i.fit(),o(),c(i)})};function s(l){let n=!0;return l%2===0?n=!0:n=!1,n}function o(l){mxVertexHandler.prototype.getHandleForEvent=function(n){let c=n.getEvent(),u=["nw-resize","n-resize","ne-resize","w-resize","e-resize","sw-resize","s-resize","se-resize"];var d=c.target||c.srcElement,i=window.getComputedStyle(d).cursor;if(u.indexOf(i)!=-1){var g=mxEvent.isMouseEvent(n.getEvent())?1:this.tolerance,p=this.allowHandleBoundsCheck&&(mxClient.IS_IE||g>0)?new mxRectangle(n.getGraphX()-g,n.getGraphY()-g,2*g,2*g):null,f=mxUtils.bind(this,function(A){var w=A!=null&&A.constructor!=mxImageShape&&this.allowHandleBoundsCheck?A.strokewidth+A.svgStrokeTolerance:null,E=w!=null?new mxRectangle(n.getGraphX()-Math.floor(w/2),n.getGraphY()-Math.floor(w/2),w,w):p;return A!=null&&(n.isSource(A)||E!=null&&mxUtils.intersects(A.bounds,E)&&A.node.style.display!="none"&&A.node.style.visibility!="hidden")});if(f(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(f(this.labelShape))return mxEvent.LABEL_HANDLE;if(this.sizers!=null){for(var v=0;v<this.sizers.length;v++)if(f(this.sizers[v]))return v}if(this.customHandles!=null&&this.isCustomHandleEvent(n)){for(var v=this.customHandles.length-1;v>=0;v--)if(f(this.customHandles[v].shape))return mxEvent.CUSTOM_HANDLE-v}}return null}}e.keyUpdownEvent=l=>{let n=e.graph,c=e.undoMng;e.keyUpdownEvt.keyUpdown(n,c,function(d){(d==="undo"||d==="redo")&&e.changePageSize()})},e.removeKeyUpDown=()=>{let l=e.graph;e.keyUpdownEvt.removeListener(l)};function m(l){return new Promise((n,c)=>{let u=new Image;u.src=`${l}`,u.onload=async function(){let d=u.width,i=u.height;n({w:d,h:i})}})}e.scheduleBorder=l=>{let n={};if(l.border){let u=l.border.split(",");u.length==1?u.forEach((d,i)=>{let g=d.split(" "),p="";n["border"+p+"Width"]=g[0],n["border"+p+"Style"]=g[1],n["border"+p+"Color"]=g[2]}):u.forEach((d,i)=>{let g=d.split(" "),p="Top";i==0?p="Top":i==1?p="Right":i==2?p="Bottom":i==3&&(p="Left"),n["border"+p+"Width"]=g[0],n["border"+p+"Style"]=g[1],n["border"+p+"Color"]=g[2]})}return n};function h(l){l.convertValueToString=function(n){let{width:c,height:u,x:d,y:i}=n.geometry;if(n.type=="vertex")return x(n);if(n.type=="kitUI:CanvasWidget"){let p=n.value.style,f=document.createElement("div");f.style.width=c+"px",f.style.height=u+"px",f.className="bgss-light";let v=l.container.querySelector("canvas");return v&&(p["background-image"]?v.style.background=`${p["background-image"]}center center no-repeat`:v.style.background="transparent"),f}else if(n.type=="img"){let p=document.createElement("div"),f=n.value.style,v="";if(f.scale=="fitRatio"?(p.style.display="flex",p.style.alignItems="center",p.style.justifyContent="center",p.style.flexDirection="column",m(f.imgUrl||n.imgUrl).then(A=>{A&&(p.style.aspectRatio=A.w/A.h)}),v="img-vr-fit-ratio"):f.scale=="fit"&&(p.style.display="flex",p.style.alignItems="center",p.style.justifyContent="center",v="img-vr-fit"),p.innerHTML=D({img:f.imgUrl||n.imgUrl}),p.style.width=c+"px",p.style.height=u+"px",p.innerHTML+='<div class="svg-edit-gr"></div>',e.preview){n.hyperlink="",n.popup="",p.className="bg-light svg-preview-gr "+v;let{url:A,pup:w}=de(n);A?(p.style.cursor="pointer",n.hyperlink=A):p.style.cursor="default",w&&w.length>0?(p.style.cursor="pointer",n.popup=w):p.style.cursor="default"}else p.className="bg-light "+v;return p}else if(n.crtype=="creatComp"){C(n);let p=document.createElement("div");if(p.innerHTML=jt(n.cmp,n.value,n.iconName),p.style.width=c+"px",p.style.height=u+"px",p.innerHTML+='<div class="svg-edit-gr"></div>',e.preview){n.hyperlink="",n.popup="",p.className="bg-creat-comp svg-preview-gr";let{url:f,pup:v}=de(n);f?(p.style.cursor="pointer",n.hyperlink=f):p.style.cursor="default",v&&v.length>0?(p.style.cursor="pointer",n.popup=v):p.style.cursor="default"}else p.className="bg-creat-comp";return p}else if(n.crtype=="schedule"){let p=n.value.style;C(n);let f=document.createElement("div"),{el:v}=n.other||{};f.innerHTML=v.outerHTML;let A=document.getElementById(n.id);if(A){var g=l.view.getState(n);A.style.position="absolute",A.style.width=g.width+"px",A.style.height=g.height+"px",A.style.left=g.x+"px",A.style.top=g.y+"px",e.preview||(f.innerHTML=A.innerHTML)}return f.style=T(p,[]),f.style.width=c+"px",f.style.height=u+"px",f.innerHTML+='<div class="svg-edit-gr"></div>',e.preview?f.className="bg-creat-comp svg-preview-gr":f.className="bg-creat-comp",f}else if(n.type=="rect"){let p=n.value.style,f=n.value.data,A=(f.children||[]).find(O=>O.key==="perimeter");A&&(p.background.indexOf("/files")>-1&&(p.background=""),Number(p.borderValue)===0&&(p.stroke="transparent"),n.style=A.value+`fillColor=${p.background||"transparent"};strokeColor=${p.stroke||"#333333"};strokeWidth=${p.borderValue||0}`);let w={},E=f.children;E&&(w=E.find(O=>O.key==="text"));let N=document.createElement("div");N.innerHTML=D({text:w.value||p.text,style:k(p,["text-","font-","color"])}),N.style=T(p,["background","stroke","strokeWidth"]),N.style.width=c+"px",N.style.height=u+"px",N.className="";let M="";if(f.title==="ShapeTriangle"?M="triangle":f.title==="ShapeRect"?M="rectangle":f.title==="ShapeCircle"&&(M="circle"),e.preview){n.hyperlink="",n.popup="";let{url:O,pup:U}=de(n);O?(N.style.cursor="pointer",N.className="main-text hyperlink-btn custom-rect-p "+M,n.hyperlink=O):(N.style.cursor="default",N.className="main-text custom-rect-p "+M),U&&U.length>0?(n.popup=U,N.style.cursor="pointer"):N.style.cursor="default"}else N.className="bg-light custom-rect "+M;return N.innerHTML+='<div class="svg-edit-gr"></div>',N}else if(n.type=="edge"){if(e.firstFlag){l.getModel(),e.firstFlag=!1;try{let p=n.value.style,f=p.dashWidth||3,v=p.dashSpace||1;f&&v&&(p.dashPattern=`${f} ${v}`),setTimeout(()=>{p&&l.setCellStyles(null,null,[n],p)},1)}finally{}return n.value}return n.value}return n.value}}function x(l){let{width:n,height:c,x:u,y:d}=l.geometry;C(l);let i=l.value.style,g=l.value.data.children,p={};g&&(p=g.find(v=>v.key==="text"));let f=document.createElement("div");if(f.innerHTML=D({img:i.imgUrl||"",text:p.value||i.text}),f.style=P(i),f.style.width=n+"px",f.style.height=c+"px",f.style.linHeight=c+"px",f.className="bg-light",e.preview){l.hyperlink="",l.popup="";let{url:v,pup:A}=de(l);v?(f.style.cursor="pointer",f.className="main-text hyperlink-btn",l.hyperlink=v):(f.style.cursor="default",f.className="main-text"),A&&A.length>0?(f.style.cursor="pointer",l.popup=A):f.style.cursor="default"}else f.className="bg-light";return f.innerHTML+='<div class="svg-edit-gr"></div>',f}function S(l,n){const c=n.x-l.x,u=n.y-l.y;return Math.sqrt(c*c+u*u)}e.isDragging=!1,e.dragTerminal=null,e.startPos=null,e.dx=null,e.dy=null,e.ctrlKey=!1,e.moveEdgeCells=[];function b(l,n,c,u){return new Promise((d,i)=>{let g=l.getDefaultParent(),p=l.getModel();p.beginUpdate();try{var f=l.insertEdge(g,null,"",null,null,n.style),v=l.getCellGeometry(n);let w=v.getTerminalPoint(!0),E=v.getTerminalPoint(!1);var A=new mxGeometry;A.setTerminalPoint(new mxPoint(w.x+c,w.y+u),!0),A.setTerminalPoint(new mxPoint(E.x+c,E.y+u),!1),f.setGeometry(A),f.value=n.value,f.type=n.type,f.model="yes",f.type="edge",f.iconName=n.iconName,d(f)}finally{p.endUpdate()}})}function y(){let l=e.graph;l.addMouseListener({mouseDown:function(n,c){e.dx=null,e.dy=null,e.moveEdgeCells=l.getSelectionCells();let u=c.evt;if(e.ctrlKey=u.ctrlKey,e.ctrlKey){let i=l.getPointForEvent(u);e.startPos=i,c.consume()}let d=l.getSelectionCell();if(d&&d.isEdge()){let i=l.getPointForEvent(u),g=d.getGeometry(),p=g.getTerminalPoint(!0),f=g.getTerminalPoint(!1),v=S(i,p),A=S(i,f);v<15&&(e.isDragging=!0,e.dragTerminal=!0,e.startPos=i,c.consume()),A<15&&(e.isDragging=!0,e.dragTerminal=!1,e.startPos=i,c.consume())}c.consume()},mouseMove:function(n,c){let u=c.evt;if(e.ctrlKey=u.ctrlKey,e.ctrlKey){let d=l.getPointForEvent(u),i=d.x,g=d.y;e.dx=i,e.dy=g,c.consume()}else if(e.isDragging&&e.dragTerminal!==null){let d=l.getPointForEvent(u),i=d.x,g=d.y;e.dx=i,e.dy=g,c.consume()}c.consume()},mouseUp:function(n,c){let u=c.evt,d=l.getModel();d.beginUpdate();try{if(e.ctrlKey&&u.ctrlKey&&e.dx!==null&&e.dy!==null){let i=e.moveEdgeCells;if(i&&i.length>0){let g=[];for(let p=0;p<i.length;p++){let f=i[p];f&&f.isEdge()&&b(l,f,e.dx-e.startPos.x,e.dy-e.startPos.y).then(v=>{g.push(v)})}}c.consume()}else if(e.isDragging&&e.dragTerminal!==null&&e.dx!==null&&e.dy!==null){let i=l.getSelectionCell(),g=i.getGeometry();if(e.dragTerminal){let p=new mxPoint(e.dx,e.dy);g.setTerminalPoint(p,!0)}else{let p=new mxPoint(e.dx,e.dy);g.setTerminalPoint(p,!1)}l.refresh(i),setTimeout(()=>{e.isDragging=!1,e.dragTerminal=null,e.startPos=null},1),c.consume()}}finally{d.endUpdate()}c.consume()}})}const C=l=>{let{width:n,height:c,x:u,y:d}=l.geometry,i=l.value.style;if(i&&i.hasOwnProperty("layout")){let g=l.value.data,p={width:n,height:c,x:u,y:d},f=g.children;if(f&&f.length>0){let v=f.find(A=>A.key=="layout");v.value=p}i.layout=p}};function D(l){let{img:n,text:c,style:u}=l,d="";return n&&(d+=`<img src='${n}' style="z-index: 0;" alt=" " v-if='${n}'>`),c&&(u?d+=`<span style="z-index: 0;${u}">${c}</span>`:d+=`<span style="z-index: 0;">${c}</span>`),!n&&!c?"<span> </span>":d}function z(l){new lt().createGrid(l,e.parent,e.preview),l.gridEnabled=!0,l.gridSize=10}e.disableAll=l=>{e.graph.setEnabled(l)},e.redo=()=>{if(e.preview)return;let l=e.undoMng;e.canRedo()&&(l.redo(),e.changePageSize())},e.undo=()=>{if(e.preview)return;let l=e.undoMng;e.canUndo()&&(l.undo(),e.changePageSize())},e.canRedo=()=>e.undoMng.canRedo(),e.canUndo=()=>e.undoMng.canUndo(),e.clearUndo=()=>{let l=e.undoMng;l&&(l.clear(),l.indexOfNextAdd=0,l.history=[])},e.getPoint=l=>e.graph.getPointForEvent(l),e.getXml=l=>{l||(l=e.graph);let c=new mxCodec().encode(l.getModel());return mxUtils.getPrettyXml(c)};function B(l){let c=e.graph.getModel();c.beginUpdate();try{let u=mxUtils.parseXml(l),g=new mxCodec(u).decode(u.documentElement,c).cells;for(const p in g){let f=g[p];f.type=="kitUI:CanvasWidget"&&(f.style=f.value.style,e.parent=f)}}finally{c.endUpdate(),setTimeout(()=>{e.changePageSize(),e.undoMng&&e.clearUndo()},1)}}function k(l,n){if(!l)return"";let c={};for(const u in l)n.some(d=>u.startsWith(d))&&(c[u]=l[u]);return c&&Object.keys(c).length===0?"":Object.entries(c).filter(([u,d])=>d!=null&&d!==""&&!(typeof d=="object"&&Object.keys(d).length===0)).map(([u,d])=>{const i=u.replace(/([A-Z])/g,"-$1").toLowerCase();let g=d;return i==="gap"&&(g=`${d}px`),`${i}:${g}`}).join("; ")+";"}function T(l,n){if(!l)return"";let c={};for(const u in l)n.indexOf(u)===-1&&(c[u]=l[u]);return c&&Object.keys(c).length===0?"":Object.entries(c).filter(([u,d])=>d!=null&&d!==""&&!(typeof d=="object"&&Object.keys(d).length===0)).map(([u,d])=>{const i=u.replace(/([A-Z])/g,"-$1").toLowerCase();let g=d;return i==="gap"&&(g=`${d}px`),`${i}:${g}`}).join("; ")+";"}function P(l){return l?(l.border&&l.border.split(",").length===1&&["top","right","bottom","left"].forEach(u=>{delete l["border-"+u+"-width"],delete l["border-"+u+"-style"],delete l["border-"+u+"-color"]}),Object.entries(l).filter(([n,c])=>c!=null&&c!==""&&!(typeof c=="object"&&Object.keys(c).length===0)).map(([n,c])=>{const u=n.replace(/([A-Z])/g,"-$1").toLowerCase();let d=c;return u==="gap"&&(d=c.toString().indexOf("px")===-1?`${c}px`:c),`${u}: ${d}`}).join("; ")+";"):""}function F(l,n){return l?Object.entries(l).filter(([u,d])=>d!=null&&d!==""&&!(typeof d=="object"&&Object.keys(d).length===0)).map(([u,d])=>{let i=u;n||(i=u.replace(/([A-Z])/g,"-$1").toLowerCase());let g=d;return i==="gap"&&(g=`${d}px`),`${i}=${g}`}).join("; ")+";":""}function j(l){const c=String(l).match(/\d+/);return c?Number(c[0]):null}function H(l,n,c){let u=l.value,d=j(u);return n==="-inf"?d<=c:c==="+inf"?d>=n:d>=n&&d<=c}function I(l,n){if(!n.children)return"";let u=n.children.filter(d=>d.animate&&(d.animate.isShow||d.animate.isShow==1));return u&&u.length>0&&u.forEach(d=>{if(d.key==="background"||d.key==="color"||d.key==="image"){let i=d.animate.data,g=d.animate.mpType,p=null;if(g==="NumericToSimple"){let f=i.find(v=>H(d,v.min,v.max));f?p=f:d.key==="image"?p={value:d.animate.default,valueUrl:d.animate.defaultVal}:p={value:d.animate.default}}else g==="BooleanToSimple"&&(p=i.find(f=>f.key===d.realValue));p&&(l[d.key]=p.value,d.key==="image"&&(l.imgUrl=`${p.valueUrl}`))}}),l}e.batchUpdateCells=l=>{const n=e.graph,c=e.undoMng;let u=n.getModel();if(!c){u.beginUpdate();try{l.forEach(i=>{if(u.setValue(i,i.value),i.value.style){let g={};if(i.type==="rect"){const p=I(i.value.style,i.value.data);g=K(i,p)}else if(i.type==="edge"){const p=I(i.value.style,i.value.data);e.firstFlag=!0,g=Z(i,p)}else i.type==="kitUI:CanvasWidget"?(g=I(realStyle,i.value.data),e.changePageSize(realStyle)):g=I(i.value.style,i.value.data);u.setStyle(i,g)}})}finally{u.endUpdate()}n.refresh();return}const d=c.undoableEditHappened;try{c.undoableEditHappened=function(){},u.beginUpdate();try{l.forEach(i=>{if(u.setValue(i,i.value),i.value.style){let g={};if(i.type==="rect"){const p=I(i.value.style,i.value.data);g=K(i,p)}else if(i.type==="edge"){const p=I(i.value.style,i.value.data);e.firstFlag=!0,g=Z(i,p)}else i.type==="kitUI:CanvasWidget"?(g=I(realStyle,i.value.data),e.changePageSize(realStyle)):g=I(i.value.style,i.value.data);u.setStyle(i,g)}})}finally{u.endUpdate()}}finally{c.undoableEditHappened=d}},e.updateCell=(l,n)=>{let c=e.graph;const u=c.getModel();u.beginUpdate();try{let d=l.value.style;if(n&&n.layout&&Object.keys(n.layout).length>0){const g=n.layout;if(g){let p=l.geometry;p!=null&&(p=p.clone(),p.x=g.x,p.y=g.y,p.width=g.width,p.height=g.height,u.setGeometry(l,p))}}u.setValue(l,l.value);let i="";l.type==="rect"?i=K(l,n):l.type==="edge"?(e.firstFlag=!0,i=Z(l,n)):l.type==="kitUI:CanvasWidget"?(i=I(d,l.value.data),e.changePageSize(d)):i=I(d,l.value.data),Je(e.graph,l,i)}finally{u.endUpdate()}c.refresh()};function Z(l,n){let c=e.graph,u="",d=l.style||"";if(d){const g={...ee(d),...n};u=F(g,!0),l.value.style=g,l.setStyle(u),I(l.value.style,l.value.data),c.refresh(l)}return u}function K(l,n){let c="",u=l.style||"";if(u){let d=ee(u);d.shape=d.shape,d.perimeter=d.perimeter,n.background.indexOf("/files")>-1&&(n.background=""),Number(n.borderValue)===0&&(n.stroke="transparent"),c=`shape=${d.shape};perimeter=${d.perimeter};fillColor=${n.background||"#D1E7FF"};strokeColor=${n.stroke||"#000000"};strokeWidth=${n.borderValue||0}`,d.direction&&(c+=`;direction=${d.direction}`);const i={...d,...n};l.value.style=i,I(l.value.style,l.value.data)}return c}function ee(l){const n={};return l.split(";").filter(u=>u.trim()!=="").forEach(u=>{const[d,i]=u.split("=");d&&i!==void 0&&(n[d.trim()]=i.trim())}),n}function ne(l){e.addImgVertex(l)}e.addImgVertex=l=>{let n=e.graph;const c=n.getModel();let u=n.getDefaultParent(),d=[];c.beginUpdate();try{l.forEach(i=>{const{evt:g=null,data:p={},pt:f={x:50,y:50},w:v=48,h:A=48,style:w={},displayName:E="",imgUrl:N="",iconName:M="icon-Imagefile",realWh:O={}}=i;let U=f,L=e.graph;g&&(U=L.getPointForEvent(g));let V=L.insertVertex(u,null,i.show?i.name:"",U.x,U.y,v,A);V.type="img",V.model="yes",V.imgUrl=i.imgUrl,V.iconName=M,V.value={data:p,style:w,name:i?i.displayName:i.getAttribute("label"),realWh:O},d.push(V)}),n.setSelectionCells(d)}finally{c.endUpdate()}};function oe(l,n){const u=l.getStylesheet().getDefaultVertexStyle();Object.assign(u,{fillColor:"transparent",strokeColor:"transparent",strokeWidth:0,fontColor:"#333333",fontSize:12})}e.createAllVertex=(l,n)=>{l==="vertex"?ra(n):l==="custom"?se(n):l==="edge"?re(n):l==="img"&&ne(n)};function re(l){e.firstFlag=!0;const n=mxGraph.prototype.insertEdge;mxGraph.prototype.insertEdge=function(g,p,f,v,A,w){return w===null&&(w=""),n.apply(this,arguments)};let c=e.graph,u=c.getDefaultParent(),d=c.getModel(),i=[];d.beginUpdate();try{for(let g=0;g<l.length;g++){const p=l[g],{evt:f=null,data:v=null,pt:A={x:50,y:50},style:w,w:E=30,h:N=100,iconName:M="icon-general-icon"}=p;let O=A;f&&(O=c.getPointForEvent(f));let U=ae(),L=c.insertEdge(u,null,"",null,null,w.perimeter+`;strokeWidth=${w.strokeWidth||1};strokeColor=${w.strokeColor||"#333333"}`);L.id=U;let V=new mxGeometry,{startX:W,startY:R,endX:Y,endY:G}=Ne(O,E,N);V.setTerminalPoint(new mxPoint(W,R),!0),V.setTerminalPoint(new mxPoint(Y,G),!1),L.setGeometry(V),L.model="yes",L.type="edge",L.iconName=M,L.value={data:{...v},style:{...w}},c.setSelectionCell(L),c.fireEvent(new mxEventObject(mxEvent.SELECTION_CHANGED,{cells:[L]})),c.refresh(L),i.push(L),e.firstStyle=!0}c.setSelectionCells(i)}finally{d.endUpdate()}}function se(l){let n=e.graph,c=n.getModel(),u=[];c.beginUpdate();try{for(let d=0;d<l.length;d++){const i=l[d],{evt:g=null,data:p=null,pt:f={x:50,y:50},style:v,w:A=100,h:w=30,type:E,tmpType:N,codeType:M,iconName:O="icon-general-icon",realType:U}=i;let L=A,V=w,W=f;g&&(W=n.getPointForEvent(g)),v.layout&&(L=v.layout.width,V=v.layout.height);let R={width:L,height:V,x:W.x,y:W.y},Y=p.children;if(Y&&Y.length>0){let ie=Y.find(Q=>Q.key=="layout");ie.value=R}v.layout=R;let G=n.getDefaultParent();oe(n,null);let $=F(v),te=ae(),_=n.insertVertex(G,te,v.text||"",W.x,W.y,L,V,$);_.crtype="creatComp",_.cmp=N,_.codeType=M,_.type=E,_.realType=U,_.model="yes",_.name=v.text||"",_.iconName=O,_.style=$,_.value={data:p,style:v},n.fireEvent(new mxEventObject(mxEvent.SELECTION_CHANGED,{cells:[_]})),u.push(_)}n.setSelectionCells(u)}finally{c.endUpdate()}}function ra(l){let n=e.graph,c=n.getModel(),u=[];c.beginUpdate();try{for(let d=0;d<l.length;d++){const i=l[d],{evt:g=null,data:p=null,pt:f={x:50,y:50},style:v,w:A=100,h:w=20,iconName:E="iconfont icon-general-icon",realType:N,from:M}=i;let O=f;n||(n=e.graph),g&&(O=n.getPointForEvent(g));let U=n.getDefaultParent(),L=n.getModel(),V={width:A,height:w,x:O.x,y:O.y},W=p.children;if(W&&W.length>0){let $=W.find(te=>te.key=="layout");$.value=V}let R=F(v);v.gtype=="rect"&&(Number(v.borderValue)===0&&(v.stroke="transparent"),R=v.perimeter+`;fillColor=${v.background||"transparent"};strokeColor=${v.stroke||"#333333"};strokeWidth=${v.borderWidth||0}`);let Y=ae(),G=n.insertVertex(U,Y,v.text||"",O.x,O.y,A,w,R);v.gtype=="rect"?G.type="rect":G.type="vertex",G.model="yes",G.name=v.text||"",G.iconName=E,G.value={data:{...p},style:{...v}},G.from=M||"other",G.realType=N,G.style=R,u.push(G),n.fireEvent(new mxEventObject(mxEvent.SELECTION_CHANGED,{cells:[G]}))}n.setSelectionCells(u)}finally{c.endUpdate()}}e.addVertex=({graph:l,options:n={}})=>new Promise((c,u)=>{const{evt:d=null,data:i=null,pt:g={x:50,y:50},style:p,w:f=100,h:v=20,iconName:A="iconfont icon-general-icon",realType:w,from:E}=n;let N=g;l||(l=e.graph),d&&(N=l.getPointForEvent(d));let M=l.getDefaultParent(),O=l.getModel(),U={width:f,height:v,x:N.x,y:N.y},L=i.children;if(L&&L.length>0){let V=L.find(W=>W.key=="layout");V.value=U}O.beginUpdate();try{let V=F(p);p.gtype=="rect"&&(Number(p.borderValue)===0&&(p.stroke="transparent"),V=p.perimeter+`;fillColor=${p.background||"transparent"};strokeColor=${p.stroke||"#333333"};strokeWidth=${p.borderWidth||0}`);let W=ae(),R=l.insertVertex(M,W,p.text||"",N.x,N.y,f,v,V);p.gtype=="rect"?R.type="rect":R.type="vertex",R.model="yes",R.name=p.text||"",R.iconName=A,R.value={data:{...i},style:{...p}},R.from=E||"other",R.realType=w,R.style=V,l.setSelectionCell(R),l.fireEvent(new mxEventObject(mxEvent.SELECTION_CHANGED,{cells:[R]})),c(R)}finally{O.endUpdate()}});function Ne(l,n,c){const d=-10*Math.PI/180,i=Math.cos(d),g=Math.sin(d),p=c/2,f=n/2,A=[{x:-p,y:-f},{x:p,y:-f},{x:p,y:f},{x:-p,y:f}].map(N=>{const M=l.x+(N.x*i-N.y*g),O=l.y+(N.x*g+N.y*i);return{x:M.toFixed(0),y:O.toFixed(0)}}),w=A[3],E=A[1];return{startX:parseFloat(w.x),startY:parseFloat(w.y),endX:parseFloat(E.x),endY:parseFloat(E.y)}}e.addEdge=({graph:l,options:n={}})=>{e.firstFlag=!0;const c=mxGraph.prototype.insertEdge;return mxGraph.prototype.insertEdge=function(u,d,i,g,p,f){return f===null&&(f=""),c.apply(this,arguments)},new Promise((u,d)=>{const{evt:i=null,data:g=null,pt:p={x:50,y:50},style:f,w:v=30,h:A=100,iconName:w="icon-general-icon"}=n;let E=p;l||(l=e.graph),i&&(E=l.getPointForEvent(i));let N=l.getDefaultParent(),M=l.getModel();M.beginUpdate();try{let O=ae(),U=l.insertEdge(N,null,"",null,null,f.perimeter+`;strokeWidth=${f.strokeWidth||1};strokeColor=${f.strokeColor||"#333333"}`);U.id=O;let L=new mxGeometry,{startX:V,startY:W,endX:R,endY:Y}=Ne(E,v,A);L.setTerminalPoint(new mxPoint(V,W),!0),L.setTerminalPoint(new mxPoint(R,Y),!1),U.setGeometry(L),U.model="yes",U.type="edge",U.iconName=w,U.value={data:{...g},style:{...f}},l.setSelectionCell(U),l.fireEvent(new mxEventObject(mxEvent.SELECTION_CHANGED,{cells:[U]})),l.refresh(U),e.firstStyle=!0,u(U)}finally{M.endUpdate()}})},e.createCustomComponent=({graph:l,options:n={}})=>new Promise((c,u)=>{const{evt:d=null,data:i=null,pt:g={x:50,y:50},id:p=null,style:f,w:v=100,h:A=30,type:w,tmpType:E,codeType:N,crtype:M="creatComp",other:O={},iconName:U="icon-general-icon",realType:L}=n;let V=v,W=A,R=g;l||(l=e.graph),d&&(R=l.getPointForEvent(d)),f.layout&&(V=f.layout.width,W=f.layout.height);let Y={width:V,height:W,x:R.x,y:R.y},G=i.children;if(G&&G.length>0){let _=G.find(ie=>ie.key=="layout");_.value=Y}f.layout=Y;let $=l.getDefaultParent(),te=l.getModel();oe(l),te.beginUpdate();try{let _=F(f),ie=p||ae(),Q=l.insertVertex($,ie,f.text||"",R.x,R.y,V,W,_);Q.crtype=M||"creatComp",Q.other=O,Q.cmp=E,Q.codeType=N,Q.type=w,Q.realType=L,Q.model="yes",Q.name=f.text||"",Q.iconName=U,Q.style=_,Q.value={data:i,style:f},l.setSelectionCell(Q),l.fireEvent(new mxEventObject(mxEvent.SELECTION_CHANGED,{cells:[Q]})),c(Q)}finally{te.endUpdate()}}),e.loadJson=()=>$e(e.graph),e.loadJsonToView=l=>{let n=tt(l);n&&B(n)},e.fromXmlToView=l=>{let n=e.graph;return new Promise((c,u)=>{let d=new mxFastOrganicLayout(n);d.forceConstant=140;const i=n.getStylesheet().getDefaultVertexStyle();i.fill="none",i[mxConstants.STYLE_STROKE]="none",n.getModel().beginUpdate();try{l&&B(l)}finally{n.getModel().endUpdate(),c()}})},e.main=l=>{let{container:n,xml:c}=l;return new Promise((u,d)=>{if(!mxClient.isBrowserSupported())mxUtils.error("Browser is not supported!",200,!1);else{let i=new mxEditor,g=i.graph;i.setGraphContainer(n),g.setEnabled(!1),g.setPanning(!1),g.setTooltips(!1),g.setHtmlLabels(!0),g.panningHandler.useLeftButtonForPanning=!0,g.isHtmlLabel=function(v){return!0},g.gridSize=10,e.graph=g,e.preview=!0;const f=g.getStylesheet().getDefaultVertexStyle();Object.assign(f,{fillColor:"transparent",strokeColor:"transparent",strokeWidth:0,fontColor:"#333333",fontSize:12}),g.convertValueToString=function(v){let{width:A,height:w}=v.geometry;if(v.type=="vertex"){let{url:E,pup:N}=de(v),M=v.value.style,O=v.value.data.children,U={};O&&(U=O.find(V=>V.key==="text"));let L=document.createElement("div");return L.innerHTML=D({img:(M==null?void 0:M.imgUrl)||"",text:U.value||M.text}),L.style=P(M),L.style.width=A+"px",L.style.height=w+"px",L.style.lineHeight=w+"px",E?(L.style.cursor="pointer",L.className="main-text hyperlink-btn",v.hyperlink=E):L.className="main-text",N&&(v.popup=N),L}else if(v.type=="kitUI:CanvasWidget"){let{width:E,height:N}=v.geometry,M=document.createElement("div");if(M.style.width=E+"px",M.style.height=N+"px",v.value){let O=v.value.style;O["background-image"]?M.style.background=`${O["background-image"]} center center no-repeat`:M.style.background=""}return M}else if(v.type=="img"){let E=document.createElement("div");return E.innerHTML=D({img:v.imgUrl||""}),E.style.width=A+"px",E.style.height=w+"px",E.className="main-img",E}return v.value},g.setPanning(!1),g.view.animate=!1,g.gridEnabled=!1,Ie(g),u(g)}})};function de(l){let n=l.value.data;if(n){let c=n.treeData||[],u=[],d=[];return c.forEach(i=>{let g=i.children||[],p=g.find(f=>f.key=="hyperlink"&&f.value!="null");p&&u.push(p),i.title=="PopupBinding"&&d.push(g)}),{url:u&&u.length>0?u[0].value:"",pup:d}}return null}e.addMask=(l,n,c,u,d)=>{let i=a(l.container,"transparentRect");if(i&&i.length>0)for(let g=0;g<i.length;g++){let p=i[g];p&&(p.style.top=c+"px",p.style.left=n+"px",p.style.width=u+"px",p.style.height=d+"px",p.style.zIndex="20",e.preview||(p.classList.remove("is-block"),p.classList.add("is-hidden")))}},e.initCanvas=l=>{const n=e.graph;return new Promise((c,u)=>{let d=n.getModel();const i=n.getDefaultParent();d.beginUpdate();try{const g=n.insertVertex(i,null,"",0,0,l?l.width:1e3,l?l.height:800,"transparent-node;fillColor=transparent;strokeColor=transparent;strokeWidth=0;consumeEvents=false;pointer-events:none;editable=0;selectable=0;clipping=1;order=999999;resizable=0");g.type="kitUI:CanvasWidget",g.resizable=!1,g.movable=!1,g.deletable=!1,g.selection=!1,g.value={style:{background:null,height:"800",horizontalAlign:"center",scrollBar:"hidden",verticalAlign:"center",viewSize:"1000,800",width:"1000"}},n.constrainChildren=!0,n.setCellsResizable(!1,[g]),g.collapsible=!1,g.automaticResize=!1,g.editable=!1,e.parent||(e.parent=g),n.refresh(g),setTimeout(()=>{e.changePageSize(l),e.undoMng&&e.clearUndo()},10),c()}finally{d.endUpdate()}})},e.changeRotationHandleStyle=l=>{mxGraphHandler.prototype.maxCells=mxClient.IS_IE?20:9999,mxConstants.GUIDELINE_WIDTH=1,mxConstants.VERTEX_SELECTION_DASHED=!1,mxConstants.HANDLE_SIZE=6,mxConstants.HANDLE_FILLCOLOR="#FD6902",mxConstants.HANDLE_STROKECOLOR="#FD6902",mxConstants.STYLE_SELECTION_STROKEWIDTH=2},e.testPosition=()=>{let l=e.graph,n=null,c=e.parent;c&&(n=c.value?c.value.style:null);let{x:u,y:d}=me(n,l.container),i=u,g=d;n.horizontalAlign==="end"&&(i=u-2),n.verticalAlign==="end"&&(g=d-2),e.addMask(l,i,g,n.width,n.height),l.getView().setTranslate(i,g)},e.getTranslate=l=>{let n=e.graph;const c=l.value?l.value.style:null;let{x:u,y:d}=me(c,n.container);return{x:u,y:d}},e.getFloatingPosition=l=>{let n=e.graph;if(!l){let i=n.getModel().cells;l=Object.values(i)}let c=l.filter(i=>i.crtype=="schedule"),u=l.find(i=>i.type=="kitUI:CanvasWidget");if(u){let{x:i,y:g}=e.getTranslate(u);i=i<0?0:i,g=g<0?0:g;for(let p=0;p<c.length;p++){let f=c[p];if(e.isPreview){let v=document.getElementsByClassName(f.id);for(let A=0;A<v.length;A++){const w=v[A];if(w){var d=f.getGeometry();w.style.position="absolute",w.style.width=d.width+"px",w.style.height=d.height+"px",w.style.left=d.x+i+"px",w.style.top=d.y+g+"px"}}}}}e.isPreview||c.forEach(i=>{n.getModel().setVisible(i,!0)})},e.changePageSize=l=>{if(!l){let n=e.parent;n&&(l=n.value?n.value.style:null)}if(l){let n=e.graph,c=n.getModel();c.beginUpdate();try{const u=e.parent;if(u){let d=n.getCellGeometry(u);if(d){let{x:i,y:g}=me(l,n.container);d.width=l.width,d.height=l.height,c.setGeometry(u,d);let p=n.container.querySelector("canvas");if(l.background)if(l.background.indexOf("files/")>-1){p&&(l["background-image"]?p.style.background=`${l["background-image"]} center center no-repeat`:p.style.background=l.background),n.container.parentElement.style.background="transparent";let A=document.querySelectorAll(".transparentRect");if(A){let w=(n.container.clientWidth-l.width)/2;A.forEach(E=>{E.style.boxShadow=`0 0 0 ${w}px #fff`})}}else{p&&(p.style.background="transparent"),l.fillColor=l.background,n.container.parentElement.style.background=l.background;let A=a(n.container,"transparentRect");if(A){let w=(n.container.clientWidth-l.width)/2;A.forEach(E=>{E.style.boxShadow=`0 0 0 ${w}px `+(l.background=="transparent"?"#fff":l.background)})}}else p&&(p.style.background="transparent");let f=i,v=g;l.horizontalAlign==="end"&&(f=i-2),l.verticalAlign==="end"&&(v=g-2),e.addMask(n,f,v,l.width,l.height),n.getView().setTranslate(f,v)}n.scrollCellToVisible(u,!1),e.parent=u,n.refresh(u)}c.setBounds=function(d){return new mxRectangle(0,0,l.width,l.height)}}finally{c.endUpdate(),z(n)}}};function Ie(l){l.addListener(mxEvent.CLICK,function(n,c){l.container.focus();const d=c.getProperty("cell");if(d)return t.handelEvent({key:"click",evt:c,val:d}),!1})}function sa(l){l.dblClick=function(n,c){if(!e.preview){if(c||(c=e.parent),c){let u=l.getModel();if(u.isVertex(c)||u.isEdge(c))return t.handelEvent({key:"db",evt:n,val:c}),!1}return!1}}}function da(l,n,c){let u=l.getModel(),d=function(i,g){n.undoableEditHappened(g.getProperty("edit"))};u.addListener(mxEvent.UNDO,d),l.getView().addListener(mxEvent.UNDO,d)}e.addCode=({code:l,pt:n,style:c,type:u,iconCls:d})=>{let i=e.graph;Ce(l,i,{pt:n,style:c,me:e,type:u,iconCls:d},t)},e.addEvent=({code:l,pt:n,style:c,type:u,iconCls:d})=>{let i=e.graph;Ce(l,i,{pt:n,style:c,me:e,type:u,iconCls:d},t)};function ca(l){l.addListener(mxEvent.RESIZE_CELLS,function(n,c){const u=c.getProperty("cells"),d=c.getProperty("bounds"),i=c.getProperty("previous"),g=l.getSelectionCells();u.forEach(p=>{if(l.getChildCells(p),l.getCellGeometry(p)){const v=parseFloat(d[0].width/i[0].width),A=parseFloat(d[0].height/i[0].height);g.forEach(w=>{if(w.id!=p.id){const N=l.getCellGeometry(w).clone();N.width*=v,N.height*=A,l.getModel().setGeometry(w,N)}})}}),setTimeout(()=>{l.setSelectionCells(g)},10),l.fireEvent(new mxEventObject(mxEvent.SELECTION_CHANGED,{cells:g}))})}function ua(l,n){mxEvent.addMouseWheelListener(function(c,u){e.preview||mxEvent.isConsumed(c)||c.ctrlKey&&(c.ctrlKey&&pa(c,l,u),e.changePageSize(),t.handelEvent({key:"wheel"}))},n)}function pa(l,n,c){mxEvent.consume(l);const u=n.getView().getScale(),d=c?1.1:1/1.1,i=u*d;if(i>3||i<.1)return;const g=n.container,p=g.offsetWidth,f=g.offsetHeight,v=p/2,A=f/2;n.getModel().beginUpdate();try{const w=n.getView(),E=w.getScale(),N=w.getTranslate(),M=v/E-N.x,O=A/E-N.y;n.getView().setScale(i);const U=v/i-N.x,L=A/i-N.y,V=U-M,W=L-O;w.setTranslate(w.getTranslate().x+V,w.getTranslate().y+W)}finally{n.getModel().endUpdate()}}function ma(l,n){n.popupMenuHandler.autoExpand=!0,n.popupMenuHandler.factoryMethod=function(c,u,d){if(e.preview)return;let i=mxClipboard.cells;if(!u)return;let g=[];u&&u.type!="kitUI:CanvasWidget"?(g=["new"],i||g.push("paste"),n.getSelectionCells().length<2&&g.push("order")):(g=["copy","cut","clone","del","order","toUp","toDown"],i||g.push("paste")),je(l,g).forEach(f=>{let v=null,A=null;f.children&&f.children.length>0?(v=null,A=f.children):v=function(){if(f.code){let E=n.getPointForEvent(d);t.contextmenus(d,{title:f.title,code:f.code||"",type:f.type,style:f.style,iconCls:f.iconCls,pt:E})}};let w=c.addItem(f.title,f.image,v,null,f.iconCls,f.disable,null,null,f.isBorder);A&&A.forEach(E=>{c.addItem(E.title,E.image,function(){if(E.code){let N=n.getPointForEvent(d);t.contextmenus(d,{title:E.title,code:E.code||"",type:E.type,style:E.style,iconCls:E.iconCls,pt:N})}},w,E.iconCls,E.disable,null,null,E.isBorder)})})}}}/*!
|
|
26
|
+
`});return(s,o)=>(r.openBlock(),r.createElementBlock("div",{class:"gr-triangle",innerHTML:a.value},null,8,Rt))}},[["__scopeId","data-v-25fd969b"]]),jt=(t,e,a)=>{const s=document.createDocumentFragment();let m=Ht({},e.data);e.style.background==="transparent"&&delete e.style.background,e.style.color==="transparent"&&delete e.style.color,e.style={...e.style,...m};let h="";if(t=="btn")h=he,e.style.btntype=="none"&&(delete e.style.background,delete e.style["background-image"]),e.style.isIcon=!1;else if(t=="bar")h=wt;else if(t=="iconbtn")h=he,e.style.btntype=="none"&&(delete e.style.background,delete e.style["background-image"]),e.style.isIcon=!0,e.style.iconName=a;else if(t=="switch"){h=Ot,e.style.btntype=="none"&&(delete e.style.background,delete e.style["background-image"]);let y=e.data;if(y.children){let D=y.children.find(z=>z.key==="text");e.style.realValue=D.realValue,e.style.path=D.animate.value}}else t=="schedule"?(e.id=e.timeId+"",h=e.comp):t=="circle"?h=Vt:t=="rectangle"?h=Ft:t=="triangle"?h=Wt:h=he;const x={setup(){var y=()=>r.h(h,{...e,onClick:function(C){}});return y}};let S=r.createApp(x);return S.use(Oe),S.use(Ve),S.mount(s).$el.outerHTML};function Ht(t,e){if(!e.children)return"";let s=e.children.filter(o=>o.animate&&(o.animate.isShow||o.animate.isShow==1));return s&&s.length>0&&s.forEach(o=>{if(o.key==="background"||o.key==="color"||o.key==="image"){let m=o.animate.data,h=o.animate.mpType,x=null;if(h==="NumericToSimple"){let S=m.find(b=>Gt(o,b.min,b.max));S?x=S:o.key==="image"?x={value:o.animate.default,valueUrl:o.animate.defaultVal}:x={value:o.animate.default}}else h==="BooleanToSimple"&&(x=m.find(S=>S.key===o.value));x&&(t[o.key]=x.value,o.key==="image"&&(t.imgUrl=`${x.valueUrl}`))}else t[o.key]=o.value}),t}function Gt(t,e,a){let s=t.value,o=_t(s);return o>=e&&o<=a}function _t(t){const a=String(t).match(/\d+/);return a?Number(a[0]):null}function Yt(t){let e=this;e.initShapes=function(){function a(){mxActor.call(this)}mxUtils.extend(a,mxActor),a.prototype.arrowWidth=.3,a.prototype.arrowSize=.2,a.prototype.redrawPath=function(o,m,h,x,S){var b=S*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),y=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize)))),C=(S-b)/2,D=C+b,z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(o,[new mxPoint(0,C),new mxPoint(x-y,C),new mxPoint(x-y,0),new mxPoint(x,S/2),new mxPoint(x-y,S),new mxPoint(x-y,D),new mxPoint(0,D)],this.isRounded,z,!0),o.end()},mxCellRenderer.registerShape("singleArrow",a);function s(){mxActor.call(this)}mxUtils.extend(s,mxActor),s.prototype.redrawPath=function(o,m,h,x,S){var b=S*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",a.prototype.arrowWidth)))),y=x*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",a.prototype.arrowSize)))),C=(S-b)/2,D=C+b,z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(o,[new mxPoint(0,S/2),new mxPoint(y,0),new mxPoint(y,C),new mxPoint(x-y,C),new mxPoint(x-y,0),new mxPoint(x,S/2),new mxPoint(x-y,S),new mxPoint(x-y,D),new mxPoint(y,D),new mxPoint(y,S)],this.isRounded,z,!0),o.end()},mxCellRenderer.registerShape("doubleArrow",s)}}function ze(t){let e=this;e.editor=null,e.parent=null,e.graph=null,e.undoMng=null,e.preview=!0,e.pageShortcuts=!1,e.firstFlag=!0,e.container=null,e.keyUpdownEvt=null,e.vueInstances=new Map,e.setPageShortcuts=l=>{e.pageShortcuts=l},e.clearCanvas=()=>{let l=e.graph;const n=l.getChildCells(l.getDefaultParent());if(n.length>0){l.getModel().beginUpdate();try{l.removeCells(n)}finally{l.getModel().endUpdate()}}};function a(l,n){return[...l.parentNode.children].filter(c=>c!==l&&c.classList.contains(n))}e.isPreview=l=>{let n=e.graph;n.setCellsResizable(l),n.setCellsEditable(l),n.setCellsSelectable(l),n.setHtmlLabels(!0),n.setCellsMovable(l),n.setPanning(!l),e.preview=!l,e.changePageSize(),e.preview?e.keyUpdownEvt&&e.keyUpdownEvt.removeListener(n):e.keyUpdownEvt=new Ee(t);let c=a(n.container,"transparentRect");if(e.preview){if(c&&c.length>0)for(let u=0;u<c.length;u++){let d=c[u];d&&(d.classList.remove("is-hidden"),d.classList.add("is-block"))}}else if(c&&c.length>0)for(let u=0;u<c.length;u++){let d=c[u];d&&(d.classList.remove("is-block"),d.classList.add("is-hidden"))}if(e.preview&&n.clearSelection(),e.preview){const u=n.container.querySelectorAll(".bg-light");if(u)for(let d=0;d<u.length;d++)u[d].classList.replace("bg-light","main-text")}else{const u=n.container.querySelectorAll(".main-text");if(u)for(let d=0;d<u.length;d++)u[d].classList.replace("main-text","bg-light")}if(e.preview){const u=n.container.querySelectorAll(".bg-creat-comp");if(u)for(let d=0;d<u.length;d++){const i=u[d];i&&i.classList.add("svg-preview-gr")}}else{const u=n.container.querySelectorAll(".svg-preview-gr");if(u)for(let d=0;d<u.length;d++){const i=u[d];i&&i.classList.remove("svg-preview-gr")}}n.view.validate(),n.view.refresh(),e.preview},e.init=l=>{let{container:n}=l;return new Promise((c,u)=>{let d=new mxEditor,i=d.graph;n.setAttribute("tabindex","0"),n.style.outline="none",n.style.width="100%",n.style.height="100%",d.setGraphContainer(n),e.container=n,e.editor=d,Ze(d),mxEvent.disableContextMenu(n);const p=i.getStylesheet().getDefaultVertexStyle();Object.assign(p,{fillColor:"transparent",strokeColor:"transparent",strokeWidth:0,fontColor:"#333333",fontSize:12}),i.setConnectable(!1),i.setEnabled(!0),i.setPanning(!1),i.resizeContainer=!1,i.scrollbars=!1,i.setHtmlLabels(!0),i.setCellsResizable(!0),i.connectionHandler.setCreateTarget(!1),i.setDropEnabled(!1),i.setCellsDeletable(!0),i.setTooltips(!1),i.setMultigraph(!1),new mxRubberband(i),i.setAllowDanglingEdges(!1),i.setCellsEditable(!0),i.setCellsSelectable(!0),i.setCellsMovable(!0),i.setEdgeLabelsMovable(!1),i.setGridEnabled(!1),i.setGridEnabled(!1),i.gridEnabled=!0,i.gridSize=10,i.centerZoom=!1,e.changeRotationHandleStyle(i),i.snapTolerance=10,i.isCellEditable=function(w){return!1},i.isCellMovable=function(w){return w.type==="kitUI:CanvasWidget"?!1:w.isVertex()||w.isEdge()},i.isCellResizable=function(w){return w.type==="kitUI:CanvasWidget"?!1:w.isVertex()||w.isEdge()},i.isCellDeletable=function(w){return w.type==="kitUI:CanvasWidget"?!1:w.isVertex()||w.isEdge()},i.isCellSelectable=function(w){return w&&w.type==="kitUI:CanvasWidget"?!1:mxGraph.prototype.isCellSelectable.apply(this,arguments)},i.setResizeContainer(!1),i.autoExtend=!1,i.setAutoSizeCells(!1),i.swimlaneSelectionEnabled=!1;let f=new mxUndoManager;da(i,f),e.undoMng=f,z(i),sa(i),Ie(i),ua(i,n),ma(t.menus,i),ca(i),e.graph=i,h(i),i.autoSize=!1,i.model.validateGraph=!1,i.model.validateEdge=()=>!0,i.model.validateNode=()=>!0,i.removeListener(i.listeners),i.view.animate=!1,e.clearUndo(),new Yt().initShapes(),y(),mxConstants.INVALID_COLOR="transparent",mxConstants.DEFAULT_INVALID_COLOR="transparent",mxConstants.INVALID_CONNECT_TARGET_COLOR="transparent",e.keyUpdownEvt=new Ee(t),mxWindow.prototype.closeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAw0lEQVR4AZyS3RHCIBCEEyuxFO1E36EGsQZ419LsBHd3IHP8jTNmWH4u+x0HyWn78xEYY3xQv3LQk1J60SeQEyjwBcZpK0DIOX9oEOi9f2IRqBlMCMBt3/d38W4CAWwlMMAWcs7d6aUOkIseXkH0NiADFq7l2Z3ooQaQQZzlzJECrMvg3GoAbXkwDmdGTK0BLcTybNn9bR9gDyktuhUskNlwFn0n7gR/02awQLguUJhBiKtVuF6cQASvEP8emVYdPTX5FwAA//+rmaLTAAAABklEQVQDAD/igh3e/xFHAAAAAElFTkSuQmCC ",mxWindow.prototype.normalizeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAwElEQVR4AcRSwRHCIBAUKkknQidaALSgtgD8tRNIJ1YC7mYSRhgn5Gfmdg7udnNwhzytn/deASWE8FxD1THGHKC2YBVugaNe8i8EBGdg10opE7kEK0awiTv8rgkheA1yI4UJ7Iqc84x9Y6j0RqByuJbGGP0Na+0LicaQfwANjxUb0tHNH4Robexw64/rnLt0nKWrfA0VaPnUC6WUnHHlIK94R42FRsuv8CPjrBc+x5HQ6oRKnNVIOJNLsOKI/DP/AQAA///YhGxbAAAABklEQVQDANQlZDV28KsrAAAAAElFTkSuQmCC",mxWindow.prototype.minimizeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAwElEQVR4AcRSwRHCIBAUKkknQidaALSgtgD8tRNIJ1YC7mYSRhgn5Gfmdg7udnNwhzytn/deASWE8FxD1THGHKC2YBVugaNe8i8EBGdg10opE7kEK0awiTv8rgkheA1yI4UJ7Iqc84x9Y6j0RqByuJbGGP0Na+0LicaQfwANjxUb0tHNH4Robexw64/rnLt0nKWrfA0VaPnUC6WUnHHlIK94R42FRsuv8CPjrBc+x5HQ6oRKnNVIOJNLsOKI/DP/AQAA///YhGxbAAAABklEQVQDANQlZDV28KsrAAAAAElFTkSuQmCC",mxWindow.prototype.maximizeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAArklEQVR4AcSSUQrDIBBEG/Eg7U1yIT88QZoT+OGFepP2IEI6b4mwlkD6UWjwmc3MjgomXPSUUq4eScPwHjVmoIgxPj0YHu9Rk7Ed96aH3vcdvYbRdXrMGIIppRXMcRMaSDoMSv9+hJzzS6tNYj2L0SMmMv6oZ7nB/0OQO6m1bmIZznLwQY/YyPzkqLNWW+BzMzSQPgsbfkfE/oeY6aau02OyBVtrN485bvIeNff4BgAA//8HoCv8AAAABklEQVQDAFXqZFJqMF/zAAAAAElFTkSuQmCC",mxWindow.prototype.resizeImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAtklEQVR4AZSS0Q2EIBBEF0MhVwqdnP5DEVZAAvyfnXidaCfcrBcTQFQkIWQ387I7Ezp6eEIIH+fc8gj03s8xxl4IMTWDDBGRYsgYMzaBKaS1HgjnFiwha+0LHvtLsIRQKynlgnXfpyBEMzbaPPF6qBVqDmfFW/cI0SmEaQPC+R4mtkCYSBnYAh0+QAvEmuwDcAPjq0HsnlINPI5d2ijTq0GswZC/RwimvcFNrLOit6XHNV/UmeYHAAD//4CpKLcAAAAGSURBVAMAuzSnSig8bRkAAAAASUVORK5CYII=";const A=i.getView().setTranslate;i.getView().setTranslate=function(w,E){const N=Math.max(0,Math.min(3e3,w)),M=Math.max(0,Math.min(3e3,E));A.call(this,N,M)},i.addListener(mxEvent.PAN,function(){const w=i.getView().getTranslate();let E=Math.min(0,w.x),N=Math.min(0,w.y);(E!==w.x||N!==w.y)&&i.getView().setTranslate(E,N)}),mxGraph.prototype.setCellStyles=function(w,E,N,M){N=N||this.getSelectionCells(),mxUtils.setCellStyles(this.model,N,w,E,M)},mxUtils.setCellStyles=function(w,E,N,M,O){if(E!=null&&E.length>0)if(e.firstStyle){w.beginUpdate();try{for(var L=0;L<E.length;L++)if(E[L]!=null)for(let W in O){var U=mxUtils.setStyle(w.getStyle(E[L]),W,O[W]);w.setStyle(E[L],U)}}finally{w.endUpdate()}}else{for(var L=0;L<E.length;L++)if(E[L]!=null)for(let V in O){var U=mxUtils.setStyle(w.getStyle(E[L]),V,O[V]);w.setStyle(E[L],U)}e.firstStyle=!1}},i.view.scaleGrid=!0,i.view.roundPoints=!0,mxSvgCanvas2D.prototype.updateTextNodes=function(w,E,N,M,O,L,U,V,W,R,Y){var G=this.state.scale;mxSvgCanvas2D.createCss(N+2,M,O,L,U,V,W,this.state.fontBackgroundColor!=null?this.state.fontBackgroundColor:null,this.state.fontBorderColor!=null?this.state.fontBorderColor:null,"display: flex; align-items: unsafe "+(L==mxConstants.ALIGN_TOP?"flex-start":L==mxConstants.ALIGN_BOTTOM?"flex-end":"center")+"; justify-content: unsafe "+(O==mxConstants.ALIGN_LEFT?"flex-start":O==mxConstants.ALIGN_RIGHT?"flex-end":"center")+"; ",this.getTextCss(),G,mxUtils.bind(this,function($,te,_,ie,Q){w+=this.state.dx,E+=this.state.dy;var ce=Y.firstChild,Pe=ce.firstChild,Le=Pe.firstChild,ga=Le.firstChild,Ue=(this.rotateHtml?this.state.rotation:0)+(R??0),ye=(this.foOffset!=0?"translate("+this.foOffset+" "+this.foOffset+")":"")+(G!=1?"scale("+G+")":"");ga.setAttribute("style",Q),Le.setAttribute("style",ie),ce.setAttribute("width",Math.ceil(1/Math.min(1,G)*100)+"%"),ce.setAttribute("height",Math.ceil(1/Math.min(1,G)*100)+"%");let ue=Math.round(E+te),fa=Math.round(w+$),ha=s(ue),ya=s(fa);if(ue<0)ce.setAttribute("y",ue);else{ce.removeAttribute("y");let Me=ue;ya||ha||(Me=ue-.5),_+="padding-top: "+Me+"px; "}_=_.replace("width: 1px","width: 0px"),_=_.replace("height: 1px","height: 0px");let ba=w+$;Pe.setAttribute("style",_+"margin-left: "+Math.round(ba)+"px;"),ye+=Ue!=0?"rotate("+Ue+" "+w+" "+E+")":"",ye!=""?Y.setAttribute("transform",ye):Y.removeAttribute("transform"),this.state.alpha!=1?Y.setAttribute("opacity",this.state.alpha):Y.removeAttribute("opacity")}))},i.fit(),o(),c(i)})};function s(l){let n=!0;return l%2===0?n=!0:n=!1,n}function o(l){mxVertexHandler.prototype.getHandleForEvent=function(n){let c=n.getEvent(),u=["nw-resize","n-resize","ne-resize","w-resize","e-resize","sw-resize","s-resize","se-resize"];var d=c.target||c.srcElement,i=window.getComputedStyle(d).cursor;if(u.indexOf(i)!=-1){var g=mxEvent.isMouseEvent(n.getEvent())?1:this.tolerance,p=this.allowHandleBoundsCheck&&(mxClient.IS_IE||g>0)?new mxRectangle(n.getGraphX()-g,n.getGraphY()-g,2*g,2*g):null,f=mxUtils.bind(this,function(A){var w=A!=null&&A.constructor!=mxImageShape&&this.allowHandleBoundsCheck?A.strokewidth+A.svgStrokeTolerance:null,E=w!=null?new mxRectangle(n.getGraphX()-Math.floor(w/2),n.getGraphY()-Math.floor(w/2),w,w):p;return A!=null&&(n.isSource(A)||E!=null&&mxUtils.intersects(A.bounds,E)&&A.node.style.display!="none"&&A.node.style.visibility!="hidden")});if(f(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(f(this.labelShape))return mxEvent.LABEL_HANDLE;if(this.sizers!=null){for(var v=0;v<this.sizers.length;v++)if(f(this.sizers[v]))return v}if(this.customHandles!=null&&this.isCustomHandleEvent(n)){for(var v=this.customHandles.length-1;v>=0;v--)if(f(this.customHandles[v].shape))return mxEvent.CUSTOM_HANDLE-v}}return null}}e.keyUpdownEvent=l=>{let n=e.graph,c=e.undoMng;e.keyUpdownEvt.keyUpdown(n,c,function(d){(d==="undo"||d==="redo")&&e.changePageSize()})},e.removeKeyUpDown=()=>{let l=e.graph;e.keyUpdownEvt.removeListener(l)};function m(l){return new Promise((n,c)=>{let u=new Image;u.src=`${l}`,u.onload=async function(){let d=u.width,i=u.height;n({w:d,h:i})}})}e.scheduleBorder=l=>{let n={};if(l.border){let u=l.border.split(",");u.length==1?u.forEach((d,i)=>{let g=d.split(" "),p="";n["border"+p+"Width"]=g[0],n["border"+p+"Style"]=g[1],n["border"+p+"Color"]=g[2]}):u.forEach((d,i)=>{let g=d.split(" "),p="Top";i==0?p="Top":i==1?p="Right":i==2?p="Bottom":i==3&&(p="Left"),n["border"+p+"Width"]=g[0],n["border"+p+"Style"]=g[1],n["border"+p+"Color"]=g[2]})}return n};function h(l){l.convertValueToString=function(n){let{width:c,height:u,x:d,y:i}=n.geometry;if(n.type=="vertex")return x(n);if(n.type=="kitUI:CanvasWidget"){let p=n.value.style,f=document.createElement("div");f.style.width=c+"px",f.style.height=u+"px",f.className="bgss-light";let v=l.container.querySelector("canvas");return v&&(p["background-image"]?v.style.background=`${p["background-image"]}center center no-repeat`:v.style.background="transparent"),f}else if(n.type=="img"){let p=document.createElement("div"),f=n.value.style,v="";if(f.scale=="fitRatio"?(p.style.display="flex",p.style.alignItems="center",p.style.justifyContent="center",p.style.flexDirection="column",m(f.imgUrl||n.imgUrl).then(A=>{A&&(p.style.aspectRatio=A.w/A.h)}),v="img-vr-fit-ratio"):f.scale=="fit"&&(p.style.display="flex",p.style.alignItems="center",p.style.justifyContent="center",v="img-vr-fit"),p.innerHTML=D({img:f.imgUrl||n.imgUrl}),p.style.width=c+"px",p.style.height=u+"px",p.innerHTML+='<div class="svg-edit-gr"></div>',e.preview){n.hyperlink="",n.popup="",p.className="bg-light svg-preview-gr "+v;let{url:A,pup:w}=de(n);A?(p.style.cursor="pointer",n.hyperlink=A):p.style.cursor="default",w&&w.length>0?(p.style.cursor="pointer",n.popup=w):p.style.cursor="default"}else p.className="bg-light "+v;return p}else if(n.crtype=="creatComp"){C(n);let p=document.createElement("div");if(p.innerHTML=jt(n.cmp,n.value,n.iconName),p.style.width=c+"px",p.style.height=u+"px",p.innerHTML+='<div class="svg-edit-gr"></div>',e.preview){n.hyperlink="",n.popup="",p.className="bg-creat-comp svg-preview-gr";let{url:f,pup:v}=de(n);f?(p.style.cursor="pointer",n.hyperlink=f):p.style.cursor="default",v&&v.length>0?(p.style.cursor="pointer",n.popup=v):p.style.cursor="default"}else p.className="bg-creat-comp";return p}else if(n.crtype=="schedule"){let p=n.value.style;C(n);let f=document.createElement("div"),{el:v}=n.other||{};f.innerHTML=v.outerHTML;let A=document.getElementById(n.id);if(A){var g=l.view.getState(n);A.style.position="absolute",A.style.width=g.width+"px",A.style.height=g.height+"px",A.style.left=g.x+"px",A.style.top=g.y+"px",e.preview||(f.innerHTML=A.innerHTML)}return f.style=T(p,[]),f.style.width=c+"px",f.style.height=u+"px",f.innerHTML+='<div class="svg-edit-gr"></div>',e.preview?f.className="bg-creat-comp svg-preview-gr":f.className="bg-creat-comp",f}else if(n.type=="rect"){let p=n.value.style,f=n.value.data,A=(f.children||[]).find(O=>O.key==="perimeter");A&&(p.background.indexOf("/files")>-1&&(p.background=""),Number(p.borderValue)===0&&(p.stroke="transparent"),n.style=A.value+`fillColor=${p.background||"transparent"};strokeColor=${p.stroke||"#333333"};strokeWidth=${p.borderValue||0}`);let w={},E=f.children;E&&(w=E.find(O=>O.key==="text"));let N=document.createElement("div");N.innerHTML=D({text:w.value||p.text,style:k(p,["text-","font-","color"])}),N.style=T(p,["background","stroke","strokeWidth"]),N.style.width=c+"px",N.style.height=u+"px",N.className="";let M="";if(f.title==="ShapeTriangle"?M="triangle":f.title==="ShapeRect"?M="rectangle":f.title==="ShapeCircle"&&(M="circle"),e.preview){n.hyperlink="",n.popup="";let{url:O,pup:L}=de(n);O?(N.style.cursor="pointer",N.className="main-text hyperlink-btn custom-rect-p "+M,n.hyperlink=O):(N.style.cursor="default",N.className="main-text custom-rect-p "+M),L&&L.length>0?(n.popup=L,N.style.cursor="pointer"):N.style.cursor="default"}else N.className="bg-light custom-rect "+M;return N.innerHTML+='<div class="svg-edit-gr"></div>',N}else if(n.type=="edge"){if(e.firstFlag){l.getModel(),e.firstFlag=!1;try{let p=n.value.style,f=p.dashWidth||3,v=p.dashSpace||1;f&&v&&(p.dashPattern=`${f} ${v}`),setTimeout(()=>{p&&l.setCellStyles(null,null,[n],p)},1)}finally{}return n.value}return n.value}return n.value}}function x(l){let{width:n,height:c,x:u,y:d}=l.geometry;C(l);let i=l.value.style,g=l.value.data.children,p={};g&&(p=g.find(v=>v.key==="text"));let f=document.createElement("div");if(f.innerHTML=D({img:i.imgUrl||"",text:p.value||i.text}),f.style=P(i),f.style.width=n+"px",f.style.height=c+"px",f.style.linHeight=c+"px",f.className="bg-light",e.preview){l.hyperlink="",l.popup="";let{url:v,pup:A}=de(l);v?(f.style.cursor="pointer",f.className="main-text hyperlink-btn",l.hyperlink=v):(f.style.cursor="default",f.className="main-text"),A&&A.length>0?(f.style.cursor="pointer",l.popup=A):f.style.cursor="default"}else f.className="bg-light";return f.innerHTML+='<div class="svg-edit-gr"></div>',f}function S(l,n){const c=n.x-l.x,u=n.y-l.y;return Math.sqrt(c*c+u*u)}e.isDragging=!1,e.dragTerminal=null,e.startPos=null,e.dx=null,e.dy=null,e.ctrlKey=!1,e.moveEdgeCells=[];function b(l,n,c,u){return new Promise((d,i)=>{let g=l.getDefaultParent(),p=l.getModel();p.beginUpdate();try{var f=l.insertEdge(g,null,"",null,null,n.style),v=l.getCellGeometry(n);let w=v.getTerminalPoint(!0),E=v.getTerminalPoint(!1);var A=new mxGeometry;A.setTerminalPoint(new mxPoint(w.x+c,w.y+u),!0),A.setTerminalPoint(new mxPoint(E.x+c,E.y+u),!1),f.setGeometry(A),f.value=n.value,f.type=n.type,f.model="yes",f.type="edge",f.iconName=n.iconName,d(f)}finally{p.endUpdate()}})}function y(){let l=e.graph;l.addMouseListener({mouseDown:function(n,c){e.dx=null,e.dy=null,e.moveEdgeCells=l.getSelectionCells();let u=c.evt;if(e.ctrlKey=u.ctrlKey,e.ctrlKey){let i=l.getPointForEvent(u);e.startPos=i,c.consume()}let d=l.getSelectionCell();if(d&&d.isEdge()){let i=l.getPointForEvent(u),g=d.getGeometry(),p=g.getTerminalPoint(!0),f=g.getTerminalPoint(!1),v=S(i,p),A=S(i,f);v<15&&(e.isDragging=!0,e.dragTerminal=!0,e.startPos=i,c.consume()),A<15&&(e.isDragging=!0,e.dragTerminal=!1,e.startPos=i,c.consume())}c.consume()},mouseMove:function(n,c){let u=c.evt;if(e.ctrlKey=u.ctrlKey,e.ctrlKey){let d=l.getPointForEvent(u),i=d.x,g=d.y;e.dx=i,e.dy=g,c.consume()}else if(e.isDragging&&e.dragTerminal!==null){let d=l.getPointForEvent(u),i=d.x,g=d.y;e.dx=i,e.dy=g,c.consume()}c.consume()},mouseUp:function(n,c){let u=c.evt,d=l.getModel();d.beginUpdate();try{if(e.ctrlKey&&u.ctrlKey&&e.dx!==null&&e.dy!==null){let i=e.moveEdgeCells;if(i&&i.length>0){let g=[];for(let p=0;p<i.length;p++){let f=i[p];f&&f.isEdge()&&b(l,f,e.dx-e.startPos.x,e.dy-e.startPos.y).then(v=>{g.push(v)})}}c.consume()}else if(e.isDragging&&e.dragTerminal!==null&&e.dx!==null&&e.dy!==null){let i=l.getSelectionCell(),g=i.getGeometry();if(e.dragTerminal){let p=new mxPoint(e.dx,e.dy);g.setTerminalPoint(p,!0)}else{let p=new mxPoint(e.dx,e.dy);g.setTerminalPoint(p,!1)}l.refresh(i),setTimeout(()=>{e.isDragging=!1,e.dragTerminal=null,e.startPos=null},1),c.consume()}}finally{d.endUpdate()}c.consume()}})}const C=l=>{let{width:n,height:c,x:u,y:d}=l.geometry,i=l.value.style;if(i&&i.hasOwnProperty("layout")){let g=l.value.data,p={width:n,height:c,x:u,y:d},f=g.children;if(f&&f.length>0){let v=f.find(A=>A.key=="layout");v.value=p}i.layout=p}};function D(l){let{img:n,text:c,style:u}=l,d="";return n&&(d+=`<img src='${n}' style="z-index: 0;" alt=" " v-if='${n}'>`),c&&(u?d+=`<span style="z-index: 0;${u}">${c}</span>`:d+=`<span style="z-index: 0;">${c}</span>`),!n&&!c?"<span> </span>":d}function z(l){new lt().createGrid(l,e.parent,e.preview),l.gridEnabled=!0,l.gridSize=10}e.disableAll=l=>{e.graph.setEnabled(l)},e.redo=()=>{if(e.preview)return;let l=e.undoMng;e.canRedo()&&(l.redo(),e.changePageSize())},e.undo=()=>{if(e.preview)return;let l=e.undoMng;e.canUndo()&&(l.undo(),e.changePageSize())},e.canRedo=()=>e.undoMng.canRedo(),e.canUndo=()=>e.undoMng.canUndo(),e.clearUndo=()=>{let l=e.undoMng;l&&(l.clear(),l.indexOfNextAdd=0,l.history=[])},e.getPoint=l=>e.graph.getPointForEvent(l),e.getXml=l=>{l||(l=e.graph);let c=new mxCodec().encode(l.getModel());return mxUtils.getPrettyXml(c)};function B(l){let c=e.graph.getModel();c.beginUpdate();try{let u=mxUtils.parseXml(l),g=new mxCodec(u).decode(u.documentElement,c).cells;for(const p in g){let f=g[p];f.type=="kitUI:CanvasWidget"&&(f.style=f.value.style,e.parent=f)}}finally{c.endUpdate(),setTimeout(()=>{e.changePageSize(),e.undoMng&&e.clearUndo()},1)}}function k(l,n){if(!l)return"";let c={};for(const u in l)n.some(d=>u.startsWith(d))&&(c[u]=l[u]);return c&&Object.keys(c).length===0?"":Object.entries(c).filter(([u,d])=>d!=null&&d!==""&&!(typeof d=="object"&&Object.keys(d).length===0)).map(([u,d])=>{const i=u.replace(/([A-Z])/g,"-$1").toLowerCase();let g=d;return i==="gap"&&(g=`${d}px`),`${i}:${g}`}).join("; ")+";"}function T(l,n){if(!l)return"";let c={};for(const u in l)n.indexOf(u)===-1&&(c[u]=l[u]);return c&&Object.keys(c).length===0?"":Object.entries(c).filter(([u,d])=>d!=null&&d!==""&&!(typeof d=="object"&&Object.keys(d).length===0)).map(([u,d])=>{const i=u.replace(/([A-Z])/g,"-$1").toLowerCase();let g=d;return i==="gap"&&(g=`${d}px`),`${i}:${g}`}).join("; ")+";"}function P(l){return l?(l.border&&l.border.split(",").length===1&&["top","right","bottom","left"].forEach(u=>{delete l["border-"+u+"-width"],delete l["border-"+u+"-style"],delete l["border-"+u+"-color"]}),Object.entries(l).filter(([n,c])=>c!=null&&c!==""&&!(typeof c=="object"&&Object.keys(c).length===0)).map(([n,c])=>{const u=n.replace(/([A-Z])/g,"-$1").toLowerCase();let d=c;return u==="gap"&&(d=c.toString().indexOf("px")===-1?`${c}px`:c),`${u}: ${d}`}).join("; ")+";"):""}function F(l,n){return l?Object.entries(l).filter(([u,d])=>d!=null&&d!==""&&!(typeof d=="object"&&Object.keys(d).length===0)).map(([u,d])=>{let i=u;n||(i=u.replace(/([A-Z])/g,"-$1").toLowerCase());let g=d;return i==="gap"&&(g=`${d}px`),`${i}=${g}`}).join("; ")+";":""}function j(l){const c=String(l).match(/\d+/);return c?Number(c[0]):null}function H(l,n,c){let u=l.value,d=j(u);return n==="-inf"?d<=c:c==="+inf"?d>=n:d>=n&&d<=c}function I(l,n){if(!n.children)return"";let u=n.children.filter(d=>d.animate&&(d.animate.isShow||d.animate.isShow==1));return u&&u.length>0&&u.forEach(d=>{if(d.key==="background"||d.key==="color"||d.key==="image"){let i=d.animate.data,g=d.animate.mpType,p=null;if(g==="NumericToSimple"){let f=i.find(v=>H(d,v.min,v.max));f?p=f:d.key==="image"?p={value:d.animate.default,valueUrl:d.animate.defaultVal}:p={value:d.animate.default}}else g==="BooleanToSimple"&&(p=i.find(f=>f.key===d.realValue));p&&(l[d.key]=p.value,d.key==="image"&&(l.imgUrl=`${p.valueUrl}`))}}),l}e.batchUpdateCells=l=>{const n=e.graph,c=e.undoMng;let u=n.getModel();if(!c){u.beginUpdate();try{l.forEach(i=>{if(u.setValue(i,i.value),i.value.style){let g={};if(i.type==="rect"){const p=I(i.value.style,i.value.data);g=K(i,p)}else if(i.type==="edge"){const p=I(i.value.style,i.value.data);e.firstFlag=!0,g=Z(i,p)}else i.type==="kitUI:CanvasWidget"?(g=I(realStyle,i.value.data),e.changePageSize(realStyle)):g=I(i.value.style,i.value.data);u.setStyle(i,g)}})}finally{u.endUpdate()}n.refresh();return}const d=c.undoableEditHappened;try{c.undoableEditHappened=function(){},u.beginUpdate();try{l.forEach(i=>{if(u.setValue(i,i.value),i.value.style){let g={};if(i.type==="rect"){const p=I(i.value.style,i.value.data);g=K(i,p)}else if(i.type==="edge"){const p=I(i.value.style,i.value.data);e.firstFlag=!0,g=Z(i,p)}else i.type==="kitUI:CanvasWidget"?(g=I(realStyle,i.value.data),e.changePageSize(realStyle)):g=I(i.value.style,i.value.data);u.setStyle(i,g)}})}finally{u.endUpdate()}}finally{c.undoableEditHappened=d}},e.updateCell=(l,n)=>{let c=e.graph;const u=c.getModel();u.beginUpdate();try{let d=l.value.style;if(n&&n.layout&&Object.keys(n.layout).length>0){const g=n.layout;if(g){let p=l.geometry;p!=null&&(p=p.clone(),p.x=g.x,p.y=g.y,p.width=g.width,p.height=g.height,u.setGeometry(l,p))}}u.setValue(l,l.value);let i="";l.type==="rect"?i=K(l,n):l.type==="edge"?(e.firstFlag=!0,i=Z(l,n)):l.type==="kitUI:CanvasWidget"?(i=I(d,l.value.data),e.changePageSize(d)):i=I(d,l.value.data),Je(e.graph,l,i)}finally{u.endUpdate()}c.refresh()};function Z(l,n){let c=e.graph,u="",d=l.style||"";if(d){const g={...ee(d),...n};u=F(g,!0),l.value.style=g,l.setStyle(u),I(l.value.style,l.value.data),c.refresh(l)}return u}function K(l,n){let c="",u=l.style||"";if(u){let d=ee(u);d.shape=d.shape,d.perimeter=d.perimeter,n.background.indexOf("/files")>-1&&(n.background=""),Number(n.borderValue)===0&&(n.stroke="transparent"),c=`shape=${d.shape};perimeter=${d.perimeter};fillColor=${n.background||"#D1E7FF"};strokeColor=${n.stroke||"#000000"};strokeWidth=${n.borderValue||0}`,d.direction&&(c+=`;direction=${d.direction}`);const i={...d,...n};l.value.style=i,I(l.value.style,l.value.data)}return c}function ee(l){const n={};return l.split(";").filter(u=>u.trim()!=="").forEach(u=>{const[d,i]=u.split("=");d&&i!==void 0&&(n[d.trim()]=i.trim())}),n}function ne(l){e.addImgVertex(l)}e.addImgVertex=l=>{let n=e.graph;const c=n.getModel();let u=n.getDefaultParent(),d=[];c.beginUpdate();try{l.forEach(i=>{const{evt:g=null,data:p={},pt:f={x:50,y:50},w:v=48,h:A=48,style:w={},displayName:E="",imgUrl:N="",iconName:M="icon-Imagefile",realWh:O={}}=i;let L=f,U=e.graph;g&&(L=U.getPointForEvent(g));let V=U.insertVertex(u,null,i.show?i.name:"",L.x,L.y,v,A);V.type="img",V.model="yes",V.imgUrl=i.imgUrl,V.iconName=M,V.value={data:p,style:w,name:i?i.displayName:i.getAttribute("label"),realWh:O},d.push(V)}),n.setSelectionCells(d)}finally{c.endUpdate()}};function oe(l,n){const u=l.getStylesheet().getDefaultVertexStyle();Object.assign(u,{fillColor:"transparent",strokeColor:"transparent",strokeWidth:0,fontColor:"#333333",fontSize:12})}e.createAllVertex=(l,n)=>{l==="vertex"?ra(n):l==="custom"?se(n):l==="edge"?re(n):l==="img"&&ne(n)};function re(l){e.firstFlag=!0;const n=mxGraph.prototype.insertEdge;mxGraph.prototype.insertEdge=function(g,p,f,v,A,w){return w===null&&(w=""),n.apply(this,arguments)};let c=e.graph,u=c.getDefaultParent(),d=c.getModel(),i=[];d.beginUpdate();try{for(let g=0;g<l.length;g++){const p=l[g],{evt:f=null,data:v=null,pt:A={x:50,y:50},style:w,w:E=30,h:N=100,iconName:M="icon-general-icon"}=p;let O=A;f&&(O=c.getPointForEvent(f));let L=ae(),U=c.insertEdge(u,null,"",null,null,w.perimeter+`;strokeWidth=${w.strokeWidth||1};strokeColor=${w.strokeColor||"#333333"}`);U.id=L;let V=new mxGeometry,{startX:W,startY:R,endX:Y,endY:G}=Ne(O,E,N);V.setTerminalPoint(new mxPoint(W,R),!0),V.setTerminalPoint(new mxPoint(Y,G),!1),U.setGeometry(V),U.model="yes",U.type="edge",U.iconName=M,U.value={data:{...v},style:{...w}},c.setSelectionCell(U),c.fireEvent(new mxEventObject(mxEvent.SELECTION_CHANGED,{cells:[U]})),c.refresh(U),i.push(U),e.firstStyle=!0}c.setSelectionCells(i)}finally{d.endUpdate()}}function se(l){let n=e.graph,c=n.getModel(),u=[];c.beginUpdate();try{for(let d=0;d<l.length;d++){const i=l[d],{evt:g=null,data:p=null,pt:f={x:50,y:50},style:v,w:A=100,h:w=30,type:E,tmpType:N,codeType:M,iconName:O="icon-general-icon",realType:L}=i;let U=A,V=w,W=f;g&&(W=n.getPointForEvent(g)),v.layout&&(U=v.layout.width,V=v.layout.height);let R={width:U,height:V,x:W.x,y:W.y},Y=p.children;if(Y&&Y.length>0){let ie=Y.find(Q=>Q.key=="layout");ie.value=R}v.layout=R;let G=n.getDefaultParent();oe(n,null);let $=F(v),te=ae(),_=n.insertVertex(G,te,v.text||"",W.x,W.y,U,V,$);_.crtype="creatComp",_.cmp=N,_.codeType=M,_.type=E,_.realType=L,_.model="yes",_.name=v.text||"",_.iconName=O,_.style=$,_.value={data:p,style:v},n.fireEvent(new mxEventObject(mxEvent.SELECTION_CHANGED,{cells:[_]})),u.push(_)}n.setSelectionCells(u)}finally{c.endUpdate()}}function ra(l){let n=e.graph,c=n.getModel(),u=[];c.beginUpdate();try{for(let d=0;d<l.length;d++){const i=l[d],{evt:g=null,data:p=null,pt:f={x:50,y:50},style:v,w:A=100,h:w=20,iconName:E="iconfont icon-general-icon",realType:N,from:M}=i;let O=f;n||(n=e.graph),g&&(O=n.getPointForEvent(g));let L=n.getDefaultParent(),U=n.getModel(),V={width:A,height:w,x:O.x,y:O.y},W=p.children;if(W&&W.length>0){let $=W.find(te=>te.key=="layout");$.value=V}let R=F(v);v.gtype=="rect"&&(Number(v.borderValue)===0&&(v.stroke="transparent"),R=v.perimeter+`;fillColor=${v.background||"transparent"};strokeColor=${v.stroke||"#333333"};strokeWidth=${v.borderWidth||0}`);let Y=ae(),G=n.insertVertex(L,Y,v.text||"",O.x,O.y,A,w,R);v.gtype=="rect"?G.type="rect":G.type="vertex",G.model="yes",G.name=v.text||"",G.iconName=E,G.value={data:{...p},style:{...v}},G.from=M||"other",G.realType=N,G.style=R,u.push(G),n.fireEvent(new mxEventObject(mxEvent.SELECTION_CHANGED,{cells:[G]}))}n.setSelectionCells(u)}finally{c.endUpdate()}}e.addVertex=({graph:l,options:n={}})=>new Promise((c,u)=>{const{evt:d=null,data:i=null,pt:g={x:50,y:50},style:p,w:f=100,h:v=20,iconName:A="iconfont icon-general-icon",realType:w,from:E}=n;let N=g;l||(l=e.graph),d&&(N=l.getPointForEvent(d));let M=l.getDefaultParent(),O=l.getModel(),L={width:f,height:v,x:N.x,y:N.y},U=i.children;if(U&&U.length>0){let V=U.find(W=>W.key=="layout");V.value=L}O.beginUpdate();try{let V=F(p);p.gtype=="rect"&&(Number(p.borderValue)===0&&(p.stroke="transparent"),V=p.perimeter+`;fillColor=${p.background||"transparent"};strokeColor=${p.stroke||"#333333"};strokeWidth=${p.borderWidth||0}`);let W=ae(),R=l.insertVertex(M,W,p.text||"",N.x,N.y,f,v,V);p.gtype=="rect"?R.type="rect":R.type="vertex",R.model="yes",R.name=p.text||"",R.iconName=A,R.value={data:{...i},style:{...p}},R.from=E||"other",R.realType=w,R.style=V,l.setSelectionCell(R),l.fireEvent(new mxEventObject(mxEvent.SELECTION_CHANGED,{cells:[R]})),c(R)}finally{O.endUpdate()}});function Ne(l,n,c){const d=-10*Math.PI/180,i=Math.cos(d),g=Math.sin(d),p=c/2,f=n/2,A=[{x:-p,y:-f},{x:p,y:-f},{x:p,y:f},{x:-p,y:f}].map(N=>{const M=l.x+(N.x*i-N.y*g),O=l.y+(N.x*g+N.y*i);return{x:M.toFixed(0),y:O.toFixed(0)}}),w=A[3],E=A[1];return{startX:parseFloat(w.x),startY:parseFloat(w.y),endX:parseFloat(E.x),endY:parseFloat(E.y)}}e.addEdge=({graph:l,options:n={}})=>{e.firstFlag=!0;const c=mxGraph.prototype.insertEdge;return mxGraph.prototype.insertEdge=function(u,d,i,g,p,f){return f===null&&(f=""),c.apply(this,arguments)},new Promise((u,d)=>{const{evt:i=null,data:g=null,pt:p={x:50,y:50},style:f,w:v=30,h:A=100,iconName:w="icon-general-icon"}=n;let E=p;l||(l=e.graph),i&&(E=l.getPointForEvent(i));let N=l.getDefaultParent(),M=l.getModel();M.beginUpdate();try{let O=ae(),L=l.insertEdge(N,null,"",null,null,f.perimeter+`;strokeWidth=${f.strokeWidth||1};strokeColor=${f.strokeColor||"#333333"}`);L.id=O;let U=new mxGeometry,{startX:V,startY:W,endX:R,endY:Y}=Ne(E,v,A);U.setTerminalPoint(new mxPoint(V,W),!0),U.setTerminalPoint(new mxPoint(R,Y),!1),L.setGeometry(U),L.model="yes",L.type="edge",L.iconName=w,L.value={data:{...g},style:{...f}},l.setSelectionCell(L),l.fireEvent(new mxEventObject(mxEvent.SELECTION_CHANGED,{cells:[L]})),l.refresh(L),e.firstStyle=!0,u(L)}finally{M.endUpdate()}})},e.createCustomComponent=({graph:l,options:n={}})=>new Promise((c,u)=>{const{evt:d=null,data:i=null,pt:g={x:50,y:50},id:p=null,style:f,w:v=100,h:A=30,type:w,tmpType:E,codeType:N,crtype:M="creatComp",other:O={},iconName:L="icon-general-icon",realType:U}=n;let V=v,W=A,R=g;l||(l=e.graph),d&&(R=l.getPointForEvent(d)),f.layout&&(V=f.layout.width,W=f.layout.height);let Y={width:V,height:W,x:R.x,y:R.y},G=i.children;if(G&&G.length>0){let _=G.find(ie=>ie.key=="layout");_.value=Y}f.layout=Y;let $=l.getDefaultParent(),te=l.getModel();oe(l),te.beginUpdate();try{let _=F(f),ie=p||ae(),Q=l.insertVertex($,ie,f.text||"",R.x,R.y,V,W,_);Q.crtype=M||"creatComp",Q.other=O,Q.cmp=E,Q.codeType=N,Q.type=w,Q.realType=U,Q.model="yes",Q.name=f.text||"",Q.iconName=L,Q.style=_,Q.value={data:i,style:f},l.setSelectionCell(Q),l.fireEvent(new mxEventObject(mxEvent.SELECTION_CHANGED,{cells:[Q]})),c(Q)}finally{te.endUpdate()}}),e.loadJson=()=>$e(e.graph),e.loadJsonToView=l=>{let n=tt(l);n&&B(n)},e.fromXmlToView=l=>{let n=e.graph;return new Promise((c,u)=>{let d=new mxFastOrganicLayout(n);d.forceConstant=140;const i=n.getStylesheet().getDefaultVertexStyle();i.fill="none",i[mxConstants.STYLE_STROKE]="none",n.getModel().beginUpdate();try{l&&B(l)}finally{n.getModel().endUpdate(),c()}})},e.main=l=>{let{container:n,xml:c}=l;return new Promise((u,d)=>{if(!mxClient.isBrowserSupported())mxUtils.error("Browser is not supported!",200,!1);else{let i=new mxEditor,g=i.graph;i.setGraphContainer(n),g.setEnabled(!1),g.setPanning(!1),g.setTooltips(!1),g.setHtmlLabels(!0),g.panningHandler.useLeftButtonForPanning=!0,g.isHtmlLabel=function(v){return!0},g.gridSize=10,e.graph=g,e.preview=!0;const f=g.getStylesheet().getDefaultVertexStyle();Object.assign(f,{fillColor:"transparent",strokeColor:"transparent",strokeWidth:0,fontColor:"#333333",fontSize:12}),g.convertValueToString=function(v){let{width:A,height:w}=v.geometry;if(v.type=="vertex"){let{url:E,pup:N}=de(v),M=v.value.style,O=v.value.data.children,L={};O&&(L=O.find(V=>V.key==="text"));let U=document.createElement("div");return U.innerHTML=D({img:(M==null?void 0:M.imgUrl)||"",text:L.value||M.text}),U.style=P(M),U.style.width=A+"px",U.style.height=w+"px",U.style.lineHeight=w+"px",E?(U.style.cursor="pointer",U.className="main-text hyperlink-btn",v.hyperlink=E):U.className="main-text",N&&(v.popup=N),U}else if(v.type=="kitUI:CanvasWidget"){let{width:E,height:N}=v.geometry,M=document.createElement("div");if(M.style.width=E+"px",M.style.height=N+"px",v.value){let O=v.value.style;O["background-image"]?M.style.background=`${O["background-image"]} center center no-repeat`:M.style.background=""}return M}else if(v.type=="img"){let E=document.createElement("div");return E.innerHTML=D({img:v.imgUrl||""}),E.style.width=A+"px",E.style.height=w+"px",E.className="main-img",E}return v.value},g.setPanning(!1),g.view.animate=!1,g.gridEnabled=!1,Ie(g),u(g)}})};function de(l){let n=l.value.data;if(n){let c=n.treeData||[],u=[],d=[];return c.forEach(i=>{let g=i.children||[],p=g.find(f=>f.key=="hyperlink"&&f.value!="null");p&&u.push(p),i.title=="PopupBinding"&&d.push(g)}),{url:u&&u.length>0?u[0].value:"",pup:d}}return null}e.addMask=(l,n,c,u,d)=>{let i=a(l.container,"transparentRect");if(i&&i.length>0)for(let g=0;g<i.length;g++){let p=i[g];p&&(p.style.top=c+"px",p.style.left=n+"px",p.style.width=u+"px",p.style.height=d+"px",p.style.zIndex="20",e.preview||(p.classList.remove("is-block"),p.classList.add("is-hidden")))}},e.initCanvas=l=>{const n=e.graph;return new Promise((c,u)=>{let d=n.getModel();const i=n.getDefaultParent();d.beginUpdate();try{const g=n.insertVertex(i,null,"",0,0,l?l.width:1e3,l?l.height:800,"transparent-node;fillColor=transparent;strokeColor=transparent;strokeWidth=0;consumeEvents=false;pointer-events:none;editable=0;selectable=0;clipping=1;order=999999;resizable=0");g.type="kitUI:CanvasWidget",g.resizable=!1,g.movable=!1,g.deletable=!1,g.selection=!1,g.value={style:{background:null,height:"800",horizontalAlign:"center",scrollBar:"hidden",verticalAlign:"center",viewSize:"1000,800",width:"1000"}},n.constrainChildren=!0,n.setCellsResizable(!1,[g]),g.collapsible=!1,g.automaticResize=!1,g.editable=!1,e.parent||(e.parent=g),n.refresh(g),setTimeout(()=>{e.changePageSize(l),e.undoMng&&e.clearUndo()},10),c()}finally{d.endUpdate()}})},e.changeRotationHandleStyle=l=>{mxGraphHandler.prototype.maxCells=mxClient.IS_IE?20:9999,mxConstants.GUIDELINE_WIDTH=1,mxConstants.VERTEX_SELECTION_DASHED=!1,mxConstants.HANDLE_SIZE=6,mxConstants.HANDLE_FILLCOLOR="#FD6902",mxConstants.HANDLE_STROKECOLOR="#FD6902",mxConstants.STYLE_SELECTION_STROKEWIDTH=2},e.testPosition=()=>{let l=e.graph,n=null,c=e.parent;c&&(n=c.value?c.value.style:null);let{x:u,y:d}=me(n,l.container),i=u,g=d;n.horizontalAlign==="end"&&(i=u-2),n.verticalAlign==="end"&&(g=d-2),e.addMask(l,i,g,n.width,n.height),l.getView().setTranslate(i,g)},e.getTranslate=l=>{let n=e.graph;const c=l.value?l.value.style:null;let{x:u,y:d}=me(c,n.container);return{x:u,y:d}},e.getFloatingPosition=l=>{let n=e.graph;if(!l){let i=n.getModel().cells;l=Object.values(i)}let c=l.filter(i=>i.crtype=="schedule"),u=l.find(i=>i.type=="kitUI:CanvasWidget");if(u){let{x:i,y:g}=e.getTranslate(u);i=i<0?0:i,g=g<0?0:g;for(let p=0;p<c.length;p++){let f=c[p];if(e.isPreview){let v=document.getElementsByClassName(f.id);for(let A=0;A<v.length;A++){const w=v[A];if(w){var d=f.getGeometry();w.style.position="absolute",w.style.width=d.width+"px",w.style.height=d.height+"px",w.style.left=d.x+i+"px",w.style.top=d.y+g+"px"}}}}}e.isPreview||c.forEach(i=>{n.getModel().setVisible(i,!0)})},e.changePageSize=l=>{if(!l){let n=e.parent;n&&(l=n.value?n.value.style:null)}if(l){let n=e.graph,c=n.getModel();c.beginUpdate();try{const u=e.parent;if(u){let d=n.getCellGeometry(u);if(d){let{x:i,y:g}=me(l,n.container);d.width=l.width,d.height=l.height,c.setGeometry(u,d);let p=n.container.querySelector("canvas");if(l.background)if(l.background.indexOf("files/")>-1){p&&(l["background-image"]?p.style.background=`${l["background-image"]} center center no-repeat`:p.style.background=l.background),n.container.parentElement.style.background="transparent";let A=document.querySelectorAll(".transparentRect");if(A){let w=(n.container.clientWidth-l.width)/2;A.forEach(E=>{E.style.boxShadow=`0 0 0 ${w}px #fff`})}}else{p&&(p.style.background="transparent"),l.fillColor=l.background,n.container.parentElement.style.background=l.background;let A=a(n.container,"transparentRect");if(A){let w=(n.container.clientWidth-l.width)/2;A.forEach(E=>{E.style.boxShadow=`0 0 0 ${w}px `+(l.background=="transparent"?"#fff":l.background)})}}else p&&(p.style.background="transparent");let f=i,v=g;l.horizontalAlign==="end"&&(f=i-2),l.verticalAlign==="end"&&(v=g-2),e.addMask(n,f,v,l.width,l.height),n.getView().setTranslate(f,v)}n.scrollCellToVisible(u,!1),e.parent=u,n.refresh(u)}c.setBounds=function(d){return new mxRectangle(0,0,l.width,l.height)}}finally{c.endUpdate(),z(n)}}};function Ie(l){l.addListener(mxEvent.CLICK,function(n,c){l.container.focus();const d=c.getProperty("cell");if(d)return t.handelEvent({key:"click",evt:c,val:d}),!1})}function sa(l){l.dblClick=function(n,c){if(!e.preview){if(c||(c=e.parent),c){let u=l.getModel();if(u.isVertex(c)||u.isEdge(c))return t.handelEvent({key:"db",evt:n,val:c}),!1}return!1}}}function da(l,n,c){let u=l.getModel(),d=function(i,g){n.undoableEditHappened(g.getProperty("edit"))};u.addListener(mxEvent.UNDO,d),l.getView().addListener(mxEvent.UNDO,d)}e.addCode=({code:l,pt:n,style:c,type:u,iconCls:d})=>{let i=e.graph;Ce(l,i,{pt:n,style:c,me:e,type:u,iconCls:d},t)},e.addEvent=({code:l,pt:n,style:c,type:u,iconCls:d})=>{let i=e.graph;Ce(l,i,{pt:n,style:c,me:e,type:u,iconCls:d},t)};function ca(l){l.addListener(mxEvent.RESIZE_CELLS,function(n,c){const u=c.getProperty("cells"),d=c.getProperty("bounds"),i=c.getProperty("previous"),g=l.getSelectionCells();u.forEach(p=>{if(l.getChildCells(p),l.getCellGeometry(p)){const v=parseFloat(d[0].width/i[0].width),A=parseFloat(d[0].height/i[0].height);g.forEach(w=>{if(w.id!=p.id){const N=l.getCellGeometry(w).clone();N.width*=v,N.height*=A,l.getModel().setGeometry(w,N)}})}}),setTimeout(()=>{l.setSelectionCells(g)},10),l.fireEvent(new mxEventObject(mxEvent.SELECTION_CHANGED,{cells:g}))})}function ua(l,n){mxEvent.addMouseWheelListener(function(c,u){e.preview||mxEvent.isConsumed(c)||c.ctrlKey&&(c.ctrlKey&&pa(c,l,u),e.changePageSize(),t.handelEvent({key:"wheel"}))},n)}function pa(l,n,c){mxEvent.consume(l);const u=n.getView().getScale(),d=c?1.1:1/1.1,i=u*d;if(i>3||i<.1)return;const g=n.container,p=g.offsetWidth,f=g.offsetHeight,v=p/2,A=f/2;n.getModel().beginUpdate();try{const w=n.getView(),E=w.getScale(),N=w.getTranslate(),M=v/E-N.x,O=A/E-N.y;n.getView().setScale(i);const L=v/i-N.x,U=A/i-N.y,V=L-M,W=U-O;w.setTranslate(w.getTranslate().x+V,w.getTranslate().y+W)}finally{n.getModel().endUpdate()}}function ma(l,n){n.popupMenuHandler.autoExpand=!0,n.popupMenuHandler.factoryMethod=function(c,u,d){if(e.preview)return;let i=mxClipboard.cells;if(!u)return;let g=[];u&&u.type!="kitUI:CanvasWidget"?(g=["new"],i||g.push("paste"),n.getSelectionCells().length<2&&g.push("order")):(g=["copy","cut","clone","del","order","toUp","toDown"],i||g.push("paste")),je(l,g).forEach(f=>{let v=null,A=null;f.children&&f.children.length>0?(v=null,A=f.children):v=function(){if(f.code){let E=n.getPointForEvent(d);t.contextmenus(d,{title:f.title,code:f.code||"",type:f.type,style:f.style,iconCls:f.iconCls,pt:E})}};let w=c.addItem(f.title,f.image,v,null,f.iconCls,f.disable,null,null,f.isBorder);A&&A.forEach(E=>{c.addItem(E.title,E.image,function(){if(E.code){let N=n.getPointForEvent(d);t.contextmenus(d,{title:E.title,code:E.code||"",type:E.type,style:E.style,iconCls:E.iconCls,pt:N})}},w,E.iconCls,E.disable,null,null,E.isBorder)})})}}}/*!
|
|
27
27
|
* vue-router v4.6.4
|
|
28
28
|
* (c) 2025 Eduardo San Martin Morote
|
|
29
29
|
* @license MIT
|
|
@@ -31,4 +31,4 @@
|
|
|
31
31
|
* vue-router v4.6.4
|
|
32
32
|
* (c) 2025 Eduardo San Martin Morote
|
|
33
33
|
* @license MIT
|
|
34
|
-
*/function Be(){return r.inject(Qt)}const De={init(t){let e=["/js/mxClient.js"];return new Promise(a=>{const s=document.getElementsByTagName("script");let o=!1;for(let x=0;x<s.length;x++)s[x].src.includes("mxClient.js")&&(o=!0);if(o)return a();let h=e.map(x=>{let S=document.createElement("script");return S.type="text/javascript",S.async=!1,S.src=x,document.head.appendChild(S),S}).pop();h.onload=a})}},Te=[{title:"新建",image:null,code:"new",iconCls:"iconfont icon-new",isBorder:!0,children:[{iconClass:"",code:"add",iconCls:"iconfont icon-binding-label",title:"标签",name:"grNewLabel",canNotUse:!1,type:"kitUI:BoundLabelWidget",style:"",child:!0},{iconClass:"",code:"add",iconCls:"iconfont icon-Imagefile",title:"图片",name:"grNewImg",canNotUse:!1,type:"kitUI:PictureWidget",style:"",child:!0},{code:"add",title:"矩形",image:null,iconCls:"iconfont icon-rectangle",type:"kitUI:ShapeRectWidget"},{code:"add",image:null,iconCls:"iconfont icon-rotundity",title:"圆形",type:"kitUI:ShapeCircleWidget"},{code:"add",iconCls:"iconfont icon-triangle",image:null,title:"等腰三角形",type:"kitUI:ShapeTriangleWidget"},{code:"add",iconCls:"iconfont icon-lingxing1",title:"棱形",disable:!1,type:"shape:Polygon"},{code:"add",iconCls:"iconfont icon-duobianxing-01",title:"正五边形",disable:!1,type:"shape:Pentagon"},{code:"add",iconCls:"iconfont icon-ziyuan",title:"正六边形",disable:!1,type:"shape:Hexagon"},{code:"add",iconCls:"iconfont icon-duobianxing",title:"任意多边形",disable:!1,type:"shape:Polygons"}]},{title:"复制",image:null,code:"copy",iconCls:"iconfont icon-copy"},{title:"克隆",image:null,code:"clone",iconCls:"iconfont icon-clone"},{title:"剪切",image:null,code:"cut",iconCls:"iconfont icon-cut"},{title:"粘贴",image:null,code:"paste",iconCls:"iconfont icon-paste"},{title:"删除",code:"del",image:null,iconCls:"iconfont icon-delete",isBorder:!0},{title:"排列",code:"order",image:null,iconCls:"iconfont icon-arrange",isBorder:!0,children:[{iconClass:"",code:"alignLeft",iconCls:"iconfont icon-left-align",title:"左对齐",name:"grNewLabel",canNotUse:!1,type:"kitUI:BoundLabelWidget",child:!0},{iconClass:"",code:"alignCenterHorizontal",iconCls:"iconfont icon-horizontal-center",title:"水平居中",name:"grNewLabel",canNotUse:!1,type:"kitUI:BoundLabelWidget",child:!0},{iconClass:"",code:"alignRight",iconCls:"iconfont icon-right-align",title:"右对齐",name:"grNewLabel",canNotUse:!1,type:"kitUI:BoundLabelWidget",child:!0},{iconClass:"",code:"alignCellsTop",iconCls:"iconfont icon-top-align",title:"顶端对齐",name:"grNewLabel",canNotUse:!1,type:"kitUI:BoundLabelWidget",child:!0},{iconClass:"",code:"alignCenterVertical",iconCls:"iconfont icon-vertical-center",title:"垂直居中",name:"grNewLabel",canNotUse:!1,type:"kitUI:BoundLabelWidget",child:!0},{iconClass:"",code:"alignCellsBottom",iconCls:"iconfont icon-bottom-align",title:"底端对齐",name:"grNewLabel",canNotUse:!1,type:"kitUI:BoundLabelWidget",child:!0}]},{title:"图层",code:"view",image:null,iconCls:"iconfont icon-view",isBorder:!0,children:[{title:"置顶",code:"toUp",image:null,iconCls:"iconfont icon-top"},{title:"置底",code:"toDown",image:null,iconCls:"iconfont icon-bottom",isBorder:!0},{title:"上一层",code:"upOne",image:null,iconCls:"iconfont icon-top"},{title:"下一层",code:"downOne",image:null,iconCls:"iconfont icon-bottom",isBorder:!0}]},{title:"编辑",code:"edit",image:null,disable:!0,iconCls:"iconfont icon-edit"}],Xt={components:{},props:{menus:{type:Array,default:Te},isShow:{type:Boolean,default:!1},isPreview:{type:Boolean,default:!1},currentIndex:{type:Number,default:0}},data(){return{graph:null,yhz:null,cell:null,loadCells:null,scale:1,pageShortcuts:!1,timeLineMap:[],updateRaf:null,keys:Math.random().toString(36).substring(2),compMap:[],pupAry:[],resizeObserver:null,isShowPup:!1,wndAry:[],thisObj:new Map,centeredWindow:[]}},watch:{isPreview:{handler(t,e){let a=this;a.yhz&&(a.yhz.isPreview(!t),a.$nextTick(()=>{t?(a.keys=Math.random().toString(36).substring(2),a.graph.refresh(),a.scheduleUpdateOverlay()):a.centeredWindow&&a.centeredWindow.forEach(o=>{o&&(o.setVisible(!1),o.destroy())})}))},immediate:!0,deep:!0}},methods:{getStyle(t){let e=this,s=t.cell.style||{};return e.yhz.scheduleBorder(s)},handleshowAndHide(t,e){},dynamicComponent(t){return this.compMap.get(t)},scheduleUpdateOverlay(){let t=this;this.updateRaf&&cancelAnimationFrame(this.updateRaf),this.updateRaf=requestAnimationFrame(()=>{t.$nextTick(()=>{var a=t.graph.getModel().cells,s=Object.values(a);let o=s.filter(m=>m.crtype=="schedule");for(let m=0;m<o.length;m++){let h=o[m];t.graph.view.validateCell(h)}}),this.$forceUpdate(),this.updateRaf=null})},async addTimeLine({cellAry:t,scheduleCombination:e}){let a=this;a.$nextTick(()=>{for(let s=0;s<t.length;s++){let o=t[s],m={id:o.id,cell:o,other:o.other,compId:o.id,show:!0};a.timeLineMap.push(m),a.thisObj.set(o.id,e)}a.compMap=Object.freeze(a.thisObj),this.$forceUpdate()})},removeKeyUpDown(){let t=this;t.yhz&&t.yhz.removeKeyUpDown()},keyUpdownEvent(){let t=this;t.yhz&&(t.yhz.keyUpdownEvent(),console.log("绑定键盘事件"))},addCode(t){let e=this;e.yhz&&e.yhz.addCode({code:t})},setPageShortcuts(t){let e=this;e.yhz&&(e.yhz.setPageShortcuts(t),e.pageShortcuts=t)},setIsPreview(t){let e=this;e.yhz&&(e.onResize(),e.yhz.isPreview(t))},clearUndo(){let t=this;if(t.yhz)return t.yhz.clearUndo()},zoomHome(){let t=this;t.graph.zoomTo(1),t.yhz.changePageSize()},redo(){let t=this;if(t.yhz)return t.handelEvent({key:"unre"}),t.yhz.redo()},undo(){let t=this;if(t.yhz)return t.handelEvent({key:"unre"}),t.yhz.undo()},canRedo(){let t=this;return t.yhz?t.yhz.canRedo():!1},canUndo(){let t=this;return t.yhz?t.yhz.canUndo():!1},view(){let t=this,e=this.cell,a={background:"#000",color:"#fff",border:"1px solid #fff"};t.yhz.updateCell(e,a)},changeSize(t){this.yhz.changePageSize(t)},preview(){Be().push({path:"/preview"})},contextmenus(t,e){e&&(this.yhz.addEvent(e),t.preventDefault(),t.stopPropagation())},changeTimeLineShow(){let t=this,e=[],a=t.graph.getModel();Object.values(a.cells).forEach(o=>{e.push(o.id)}),t.timeLineMap=t.timeLineMap.filter(o=>e.includes(o.id))},handelEvent(t){let e=this;e.cell=t.val,t.key=="delete"&&e.changeTimeLineShow(),e.$emit("handelEvent",t)},loadJson(){this.yhz.loadJson()},async loadXml(t,e){let a=this;t?a.yhz.fromXmlToView(t):a.yhz.initCanvas(null,a.$refs.transparentRectRef)},async init(){let t=this,e=t.$refs.geEditor;const a=new ze(t);if(!t.graph){let s=await a.init({container:e,menus:t.menus,pageShortcuts:t.pageShortcuts});t.graph=s,t.delCell(s),t.yhz=a,t.$emit("handelEvent",{key:"init",mygraph:s,yhz:a}),setTimeout(()=>{a.isPreview(!t.isPreview)},0)}},delCell(t){let e=this;t.addListener(mxEvent.DELETE_CELLS,(a,s)=>{const o=s.properties.cells;let m=[];o&&o.length>0&&(o.forEach(h=>{m.push(h.id)}),e.timeLineMap.forEach(h=>{m.includes(h.id)&&(h.show=!1)}))})},onResize(){let t=this;t.yhz&&(t.yhz.changePageSize(),t.yhz.getFloatingPosition())},clearCanvas(){let t=this;t.yhz&&t.yhz.clearCanvas()},openPupop(t,e=!0){let a=this;if(mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img"),this.closeImg.setAttribute("src",this.closeImage),this.closeImg.setAttribute("title","Close"),this.closeImg.style.marginLeft="2px",this.closeImg.style.cursor="default",this.closeImg.style.display="none",this.buttons.appendChild(this.closeImg),mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,async function(s){if(this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",s)),this.destroyOnClose)return await window.changeSchedule()&&this.destroy(),!1;await window.changeSchedule()&&this.setVisible(!1),mxEvent.consume(s)}))},a.pupAry=t,t&&t.length>0){a.centeredWindow&&a.centeredWindow.forEach(m=>{m&&(m.setVisible(!1),m.destroy())});let s=[];t.forEach((o,m)=>{var h=document.createElement("div");if(o.type==="img"){h.style.overflow="auto",h.style.width="100%",h.style.height="100%",h.style.display="flex",h.style.justifyContent="center",h.style.alignItems="center";var x=document.createElement("img");x.src=o.path,h.appendChild(x)}else if(o.type==="time"){let{el:P}=o.vnode;h.style.overflow="auto",h.style.width="100%",h.style.height="100%",h.appendChild(P)}else{h.style.overflow="auto",h.style.width="100%",h.style.height="100%",h.style.display="flex",h.style.justifyContent="center",h.style.alignItems="center";var S=o.pathHtml;h.appendChild(S)}let b=0,y=0;if(o.isCenter=="false")b=o.left,y=o.top;else{var C=document.getElementById("app"),D=C.clientWidth,z=C.clientHeight;b=(D-o.width)/2,y=(z-o.height)/2}b<0&&(b=0),y<0&&(y=0);var B=document.createElement("div");let k=document.querySelectorAll(".mx-window-mask");var T=new mxWindow(o.title,h,b,y,o.width,o.height,!1,!0,"mxWindowTitle");T.setClosable(!0),T.setMaximizable(!0),T.setScrollable(!0),T.setResizable(!0),T.setVisible(e),T.constrainWithinViewport=!0,T.addListener(mxEvent.CLOSE,function(P,F){return a.isShowPup=!1,k=document.querySelectorAll(".mx-window-mask"),k&&k.length>0&&k.forEach(j=>{j.style.display="none",j.remove()}),!1}),T.addListener(mxEvent.MOVE,function(P,F){var j=T.getX(),H=T.getY(),I=T.getElement().offsetWidth,Z=T.getElement().offsetHeight,K=document.documentElement.clientWidth,ee=document.documentElement.clientHeight,ne=0,oe=0,re=K-I,se=ee-Z;j=Math.max(ne,Math.min(j,re)),H=Math.max(oe,Math.min(H,se)),T.setLocation(j,H)}),T.div&&k.length==0&&(T.div.style.zIndex=2e3+m,B.className="mx-window-mask",B.style.zIndex=30+m,document.body.appendChild(B),B.style.display="block"),s.push(T)}),a.centeredWindow=s,a.wndAry=s}},getWindowInfo(){let t=this,e=t.wndAry;e&&e.length>0&&e.forEach((a,s)=>{if(a){let o=t.pupAry[s];o&&t.openPupop([o],a.isVisible())}})},debounce(t,e=200){let a=null;return function(...s){clearTimeout(a),a=setTimeout(()=>{t.apply(this,s)},e)}},debouncedScroll(t){let e=this;if(e.graph){var a=e.graph.container;a.addEventListener("scroll",function(){console.log("元素滚动:",a.scrollTop,a.scrollLeft)})}}},mounted(){let t=this,e=t.$refs.geEditor;De.init().then(()=>{t.init()}),t.resizeObserver=new ResizeObserver(a=>{t.onResize(null)}),t.resizeObserver.observe(e),window.addEventListener("resize",t.getWindowInfo)},unmounted(){let t=this;t.resizeObserver&&t.resizeObserver.disconnect(),t.isShowPup=!1,t.centeredWindow&&t.centeredWindow.forEach(a=>{a&&(a.setVisible(!1),a.destroy())}),window.removeEventListener("resize",t.getWindowInfo)}},Zt=["id"],Jt={key:0,class:"transparentRect"},qt=["id"];function Kt(t,e,a,s,o,m){return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["main-gd",{"show-scroll":a.isPreview}]),ref:"mainGd"},[r.createElementVNode("div",{class:r.normalizeClass(["main-body",{"hidden-scroll":a.isPreview}]),ref:"geEditor",id:a.currentIndex},null,10,Zt),a.isShow?(r.openBlock(),r.createElementBlock("div",Jt)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.timeLineMap,(h,x)=>r.withDirectives((r.openBlock(),r.createElementBlock("div",{key:h.id+o.keys,id:h.id,style:r.normalizeStyle([{position:"absolute"},m.getStyle(h)]),class:r.normalizeClass(h.id)},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.dynamicComponent(h.compId)),{id:h.other.timeId+"",thisTab:h.other.thisTab},null,8,["id","thisTab"]))],14,qt)),[[r.vShow,o.timeLineMap.length>0&&a.isPreview]])),128))],2)}const $t=q(Xt,[["render",Kt]]),ea={components:{},props:{menus:{type:Array,default:Te},isShow:{type:Boolean,default:!1},isPreview:{type:Boolean,default:!0},currentIndex:{type:Number,default:0}},data(){return{graph:null,yhz:null,cell:null,loadCells:null,scale:1,pageShortcuts:!1,timeLineMap:[],compMap:[],pupAry:[],resizeObserver:null,isShowPup:!1}},watch:{isPreview:{handler(t,e){let a=this;a.yhz&&(a.yhz.isPreview(!t),a.$nextTick(()=>{t?(a.keys=Math.random().toString(36).substring(2),a.graph.refresh(),a.scheduleUpdateOverlay()):window.centeredWindow&&window.centeredWindow.forEach(o=>{o&&(o.setVisible(!1),o.destroy())})}))},immediate:!0,deep:!0}},methods:{dynamicComponent(t){return this.compMap[t]},scheduleUpdateOverlay(){let t=this;this.updateRaf&&cancelAnimationFrame(this.updateRaf),this.updateRaf=requestAnimationFrame(()=>{t.$nextTick(()=>{var a=t.graph.getModel().cells,s=Object.values(a);let o=s.filter(m=>m.crtype=="schedule");for(let m=0;m<o.length;m++){let h=o[m];t.graph.view.validateCell(h)}}),this.$forceUpdate(),this.updateRaf=null})},async addTimeLine({cellAry:t,scheduleCombination:e}){let a=this;a.$nextTick(()=>{let s={};for(let o=0;o<t.length;o++){let m=t[o],h={id:m.id,cell:m,other:m.other,compId:m.id,show:!0};a.timeLineMap.push(h),s[m.id]=e}a.compMap=Object.freeze(s),this.$forceUpdate()})},removeKeyUpDown(){let t=this;t.yhz&&t.yhz.removeKeyUpDown()},keyUpdownEvent(){let t=this;t.yhz&&t.yhz.keyUpdownEvent()},addCode(t){let e=this;e.yhz&&e.yhz.addCode({code:t})},setPageShortcuts(t){let e=this;e.yhz&&(e.yhz.setPageShortcuts(t),e.pageShortcuts=t)},setIsPreview(t){let e=this;e.yhz&&(e.onResize(),e.yhz.isPreview(t))},clearUndo(){let t=this;if(t.yhz)return t.yhz.clearUndo()},zoomHome(){let t=this;t.graph.zoomTo(1),t.yhz.changePageSize()},redo(){let t=this;if(t.yhz)return t.handelEvent({key:"unre"}),t.yhz.redo()},undo(){let t=this;if(t.yhz)return t.handelEvent({key:"unre"}),t.yhz.undo()},canRedo(){let t=this;return t.yhz?t.yhz.canRedo():!1},canUndo(){let t=this;return t.yhz?t.yhz.canUndo():!1},view(){let t=this,e=this.cell,a={background:"#000",color:"#fff",border:"1px solid #fff"};t.yhz.updateCell(e,a)},changeSize(t){this.yhz.changePageSize(t)},preview(){Be().push({path:"/preview"})},contextmenus(t,e){e&&(this.yhz.addEvent(e),t.preventDefault(),t.stopPropagation())},handelEvent(t){let e=this;e.cell=t.val,e.$emit("handelEvent",t)},loadJson(){this.yhz.loadJson()},async loadXml(t,e){let a=this;t?a.yhz.fromXmlToView(t):a.yhz.initCanvas(null,a.$refs.transparentRectRef)},async init(){let t=this,e=t.$refs.geEditor;const a=new ze(t);if(!t.graph){let s=await a.init({container:e,menus:t.menus,pageShortcuts:t.pageShortcuts});t.graph=s,t.yhz=a,t.$emit("handelEvent",{key:"init",mygraph:s,yhz:a}),setTimeout(()=>{a.isPreview(!t.isPreview)},0)}},onResize(){let t=this;t.yhz&&t.yhz.changePageSize()},clearCanvas(){let t=this;t.yhz&&t.yhz.clearCanvas()},openPupop(t,e=!0){let a=this;if(a.pupAry=t,t&&t.length>0){window.centeredWindow&&window.centeredWindow.forEach(m=>{m&&(m.setVisible(!1),m.destroy())});let s=[];t.forEach(o=>{var m=document.createElement("div");if(o.type==="img"){m.style.overflow="auto",m.style.width="100%",m.style.height="100%",m.style.display="flex",m.style.justifyContent="center",m.style.alignItems="center";var h=document.createElement("img");h.src=o.path,m.appendChild(h)}else if(o.type==="time"){let{el:B}=o.vnode;m.style.overflow="auto",m.style.width="100%",m.style.height="100%",m.appendChild(B)}else{m.style.overflow="auto",m.style.width="100%",m.style.height="100%";var x=o.pathHtml;m.appendChild(x)}let S=0,b=0;if(o.isCenter=="false")S=o.left,b=o.top;else{var y=document.getElementById("app"),C=y.clientWidth,D=y.clientHeight;S=(C-o.width)/2,b=(D-o.height)/2}var z=new mxWindow(o.title,m,S,b,o.width,o.height,!0,!0,"mxWindowTitle");z.setClosable(!0),z.setMaximizable(!1),z.setResizable(!0),z.setVisible(e),z.constrainWithinViewport=!0,z.addListener(mxEvent.CLOSE,function(B,k){a.isShowPup=!1}),z.addListener(mxEvent.MOVE,function(B,k){var T=z.getX(),P=z.getY(),F=z.getElement().offsetWidth,j=z.getElement().offsetHeight,H=document.documentElement.clientWidth,I=document.documentElement.clientHeight,Z=0,K=0,ee=H-F,ne=I-j;T=Math.max(Z,Math.min(T,ee)),P=Math.max(K,Math.min(P,ne)),z.setLocation(T,P)}),s.push(z)}),window.centeredWindow=s,a.wndAry=s}}},mounted(){let t=this;De.init().then(()=>{t.init()}),t.resizeObserver=new ResizeObserver(e=>{e.forEach(a=>{const{width:s,height:o}=a.contentRect;t.onResize(),t.openPupop(t.pupAry)})}),t.resizeObserver.observe(t.$refs.geEditor)},unmounted(){let t=this;t.resizeObserver&&t.resizeObserver.disconnect(),t.isShowPup=!1,window.centeredWindow&&window.centeredWindow.forEach(a=>{a&&(a.setVisible(!1),a.destroy())})}},ta={class:"main-gd",ref:"mainGd"},aa=["id"],la={key:0,class:"transparentRect"},na=["id"];function ia(t,e,a,s,o,m){return r.openBlock(),r.createElementBlock("div",ta,[r.createElementVNode("div",{class:"main-body",ref:"geEditor",id:a.currentIndex},[a.isShow?(r.openBlock(),r.createElementBlock("div",la)):r.createCommentVNode("",!0),o.timeLineMap.length>0&&a.isPreview?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:1},r.renderList(o.timeLineMap,(h,x)=>(r.openBlock(),r.createElementBlock("div",{key:h.id,id:h.id,class:r.normalizeClass(h.id),style:r.normalizeStyle([{position:"absolute"},{zIndex:0}])},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.dynamicComponent(h.compId)),{id:h.other.timeId+"",thisTab:h.other.thisTab},null,8,["id","thisTab"]))],10,na))),128)):r.createCommentVNode("",!0)],8,aa)],512)}const oa=q(ea,[["render",ia]]);J.mxCodeSvg=$t,J.mxCodeSvgPreview=oa,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
|
|
34
|
+
*/function Be(){return r.inject(Qt)}const De={init(t){let e=["/js/mxClient.js"];return new Promise(a=>{const s=document.getElementsByTagName("script");let o=!1;for(let x=0;x<s.length;x++)s[x].src.includes("mxClient.js")&&(o=!0);if(o)return a();let h=e.map(x=>{let S=document.createElement("script");return S.type="text/javascript",S.async=!1,S.src=x,document.head.appendChild(S),S}).pop();h.onload=a})}},Te=[{title:"新建",image:null,code:"new",iconCls:"iconfont icon-new",isBorder:!0,children:[{iconClass:"",code:"add",iconCls:"iconfont icon-binding-label",title:"标签",name:"grNewLabel",canNotUse:!1,type:"kitUI:BoundLabelWidget",style:"",child:!0},{iconClass:"",code:"add",iconCls:"iconfont icon-Imagefile",title:"图片",name:"grNewImg",canNotUse:!1,type:"kitUI:PictureWidget",style:"",child:!0},{code:"add",title:"矩形",image:null,iconCls:"iconfont icon-rectangle",type:"kitUI:ShapeRectWidget"},{code:"add",image:null,iconCls:"iconfont icon-rotundity",title:"圆形",type:"kitUI:ShapeCircleWidget"},{code:"add",iconCls:"iconfont icon-triangle",image:null,title:"等腰三角形",type:"kitUI:ShapeTriangleWidget"},{code:"add",iconCls:"iconfont icon-lingxing1",title:"棱形",disable:!1,type:"shape:Polygon"},{code:"add",iconCls:"iconfont icon-duobianxing-01",title:"正五边形",disable:!1,type:"shape:Pentagon"},{code:"add",iconCls:"iconfont icon-ziyuan",title:"正六边形",disable:!1,type:"shape:Hexagon"},{code:"add",iconCls:"iconfont icon-duobianxing",title:"任意多边形",disable:!1,type:"shape:Polygons"}]},{title:"复制",image:null,code:"copy",iconCls:"iconfont icon-copy"},{title:"克隆",image:null,code:"clone",iconCls:"iconfont icon-clone"},{title:"剪切",image:null,code:"cut",iconCls:"iconfont icon-cut"},{title:"粘贴",image:null,code:"paste",iconCls:"iconfont icon-paste"},{title:"删除",code:"del",image:null,iconCls:"iconfont icon-delete",isBorder:!0},{title:"排列",code:"order",image:null,iconCls:"iconfont icon-arrange",isBorder:!0,children:[{iconClass:"",code:"alignLeft",iconCls:"iconfont icon-left-align",title:"左对齐",name:"grNewLabel",canNotUse:!1,type:"kitUI:BoundLabelWidget",child:!0},{iconClass:"",code:"alignCenterHorizontal",iconCls:"iconfont icon-horizontal-center",title:"水平居中",name:"grNewLabel",canNotUse:!1,type:"kitUI:BoundLabelWidget",child:!0},{iconClass:"",code:"alignRight",iconCls:"iconfont icon-right-align",title:"右对齐",name:"grNewLabel",canNotUse:!1,type:"kitUI:BoundLabelWidget",child:!0},{iconClass:"",code:"alignCellsTop",iconCls:"iconfont icon-top-align",title:"顶端对齐",name:"grNewLabel",canNotUse:!1,type:"kitUI:BoundLabelWidget",child:!0},{iconClass:"",code:"alignCenterVertical",iconCls:"iconfont icon-vertical-center",title:"垂直居中",name:"grNewLabel",canNotUse:!1,type:"kitUI:BoundLabelWidget",child:!0},{iconClass:"",code:"alignCellsBottom",iconCls:"iconfont icon-bottom-align",title:"底端对齐",name:"grNewLabel",canNotUse:!1,type:"kitUI:BoundLabelWidget",child:!0}]},{title:"图层",code:"view",image:null,iconCls:"iconfont icon-view",isBorder:!0,children:[{title:"置顶",code:"toUp",image:null,iconCls:"iconfont icon-top"},{title:"置底",code:"toDown",image:null,iconCls:"iconfont icon-bottom",isBorder:!0},{title:"上一层",code:"upOne",image:null,iconCls:"iconfont icon-top"},{title:"下一层",code:"downOne",image:null,iconCls:"iconfont icon-bottom",isBorder:!0}]},{title:"编辑",code:"edit",image:null,disable:!0,iconCls:"iconfont icon-edit"}],Xt={components:{},props:{menus:{type:Array,default:Te},isShow:{type:Boolean,default:!1},isPreview:{type:Boolean,default:!1},currentIndex:{type:Number,default:0}},data(){return{graph:null,yhz:null,cell:null,loadCells:null,scale:1,pageShortcuts:!1,timeLineMap:[],updateRaf:null,keys:Math.random().toString(36).substring(2),compMap:[],pupAry:[],resizeObserver:null,isShowPup:!1,wndAry:[],thisObj:new Map,centeredWindow:[]}},watch:{isPreview:{handler(t,e){let a=this;a.yhz&&(a.yhz.isPreview(!t),a.$nextTick(()=>{t?(a.keys=Math.random().toString(36).substring(2),a.graph.refresh(),a.scheduleUpdateOverlay(),a.timeLineMap.length>0&&a.timeLineMap.forEach(s=>{s.cell.setVisible(!1)})):(a.timeLineMap.length>0&&a.timeLineMap.forEach(s=>{s.cell.setVisible(!0)}),a.centeredWindow&&a.centeredWindow.forEach(o=>{o&&(o.setVisible(!1),o.destroy())}))}))},immediate:!0,deep:!0}},methods:{getStyle(t){let e=this,s=t.cell.style||{};return e.yhz.scheduleBorder(s)},handleshowAndHide(t,e){},dynamicComponent(t){return this.compMap.get(t)},scheduleUpdateOverlay(){let t=this;this.updateRaf&&cancelAnimationFrame(this.updateRaf),this.updateRaf=requestAnimationFrame(()=>{t.$nextTick(()=>{var a=t.graph.getModel().cells,s=Object.values(a);let o=s.filter(m=>m.crtype=="schedule");for(let m=0;m<o.length;m++){let h=o[m];t.graph.view.validateCell(h)}}),this.$forceUpdate(),this.updateRaf=null})},async addTimeLine({cellAry:t,scheduleCombination:e}){let a=this;a.$nextTick(()=>{for(let s=0;s<t.length;s++){let o=t[s],m={id:o.id,cell:o,other:o.other,compId:o.id,show:!0};a.timeLineMap.push(m),a.thisObj.set(o.id,e)}a.compMap=Object.freeze(a.thisObj),this.$forceUpdate()})},removeKeyUpDown(){let t=this;t.yhz&&t.yhz.removeKeyUpDown()},keyUpdownEvent(){let t=this;t.yhz&&(t.yhz.keyUpdownEvent(),console.log("绑定键盘事件"))},addCode(t){let e=this;e.yhz&&e.yhz.addCode({code:t})},setPageShortcuts(t){let e=this;e.yhz&&(e.yhz.setPageShortcuts(t),e.pageShortcuts=t)},setIsPreview(t){let e=this;e.yhz&&(e.onResize(),e.yhz.isPreview(t))},clearUndo(){let t=this;if(t.yhz)return t.yhz.clearUndo()},zoomHome(){let t=this;t.graph.zoomTo(1),t.yhz.changePageSize()},redo(){let t=this;if(t.yhz)return t.handelEvent({key:"unre"}),t.yhz.redo()},undo(){let t=this;if(t.yhz)return t.handelEvent({key:"unre"}),t.yhz.undo()},canRedo(){let t=this;return t.yhz?t.yhz.canRedo():!1},canUndo(){let t=this;return t.yhz?t.yhz.canUndo():!1},view(){let t=this,e=this.cell,a={background:"#000",color:"#fff",border:"1px solid #fff"};t.yhz.updateCell(e,a)},changeSize(t){this.yhz.changePageSize(t)},preview(){Be().push({path:"/preview"})},contextmenus(t,e){e&&(this.yhz.addEvent(e),t.preventDefault(),t.stopPropagation())},changeTimeLineShow(){let t=this,e=[],a=t.graph.getModel();Object.values(a.cells).forEach(o=>{e.push(o.id)}),t.timeLineMap=t.timeLineMap.filter(o=>e.includes(o.id))},handelEvent(t){let e=this;e.cell=t.val,t.key=="delete"&&e.changeTimeLineShow(),e.$emit("handelEvent",t)},loadJson(){this.yhz.loadJson()},async loadXml(t,e){let a=this;t?a.yhz.fromXmlToView(t):a.yhz.initCanvas(null,a.$refs.transparentRectRef)},async init(){let t=this,e=t.$refs.geEditor;const a=new ze(t);if(!t.graph){let s=await a.init({container:e,menus:t.menus,pageShortcuts:t.pageShortcuts});t.graph=s,t.delCell(s),t.yhz=a,t.$emit("handelEvent",{key:"init",mygraph:s,yhz:a}),setTimeout(()=>{a.isPreview(!t.isPreview)},0)}},delCell(t){let e=this;t.addListener(mxEvent.DELETE_CELLS,(a,s)=>{const o=s.properties.cells;let m=[];o&&o.length>0&&(o.forEach(h=>{m.push(h.id)}),e.timeLineMap.forEach(h=>{m.includes(h.id)&&(h.show=!1)}))})},onResize(){let t=this;t.yhz&&(t.yhz.changePageSize(),t.yhz.getFloatingPosition())},clearCanvas(){let t=this;t.yhz&&t.yhz.clearCanvas()},openPupop(t,e=!0){let a=this;if(mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img"),this.closeImg.setAttribute("src",this.closeImage),this.closeImg.setAttribute("title","Close"),this.closeImg.style.marginLeft="2px",this.closeImg.style.cursor="default",this.closeImg.style.display="none",this.buttons.appendChild(this.closeImg),mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,async function(s){if(this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",s)),this.destroyOnClose)return await window.changeSchedule()&&this.destroy(),!1;await window.changeSchedule()&&this.setVisible(!1),mxEvent.consume(s)}))},a.pupAry=t,t&&t.length>0){a.centeredWindow&&a.centeredWindow.forEach(m=>{m&&(m.setVisible(!1),m.destroy())});let s=[];t.forEach((o,m)=>{var h=document.createElement("div");if(o.type==="img"){h.style.overflow="auto",h.style.width="100%",h.style.height="100%",h.style.display="flex",h.style.justifyContent="center",h.style.alignItems="center";var x=document.createElement("img");x.src=o.path,h.appendChild(x)}else if(o.type==="time"){let{el:P}=o.vnode;h.style.overflow="auto",h.style.width="100%",h.style.height="100%",h.appendChild(P)}else{h.style.overflow="auto",h.style.width="100%",h.style.height="100%",h.style.display="flex",h.style.justifyContent="center",h.style.alignItems="center";var S=o.pathHtml;h.appendChild(S)}let b=0,y=0;if(o.isCenter=="false")b=o.left,y=o.top;else{var C=document.getElementById("app"),D=C.clientWidth,z=C.clientHeight;b=(D-o.width)/2,y=(z-o.height)/2}b<0&&(b=0),y<0&&(y=0);var B=document.createElement("div");let k=document.querySelectorAll(".mx-window-mask");var T=new mxWindow(o.title,h,b,y,o.width,o.height,!1,!0,"mxWindowTitle");T.setClosable(!0),T.setMaximizable(!0),T.setScrollable(!0),T.setResizable(!0),T.setVisible(e),T.constrainWithinViewport=!0,T.addListener(mxEvent.CLOSE,function(P,F){return a.isShowPup=!1,k=document.querySelectorAll(".mx-window-mask"),k&&k.length>0&&k.forEach(j=>{j.style.display="none",j.remove()}),!1}),T.addListener(mxEvent.MOVE,function(P,F){var j=T.getX(),H=T.getY(),I=T.getElement().offsetWidth,Z=T.getElement().offsetHeight,K=document.documentElement.clientWidth,ee=document.documentElement.clientHeight,ne=0,oe=0,re=K-I,se=ee-Z;j=Math.max(ne,Math.min(j,re)),H=Math.max(oe,Math.min(H,se)),T.setLocation(j,H)}),T.div&&k.length==0&&(T.div.style.zIndex=2e3+m,B.className="mx-window-mask",B.style.zIndex=30+m,document.body.appendChild(B),B.style.display="block"),s.push(T)}),a.centeredWindow=s,a.wndAry=s}},getWindowInfo(){let t=this,e=t.wndAry;e&&e.length>0&&e.forEach((a,s)=>{if(a){let o=t.pupAry[s];o&&t.openPupop([o],a.isVisible())}})},debounce(t,e=200){let a=null;return function(...s){clearTimeout(a),a=setTimeout(()=>{t.apply(this,s)},e)}},debouncedScroll(t){let e=this;if(e.graph){var a=e.graph.container;a.addEventListener("scroll",function(){console.log("元素滚动:",a.scrollTop,a.scrollLeft)})}}},mounted(){let t=this,e=t.$refs.geEditor;De.init().then(()=>{t.init()}),t.resizeObserver=new ResizeObserver(a=>{t.onResize(null)}),t.resizeObserver.observe(e),window.addEventListener("resize",t.getWindowInfo)},unmounted(){let t=this;t.resizeObserver&&t.resizeObserver.disconnect(),t.isShowPup=!1,t.centeredWindow&&t.centeredWindow.forEach(a=>{a&&(a.setVisible(!1),a.destroy())}),window.removeEventListener("resize",t.getWindowInfo)}},Zt=["id"],Jt={key:0,class:"transparentRect"},qt=["id"];function Kt(t,e,a,s,o,m){return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["main-gd",{"show-scroll":a.isPreview}]),ref:"mainGd"},[r.createElementVNode("div",{class:r.normalizeClass(["main-body",{"hidden-scroll":a.isPreview}]),ref:"geEditor",id:a.currentIndex},null,10,Zt),a.isShow?(r.openBlock(),r.createElementBlock("div",Jt)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.timeLineMap,(h,x)=>r.withDirectives((r.openBlock(),r.createElementBlock("div",{key:h.id+o.keys,id:h.id,style:r.normalizeStyle([{position:"absolute"},m.getStyle(h)]),class:r.normalizeClass(h.id)},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.dynamicComponent(h.compId)),{id:h.other.timeId+"",thisTab:h.other.thisTab},null,8,["id","thisTab"]))],14,qt)),[[r.vShow,o.timeLineMap.length>0&&a.isPreview]])),128))],2)}const $t=q(Xt,[["render",Kt]]),ea={components:{},props:{menus:{type:Array,default:Te},isShow:{type:Boolean,default:!1},isPreview:{type:Boolean,default:!0},currentIndex:{type:Number,default:0}},data(){return{graph:null,yhz:null,cell:null,loadCells:null,scale:1,pageShortcuts:!1,timeLineMap:[],compMap:[],pupAry:[],resizeObserver:null,isShowPup:!1}},watch:{isPreview:{handler(t,e){let a=this;a.yhz&&(a.yhz.isPreview(!t),a.$nextTick(()=>{t?(a.keys=Math.random().toString(36).substring(2),a.graph.refresh(),a.scheduleUpdateOverlay()):window.centeredWindow&&window.centeredWindow.forEach(o=>{o&&(o.setVisible(!1),o.destroy())})}))},immediate:!0,deep:!0}},methods:{dynamicComponent(t){return this.compMap[t]},scheduleUpdateOverlay(){let t=this;this.updateRaf&&cancelAnimationFrame(this.updateRaf),this.updateRaf=requestAnimationFrame(()=>{t.$nextTick(()=>{var a=t.graph.getModel().cells,s=Object.values(a);let o=s.filter(m=>m.crtype=="schedule");for(let m=0;m<o.length;m++){let h=o[m];t.graph.view.validateCell(h)}}),this.$forceUpdate(),this.updateRaf=null})},async addTimeLine({cellAry:t,scheduleCombination:e}){let a=this;a.$nextTick(()=>{let s={};for(let o=0;o<t.length;o++){let m=t[o],h={id:m.id,cell:m,other:m.other,compId:m.id,show:!0};a.timeLineMap.push(h),s[m.id]=e}a.compMap=Object.freeze(s),this.$forceUpdate()})},removeKeyUpDown(){let t=this;t.yhz&&t.yhz.removeKeyUpDown()},keyUpdownEvent(){let t=this;t.yhz&&t.yhz.keyUpdownEvent()},addCode(t){let e=this;e.yhz&&e.yhz.addCode({code:t})},setPageShortcuts(t){let e=this;e.yhz&&(e.yhz.setPageShortcuts(t),e.pageShortcuts=t)},setIsPreview(t){let e=this;e.yhz&&(e.onResize(),e.yhz.isPreview(t))},clearUndo(){let t=this;if(t.yhz)return t.yhz.clearUndo()},zoomHome(){let t=this;t.graph.zoomTo(1),t.yhz.changePageSize()},redo(){let t=this;if(t.yhz)return t.handelEvent({key:"unre"}),t.yhz.redo()},undo(){let t=this;if(t.yhz)return t.handelEvent({key:"unre"}),t.yhz.undo()},canRedo(){let t=this;return t.yhz?t.yhz.canRedo():!1},canUndo(){let t=this;return t.yhz?t.yhz.canUndo():!1},view(){let t=this,e=this.cell,a={background:"#000",color:"#fff",border:"1px solid #fff"};t.yhz.updateCell(e,a)},changeSize(t){this.yhz.changePageSize(t)},preview(){Be().push({path:"/preview"})},contextmenus(t,e){e&&(this.yhz.addEvent(e),t.preventDefault(),t.stopPropagation())},handelEvent(t){let e=this;e.cell=t.val,e.$emit("handelEvent",t)},loadJson(){this.yhz.loadJson()},async loadXml(t,e){let a=this;t?a.yhz.fromXmlToView(t):a.yhz.initCanvas(null,a.$refs.transparentRectRef)},async init(){let t=this,e=t.$refs.geEditor;const a=new ze(t);if(!t.graph){let s=await a.init({container:e,menus:t.menus,pageShortcuts:t.pageShortcuts});t.graph=s,t.yhz=a,t.$emit("handelEvent",{key:"init",mygraph:s,yhz:a}),setTimeout(()=>{a.isPreview(!t.isPreview)},0)}},onResize(){let t=this;t.yhz&&t.yhz.changePageSize()},clearCanvas(){let t=this;t.yhz&&t.yhz.clearCanvas()},openPupop(t,e=!0){let a=this;if(a.pupAry=t,t&&t.length>0){window.centeredWindow&&window.centeredWindow.forEach(m=>{m&&(m.setVisible(!1),m.destroy())});let s=[];t.forEach(o=>{var m=document.createElement("div");if(o.type==="img"){m.style.overflow="auto",m.style.width="100%",m.style.height="100%",m.style.display="flex",m.style.justifyContent="center",m.style.alignItems="center";var h=document.createElement("img");h.src=o.path,m.appendChild(h)}else if(o.type==="time"){let{el:B}=o.vnode;m.style.overflow="auto",m.style.width="100%",m.style.height="100%",m.appendChild(B)}else{m.style.overflow="auto",m.style.width="100%",m.style.height="100%";var x=o.pathHtml;m.appendChild(x)}let S=0,b=0;if(o.isCenter=="false")S=o.left,b=o.top;else{var y=document.getElementById("app"),C=y.clientWidth,D=y.clientHeight;S=(C-o.width)/2,b=(D-o.height)/2}var z=new mxWindow(o.title,m,S,b,o.width,o.height,!0,!0,"mxWindowTitle");z.setClosable(!0),z.setMaximizable(!1),z.setResizable(!0),z.setVisible(e),z.constrainWithinViewport=!0,z.addListener(mxEvent.CLOSE,function(B,k){a.isShowPup=!1}),z.addListener(mxEvent.MOVE,function(B,k){var T=z.getX(),P=z.getY(),F=z.getElement().offsetWidth,j=z.getElement().offsetHeight,H=document.documentElement.clientWidth,I=document.documentElement.clientHeight,Z=0,K=0,ee=H-F,ne=I-j;T=Math.max(Z,Math.min(T,ee)),P=Math.max(K,Math.min(P,ne)),z.setLocation(T,P)}),s.push(z)}),window.centeredWindow=s,a.wndAry=s}}},mounted(){let t=this;De.init().then(()=>{t.init()}),t.resizeObserver=new ResizeObserver(e=>{e.forEach(a=>{const{width:s,height:o}=a.contentRect;t.onResize(),t.openPupop(t.pupAry)})}),t.resizeObserver.observe(t.$refs.geEditor)},unmounted(){let t=this;t.resizeObserver&&t.resizeObserver.disconnect(),t.isShowPup=!1,window.centeredWindow&&window.centeredWindow.forEach(a=>{a&&(a.setVisible(!1),a.destroy())})}},ta={class:"main-gd",ref:"mainGd"},aa=["id"],la={key:0,class:"transparentRect"},na=["id"];function ia(t,e,a,s,o,m){return r.openBlock(),r.createElementBlock("div",ta,[r.createElementVNode("div",{class:"main-body",ref:"geEditor",id:a.currentIndex},[a.isShow?(r.openBlock(),r.createElementBlock("div",la)):r.createCommentVNode("",!0),o.timeLineMap.length>0&&a.isPreview?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:1},r.renderList(o.timeLineMap,(h,x)=>(r.openBlock(),r.createElementBlock("div",{key:h.id,id:h.id,class:r.normalizeClass(h.id),style:r.normalizeStyle([{position:"absolute"},{zIndex:0}])},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.dynamicComponent(h.compId)),{id:h.other.timeId+"",thisTab:h.other.thisTab},null,8,["id","thisTab"]))],10,na))),128)):r.createCommentVNode("",!0)],8,aa)],512)}const oa=q(ea,[["render",ia]]);J.mxCodeSvg=$t,J.mxCodeSvgPreview=oa,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
|