xframelib 0.6.3 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +82 -78
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
基于 VUE3+Hprose+Typescript 的前端框架
|
|
4
4
|
|
|
5
|
+
- v0.6.4 调整LayoutContainer层级;修改centerDiv的默认pointer-events
|
|
5
6
|
- v0.6.3
|
|
6
7
|
升级基础库;完善LayoutContainer增加enableRouterView控制是否启用内置的RouterView;H5Tool增加dispatchWindowResize和dispatchElementEvent主动触发元素事件
|
|
7
8
|
- v0.6.2 增加计算完整MD5值和文件上传导出问题;部分小问题修改;增加窗体同步消息库WSynchro.js;
|
package/dist/index.cjs
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
>
|
|
16
16
|
<path d="M6.34292 7.75734L4.92871 9.17155L11.9998 16.2426L19.0708 9.17158L17.6566 7.75737L11.9998 13.4142L6.34292 7.75734Z"/>
|
|
17
17
|
</svg>
|
|
18
|
-
`}}});const zi={class:"vcp__header-title"},Mi={key:0,class:"vcp__header-icon"},_i=["innerHTML"],Ii={key:0,ref:"bodyRef",class:"vcp__body"},Ri={ref:"bodyContentRef",class:"vcp__body-content"};function Dt(e){return window.TouchEvent&&e instanceof TouchEvent}We.render=function(e,t,n,r,i,o){return w.openBlock(),w.createElementBlock("section",{ref:"panelRef",class:w.normalizeClass(["vcp",{"vcp--expanded":e.isExpanded,"vcp--expandable":e.body.hasContent}])},[w.createElementVNode("header",{class:"vcp__header",onClick:t[0]||(t[0]=(...l)=>e.toggle&&e.toggle(...l))},[w.createElementVNode("div",zi,[w.renderSlot(e.$slots,"title")]),e.body.hasContent?(w.openBlock(),w.createElementBlock("div",Mi,[w.renderSlot(e.$slots,"icon",{},()=>[w.createElementVNode("span",{innerHTML:e.toggleIcon},null,8,_i)])])):w.createCommentVNode("v-if",!0)]),w.createVNode(w.Transition,{"data-key":e.body.dataKey,name:"slide",onBeforeEnter:e.collapse,onEnter:e.expand,onBeforeLeave:e.expand,onLeave:e.collapse},{default:w.withCtx(()=>[e.isExpanded?(w.openBlock(),w.createElementBlock("div",Ii,[w.createElementVNode("div",Ri,[w.renderSlot(e.$slots,"content")],512)],512)):w.createCommentVNode("v-if",!0)]),_:3},8,["data-key","onBeforeEnter","onEnter","onBeforeLeave","onLeave"])],2)},We.__scopeId="data-v-08c94cf8",We.__file="src/controls/collapsepanel/VCollapsiblePanel.vue";class J{e;constructor(t){this.e=t}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return Dt(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return Dt(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new Xt(this.clientX,this.clientY)}static bindDown(t,n,r,i=!1){const o=d=>{n(new J(d))},l=d=>{d.touches.length===1&&n(new J(d)),d.touches.length>1&&r&&r(new J(d))};return t.addEventListener("mousedown",o,i),t.addEventListener("touchstart",l,i),()=>{t.removeEventListener("mousedown",o,i),t.removeEventListener("touchstart",l,i)}}static bindMove(t,n,r=!1){const i=l=>{n(new J(l))},o=l=>{l.touches.length===1&&n(new J(l))};return t.addEventListener("mousemove",i,r),t.addEventListener("touchmove",o,r),()=>{t.removeEventListener("mousemove",i,r),t.removeEventListener("touchmove",o,r)}}static bindUp(t,n,r=!1){const i=l=>{n(new J(l))},o=l=>{l.touches.length===0&&n(new J(l))};return t.addEventListener("mouseup",i,r),t.addEventListener("touchend",o,r),()=>{t.removeEventListener("mouseup",i,r),t.removeEventListener("touchend",o,r)}}originalEvent({mouse:t,touch:n}){Dt(this.e)?n&&n(this.e):t&&t(this.e)}}class Xt{x;y;constructor(t,n){this.x=t,this.y=n}clone(){return new Xt(this.x,this.y)}}class Bi{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(t,n,r={}){this.handle=t,this.container=n,this.options=r,t&&(this.unbindDown=J.bindDown(t,this.mousedown),t.classList.add("draggable-handle"))}teardown(){this.handle?.classList.remove("draggable-handle"),this.unbindDown&&this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove()}offsetX;offsetY;mousedown=t=>{if(t.preventDefault(),this.handle){const{left:n,top:r}=this.handle.getBoundingClientRect();this.offsetX=t.clientX-n,this.offsetY=t.clientY-r}this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=J.bindMove(document,this.mousemove),this.unbindUp=J.bindUp(document,this.mouseup)};mousemove=t=>{this.container&&(this.container.style.left=t.clientX-this.offsetX+"px",this.container.style.top=t.clientY-this.offsetY+"px"),this.options.onMove&&this.options.onMove()};mouseup=t=>{this.options.onMoveEnd&&this.options.onMoveEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0}}class Li{_group;onChange;zIndex;constructor(t,n){this._group=t,this.onChange=n,this.a(r=>r.push(this))}set group(t){this._group=t;const n=qe(this._group),r=qe(t);n.splice(n.indexOf(this),1),r.push(this),Hn()}get group(){return this._group}unregister(){this.a(t=>t.splice(t.indexOf(this),1))}raise(){this.a(t=>{t.splice(t.indexOf(this),1),t.push(this)})}a(t){t(qe(this._group)),Hn()}}const He=new Map;function qe(e){return He.has(e)||He.set(e,[]),He.get(e)}function Wn(e,t){return e>t?-Wn(t,e):e<0&&t>=0?1:e-t}function Hn(){let e=0;for(const t of function(n){const r=[];return n.forEach((i,o)=>r.push(o)),r}(He).sort(Wn))for(const n of qe(t))e!=n.zIndex&&(n.zIndex=e,n.onChange(e)),e++}function Tt(e){if(e){const{width:t,height:n}=e.style;e.style.width="auto",e.style.height="auto";const r=Ge(e);return e.style.width=t,e.style.height=n,r}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function Ge(e){const t=e.getBoundingClientRect(),n=t.width,r=t.height,i=t.top,o=t.left;return{width:n,height:r,top:i,left:o,bottom:i+r,right:o+n}}class Pi{container;options;handles;constructor(t,n){if(this.container=t,this.options=n,t&&n){this.handles=qn.map(v=>new v(t,this));const{width:r,height:i}=Tt(t),o=n.maxWidth||window.innerWidth,l=n.maxHeight||window.innerHeight;let d=!1;(r<n.minWidth||r>o)&&(t.style.width=`${Gn(r,n.minWidth,o)}px`,d=!0),(i<n.minHeight||i>l)&&(t.style.height=`${Gn(i,n.minHeight,l)}px`,d=!0),d&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(t=>t.teardown())}}const qn=[];class ue{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(t,n){this.container=t,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=J.bindDown(this.handle,this.mousedown)}teardown(){this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove(),this.handle.parentElement.removeChild(this.handle)}x0;y0;left0;top0;width0;height0;mousedown=t=>{t.preventDefault(),t.stopPropagation();const{left:n,top:r,width:i,height:o}=Ge(this.container);this.x0=t.clientX,this.y0=t.clientY,this.left0=n,this.top0=r,this.width0=i,this.height0=o,this.calcSafeBoundaries(),this.helper.options&&this.helper.options.onResizeStart&&this.helper.options.onResizeStart(),this.unbindMove=J.bindMove(document,this.mousemove),this.unbindUp=J.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:t,top:n,right:r,bottom:i}=Ge(this.container),o=this.helper.options,l=o.maxWidth||window.innerWidth,d=o.maxHeight||window.innerHeight;this.minLeft=Math.max(r-l,0),this.maxLeft=r-o.minWidth,this.minRight=t+o.minWidth,this.maxRight=Math.min(t+l,window.innerWidth),this.minTop=Math.max(i-d,0),this.maxTop=i-o.minHeight,this.minBottom=n+o.minHeight,this.maxBottom=Math.min(n+d,window.innerHeight)}mousemove=t=>{t.preventDefault(),t.stopPropagation(),this.setPosition(t),this.fixPosition(),this.helper.options&&this.helper.options.onResize&&this.helper.options.onResize()};fixPosition(){const{width:t,height:n,left:r,top:i,right:o,bottom:l}=Ge(this.container),d=this.helper.options;!d||(r<this.minLeft?(this.container.style.width=t+r-this.minLeft+"px",this.container.style.left=`${this.minLeft}px`):r>this.maxLeft?(this.container.style.width=`${d.minWidth}px`,this.container.style.left=`${this.maxLeft}px`):o<this.minRight?this.container.style.width=`${d.minWidth}px`:o>this.maxRight&&(this.container.style.width=this.maxRight-r+"px"),i<this.minTop?(this.container.style.height=n+i-this.minTop+"px",this.container.style.top=`${this.minTop}px`):i>this.maxTop?(this.container.style.height=`${d.minHeight}px`,this.container.style.top=`${this.maxTop}px`):l<this.minBottom?this.container.style.height=`${d.minHeight}px`:l>this.maxBottom&&(this.container.style.height=this.maxBottom-i+"px"))}mouseup=t=>{t.preventDefault(),t.stopPropagation(),this.helper.options&&this.helper.options.onResizeEnd&&this.helper.options.onResizeEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0};createHandleElement(){const t=document.createElement("div"),n=t.style;return n.position="absolute",this.applyStyle(n),this.container.appendChild(t),t}}function Gn(e,t,n){return e<t?t:e>n?n:e}qn.push(class extends ue{setPosition(e){this.container.style.width=this.width0+e.clientX-this.x0+"px",this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.right=-this.handleSize+"px",e.bottom=-this.handleSize+"px",e.cursor="nwse-resize"}},class extends ue{setPosition(e){this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.right=`${this.handleSize}px`,e.left=`${this.handleSize}px`,e.height=2*this.handleSize+"px",e.bottom=-this.handleSize+"px",e.cursor="ns-resize"}},class extends ue{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px",this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.bottom=-this.handleSize+"px",e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.cursor="nesw-resize"}},class extends ue{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.bottom=`${this.handleSize}px`,e.width=2*this.handleSize+"px",e.top=`${this.handleSize}px`,e.cursor="ew-resize"}},class extends ue{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px",this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.top=-this.handleSize+"px",e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.cursor="nwse-resize"}},class extends ue{setPosition(e){this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px"}applyStyle(e){e.left=`${this.handleSize}px`,e.right=`${this.handleSize}px`,e.height=2*this.handleSize+"px",e.top=-this.handleSize+"px",e.cursor="ns-resize"}},class extends ue{setPosition(e){this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px",this.container.style.width=this.width0+e.clientX-this.x0+"px"}applyStyle(e){e.right=-this.handleSize+"px",e.top=-this.handleSize+"px",e.height=2*this.handleSize+"px",e.width=2*this.handleSize+"px",e.cursor="nesw-resize"}},class extends ue{setPosition(e){this.container.style.width=this.width0+e.clientX-this.x0+"px"}applyStyle(e){e.right=-this.handleSize+"px",e.top=`${this.handleSize}px`,e.bottom=`${this.handleSize}px`,e.width=2*this.handleSize+"px",e.cursor="ew-resize"}});var Ve=w.defineComponent({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(e){const t=w.ref(!1),n=w.ref(!1);return{hover:t,active:n,style:function(){let r=e.windowStyle.button;return t.value&&(r={...r,...this.windowStyle.buttonHover}),n.value&&(r={...r,...this.windowStyle.buttonActive}),r},mouseup:function(r){this.active&&this.$emit("click")},mousedown:function(r){r.preventDefault(),n.value=!0;const i=J.bindUp(document,()=>{n.value=!1,i()})}}}});const Ai=["disabled"];Ve.render=function(e,t,n,r,i,o){return w.openBlock(),w.createElementBlock("div",{class:"btn",style:w.normalizeStyle(e.style()),onMouseenter:t[0]||(t[0]=l=>e.hover=!0),onMouseleave:t[1]||(t[1]=l=>e.hover=!1),onMousedown:t[2]||(t[2]=w.withModifiers((...l)=>e.mousedown&&e.mousedown(...l),["stop"])),onTouchstart:t[3]||(t[3]=w.withModifiers((...l)=>e.mousedown&&e.mousedown(...l),["stop"])),onMouseup:t[4]||(t[4]=(...l)=>e.mouseup&&e.mouseup(...l)),onTouchend:t[5]||(t[5]=(...l)=>e.mouseup&&e.mouseup(...l)),disabled:e.disabled},[w.renderSlot(e.$slots,"default")],44,Ai)},Ve.__scopeId="data-v-71662210",Ve.__file="src/controls/vuewindow/window/Button.vue";const Nt=new Set;function Vn(e){return e!==null?parseFloat(e):0}function Xe(e){const t=window.getComputedStyle(e),n=Math.ceil([t.paddingLeft,t.width,t.paddingRight].map(Vn).reduce((i,o)=>i+o)),r=Math.ceil([t.paddingTop,t.height,t.paddingBottom].map(Vn).reduce((i,o)=>i+o));return{width:n,height:r}}class Xn{width;height;constructor(t,n){this.width=t,this.height=n}}function Di(e){const t=e.windowEl;if(t){const n=parseFloat(t.style.left||"NaN"),r=parseFloat(t.style.top||"NaN");if(!isNaN(n)&&!isNaN(r))return{left:n,top:r}}return null}function Ti(e,t,n,r){const i=e-n,o=t-r;return i*i+o*o}window.addEventListener("resize",e=>{Nt.forEach(t=>{t&&_e(t.fixPosition)&&t.fixPosition()})});const Ke=[];var Ye=w.defineComponent({name:"Window",props:{windowStyle:{type:Object,required:!0},isOpen:{type:Boolean,required:!1,default:!0},title:{type:String,required:!0,default:""},closeButton:{type:Boolean,required:!1,default:!0},resizable:{type:Boolean,required:!1,default:!1},isScrollable:{type:Boolean,required:!1,default:!1},padding:{type:Number,required:!1,default:8},activateWhenOpen:{type:Boolean,required:!1,default:!0},positionHint:{type:String,required:!1,default:""},zGroup:{type:Number,required:!1,default:1},overflow:{type:String,required:!1,default:"visible"},minWidth:{type:Number,required:!1,default:1},minHeight:{type:Number,required:!1,default:0},maxWidth:{type:Number,required:!1,default:0},maxHeight:{type:Number,required:!1,default:0},height:{type:Number,required:!1},width:{type:Number,required:!1},top:{type:Number,required:!1},left:{type:Number,required:!1}},components:{myButton:Ve},setup(e,{emit:t}){const n=w.getCurrentInstance();if(!n)return;const{proxy:r}=n;let i=0,o,l,d;const v=w.ref(e.isOpen),S=()=>{Ke.push(r),d=new Li(e.zGroup,E),e.isOpen&&function(B){B&&(w.nextTick(()=>{i++==0&&(f(r),function(){const L=k.value,{width:U,height:F}=Tt(L);let j,H;if(e.left!==void 0!=(e.top!==void 0))throw new Error("Either of left or top is specified. Both must be set or not set.");if(typeof e.left=="number")j=e.left,H=e.top;else{const Z=e.positionHint||"auto";switch(Z){case"auto":{let V=20,X=50,q=0;do{if(Ke.every(ne=>{if(!ne.isOpen||r==ne)return!0;const Ee=Di(ne);if(Ee==null)return!0;const{left:nt,top:ee}=Ee;return Ti(nt,ee,V,X)>16}))break;V=(V+40)%(window.innerWidth-200),X=(X+40)%(window.innerHeight-200)}while(++q<100);j=V,H=X}break;case"center":j=(window.innerWidth-U)/2,H=(window.innerHeight-F)/2,console.log(j,H,window.innerWidth,window.innerHeight,"111111");break;default:try{const V=Z.split("/").map(Number);if(V.length!=2)throw null;const[X,q]=V;if(!isFinite(X)||!isFinite(q))throw null;j=X>=0?X:window.innerWidth-U+X,H=q>=0?q:window.innerHeight-F+q}catch{throw new Error(`invalid position string: ${Z}`)}}}L&&(L.style.left=`${j}px`,L.style.top=`${H}px`)}()),e.resizable&&h(),A(),o=new Bi(P.value,k.value,{onMove:()=>A(),onMoveStart:()=>t("move-start"),onMoveEnd:()=>t("move-end")}),e.resizable&&function(){const{height:L}=Tt(P.value);l=new Pi(k.value,{onResize:()=>h(),onResizeStart:()=>t("resize-start"),onResizeEnd:()=>t("resize-end"),minWidth:e.minWidth,minHeight:e.minHeight+L,maxWidth:e.maxWidth,maxHeight:e.maxHeight?e.maxHeight+L:void 0})}()}),e.activateWhenOpen&&R())}(!0),Nt.add(r)};function E(B){C.value.zIndex=`${B}`}const k=w.ref(null),P=w.ref(null),N=w.ref(null);function R(){d.raise(),t("activate")}const C=w.ref({...e.windowStyle.window,zIndex:"auto",overflow:e.overflow}),u=w.computed(()=>e.windowStyle.titlebar),p=w.computed(()=>{const B={...e.windowStyle.content};return e.resizable?B.padding="0":e.padding!=null&&(B.padding=`${e.padding}px`),e.isScrollable&&(B.overflow="auto"),B});function f(B){const{width:L,height:U,top:F,left:j}=B,H=k;if(H&&L!=null&&(H.value.style.width=`${L}px`),U!=null){const Z=P.value;if(Z){const V=Xe(Z).height;H.value.style.height=`${U+V}px`}}H&&j!=null&&(H.value.style.left=`${j}px`),H&&F!=null&&(H.value.style.top=`${F}px`)}function h(B=!0){const L=k.value,U=P.value,F=N.value;if(F&&L&&U){const{width:j,height:H}=Xe(F),{width:Z,height:V}=Xe(L),X=Xe(U).height,q=Z-(F.offsetWidth-j),ne=V-X-(F.offsetHeight-H);F.style.width=`${q}px`,F.style.height=`${ne}px`,g(),t("resize",new Xn(q,ne)),B&&(t("update:width",q),t("update:height",ne))}}function g(){const B=k.value;if(B){const L=B.getBoundingClientRect();L.left<0&&(C.value.left="0px"),L.top<0&&(C.value.top="0px"),L.right>window.innerWidth&&(C.value.left=window.innerWidth-L.width+"px"),L.bottom>window.innerHeight&&(C.value.top=window.innerHeight-L.height+"px")}}function A(B=!0){g();const L=k.value;if(L){const{left:U,top:F}=L.getBoundingClientRect();B&&(t("update:left",U),t("update:top",F))}}return w.watch(()=>e.isOpen,B=>{v.value=B}),w.watch(()=>e.zGroup,B=>{d.group=B}),w.watch(()=>e.width,B=>{f({width:B}),h(!1)}),w.watch(()=>e.height,B=>{f({height:B}),h(!1)}),w.onMounted(()=>{S()}),w.onBeforeUnmount(()=>{Nt.delete(this),d.unregister(),l&&l.teardown(),o&&o.teardown(),Ke.splice(Ke.indexOf(r),1)}),{isOpen:v,windowEl:k,titlebar:P,content:N,activate:R,styleWindow:C,styleTitlebar:u,styleContent:p,closeButtonClick:function(){v.value=!1,t("closebuttonclick")},fixPosition:g}}});const Ni={class:"title"},Oi=w.createTextVNode("\xD7");var Kn;Ye.render=function(e,t,n,r,i,o){const l=w.resolveComponent("myButton");return w.openBlock(),w.createBlock(w.Transition,{name:"fade",onAfterLeave:t[2]||(t[2]=d=>e.$emit("close")),onAfterEnter:t[3]||(t[3]=d=>e.$emit("open")),persisted:""},{default:w.withCtx(()=>[w.withDirectives(w.createElementVNode("div",{class:"window",style:w.normalizeStyle(e.styleWindow),ref:"windowEl",onMousedown:t[0]||(t[0]=(...d)=>e.activate&&e.activate(...d)),onTouchstart:t[1]||(t[1]=(...d)=>e.activate&&e.activate(...d))},[w.createElementVNode("div",{class:"titlebar",style:w.normalizeStyle(e.styleTitlebar),ref:"titlebar"},[w.createElementVNode("div",Ni,[e.$slots.title?w.renderSlot(e.$slots,"title",{key:0}):(w.openBlock(),w.createElementBlock(w.Fragment,{key:1},[w.createTextVNode(w.toDisplayString(e.title),1)],64))]),e.closeButton?(w.openBlock(),w.createBlock(l,{key:0,windowStyle:e.windowStyle,onClick:e.closeButtonClick},{default:w.withCtx(()=>[Oi]),_:1},8,["windowStyle","onClick"])):w.createCommentVNode("v-if",!0)],4),w.createElementVNode("div",{class:"content",style:w.normalizeStyle(e.styleContent),ref:"content"},[w.renderSlot(e.$slots,"default")],4)],36),[[w.vShow,e.isOpen]])]),_:3})},Ye.__file="src/controls/vuewindow/window/index.vue",function(e){e[e.StyleBlack=0]="StyleBlack",e[e.StyleWhite=1]="StyleWhite",e[e.StyleMetal=2]="StyleMetal",e[e.StyleGrayblue=3]="StyleGrayblue"}(Kn||(Kn={}));const Ui=Ye;exports.LayoutContainerEnum=void 0,function(e){e[e.top=0]="top",e[e.bottom=1]="bottom",e[e.centerBack=2]="centerBack",e[e.centerMain=3]="centerMain",e[e.centerFront=4]="centerFront",e[e.left=5]="left",e[e.right=6]="right"}(exports.LayoutContainerEnum||(exports.LayoutContainerEnum={}));class Yn{layoutState;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;widgetConfig=new Array;_LayoutID;constructor(t,n,r){this.layoutState=t,this._LayoutID=r,n.forEach(i=>{if(i.layoutID===r&&(this.widgetConfig.push(i),i.afterid))if(this.preConditionMap.has(i.afterid))this.preConditionMap.get(i.afterid)?.add(i);else{const o=new Set;o.add(i),this.preConditionMap.set(i.afterid,o)}})}getLayoutID(){return this._LayoutID}getWidgetConfig(){return this.widgetConfig}preloadWidgets(){this.widgetConfig.filter(t=>t.preload&&!t.afterid).forEach(t=>{this._loadWidget(t)})}async loadWidget(t){if(!t)return;let n;return le(t)?n=t:Ie(t)&&(n=this.widgetConfig.find(r=>r.id===t)),n?n.afterid?(this.isWidgetLoaded(n.afterid)||await this.loadWidget(n.afterid),this._loadWidget(n)):this._loadWidget(n):void 0}loadOtherDependenceWidgets(t){this.preConditionMap.has(t)&&this.preConditionMap.get(t)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(t){if(!this.widgetsLoadedSet.has(t.id))return t.component().then(n=>{if(n.default){const r=w.markRaw(n.default);this.getContainerComponents(t.container).value.set(t.id,r),this.widgetsLoadedSet.add(t.id),w.nextTick().then(()=>{T.EventBus.emit(Q.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:t.id}),this.loadOtherDependenceWidgets(t.id)})}})}hasDependentWidgets(t){let n=!1;if(this.preConditionMap.has(t)){const r=this.preConditionMap.get(t);if(r){for(const i of r)if(this.isWidgetLoaded(i.id)){n=!0;break}}}return n}unloadWidget(t){if(!t||!this.isWidgetLoaded(t))return;const n=this.widgetConfig.find(r=>r.id===t);if(n){if(this.preConditionMap.has(t)){const o=this.preConditionMap.get(t);if(o)for(const l of o)this.unloadWidget(l.id)}const r=this.getContainerComponents(n.container),i=r.value.get(t);i&&i.unmounted&&i.unmounted(),r.value.delete(t),this.widgetsLoadedSet.delete(t),T.EventBus.emit(Q.WidgetUnLoadedEvent,{layoutID:this._LayoutID,widgetID:t})}}isWidgetLoaded(t){return this.widgetsLoadedSet.has(t)}splitTwoContainer(t=!1){const n=this.layoutState.centerMainContainer,r=this.layoutState.centerBackContainer;t?(n&&(n.style.left="0",n.style.width="100%"),r&&(r.style.width="100%")):(n&&(n.style.left="50%",n.style.width="50%"),r&&(r.style.width="50%"))}getLayoutContainer(t){switch(t){case exports.LayoutContainerEnum.top:return this.layoutState.topContainer;case exports.LayoutContainerEnum.bottom:return this.layoutState.bottomContainer;case exports.LayoutContainerEnum.left:return this.layoutState.leftContainer;case exports.LayoutContainerEnum.right:return this.layoutState.rightContainer;case exports.LayoutContainerEnum.centerBack:return this.layoutState.centerBackContainer;case exports.LayoutContainerEnum.centerMain:return this.layoutState.centerMainContainer;case exports.LayoutContainerEnum.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(t,n=!1){const r=this.getLayoutContainer(t);r&&(r.style.visibility=n?"visible":"hidden")}changeWidgetVisible(t,n=!1){const r=this.getWidgetComponent(t);r&&T.EventBus.emit(Q.WidgetVisibleChanged,{id:t,layoutID:this._LayoutID,name:r.name,visible:n})}getWidgetComponent(t){if(this.widgetsLoadedSet.has(t)){const n=this.widgetConfig.find(r=>r.id===t);if(n)return this.getContainerComponents(n.container).value.get(t)}}getWigetItem(t){return this.widgetConfig.find(n=>n.id===t)}getGroupWigetItems(t){return this.widgetConfig.filter(n=>n.group===t)}getContainerComponents(t){if(this.layoutMap.has(t))return this.layoutMap.get(t);{const n=w.ref(new Map);return this.layoutMap.set(t,n),n}}addContainerComponent(t,n){}}var Je=w.defineComponent({name:"MainContainer",props:{widgetConfig:{type:Array,required:!0,default:()=>[]},layoutID:{type:String,default:void 0},layoutStyle:{type:Object},enableRouterView:{type:Boolean,default:!0}},emits:["containerLoaded"],setup(e,{attrs:t,slots:n,emit:r}){const i=e.layoutID,o=w.ref(e.enableRouterView);w.watch(()=>e.enableRouterView,()=>{o.value=e.enableRouterView});const l=w.reactive({topContainer:void 0,centerBackContainer:void 0,centerMainContainer:void 0,centerFrontContainer:void 0,bottomContainer:void 0,leftContainer:void 0,rightContainer:void 0}),d=new Yn(l,e.widgetConfig,i),v=R(exports.LayoutContainerEnum.top),S=R(exports.LayoutContainerEnum.centerBack),E=R(exports.LayoutContainerEnum.centerFront),k=R(exports.LayoutContainerEnum.left),P=R(exports.LayoutContainerEnum.right),N=R(exports.LayoutContainerEnum.bottom);function R(u){return d?.getContainerComponents(u)}const C=w.computed(()=>e.layoutStyle);return w.onMounted(()=>{d&&(d.preloadWidgets(),i===void 0&&(T.LayoutManager=d),r("containerLoaded",{layoutID:i,layoutManager:d}))}),{...w.toRefs(l),topContainerComponents:v,centerbackComponents:S,centerfrontComponents:E,leftContainerComponents:k,rightContainerComponents:P,bottomContainerComponents:N,containerStyle:C,isEnableRouterView:o}}});const ji={ref:"topContainer",class:"topContainer"},Fi={ref:"centerBackContainer",class:"centerdiv backContainer"},$i={key:0,ref:"centerMainContainer",class:"centerdiv mainContainer"},Wi={ref:"centerFrontContainer",class:"centerdiv centerContainer"},Hi={ref:"leftContainer",class:"leftContainer"},qi={ref:"rightContainer",class:"rightContainer"},Gi={ref:"bottomContainer",class:"bottomContainer"};Je.render=function(e,t,n,r,i,o){const l=w.resolveComponent("router-view");return w.openBlock(),w.createElementBlock("div",{class:"layoutContainer",style:w.normalizeStyle(e.containerStyle)},[w.createElementVNode("div",ji,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(e.topContainerComponents,([d,v])=>(w.openBlock(),w.createBlock(w.resolveDynamicComponent(v),{key:d}))),128))],512),w.createElementVNode("div",null,[w.createCommentVNode(" \u5E95\u5C42-\u4E3B\u5BB9\u5668 "),w.createElementVNode("div",Fi,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(e.centerbackComponents,([d,v])=>(w.openBlock(),w.createBlock(w.resolveDynamicComponent(v),{key:d}))),128))],512),w.createCommentVNode(" \u4E3B\u8981\u5BB9\u5668 "),e.isEnableRouterView?(w.openBlock(),w.createElementBlock("div",$i,[w.createVNode(l,null,{default:w.withCtx(({Component:d})=>[(w.openBlock(),w.createBlock(w.resolveDynamicComponent(d)))]),_:1})],512)):w.createCommentVNode("v-if",!0),w.createCommentVNode(" \u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),w.createElementVNode("div",Wi,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(e.centerfrontComponents,([d,v])=>(w.openBlock(),w.createBlock(w.resolveDynamicComponent(v),{key:d}))),128))],512),w.createElementVNode("div",Hi,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(e.leftContainerComponents,([d,v])=>(w.openBlock(),w.createBlock(w.resolveDynamicComponent(v),{key:d}))),128))],512),w.createElementVNode("div",qi,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(e.rightContainerComponents,([d,v])=>(w.openBlock(),w.createBlock(w.resolveDynamicComponent(v),{key:d}))),128))],512)]),w.createElementVNode("div",Gi,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(e.bottomContainerComponents,([d,v])=>(w.openBlock(),w.createBlock(w.resolveDynamicComponent(v),{key:d}))),128))],512)],4)},Je.__scopeId="data-v-4d081e5c",Je.__file="src/controls/layoutcontainer/layout.vue";const Ze=new Map,Ot=new Map;let Qe;const Vi={getDefaultClient(){if(Qe||(Qe=new we(SysConfig.DefaultHproseAPI)),!Qe)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return Qe},registerHprose(e,t){const n=Ot.get(e);if(!n){const r=new we(t);Ze.set(e,r)}return n},getHprose:e=>Ot?.get(e),getProxyHprose:e=>Ze.get(e),unregisterHprose(e){Ze.get(e)&&(Ot.delete(e),Ze.delete(e))}},fe={Login:"/api/User/Login",ChangeMyPwd:"/api/User/ChangeMyPwd",Logout:"/api/Check/ExitLogin",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken",GetSystemRights:"/api/System/GetSystem"},Ut="access_token",Xi=T.Config.ServiceURL.LoginAuthURL;function jt(){const e=Cn();e&&oe(fe.RefreshToken,Xi,{refreshToken:e}).then(t=>{Ft(t.data)})}function Jn(){const e=ie.getJsonObject(Ut);if(!e)return;const t=new Date().getTime(),n=new Date(e.expire).getTime()-t;n>0&&(n<=5e3?jt():setTimeout(jt,n-5e3))}function Ft(e){const t=new Date().getTime();let n=new Date(e.accessToken.expires).getTime()-t;if(n>=36e5?(n=18e5,T.Message?.err("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u8FC7\u53BB\u65F6\u95F4\uFF01")):n<-6e5&&(n=18e5,T.Message?.err("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u672A\u6765\u65F6\u95F4\uFF01")),n>0){let r=he();r?(r.token=e.accessToken.tokenContent,r.expire=e.accessToken.expires,r.refresh=e.refreshToken.tokenContent):r={token:e.accessToken.tokenContent,expire:e.accessToken.expires,refresh:e.refreshToken.tokenContent},ie.set(Ut,r,n/1e3),Jn()}else ie.remove(Ut)}const et="Wm314243",tt=T.Config.ServiceURL.LoginAuthURL,$t="ROLE_SYSTEM_RIGHT",Wt=new Be("",sessionStorage);function Zn(){return Wt.get($t)}function Ht(e){Wt.set($t,e)}function Qn(){Wt.remove($t)}function ve(e){if(e)for(let t=0;t<e.length;t++){const n=e[t];n.children&&n.children.length>0?(ve(n.children),n.children.length===0&&(e.splice(t,1),t--)):n.selected||(e.splice(t,1),t--)}}function er(e,t,n="name"){e&&t&&e.forEach(r=>{const i=t.find(o=>o[n]===r[n]);i&&(r.children?i.children&&er(r.children,i.children,n):(!i.children||i.children.length===0)&&i.selected&&(r.selected=i.selected))})}function Se(e,t,n,r="name"){const i=e[n],o=t[n];i?o&&er(i,o,r):o&&(e[n]=o)}function tr(e){if(e&&e.length>0){const t=e.length;let n,r=!1;if(t>0){r=le(e[0]);const i=r?e[0]:JSON.parse(e[0]);if(t>1)for(let o=1;o<e.length;o++){const l=e[o],d=r?l:JSON.parse(l);Se(i,d,"routes","name"),Se(i,d,"widgetMenu","name"),Se(i,d,"widgets","id"),Se(i,d,"functions","id")}n=i}return n&&(ve(n.routes),ve(n.widgetMenu),ve(n.widgets),ve(n.functions)),n}}const qt=[],Gt=[],Vt=[];function Ce(){return Zn()}function nr(e,t){const n={...e};return n.meta||(n.meta={}),t.index!=null&&(n.meta.index=t.index),t.title!=null&&(n.meta.title=t.title),e.children&&(n.children=[],t.children&&t.children.forEach(r=>{const i=e.children?.find(o=>o.path===r.path);if(i){const o=nr(i,r);o&&n.children?.push(o)}})),n}function rr(e,t){const n={...e};return t.index!=null&&(n.index=t.index),e.children&&(n.children=[],t.children&&t.children.forEach(r=>{const i=e.children?.find(o=>o.name===r.name);if(i){const o=rr(i,r);o&&n.children?.push(o)}})),n}exports.BigFileDownload=class{fileID;downloadURL;ChunkUnitM=1048576;chunkByteSize;totalChunks=1;currentDB;keys;fileMetaData=null;finishNum=0;eventTarget;cancelSource;isStarting=!1;fileName;cacheSize=6;requestTimeout=6e4;constructor(e,t,n=3,r=6,i=6e4){this.fileID=e,this.downloadURL=t,this.chunkByteSize=n*this.ChunkUnitM,this.eventTarget=Ct(),this.initIndexDB(),r>=3&&(this.cacheSize=r),i>this.requestTimeout&&(this.requestTimeout=i)}on(e,t){this.eventTarget.on(e,t)}dispatch(e,t){this.eventTarget.emit(e,t)}dispatchError(e){this.eventTarget.emit("error",e)}dispatchInfo(e){this.eventTarget.emit("info",e)}async queryDownloadFileMeta(e,t="",n){this.dispatchInfo("\u5F00\u59CB\u83B7\u53D6\u6587\u4EF6\u4FE1\u606F");const r=await oe(t,e,n);let i=null;return r&&r.status===200&&(i=r.data),i}async getIFileMeta(){if(this.fileMetaData===null){const e=await this.currentDB?.getItem("fileinfo");this.fileMetaData=e||null}return this.fileMetaData}initIndexDB(){this.currentDB=Te.createInstance({name:this.fileID,driver:Te.INDEXEDDB})}async init(e){if(this.finishNum=0,e){const t="fileinfo";this.fileMetaData={id:e.id,name:e.name,length:e.length,downloadID:e.downloadID,chunkSize:this.chunkByteSize},this.fileName=e.name,this.currentDB?.setItem(t,this.fileMetaData)}if(this.fileMetaData!=null){const t=this.fileMetaData.chunkSize;t!=null&&t>0&&(this.chunkByteSize=t)}this.fileMetaData&&(this.totalChunks=Math.ceil(this.fileMetaData.length/this.chunkByteSize)),this.dispatchInfo("\u5B8C\u6210\u521D\u59CB\u5316\u6587\u4EF6\u4FE1\u606F\uFF0C\u603B\u5206\u7247\uFF1A"+this.totalChunks),this.currentDB&&(this.keys=await this.currentDB.keys())}getTotalChunks(){return this.totalChunks}pause(){this.cancelSource&&this.isStarting&&(this.cancelSource.cancel(),this.isStarting=!1),this.dispatchInfo("\u5DF2\u6682\u505C\u4E0B\u8F7D\u4EFB\u52A1")}restart(){this.dispatchInfo("\u6B63\u5728\u91CD\u542F\u4E0B\u8F7D\u4EFB\u52A1"),this.download()}delete(){this.cancelSource&&this.cancelSource.cancel(),Te.dropInstance({name:this.fileID}),this.currentDB=void 0,this.keys&&(this.keys.length=0,this.keys=void 0),this.finishNum=0,this.downloadProgress(),this.outputProgress(0),this.dispatchInfo("\u5DF2\u5220\u9664\u4E0B\u8F7D\u4EFB\u52A1")}sleep(e){return new Promise(t=>setTimeout(t,e))}async download(e,t){let n=e;if(!n&&this.downloadURL&&(n=this.downloadURL),!n)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const r=T.Axios.CancelToken;this.cancelSource=r.source(),this.isStarting=!0;const i={key:this.fileMetaData?.downloadID};let o=0;const l=this.cacheSize;let d=0;for(let v=0;v<this.totalChunks;v++){if(this.keys&&this.keys?.indexOf(v.toString())>=0){o++,o>this.finishNum&&(this.finishNum=o,this.downloadProgress());continue}const S=v*this.chunkByteSize;let E=S+this.chunkByteSize-1;this.fileMetaData&&E>this.fileMetaData.length&&(E=this.fileMetaData.length-1);const k={range:`bytes=${S}-${E}`};for(;d>=l;)await this.sleep(200);const P=v.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${v+1}/${this.totalChunks}`),d++,oe(n,t,i,k,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async N=>{const R=N.data;d--,await this.currentDB?.setItem(P,R),o++,o>this.finishNum&&(this.finishNum=o,this.downloadProgress());const C=parseInt(P)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${C}/${this.totalChunks}`),this.savefile()}).catch(N=>{d--;const R=parseInt(P)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${R}\uFF09\u4E2A\u5206\u7247\u5185\u5BB9\u5931\u8D25\uFF01`)})}this.finishNum===this.totalChunks&&this.savefile()}downloadProgress(){const e=100*this.finishNum/this.totalChunks;this.dispatch("downloadProgress",e)}outputProgress(e){const t=100*e/this.totalChunks;this.dispatch("saveProgress",t)}async savefile(){if(this.finishNum===this.totalChunks){if(!this.fileName)return void this.dispatchError("\u4E0B\u8F7D\u9519\u8BEF\uFF1A\u6587\u4EF6\u540D\u4E3A\u7A7A!");this.dispatchInfo("\u5F00\u59CB\u4FDD\u5B58\u4E0B\u8F7D\u6587\u4EF6:"+this.fileName);const e=Ci.createWriteStream(this.fileName).getWriter();let t=0;for(let n=0;n<this.totalChunks;n++){const r=n.toString();let i=await this.currentDB?.getItem(r);if(i||(i=await this.currentDB?.getItem(r)),!i)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${n+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);let o=new Response(i).body;if(o===null)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${n+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);const l=o.getReader();for(;;){const{done:d,value:v}=await l.read();if(d)break;await e.write(v)}t++,this.outputProgress(t),this.dispatchInfo(`\u5B8C\u6210\u7B2C${n+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}e.close(),Te.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}},exports.Download=Ae,exports.DownloadByUrl=function({url:e,target:t="_blank",fileName:n}){const r=new URL(e).host==location.host;return new Promise((i,o)=>{if(r){const l=document.createElement("a");if(l.href=e,l.target=t,l.download!==void 0&&(l.download=n||bn(e)),document.createEvent){const d=document.createEvent("MouseEvents");return d.initEvent("click",!0,!0),l.dispatchEvent(d),i(!0)}return e.indexOf("?")===-1&&(e+="?download"),window.open(e,t),i(!0)}{const l=document.createElement("canvas"),d=document.createElement("img");d.setAttribute("crossOrigin","Anonymous"),d.src=e,d.onload=v=>{l.width=d.width,l.height=d.height,l.getContext("2d").drawImage(d,0,0,d.width,d.height),l.toBlob(S=>{if(S){const E=document.createElement("a");E.href=window.URL.createObjectURL(S),E.download=bn(e),E.click(),URL.revokeObjectURL(E.href),i(!0)}},"image/jpeg")},d.onerror=v=>o(v)}})},exports.FileUpload=Mn,exports.Global=T,exports.GlobalHprose=Vi,exports.GlobalMitt=ge,exports.H5Tool=te,exports.HproseClient=xe,exports.HttpDownload=(e,t,n)=>{e.get(t,{responseType:"blob"}).then(function(r){Ae(r.data,n)}).catch(r=>{console.warn(r),ge.emit(Q.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})},exports.JsonDownload=wn,exports.LayoutContainer=Je,exports.LayoutManager=Yn,exports.ObjToUrlParams=function(e,t){let n="",r="";for(const i in t)n+=i+"="+encodeURIComponent(t[i])+"&";return n=n.replace(/&$/,""),r=/\?$/.test(e)?e+n:e.replace(/\/?$/,"?")+n,r},exports.Pane=dt,exports.ProxyClient=we,exports.SaveAs=function(e,t){const n=window.URL||window.webkitURL||window,r=new Blob([e]),i=document.createElement("a");i.href=n.createObjectURL(r),i.download=t,i.click(),n.revokeObjectURL(i.href)},exports.Splitpanes=ii,exports.Storage=Be,exports.StringUtils=Re,exports.StyleBlack={window:{color:"#fff",boxShadow:"0 0 6pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(31, 31, 31, 0.9)"},titlebar:{backgroundColor:"rgba(63, 63, 63, 0.9)"},content:{},button:{color:"white"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},exports.StyleGrayblue={window:{color:"#fff",fontSize:"14px",boxShadow:"0 0 3pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(4,51,81,0.6)",borderRadius:"5px"},titlebar:{backgroundColor:"rgba(4,51,81,0.8)",border:"1px solid rgba(153, 153, 153, 0.5)",borderRadius:"5px",fontSize:"16px",fontWeight:400,color:"#fff"},content:{},button:{color:"white",fontSize:"18px"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},exports.StyleMetal={window:{color:"#000",boxShadow:"0 4pt 8pt rgba(0, 0, 0, 0.5)",background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},titlebar:{background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},exports.StyleWhite={window:{color:"#000",boxShadow:"0 2pt 4pt rgba(0, 0, 0, 0.5)",backgroundColor:"rgba(239, 239, 239, 0.95)"},titlebar:{backgroundColor:"rgba(191, 191, 191, 0.9)"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},exports.SysEvents=Q,exports.TOKEN_REFRESH_TIME=5e3,exports.TOKEN_VALID_TIMESPAN=36e5,exports.USER_TOKEN_API=fe,exports.VCollapsiblePanel=We,exports.VCollapsiblePanelGroup=$e,exports.VWindow=Ye,exports.WindowResizeEvent=Xn,exports.WindowType=Ui,exports.calculateBestTextColor=function(e){return function(t,n){return(yn(~~t[0],~~t[1],~~t[2])+.05)/(yn(n[0],n[1],n[2])+.05)}(wt(e.substring(1)).split(","),[0,0,0])>=12?"#000000":"#FFFFFF"},exports.changeMyPWD=function(e){const t={oldpwd:je.encryptToString(e.oldpwd,et),newpwd:je.encryptToString(e.newpwd,et)};return oe(fe.ChangeMyPwd,tt,t)},exports.checkDoRefreshToken=Jn,exports.checkToken=function(e){return oe(fe.CheckToken,tt,{token:e})},exports.clearLocalToken=xt,exports.clearRight=Qn,exports.colorIsDark=function(e){if(!Pe(e))return;const[t,n,r]=wt(e).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(i=>Number(i));return .299*t+.578*n+.114*r<192},exports.createFileUpload=e=>new Mn(e),exports.darken=function(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${St(e.substring(0,2),t)}${St(e.substring(2,4),t)}${St(e.substring(4,6),t)}`},exports.deepMerge=function e(t={},n={}){let r;for(r in n)t[r]=le(t[r])?e(t[r],n[r]):t[r]=n[r];return t},exports.doRefreshToken=jt,exports.exportSystemRights=Pn,exports.get=function(e,t){return oe(e,void 0,t)},exports.getCurrentSystemRight=Ce,exports.getData=function(e,t){return T.Axios?.get(e,{params:t}).catch(function(n){De(n,e,"","\u5916\u90E8Get")})},exports.getEncryptPWD=function(e){return je.encryptToString(e,et)},exports.getFunctions=function(e,t=2){if(t===0)return e;const n=Ce();return n?n.functions:void 0},exports.getHexColor=function(e){const t=e.toLowerCase().replace(/rgb?a?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n=parseFloat(t[3]||"1"),r=Math.floor(n*parseInt(t[0])+255*(1-n)),i=Math.floor(n*parseInt(t[1])+255*(1-n)),o=Math.floor(n*parseInt(t[2])+255*(1-n));return"#"+("0"+r.toString(16)).slice(-2)+("0"+i.toString(16)).slice(-2)+("0"+o.toString(16)).slice(-2)},exports.getLocalToken=he,exports.getLockState=function(){return ie.get(It,!1)},exports.getLongHexColor=function(e){const t=e;if(t.length===4){let r="#";for(var n=1;n<4;n+=1){const i=t.slice(n,n+1);r+=i.concat(i)}return r}return t},exports.getProxyClient=_n,exports.getRGBColor=function(e){var t=e.toLowerCase();if(Pe(e)){if(t.length===4){for(var n="#",r=1;r<4;r+=1){const o=t.slice(r,r+1);n+=o.concat(o)}t=n}var i=[];for(r=1;r<7;r+=2)i.push(parseInt("0x"+t.slice(r,r+2)));return"rgb("+i.join(",")+")"}return t},exports.getRGBColorFromHSLA=function(e){if(!!e){var t=e.toLowerCase().match(/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i);if(!!t){var n,r,i,o=(parseFloat(t[1])%360+360)%360/360,l=parseFloat(t[2])/(/%$/.test(t[2])?100:1),d=parseFloat(t[3])/(/%$/.test(t[3])?100:1);if(l===0)n=r=i=d;else{var v=d<=.5?d*(l+1):d+l-d*l,S=2*d-v;n=yt(S,v,o+1/3),r=yt(S,v,o),i=yt(S,v,o-1/3)}return`rgba(${n=Math.round(255*n)},${r=Math.round(255*r)},${i=Math.round(255*i)},${t[4]?parseFloat(t[4]):1})`}}},exports.getRefreshToken=Cn,exports.getRight=Zn,exports.getRoutes=function(e,t=2){if(t===0)return e;const n=Ce();return n&&n.routes?(Vt.length>0||e.forEach(r=>{const i=n.routes?.find(o=>o.name===r.name);if(i){const o=nr(r,i);o&&Vt.push(o)}}),Vt):void 0},exports.getSystemRoleRight=async function(e,t=!1){Qn();const n=fe.GetSystemRights,r=T.Config.ServiceURL.LoginAuthURL,i=await oe(n,r,{systemid:e});if(!i||!i.data)return void T.Message?.warn("\u65E0\u6CD5\u83B7\u53D6\u529F\u80FD\u6388\u6743\u5217\u8868\uFF01");const o=i.data;if(o&&o.length>0){if(t){const l=JSON.parse(o[0]);return Ht(l),l}{const l=tr(o);return Ht(l),l}}},exports.getWidgetConfig=function(e,t=2){if(t===0)return e;const n=Ce();return n&&n.widgets?(qt.length>0||e?.forEach(r=>{n.widgets?.find(i=>i.id===r.id)&&qt.push(r)}),qt):void 0},exports.getWidgetMenus=function(e,t=2){if(t===0)return e;const n=Ce();return n&&n.widgetMenu?(Gt.length>0||e.forEach(r=>{const i=n.widgetMenu?.find(o=>o.name===r.name);if(i){const o=rr(r,i);o&&Gt.push(o)}}),Gt):void 0},exports.handleNodes=ve,exports.hexToRGB=wt,exports.init=function(e,t,n){!T.Config.DefaultHproseAPI&&T.Config.ServiceURL&&(T.Config.DefaultHproseAPI=T.Config.ServiceURL.DefaultHproseAPI),T.Config.DefaultHproseAPI&&Re.isNotEmpty(T.Config.DefaultHproseAPI)&&(T.DefaultProxyClient=new we(T.Config.DefaultHproseAPI));const r=T.Config.UI.GrayMode;r&&te.setGrayMode(r);const i=new bi(e,T.EventBus);T.Message=i,T.SystemID=t,T.SystemGroup=n,T.EventBus.on(Q.HproseServiceErrorEvent,o=>{const l=`\u5F53\u524D\u540E\u53F0\u4E1A\u52A1\u670D\u52A1\u4E0D\u53EF\u7528!${o}`;i.warn(l)}),T.EventBus.on(Q.WebAPIErrorEvent,o=>{const l=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${o}`;i.warn(l)}),T.EventBus.on(Q.AxiosRequestErrorEvent,o=>{const l=`Http\u8BF7\u6C42'${o.code}'\u9519\u8BEF: ${o.message}`;console.warn("Http\u8BF7\u6C42\u9519\u8BEF",o),i.warn(l)}),T.EventBus.on(Q.CommonWarnEvent,o=>{i.warn(o)})},exports.initDefaultProxyClient=function(e){const t=_n(e);return t&&(T.DefaultProxyClient=t),t},exports.is=K,exports.isArray=mt,exports.isAsyncFunction=function(e){return K(e,"AsyncFunction")},exports.isBoolean=function(e){return e===!0||e===!1||K(e,"Boolean")},exports.isClient=()=>typeof window<"u",exports.isDate=function(e){return K(e,"Date")},exports.isDef=vn,exports.isElement=e=>le(e)&&!!e.tagName,exports.isEmpty=function(e){return e==null||(Ie(e)||mt(e)?e.length===0:!!le(e)&&JSON.stringify(e)==="{}")},exports.isEnumColor=function(e){if(typeof e=="object"||!e)return;const t=e.toLowerCase().substring(0,1);return t==="#"?exports.EnumColor.Hex:t==="r"||t==="("?exports.EnumColor.RGBA:t==="h"?exports.EnumColor.Hsla:exports.EnumColor.RGBA},exports.isError=function(e){return K(e,"Error")},exports.isFunction=_e,exports.isHexColor=Pe,exports.isImageDom=function(e){return e&&["IMAGE","IMG"].includes(e.tagName)},exports.isMap=function(e){return K(e,"Map")},exports.isNull=pt,exports.isNullAndUnDef=function(e){return ft(e)&&pt(e)},exports.isNullOrUnDef=function(e){return ft(e)||pt(e)},exports.isNumber=function(e){return K(e,"Number")},exports.isObject=le,exports.isPromise=function(e){return K(e,"Promise")&&le(e)&&_e(e.then)&&_e(e.catch)},exports.isServer=si,exports.isString=Ie,exports.isSymbol=function(e){return K(e,"Symbol")},exports.isUnDef=ft,exports.isValidURL=e=>/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(e),exports.isWeakMap=function(e){return K(e,"WeakMap")},exports.isWeakSet=function(e){return K(e,"WeakSet")},exports.isWindow=e=>typeof window<"u"&&K(e,"Window"),exports.jquery=wi,exports.lighten=function(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${bt(e.substring(0,2),t)}${bt(e.substring(2,4),t)}${bt(e.substring(4,6),t)}`},exports.login=async function(e){const t={username:e.username,pwd:je.encryptToString(e.pwd,et)},n=(await oe(fe.Login,tt,t))?.data;return n&&Ft(n.doubletoken),n},exports.logout=function(){const e=he();e&&(kt(fe.Logout,tt,{token:e.token,reftoken:e.refresh}),xt())},exports.mergeFilterRoleSysRight=tr,exports.mergeNodes=function e(t,n,r="name"){t&&n&&t.forEach(i=>{const o=n.find(l=>l[r]===i[r]);o&&(i.children?o.children&&e(i.children,o.children,r):(!o.children||o.children.length===0)&&o.selected&&(i.selected=o.selected))})},exports.mergeNodesAll=Se,exports.newGuid=function(){var e=new Date().getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var r=(e+16*Math.random())%16|0;return e=Math.floor(e/16),(n==="x"?r:3&r|8).toString(16)});return t},exports.onLockListener=function(){Bt(),document.addEventListener("mousedown",Bt)},exports.post=function(e,t){return kt(e,void 0,t)},exports.requestGet=oe,exports.requestPost=kt,exports.requestPostBody=function(e,t,n,r,i,o="json",l){const d=Et(r,t,i,o);return l&&l>=2e4&&(d.timeout=l),T.Axios?.post(e,n,d).catch(function(v){De(v,t,e,"Post")})},exports.rgbToHex=function(e,t,n){const r=(e<<16|t<<8|n).toString(16);return"#"+new Array(Math.abs(r.length-7)).join("0")+r},exports.setLocalToken=Ft,exports.setRight=Ht,exports.sleep=function(e){for(var t=new Date().getTime();new Date().getTime()-t<e;);console.log(`\u5F3A\u5236\u7B49\u5F85${e}\u6BEB\u79D2`)},exports.storage=ci,exports.storageHelper=ie,exports.unLockListener=function(){document.removeEventListener("mousedown",Bt)},exports.uuid=Le,exports.writeIconifyList=function(e,t="IconifyList.ts"){let n="",r=`const iconlist={
|
|
18
|
+
`}}});const zi={class:"vcp__header-title"},Mi={key:0,class:"vcp__header-icon"},_i=["innerHTML"],Ii={key:0,ref:"bodyRef",class:"vcp__body"},Ri={ref:"bodyContentRef",class:"vcp__body-content"};function Dt(e){return window.TouchEvent&&e instanceof TouchEvent}We.render=function(e,t,n,r,i,o){return w.openBlock(),w.createElementBlock("section",{ref:"panelRef",class:w.normalizeClass(["vcp",{"vcp--expanded":e.isExpanded,"vcp--expandable":e.body.hasContent}])},[w.createElementVNode("header",{class:"vcp__header",onClick:t[0]||(t[0]=(...l)=>e.toggle&&e.toggle(...l))},[w.createElementVNode("div",zi,[w.renderSlot(e.$slots,"title")]),e.body.hasContent?(w.openBlock(),w.createElementBlock("div",Mi,[w.renderSlot(e.$slots,"icon",{},()=>[w.createElementVNode("span",{innerHTML:e.toggleIcon},null,8,_i)])])):w.createCommentVNode("v-if",!0)]),w.createVNode(w.Transition,{"data-key":e.body.dataKey,name:"slide",onBeforeEnter:e.collapse,onEnter:e.expand,onBeforeLeave:e.expand,onLeave:e.collapse},{default:w.withCtx(()=>[e.isExpanded?(w.openBlock(),w.createElementBlock("div",Ii,[w.createElementVNode("div",Ri,[w.renderSlot(e.$slots,"content")],512)],512)):w.createCommentVNode("v-if",!0)]),_:3},8,["data-key","onBeforeEnter","onEnter","onBeforeLeave","onLeave"])],2)},We.__scopeId="data-v-08c94cf8",We.__file="src/controls/collapsepanel/VCollapsiblePanel.vue";class J{e;constructor(t){this.e=t}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return Dt(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return Dt(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new Xt(this.clientX,this.clientY)}static bindDown(t,n,r,i=!1){const o=d=>{n(new J(d))},l=d=>{d.touches.length===1&&n(new J(d)),d.touches.length>1&&r&&r(new J(d))};return t.addEventListener("mousedown",o,i),t.addEventListener("touchstart",l,i),()=>{t.removeEventListener("mousedown",o,i),t.removeEventListener("touchstart",l,i)}}static bindMove(t,n,r=!1){const i=l=>{n(new J(l))},o=l=>{l.touches.length===1&&n(new J(l))};return t.addEventListener("mousemove",i,r),t.addEventListener("touchmove",o,r),()=>{t.removeEventListener("mousemove",i,r),t.removeEventListener("touchmove",o,r)}}static bindUp(t,n,r=!1){const i=l=>{n(new J(l))},o=l=>{l.touches.length===0&&n(new J(l))};return t.addEventListener("mouseup",i,r),t.addEventListener("touchend",o,r),()=>{t.removeEventListener("mouseup",i,r),t.removeEventListener("touchend",o,r)}}originalEvent({mouse:t,touch:n}){Dt(this.e)?n&&n(this.e):t&&t(this.e)}}class Xt{x;y;constructor(t,n){this.x=t,this.y=n}clone(){return new Xt(this.x,this.y)}}class Bi{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(t,n,r={}){this.handle=t,this.container=n,this.options=r,t&&(this.unbindDown=J.bindDown(t,this.mousedown),t.classList.add("draggable-handle"))}teardown(){this.handle?.classList.remove("draggable-handle"),this.unbindDown&&this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove()}offsetX;offsetY;mousedown=t=>{if(t.preventDefault(),this.handle){const{left:n,top:r}=this.handle.getBoundingClientRect();this.offsetX=t.clientX-n,this.offsetY=t.clientY-r}this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=J.bindMove(document,this.mousemove),this.unbindUp=J.bindUp(document,this.mouseup)};mousemove=t=>{this.container&&(this.container.style.left=t.clientX-this.offsetX+"px",this.container.style.top=t.clientY-this.offsetY+"px"),this.options.onMove&&this.options.onMove()};mouseup=t=>{this.options.onMoveEnd&&this.options.onMoveEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0}}class Li{_group;onChange;zIndex;constructor(t,n){this._group=t,this.onChange=n,this.a(r=>r.push(this))}set group(t){this._group=t;const n=qe(this._group),r=qe(t);n.splice(n.indexOf(this),1),r.push(this),Hn()}get group(){return this._group}unregister(){this.a(t=>t.splice(t.indexOf(this),1))}raise(){this.a(t=>{t.splice(t.indexOf(this),1),t.push(this)})}a(t){t(qe(this._group)),Hn()}}const He=new Map;function qe(e){return He.has(e)||He.set(e,[]),He.get(e)}function Wn(e,t){return e>t?-Wn(t,e):e<0&&t>=0?1:e-t}function Hn(){let e=0;for(const t of function(n){const r=[];return n.forEach((i,o)=>r.push(o)),r}(He).sort(Wn))for(const n of qe(t))e!=n.zIndex&&(n.zIndex=e,n.onChange(e)),e++}function Tt(e){if(e){const{width:t,height:n}=e.style;e.style.width="auto",e.style.height="auto";const r=Ge(e);return e.style.width=t,e.style.height=n,r}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function Ge(e){const t=e.getBoundingClientRect(),n=t.width,r=t.height,i=t.top,o=t.left;return{width:n,height:r,top:i,left:o,bottom:i+r,right:o+n}}class Pi{container;options;handles;constructor(t,n){if(this.container=t,this.options=n,t&&n){this.handles=qn.map(v=>new v(t,this));const{width:r,height:i}=Tt(t),o=n.maxWidth||window.innerWidth,l=n.maxHeight||window.innerHeight;let d=!1;(r<n.minWidth||r>o)&&(t.style.width=`${Gn(r,n.minWidth,o)}px`,d=!0),(i<n.minHeight||i>l)&&(t.style.height=`${Gn(i,n.minHeight,l)}px`,d=!0),d&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(t=>t.teardown())}}const qn=[];class ue{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(t,n){this.container=t,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=J.bindDown(this.handle,this.mousedown)}teardown(){this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove(),this.handle.parentElement.removeChild(this.handle)}x0;y0;left0;top0;width0;height0;mousedown=t=>{t.preventDefault(),t.stopPropagation();const{left:n,top:r,width:i,height:o}=Ge(this.container);this.x0=t.clientX,this.y0=t.clientY,this.left0=n,this.top0=r,this.width0=i,this.height0=o,this.calcSafeBoundaries(),this.helper.options&&this.helper.options.onResizeStart&&this.helper.options.onResizeStart(),this.unbindMove=J.bindMove(document,this.mousemove),this.unbindUp=J.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:t,top:n,right:r,bottom:i}=Ge(this.container),o=this.helper.options,l=o.maxWidth||window.innerWidth,d=o.maxHeight||window.innerHeight;this.minLeft=Math.max(r-l,0),this.maxLeft=r-o.minWidth,this.minRight=t+o.minWidth,this.maxRight=Math.min(t+l,window.innerWidth),this.minTop=Math.max(i-d,0),this.maxTop=i-o.minHeight,this.minBottom=n+o.minHeight,this.maxBottom=Math.min(n+d,window.innerHeight)}mousemove=t=>{t.preventDefault(),t.stopPropagation(),this.setPosition(t),this.fixPosition(),this.helper.options&&this.helper.options.onResize&&this.helper.options.onResize()};fixPosition(){const{width:t,height:n,left:r,top:i,right:o,bottom:l}=Ge(this.container),d=this.helper.options;!d||(r<this.minLeft?(this.container.style.width=t+r-this.minLeft+"px",this.container.style.left=`${this.minLeft}px`):r>this.maxLeft?(this.container.style.width=`${d.minWidth}px`,this.container.style.left=`${this.maxLeft}px`):o<this.minRight?this.container.style.width=`${d.minWidth}px`:o>this.maxRight&&(this.container.style.width=this.maxRight-r+"px"),i<this.minTop?(this.container.style.height=n+i-this.minTop+"px",this.container.style.top=`${this.minTop}px`):i>this.maxTop?(this.container.style.height=`${d.minHeight}px`,this.container.style.top=`${this.maxTop}px`):l<this.minBottom?this.container.style.height=`${d.minHeight}px`:l>this.maxBottom&&(this.container.style.height=this.maxBottom-i+"px"))}mouseup=t=>{t.preventDefault(),t.stopPropagation(),this.helper.options&&this.helper.options.onResizeEnd&&this.helper.options.onResizeEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0};createHandleElement(){const t=document.createElement("div"),n=t.style;return n.position="absolute",this.applyStyle(n),this.container.appendChild(t),t}}function Gn(e,t,n){return e<t?t:e>n?n:e}qn.push(class extends ue{setPosition(e){this.container.style.width=this.width0+e.clientX-this.x0+"px",this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.right=-this.handleSize+"px",e.bottom=-this.handleSize+"px",e.cursor="nwse-resize"}},class extends ue{setPosition(e){this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.right=`${this.handleSize}px`,e.left=`${this.handleSize}px`,e.height=2*this.handleSize+"px",e.bottom=-this.handleSize+"px",e.cursor="ns-resize"}},class extends ue{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px",this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.bottom=-this.handleSize+"px",e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.cursor="nesw-resize"}},class extends ue{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.bottom=`${this.handleSize}px`,e.width=2*this.handleSize+"px",e.top=`${this.handleSize}px`,e.cursor="ew-resize"}},class extends ue{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px",this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.top=-this.handleSize+"px",e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.cursor="nwse-resize"}},class extends ue{setPosition(e){this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px"}applyStyle(e){e.left=`${this.handleSize}px`,e.right=`${this.handleSize}px`,e.height=2*this.handleSize+"px",e.top=-this.handleSize+"px",e.cursor="ns-resize"}},class extends ue{setPosition(e){this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px",this.container.style.width=this.width0+e.clientX-this.x0+"px"}applyStyle(e){e.right=-this.handleSize+"px",e.top=-this.handleSize+"px",e.height=2*this.handleSize+"px",e.width=2*this.handleSize+"px",e.cursor="nesw-resize"}},class extends ue{setPosition(e){this.container.style.width=this.width0+e.clientX-this.x0+"px"}applyStyle(e){e.right=-this.handleSize+"px",e.top=`${this.handleSize}px`,e.bottom=`${this.handleSize}px`,e.width=2*this.handleSize+"px",e.cursor="ew-resize"}});var Ve=w.defineComponent({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(e){const t=w.ref(!1),n=w.ref(!1);return{hover:t,active:n,style:function(){let r=e.windowStyle.button;return t.value&&(r={...r,...this.windowStyle.buttonHover}),n.value&&(r={...r,...this.windowStyle.buttonActive}),r},mouseup:function(r){this.active&&this.$emit("click")},mousedown:function(r){r.preventDefault(),n.value=!0;const i=J.bindUp(document,()=>{n.value=!1,i()})}}}});const Ai=["disabled"];Ve.render=function(e,t,n,r,i,o){return w.openBlock(),w.createElementBlock("div",{class:"btn",style:w.normalizeStyle(e.style()),onMouseenter:t[0]||(t[0]=l=>e.hover=!0),onMouseleave:t[1]||(t[1]=l=>e.hover=!1),onMousedown:t[2]||(t[2]=w.withModifiers((...l)=>e.mousedown&&e.mousedown(...l),["stop"])),onTouchstart:t[3]||(t[3]=w.withModifiers((...l)=>e.mousedown&&e.mousedown(...l),["stop"])),onMouseup:t[4]||(t[4]=(...l)=>e.mouseup&&e.mouseup(...l)),onTouchend:t[5]||(t[5]=(...l)=>e.mouseup&&e.mouseup(...l)),disabled:e.disabled},[w.renderSlot(e.$slots,"default")],44,Ai)},Ve.__scopeId="data-v-71662210",Ve.__file="src/controls/vuewindow/window/Button.vue";const Nt=new Set;function Vn(e){return e!==null?parseFloat(e):0}function Xe(e){const t=window.getComputedStyle(e),n=Math.ceil([t.paddingLeft,t.width,t.paddingRight].map(Vn).reduce((i,o)=>i+o)),r=Math.ceil([t.paddingTop,t.height,t.paddingBottom].map(Vn).reduce((i,o)=>i+o));return{width:n,height:r}}class Xn{width;height;constructor(t,n){this.width=t,this.height=n}}function Di(e){const t=e.windowEl;if(t){const n=parseFloat(t.style.left||"NaN"),r=parseFloat(t.style.top||"NaN");if(!isNaN(n)&&!isNaN(r))return{left:n,top:r}}return null}function Ti(e,t,n,r){const i=e-n,o=t-r;return i*i+o*o}window.addEventListener("resize",e=>{Nt.forEach(t=>{t&&_e(t.fixPosition)&&t.fixPosition()})});const Ke=[];var Ye=w.defineComponent({name:"Window",props:{windowStyle:{type:Object,required:!0},isOpen:{type:Boolean,required:!1,default:!0},title:{type:String,required:!0,default:""},closeButton:{type:Boolean,required:!1,default:!0},resizable:{type:Boolean,required:!1,default:!1},isScrollable:{type:Boolean,required:!1,default:!1},padding:{type:Number,required:!1,default:8},activateWhenOpen:{type:Boolean,required:!1,default:!0},positionHint:{type:String,required:!1,default:""},zGroup:{type:Number,required:!1,default:1},overflow:{type:String,required:!1,default:"visible"},minWidth:{type:Number,required:!1,default:1},minHeight:{type:Number,required:!1,default:0},maxWidth:{type:Number,required:!1,default:0},maxHeight:{type:Number,required:!1,default:0},height:{type:Number,required:!1},width:{type:Number,required:!1},top:{type:Number,required:!1},left:{type:Number,required:!1}},components:{myButton:Ve},setup(e,{emit:t}){const n=w.getCurrentInstance();if(!n)return;const{proxy:r}=n;let i=0,o,l,d;const v=w.ref(e.isOpen),S=()=>{Ke.push(r),d=new Li(e.zGroup,E),e.isOpen&&function(B){B&&(w.nextTick(()=>{i++==0&&(f(r),function(){const L=k.value,{width:U,height:F}=Tt(L);let j,H;if(e.left!==void 0!=(e.top!==void 0))throw new Error("Either of left or top is specified. Both must be set or not set.");if(typeof e.left=="number")j=e.left,H=e.top;else{const Z=e.positionHint||"auto";switch(Z){case"auto":{let V=20,X=50,q=0;do{if(Ke.every(ne=>{if(!ne.isOpen||r==ne)return!0;const Ee=Di(ne);if(Ee==null)return!0;const{left:nt,top:ee}=Ee;return Ti(nt,ee,V,X)>16}))break;V=(V+40)%(window.innerWidth-200),X=(X+40)%(window.innerHeight-200)}while(++q<100);j=V,H=X}break;case"center":j=(window.innerWidth-U)/2,H=(window.innerHeight-F)/2,console.log(j,H,window.innerWidth,window.innerHeight,"111111");break;default:try{const V=Z.split("/").map(Number);if(V.length!=2)throw null;const[X,q]=V;if(!isFinite(X)||!isFinite(q))throw null;j=X>=0?X:window.innerWidth-U+X,H=q>=0?q:window.innerHeight-F+q}catch{throw new Error(`invalid position string: ${Z}`)}}}L&&(L.style.left=`${j}px`,L.style.top=`${H}px`)}()),e.resizable&&h(),A(),o=new Bi(P.value,k.value,{onMove:()=>A(),onMoveStart:()=>t("move-start"),onMoveEnd:()=>t("move-end")}),e.resizable&&function(){const{height:L}=Tt(P.value);l=new Pi(k.value,{onResize:()=>h(),onResizeStart:()=>t("resize-start"),onResizeEnd:()=>t("resize-end"),minWidth:e.minWidth,minHeight:e.minHeight+L,maxWidth:e.maxWidth,maxHeight:e.maxHeight?e.maxHeight+L:void 0})}()}),e.activateWhenOpen&&R())}(!0),Nt.add(r)};function E(B){C.value.zIndex=`${B}`}const k=w.ref(null),P=w.ref(null),N=w.ref(null);function R(){d.raise(),t("activate")}const C=w.ref({...e.windowStyle.window,zIndex:"auto",overflow:e.overflow}),u=w.computed(()=>e.windowStyle.titlebar),p=w.computed(()=>{const B={...e.windowStyle.content};return e.resizable?B.padding="0":e.padding!=null&&(B.padding=`${e.padding}px`),e.isScrollable&&(B.overflow="auto"),B});function f(B){const{width:L,height:U,top:F,left:j}=B,H=k;if(H&&L!=null&&(H.value.style.width=`${L}px`),U!=null){const Z=P.value;if(Z){const V=Xe(Z).height;H.value.style.height=`${U+V}px`}}H&&j!=null&&(H.value.style.left=`${j}px`),H&&F!=null&&(H.value.style.top=`${F}px`)}function h(B=!0){const L=k.value,U=P.value,F=N.value;if(F&&L&&U){const{width:j,height:H}=Xe(F),{width:Z,height:V}=Xe(L),X=Xe(U).height,q=Z-(F.offsetWidth-j),ne=V-X-(F.offsetHeight-H);F.style.width=`${q}px`,F.style.height=`${ne}px`,g(),t("resize",new Xn(q,ne)),B&&(t("update:width",q),t("update:height",ne))}}function g(){const B=k.value;if(B){const L=B.getBoundingClientRect();L.left<0&&(C.value.left="0px"),L.top<0&&(C.value.top="0px"),L.right>window.innerWidth&&(C.value.left=window.innerWidth-L.width+"px"),L.bottom>window.innerHeight&&(C.value.top=window.innerHeight-L.height+"px")}}function A(B=!0){g();const L=k.value;if(L){const{left:U,top:F}=L.getBoundingClientRect();B&&(t("update:left",U),t("update:top",F))}}return w.watch(()=>e.isOpen,B=>{v.value=B}),w.watch(()=>e.zGroup,B=>{d.group=B}),w.watch(()=>e.width,B=>{f({width:B}),h(!1)}),w.watch(()=>e.height,B=>{f({height:B}),h(!1)}),w.onMounted(()=>{S()}),w.onBeforeUnmount(()=>{Nt.delete(this),d.unregister(),l&&l.teardown(),o&&o.teardown(),Ke.splice(Ke.indexOf(r),1)}),{isOpen:v,windowEl:k,titlebar:P,content:N,activate:R,styleWindow:C,styleTitlebar:u,styleContent:p,closeButtonClick:function(){v.value=!1,t("closebuttonclick")},fixPosition:g}}});const Ni={class:"title"},Oi=w.createTextVNode("\xD7");var Kn;Ye.render=function(e,t,n,r,i,o){const l=w.resolveComponent("myButton");return w.openBlock(),w.createBlock(w.Transition,{name:"fade",onAfterLeave:t[2]||(t[2]=d=>e.$emit("close")),onAfterEnter:t[3]||(t[3]=d=>e.$emit("open")),persisted:""},{default:w.withCtx(()=>[w.withDirectives(w.createElementVNode("div",{class:"window",style:w.normalizeStyle(e.styleWindow),ref:"windowEl",onMousedown:t[0]||(t[0]=(...d)=>e.activate&&e.activate(...d)),onTouchstart:t[1]||(t[1]=(...d)=>e.activate&&e.activate(...d))},[w.createElementVNode("div",{class:"titlebar",style:w.normalizeStyle(e.styleTitlebar),ref:"titlebar"},[w.createElementVNode("div",Ni,[e.$slots.title?w.renderSlot(e.$slots,"title",{key:0}):(w.openBlock(),w.createElementBlock(w.Fragment,{key:1},[w.createTextVNode(w.toDisplayString(e.title),1)],64))]),e.closeButton?(w.openBlock(),w.createBlock(l,{key:0,windowStyle:e.windowStyle,onClick:e.closeButtonClick},{default:w.withCtx(()=>[Oi]),_:1},8,["windowStyle","onClick"])):w.createCommentVNode("v-if",!0)],4),w.createElementVNode("div",{class:"content",style:w.normalizeStyle(e.styleContent),ref:"content"},[w.renderSlot(e.$slots,"default")],4)],36),[[w.vShow,e.isOpen]])]),_:3})},Ye.__file="src/controls/vuewindow/window/index.vue",function(e){e[e.StyleBlack=0]="StyleBlack",e[e.StyleWhite=1]="StyleWhite",e[e.StyleMetal=2]="StyleMetal",e[e.StyleGrayblue=3]="StyleGrayblue"}(Kn||(Kn={}));const Ui=Ye;exports.LayoutContainerEnum=void 0,function(e){e[e.top=0]="top",e[e.bottom=1]="bottom",e[e.centerBack=2]="centerBack",e[e.centerMain=3]="centerMain",e[e.centerFront=4]="centerFront",e[e.left=5]="left",e[e.right=6]="right"}(exports.LayoutContainerEnum||(exports.LayoutContainerEnum={}));class Yn{layoutState;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;widgetConfig=new Array;_LayoutID;constructor(t,n,r){this.layoutState=t,this._LayoutID=r,n.forEach(i=>{if(i.layoutID===r&&(this.widgetConfig.push(i),i.afterid))if(this.preConditionMap.has(i.afterid))this.preConditionMap.get(i.afterid)?.add(i);else{const o=new Set;o.add(i),this.preConditionMap.set(i.afterid,o)}})}getLayoutID(){return this._LayoutID}getWidgetConfig(){return this.widgetConfig}preloadWidgets(){this.widgetConfig.filter(t=>t.preload&&!t.afterid).forEach(t=>{this._loadWidget(t)})}async loadWidget(t){if(!t)return;let n;return le(t)?n=t:Ie(t)&&(n=this.widgetConfig.find(r=>r.id===t)),n?n.afterid?(this.isWidgetLoaded(n.afterid)||await this.loadWidget(n.afterid),this._loadWidget(n)):this._loadWidget(n):void 0}loadOtherDependenceWidgets(t){this.preConditionMap.has(t)&&this.preConditionMap.get(t)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(t){if(!this.widgetsLoadedSet.has(t.id))return t.component().then(n=>{if(n.default){const r=w.markRaw(n.default);this.getContainerComponents(t.container).value.set(t.id,r),this.widgetsLoadedSet.add(t.id),w.nextTick().then(()=>{T.EventBus.emit(Q.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:t.id}),this.loadOtherDependenceWidgets(t.id)})}})}hasDependentWidgets(t){let n=!1;if(this.preConditionMap.has(t)){const r=this.preConditionMap.get(t);if(r){for(const i of r)if(this.isWidgetLoaded(i.id)){n=!0;break}}}return n}unloadWidget(t){if(!t||!this.isWidgetLoaded(t))return;const n=this.widgetConfig.find(r=>r.id===t);if(n){if(this.preConditionMap.has(t)){const o=this.preConditionMap.get(t);if(o)for(const l of o)this.unloadWidget(l.id)}const r=this.getContainerComponents(n.container),i=r.value.get(t);i&&i.unmounted&&i.unmounted(),r.value.delete(t),this.widgetsLoadedSet.delete(t),T.EventBus.emit(Q.WidgetUnLoadedEvent,{layoutID:this._LayoutID,widgetID:t})}}isWidgetLoaded(t){return this.widgetsLoadedSet.has(t)}splitTwoContainer(t=!1){const n=this.layoutState.centerMainContainer,r=this.layoutState.centerBackContainer;t?(n&&(n.style.left="0",n.style.width="100%"),r&&(r.style.width="100%")):(n&&(n.style.left="50%",n.style.width="50%"),r&&(r.style.width="50%"))}getLayoutContainer(t){switch(t){case exports.LayoutContainerEnum.top:return this.layoutState.topContainer;case exports.LayoutContainerEnum.bottom:return this.layoutState.bottomContainer;case exports.LayoutContainerEnum.left:return this.layoutState.leftContainer;case exports.LayoutContainerEnum.right:return this.layoutState.rightContainer;case exports.LayoutContainerEnum.centerBack:return this.layoutState.centerBackContainer;case exports.LayoutContainerEnum.centerMain:return this.layoutState.centerMainContainer;case exports.LayoutContainerEnum.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(t,n=!1){const r=this.getLayoutContainer(t);r&&(r.style.visibility=n?"visible":"hidden")}changeWidgetVisible(t,n=!1){const r=this.getWidgetComponent(t);r&&T.EventBus.emit(Q.WidgetVisibleChanged,{id:t,layoutID:this._LayoutID,name:r.name,visible:n})}getWidgetComponent(t){if(this.widgetsLoadedSet.has(t)){const n=this.widgetConfig.find(r=>r.id===t);if(n)return this.getContainerComponents(n.container).value.get(t)}}getWigetItem(t){return this.widgetConfig.find(n=>n.id===t)}getGroupWigetItems(t){return this.widgetConfig.filter(n=>n.group===t)}getContainerComponents(t){if(this.layoutMap.has(t))return this.layoutMap.get(t);{const n=w.ref(new Map);return this.layoutMap.set(t,n),n}}addContainerComponent(t,n){}}var Je=w.defineComponent({name:"MainContainer",props:{widgetConfig:{type:Array,required:!0,default:()=>[]},layoutID:{type:String,default:void 0},layoutStyle:{type:Object},enableRouterView:{type:Boolean,default:!0}},emits:["containerLoaded"],setup(e,{attrs:t,slots:n,emit:r}){const i=e.layoutID,o=w.ref(e.enableRouterView);w.watch(()=>e.enableRouterView,()=>{o.value=e.enableRouterView});const l=w.reactive({topContainer:void 0,centerBackContainer:void 0,centerMainContainer:void 0,centerFrontContainer:void 0,bottomContainer:void 0,leftContainer:void 0,rightContainer:void 0}),d=new Yn(l,e.widgetConfig,i),v=R(exports.LayoutContainerEnum.top),S=R(exports.LayoutContainerEnum.centerBack),E=R(exports.LayoutContainerEnum.centerFront),k=R(exports.LayoutContainerEnum.left),P=R(exports.LayoutContainerEnum.right),N=R(exports.LayoutContainerEnum.bottom);function R(u){return d?.getContainerComponents(u)}const C=w.computed(()=>e.layoutStyle);return w.onMounted(()=>{d&&(d.preloadWidgets(),i===void 0&&(T.LayoutManager=d),r("containerLoaded",{layoutID:i,layoutManager:d}))}),{...w.toRefs(l),topContainerComponents:v,centerbackComponents:S,centerfrontComponents:E,leftContainerComponents:k,rightContainerComponents:P,bottomContainerComponents:N,containerStyle:C,isEnableRouterView:o}}});const ji={ref:"topContainer",class:"topContainer"},Fi={key:0,ref:"centerMainContainer",class:"centerdiv mainContainer"},$i={ref:"centerBackContainer",class:"centerdiv backContainer"},Wi={ref:"centerFrontContainer",class:"centerdiv centerContainer"},Hi={ref:"leftContainer",class:"leftContainer"},qi={ref:"rightContainer",class:"rightContainer"},Gi={ref:"bottomContainer",class:"bottomContainer"};Je.render=function(e,t,n,r,i,o){const l=w.resolveComponent("router-view");return w.openBlock(),w.createElementBlock("div",{class:"layoutContainer",style:w.normalizeStyle(e.containerStyle)},[w.createElementVNode("div",ji,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(e.topContainerComponents,([d,v])=>(w.openBlock(),w.createBlock(w.resolveDynamicComponent(v),{key:d}))),128))],512),w.createElementVNode("div",null,[w.createCommentVNode(" \u4E3B\u8981\u5BB9\u5668-\u5E95\u90E8 "),e.isEnableRouterView?(w.openBlock(),w.createElementBlock("div",Fi,[w.createVNode(l,null,{default:w.withCtx(({Component:d})=>[(w.openBlock(),w.createBlock(w.resolveDynamicComponent(d)))]),_:1})],512)):w.createCommentVNode("v-if",!0),w.createCommentVNode(" \u4E0A\u4E00\u5C42-\u4E3B\u5BB9\u5668 "),w.createElementVNode("div",$i,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(e.centerbackComponents,([d,v])=>(w.openBlock(),w.createBlock(w.resolveDynamicComponent(v),{key:d}))),128))],512),w.createCommentVNode(" \u6700\u4E0A\u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),w.createElementVNode("div",Wi,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(e.centerfrontComponents,([d,v])=>(w.openBlock(),w.createBlock(w.resolveDynamicComponent(v),{key:d}))),128))],512),w.createElementVNode("div",Hi,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(e.leftContainerComponents,([d,v])=>(w.openBlock(),w.createBlock(w.resolveDynamicComponent(v),{key:d}))),128))],512),w.createElementVNode("div",qi,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(e.rightContainerComponents,([d,v])=>(w.openBlock(),w.createBlock(w.resolveDynamicComponent(v),{key:d}))),128))],512)]),w.createElementVNode("div",Gi,[(w.openBlock(!0),w.createElementBlock(w.Fragment,null,w.renderList(e.bottomContainerComponents,([d,v])=>(w.openBlock(),w.createBlock(w.resolveDynamicComponent(v),{key:d}))),128))],512)],4)},Je.__scopeId="data-v-4d081e5c",Je.__file="src/controls/layoutcontainer/layout.vue";const Ze=new Map,Ot=new Map;let Qe;const Vi={getDefaultClient(){if(Qe||(Qe=new we(SysConfig.DefaultHproseAPI)),!Qe)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return Qe},registerHprose(e,t){const n=Ot.get(e);if(!n){const r=new we(t);Ze.set(e,r)}return n},getHprose:e=>Ot?.get(e),getProxyHprose:e=>Ze.get(e),unregisterHprose(e){Ze.get(e)&&(Ot.delete(e),Ze.delete(e))}},fe={Login:"/api/User/Login",ChangeMyPwd:"/api/User/ChangeMyPwd",Logout:"/api/Check/ExitLogin",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken",GetSystemRights:"/api/System/GetSystem"},Ut="access_token",Xi=T.Config.ServiceURL.LoginAuthURL;function jt(){const e=Cn();e&&oe(fe.RefreshToken,Xi,{refreshToken:e}).then(t=>{Ft(t.data)})}function Jn(){const e=ie.getJsonObject(Ut);if(!e)return;const t=new Date().getTime(),n=new Date(e.expire).getTime()-t;n>0&&(n<=5e3?jt():setTimeout(jt,n-5e3))}function Ft(e){const t=new Date().getTime();let n=new Date(e.accessToken.expires).getTime()-t;if(n>=36e5?(n=18e5,T.Message?.err("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u8FC7\u53BB\u65F6\u95F4\uFF01")):n<-6e5&&(n=18e5,T.Message?.err("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u672A\u6765\u65F6\u95F4\uFF01")),n>0){let r=he();r?(r.token=e.accessToken.tokenContent,r.expire=e.accessToken.expires,r.refresh=e.refreshToken.tokenContent):r={token:e.accessToken.tokenContent,expire:e.accessToken.expires,refresh:e.refreshToken.tokenContent},ie.set(Ut,r,n/1e3),Jn()}else ie.remove(Ut)}const et="Wm314243",tt=T.Config.ServiceURL.LoginAuthURL,$t="ROLE_SYSTEM_RIGHT",Wt=new Be("",sessionStorage);function Zn(){return Wt.get($t)}function Ht(e){Wt.set($t,e)}function Qn(){Wt.remove($t)}function ve(e){if(e)for(let t=0;t<e.length;t++){const n=e[t];n.children&&n.children.length>0?(ve(n.children),n.children.length===0&&(e.splice(t,1),t--)):n.selected||(e.splice(t,1),t--)}}function er(e,t,n="name"){e&&t&&e.forEach(r=>{const i=t.find(o=>o[n]===r[n]);i&&(r.children?i.children&&er(r.children,i.children,n):(!i.children||i.children.length===0)&&i.selected&&(r.selected=i.selected))})}function Se(e,t,n,r="name"){const i=e[n],o=t[n];i?o&&er(i,o,r):o&&(e[n]=o)}function tr(e){if(e&&e.length>0){const t=e.length;let n,r=!1;if(t>0){r=le(e[0]);const i=r?e[0]:JSON.parse(e[0]);if(t>1)for(let o=1;o<e.length;o++){const l=e[o],d=r?l:JSON.parse(l);Se(i,d,"routes","name"),Se(i,d,"widgetMenu","name"),Se(i,d,"widgets","id"),Se(i,d,"functions","id")}n=i}return n&&(ve(n.routes),ve(n.widgetMenu),ve(n.widgets),ve(n.functions)),n}}const qt=[],Gt=[],Vt=[];function Ce(){return Zn()}function nr(e,t){const n={...e};return n.meta||(n.meta={}),t.index!=null&&(n.meta.index=t.index),t.title!=null&&(n.meta.title=t.title),e.children&&(n.children=[],t.children&&t.children.forEach(r=>{const i=e.children?.find(o=>o.path===r.path);if(i){const o=nr(i,r);o&&n.children?.push(o)}})),n}function rr(e,t){const n={...e};return t.index!=null&&(n.index=t.index),e.children&&(n.children=[],t.children&&t.children.forEach(r=>{const i=e.children?.find(o=>o.name===r.name);if(i){const o=rr(i,r);o&&n.children?.push(o)}})),n}exports.BigFileDownload=class{fileID;downloadURL;ChunkUnitM=1048576;chunkByteSize;totalChunks=1;currentDB;keys;fileMetaData=null;finishNum=0;eventTarget;cancelSource;isStarting=!1;fileName;cacheSize=6;requestTimeout=6e4;constructor(e,t,n=3,r=6,i=6e4){this.fileID=e,this.downloadURL=t,this.chunkByteSize=n*this.ChunkUnitM,this.eventTarget=Ct(),this.initIndexDB(),r>=3&&(this.cacheSize=r),i>this.requestTimeout&&(this.requestTimeout=i)}on(e,t){this.eventTarget.on(e,t)}dispatch(e,t){this.eventTarget.emit(e,t)}dispatchError(e){this.eventTarget.emit("error",e)}dispatchInfo(e){this.eventTarget.emit("info",e)}async queryDownloadFileMeta(e,t="",n){this.dispatchInfo("\u5F00\u59CB\u83B7\u53D6\u6587\u4EF6\u4FE1\u606F");const r=await oe(t,e,n);let i=null;return r&&r.status===200&&(i=r.data),i}async getIFileMeta(){if(this.fileMetaData===null){const e=await this.currentDB?.getItem("fileinfo");this.fileMetaData=e||null}return this.fileMetaData}initIndexDB(){this.currentDB=Te.createInstance({name:this.fileID,driver:Te.INDEXEDDB})}async init(e){if(this.finishNum=0,e){const t="fileinfo";this.fileMetaData={id:e.id,name:e.name,length:e.length,downloadID:e.downloadID,chunkSize:this.chunkByteSize},this.fileName=e.name,this.currentDB?.setItem(t,this.fileMetaData)}if(this.fileMetaData!=null){const t=this.fileMetaData.chunkSize;t!=null&&t>0&&(this.chunkByteSize=t)}this.fileMetaData&&(this.totalChunks=Math.ceil(this.fileMetaData.length/this.chunkByteSize)),this.dispatchInfo("\u5B8C\u6210\u521D\u59CB\u5316\u6587\u4EF6\u4FE1\u606F\uFF0C\u603B\u5206\u7247\uFF1A"+this.totalChunks),this.currentDB&&(this.keys=await this.currentDB.keys())}getTotalChunks(){return this.totalChunks}pause(){this.cancelSource&&this.isStarting&&(this.cancelSource.cancel(),this.isStarting=!1),this.dispatchInfo("\u5DF2\u6682\u505C\u4E0B\u8F7D\u4EFB\u52A1")}restart(){this.dispatchInfo("\u6B63\u5728\u91CD\u542F\u4E0B\u8F7D\u4EFB\u52A1"),this.download()}delete(){this.cancelSource&&this.cancelSource.cancel(),Te.dropInstance({name:this.fileID}),this.currentDB=void 0,this.keys&&(this.keys.length=0,this.keys=void 0),this.finishNum=0,this.downloadProgress(),this.outputProgress(0),this.dispatchInfo("\u5DF2\u5220\u9664\u4E0B\u8F7D\u4EFB\u52A1")}sleep(e){return new Promise(t=>setTimeout(t,e))}async download(e,t){let n=e;if(!n&&this.downloadURL&&(n=this.downloadURL),!n)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const r=T.Axios.CancelToken;this.cancelSource=r.source(),this.isStarting=!0;const i={key:this.fileMetaData?.downloadID};let o=0;const l=this.cacheSize;let d=0;for(let v=0;v<this.totalChunks;v++){if(this.keys&&this.keys?.indexOf(v.toString())>=0){o++,o>this.finishNum&&(this.finishNum=o,this.downloadProgress());continue}const S=v*this.chunkByteSize;let E=S+this.chunkByteSize-1;this.fileMetaData&&E>this.fileMetaData.length&&(E=this.fileMetaData.length-1);const k={range:`bytes=${S}-${E}`};for(;d>=l;)await this.sleep(200);const P=v.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${v+1}/${this.totalChunks}`),d++,oe(n,t,i,k,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async N=>{const R=N.data;d--,await this.currentDB?.setItem(P,R),o++,o>this.finishNum&&(this.finishNum=o,this.downloadProgress());const C=parseInt(P)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${C}/${this.totalChunks}`),this.savefile()}).catch(N=>{d--;const R=parseInt(P)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${R}\uFF09\u4E2A\u5206\u7247\u5185\u5BB9\u5931\u8D25\uFF01`)})}this.finishNum===this.totalChunks&&this.savefile()}downloadProgress(){const e=100*this.finishNum/this.totalChunks;this.dispatch("downloadProgress",e)}outputProgress(e){const t=100*e/this.totalChunks;this.dispatch("saveProgress",t)}async savefile(){if(this.finishNum===this.totalChunks){if(!this.fileName)return void this.dispatchError("\u4E0B\u8F7D\u9519\u8BEF\uFF1A\u6587\u4EF6\u540D\u4E3A\u7A7A!");this.dispatchInfo("\u5F00\u59CB\u4FDD\u5B58\u4E0B\u8F7D\u6587\u4EF6:"+this.fileName);const e=Ci.createWriteStream(this.fileName).getWriter();let t=0;for(let n=0;n<this.totalChunks;n++){const r=n.toString();let i=await this.currentDB?.getItem(r);if(i||(i=await this.currentDB?.getItem(r)),!i)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${n+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);let o=new Response(i).body;if(o===null)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${n+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);const l=o.getReader();for(;;){const{done:d,value:v}=await l.read();if(d)break;await e.write(v)}t++,this.outputProgress(t),this.dispatchInfo(`\u5B8C\u6210\u7B2C${n+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}e.close(),Te.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}},exports.Download=Ae,exports.DownloadByUrl=function({url:e,target:t="_blank",fileName:n}){const r=new URL(e).host==location.host;return new Promise((i,o)=>{if(r){const l=document.createElement("a");if(l.href=e,l.target=t,l.download!==void 0&&(l.download=n||bn(e)),document.createEvent){const d=document.createEvent("MouseEvents");return d.initEvent("click",!0,!0),l.dispatchEvent(d),i(!0)}return e.indexOf("?")===-1&&(e+="?download"),window.open(e,t),i(!0)}{const l=document.createElement("canvas"),d=document.createElement("img");d.setAttribute("crossOrigin","Anonymous"),d.src=e,d.onload=v=>{l.width=d.width,l.height=d.height,l.getContext("2d").drawImage(d,0,0,d.width,d.height),l.toBlob(S=>{if(S){const E=document.createElement("a");E.href=window.URL.createObjectURL(S),E.download=bn(e),E.click(),URL.revokeObjectURL(E.href),i(!0)}},"image/jpeg")},d.onerror=v=>o(v)}})},exports.FileUpload=Mn,exports.Global=T,exports.GlobalHprose=Vi,exports.GlobalMitt=ge,exports.H5Tool=te,exports.HproseClient=xe,exports.HttpDownload=(e,t,n)=>{e.get(t,{responseType:"blob"}).then(function(r){Ae(r.data,n)}).catch(r=>{console.warn(r),ge.emit(Q.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})},exports.JsonDownload=wn,exports.LayoutContainer=Je,exports.LayoutManager=Yn,exports.ObjToUrlParams=function(e,t){let n="",r="";for(const i in t)n+=i+"="+encodeURIComponent(t[i])+"&";return n=n.replace(/&$/,""),r=/\?$/.test(e)?e+n:e.replace(/\/?$/,"?")+n,r},exports.Pane=dt,exports.ProxyClient=we,exports.SaveAs=function(e,t){const n=window.URL||window.webkitURL||window,r=new Blob([e]),i=document.createElement("a");i.href=n.createObjectURL(r),i.download=t,i.click(),n.revokeObjectURL(i.href)},exports.Splitpanes=ii,exports.Storage=Be,exports.StringUtils=Re,exports.StyleBlack={window:{color:"#fff",boxShadow:"0 0 6pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(31, 31, 31, 0.9)"},titlebar:{backgroundColor:"rgba(63, 63, 63, 0.9)"},content:{},button:{color:"white"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},exports.StyleGrayblue={window:{color:"#fff",fontSize:"14px",boxShadow:"0 0 3pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(4,51,81,0.6)",borderRadius:"5px"},titlebar:{backgroundColor:"rgba(4,51,81,0.8)",border:"1px solid rgba(153, 153, 153, 0.5)",borderRadius:"5px",fontSize:"16px",fontWeight:400,color:"#fff"},content:{},button:{color:"white",fontSize:"18px"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},exports.StyleMetal={window:{color:"#000",boxShadow:"0 4pt 8pt rgba(0, 0, 0, 0.5)",background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},titlebar:{background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},exports.StyleWhite={window:{color:"#000",boxShadow:"0 2pt 4pt rgba(0, 0, 0, 0.5)",backgroundColor:"rgba(239, 239, 239, 0.95)"},titlebar:{backgroundColor:"rgba(191, 191, 191, 0.9)"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},exports.SysEvents=Q,exports.TOKEN_REFRESH_TIME=5e3,exports.TOKEN_VALID_TIMESPAN=36e5,exports.USER_TOKEN_API=fe,exports.VCollapsiblePanel=We,exports.VCollapsiblePanelGroup=$e,exports.VWindow=Ye,exports.WindowResizeEvent=Xn,exports.WindowType=Ui,exports.calculateBestTextColor=function(e){return function(t,n){return(yn(~~t[0],~~t[1],~~t[2])+.05)/(yn(n[0],n[1],n[2])+.05)}(wt(e.substring(1)).split(","),[0,0,0])>=12?"#000000":"#FFFFFF"},exports.changeMyPWD=function(e){const t={oldpwd:je.encryptToString(e.oldpwd,et),newpwd:je.encryptToString(e.newpwd,et)};return oe(fe.ChangeMyPwd,tt,t)},exports.checkDoRefreshToken=Jn,exports.checkToken=function(e){return oe(fe.CheckToken,tt,{token:e})},exports.clearLocalToken=xt,exports.clearRight=Qn,exports.colorIsDark=function(e){if(!Pe(e))return;const[t,n,r]=wt(e).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(i=>Number(i));return .299*t+.578*n+.114*r<192},exports.createFileUpload=e=>new Mn(e),exports.darken=function(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${St(e.substring(0,2),t)}${St(e.substring(2,4),t)}${St(e.substring(4,6),t)}`},exports.deepMerge=function e(t={},n={}){let r;for(r in n)t[r]=le(t[r])?e(t[r],n[r]):t[r]=n[r];return t},exports.doRefreshToken=jt,exports.exportSystemRights=Pn,exports.get=function(e,t){return oe(e,void 0,t)},exports.getCurrentSystemRight=Ce,exports.getData=function(e,t){return T.Axios?.get(e,{params:t}).catch(function(n){De(n,e,"","\u5916\u90E8Get")})},exports.getEncryptPWD=function(e){return je.encryptToString(e,et)},exports.getFunctions=function(e,t=2){if(t===0)return e;const n=Ce();return n?n.functions:void 0},exports.getHexColor=function(e){const t=e.toLowerCase().replace(/rgb?a?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n=parseFloat(t[3]||"1"),r=Math.floor(n*parseInt(t[0])+255*(1-n)),i=Math.floor(n*parseInt(t[1])+255*(1-n)),o=Math.floor(n*parseInt(t[2])+255*(1-n));return"#"+("0"+r.toString(16)).slice(-2)+("0"+i.toString(16)).slice(-2)+("0"+o.toString(16)).slice(-2)},exports.getLocalToken=he,exports.getLockState=function(){return ie.get(It,!1)},exports.getLongHexColor=function(e){const t=e;if(t.length===4){let r="#";for(var n=1;n<4;n+=1){const i=t.slice(n,n+1);r+=i.concat(i)}return r}return t},exports.getProxyClient=_n,exports.getRGBColor=function(e){var t=e.toLowerCase();if(Pe(e)){if(t.length===4){for(var n="#",r=1;r<4;r+=1){const o=t.slice(r,r+1);n+=o.concat(o)}t=n}var i=[];for(r=1;r<7;r+=2)i.push(parseInt("0x"+t.slice(r,r+2)));return"rgb("+i.join(",")+")"}return t},exports.getRGBColorFromHSLA=function(e){if(!!e){var t=e.toLowerCase().match(/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i);if(!!t){var n,r,i,o=(parseFloat(t[1])%360+360)%360/360,l=parseFloat(t[2])/(/%$/.test(t[2])?100:1),d=parseFloat(t[3])/(/%$/.test(t[3])?100:1);if(l===0)n=r=i=d;else{var v=d<=.5?d*(l+1):d+l-d*l,S=2*d-v;n=yt(S,v,o+1/3),r=yt(S,v,o),i=yt(S,v,o-1/3)}return`rgba(${n=Math.round(255*n)},${r=Math.round(255*r)},${i=Math.round(255*i)},${t[4]?parseFloat(t[4]):1})`}}},exports.getRefreshToken=Cn,exports.getRight=Zn,exports.getRoutes=function(e,t=2){if(t===0)return e;const n=Ce();return n&&n.routes?(Vt.length>0||e.forEach(r=>{const i=n.routes?.find(o=>o.name===r.name);if(i){const o=nr(r,i);o&&Vt.push(o)}}),Vt):void 0},exports.getSystemRoleRight=async function(e,t=!1){Qn();const n=fe.GetSystemRights,r=T.Config.ServiceURL.LoginAuthURL,i=await oe(n,r,{systemid:e});if(!i||!i.data)return void T.Message?.warn("\u65E0\u6CD5\u83B7\u53D6\u529F\u80FD\u6388\u6743\u5217\u8868\uFF01");const o=i.data;if(o&&o.length>0){if(t){const l=JSON.parse(o[0]);return Ht(l),l}{const l=tr(o);return Ht(l),l}}},exports.getWidgetConfig=function(e,t=2){if(t===0)return e;const n=Ce();return n&&n.widgets?(qt.length>0||e?.forEach(r=>{n.widgets?.find(i=>i.id===r.id)&&qt.push(r)}),qt):void 0},exports.getWidgetMenus=function(e,t=2){if(t===0)return e;const n=Ce();return n&&n.widgetMenu?(Gt.length>0||e.forEach(r=>{const i=n.widgetMenu?.find(o=>o.name===r.name);if(i){const o=rr(r,i);o&&Gt.push(o)}}),Gt):void 0},exports.handleNodes=ve,exports.hexToRGB=wt,exports.init=function(e,t,n){!T.Config.DefaultHproseAPI&&T.Config.ServiceURL&&(T.Config.DefaultHproseAPI=T.Config.ServiceURL.DefaultHproseAPI),T.Config.DefaultHproseAPI&&Re.isNotEmpty(T.Config.DefaultHproseAPI)&&(T.DefaultProxyClient=new we(T.Config.DefaultHproseAPI));const r=T.Config.UI.GrayMode;r&&te.setGrayMode(r);const i=new bi(e,T.EventBus);T.Message=i,T.SystemID=t,T.SystemGroup=n,T.EventBus.on(Q.HproseServiceErrorEvent,o=>{const l=`\u5F53\u524D\u540E\u53F0\u4E1A\u52A1\u670D\u52A1\u4E0D\u53EF\u7528!${o}`;i.warn(l)}),T.EventBus.on(Q.WebAPIErrorEvent,o=>{const l=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${o}`;i.warn(l)}),T.EventBus.on(Q.AxiosRequestErrorEvent,o=>{const l=`Http\u8BF7\u6C42'${o.code}'\u9519\u8BEF: ${o.message}`;console.warn("Http\u8BF7\u6C42\u9519\u8BEF",o),i.warn(l)}),T.EventBus.on(Q.CommonWarnEvent,o=>{i.warn(o)})},exports.initDefaultProxyClient=function(e){const t=_n(e);return t&&(T.DefaultProxyClient=t),t},exports.is=K,exports.isArray=mt,exports.isAsyncFunction=function(e){return K(e,"AsyncFunction")},exports.isBoolean=function(e){return e===!0||e===!1||K(e,"Boolean")},exports.isClient=()=>typeof window<"u",exports.isDate=function(e){return K(e,"Date")},exports.isDef=vn,exports.isElement=e=>le(e)&&!!e.tagName,exports.isEmpty=function(e){return e==null||(Ie(e)||mt(e)?e.length===0:!!le(e)&&JSON.stringify(e)==="{}")},exports.isEnumColor=function(e){if(typeof e=="object"||!e)return;const t=e.toLowerCase().substring(0,1);return t==="#"?exports.EnumColor.Hex:t==="r"||t==="("?exports.EnumColor.RGBA:t==="h"?exports.EnumColor.Hsla:exports.EnumColor.RGBA},exports.isError=function(e){return K(e,"Error")},exports.isFunction=_e,exports.isHexColor=Pe,exports.isImageDom=function(e){return e&&["IMAGE","IMG"].includes(e.tagName)},exports.isMap=function(e){return K(e,"Map")},exports.isNull=pt,exports.isNullAndUnDef=function(e){return ft(e)&&pt(e)},exports.isNullOrUnDef=function(e){return ft(e)||pt(e)},exports.isNumber=function(e){return K(e,"Number")},exports.isObject=le,exports.isPromise=function(e){return K(e,"Promise")&&le(e)&&_e(e.then)&&_e(e.catch)},exports.isServer=si,exports.isString=Ie,exports.isSymbol=function(e){return K(e,"Symbol")},exports.isUnDef=ft,exports.isValidURL=e=>/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(e),exports.isWeakMap=function(e){return K(e,"WeakMap")},exports.isWeakSet=function(e){return K(e,"WeakSet")},exports.isWindow=e=>typeof window<"u"&&K(e,"Window"),exports.jquery=wi,exports.lighten=function(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${bt(e.substring(0,2),t)}${bt(e.substring(2,4),t)}${bt(e.substring(4,6),t)}`},exports.login=async function(e){const t={username:e.username,pwd:je.encryptToString(e.pwd,et)},n=(await oe(fe.Login,tt,t))?.data;return n&&Ft(n.doubletoken),n},exports.logout=function(){const e=he();e&&(kt(fe.Logout,tt,{token:e.token,reftoken:e.refresh}),xt())},exports.mergeFilterRoleSysRight=tr,exports.mergeNodes=function e(t,n,r="name"){t&&n&&t.forEach(i=>{const o=n.find(l=>l[r]===i[r]);o&&(i.children?o.children&&e(i.children,o.children,r):(!o.children||o.children.length===0)&&o.selected&&(i.selected=o.selected))})},exports.mergeNodesAll=Se,exports.newGuid=function(){var e=new Date().getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var r=(e+16*Math.random())%16|0;return e=Math.floor(e/16),(n==="x"?r:3&r|8).toString(16)});return t},exports.onLockListener=function(){Bt(),document.addEventListener("mousedown",Bt)},exports.post=function(e,t){return kt(e,void 0,t)},exports.requestGet=oe,exports.requestPost=kt,exports.requestPostBody=function(e,t,n,r,i,o="json",l){const d=Et(r,t,i,o);return l&&l>=2e4&&(d.timeout=l),T.Axios?.post(e,n,d).catch(function(v){De(v,t,e,"Post")})},exports.rgbToHex=function(e,t,n){const r=(e<<16|t<<8|n).toString(16);return"#"+new Array(Math.abs(r.length-7)).join("0")+r},exports.setLocalToken=Ft,exports.setRight=Ht,exports.sleep=function(e){for(var t=new Date().getTime();new Date().getTime()-t<e;);console.log(`\u5F3A\u5236\u7B49\u5F85${e}\u6BEB\u79D2`)},exports.storage=ci,exports.storageHelper=ie,exports.unLockListener=function(){document.removeEventListener("mousedown",Bt)},exports.uuid=Le,exports.writeIconifyList=function(e,t="IconifyList.ts"){let n="",r=`const iconlist={
|
|
19
19
|
`,i=0;e.forEach(o=>{const l=o.split(":");if(l&&l.length===2){const d="icon"+i;n+=`import ${d} from '~icons/${l[0]}/${l[1]}'
|
|
20
20
|
`,r+=` '${o}':${d},
|
|
21
21
|
`,i++}}),i>0&&(r+=`};
|
package/dist/index.css
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
--layout-bottom-zindex: 10000;
|
|
13
13
|
--layout-center-zindex: 9999;
|
|
14
14
|
--layout-left-zindex: 10000;
|
|
15
|
+
--layout-right-zindex: 10000;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
.topContainer {
|
|
@@ -20,7 +21,7 @@
|
|
|
20
21
|
left: 0px;
|
|
21
22
|
width: 100%;
|
|
22
23
|
height: var(--layout-top-height);
|
|
23
|
-
z-index:
|
|
24
|
+
z-index: var(--layout-top-zindex);
|
|
24
25
|
pointer-events: none;
|
|
25
26
|
}
|
|
26
27
|
|
|
@@ -30,6 +31,7 @@
|
|
|
30
31
|
left: 0px;
|
|
31
32
|
width: 100%;
|
|
32
33
|
height: var(--layout-bottom-height);
|
|
34
|
+
z-index: var(--layout-bottom-zindex);
|
|
33
35
|
pointer-events: none;
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -38,6 +40,7 @@
|
|
|
38
40
|
top: 0px;
|
|
39
41
|
left: 0px;
|
|
40
42
|
width: var(--layout-left-width);
|
|
43
|
+
z-index: var(--layout-left-zindex);
|
|
41
44
|
height: 100%;
|
|
42
45
|
pointer-events: none;
|
|
43
46
|
}
|
|
@@ -47,6 +50,7 @@
|
|
|
47
50
|
top: 0px;
|
|
48
51
|
right: 0px;
|
|
49
52
|
width: var(--layout-right-width);
|
|
53
|
+
z-index: var(--layout-right-zindex);
|
|
50
54
|
height: 100%;
|
|
51
55
|
pointer-events: none;
|
|
52
56
|
}
|
|
@@ -59,7 +63,83 @@
|
|
|
59
63
|
width: 100%;
|
|
60
64
|
background-color: transparent;
|
|
61
65
|
overflow: hidden;
|
|
62
|
-
pointer-events: none
|
|
66
|
+
pointer-events: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.vcpg {
|
|
70
|
+
border: 1px solid var(--border-color);
|
|
71
|
+
border-radius: 4px;
|
|
72
|
+
width: 100%;
|
|
73
|
+
}
|
|
74
|
+
.vcpg ::v-deep(.vcp) * {
|
|
75
|
+
box-sizing: border-box;
|
|
76
|
+
}
|
|
77
|
+
.vcpg ::v-deep(.vcp) .vcp__header {
|
|
78
|
+
background-color: var(--bg-color-header);
|
|
79
|
+
height: 30px;
|
|
80
|
+
border-bottom: 2px solid #c6bebd;
|
|
81
|
+
transition: background-color 0.3s ease;
|
|
82
|
+
}
|
|
83
|
+
.vcpg ::v-deep(.vcp) .vcp__header .vcp__header:hover {
|
|
84
|
+
background-color: var(--bg-color-header-hover);
|
|
85
|
+
}
|
|
86
|
+
.vcpg ::v-deep(.vcp) .vcp__header .vcp__header:active {
|
|
87
|
+
background-color: var(--bg-color-header-active);
|
|
88
|
+
}
|
|
89
|
+
.vcpg ::v-deep(.vcp) .vcp:not(:first-of-type) .vcp__header {
|
|
90
|
+
border-top: 2px solid var(--border-color);
|
|
91
|
+
}
|
|
92
|
+
.vcpg ::v-deep(.vcp) .vcp__header-title {
|
|
93
|
+
font-weight: 500;
|
|
94
|
+
}
|
|
95
|
+
.vcpg ::v-deep(.vcp) .vcp__body {
|
|
96
|
+
border-top: 1px solid var(--border-color);
|
|
97
|
+
background-color: var(--bg-color-body);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.vcp__header {
|
|
101
|
+
display: flex;
|
|
102
|
+
padding: 12px;
|
|
103
|
+
pointer-events: none;
|
|
104
|
+
}
|
|
105
|
+
.vcp--expandable .vcp__header {
|
|
106
|
+
pointer-events: auto;
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
}
|
|
109
|
+
.vcp__header-title {
|
|
110
|
+
display: flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
flex: 1;
|
|
113
|
+
}
|
|
114
|
+
.vcp__header-icon {
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
transition: transform 0.3s cubic-bezier(0.5, 0.25, 0, 1);
|
|
118
|
+
}
|
|
119
|
+
.vcp--expanded .vcp__header-icon {
|
|
120
|
+
transform-origin: center;
|
|
121
|
+
transform: rotate(180deg);
|
|
122
|
+
}
|
|
123
|
+
.vcp__header-icon > span {
|
|
124
|
+
display: flex;
|
|
125
|
+
height: 24px;
|
|
126
|
+
width: 24px;
|
|
127
|
+
}
|
|
128
|
+
.vcp__header-icon ::v-deep(svg) {
|
|
129
|
+
height: 100%;
|
|
130
|
+
width: 100%;
|
|
131
|
+
}
|
|
132
|
+
.vcp__body {
|
|
133
|
+
overflow: hidden;
|
|
134
|
+
transition: all 0.3s cubic-bezier(0.5, 0.25, 0, 1);
|
|
135
|
+
}
|
|
136
|
+
.vcp__body-content {
|
|
137
|
+
padding: 12px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.slide-enter-from,
|
|
141
|
+
.slide-leave-to {
|
|
142
|
+
opacity: 0.25;
|
|
63
143
|
}
|
|
64
144
|
|
|
65
145
|
.splitpanes {
|
|
@@ -172,82 +252,6 @@
|
|
|
172
252
|
margin-top: 1px;
|
|
173
253
|
}
|
|
174
254
|
|
|
175
|
-
.vcpg {
|
|
176
|
-
border: 1px solid var(--border-color);
|
|
177
|
-
border-radius: 4px;
|
|
178
|
-
width: 100%;
|
|
179
|
-
}
|
|
180
|
-
.vcpg ::v-deep(.vcp) * {
|
|
181
|
-
box-sizing: border-box;
|
|
182
|
-
}
|
|
183
|
-
.vcpg ::v-deep(.vcp) .vcp__header {
|
|
184
|
-
background-color: var(--bg-color-header);
|
|
185
|
-
height: 30px;
|
|
186
|
-
border-bottom: 2px solid #c6bebd;
|
|
187
|
-
transition: background-color 0.3s ease;
|
|
188
|
-
}
|
|
189
|
-
.vcpg ::v-deep(.vcp) .vcp__header .vcp__header:hover {
|
|
190
|
-
background-color: var(--bg-color-header-hover);
|
|
191
|
-
}
|
|
192
|
-
.vcpg ::v-deep(.vcp) .vcp__header .vcp__header:active {
|
|
193
|
-
background-color: var(--bg-color-header-active);
|
|
194
|
-
}
|
|
195
|
-
.vcpg ::v-deep(.vcp) .vcp:not(:first-of-type) .vcp__header {
|
|
196
|
-
border-top: 2px solid var(--border-color);
|
|
197
|
-
}
|
|
198
|
-
.vcpg ::v-deep(.vcp) .vcp__header-title {
|
|
199
|
-
font-weight: 500;
|
|
200
|
-
}
|
|
201
|
-
.vcpg ::v-deep(.vcp) .vcp__body {
|
|
202
|
-
border-top: 1px solid var(--border-color);
|
|
203
|
-
background-color: var(--bg-color-body);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.vcp__header {
|
|
207
|
-
display: flex;
|
|
208
|
-
padding: 12px;
|
|
209
|
-
pointer-events: none;
|
|
210
|
-
}
|
|
211
|
-
.vcp--expandable .vcp__header {
|
|
212
|
-
pointer-events: auto;
|
|
213
|
-
cursor: pointer;
|
|
214
|
-
}
|
|
215
|
-
.vcp__header-title {
|
|
216
|
-
display: flex;
|
|
217
|
-
align-items: center;
|
|
218
|
-
flex: 1;
|
|
219
|
-
}
|
|
220
|
-
.vcp__header-icon {
|
|
221
|
-
display: flex;
|
|
222
|
-
align-items: center;
|
|
223
|
-
transition: transform 0.3s cubic-bezier(0.5, 0.25, 0, 1);
|
|
224
|
-
}
|
|
225
|
-
.vcp--expanded .vcp__header-icon {
|
|
226
|
-
transform-origin: center;
|
|
227
|
-
transform: rotate(180deg);
|
|
228
|
-
}
|
|
229
|
-
.vcp__header-icon > span {
|
|
230
|
-
display: flex;
|
|
231
|
-
height: 24px;
|
|
232
|
-
width: 24px;
|
|
233
|
-
}
|
|
234
|
-
.vcp__header-icon ::v-deep(svg) {
|
|
235
|
-
height: 100%;
|
|
236
|
-
width: 100%;
|
|
237
|
-
}
|
|
238
|
-
.vcp__body {
|
|
239
|
-
overflow: hidden;
|
|
240
|
-
transition: all 0.3s cubic-bezier(0.5, 0.25, 0, 1);
|
|
241
|
-
}
|
|
242
|
-
.vcp__body-content {
|
|
243
|
-
padding: 12px;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.slide-enter-from,
|
|
247
|
-
.slide-leave-to {
|
|
248
|
-
opacity: 0.25;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
255
|
.window {
|
|
252
256
|
display: flex;
|
|
253
257
|
flex-flow: column;
|
package/dist/index.js
CHANGED
|
@@ -19,4 +19,4 @@ import{h as zr,openBlock as H,createElementBlock as Y,normalizeStyle as vt,rende
|
|
|
19
19
|
>
|
|
20
20
|
<path d="M6.34292 7.75734L4.92871 9.17155L11.9998 16.2426L19.0708 9.17158L17.6566 7.75737L11.9998 13.4142L6.34292 7.75734Z"/>
|
|
21
21
|
</svg>
|
|
22
|
-
`}}});const es={class:"vcp__header-title"},ns={key:0,class:"vcp__header-icon"},is=["innerHTML"],rs={key:0,ref:"bodyRef",class:"vcp__body"},os={ref:"bodyContentRef",class:"vcp__body-content"};function Qe(t){return window.TouchEvent&&t instanceof TouchEvent}re.render=function(t,e,n,i,r,o){return H(),Y("section",{ref:"panelRef",class:_r(["vcp",{"vcp--expanded":t.isExpanded,"vcp--expandable":t.body.hasContent}])},[J("header",{class:"vcp__header",onClick:e[0]||(e[0]=(...u)=>t.toggle&&t.toggle(...u))},[J("div",es,[pt(t.$slots,"title")]),t.body.hasContent?(H(),Y("div",ns,[pt(t.$slots,"icon",{},()=>[J("span",{innerHTML:t.toggleIcon},null,8,is)])])):yt("v-if",!0)]),Tn(Bn,{"data-key":t.body.dataKey,name:"slide",onBeforeEnter:t.collapse,onEnter:t.expand,onBeforeLeave:t.expand,onLeave:t.collapse},{default:$t(()=>[t.isExpanded?(H(),Y("div",rs,[J("div",os,[pt(t.$slots,"content")],512)],512)):yt("v-if",!0)]),_:3},8,["data-key","onBeforeEnter","onEnter","onBeforeLeave","onLeave"])],2)},re.__scopeId="data-v-08c94cf8",re.__file="src/controls/collapsepanel/VCollapsiblePanel.vue";class tt{e;constructor(e){this.e=e}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return Qe(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return Qe(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new fn(this.clientX,this.clientY)}static bindDown(e,n,i,r=!1){const o=d=>{n(new tt(d))},u=d=>{d.touches.length===1&&n(new tt(d)),d.touches.length>1&&i&&i(new tt(d))};return e.addEventListener("mousedown",o,r),e.addEventListener("touchstart",u,r),()=>{e.removeEventListener("mousedown",o,r),e.removeEventListener("touchstart",u,r)}}static bindMove(e,n,i=!1){const r=u=>{n(new tt(u))},o=u=>{u.touches.length===1&&n(new tt(u))};return e.addEventListener("mousemove",r,i),e.addEventListener("touchmove",o,i),()=>{e.removeEventListener("mousemove",r,i),e.removeEventListener("touchmove",o,i)}}static bindUp(e,n,i=!1){const r=u=>{n(new tt(u))},o=u=>{u.touches.length===0&&n(new tt(u))};return e.addEventListener("mouseup",r,i),e.addEventListener("touchend",o,i),()=>{e.removeEventListener("mouseup",r,i),e.removeEventListener("touchend",o,i)}}originalEvent({mouse:e,touch:n}){Qe(this.e)?n&&n(this.e):e&&e(this.e)}}class fn{x;y;constructor(e,n){this.x=e,this.y=n}clone(){return new fn(this.x,this.y)}}class ss{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(e,n,i={}){this.handle=e,this.container=n,this.options=i,e&&(this.unbindDown=tt.bindDown(e,this.mousedown),e.classList.add("draggable-handle"))}teardown(){this.handle?.classList.remove("draggable-handle"),this.unbindDown&&this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove()}offsetX;offsetY;mousedown=e=>{if(e.preventDefault(),this.handle){const{left:n,top:i}=this.handle.getBoundingClientRect();this.offsetX=e.clientX-n,this.offsetY=e.clientY-i}this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=tt.bindMove(document,this.mousemove),this.unbindUp=tt.bindUp(document,this.mouseup)};mousemove=e=>{this.container&&(this.container.style.left=e.clientX-this.offsetX+"px",this.container.style.top=e.clientY-this.offsetY+"px"),this.options.onMove&&this.options.onMove()};mouseup=e=>{this.options.onMoveEnd&&this.options.onMoveEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0}}class as{_group;onChange;zIndex;constructor(e,n){this._group=e,this.onChange=n,this.a(i=>i.push(this))}set group(e){this._group=e;const n=se(this._group),i=se(e);n.splice(n.indexOf(this),1),i.push(this),mi()}get group(){return this._group}unregister(){this.a(e=>e.splice(e.indexOf(this),1))}raise(){this.a(e=>{e.splice(e.indexOf(this),1),e.push(this)})}a(e){e(se(this._group)),mi()}}const oe=new Map;function se(t){return oe.has(t)||oe.set(t,[]),oe.get(t)}function pi(t,e){return t>e?-pi(e,t):t<0&&e>=0?1:t-e}function mi(){let t=0;for(const e of function(n){const i=[];return n.forEach((r,o)=>i.push(o)),i}(oe).sort(pi))for(const n of se(e))t!=n.zIndex&&(n.zIndex=t,n.onChange(t)),t++}function tn(t){if(t){const{width:e,height:n}=t.style;t.style.width="auto",t.style.height="auto";const i=ae(t);return t.style.width=e,t.style.height=n,i}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function ae(t){const e=t.getBoundingClientRect(),n=e.width,i=e.height,r=e.top,o=e.left;return{width:n,height:i,top:r,left:o,bottom:r+i,right:o+n}}class cs{container;options;handles;constructor(e,n){if(this.container=e,this.options=n,e&&n){this.handles=gi.map(v=>new v(e,this));const{width:i,height:r}=tn(e),o=n.maxWidth||window.innerWidth,u=n.maxHeight||window.innerHeight;let d=!1;(i<n.minWidth||i>o)&&(e.style.width=`${vi(i,n.minWidth,o)}px`,d=!0),(r<n.minHeight||r>u)&&(e.style.height=`${vi(r,n.minHeight,u)}px`,d=!0),d&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(e=>e.teardown())}}const gi=[];class gt{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(e,n){this.container=e,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=tt.bindDown(this.handle,this.mousedown)}teardown(){this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove(),this.handle.parentElement.removeChild(this.handle)}x0;y0;left0;top0;width0;height0;mousedown=e=>{e.preventDefault(),e.stopPropagation();const{left:n,top:i,width:r,height:o}=ae(this.container);this.x0=e.clientX,this.y0=e.clientY,this.left0=n,this.top0=i,this.width0=r,this.height0=o,this.calcSafeBoundaries(),this.helper.options&&this.helper.options.onResizeStart&&this.helper.options.onResizeStart(),this.unbindMove=tt.bindMove(document,this.mousemove),this.unbindUp=tt.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:e,top:n,right:i,bottom:r}=ae(this.container),o=this.helper.options,u=o.maxWidth||window.innerWidth,d=o.maxHeight||window.innerHeight;this.minLeft=Math.max(i-u,0),this.maxLeft=i-o.minWidth,this.minRight=e+o.minWidth,this.maxRight=Math.min(e+u,window.innerWidth),this.minTop=Math.max(r-d,0),this.maxTop=r-o.minHeight,this.minBottom=n+o.minHeight,this.maxBottom=Math.min(n+d,window.innerHeight)}mousemove=e=>{e.preventDefault(),e.stopPropagation(),this.setPosition(e),this.fixPosition(),this.helper.options&&this.helper.options.onResize&&this.helper.options.onResize()};fixPosition(){const{width:e,height:n,left:i,top:r,right:o,bottom:u}=ae(this.container),d=this.helper.options;!d||(i<this.minLeft?(this.container.style.width=e+i-this.minLeft+"px",this.container.style.left=`${this.minLeft}px`):i>this.maxLeft?(this.container.style.width=`${d.minWidth}px`,this.container.style.left=`${this.maxLeft}px`):o<this.minRight?this.container.style.width=`${d.minWidth}px`:o>this.maxRight&&(this.container.style.width=this.maxRight-i+"px"),r<this.minTop?(this.container.style.height=n+r-this.minTop+"px",this.container.style.top=`${this.minTop}px`):r>this.maxTop?(this.container.style.height=`${d.minHeight}px`,this.container.style.top=`${this.maxTop}px`):u<this.minBottom?this.container.style.height=`${d.minHeight}px`:u>this.maxBottom&&(this.container.style.height=this.maxBottom-r+"px"))}mouseup=e=>{e.preventDefault(),e.stopPropagation(),this.helper.options&&this.helper.options.onResizeEnd&&this.helper.options.onResizeEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0};createHandleElement(){const e=document.createElement("div"),n=e.style;return n.position="absolute",this.applyStyle(n),this.container.appendChild(e),e}}function vi(t,e,n){return t<e?e:t>n?n:t}gi.push(class extends gt{setPosition(t){this.container.style.width=this.width0+t.clientX-this.x0+"px",this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.right=-this.handleSize+"px",t.bottom=-this.handleSize+"px",t.cursor="nwse-resize"}},class extends gt{setPosition(t){this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.right=`${this.handleSize}px`,t.left=`${this.handleSize}px`,t.height=2*this.handleSize+"px",t.bottom=-this.handleSize+"px",t.cursor="ns-resize"}},class extends gt{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px",this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.bottom=-this.handleSize+"px",t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.cursor="nesw-resize"}},class extends gt{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.bottom=`${this.handleSize}px`,t.width=2*this.handleSize+"px",t.top=`${this.handleSize}px`,t.cursor="ew-resize"}},class extends gt{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px",this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.top=-this.handleSize+"px",t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.cursor="nwse-resize"}},class extends gt{setPosition(t){this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px"}applyStyle(t){t.left=`${this.handleSize}px`,t.right=`${this.handleSize}px`,t.height=2*this.handleSize+"px",t.top=-this.handleSize+"px",t.cursor="ns-resize"}},class extends gt{setPosition(t){this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px",this.container.style.width=this.width0+t.clientX-this.x0+"px"}applyStyle(t){t.right=-this.handleSize+"px",t.top=-this.handleSize+"px",t.height=2*this.handleSize+"px",t.width=2*this.handleSize+"px",t.cursor="nesw-resize"}},class extends gt{setPosition(t){this.container.style.width=this.width0+t.clientX-this.x0+"px"}applyStyle(t){t.right=-this.handleSize+"px",t.top=`${this.handleSize}px`,t.bottom=`${this.handleSize}px`,t.width=2*this.handleSize+"px",t.cursor="ew-resize"}});var ce=Lt({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(t){const e=it(!1),n=it(!1);return{hover:e,active:n,style:function(){let i=t.windowStyle.button;return e.value&&(i={...i,...this.windowStyle.buttonHover}),n.value&&(i={...i,...this.windowStyle.buttonActive}),i},mouseup:function(i){this.active&&this.$emit("click")},mousedown:function(i){i.preventDefault(),n.value=!0;const r=tt.bindUp(document,()=>{n.value=!1,r()})}}}});const us=["disabled"];ce.render=function(t,e,n,i,r,o){return H(),Y("div",{class:"btn",style:vt(t.style()),onMouseenter:e[0]||(e[0]=u=>t.hover=!0),onMouseleave:e[1]||(e[1]=u=>t.hover=!1),onMousedown:e[2]||(e[2]=Nn((...u)=>t.mousedown&&t.mousedown(...u),["stop"])),onTouchstart:e[3]||(e[3]=Nn((...u)=>t.mousedown&&t.mousedown(...u),["stop"])),onMouseup:e[4]||(e[4]=(...u)=>t.mouseup&&t.mouseup(...u)),onTouchend:e[5]||(e[5]=(...u)=>t.mouseup&&t.mouseup(...u)),disabled:t.disabled},[pt(t.$slots,"default")],44,us)},ce.__scopeId="data-v-71662210",ce.__file="src/controls/vuewindow/window/Button.vue";const en=new Set;function yi(t){return t!==null?parseFloat(t):0}function ue(t){const e=window.getComputedStyle(t),n=Math.ceil([e.paddingLeft,e.width,e.paddingRight].map(yi).reduce((r,o)=>r+o)),i=Math.ceil([e.paddingTop,e.height,e.paddingBottom].map(yi).reduce((r,o)=>r+o));return{width:n,height:i}}class wi{width;height;constructor(e,n){this.width=e,this.height=n}}function ls(t){const e=t.windowEl;if(e){const n=parseFloat(e.style.left||"NaN"),i=parseFloat(e.style.top||"NaN");if(!isNaN(n)&&!isNaN(i))return{left:n,top:i}}return null}function hs(t,e,n,i){const r=t-n,o=e-i;return r*r+o*o}window.addEventListener("resize",t=>{en.forEach(e=>{e&&Wt(e.fixPosition)&&e.fixPosition()})});const le=[];var he=Lt({name:"Window",props:{windowStyle:{type:Object,required:!0},isOpen:{type:Boolean,required:!1,default:!0},title:{type:String,required:!0,default:""},closeButton:{type:Boolean,required:!1,default:!0},resizable:{type:Boolean,required:!1,default:!1},isScrollable:{type:Boolean,required:!1,default:!1},padding:{type:Number,required:!1,default:8},activateWhenOpen:{type:Boolean,required:!1,default:!0},positionHint:{type:String,required:!1,default:""},zGroup:{type:Number,required:!1,default:1},overflow:{type:String,required:!1,default:"visible"},minWidth:{type:Number,required:!1,default:1},minHeight:{type:Number,required:!1,default:0},maxWidth:{type:Number,required:!1,default:0},maxHeight:{type:Number,required:!1,default:0},height:{type:Number,required:!1},width:{type:Number,required:!1},top:{type:Number,required:!1},left:{type:Number,required:!1}},components:{myButton:ce},setup(t,{emit:e}){const n=Ir();if(!n)return;const{proxy:i}=n;let r=0,o,u,d;const v=it(t.isOpen),b=()=>{le.push(i),d=new as(t.zGroup,C),t.isOpen&&function(I){I&&(_e(()=>{r++==0&&(f(i),function(){const P=E.value,{width:O,height:j}=tn(P);let U,W;if(t.left!==void 0!=(t.top!==void 0))throw new Error("Either of left or top is specified. Both must be set or not set.");if(typeof t.left=="number")U=t.left,W=t.top;else{const et=t.positionHint||"auto";switch(et){case"auto":{let X=20,K=50,q=0;do{if(le.every(st=>{if(!st.isOpen||i==st)return!0;const Ut=ls(st);if(Ut==null)return!0;const{left:ve,top:rt}=Ut;return hs(ve,rt,X,K)>16}))break;X=(X+40)%(window.innerWidth-200),K=(K+40)%(window.innerHeight-200)}while(++q<100);U=X,W=K}break;case"center":U=(window.innerWidth-O)/2,W=(window.innerHeight-j)/2,console.log(U,W,window.innerWidth,window.innerHeight,"111111");break;default:try{const X=et.split("/").map(Number);if(X.length!=2)throw null;const[K,q]=X;if(!isFinite(K)||!isFinite(q))throw null;U=K>=0?K:window.innerWidth-O+K,W=q>=0?q:window.innerHeight-j+q}catch{throw new Error(`invalid position string: ${et}`)}}}P&&(P.style.left=`${U}px`,P.style.top=`${W}px`)}()),t.resizable&&h(),A(),o=new ss(L.value,E.value,{onMove:()=>A(),onMoveStart:()=>e("move-start"),onMoveEnd:()=>e("move-end")}),t.resizable&&function(){const{height:P}=tn(L.value);u=new cs(E.value,{onResize:()=>h(),onResizeStart:()=>e("resize-start"),onResizeEnd:()=>e("resize-end"),minWidth:t.minWidth,minHeight:t.minHeight+P,maxWidth:t.maxWidth,maxHeight:t.maxHeight?t.maxHeight+P:void 0})}()}),t.activateWhenOpen&&R())}(!0),en.add(i)};function C(I){S.value.zIndex=`${I}`}const E=it(null),L=it(null),T=it(null);function R(){d.raise(),e("activate")}const S=it({...t.windowStyle.window,zIndex:"auto",overflow:t.overflow}),l=mt(()=>t.windowStyle.titlebar),p=mt(()=>{const I={...t.windowStyle.content};return t.resizable?I.padding="0":t.padding!=null&&(I.padding=`${t.padding}px`),t.isScrollable&&(I.overflow="auto"),I});function f(I){const{width:P,height:O,top:j,left:U}=I,W=E;if(W&&P!=null&&(W.value.style.width=`${P}px`),O!=null){const et=L.value;if(et){const X=ue(et).height;W.value.style.height=`${O+X}px`}}W&&U!=null&&(W.value.style.left=`${U}px`),W&&j!=null&&(W.value.style.top=`${j}px`)}function h(I=!0){const P=E.value,O=L.value,j=T.value;if(j&&P&&O){const{width:U,height:W}=ue(j),{width:et,height:X}=ue(P),K=ue(O).height,q=et-(j.offsetWidth-U),st=X-K-(j.offsetHeight-W);j.style.width=`${q}px`,j.style.height=`${st}px`,g(),e("resize",new wi(q,st)),I&&(e("update:width",q),e("update:height",st))}}function g(){const I=E.value;if(I){const P=I.getBoundingClientRect();P.left<0&&(S.value.left="0px"),P.top<0&&(S.value.top="0px"),P.right>window.innerWidth&&(S.value.left=window.innerWidth-P.width+"px"),P.bottom>window.innerHeight&&(S.value.top=window.innerHeight-P.height+"px")}}function A(I=!0){g();const P=E.value;if(P){const{left:O,top:j}=P.getBoundingClientRect();I&&(e("update:left",O),e("update:top",j))}}return At(()=>t.isOpen,I=>{v.value=I}),At(()=>t.zGroup,I=>{d.group=I}),At(()=>t.width,I=>{f({width:I}),h(!1)}),At(()=>t.height,I=>{f({height:I}),h(!1)}),Me(()=>{b()}),Rr(()=>{en.delete(this),d.unregister(),u&&u.teardown(),o&&o.teardown(),le.splice(le.indexOf(i),1)}),{isOpen:v,windowEl:E,titlebar:L,content:T,activate:R,styleWindow:S,styleTitlebar:l,styleContent:p,closeButtonClick:function(){v.value=!1,e("closebuttonclick")},fixPosition:g}}});const ds={class:"title"},fs=On("\xD7");var bi;he.render=function(t,e,n,i,r,o){const u=Un("myButton");return H(),ct(Bn,{name:"fade",onAfterLeave:e[2]||(e[2]=d=>t.$emit("close")),onAfterEnter:e[3]||(e[3]=d=>t.$emit("open")),persisted:""},{default:$t(()=>[Pr(J("div",{class:"window",style:vt(t.styleWindow),ref:"windowEl",onMousedown:e[0]||(e[0]=(...d)=>t.activate&&t.activate(...d)),onTouchstart:e[1]||(e[1]=(...d)=>t.activate&&t.activate(...d))},[J("div",{class:"titlebar",style:vt(t.styleTitlebar),ref:"titlebar"},[J("div",ds,[t.$slots.title?pt(t.$slots,"title",{key:0}):(H(),Y(wt,{key:1},[On(Lr(t.title),1)],64))]),t.closeButton?(H(),ct(u,{key:0,windowStyle:t.windowStyle,onClick:t.closeButtonClick},{default:$t(()=>[fs]),_:1},8,["windowStyle","onClick"])):yt("v-if",!0)],4),J("div",{class:"content",style:vt(t.styleContent),ref:"content"},[pt(t.$slots,"default")],4)],36),[[Ar,t.isOpen]])]),_:3})},he.__file="src/controls/vuewindow/window/index.vue",function(t){t[t.StyleBlack=0]="StyleBlack",t[t.StyleWhite=1]="StyleWhite",t[t.StyleMetal=2]="StyleMetal",t[t.StyleGrayblue=3]="StyleGrayblue"}(bi||(bi={}));const ps={window:{color:"#fff",boxShadow:"0 0 6pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(31, 31, 31, 0.9)"},titlebar:{backgroundColor:"rgba(63, 63, 63, 0.9)"},content:{},button:{color:"white"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},ms={window:{color:"#000",boxShadow:"0 2pt 4pt rgba(0, 0, 0, 0.5)",backgroundColor:"rgba(239, 239, 239, 0.95)"},titlebar:{backgroundColor:"rgba(191, 191, 191, 0.9)"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},gs={window:{color:"#000",boxShadow:"0 4pt 8pt rgba(0, 0, 0, 0.5)",background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},titlebar:{background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},vs={window:{color:"#fff",fontSize:"14px",boxShadow:"0 0 3pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(4,51,81,0.6)",borderRadius:"5px"},titlebar:{backgroundColor:"rgba(4,51,81,0.8)",border:"1px solid rgba(153, 153, 153, 0.5)",borderRadius:"5px",fontSize:"16px",fontWeight:400,color:"#fff"},content:{},button:{color:"white",fontSize:"18px"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},ys=he;var V;(function(t){t[t.top=0]="top",t[t.bottom=1]="bottom",t[t.centerBack=2]="centerBack",t[t.centerMain=3]="centerMain",t[t.centerFront=4]="centerFront",t[t.left=5]="left",t[t.right=6]="right"})(V||(V={}));class Si{layoutState;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;widgetConfig=new Array;_LayoutID;constructor(e,n,i){this.layoutState=e,this._LayoutID=i,n.forEach(r=>{if(r.layoutID===i&&(this.widgetConfig.push(r),r.afterid))if(this.preConditionMap.has(r.afterid))this.preConditionMap.get(r.afterid)?.add(r);else{const o=new Set;o.add(r),this.preConditionMap.set(r.afterid,o)}})}getLayoutID(){return this._LayoutID}getWidgetConfig(){return this.widgetConfig}preloadWidgets(){this.widgetConfig.filter(e=>e.preload&&!e.afterid).forEach(e=>{this._loadWidget(e)})}async loadWidget(e){if(!e)return;let n;return St(e)?n=e:Ht(e)&&(n=this.widgetConfig.find(i=>i.id===e)),n?n.afterid?(this.isWidgetLoaded(n.afterid)||await this.loadWidget(n.afterid),this._loadWidget(n)):this._loadWidget(n):void 0}loadOtherDependenceWidgets(e){this.preConditionMap.has(e)&&this.preConditionMap.get(e)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(e){if(!this.widgetsLoadedSet.has(e.id))return e.component().then(n=>{if(n.default){const i=Dr(n.default);this.getContainerComponents(e.container).value.set(e.id,i),this.widgetsLoadedSet.add(e.id),_e().then(()=>{B.EventBus.emit(nt.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:e.id}),this.loadOtherDependenceWidgets(e.id)})}})}hasDependentWidgets(e){let n=!1;if(this.preConditionMap.has(e)){const i=this.preConditionMap.get(e);if(i){for(const r of i)if(this.isWidgetLoaded(r.id)){n=!0;break}}}return n}unloadWidget(e){if(!e||!this.isWidgetLoaded(e))return;const n=this.widgetConfig.find(i=>i.id===e);if(n){if(this.preConditionMap.has(e)){const o=this.preConditionMap.get(e);if(o)for(const u of o)this.unloadWidget(u.id)}const i=this.getContainerComponents(n.container),r=i.value.get(e);r&&r.unmounted&&r.unmounted(),i.value.delete(e),this.widgetsLoadedSet.delete(e),B.EventBus.emit(nt.WidgetUnLoadedEvent,{layoutID:this._LayoutID,widgetID:e})}}isWidgetLoaded(e){return this.widgetsLoadedSet.has(e)}splitTwoContainer(e=!1){const n=this.layoutState.centerMainContainer,i=this.layoutState.centerBackContainer;e?(n&&(n.style.left="0",n.style.width="100%"),i&&(i.style.width="100%")):(n&&(n.style.left="50%",n.style.width="50%"),i&&(i.style.width="50%"))}getLayoutContainer(e){switch(e){case V.top:return this.layoutState.topContainer;case V.bottom:return this.layoutState.bottomContainer;case V.left:return this.layoutState.leftContainer;case V.right:return this.layoutState.rightContainer;case V.centerBack:return this.layoutState.centerBackContainer;case V.centerMain:return this.layoutState.centerMainContainer;case V.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(e,n=!1){const i=this.getLayoutContainer(e);i&&(i.style.visibility=n?"visible":"hidden")}changeWidgetVisible(e,n=!1){const i=this.getWidgetComponent(e);i&&B.EventBus.emit(nt.WidgetVisibleChanged,{id:e,layoutID:this._LayoutID,name:i.name,visible:n})}getWidgetComponent(e){if(this.widgetsLoadedSet.has(e)){const n=this.widgetConfig.find(i=>i.id===e);if(n)return this.getContainerComponents(n.container).value.get(e)}}getWigetItem(e){return this.widgetConfig.find(n=>n.id===e)}getGroupWigetItems(e){return this.widgetConfig.filter(n=>n.group===e)}getContainerComponents(e){if(this.layoutMap.has(e))return this.layoutMap.get(e);{const n=it(new Map);return this.layoutMap.set(e,n),n}}addContainerComponent(e,n){}}var de=Lt({name:"MainContainer",props:{widgetConfig:{type:Array,required:!0,default:()=>[]},layoutID:{type:String,default:void 0},layoutStyle:{type:Object},enableRouterView:{type:Boolean,default:!0}},emits:["containerLoaded"],setup(t,{attrs:e,slots:n,emit:i}){const r=t.layoutID,o=it(t.enableRouterView);At(()=>t.enableRouterView,()=>{o.value=t.enableRouterView});const u=Dn({topContainer:void 0,centerBackContainer:void 0,centerMainContainer:void 0,centerFrontContainer:void 0,bottomContainer:void 0,leftContainer:void 0,rightContainer:void 0}),d=new Si(u,t.widgetConfig,r),v=R(V.top),b=R(V.centerBack),C=R(V.centerFront),E=R(V.left),L=R(V.right),T=R(V.bottom);function R(l){return d?.getContainerComponents(l)}const S=mt(()=>t.layoutStyle);return Me(()=>{d&&(d.preloadWidgets(),r===void 0&&(B.LayoutManager=d),i("containerLoaded",{layoutID:r,layoutManager:d}))}),{...Tr(u),topContainerComponents:v,centerbackComponents:b,centerfrontComponents:C,leftContainerComponents:E,rightContainerComponents:L,bottomContainerComponents:T,containerStyle:S,isEnableRouterView:o}}});const ws={ref:"topContainer",class:"topContainer"},bs={ref:"centerBackContainer",class:"centerdiv backContainer"},Ss={key:0,ref:"centerMainContainer",class:"centerdiv mainContainer"},xs={ref:"centerFrontContainer",class:"centerdiv centerContainer"},Cs={ref:"leftContainer",class:"leftContainer"},Es={ref:"rightContainer",class:"rightContainer"},ks={ref:"bottomContainer",class:"bottomContainer"};de.render=function(t,e,n,i,r,o){const u=Un("router-view");return H(),Y("div",{class:"layoutContainer",style:vt(t.containerStyle)},[J("div",ws,[(H(!0),Y(wt,null,Mt(t.topContainerComponents,([d,v])=>(H(),ct(bt(v),{key:d}))),128))],512),J("div",null,[yt(" \u5E95\u5C42-\u4E3B\u5BB9\u5668 "),J("div",bs,[(H(!0),Y(wt,null,Mt(t.centerbackComponents,([d,v])=>(H(),ct(bt(v),{key:d}))),128))],512),yt(" \u4E3B\u8981\u5BB9\u5668 "),t.isEnableRouterView?(H(),Y("div",Ss,[Tn(u,null,{default:$t(({Component:d})=>[(H(),ct(bt(d)))]),_:1})],512)):yt("v-if",!0),yt(" \u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),J("div",xs,[(H(!0),Y(wt,null,Mt(t.centerfrontComponents,([d,v])=>(H(),ct(bt(v),{key:d}))),128))],512),J("div",Cs,[(H(!0),Y(wt,null,Mt(t.leftContainerComponents,([d,v])=>(H(),ct(bt(v),{key:d}))),128))],512),J("div",Es,[(H(!0),Y(wt,null,Mt(t.rightContainerComponents,([d,v])=>(H(),ct(bt(v),{key:d}))),128))],512)]),J("div",ks,[(H(!0),Y(wt,null,Mt(t.bottomContainerComponents,([d,v])=>(H(),ct(bt(v),{key:d}))),128))],512)],4)},de.__scopeId="data-v-4d081e5c",de.__file="src/controls/layoutcontainer/layout.vue";const fe=new Map,nn=new Map;let pe;const zs={getDefaultClient(){if(pe||(pe=new Dt(SysConfig.DefaultHproseAPI)),!pe)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return pe},registerHprose(t,e){const n=nn.get(t);if(!n){const i=new Dt(e);fe.set(t,i)}return n},getHprose:t=>nn?.get(t),getProxyHprose:t=>fe.get(t),unregisterHprose(t){fe.get(t)&&(nn.delete(t),fe.delete(t))}},Ms=5e3,_s=36e5,kt={Login:"/api/User/Login",ChangeMyPwd:"/api/User/ChangeMyPwd",Logout:"/api/Check/ExitLogin",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken",GetSystemRights:"/api/System/GetSystem"},rn="access_token",Is=B.Config.ServiceURL.LoginAuthURL;function on(){const t=Gn();t&<(kt.RefreshToken,Is,{refreshToken:t}).then(e=>{sn(e.data)})}function xi(){const t=ut.getJsonObject(rn);if(!t)return;const e=new Date().getTime(),n=new Date(t.expire).getTime()-e;n>0&&(n<=5e3?on():setTimeout(on,n-5e3))}function sn(t){const e=new Date().getTime();let n=new Date(t.accessToken.expires).getTime()-e;if(n>=36e5?(n=18e5,B.Message?.err("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u8FC7\u53BB\u65F6\u95F4\uFF01")):n<-6e5&&(n=18e5,B.Message?.err("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u672A\u6765\u65F6\u95F4\uFF01")),n>0){let i=Ct();i?(i.token=t.accessToken.tokenContent,i.expire=t.accessToken.expires,i.refresh=t.refreshToken.tokenContent):i={token:t.accessToken.tokenContent,expire:t.accessToken.expires,refresh:t.refreshToken.tokenContent},ut.set(rn,i,n/1e3),xi()}else ut.remove(rn)}const me="Wm314243",ge=B.Config.ServiceURL.LoginAuthURL;async function Rs(t){const e={username:t.username,pwd:ee.encryptToString(t.pwd,me)},n=(await lt(kt.Login,ge,e))?.data;return n&&sn(n.doubletoken),n}function Ps(t){const e={oldpwd:ee.encryptToString(t.oldpwd,me),newpwd:ee.encryptToString(t.newpwd,me)};return lt(kt.ChangeMyPwd,ge,e)}function Ls(t){return ee.encryptToString(t,me)}function As(){const t=Ct();t&&(We(kt.Logout,ge,{token:t.token,reftoken:t.refresh}),Fe())}function Ds(t){return lt(kt.CheckToken,ge,{token:t})}const an="ROLE_SYSTEM_RIGHT",cn=new Gt("",sessionStorage);function Ci(){return cn.get(an)}function un(t){cn.set(an,t)}function Ei(){cn.remove(an)}function Rt(t){if(t)for(let e=0;e<t.length;e++){const n=t[e];n.children&&n.children.length>0?(Rt(n.children),n.children.length===0&&(t.splice(e,1),e--)):n.selected||(t.splice(e,1),e--)}}function ki(t,e,n="name"){t&&e&&t.forEach(i=>{const r=e.find(o=>o[n]===i[n]);r&&(i.children?r.children&&ki(i.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(i.selected=r.selected))})}function zi(t,e,n="name"){t&&e&&t.forEach(i=>{const r=e.find(o=>o[n]===i[n]);r&&(i.children?r.children&&zi(i.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(i.selected=r.selected))})}function Bt(t,e,n,i="name"){const r=t[n],o=e[n];r?o&&zi(r,o,i):o&&(t[n]=o)}function Mi(t){if(t&&t.length>0){const e=t.length;let n,i=!1;if(e>0){i=St(t[0]);const r=i?t[0]:JSON.parse(t[0]);if(e>1)for(let o=1;o<t.length;o++){const u=t[o],d=i?u:JSON.parse(u);Bt(r,d,"routes","name"),Bt(r,d,"widgetMenu","name"),Bt(r,d,"widgets","id"),Bt(r,d,"functions","id")}n=r}return n&&(Rt(n.routes),Rt(n.widgetMenu),Rt(n.widgets),Rt(n.functions)),n}}const ln=[],hn=[],dn=[];function Nt(){return Ci()}async function Ts(t,e=!1){Ei();const n=kt.GetSystemRights,i=B.Config.ServiceURL.LoginAuthURL,r=await lt(n,i,{systemid:t});if(!r||!r.data)return void B.Message?.warn("\u65E0\u6CD5\u83B7\u53D6\u529F\u80FD\u6388\u6743\u5217\u8868\uFF01");const o=r.data;if(o&&o.length>0){if(e){const u=JSON.parse(o[0]);return un(u),u}{const u=Mi(o);return un(u),u}}}function _i(t,e){const n={...t};return n.meta||(n.meta={}),e.index!=null&&(n.meta.index=e.index),e.title!=null&&(n.meta.title=e.title),t.children&&(n.children=[],e.children&&e.children.forEach(i=>{const r=t.children?.find(o=>o.path===i.path);if(r){const o=_i(r,i);o&&n.children?.push(o)}})),n}function Bs(t,e=2){if(e===0)return t;const n=Nt();return n&&n.routes?(dn.length>0||t.forEach(i=>{const r=n.routes?.find(o=>o.name===i.name);if(r){const o=_i(i,r);o&&dn.push(o)}}),dn):void 0}function Ii(t,e){const n={...t};return e.index!=null&&(n.index=e.index),t.children&&(n.children=[],e.children&&e.children.forEach(i=>{const r=t.children?.find(o=>o.name===i.name);if(r){const o=Ii(r,i);o&&n.children?.push(o)}})),n}function Ns(t,e=2){if(e===0)return t;const n=Nt();return n&&n.widgetMenu?(hn.length>0||t.forEach(i=>{const r=n.widgetMenu?.find(o=>o.name===i.name);if(r){const o=Ii(i,r);o&&hn.push(o)}}),hn):void 0}function Os(t,e=2){if(e===0)return t;const n=Nt();return n&&n.widgets?(ln.length>0||t?.forEach(i=>{n.widgets?.find(r=>r.id===i.id)&&ln.push(i)}),ln):void 0}function Us(t,e=2){if(e===0)return t;const n=Nt();return n?n.functions:void 0}export{Vo as BigFileDownload,Kt as Download,xo as DownloadByUrl,xt as EnumColor,Jn as FileUpload,B as Global,zs as GlobalHprose,It as GlobalMitt,ot as H5Tool,Ot as HproseClient,So as HttpDownload,Wn as JsonDownload,de as LayoutContainer,V as LayoutContainerEnum,Si as LayoutManager,Ko as ObjToUrlParams,Re as Pane,Dt as ProxyClient,bo as SaveAs,Ur as Splitpanes,Gt as Storage,qt as StringUtils,ps as StyleBlack,vs as StyleGrayblue,gs as StyleMetal,ms as StyleWhite,nt as SysEvents,Ms as TOKEN_REFRESH_TIME,_s as TOKEN_VALID_TIMESPAN,kt as USER_TOKEN_API,re as VCollapsiblePanel,ie as VCollapsiblePanelGroup,he as VWindow,wi as WindowResizeEvent,ys as WindowType,wo as calculateBestTextColor,Ps as changeMyPWD,xi as checkDoRefreshToken,Ds as checkToken,Fe as clearLocalToken,Ei as clearRight,go as colorIsDark,Oo as createFileUpload,vo as darken,ii as deepMerge,on as doRefreshToken,ri as exportSystemRights,ko as get,Nt as getCurrentSystemRight,Mo as getData,Ls as getEncryptPWD,Us as getFunctions,uo as getHexColor,Ct as getLocalToken,Wo as getLockState,ho as getLongHexColor,Zn as getProxyClient,lo as getRGBColor,po as getRGBColorFromHSLA,Gn as getRefreshToken,Ci as getRight,Bs as getRoutes,Ts as getSystemRoleRight,Os as getWidgetConfig,Ns as getWidgetMenus,Rt as handleNodes,Ne as hexToRGB,Fo as init,$o as initDefaultProxyClient,Z as is,Ae as isArray,qr as isAsyncFunction,Xr as isBoolean,Vr as isClient,Wr as isDate,Fn as isDef,Yr as isElement,Qr as isEmpty,fo as isEnumColor,to as isError,Wt as isFunction,Vt as isHexColor,Zr as isImageDom,ro as isMap,Le as isNull,Fr as isNullAndUnDef,$r as isNullOrUnDef,Hr as isNumber,St as isObject,Gr as isPromise,Jr as isServer,Ht as isString,io as isSymbol,Pe as isUnDef,oo as isValidURL,no as isWeakMap,eo as isWeakSet,Kr as isWindow,Uo as jquery,yo as lighten,Rs as login,As as logout,Mi as mergeFilterRoleSysRight,ki as mergeNodes,Bt as mergeNodesAll,co as newGuid,Ho as onLockListener,zo as post,lt as requestGet,We as requestPost,Eo as requestPostBody,mo as rgbToHex,sn as setLocalToken,un as setRight,Co as sleep,ao as storage,ut as storageHelper,qo as unLockListener,Xt as uuid,Jo as writeIconifyList,Zo as writeSysRoleRight};
|
|
22
|
+
`}}});const es={class:"vcp__header-title"},ns={key:0,class:"vcp__header-icon"},is=["innerHTML"],rs={key:0,ref:"bodyRef",class:"vcp__body"},os={ref:"bodyContentRef",class:"vcp__body-content"};function Qe(t){return window.TouchEvent&&t instanceof TouchEvent}re.render=function(t,e,n,i,r,o){return H(),Y("section",{ref:"panelRef",class:_r(["vcp",{"vcp--expanded":t.isExpanded,"vcp--expandable":t.body.hasContent}])},[J("header",{class:"vcp__header",onClick:e[0]||(e[0]=(...u)=>t.toggle&&t.toggle(...u))},[J("div",es,[pt(t.$slots,"title")]),t.body.hasContent?(H(),Y("div",ns,[pt(t.$slots,"icon",{},()=>[J("span",{innerHTML:t.toggleIcon},null,8,is)])])):yt("v-if",!0)]),Tn(Bn,{"data-key":t.body.dataKey,name:"slide",onBeforeEnter:t.collapse,onEnter:t.expand,onBeforeLeave:t.expand,onLeave:t.collapse},{default:$t(()=>[t.isExpanded?(H(),Y("div",rs,[J("div",os,[pt(t.$slots,"content")],512)],512)):yt("v-if",!0)]),_:3},8,["data-key","onBeforeEnter","onEnter","onBeforeLeave","onLeave"])],2)},re.__scopeId="data-v-08c94cf8",re.__file="src/controls/collapsepanel/VCollapsiblePanel.vue";class tt{e;constructor(e){this.e=e}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return Qe(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return Qe(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new fn(this.clientX,this.clientY)}static bindDown(e,n,i,r=!1){const o=d=>{n(new tt(d))},u=d=>{d.touches.length===1&&n(new tt(d)),d.touches.length>1&&i&&i(new tt(d))};return e.addEventListener("mousedown",o,r),e.addEventListener("touchstart",u,r),()=>{e.removeEventListener("mousedown",o,r),e.removeEventListener("touchstart",u,r)}}static bindMove(e,n,i=!1){const r=u=>{n(new tt(u))},o=u=>{u.touches.length===1&&n(new tt(u))};return e.addEventListener("mousemove",r,i),e.addEventListener("touchmove",o,i),()=>{e.removeEventListener("mousemove",r,i),e.removeEventListener("touchmove",o,i)}}static bindUp(e,n,i=!1){const r=u=>{n(new tt(u))},o=u=>{u.touches.length===0&&n(new tt(u))};return e.addEventListener("mouseup",r,i),e.addEventListener("touchend",o,i),()=>{e.removeEventListener("mouseup",r,i),e.removeEventListener("touchend",o,i)}}originalEvent({mouse:e,touch:n}){Qe(this.e)?n&&n(this.e):e&&e(this.e)}}class fn{x;y;constructor(e,n){this.x=e,this.y=n}clone(){return new fn(this.x,this.y)}}class ss{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(e,n,i={}){this.handle=e,this.container=n,this.options=i,e&&(this.unbindDown=tt.bindDown(e,this.mousedown),e.classList.add("draggable-handle"))}teardown(){this.handle?.classList.remove("draggable-handle"),this.unbindDown&&this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove()}offsetX;offsetY;mousedown=e=>{if(e.preventDefault(),this.handle){const{left:n,top:i}=this.handle.getBoundingClientRect();this.offsetX=e.clientX-n,this.offsetY=e.clientY-i}this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=tt.bindMove(document,this.mousemove),this.unbindUp=tt.bindUp(document,this.mouseup)};mousemove=e=>{this.container&&(this.container.style.left=e.clientX-this.offsetX+"px",this.container.style.top=e.clientY-this.offsetY+"px"),this.options.onMove&&this.options.onMove()};mouseup=e=>{this.options.onMoveEnd&&this.options.onMoveEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0}}class as{_group;onChange;zIndex;constructor(e,n){this._group=e,this.onChange=n,this.a(i=>i.push(this))}set group(e){this._group=e;const n=se(this._group),i=se(e);n.splice(n.indexOf(this),1),i.push(this),mi()}get group(){return this._group}unregister(){this.a(e=>e.splice(e.indexOf(this),1))}raise(){this.a(e=>{e.splice(e.indexOf(this),1),e.push(this)})}a(e){e(se(this._group)),mi()}}const oe=new Map;function se(t){return oe.has(t)||oe.set(t,[]),oe.get(t)}function pi(t,e){return t>e?-pi(e,t):t<0&&e>=0?1:t-e}function mi(){let t=0;for(const e of function(n){const i=[];return n.forEach((r,o)=>i.push(o)),i}(oe).sort(pi))for(const n of se(e))t!=n.zIndex&&(n.zIndex=t,n.onChange(t)),t++}function tn(t){if(t){const{width:e,height:n}=t.style;t.style.width="auto",t.style.height="auto";const i=ae(t);return t.style.width=e,t.style.height=n,i}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function ae(t){const e=t.getBoundingClientRect(),n=e.width,i=e.height,r=e.top,o=e.left;return{width:n,height:i,top:r,left:o,bottom:r+i,right:o+n}}class cs{container;options;handles;constructor(e,n){if(this.container=e,this.options=n,e&&n){this.handles=gi.map(v=>new v(e,this));const{width:i,height:r}=tn(e),o=n.maxWidth||window.innerWidth,u=n.maxHeight||window.innerHeight;let d=!1;(i<n.minWidth||i>o)&&(e.style.width=`${vi(i,n.minWidth,o)}px`,d=!0),(r<n.minHeight||r>u)&&(e.style.height=`${vi(r,n.minHeight,u)}px`,d=!0),d&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(e=>e.teardown())}}const gi=[];class gt{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(e,n){this.container=e,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=tt.bindDown(this.handle,this.mousedown)}teardown(){this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove(),this.handle.parentElement.removeChild(this.handle)}x0;y0;left0;top0;width0;height0;mousedown=e=>{e.preventDefault(),e.stopPropagation();const{left:n,top:i,width:r,height:o}=ae(this.container);this.x0=e.clientX,this.y0=e.clientY,this.left0=n,this.top0=i,this.width0=r,this.height0=o,this.calcSafeBoundaries(),this.helper.options&&this.helper.options.onResizeStart&&this.helper.options.onResizeStart(),this.unbindMove=tt.bindMove(document,this.mousemove),this.unbindUp=tt.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:e,top:n,right:i,bottom:r}=ae(this.container),o=this.helper.options,u=o.maxWidth||window.innerWidth,d=o.maxHeight||window.innerHeight;this.minLeft=Math.max(i-u,0),this.maxLeft=i-o.minWidth,this.minRight=e+o.minWidth,this.maxRight=Math.min(e+u,window.innerWidth),this.minTop=Math.max(r-d,0),this.maxTop=r-o.minHeight,this.minBottom=n+o.minHeight,this.maxBottom=Math.min(n+d,window.innerHeight)}mousemove=e=>{e.preventDefault(),e.stopPropagation(),this.setPosition(e),this.fixPosition(),this.helper.options&&this.helper.options.onResize&&this.helper.options.onResize()};fixPosition(){const{width:e,height:n,left:i,top:r,right:o,bottom:u}=ae(this.container),d=this.helper.options;!d||(i<this.minLeft?(this.container.style.width=e+i-this.minLeft+"px",this.container.style.left=`${this.minLeft}px`):i>this.maxLeft?(this.container.style.width=`${d.minWidth}px`,this.container.style.left=`${this.maxLeft}px`):o<this.minRight?this.container.style.width=`${d.minWidth}px`:o>this.maxRight&&(this.container.style.width=this.maxRight-i+"px"),r<this.minTop?(this.container.style.height=n+r-this.minTop+"px",this.container.style.top=`${this.minTop}px`):r>this.maxTop?(this.container.style.height=`${d.minHeight}px`,this.container.style.top=`${this.maxTop}px`):u<this.minBottom?this.container.style.height=`${d.minHeight}px`:u>this.maxBottom&&(this.container.style.height=this.maxBottom-r+"px"))}mouseup=e=>{e.preventDefault(),e.stopPropagation(),this.helper.options&&this.helper.options.onResizeEnd&&this.helper.options.onResizeEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0};createHandleElement(){const e=document.createElement("div"),n=e.style;return n.position="absolute",this.applyStyle(n),this.container.appendChild(e),e}}function vi(t,e,n){return t<e?e:t>n?n:t}gi.push(class extends gt{setPosition(t){this.container.style.width=this.width0+t.clientX-this.x0+"px",this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.right=-this.handleSize+"px",t.bottom=-this.handleSize+"px",t.cursor="nwse-resize"}},class extends gt{setPosition(t){this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.right=`${this.handleSize}px`,t.left=`${this.handleSize}px`,t.height=2*this.handleSize+"px",t.bottom=-this.handleSize+"px",t.cursor="ns-resize"}},class extends gt{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px",this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.bottom=-this.handleSize+"px",t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.cursor="nesw-resize"}},class extends gt{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.bottom=`${this.handleSize}px`,t.width=2*this.handleSize+"px",t.top=`${this.handleSize}px`,t.cursor="ew-resize"}},class extends gt{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px",this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.top=-this.handleSize+"px",t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.cursor="nwse-resize"}},class extends gt{setPosition(t){this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px"}applyStyle(t){t.left=`${this.handleSize}px`,t.right=`${this.handleSize}px`,t.height=2*this.handleSize+"px",t.top=-this.handleSize+"px",t.cursor="ns-resize"}},class extends gt{setPosition(t){this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px",this.container.style.width=this.width0+t.clientX-this.x0+"px"}applyStyle(t){t.right=-this.handleSize+"px",t.top=-this.handleSize+"px",t.height=2*this.handleSize+"px",t.width=2*this.handleSize+"px",t.cursor="nesw-resize"}},class extends gt{setPosition(t){this.container.style.width=this.width0+t.clientX-this.x0+"px"}applyStyle(t){t.right=-this.handleSize+"px",t.top=`${this.handleSize}px`,t.bottom=`${this.handleSize}px`,t.width=2*this.handleSize+"px",t.cursor="ew-resize"}});var ce=Lt({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(t){const e=it(!1),n=it(!1);return{hover:e,active:n,style:function(){let i=t.windowStyle.button;return e.value&&(i={...i,...this.windowStyle.buttonHover}),n.value&&(i={...i,...this.windowStyle.buttonActive}),i},mouseup:function(i){this.active&&this.$emit("click")},mousedown:function(i){i.preventDefault(),n.value=!0;const r=tt.bindUp(document,()=>{n.value=!1,r()})}}}});const us=["disabled"];ce.render=function(t,e,n,i,r,o){return H(),Y("div",{class:"btn",style:vt(t.style()),onMouseenter:e[0]||(e[0]=u=>t.hover=!0),onMouseleave:e[1]||(e[1]=u=>t.hover=!1),onMousedown:e[2]||(e[2]=Nn((...u)=>t.mousedown&&t.mousedown(...u),["stop"])),onTouchstart:e[3]||(e[3]=Nn((...u)=>t.mousedown&&t.mousedown(...u),["stop"])),onMouseup:e[4]||(e[4]=(...u)=>t.mouseup&&t.mouseup(...u)),onTouchend:e[5]||(e[5]=(...u)=>t.mouseup&&t.mouseup(...u)),disabled:t.disabled},[pt(t.$slots,"default")],44,us)},ce.__scopeId="data-v-71662210",ce.__file="src/controls/vuewindow/window/Button.vue";const en=new Set;function yi(t){return t!==null?parseFloat(t):0}function ue(t){const e=window.getComputedStyle(t),n=Math.ceil([e.paddingLeft,e.width,e.paddingRight].map(yi).reduce((r,o)=>r+o)),i=Math.ceil([e.paddingTop,e.height,e.paddingBottom].map(yi).reduce((r,o)=>r+o));return{width:n,height:i}}class wi{width;height;constructor(e,n){this.width=e,this.height=n}}function ls(t){const e=t.windowEl;if(e){const n=parseFloat(e.style.left||"NaN"),i=parseFloat(e.style.top||"NaN");if(!isNaN(n)&&!isNaN(i))return{left:n,top:i}}return null}function hs(t,e,n,i){const r=t-n,o=e-i;return r*r+o*o}window.addEventListener("resize",t=>{en.forEach(e=>{e&&Wt(e.fixPosition)&&e.fixPosition()})});const le=[];var he=Lt({name:"Window",props:{windowStyle:{type:Object,required:!0},isOpen:{type:Boolean,required:!1,default:!0},title:{type:String,required:!0,default:""},closeButton:{type:Boolean,required:!1,default:!0},resizable:{type:Boolean,required:!1,default:!1},isScrollable:{type:Boolean,required:!1,default:!1},padding:{type:Number,required:!1,default:8},activateWhenOpen:{type:Boolean,required:!1,default:!0},positionHint:{type:String,required:!1,default:""},zGroup:{type:Number,required:!1,default:1},overflow:{type:String,required:!1,default:"visible"},minWidth:{type:Number,required:!1,default:1},minHeight:{type:Number,required:!1,default:0},maxWidth:{type:Number,required:!1,default:0},maxHeight:{type:Number,required:!1,default:0},height:{type:Number,required:!1},width:{type:Number,required:!1},top:{type:Number,required:!1},left:{type:Number,required:!1}},components:{myButton:ce},setup(t,{emit:e}){const n=Ir();if(!n)return;const{proxy:i}=n;let r=0,o,u,d;const v=it(t.isOpen),b=()=>{le.push(i),d=new as(t.zGroup,C),t.isOpen&&function(I){I&&(_e(()=>{r++==0&&(f(i),function(){const P=E.value,{width:O,height:j}=tn(P);let U,W;if(t.left!==void 0!=(t.top!==void 0))throw new Error("Either of left or top is specified. Both must be set or not set.");if(typeof t.left=="number")U=t.left,W=t.top;else{const et=t.positionHint||"auto";switch(et){case"auto":{let X=20,K=50,q=0;do{if(le.every(st=>{if(!st.isOpen||i==st)return!0;const Ut=ls(st);if(Ut==null)return!0;const{left:ve,top:rt}=Ut;return hs(ve,rt,X,K)>16}))break;X=(X+40)%(window.innerWidth-200),K=(K+40)%(window.innerHeight-200)}while(++q<100);U=X,W=K}break;case"center":U=(window.innerWidth-O)/2,W=(window.innerHeight-j)/2,console.log(U,W,window.innerWidth,window.innerHeight,"111111");break;default:try{const X=et.split("/").map(Number);if(X.length!=2)throw null;const[K,q]=X;if(!isFinite(K)||!isFinite(q))throw null;U=K>=0?K:window.innerWidth-O+K,W=q>=0?q:window.innerHeight-j+q}catch{throw new Error(`invalid position string: ${et}`)}}}P&&(P.style.left=`${U}px`,P.style.top=`${W}px`)}()),t.resizable&&h(),A(),o=new ss(L.value,E.value,{onMove:()=>A(),onMoveStart:()=>e("move-start"),onMoveEnd:()=>e("move-end")}),t.resizable&&function(){const{height:P}=tn(L.value);u=new cs(E.value,{onResize:()=>h(),onResizeStart:()=>e("resize-start"),onResizeEnd:()=>e("resize-end"),minWidth:t.minWidth,minHeight:t.minHeight+P,maxWidth:t.maxWidth,maxHeight:t.maxHeight?t.maxHeight+P:void 0})}()}),t.activateWhenOpen&&R())}(!0),en.add(i)};function C(I){S.value.zIndex=`${I}`}const E=it(null),L=it(null),T=it(null);function R(){d.raise(),e("activate")}const S=it({...t.windowStyle.window,zIndex:"auto",overflow:t.overflow}),l=mt(()=>t.windowStyle.titlebar),p=mt(()=>{const I={...t.windowStyle.content};return t.resizable?I.padding="0":t.padding!=null&&(I.padding=`${t.padding}px`),t.isScrollable&&(I.overflow="auto"),I});function f(I){const{width:P,height:O,top:j,left:U}=I,W=E;if(W&&P!=null&&(W.value.style.width=`${P}px`),O!=null){const et=L.value;if(et){const X=ue(et).height;W.value.style.height=`${O+X}px`}}W&&U!=null&&(W.value.style.left=`${U}px`),W&&j!=null&&(W.value.style.top=`${j}px`)}function h(I=!0){const P=E.value,O=L.value,j=T.value;if(j&&P&&O){const{width:U,height:W}=ue(j),{width:et,height:X}=ue(P),K=ue(O).height,q=et-(j.offsetWidth-U),st=X-K-(j.offsetHeight-W);j.style.width=`${q}px`,j.style.height=`${st}px`,g(),e("resize",new wi(q,st)),I&&(e("update:width",q),e("update:height",st))}}function g(){const I=E.value;if(I){const P=I.getBoundingClientRect();P.left<0&&(S.value.left="0px"),P.top<0&&(S.value.top="0px"),P.right>window.innerWidth&&(S.value.left=window.innerWidth-P.width+"px"),P.bottom>window.innerHeight&&(S.value.top=window.innerHeight-P.height+"px")}}function A(I=!0){g();const P=E.value;if(P){const{left:O,top:j}=P.getBoundingClientRect();I&&(e("update:left",O),e("update:top",j))}}return At(()=>t.isOpen,I=>{v.value=I}),At(()=>t.zGroup,I=>{d.group=I}),At(()=>t.width,I=>{f({width:I}),h(!1)}),At(()=>t.height,I=>{f({height:I}),h(!1)}),Me(()=>{b()}),Rr(()=>{en.delete(this),d.unregister(),u&&u.teardown(),o&&o.teardown(),le.splice(le.indexOf(i),1)}),{isOpen:v,windowEl:E,titlebar:L,content:T,activate:R,styleWindow:S,styleTitlebar:l,styleContent:p,closeButtonClick:function(){v.value=!1,e("closebuttonclick")},fixPosition:g}}});const ds={class:"title"},fs=On("\xD7");var bi;he.render=function(t,e,n,i,r,o){const u=Un("myButton");return H(),ct(Bn,{name:"fade",onAfterLeave:e[2]||(e[2]=d=>t.$emit("close")),onAfterEnter:e[3]||(e[3]=d=>t.$emit("open")),persisted:""},{default:$t(()=>[Pr(J("div",{class:"window",style:vt(t.styleWindow),ref:"windowEl",onMousedown:e[0]||(e[0]=(...d)=>t.activate&&t.activate(...d)),onTouchstart:e[1]||(e[1]=(...d)=>t.activate&&t.activate(...d))},[J("div",{class:"titlebar",style:vt(t.styleTitlebar),ref:"titlebar"},[J("div",ds,[t.$slots.title?pt(t.$slots,"title",{key:0}):(H(),Y(wt,{key:1},[On(Lr(t.title),1)],64))]),t.closeButton?(H(),ct(u,{key:0,windowStyle:t.windowStyle,onClick:t.closeButtonClick},{default:$t(()=>[fs]),_:1},8,["windowStyle","onClick"])):yt("v-if",!0)],4),J("div",{class:"content",style:vt(t.styleContent),ref:"content"},[pt(t.$slots,"default")],4)],36),[[Ar,t.isOpen]])]),_:3})},he.__file="src/controls/vuewindow/window/index.vue",function(t){t[t.StyleBlack=0]="StyleBlack",t[t.StyleWhite=1]="StyleWhite",t[t.StyleMetal=2]="StyleMetal",t[t.StyleGrayblue=3]="StyleGrayblue"}(bi||(bi={}));const ps={window:{color:"#fff",boxShadow:"0 0 6pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(31, 31, 31, 0.9)"},titlebar:{backgroundColor:"rgba(63, 63, 63, 0.9)"},content:{},button:{color:"white"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},ms={window:{color:"#000",boxShadow:"0 2pt 4pt rgba(0, 0, 0, 0.5)",backgroundColor:"rgba(239, 239, 239, 0.95)"},titlebar:{backgroundColor:"rgba(191, 191, 191, 0.9)"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},gs={window:{color:"#000",boxShadow:"0 4pt 8pt rgba(0, 0, 0, 0.5)",background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},titlebar:{background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},vs={window:{color:"#fff",fontSize:"14px",boxShadow:"0 0 3pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(4,51,81,0.6)",borderRadius:"5px"},titlebar:{backgroundColor:"rgba(4,51,81,0.8)",border:"1px solid rgba(153, 153, 153, 0.5)",borderRadius:"5px",fontSize:"16px",fontWeight:400,color:"#fff"},content:{},button:{color:"white",fontSize:"18px"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},ys=he;var V;(function(t){t[t.top=0]="top",t[t.bottom=1]="bottom",t[t.centerBack=2]="centerBack",t[t.centerMain=3]="centerMain",t[t.centerFront=4]="centerFront",t[t.left=5]="left",t[t.right=6]="right"})(V||(V={}));class Si{layoutState;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;widgetConfig=new Array;_LayoutID;constructor(e,n,i){this.layoutState=e,this._LayoutID=i,n.forEach(r=>{if(r.layoutID===i&&(this.widgetConfig.push(r),r.afterid))if(this.preConditionMap.has(r.afterid))this.preConditionMap.get(r.afterid)?.add(r);else{const o=new Set;o.add(r),this.preConditionMap.set(r.afterid,o)}})}getLayoutID(){return this._LayoutID}getWidgetConfig(){return this.widgetConfig}preloadWidgets(){this.widgetConfig.filter(e=>e.preload&&!e.afterid).forEach(e=>{this._loadWidget(e)})}async loadWidget(e){if(!e)return;let n;return St(e)?n=e:Ht(e)&&(n=this.widgetConfig.find(i=>i.id===e)),n?n.afterid?(this.isWidgetLoaded(n.afterid)||await this.loadWidget(n.afterid),this._loadWidget(n)):this._loadWidget(n):void 0}loadOtherDependenceWidgets(e){this.preConditionMap.has(e)&&this.preConditionMap.get(e)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(e){if(!this.widgetsLoadedSet.has(e.id))return e.component().then(n=>{if(n.default){const i=Dr(n.default);this.getContainerComponents(e.container).value.set(e.id,i),this.widgetsLoadedSet.add(e.id),_e().then(()=>{B.EventBus.emit(nt.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:e.id}),this.loadOtherDependenceWidgets(e.id)})}})}hasDependentWidgets(e){let n=!1;if(this.preConditionMap.has(e)){const i=this.preConditionMap.get(e);if(i){for(const r of i)if(this.isWidgetLoaded(r.id)){n=!0;break}}}return n}unloadWidget(e){if(!e||!this.isWidgetLoaded(e))return;const n=this.widgetConfig.find(i=>i.id===e);if(n){if(this.preConditionMap.has(e)){const o=this.preConditionMap.get(e);if(o)for(const u of o)this.unloadWidget(u.id)}const i=this.getContainerComponents(n.container),r=i.value.get(e);r&&r.unmounted&&r.unmounted(),i.value.delete(e),this.widgetsLoadedSet.delete(e),B.EventBus.emit(nt.WidgetUnLoadedEvent,{layoutID:this._LayoutID,widgetID:e})}}isWidgetLoaded(e){return this.widgetsLoadedSet.has(e)}splitTwoContainer(e=!1){const n=this.layoutState.centerMainContainer,i=this.layoutState.centerBackContainer;e?(n&&(n.style.left="0",n.style.width="100%"),i&&(i.style.width="100%")):(n&&(n.style.left="50%",n.style.width="50%"),i&&(i.style.width="50%"))}getLayoutContainer(e){switch(e){case V.top:return this.layoutState.topContainer;case V.bottom:return this.layoutState.bottomContainer;case V.left:return this.layoutState.leftContainer;case V.right:return this.layoutState.rightContainer;case V.centerBack:return this.layoutState.centerBackContainer;case V.centerMain:return this.layoutState.centerMainContainer;case V.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(e,n=!1){const i=this.getLayoutContainer(e);i&&(i.style.visibility=n?"visible":"hidden")}changeWidgetVisible(e,n=!1){const i=this.getWidgetComponent(e);i&&B.EventBus.emit(nt.WidgetVisibleChanged,{id:e,layoutID:this._LayoutID,name:i.name,visible:n})}getWidgetComponent(e){if(this.widgetsLoadedSet.has(e)){const n=this.widgetConfig.find(i=>i.id===e);if(n)return this.getContainerComponents(n.container).value.get(e)}}getWigetItem(e){return this.widgetConfig.find(n=>n.id===e)}getGroupWigetItems(e){return this.widgetConfig.filter(n=>n.group===e)}getContainerComponents(e){if(this.layoutMap.has(e))return this.layoutMap.get(e);{const n=it(new Map);return this.layoutMap.set(e,n),n}}addContainerComponent(e,n){}}var de=Lt({name:"MainContainer",props:{widgetConfig:{type:Array,required:!0,default:()=>[]},layoutID:{type:String,default:void 0},layoutStyle:{type:Object},enableRouterView:{type:Boolean,default:!0}},emits:["containerLoaded"],setup(t,{attrs:e,slots:n,emit:i}){const r=t.layoutID,o=it(t.enableRouterView);At(()=>t.enableRouterView,()=>{o.value=t.enableRouterView});const u=Dn({topContainer:void 0,centerBackContainer:void 0,centerMainContainer:void 0,centerFrontContainer:void 0,bottomContainer:void 0,leftContainer:void 0,rightContainer:void 0}),d=new Si(u,t.widgetConfig,r),v=R(V.top),b=R(V.centerBack),C=R(V.centerFront),E=R(V.left),L=R(V.right),T=R(V.bottom);function R(l){return d?.getContainerComponents(l)}const S=mt(()=>t.layoutStyle);return Me(()=>{d&&(d.preloadWidgets(),r===void 0&&(B.LayoutManager=d),i("containerLoaded",{layoutID:r,layoutManager:d}))}),{...Tr(u),topContainerComponents:v,centerbackComponents:b,centerfrontComponents:C,leftContainerComponents:E,rightContainerComponents:L,bottomContainerComponents:T,containerStyle:S,isEnableRouterView:o}}});const ws={ref:"topContainer",class:"topContainer"},bs={key:0,ref:"centerMainContainer",class:"centerdiv mainContainer"},Ss={ref:"centerBackContainer",class:"centerdiv backContainer"},xs={ref:"centerFrontContainer",class:"centerdiv centerContainer"},Cs={ref:"leftContainer",class:"leftContainer"},Es={ref:"rightContainer",class:"rightContainer"},ks={ref:"bottomContainer",class:"bottomContainer"};de.render=function(t,e,n,i,r,o){const u=Un("router-view");return H(),Y("div",{class:"layoutContainer",style:vt(t.containerStyle)},[J("div",ws,[(H(!0),Y(wt,null,Mt(t.topContainerComponents,([d,v])=>(H(),ct(bt(v),{key:d}))),128))],512),J("div",null,[yt(" \u4E3B\u8981\u5BB9\u5668-\u5E95\u90E8 "),t.isEnableRouterView?(H(),Y("div",bs,[Tn(u,null,{default:$t(({Component:d})=>[(H(),ct(bt(d)))]),_:1})],512)):yt("v-if",!0),yt(" \u4E0A\u4E00\u5C42-\u4E3B\u5BB9\u5668 "),J("div",Ss,[(H(!0),Y(wt,null,Mt(t.centerbackComponents,([d,v])=>(H(),ct(bt(v),{key:d}))),128))],512),yt(" \u6700\u4E0A\u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),J("div",xs,[(H(!0),Y(wt,null,Mt(t.centerfrontComponents,([d,v])=>(H(),ct(bt(v),{key:d}))),128))],512),J("div",Cs,[(H(!0),Y(wt,null,Mt(t.leftContainerComponents,([d,v])=>(H(),ct(bt(v),{key:d}))),128))],512),J("div",Es,[(H(!0),Y(wt,null,Mt(t.rightContainerComponents,([d,v])=>(H(),ct(bt(v),{key:d}))),128))],512)]),J("div",ks,[(H(!0),Y(wt,null,Mt(t.bottomContainerComponents,([d,v])=>(H(),ct(bt(v),{key:d}))),128))],512)],4)},de.__scopeId="data-v-4d081e5c",de.__file="src/controls/layoutcontainer/layout.vue";const fe=new Map,nn=new Map;let pe;const zs={getDefaultClient(){if(pe||(pe=new Dt(SysConfig.DefaultHproseAPI)),!pe)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return pe},registerHprose(t,e){const n=nn.get(t);if(!n){const i=new Dt(e);fe.set(t,i)}return n},getHprose:t=>nn?.get(t),getProxyHprose:t=>fe.get(t),unregisterHprose(t){fe.get(t)&&(nn.delete(t),fe.delete(t))}},Ms=5e3,_s=36e5,kt={Login:"/api/User/Login",ChangeMyPwd:"/api/User/ChangeMyPwd",Logout:"/api/Check/ExitLogin",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken",GetSystemRights:"/api/System/GetSystem"},rn="access_token",Is=B.Config.ServiceURL.LoginAuthURL;function on(){const t=Gn();t&<(kt.RefreshToken,Is,{refreshToken:t}).then(e=>{sn(e.data)})}function xi(){const t=ut.getJsonObject(rn);if(!t)return;const e=new Date().getTime(),n=new Date(t.expire).getTime()-e;n>0&&(n<=5e3?on():setTimeout(on,n-5e3))}function sn(t){const e=new Date().getTime();let n=new Date(t.accessToken.expires).getTime()-e;if(n>=36e5?(n=18e5,B.Message?.err("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u8FC7\u53BB\u65F6\u95F4\uFF01")):n<-6e5&&(n=18e5,B.Message?.err("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u672A\u6765\u65F6\u95F4\uFF01")),n>0){let i=Ct();i?(i.token=t.accessToken.tokenContent,i.expire=t.accessToken.expires,i.refresh=t.refreshToken.tokenContent):i={token:t.accessToken.tokenContent,expire:t.accessToken.expires,refresh:t.refreshToken.tokenContent},ut.set(rn,i,n/1e3),xi()}else ut.remove(rn)}const me="Wm314243",ge=B.Config.ServiceURL.LoginAuthURL;async function Rs(t){const e={username:t.username,pwd:ee.encryptToString(t.pwd,me)},n=(await lt(kt.Login,ge,e))?.data;return n&&sn(n.doubletoken),n}function Ps(t){const e={oldpwd:ee.encryptToString(t.oldpwd,me),newpwd:ee.encryptToString(t.newpwd,me)};return lt(kt.ChangeMyPwd,ge,e)}function Ls(t){return ee.encryptToString(t,me)}function As(){const t=Ct();t&&(We(kt.Logout,ge,{token:t.token,reftoken:t.refresh}),Fe())}function Ds(t){return lt(kt.CheckToken,ge,{token:t})}const an="ROLE_SYSTEM_RIGHT",cn=new Gt("",sessionStorage);function Ci(){return cn.get(an)}function un(t){cn.set(an,t)}function Ei(){cn.remove(an)}function Rt(t){if(t)for(let e=0;e<t.length;e++){const n=t[e];n.children&&n.children.length>0?(Rt(n.children),n.children.length===0&&(t.splice(e,1),e--)):n.selected||(t.splice(e,1),e--)}}function ki(t,e,n="name"){t&&e&&t.forEach(i=>{const r=e.find(o=>o[n]===i[n]);r&&(i.children?r.children&&ki(i.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(i.selected=r.selected))})}function zi(t,e,n="name"){t&&e&&t.forEach(i=>{const r=e.find(o=>o[n]===i[n]);r&&(i.children?r.children&&zi(i.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(i.selected=r.selected))})}function Bt(t,e,n,i="name"){const r=t[n],o=e[n];r?o&&zi(r,o,i):o&&(t[n]=o)}function Mi(t){if(t&&t.length>0){const e=t.length;let n,i=!1;if(e>0){i=St(t[0]);const r=i?t[0]:JSON.parse(t[0]);if(e>1)for(let o=1;o<t.length;o++){const u=t[o],d=i?u:JSON.parse(u);Bt(r,d,"routes","name"),Bt(r,d,"widgetMenu","name"),Bt(r,d,"widgets","id"),Bt(r,d,"functions","id")}n=r}return n&&(Rt(n.routes),Rt(n.widgetMenu),Rt(n.widgets),Rt(n.functions)),n}}const ln=[],hn=[],dn=[];function Nt(){return Ci()}async function Ts(t,e=!1){Ei();const n=kt.GetSystemRights,i=B.Config.ServiceURL.LoginAuthURL,r=await lt(n,i,{systemid:t});if(!r||!r.data)return void B.Message?.warn("\u65E0\u6CD5\u83B7\u53D6\u529F\u80FD\u6388\u6743\u5217\u8868\uFF01");const o=r.data;if(o&&o.length>0){if(e){const u=JSON.parse(o[0]);return un(u),u}{const u=Mi(o);return un(u),u}}}function _i(t,e){const n={...t};return n.meta||(n.meta={}),e.index!=null&&(n.meta.index=e.index),e.title!=null&&(n.meta.title=e.title),t.children&&(n.children=[],e.children&&e.children.forEach(i=>{const r=t.children?.find(o=>o.path===i.path);if(r){const o=_i(r,i);o&&n.children?.push(o)}})),n}function Bs(t,e=2){if(e===0)return t;const n=Nt();return n&&n.routes?(dn.length>0||t.forEach(i=>{const r=n.routes?.find(o=>o.name===i.name);if(r){const o=_i(i,r);o&&dn.push(o)}}),dn):void 0}function Ii(t,e){const n={...t};return e.index!=null&&(n.index=e.index),t.children&&(n.children=[],e.children&&e.children.forEach(i=>{const r=t.children?.find(o=>o.name===i.name);if(r){const o=Ii(r,i);o&&n.children?.push(o)}})),n}function Ns(t,e=2){if(e===0)return t;const n=Nt();return n&&n.widgetMenu?(hn.length>0||t.forEach(i=>{const r=n.widgetMenu?.find(o=>o.name===i.name);if(r){const o=Ii(i,r);o&&hn.push(o)}}),hn):void 0}function Os(t,e=2){if(e===0)return t;const n=Nt();return n&&n.widgets?(ln.length>0||t?.forEach(i=>{n.widgets?.find(r=>r.id===i.id)&&ln.push(i)}),ln):void 0}function Us(t,e=2){if(e===0)return t;const n=Nt();return n?n.functions:void 0}export{Vo as BigFileDownload,Kt as Download,xo as DownloadByUrl,xt as EnumColor,Jn as FileUpload,B as Global,zs as GlobalHprose,It as GlobalMitt,ot as H5Tool,Ot as HproseClient,So as HttpDownload,Wn as JsonDownload,de as LayoutContainer,V as LayoutContainerEnum,Si as LayoutManager,Ko as ObjToUrlParams,Re as Pane,Dt as ProxyClient,bo as SaveAs,Ur as Splitpanes,Gt as Storage,qt as StringUtils,ps as StyleBlack,vs as StyleGrayblue,gs as StyleMetal,ms as StyleWhite,nt as SysEvents,Ms as TOKEN_REFRESH_TIME,_s as TOKEN_VALID_TIMESPAN,kt as USER_TOKEN_API,re as VCollapsiblePanel,ie as VCollapsiblePanelGroup,he as VWindow,wi as WindowResizeEvent,ys as WindowType,wo as calculateBestTextColor,Ps as changeMyPWD,xi as checkDoRefreshToken,Ds as checkToken,Fe as clearLocalToken,Ei as clearRight,go as colorIsDark,Oo as createFileUpload,vo as darken,ii as deepMerge,on as doRefreshToken,ri as exportSystemRights,ko as get,Nt as getCurrentSystemRight,Mo as getData,Ls as getEncryptPWD,Us as getFunctions,uo as getHexColor,Ct as getLocalToken,Wo as getLockState,ho as getLongHexColor,Zn as getProxyClient,lo as getRGBColor,po as getRGBColorFromHSLA,Gn as getRefreshToken,Ci as getRight,Bs as getRoutes,Ts as getSystemRoleRight,Os as getWidgetConfig,Ns as getWidgetMenus,Rt as handleNodes,Ne as hexToRGB,Fo as init,$o as initDefaultProxyClient,Z as is,Ae as isArray,qr as isAsyncFunction,Xr as isBoolean,Vr as isClient,Wr as isDate,Fn as isDef,Yr as isElement,Qr as isEmpty,fo as isEnumColor,to as isError,Wt as isFunction,Vt as isHexColor,Zr as isImageDom,ro as isMap,Le as isNull,Fr as isNullAndUnDef,$r as isNullOrUnDef,Hr as isNumber,St as isObject,Gr as isPromise,Jr as isServer,Ht as isString,io as isSymbol,Pe as isUnDef,oo as isValidURL,no as isWeakMap,eo as isWeakSet,Kr as isWindow,Uo as jquery,yo as lighten,Rs as login,As as logout,Mi as mergeFilterRoleSysRight,ki as mergeNodes,Bt as mergeNodesAll,co as newGuid,Ho as onLockListener,zo as post,lt as requestGet,We as requestPost,Eo as requestPostBody,mo as rgbToHex,sn as setLocalToken,un as setRight,Co as sleep,ao as storage,ut as storageHelper,qo as unLockListener,Xt as uuid,Jo as writeIconifyList,Zo as writeSysRoleRight};
|