@ibiz-template/vue3-util 0.2.18-dev.2 → 0.2.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- .ibiz-control-shell{position:relative;width:100%;height:100%}.ibiz-view-shell{position:relative;width:100%;height:100%}.ibiz-code-list__item{color:var(--ibiz-code-list-item-color)}.ibiz-view{--ibiz-view-bg-color:var(--ibiz-color-bg-1);--ibiz-view-border-radius:var(--ibiz-border-radius-medium);width:100%;height:100%}.ibiz-view .ibiz-view{background-color:var(--ibiz-view-bg-color);border-radius:var(--ibiz-view-border-radius)}.ibiz-view .ibiz-view-appportalview{background-color:rgba(0,0,0,0)}.ibiz-view.has-top-message,.ibiz-view.has-bottom-message{display:flex;flex-flow:column nowrap}.ibiz-view.has-top-message>.ibiz-view-message,.ibiz-view.has-bottom-message>.ibiz-view-message{flex-grow:0;flex-shrink:0}.ibiz-view.has-top-message>.ibiz-control-viewlayoutpanel,.ibiz-view.has-bottom-message>.ibiz-control-viewlayoutpanel{flex-grow:1;flex-shrink:1}.ibiz-panel-container{width:100%;height:100%}.ibiz-panel-container>.ibiz-row{height:100%;overflow-x:hidden;overflow-y:auto}.ibiz-panel-container.is-hidden{display:none}.ibiz-panel-ctrl-pos{width:100%;height:100%}.ibiz-panel-ctrl-pos.is-hidden{display:none}.ibiz-scroll-container-item{width:100%;height:100%;overflow:auto}.ibiz-scroll-container-item.is-hidden{display:none}.ibiz-scroll-container{width:100%;height:100%;display:flex;flex-flow:column nowrap}.ibiz-scroll-container.is-hidden{display:none}.ibiz-scroll-container-content{flex-grow:1;overflow:auto;display:flex}.ibiz-scroll-container-content__center{flex-grow:1;overflow:auto}.ibiz-scroll-container-content__left{overflow:auto}.ibiz-scroll-container-content__right{overflow:auto}.ibiz-scroll-container-header{overflow:auto}.ibiz-scroll-container-footer{overflow:auto}.ibiz-nav-pos{width:100%;height:100%}.ibiz-panel-field{--ibiz-form-item-label-color:var(--ibiz-color-text-1);--ibiz-form-item-text-color:var(--ibiz-color-text-2);--ibiz-form-item-hover-color:var(--ibiz-color-text-0);--ibiz-form-item-hover-bg-color:var(--ibiz-color-fill-1);--ibiz-form-item-readonly-color:var(--ibiz-color-disabled-text);--ibiz-form-item-border-color:transparent;--ibiz-form-item-font-size:var(--ibiz-font-size-regular);--ibiz-form-item-placeholder-color:var(--ibiz-color-text-3);--ibiz-form-item-disabled-color:var(--ibiz-color-disabled-text);--ibiz-form-item-disabled-bg-color:var(--ibiz-color-disabled-fill);--ibiz-form-item-disabled-border-color:var(--ibiz-color-disabled-border);--ibiz-form-item-active-bg:var(--ibiz-color-fill-2);--ibiz-form-item-active-border:var(--ibiz-active-bg);--ibiz-form-item-focus-bg:var(--ibiz-color-fill-0);--ibiz-form-item-focus-border:var(--ibiz-color-focus-border);--ibiz-form-item-line-height:var(--ibiz-editor-default-line-height);--ibiz-form-item-font-weight:var(--ibiz-font-weight-regular);width:100%;height:100%}.ibiz-panel-field .ibiz-panel-field-content{line-height:inherit}.ibiz-panel-rawitem{width:100%;height:100%}.ibiz-panel-rawitem .ibiz-panel-rawitem-content{width:100%}.ibiz-multi-data-container{width:100%;height:100%}.ibiz-single-data-container{width:100%;height:100%}.ibiz-grid-container{--ibiz-grid-container-bg-color:var(--ibiz-bg-color-overlay);--ibiz-grid-container-padding:var(--ibiz-padding);width:100%;height:100%;overflow:auto}.ibiz-grid-container.is-hidden{display:none}
1
+ .ibiz-control-shell{position:relative;width:100%;height:100%}.ibiz-view-shell{position:relative;width:100%;height:100%}.ibiz-code-list__item{color:var(--ibiz-code-list-item-color)}.ibiz-panel-ctrl-pos{width:100%;height:100%}.ibiz-panel-ctrl-pos.is-hidden{display:none}.ibiz-panel-container{width:100%;height:100%}.ibiz-panel-container>.ibiz-row{height:100%;overflow-x:hidden;overflow-y:auto}.ibiz-panel-container.is-hidden{display:none}.ibiz-nav-pos{width:100%;height:100%}.ibiz-scroll-container-item{width:100%;height:100%;overflow:auto}.ibiz-scroll-container-item.is-hidden{display:none}.ibiz-scroll-container{width:100%;height:100%;display:flex;flex-flow:column nowrap}.ibiz-scroll-container.is-hidden{display:none}.ibiz-scroll-container-content{flex-grow:1;overflow:auto;display:flex}.ibiz-scroll-container-content__center{flex-grow:1;overflow:auto}.ibiz-scroll-container-content__left{overflow:auto}.ibiz-scroll-container-content__right{overflow:auto}.ibiz-scroll-container-header{overflow:auto}.ibiz-scroll-container-footer{overflow:auto}.ibiz-panel-field{--ibiz-form-item-label-color:var(--ibiz-color-text-1);--ibiz-form-item-text-color:var(--ibiz-color-text-2);--ibiz-form-item-hover-color:var(--ibiz-color-text-0);--ibiz-form-item-hover-bg-color:var(--ibiz-color-fill-1);--ibiz-form-item-readonly-color:var(--ibiz-color-disabled-text);--ibiz-form-item-border-color:transparent;--ibiz-form-item-font-size:var(--ibiz-font-size-regular);--ibiz-form-item-placeholder-color:var(--ibiz-color-text-3);--ibiz-form-item-disabled-color:var(--ibiz-color-disabled-text);--ibiz-form-item-disabled-bg-color:var(--ibiz-color-disabled-fill);--ibiz-form-item-disabled-border-color:var(--ibiz-color-disabled-border);--ibiz-form-item-active-bg:var(--ibiz-color-fill-2);--ibiz-form-item-active-border:var(--ibiz-active-bg);--ibiz-form-item-focus-bg:var(--ibiz-color-fill-0);--ibiz-form-item-focus-border:var(--ibiz-color-focus-border);--ibiz-form-item-line-height:var(--ibiz-editor-default-line-height);--ibiz-form-item-font-weight:var(--ibiz-font-weight-regular);width:100%;height:100%}.ibiz-panel-field .ibiz-panel-field-content{line-height:inherit}.ibiz-panel-rawitem{width:100%;height:100%}.ibiz-panel-rawitem .ibiz-panel-rawitem-content{width:100%}.ibiz-multi-data-container{width:100%;height:100%}.ibiz-single-data-container{width:100%;height:100%}.ibiz-grid-container{--ibiz-grid-container-bg-color:var(--ibiz-bg-color-overlay);--ibiz-grid-container-padding:var(--ibiz-padding);width:100%;height:100%;overflow:auto}.ibiz-grid-container.is-hidden{display:none}.ibiz-view{--ibiz-view-bg-color:var(--ibiz-color-bg-1);--ibiz-view-border-radius:var(--ibiz-border-radius-medium);width:100%;height:100%}.ibiz-view .ibiz-view{background-color:var(--ibiz-view-bg-color);border-radius:var(--ibiz-view-border-radius)}.ibiz-view .ibiz-view-appportalview{background-color:rgba(0,0,0,0)}.ibiz-view.has-top-message,.ibiz-view.has-bottom-message{display:flex;flex-flow:column nowrap}.ibiz-view.has-top-message>.ibiz-view-message,.ibiz-view.has-bottom-message>.ibiz-view-message{flex-grow:0;flex-shrink:0}.ibiz-view.has-top-message>.ibiz-control-viewlayoutpanel,.ibiz-view.has-bottom-message>.ibiz-control-viewlayoutpanel{flex-grow:1;flex-shrink:1}
@@ -1,2 +1,2 @@
1
- System.register(["vue","@ibiz-template/core","ramda","qx-util","vue-router","qs","@ibiz-template/runtime","pinia"],function(h,ur){"use strict";var b,W,Gt,q,Ut,Wt,x,z,w,A,m,qt,v,S,d,Z,Y,k,at,lt,K,Kt,Ht,Xt,R,Jt,Qt,F,Zt,ut,I,Yt,L,te,ee,re,V,ne,se,oe,tt,ct,$,E,ie,ae,le,ue,T,B,y,ce,dt,de,he,et,rt,ht,pt,ft,mt,pe,gt,fe,H,me,Ct,ge;return{setters:[function(u){b=u.watch,W=u.onBeforeUnmount,Gt=u.createCommentVNode,q=u.getCurrentInstance,Ut=u.isReactive,Wt=u.toRaw,x=u.inject,z=u.reactive,w=u.ref,A=u.h,m=u.resolveComponent,qt=u.provide,v=u.defineComponent,S=u.computed,d=u.createVNode,Z=u.withDirectives,Y=u.resolveDirective,k=u.isVNode,at=u.onUnmounted,lt=u.onMounted,K=u.createTextVNode,Kt=u.onActivated,Ht=u.onDeactivated},function(u){Xt=u.onClickOutside,R=u.NOOP,Jt=u.listenJSEvent,Qt=u.Namespace,F=u.RuntimeError,Zt=u.isSvg,ut=u.ModelError,I=u.RuntimeModelError,Yt=u.IBizContext},function(u){L=u.isNil,te=u.isNotNil,ee=u.mergeLeft},function(u){re=u.isFunc,V=u.notNilEmpty,ne=u.QXEvent,se=u.clearAll,oe=u.createUUID},function(u){tt=u.useRoute,ct=u.useRouter},function(u){$=u.default},function(u){E=u.ViewType,ie=u.getMatchResPath,ae=u.calcDeCodeNameById,le=u.getControlProvider,ue=u.getViewProvider,T=u.PanelItemState,B=u.PanelItemController,y=u.registerPanelItemProvider,ce=u.Modal,dt=u.ViewMode,de=u.OpenAppViewCommand,he=u.getEditorProvider,et=u.getAllPanelField,rt=u.isDataContainer,ht=u.getPanelItemProvider,pt=u.PanelData,ft=u.PanelNotifyState,mt=u.execDELogicById,pe=u.toLocalOpenWFRedirectView,gt=u.ViewController,fe=u.getControlsByView,H=u.registerViewProvider,me=u.RemotePluginItem},function(u){Ct=u.defineStore,ge=u.createPinia}],execute:function(){h({calcResRoutePath:we,createOverlayView:J,generateRoutePath:yr,getArrayProps:ir,getAutoCompleteProps:rr,getCascaderProps:ar,getCheckboxListProps:Me,getCheckboxProps:Ge,getCodeProps:nr,getColorPickerProps:lr,getDataPickerProps:Ue,getDatePickerProps:We,getDateRangeProps:qe,getDrawerPlacement:Or,getDropdownProps:$e,getEditorEmits:nn,getEditorProps:g,getGridArrayProps:Rn,getGridAutoCompleteProps:In,getGridCascaderProps:Bn,getGridCheckboxListProps:dn,getGridCheckboxProps:hn,getGridCodeProps:An,getGridColorPickerProps:On,getGridDataPickerProps:pn,getGridDatePickerProps:fn,getGridDateRangeProps:mn,getGridDropdownProps:cn,getGridEditorCommonProps:C,getGridEditorEmits:sn,getGridHtmlProps:Sn,getGridInputIpProps:ln,getGridInputNumberProps:an,getGridInputProps:on,getGridListBoxProps:gn,getGridMarkDownProps:Nn,getGridNumberRangeProps:Cn,getGridRadioProps:vn,getGridRateProps:Pn,getGridRawProps:yn,getGridSliderProps:wn,getGridSpanProps:un,getGridStepperProps:Dn,getGridSwitchProps:bn,getGridUploadProps:En,getHtmlProps:sr,getInputIpProps:Ve,getInputNumberProps:Le,getInputProps:ke,getListBoxProps:Ke,getMarkDownProps:or,getNestedRoutePath:M,getNumberRangeProps:He,getOrigin:st,getOwnRouteContext:ye,getRadioProps:Xe,getRateProps:Je,getRawProps:Qe,getSliderProps:Ze,getSpanProps:je,getStepperProps:Ye,getSwitchProps:tr,getUploadProps:er,isEmptyVNode:pr,onRouteChange:Dr,openViewDrawer:Nr,openViewFloatWindow:Sr,openViewModal:Ar,openViewPopover:Rr,parseRouteViewData:wr,prepareControl:br,renderString:Er,route2routePath:ot,routePath2string:vt,useClickOutside:u,useControlController:Cr,useController:hr,useCtx:ve,useEventListener:Pe,useFocusAndBlur:vr,useForce:X,useForceTogether:dr,useMobCtx:fr,useNamespace:P,useProps:nt,usePropsWatch:cr,useRouteKey:Tr,useRouterQuery:xr,useViewController:Pt});function u(n,t,e={}){let s=R,r=R,o=R;const i=()=>{s(),s=R,r=R,o=R};return b(n,(a,l)=>{if(a!==l)if(L(a))i();else{const c=Xt(a?.$el||a,t,e);s=c.stop,r=c.pause,o=c.proceed}},{immediate:!0}),W(()=>{s!==R&&i()}),{stop:()=>s(),pause:()=>r(),proceed:()=>o()}}function nt(){return q().proxy.$props}function st(n){return Ut(n)?Wt(n):n}function cr(n,t,e){const s=nt();Object.prototype.hasOwnProperty.call(s,n)&&(b(()=>s[n],(r,o)=>{t(st(r),st(o))},e),t(st(s[n]),void 0))}function X(){const n=q().proxy;return t=>{n.$forceUpdate(),t&&re(t)&&n.$nextTick(()=>{t()})}}function dr(n,t){const e=t.force,s=X();t.force=r=>{e(r),s()}}function hr(n){n.force=X()}const Ce=h("EmptyVNode",Gt("EmptyVNode"));function pr(n){return Array.isArray(n)?n.length===1&&n[0]===Ce:n===Ce}function ve(){return x("ctx")}function fr(){return x("ctx")}function mr(n,t){b(()=>({context:n.context,params:n.params}),e=>{t.updateContextParams({...e}),ibiz.log.debug(`${t.model.id}\u7684\u4E0A\u4E0B\u6587\u6216\u89C6\u56FE\u53C2\u6570\u53D8\u66F4\uFF1A`,e)})}function gr(n,t){const e=["context","params","modelData"];b(()=>{const s={};return Object.keys(n).forEach(r=>{e.includes(r)||(s[r]=n[r])}),s},(s,r)=>{const o={};Object.keys(s).forEach(i=>{s[i]!==(r||{})[i]&&(o[i]=s[i])}),ibiz.log.debug(`\u90E8\u4EF6 [${t.model.name}] state \u53D8\u66F4`,o),Object.keys(o).forEach(i=>{o[i]!==void 0&&(t.state[i]=o[i])})},{immediate:!0})}function Cr(n){const t=ve(),e=nt();t.evt.emit("onForecast",e.modelData.name);const s=e.provider;let r;s?.createController?r=s.createController(e.modelData,e.context,e.params,t):r=n(e.modelData,e.context,e.params,t),mr(e,r),gr(e,r),r.state=z(r.state),r.force=X();const o=q().proxy;return r.evt.onAll((i,a)=>{o.$emit(i.slice(2),a)}),o.$emit("controllerAppear",r),r.created(),W(()=>r.destroyed()),r}function Pe(n,t,e,s={}){let r=R;return b(n,(o,i)=>{o!==i&&(L(o)?(r(),r=R):r=Jt(o?.$el||o,t,e,s))},{immediate:!0}),W(()=>{r!==R&&r()}),()=>{r()}}function vr(n,t){const e=w(),s=w(!1);let r;const o=()=>{s.value||ibiz.log.debug("\u6CA1\u6709\u805A\u7126\uFF0C\u4E0D\u89E6\u53D1\u5931\u7126"),t(),r.stop(),s.value=!1},i=()=>{r&&r.pause()},a=()=>{r&&r.stop()};return Pe(e,"click",l=>{s.value||(r=u(e,()=>{o()}),s.value=!0,n())},{capture:!0}),{componentRef:e,isFocus:s,doBlur:o,pause:i,stop:a}}function P(n){return new Qt(n,ibiz.env.namespace)}function ot(n){const t=n.matched.length,e=[];for(let r=1;r<=t;r++){const o=n.path.split("/")[r*2],i=n.params[`params${r}`];let a,l,c;!i||i===ibiz.env.routePlaceholder?a=void 0:a=$.parse(i,{strictNullHandling:!0,delimiter:";"}),a&&(r===1?(l=a,a=void 0):(a.srfnavctx&&(l=JSON.parse(decodeURIComponent(a.srfnavctx)),delete a.srfnavctx),a.srfnav&&(c=a.srfnav,delete a.srfnav))),e.push({viewName:o,context:l,params:a,srfnav:c})}let s;return n.params.appContext&&n.params.appContext!==ibiz.env.routePlaceholder&&(s=$.parse(n.params.appContext,{strictNullHandling:!0,delimiter:";"})),{appContext:s,pathNodes:e}}function vt(n){let t="";return n.appContext?t+=`/${$.stringify(n.appContext,{delimiter:";",strictNullHandling:!0})}`:t+=`/${ibiz.env.routePlaceholder}`,n.pathNodes.forEach((e,s)=>{t+=`/${e.viewName}/`;let r={};if(s===0)V(e.context)&&(r=e.context);else{if(r=V(e.params)?e.params:{},V(e.context)){const i=JSON.stringify(e.context);i!=="{}"&&(r.srfnavctx=encodeURIComponent(i))}e.srfnav&&(r.srfnav=e.srfnav)}const o=$.stringify(r,{delimiter:";",strictNullHandling:!0,skipNulls:!0});V(o)?t+=o:t+=ibiz.env.routePlaceholder}),t}function ye(n){const t=n.getOwnContext(),e=["srfsessionid","srfappid"];return Object.keys(t).forEach(s=>{e.includes(s)&&delete t[s]}),t}const Pr=h("excludeViewTypes",[E.DE_GRID_VIEW,E.DE_GRID_EXP_VIEW,E.DE_LIST_VIEW,E.DE_LIST_EXP_VIEW,E.DE_DATA_VIEW,E.DE_DATAVIEW_EXP_VIEW,E.DE_CALENDAR_VIEW,E.DE_CALENDAR_EXP_VIEW,E.DE_CHART_VIEW,E.DE_CHART_EXP_VIEW,E.DE_KANBAN_VIEW]);async function we(n,t,e){if(!e)n.pathNodes[0].context=void 0;else{const s=await ibiz.hub.getAppDataEntity(e);let r=ie(t,s);if(r||(r={path:"",keys:[s.codeName.toLowerCase()]}),r){const o=n.pathNodes[1].context,i={};r.keys.forEach(a=>{t&&Object.prototype.hasOwnProperty.call(t,a)&&(i[a]=t[a],o&&delete o[a])}),n.pathNodes[0].context=i}}}async function yr(n,t,e,s){const r=ot(t);let o=2;if(e.toRouteDepth?(o=e.toRouteDepth,delete e.toRouteDepth):ibiz.env.isMob&&(r.pathNodes[0]={viewName:"home"}),r.pathNodes.splice(o-1,r.pathNodes.length-o+1),e.currentSrfNav){const i=r.pathNodes[r.pathNodes.length-1];i.params=i.params||{},i.srfnav=e.currentSrfNav,delete e.currentSrfNav}if(t.fullPath.startsWith("/appredirectview")&&(s?.srfindexname?(r.pathNodes[0].viewName=s.srfindexname,delete s.srfindexname):r.pathNodes[0].viewName="index"),r.pathNodes.push({viewName:n.codeName.toLowerCase(),context:ye(e),params:s}),o===2&&(await we(r,e,n.appDataEntityId),Pr.includes(n.viewType))){const i=ae(n.appDataEntityId);delete r.pathNodes[0].context[i]}return{path:vt(r)}}async function wr(n,t){var e;const s=ot(n);let r=s.pathNodes[t-1].viewName;if(!r)throw new F(`\u7B2C${t}\u7EA7\u8DEF\u7531\u4E0D\u5B58\u5728\u89C6\u56FE\u6807\u8BC6`);r==="index"&&(r=ibiz.hub.defaultAppIndexViewName);const o=await ibiz.hub.getAppView(r);if(!o)throw new F(`\u627E\u4E0D\u5230\u89C6\u56FE${r}`);const i={};if((e=ibiz.appData)!=null&&e.context&&Object.assign(i,ibiz.appData.context),s.appContext&&Object.assign(i,s.appContext),t!==1)for(let c=0;c<t;c++){const f=s.pathNodes[c];V(f.context)&&Object.assign(i,f.context)}const{params:a,srfnav:l}=s.pathNodes[t-1];return{viewModel:o,context:i,params:a,srfnav:l}}function M(n,t,e=!0){if(n.matched.length<t)return"";if(n.matched.length===t&&n.name)return n.path;const s=ot(n);return s.pathNodes.length<t?n.path:(s.pathNodes.length>t&&(s.pathNodes=s.pathNodes.slice(0,t)),e&&delete s.pathNodes[t-1].srfnav,vt(s))}function Dr(n,t){const e=tt();if(!e)throw new F("\u65E0\u6CD5\u6B63\u786E\u83B7\u53D6route,\u53EF\u80FD\u662F\u4F9D\u8D56\u95EE\u9898");b(()=>e?.path,()=>{const s=M(e,t);n({currentKey:s,fullPath:e.fullPath})},{immediate:!0})}class De{constructor(t,e){this.callbacks=[],this.timers=[],this.wait=500,e&&(this.wait=e),b(()=>t.path,(s,r)=>{if(s!==r){if(this.callbacks.length)for(let o=0;o<this.callbacks.length;o++){const i=this.callbacks[o];i()}if(this.callbacks=[],this.timers.length)for(let o=0;o<this.timers.length;o++){const i=this.timers[o];clearTimeout(i)}this.timers=[]}})}nextChange(t){t&&(this.timers.push(setTimeout(()=>{t();const e=this.callbacks.findIndex(s=>s===t);this.callbacks.splice(e,1)},this.wait)),this.callbacks.push(t))}}h("RouteListener",De);const O=h("withInstall",(n,t)=>(n.install=e=>{t(e)},n));function br(n){const t=P("control"),{controlType:e,sysCss:s,codeName:r}=n.model,o=e.toLowerCase(),i=s?.cssName,a=P(`control-${o}`),l=[t.b(),t.b(o),t.m(r)];return i&&l.push(i),{controlClass:l,ns:a}}function Er(n){if(L(n))return"";if(typeof n=="string")return n;try{return n.toString()}catch(t){ibiz.log.error(n,"\u8F6C\u6362\u6210\u5B57\u7B26\u4E32\u5931\u8D25",t)}return""}class it{constructor(t,e,s){this.component=t,this.render=e,this.opts=s,this.evt=new ne,this.init()}static createVueApp(t,e){throw new F("\u6CA1\u6709\u6CE8\u5165createVueApp\u65B9\u6CD5")}init(){const t=this,{render:e,opts:s}=this,r=document.createElement("div");document.body.appendChild(r);const o=it.createVueApp({mounted(){t.modal=this.$refs.root},unmounted(){document.body.removeChild(r),t.evt.emit("dismiss",t.result)},render(){return A(t.component,{ref:"root",opts:s,onDismiss(i){t.result=i,o.unmount()}},{default:e})}});ibiz.plugin.register(o),o.mount(r),this.vm=o}async present(){return this.modal.present()}async dismiss(t){this.modal.dismiss(t)}async onWillDismiss(){return new Promise(t=>{const e=s=>{t(s),this.evt.off("dismiss",e)};this.evt.on("dismiss",e)})}}h("OverlayContainer",it);class Ir extends it{present(t){return this.modal.present(t)}}h("OverlayPopoverContainer",Ir);function J(n){return t=>{const e=m("IBizViewShell");return A(e,{...n,modal:t})}}async function Ar(n,t){const e=ibiz.overlay.createModal(J(n),void 0,t);return e.present(),await e.onWillDismiss()||{ok:!1}}async function Sr(n,t){const e=ibiz.overlay.createFloatWindow(J(n),void 0,t);return e.present(),await e.onWillDismiss()||{ok:!1}}async function Nr(n,t){const e=ibiz.overlay.createDrawer(J(n),void 0,t);return await e.present(),await e.onWillDismiss()||{ok:!1}}async function Rr(n,t,e){const s=ibiz.overlay.createPopover(J(t),void 0,e);return s.present(n.target),await s.onWillDismiss()||{ok:!1}}const Br={DRAWER_LEFT:"left",DRAWER_RIGHT:"right",DRAWER_TOP:"top",DRAWER_BOTTOM:"bottom"};function Or(n){return Br[n]||"right"}class zr{constructor(t,e){this.from=t,this.to=e,this.isActivated=!1,ibiz.log.debug("openRouter: ",t,e)}onWillDismiss(){return this.promise||(this.promise=new Promise(t=>{this.resolve=t})),this.promise.then(t=>(ibiz.log.debug("onWillDismiss: ",this.from,this.to,t),t))}close(t){ibiz.log.debug("closeRouter: ",this.from,this.to,t),this.resolve&&(this.resolve(t),this.resolve=void 0)}active(){ibiz.log.debug("activeRouter: ",this.from,this.to),this.isActivated=!0}destroy(){ibiz.log.debug("destroyRouter: ",this.from,this.to),this.resolve&&(this.resolve({ok:!1}),this.resolve=void 0)}}class Fr{constructor(){this.map=new Map}async open(t,e){const s=t.currentRoute.value.fullPath;t.push({path:e});const r=e;if(this.map.has(r))return this.map.get(r).onWillDismiss();const o=new zr(s,r);return this.map.set(r,o),this.scheduledDestruction(o),o.onWillDismiss()}close(t,e){const s=this.map.get(t);s&&(s.close(e),this.map.delete(t))}active(t){const e=this.map.get(t);e&&(window.clearTimeout(e.timeout),e.timeout=void 0,e.active())}scheduledDestruction(t){t.timeout=window.setTimeout(()=>{t.timeout=void 0,t.destroy(),this.map.delete(t.to)},10*1e3)}}const zn=h("routerCallback",new Fr),Fn=h("useAppStore",Ct("appStore",()=>({appStore:z({})})));function _r(){const e=w(500);function s(){return e.value+=1,e.value}function r(){e.value-=1}return{zIndex:e,increment:s,decrement:r}}const _n=h("useUIStore",Ct("uiStore",()=>{const n=_r();return{UIStore:z({zIndex:n.zIndex,theme:"light"}),zIndex:n}})),xn=h("piniaInstance",ge());function xr(){const n=tt(),{query:t}=n;return t}function Tr(n,t,e){e||(e=w("")),e.value=n.value;const s=new De(t);return b(n,(r,o)=>{r!==o&&s.nextChange(()=>{e.value=r})}),e}function kr(n,t){b(()=>({context:n.context,params:n.params}),e=>{t.context.reset({},e.context),se(t.params),Object.assign(t.params,e.params),t.handleContextParams(),ibiz.log.debug(`${t.model.id}\u7684\u4E0A\u4E0B\u6587\u6216\u89C6\u56FE\u53C2\u6570\u53D8\u66F4\uFF1A`,e)})}function Lr(n,t){b(()=>n.state?{...n.state}:{},(e,s)=>{const r={};Object.keys(e).forEach(o=>{e[o]!==(s||{})[o]&&(r[o]=e[o])}),ibiz.log.debug(`\u89C6\u56FE [${t.model.name}] state \u53D8\u66F4`,r),Object.keys(r).forEach(o=>{t.state[o]=r[o]})},{immediate:!0})}function Pt(n){const t=nt(),e=x("ctx",void 0);e?.evt.emit("onForecast",t.modelData.name);const s=t.provider;let r;s?.createController?r=s.createController(t.modelData,t.context,t.params,e):r=n(t.modelData,t.context,t.params,e),kr(t,r),Lr(t,r),qt("ctx",r.ctx),r.state=z(r.state),r.slotProps=z(r.slotProps),t.modal&&(r.modal=t.modal),r.force=X();const o=q().proxy;return r.evt.onAll((i,a)=>{o.$emit(i.slice(2),a)}),r.created(),W(()=>r.destroyed()),r}const Tn=h("IBizIcon",v({name:"IBizIcon",props:{icon:{type:Object},size:{type:String},baseDir:{type:String,default:"images"}},setup(n){const t=P("icon"),e=`${ibiz.env.assetsUrl}/${n.baseDir}/`;function s(o){if(o){if(o.htmlStr)return d("span",{class:t.b(),innerHTML:o.htmlStr},null);if(o.cssClass)return o.cssClass.indexOf("fa-")!==-1?d("i",{class:[t.b(),o.cssClass]},null):d("ion-icon",{class:t.b(),name:o.cssClass},null);if(o.imagePath)return o.imagePath.endsWith("svg")?o.imagePath.startsWith("http")?d("img",{class:t.b(),src:o.imagePath},null):d("ion-icon",{src:e+o.imagePath,class:t.b()},null):o.imagePath.startsWith("http")?d("img",{class:t.b(),src:o.imagePath},null):d("img",{class:t.b(),src:e+o.imagePath},null);if(o.rawContent)return Zt(o.rawContent)?d("div",{class:t.b(),innerHTML:o.rawContent},null):d("img",{class:t.b(),src:o.rawContent},null)}return null}const r=S(()=>s(n.icon));return()=>r.value}})),kn=h("IBizRouterView",v({name:"IBizRouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object,manualKey:{type:String}},setup(n,{attrs:t}){const e={};let s=!0;return b(()=>n.manualKey,(o,i)=>{te(o)&&o!==i&&(s=!0)}),{renderComp:(o,i)=>{if(!s)return e.vNode;if(s=!1,o){const a={...o.props};delete a.onVnodeUnmounted,delete a.ref;const l=A(o.type,{...a,...t,key:n.manualKey});return e.vNode=l,l}}}},render(){return d(m("router-view"),{name:this.name,route:this.route},{default:({Component:n,route:t})=>{const e=this.renderComp(n,t);return this.$slots.default?this.$slots.default({Component:e,route:t}):e}})}})),Ln=h("IBizControlBase",v({name:"IBizControlBase",props:{controller:{type:Object,required:!0}},setup(n){const t=P("control"),{controlType:e,sysCss:s,codeName:r}=n.controller.model,o=e.toLowerCase(),i=s?.cssName,a=n.controller.model,l=n.controller.model.controls,c=p=>{n.controller.setLayoutPanel(p)},f=z({});return a.controlType.endsWith("EXPBAR")===!1&&(L(a.width)||(f.width=`${a.width}px`),L(a.height)||(f.height=`${a.height}px`)),{ns:t,typeClass:o,sysCssName:i,inlineStyle:f,codeName:r,controls:l,onLayoutPanelCreated:c}},render(){var n,t,e;const{state:s,controlPanel:r,providers:o}=this.controller;let i=null;if(s.isCreated&&r){const a={...this.$slots};(n=this.controls)!=null&&n.length&&this.controls.forEach(c=>{const f=c.name,p={context:this.controller.context,params:this.controller.params},D=a[f];D?a[f]=()=>D(p):a[f]=()=>{const U=m("IBizControlShell");return A(U,{modelData:c,...p})}});const l=o[r.name];i=A(m(l.component),{modelData:r,context:this.controller.context,params:this.controller.params,provider:l,onControllerAppear:this.onLayoutPanelCreated},a)}return d("div",{class:[this.ns.b(),this.ns.b(this.typeClass),this.ns.m(this.codeName),this.sysCssName],style:this.inlineStyle},[i||((e=(t=this.$slots).default)==null?void 0:e.call(t))])}})),Vn=h("IBizControlShell",v({name:"IBizControlShell",props:{modelData:{type:Object,required:!0}},setup(n){x("ctx").evt.emit("onForecast",n.modelData.name);const e=w(!1),s=w(""),r=w();return le(n.modelData).then(i=>{i?r.value=i:s.value="\u672A\u627E\u5230\u5BF9\u5E94\u90E8\u4EF6\u7684\u9002\u914D\u5668",e.value=!0}).catch(i=>{ibiz.log.error(i),s.value=i.message,e.value=!0}),{ns:P("control-shell"),isComplete:e,errMsg:s,provider:r}},render(){return this.isComplete&&this.provider?A(m(this.provider.component),{provider:this.provider,...this.$props,...this.$attrs},this.$slots):Z(d("div",{class:this.ns.b()},[this.isComplete?this.errMsg:null]),[[Y("loading"),!this.isComplete]])}})),jn=h("IBizViewShell",v({name:"IBizViewShell",props:{context:{type:Object,required:!0},params:{type:Object},modelData:{type:Object},viewId:{type:String}},setup(n){const t=P("view-shell"),e=w(!1),s=w(""),r=w(),o=w();return(async()=>{let a;if(n.modelData?a=n.modelData:a=await ibiz.hub.getAppView(n.viewId),!a)throw new F("\u672A\u627E\u5230\u89C6\u56FE\u6A21\u578B");o.value=a;try{r.value=await ue(a)}catch(l){ibiz.log.error(l),s.value=l.message}finally{e.value=!0}})(),{ns:t,isComplete:e,errMsg:s,viewModelData:o,provider:r}},render(){return this.isComplete&&this.provider?A(m(this.provider.component),{context:this.$props.context,params:this.$props.params,modelData:this.viewModelData,...this.$attrs,provider:this.provider},this.$slots):Z(d("div",{class:this.ns.b()},[this.isComplete?this.errMsg:null]),[[Y("loading"),!this.isComplete]])}})),$n=h("IBizCodeList",v({name:"IBizCodeList",props:{codeListItems:{type:Array},codeList:{type:Object,required:!0},value:{type:[String,Number]}},setup(n){const t=P("code-list"),e=w([]),s=(o,i)=>{if(o){const a=o.find(l=>l.value==i);if(a)return a;for(let l=0;l<o.length;l++){const c=s(o[l].children,i);if(c)return c}}};b(()=>n.value,(o,i)=>{if(o!==i)if(L(o)||o==="")e.value=[];else{let a;typeof o=="string"?a=o.split(","):a=[o],e.value=a.map(l=>{const c=s(n.codeListItems,l);return{text:c?.text||l,color:c?.color,textCls:c?.textCls}})}},{immediate:!0});const r=n.codeList.emptyText==="\u672A\u5B9A\u4E49"?"- - -":n.codeList.emptyText;return{items:e,ns:t,emptyText:r}},render(){return d("span",{class:this.ns.b()},[this.items.length===0?this.emptyText:this.items.map((n,t)=>{var e;return[t!==0?(e=this.codeList)==null?void 0:e.textSeparator:null,d("span",{class:[this.ns.e("item"),n.textCls?n.textCls:null],style:this.ns.cssVarBlock({"item-color":`${n.color}`})},[n.text])]})])}})),Mn=h("ControlLoadingPlaceholder",v({name:"ControlLoadingPlaceholder",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})}},setup(n){return x("ctx").evt.emit("onForecast",n.modelData.name),{}},render(){return null}}));class be extends T{}h("PanelContainerState",be);class yt extends B{createState(){var t;return new be((t=this.parent)==null?void 0:t.state)}}h("PanelContainerController",yt);function Ee(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!k(n)}const wt=v({name:"IBizPanelContainer",props:{modelData:{type:Object,required:!0},controller:{type:yt,required:!0}},setup(n){const t=P("panel-container"),{id:e}=n.modelData,s=S(()=>{let r=[t.b(),t.m(e)];return r=[...r,...n.controller.containerClass,t.is("hidden",!n.controller.state.visible)],r});return{ns:t,classArr:s}},render(){var n,t;let e;const s=((t=(n=this.$slots).default)==null?void 0:t.call(n))||[],r=d(m("iBizRow"),{slot:"content",layout:this.modelData.layout},Ee(e=s.map(o=>{const i=o.props;return!i||!i.controller?o:d(m("iBizCol"),{layoutPos:i.modelData.layoutPos,state:i.controller.state},Ee(o)?o:{default:()=>[o]})}))?e:{default:()=>[e]});return d("div",{class:this.classArr,onClick:()=>{this.controller.onClick()}},[this.controller.model.cssStyle?d("style",{type:"text/css"},[this.controller.model.cssStyle]):null,r])}});class Ie{constructor(){this.component="IBizPanelContainer"}async createController(t,e,s){const r=new yt(t,e,s);return await r.init(),r}}const Gn=h("IBizPanelContainer",O(wt,function(n){n.component(wt.name,wt),y("CONTAINER",()=>new Ie),y("CONTAINER_DEFAULT",()=>new Ie)})),Dt=v({name:"IBizPanelCtrlPos",props:{modelData:{type:Object,required:!0},controller:{type:Object,required:!0}},setup(n){return x("ctx").evt.on("onRegister",(s,r)=>{s===n.modelData.id&&n.controller.bindControl(r)}),{ns:P("panel-ctrl-pos")}},render(){const{state:n}=this.controller;let t;return this.$slots.default&&(t=this.$slots.default()),d("div",{class:[this.ns.b(),this.ns.m(this.modelData.id),...this.controller.containerClass,this.ns.is("hidden",!n.visible)]},[t||(ibiz.env.dev?`\u672A\u63D0\u4F9B${this.modelData.id}\u63D2\u69FD`:"")])}});class Ae extends B{bindControl(t){this.control=t,t.evt.onAll((e,s)=>{this.panel.evt.emit("onControlEvent",{triggerControlName:this.model.id,triggerEventName:e,triggerEvent:s})})}}h("PanelCtrlPosController",Ae);class Vr{constructor(){this.component="IBizPanelCtrlPos"}async createController(t,e,s){const r=new Ae(t,e,s);return await r.init(),r}}const Un=h("IBizPanelCtrlPos",O(Dt,function(n){n.component(Dt.name,Dt),y("CTRLPOS",()=>new Vr)}));class bt extends B{}h("ScrollContainerItemController",bt);function Se(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!k(n)}const Ne=h("ScrollContainerItem",v({name:"IBizScrollContainerItem",props:{modelData:{type:Object,required:!0},controller:{type:bt,required:!0}},setup(n){const t=P("scroll-container-item"),{id:e}=n.modelData,s=S(()=>[t.b(),t.m(e),t.is("hidden",!n.controller.state.visible)]);return{ns:t,classArr:s}},render(){var n,t;let e;const s=((t=(n=this.$slots).default)==null?void 0:t.call(n))||[];return d(m("iBizRow"),{class:this.classArr,layout:{layout:"FLEX"}},Se(e=s.map(r=>{const o=r.props;return!o||!o.controller?r:(o.modelData.layoutPos.layout="FLEX",d(m("iBizCol"),{layoutPos:o.modelData.layoutPos,state:o.controller.state},Se(r)?r:{default:()=>[r]}))}))?e:{default:()=>[e]})}}));class Q{constructor(){this.component="IBizScrollContainerItem"}async createController(t,e,s){const r=new bt(t,e,s);return await r.init(),r}}class Et extends B{async onInit(){await super.onInit(),this.state.layout.width="100%",this.state.layout.height="100%"}}h("ScrollContainerController",Et);const It=h("ScrollContainer",v({name:"IBizScrollContainer",props:{modelData:{type:Object,required:!0},controller:{type:Et,required:!0}},setup(n){const t=P("scroll-container"),{id:e}=n.modelData,s=S(()=>[t.b(),t.m(e),...n.controller.containerClass,t.is("hidden",!n.controller.state.visible)]);return{ns:t,classArr:s}},render(){var n,t;let e=null,s=null,r=null,o=null,i=null;const a={};(((t=(n=this.$slots).default)==null?void 0:t.call(n))||[]).forEach(c=>{const f=c.props;if(!f||!f.controller)return;const{width:p,height:D}=f.controller.state.layout;switch(f.modelData.layoutPos.layoutPos){case"WEST":e=c,a.left={width:p};break;case"EAST":r=c,a.right={width:p};break;case"NORTH":s=c,a.top={height:D};break;case"SOUTH":o=c,a.bottom={height:D};break;case"CENTER":i=c;break;default:ibiz.log.debug(`\u672A\u9002\u914D\u7684\u5E03\u5C40\u5360\u4F4D${f.modelData.layoutPos.layoutPos}`);break}});for(const c in a)(a[c].width||a[c].height)&&(a[c].flexShrink=0);return d("div",{class:this.classArr},[d("div",{class:[this.ns.e("header")],style:a.top},[s]),d("div",{class:[this.ns.b("content")]},[d("div",{class:this.ns.be("content","left"),style:a.left},[e]),d("div",{class:this.ns.be("content","center")},[i]),d("div",{class:this.ns.be("content","right"),style:a.right},[r])]),d("div",{class:[this.ns.e("footer")],style:a.bottom},[o])])}}));class jr{constructor(){this.component="IBizScrollContainer"}async createController(t,e,s){const r=new Et(t,e,s);return await r.init(),r}}const Wn=h("IBizScrollContainer",O(It,function(n){n.component(It.name,It),n.component(Ne.name,Ne),y("CONTAINER_CONTAINER_SCROLL",()=>new jr),y("CONTAINER_CONTAINER_SCROLL_LEFT",()=>new Q),y("CONTAINER_CONTAINER_SCROLL_HEADER",()=>new Q),y("CONTAINER_CONTAINER_SCROLL_RIGHT",()=>new Q),y("CONTAINER_CONTAINER_SCROLL_BOTTOM",()=>new Q),y("CONTAINER_CONTAINER_SCROLL_MAIN",()=>new Q)}));class Re extends T{constructor(){super(...arguments),this.cache=!0,this.routeOpen=!0,this.currentKey="",this.cacheKeys=["RouterShell"],this.navViewMsgs={}}}h("NavPosState",Re);const $r=["is404","isRoutePushed"];class At extends B{constructor(){super(...arguments),this.viewModals={},this.refCtrlKeys=[],this.rawItemParams={}}get route(){return this.router.currentRoute.value}getExpItemIsCache(t){return this.rawItemParams.expcache==="CACHE"?!0:this.rawItemParams.expcache==="NO_CACHE"?!1:t.isCache}setRouter(t){this.router=t}async onInit(){var t;await super.onInit(),this.handleRawItemParams(),(t=this.model.rawItem)!=null&&t.rawItemParams&&this.model.rawItem.rawItemParams.find(s=>s.key==="REFCTRL"&&s.value?(this.refCtrlKeys=s.value.split(";").map(r=>r.toLowerCase()),!0):!1),this.panel.evt.on("onControlEvent",s=>{if((this.refCtrlKeys.length===0||this.refCtrlKeys.includes(s.triggerControlName))&&s.triggerEventName==="onNavViewChange"){const o=s.triggerEvent;this.openView(o.navViewMsg)}});const e=this.rawItemParams.expmode||this.panel.view.params.expmode;e==="ROUTE"&&this.routeDepth?this.state.routeOpen=!0:e==="NO_ROUTE"?this.state.routeOpen=!1:this.state.routeOpen=!!this.routeDepth,this.panel.view.params.expmode&&delete this.panel.view.params.expmode}createState(){var t;return new Re((t=this.parent)==null?void 0:t.state)}get routeDepth(){return this.panel.view.modal.routeDepth}onRouteChange(t){this.curNavViewMsg&&(this.state.currentKey=this.curNavViewMsg.key,this.state.navViewMsgs[this.curNavViewMsg.key].fullPath=t.fullPath)}setNavViewMsgs(t){t.isRoutePushed=t.isRoutePushed===!0,this.state.navViewMsgs[t.key]?(ee(this.state.navViewMsgs[t.key],t),$r.forEach(e=>{Object.prototype.hasOwnProperty.call(t,e)&&(this.state.navViewMsgs[t.key][e]=void 0)})):(this.state.navViewMsgs[t.key]=t,this.getExpItemIsCache(t)&&this.state.cacheKeys.push(t.key),this.viewModals[t.key]=new ce({mode:this.routeDepth?dt.ROUTE:dt.EMBED,routeDepth:this.routeDepth?this.routeDepth+1:void 0,dismiss:()=>{this.dismiss(t.key)}})),this.curNavViewMsg=this.state.navViewMsgs[t.key]}dismiss(t){ibiz.log.debug(this.constructor.name,"dismiss",t)}onViewCreated(t){ibiz.log.debug(this.constructor.name,"onViewCreated",t)}toBlankRoute(){const t=M(this.route,this.routeDepth);this.router.push(t)}openView(t){if(!t.key){this.state.currentKey=t.key,this.routeDepth&&this.state.routeOpen&&this.toBlankRoute();return}this.routeDepth&&this.state.routeOpen?this.openViewByPath(t):this.openViewByModel(t)}openViewByPath(t){if(this.setNavViewMsgs(t),t.isRoutePushed===!0){this.state.currentKey=t.key,this.state.navViewMsgs[this.curNavViewMsg.key].fullPath=this.route.fullPath;return}if(t.is404){const s=M(this.route,this.routeDepth,!1);this.router.push(`${s}/404`)}else if(this.state.navViewMsgs[t.key].fullPath&&this.getExpItemIsCache(t))this.router.push(this.state.navViewMsgs[t.key].fullPath);else{const s=Object.assign(t.context.clone(),{toRouteDepth:this.routeDepth+1});this.getExpItemIsCache(t)&&this.state.cacheKeys.push(t.key),ibiz.commands.execute(de.TAG,t.viewId,s,t.params,{openMode:"INDEXVIEWTAB"})}}openViewByModel(t){this.setNavViewMsgs(t),this.state.currentKey=t.key}handleRawItemParams(){var t;let e={};const s=(t=this.model.rawItem)==null?void 0:t.rawItemParams;V(s)&&(e=s.reduce((r,o)=>(r[o.key.toLowerCase()]=o.value,r),{})),Object.assign(this.rawItemParams,e)}}h("NavPosController",At);function Be(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!k(n)}const St=v({name:"IBizNavPos",props:{modelData:{type:Object,required:!0},controller:{type:At,required:!0}},setup(n){const t=n.controller,e=P("nav-pos"),s=i=>{t.onViewCreated(i)},r=ct(),o=tt();if(t.setRouter(r),t.routeDepth){const i=M(o,t.routeDepth);b(()=>o.fullPath,()=>{const a=M(o,t.routeDepth);i===a&&o.matched.length>t.routeDepth&&t.onRouteChange(o)},{immediate:!0})}return{ns:e,c:t,onViewCreated:s}},render(){const{viewModals:n,state:t}=this.c,{currentKey:e,cacheKeys:s,navViewMsgs:r,cache:o}=t;let i=null;if(t.routeOpen)i=d(m("iBizRouterView"),{manualKey:e,modal:n[e],onCreated:this.onViewCreated},{default:({Component:a})=>{const l=e===""||!a?null:d(a,null,null);return o?d(m("keepAlive"),{include:s,max:30,isKey:!0},Be(l)?l:{default:()=>[l]}):l}});else{const a=e?A(m("IBizViewShell"),{context:r[e].context,params:r[e].params,key:r[e].key,viewId:r[e].viewId,onCreated:this.onViewCreated}):null;i=o?d(m("keepAlive"),{include:s,max:30,isKey:!0},Be(a)?a:{default:()=>[a]}):a}return d("div",{class:[this.ns.b(),this.ns.m(this.modelData.id),...this.controller.containerClass]},[i])}});class Mr{constructor(){this.component="IBizNavPos"}async createController(t,e,s){const r=new At(t,e,s);return await r.init(),r}}const qn=h("IBizNavPos",O(St,function(n){n.component(St.name,St),y("RAWITEM_NAV_POS",()=>new Mr)}));class Gr extends T{}class Nt extends B{constructor(){super(...arguments),this.unitName=void 0}get valueFormat(){return this.model.valueFormat}get dataType(){}get context(){return this.panel.context}get params(){return this.panel.params}get data(){return this.dataParent.data}get value(){return this.data[this.model.id]}createState(){var t;return new Gr((t=this.parent)==null?void 0:t.state)}async onInit(){await super.onInit(),this.state.required=!this.model.allowEmpty,this.model.editor&&this.model.editor.editorType!=="HIDDEN"&&(this.editorProvider=await he(this.model.editor),this.editorProvider&&(this.editor=await this.editorProvider.createController(this.model.editor,this)))}async setDataValue(t,e){const{id:s}=this.model;e=e||s,this.dataParent.setDataValue&&await this.dataParent.setDataValue(e,t)}}h("PanelFieldController",Nt);const Rt=v({name:"IBizPanelField",props:{modelData:{type:Object,required:!0},controller:{type:Nt,required:!0}},setup(n){const t=P("panel-field"),e=S(()=>{const{id:r}=n.modelData,o=[t.b(),t.m(r)];return o.push(...n.controller.containerClass),o});return{ns:t,classArr:e,onValueChange:(r,o)=>{n.controller.setDataValue(r,o)}}},render(){let n=null;if(this.controller.data){const t={value:this.controller.value,data:this.controller.data,controller:this.controller.editor,disabled:this.controller.state.disabled,class:this.ns.b("content"),readonly:this.controller.model.editor.readOnly,onChange:this.onValueChange};if(this.$slots.default)n=this.$slots.default(t);else if(this.controller.editorProvider){const e=m(this.controller.editorProvider.formEditor);n=A(e,{...t})}else n=d(m("not-supported-editor"),{modelData:this.modelData.editor},null)}return d("div",{class:this.classArr,onClick:()=>{this.controller.onClick()}},[n])}});class Ur{constructor(){this.component="IBizPanelField"}async createController(t,e,s){const r=new Nt(t,e,s);return await r.init(),r}}const Kn=h("IBizPanelField",O(Rt,function(n){n.component(Rt.name,Rt),y("FIELD",()=>new Ur)}));class Bt extends B{get data(){return this.dataParent.data}async onInit(){await super.onInit()}}h("PanelRawItemController",Bt);const Ot=v({name:"IBizPanelRawItem",props:{modelData:{type:Object,required:!0},controller:{type:Bt,required:!0}},setup(n){const t=P("panel-rawitem"),e=S(()=>{const{id:s}=n.modelData,r=[t.b(),t.m(s)];return r.push(...n.controller.containerClass),r});return{ns:t,classArr:e}},render(){if(this.controller.state.visible)return d("div",{class:this.classArr,onClick:()=>{this.controller.onClick()}},[d(m("iBizRawItem"),{rawItem:this.modelData},null)])}});class Oe{constructor(){this.component="IBizPanelRawItem"}async createController(t,e,s){const r=new Bt(t,e,s);return await r.init(),r}}const Hn=h("IBizPanelRawItem",O(Ot,function(n){n.component(Ot.name,Ot),y("RAWITEM",()=>new Oe),y("RAWITEM_STATIC_IMAGE",()=>new Oe)}));class Wr extends T{constructor(){super(...arguments),this.data={}}}class qr{constructor(t,e,s,r){this.model=t,this.panel=e,this.parent=s,this.state=new Wr,this.isDataContainer=!0,this.panelItems={},this.state.data=r;const i=et(this.model).map(a=>a.id);r._evt.on("change",a=>{i.includes(a)&&this.childDataChangeNotify([a])})}get data(){return this.state.data}async init(){await this.initChildrenController()}async initChildrenController(t=this.model.panelItems,e=this.panel,s=this){t&&await Promise.all(t.map(async r=>{var o,i;const a=this.parent.providers[r.id];if(!a)return;const l=await a.createController(r,e,s);this.panelItems[r.id]=l,(o=r.panelItems)!=null&&o.length&&!rt(r)?await this.initChildrenController(r.panelItems,e,l):(i=r.panelTabPages)!=null&&i.length&&await this.initChildrenController(r.panelTabPages,e,l)}))}async dataChangeNotify(t){}async childDataChangeNotify(t){Object.values(this.panelItems).forEach(e=>{e.dataChangeNotify(t)})}async panelStateNotify(t){Object.values(this.panelItems).forEach(e=>{e.panelStateNotify(t)})}async setDataValue(t,e){Object.prototype.hasOwnProperty.call(this.state.data,t)&&this.state.data[t]===e||(this.state.data[t]=e,this.childDataChangeNotify([t]))}destroy(){var t,e;(e=(t=this.data).destroy)==null||e.call(t),Object.values(this.panelItems).forEach(s=>{s.destroy()})}}class ze extends T{constructor(){super(...arguments),this.items=[]}}h("MultiDataContainerState",ze);class zt extends B{constructor(){super(...arguments),this.isDataContainer=!0,this.dataItems=[],this.providers={}}get data(){return this.state.items}createState(){var t;return new ze((t=this.parent)==null?void 0:t.state)}async onInit(){await super.onInit(),await this.initPanelItemProviders(),this.initContainerData()}async initPanelItemProviders(t=this.model.panelItems){t&&await Promise.all(t.map(async e=>{var s,r;const o=await ht(e);o&&(this.providers[e.id]=o,(s=e.panelItems)!=null&&s.length&&!rt(e)&&await this.initPanelItemProviders(e.panelItems),(r=e.panelTabPages)!=null&&r.length&&await this.initPanelItemProviders(e.panelTabPages))}))}initContainerData(){const{dataSourceType:t,dataName:e}=this.model;switch(t){case"DEACTION":case"DEDATASET":this.setDataByDeMethod();break;case"APPGLOBALPARAM":this.setDataByAppGlobalParam();break;case"DELOGIC":this.setDataByDeLogic();break;case"TOPVIEWSESSIONPARAM":{if(!e)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u6570\u636E\u5BF9\u8C61\u540D\u79F0");this.bindViewData(this.panel.getTopView(),e);break}case"VIEWSESSIONPARAM":{if(!e)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u6570\u636E\u5BF9\u8C61\u540D\u79F0");this.bindViewData(this.panel.view,e);break}default:throw new ut(this.model,`\u6570\u636E\u6E90\u7C7B\u578B${t}\u6682\u672A\u652F\u6301`)}}childrenStateNotify(t){this.dataItems.forEach(e=>{e.panelStateNotify(t)})}async setData(t){const e=et(this.model),s=t.map(r=>new pt(e,r));this.dataItems=s.map(r=>new qr(this.model,this.panel,this,r)),this.dataItems.length&&await Promise.all(this.dataItems.map(r=>r.init())),this.state.items=s,this.childrenStateNotify(ft.LOAD)}async setDataByDeLogic(){const{appDataEntityId:t,appDELogicId:e}=this.model;if(!e)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u903B\u8F91");if(!t)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53");const s=await mt(e,t,this.panel.context,[],this.panel.params);if(!s)throw new F(`\u5B9E\u4F53\u903B\u8F91${e}\u6CA1\u6709\u8FD4\u56DE\u503C`);this.setData(s)}setDataByAppGlobalParam(){const{dataName:t}=this.model,e=t?ibiz.appData[t]:ibiz.appData;e?this.setData(e):ibiz.log.error(`\u5168\u5C40\u53D8\u91CF\u91CC\u6CA1\u6709${t}\u5C5E\u6027`)}async setDataByDeMethod(){const{appDEMethodId:t,appDataEntityId:e}=this.model;if(!t)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u884C\u4E3A");if(!e)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53");const r=await ibiz.hub.getApp(this.panel.context.srfappid).deService.exec(e,t,this.panel.context,[],this.panel.params);r.ok&&r.data&&this.setData(r.data)}bindViewData(t,e){if(!Object.prototype.hasOwnProperty.call(t.state,e)){ibiz.log.error(`\u7ED1\u5B9A\u89C6\u56FE\u7684\u4F1A\u8BDD\u4E0D\u5B58\u5728${e}`);return}const s=()=>{const r=t.state[e];r?this.setData(r):ibiz.log.error(`\u89C6\u56FEstate\u91CC\u6CA1\u6709${e}\u5C5E\u6027`)};s(),t.evt.on("onDataChange",()=>{s()})}setDataValue(t,e){throw new Error("Method not implemented.")}destroy(){super.destroy(),this.dataItems.forEach(t=>{t.destroy()})}}h("MultiDataContainerController",zt);function Kr(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!k(n)}const Ft=v({name:"IBizMultiDataContainer",props:{modelData:{type:Object,required:!0},controller:{type:zt,required:!0}},setup(n){const t=P("multi-data-container"),{id:e}=n.modelData;b(()=>n.controller.state.items,()=>{n.controller.dataItems.forEach(o=>{o.state=z(o.state),Object.keys(o.panelItems).forEach(a=>{const l=o.panelItems[a];l.state=z(l.state)})})},{immediate:!0});const s=x("renderPanelItem"),r=S(()=>[t.b(),t.m(e),...n.controller.containerClass]);return{ns:t,classArr:r,renderPanelItem:s}},render(){let n;return this.$slots.default?n=this.$slots.default():n=this.controller.state.items.map((t,e)=>{const s=this.controller.dataItems[e];return d(m("iBizRow"),{class:this.ns.b("content"),layout:this.modelData.layout},{default:()=>{var r;return[(r=this.modelData.panelItems)==null?void 0:r.map(o=>{let i;const a=s.panelItems[o.id];return d(m("iBizCol"),{layoutPos:o.layoutPos,state:a.state},Kr(i=this.renderPanelItem(o,{providers:this.controller.providers,panelItems:s.panelItems}))?i:{default:()=>[i]})})]}})}),d("div",{class:this.classArr},[n])}});class Hr{constructor(){this.component="IBizMultiDataContainer"}async createController(t,e,s){const r=new zt(t,e,s);return await r.init(),r}}const Xn=h("IBizMultiDataContainer",O(Ft,function(n){n.component(Ft.name,Ft),y("CONTAINER_CONTAINER_MULTIDATA",()=>new Hr)}));class Fe extends T{constructor(){super(...arguments),this.data={}}}h("SingleDataContainerState",Fe);class _t extends B{constructor(){super(...arguments),this.isDataContainer=!0,this.panelItems={},this.providers={}}get data(){return this.state.data}createState(){var t;return new Fe((t=this.parent)==null?void 0:t.state)}async onInit(){await super.onInit(),await this.initPanelItemControllers(),this.initContainerData()}async initPanelItemControllers(t=this.model.panelItems,e=this.panel,s=this){t&&await Promise.all(t.map(async r=>{var o,i;const a=await ht(r);if(!a)return;this.providers[r.id]=a;const l=await a.createController(r,e,s);this.panelItems[r.id]=l,(o=r.panelItems)!=null&&o.length&&!rt(r)&&await this.initPanelItemControllers(r.panelItems,e,l),(i=r.panelTabPages)!=null&&i.length&&await this.initPanelItemControllers(r.panelTabPages,e,l)}))}initContainerData(){const{dataSourceType:t,dataName:e}=this.model;switch(t){case"DEACTION":case"DEDATASET":this.setDataByDeMethod();break;case"APPGLOBALPARAM":this.setDataByAppGlobalParam();break;case"DELOGIC":this.setDataByDeLogic();break;case"TOPVIEWSESSIONPARAM":{if(!e)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u6570\u636E\u5BF9\u8C61\u540D\u79F0");this.bindViewData(this.panel.getTopView(),e);break}case"VIEWSESSIONPARAM":{if(!e)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u6570\u636E\u5BF9\u8C61\u540D\u79F0");this.bindViewData(this.panel.view,e);break}default:throw new ut(this.model,`\u6570\u636E\u6E90\u7C7B\u578B${t}\u6682\u672A\u652F\u6301`)}}childrenStateNotify(t){Object.values(this.panelItems).forEach(e=>{e.panelStateNotify(t)})}async setData(t){var e,s;const r=et(this.model),o=r.map(a=>a.id),i=new pt(r,t);i._evt.on("change",a=>{o.includes(a)&&this.childDataChangeNotify([a])}),(s=(e=this.data).destroy)==null||s.call(e),this.state.data=i,this.childrenStateNotify(ft.LOAD)}async setDataByDeLogic(){const{appDataEntityId:t,appDELogicId:e}=this.model;if(!e)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u903B\u8F91");if(!t)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53");const s=await mt(e,t,this.panel.context,[],this.panel.params);if(!s)throw new F(`\u5B9E\u4F53\u903B\u8F91${e}\u6CA1\u6709\u8FD4\u56DE\u503C`);this.setData(s)}setDataByAppGlobalParam(){const{dataName:t}=this.model,e=t?ibiz.appData[t]:ibiz.appData;e?this.setData(e):ibiz.log.error(`\u5168\u5C40\u53D8\u91CF\u91CC\u6CA1\u6709${t}\u5C5E\u6027`)}async setDataByDeMethod(){const{appDEMethodId:t,appDataEntityId:e}=this.model;if(!t)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u884C\u4E3A");if(!e)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53");const r=await ibiz.hub.getApp(this.panel.context.srfappid).deService.exec(e,t,this.panel.context,[],this.panel.params);r.ok&&r.data&&this.setData(r.data)}bindViewData(t,e){if(!Object.prototype.hasOwnProperty.call(t.state,e)){ibiz.log.error(`\u7ED1\u5B9A\u89C6\u56FE\u7684\u4F1A\u8BDD\u4E0D\u5B58\u5728${e}`);return}const s=()=>{const r=t.state[e];r?this.setData(r):ibiz.log.error(`\u89C6\u56FEstate\u91CC\u6CA1\u6709${e}\u5C5E\u6027`)};s(),t.evt.on("onDataChange",()=>{s()})}childDataChangeNotify(t){Object.values(this.panelItems).forEach(e=>{e.dataChangeNotify(t)})}async setDataValue(t,e){Object.prototype.hasOwnProperty.call(this.state.data,t)&&this.state.data[t]===e||(this.state.data[t]=e)}destroy(){var t,e;super.destroy(),(e=(t=this.data).destroy)==null||e.call(t),Object.values(this.panelItems).forEach(s=>{s.destroy()})}}h("SingleDataContainerController",_t);function Xr(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!k(n)}const xt=v({name:"IBizSingleDataContainer",props:{modelData:{type:Object,required:!0},controller:{type:_t,required:!0}},setup(n){const t=P("single-data-container"),{id:e}=n.modelData;Object.keys(n.controller.panelItems).forEach(i=>{const a=n.controller.panelItems[i];a.state=z(a.state)});const r=x("renderPanelItem"),o=S(()=>[t.b(),t.m(e),...n.controller.containerClass]);return{ns:t,classArr:o,renderPanelItem:r}},render(){let n;return this.$slots.default?n=this.$slots.default():n=d(m("iBizRow"),{class:this.ns.b("content"),layout:this.modelData.layout},{default:()=>{var t;return[(t=this.modelData.panelItems)==null?void 0:t.map(e=>{let s;const r=this.controller.panelItems[e.id];return d(m("iBizCol"),{layoutPos:e.layoutPos,state:r.state},Xr(s=this.renderPanelItem(e,{providers:this.controller.providers,panelItems:this.controller.panelItems}))?s:{default:()=>[s]})})]}}),d("div",{class:this.classArr},[n])}});class Jr{constructor(){this.component="IBizSingleDataContainer"}async createController(t,e,s){const r=new _t(t,e,s);return await r.init(),r}}const Jn=h("IBizSingleDataContainer",O(xt,function(n){n.component(xt.name,xt),y("CONTAINER_CONTAINER_SINGLEDATA",()=>new Jr)}));class _e extends T{}h("GridContainerState",_e);class Tt extends B{createState(){var t;return new _e((t=this.parent)==null?void 0:t.state)}}h("GridContainerController",Tt);function xe(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!k(n)}const kt=v({name:"IBizGridContainer",props:{modelData:{type:Object,required:!0},controller:{type:Tt,required:!0}},setup(n){const t=P("grid-container"),{id:e}=n.modelData,s=S(()=>{let l=[t.b(),t.m(e)];return l=[...l,...n.controller.containerClass,t.is("hidden",!n.controller.state.visible)],l}),r=S(()=>({...n.modelData.layout,layout:"TABLE_12COL"})),o=(l,c)=>{const f={...l,layout:"TABLE_12COL",colXS:l.grow||c,colSM:l.grow||c,colMD:l.grow||c,colLG:l.grow||c};return delete f.grow,f},i=w(void 0),a=w(12);return{ns:t,classArr:s,layoutModel:r,convertLayoutPos:o,adaptGrow:a,adaptCols:i}},render(){var n,t;let e;const s=((t=(n=this.$slots).default)==null?void 0:t.call(n))||[];if(this.adaptCols===void 0){let r=0,o=0;s.forEach(a=>{const l=a.props;l&&l.modelData&&l.modelData.layoutPos&&(typeof l.modelData.layoutPos.grow=="number"?r+=l.modelData.layoutPos.grow:typeof l.modelData.layoutPos.grow>"u"&&(o+=1))});let i=12;o>0&&(i=(12-r)/o),this.adaptCols=o,this.adaptGrow=i}return d(m("iBizRow"),{class:this.classArr,layout:this.layoutModel},xe(e=s.map(r=>{const o=r.props;return!o||!o.controller?r:d(m("iBizCol"),{layoutPos:this.convertLayoutPos(o.modelData.layoutPos,this.adaptGrow),state:o.controller.state},xe(r)?r:{default:()=>[r]})}))?e:{default:()=>[e]})}});class Qr{constructor(){this.component="IBizGridContainer"}async createController(t,e,s){const r=new Tt(t,e,s);return await r.init(),r}}const Qn=h("IBizGridContainer",O(kt,function(n){n.component(kt.name,kt),y("CONTAINER_CONTAINER_GRID",()=>new Qr)})),Zn=h("AppRedirectView",v({setup(){var n;const t=Yt.create(((n=ibiz.appData)==null?void 0:n.context)||{});at(()=>{t.destroy()});const{href:e}=window.location;async function s(){await pe(t,e)}lt(()=>ibiz.util.hiddenAppLoading()),s()},render(){return d("div",null,[K("\u91CD\u5B9A\u5411\u8DF3\u8F6C\u4E2D")])}}));class Zr{constructor(){this.component="IBizView"}}const Lt=v({name:"IBizView",props:{context:Object,params:{type:Object,default:()=>({})},modelData:{type:Object,required:!0},modal:{type:Object},state:{type:Object},provider:{type:Object}},setup(){const n=P("view"),t=Pt((...N)=>new gt(...N)),e=fe(t.model),{viewType:s,sysCss:r,codeName:o}=t.model,i=s.toLowerCase(),a=r?.cssName,l=S(()=>[n.b(),n.b(i),n.m(o),a,t.state.viewMessages.TOP?"has-top-message":"",t.state.viewMessages.BOTTOM?"has-bottom-message":""]),c=N=>{t.setLayoutPanel(N)},f=w(null),p=oe(),D=window.devtool;return lt(()=>{D&&D.registerView(p,t,f)}),at(()=>{D&&D.unRegisterView(p)}),Kt(()=>t.onActivated()),Ht(()=>t.onDeactivated()),{c:t,controls:e,viewClassNames:l,container:f,onLayoutPanelCreated:c,renderViewMessage:N=>{if(t.state.isCreated){const Mt=t.state.viewMessages[N];if(Mt?.length)return d(m("view-message"),{class:[n.e(`${N.toLowerCase()}-message`)],messages:Mt},null)}return null}}},render(){var n;let t=null;if(this.c.state.isCreated){const e={...this.$slots};if((n=this.controls)!=null&&n.length&&this.controls.forEach(s=>{const r=s.name||s.id,o={context:this.c.context,params:this.c.params};this.c.slotProps[r]&&Object.assign(o,this.c.slotProps[r]);const i=e[r];if(i){e[r]=()=>i(o);return}const a=this.c.providers[r];a&&(e[r]=()=>{const l=m(a.component);return A(l,{modelData:s,...o,provider:a})})}),this.c.engines.length===0)t=d("span",{style:"color:red;"},[K("\u89C6\u56FE\u7C7B\u578B"),this.modelData.viewType,K("\u6682\u672A\u652F\u6301")]);else{const s=this.c.model.viewLayoutPanel,r=this.c.providers[s.name];t=A(m(r.component),{modelData:s,context:this.c.context,params:this.c.params,provider:r,onControllerAppear:this.onLayoutPanelCreated},e)}}return Z(d("div",{ref:"container",class:this.viewClassNames},[this.renderViewMessage("TOP"),t,this.renderViewMessage("BOTTOM")]),[[Y("loading"),this.c.state.isLoading]])}}),Yn=h("IBizView",O(Lt,function(n){n.component(Lt.name,Lt),H("DEFAULT",()=>new Zr)})),ts=h("TodoRedirect",v({setup(){const n=ct(),{href:t}=window.location,e=t.lastIndexOf("?"),s=decodeURIComponent(t.substring(e+1,t.length));if(!s)throw new Error("\u91CD\u5B9A\u5411\u53C2\u6570\u4E0D\u8DB3\u65E0\u6CD5\u8DF3\u8F6C");const r=$.parse(s,{delimiter:";"}),{apptype:o,todotype:i,todoid:a}=r,l={srfapptype:"pc",srfapp:""};o||(l.todourltype="RouterUrl");async function c(){let p=(await ibiz.net.post(`/systodos/${a}/getlinkurl`,l)).data.linkurl;o?window.location.href=p:(p.indexOf("/")!==0&&(p=`/${p}`),p+=`;srfwf=${i}`,n.push(`/index${p}`))}c()},render(){return d("div",null,[K("\u5F85\u529E\u5217\u8868\u91CD\u5B9A\u5411")])}}));class Vt{constructor(){this.component="IBizPortalView"}}const jt=v({name:"IBizPortalView",props:{context:Object,params:{type:Object,default:()=>({})},modelData:{type:Object,required:!0},modal:{type:Object},state:{type:Object}},setup(){var n;const t=P("view"),e=Pt((...f)=>new gt(...f)),s=((n=e.model.viewLayoutPanel)==null?void 0:n.controls)||e.model.controls,{viewType:r,sysCss:o,codeName:i}=e.model,a=r.toLowerCase(),l=o?.cssName,c=[t.b(),t.b(a),t.m(i),l];return{c:e,ns:t,controls:s,viewClassNames:c}},render(){var n;let t=null;if(this.c.state.isCreated){const e={...this.$slots};(n=this.controls)!=null&&n.length&&this.controls.forEach(s=>{const r=s.name||s.id,o={context:this.c.context,params:this.c.params};this.c.slotProps[r]&&Object.assign(o,this.c.slotProps[r]);const i=e[r];if(i){e[r]=()=>i(o);return}const a=this.c.providers[r];a&&(e[r]=()=>{const l=m(a.component);return A(l,{modelData:s,...o})})}),e.dashboard&&(t=e.dashboard())}return d("div",{class:this.viewClassNames},[t])}}),es=h("IBizPortalView",O(jt,function(n){n.component(jt.name,jt),H(E.APP_PORTAL_VIEW,()=>new Vt),H(E.DE_PORTAL_VIEW,()=>new Vt),H(E.DE_PORTAL_VIEW9,()=>new Vt)}));function Yr(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function _(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}function Te(n,t){for(var e="",s=0,r=-1,o=0,i,a=0;a<=n.length;++a){if(a<n.length)i=n.charCodeAt(a);else{if(i===47)break;i=47}if(i===47){if(!(r===a-1||o===1))if(r!==a-1&&o===2){if(e.length<2||s!==2||e.charCodeAt(e.length-1)!==46||e.charCodeAt(e.length-2)!==46){if(e.length>2){var l=e.lastIndexOf("/");if(l!==e.length-1){l===-1?(e="",s=0):(e=e.slice(0,l),s=e.length-1-e.lastIndexOf("/")),r=a,o=0;continue}}else if(e.length===2||e.length===1){e="",s=0,r=a,o=0;continue}}t&&(e.length>0?e+="/..":e="..",s=2)}else e.length>0?e+="/"+n.slice(r+1,a):e=n.slice(r+1,a),s=a-r-1;r=a,o=0}else i===46&&o!==-1?++o:o=-1}return e}function tn(n,t){var e=t.dir||t.root,s=t.base||(t.name||"")+(t.ext||"");return e?e===t.root?e+s:e+n+s:s}var G={resolve:function(){for(var t="",e=!1,s,r=arguments.length-1;r>=-1&&!e;r--){var o;r>=0?o=arguments[r]:(s===void 0&&(s=process.cwd()),o=s),_(o),o.length!==0&&(t=o+"/"+t,e=o.charCodeAt(0)===47)}return t=Te(t,!e),e?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(_(t),t.length===0)return".";var e=t.charCodeAt(0)===47,s=t.charCodeAt(t.length-1)===47;return t=Te(t,!e),t.length===0&&!e&&(t="."),t.length>0&&s&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return _(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,e=0;e<arguments.length;++e){var s=arguments[e];_(s),s.length>0&&(t===void 0?t=s:t+="/"+s)}return t===void 0?".":G.normalize(t)},relative:function(t,e){if(_(t),_(e),t===e||(t=G.resolve(t),e=G.resolve(e),t===e))return"";for(var s=1;s<t.length&&t.charCodeAt(s)===47;++s);for(var r=t.length,o=r-s,i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var a=e.length,l=a-i,c=o<l?o:l,f=-1,p=0;p<=c;++p){if(p===c){if(l>c){if(e.charCodeAt(i+p)===47)return e.slice(i+p+1);if(p===0)return e.slice(i+p)}else o>c&&(t.charCodeAt(s+p)===47?f=p:p===0&&(f=0));break}var D=t.charCodeAt(s+p),U=e.charCodeAt(i+p);if(D!==U)break;D===47&&(f=p)}var N="";for(p=s+f+1;p<=r;++p)(p===r||t.charCodeAt(p)===47)&&(N.length===0?N+="..":N+="/..");return N.length>0?N+e.slice(i+f):(i+=f,e.charCodeAt(i)===47&&++i,e.slice(i))},_makeLong:function(t){return t},dirname:function(t){if(_(t),t.length===0)return".";for(var e=t.charCodeAt(0),s=e===47,r=-1,o=!0,i=t.length-1;i>=1;--i)if(e=t.charCodeAt(i),e===47){if(!o){r=i;break}}else o=!1;return r===-1?s?"/":".":s&&r===1?"//":t.slice(0,r)},basename:function(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');_(t);var s=0,r=-1,o=!0,i;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,l=-1;for(i=t.length-1;i>=0;--i){var c=t.charCodeAt(i);if(c===47){if(!o){s=i+1;break}}else l===-1&&(o=!1,l=i+1),a>=0&&(c===e.charCodeAt(a)?--a===-1&&(r=i):(a=-1,r=l))}return s===r?r=l:r===-1&&(r=t.length),t.slice(s,r)}else{for(i=t.length-1;i>=0;--i)if(t.charCodeAt(i)===47){if(!o){s=i+1;break}}else r===-1&&(o=!1,r=i+1);return r===-1?"":t.slice(s,r)}},extname:function(t){_(t);for(var e=-1,s=0,r=-1,o=!0,i=0,a=t.length-1;a>=0;--a){var l=t.charCodeAt(a);if(l===47){if(!o){s=a+1;break}continue}r===-1&&(o=!1,r=a+1),l===46?e===-1?e=a:i!==1&&(i=1):e!==-1&&(i=-1)}return e===-1||r===-1||i===0||i===1&&e===r-1&&e===s+1?"":t.slice(e,r)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return tn("/",t)},parse:function(t){_(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;var s=t.charCodeAt(0),r=s===47,o;r?(e.root="/",o=1):o=0;for(var i=-1,a=0,l=-1,c=!0,f=t.length-1,p=0;f>=o;--f){if(s=t.charCodeAt(f),s===47){if(!c){a=f+1;break}continue}l===-1&&(c=!1,l=f+1),s===46?i===-1?i=f:p!==1&&(p=1):i!==-1&&(p=-1)}return i===-1||l===-1||p===0||p===1&&i===l-1&&i===a+1?l!==-1&&(a===0&&r?e.base=e.name=t.slice(1,l):e.base=e.name=t.slice(a,l)):(a===0&&r?(e.name=t.slice(1,i),e.base=t.slice(1,l)):(e.name=t.slice(a,i),e.base=t.slice(a,l)),e.ext=t.slice(i,l)),a>0?e.dir=t.slice(0,a-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};G.posix=G;var j=G,en=Yr(j);class rn{constructor(){this.urlReg=/^http[s]?:\/\/[^\s]*/,this.cache=new Map,this.devPackages=new Map,this.pluginCache=new Map,this.pluginCodes=[],this.predefinedPlugins=new Map}registerPredefinedPlugin(t){this.predefinedPlugins.set(t.name,t)}register(t){this.pluginCodes.forEach(e=>{t.use(e)})}async loadPredefinedPlugin(t){if(this.predefinedPlugins.has(t)){const e=this.predefinedPlugins.get(t);e&&await this.loadPluginRef(e.name,e.path)}}setPluginCode(t){this.pluginCodes.push(t),window.vueInstances.forEach(e=>{e.use(t)})}setDevPlugin(t,e){this.devPackages.set(t,e)}async loadPlugin(t){if(t.runtimeObject===!0){const e=t;if(e)try{await this.loadPluginRef(e.rtobjectName,e.rtobjectRepo)}catch{throw new I(e,"\u914D\u7F6E\u52A0\u8F7D\u5931\u8D25")}}return!1}async loadPluginRef(t,e){if(this.pluginCache.has(t))return!0;let s=null;const r=this.devPackages.get(t);if(r)s=await r();else{const i=e,a=this.urlReg.test(i)?`${i}/package.json`:`${ibiz.env.pluginBaseUrl}/${j.join(i,"package.json")}`,l=await ibiz.net.axios({method:"get",headers:{"Access-Control-Allow-Origin":"*"},url:a});if(l.status!==200)throw new Error("\u914D\u7F6E\u52A0\u8F7D\u5931\u8D25");s=l.data}const o=new me(t,e,s);if(o)try{return await this.loadScript(o),this.pluginCache.set(t,o),!0}catch(i){ibiz.log.error(i)}return!1}async loadScript(t){const e=t.repo,{name:s,version:r,system:o,module:i,styles:a}=t.config;let l="";if(this.devPackages.has(s)?l=j.join(`${s}@${r}`,i):ibiz.env.dev?l=this.urlReg.test(e)?`${e}/${j.join(i)}`:`${ibiz.env.pluginBaseUrl}/${e}/${j.join(i)}`:l=j.join(e,o),l){if(this.cache.has(l))return;let c=null;const f=this.parseUrl(l),p=(typeof a=="string"?[a]:a).map(D=>this.parseUrl(en.join(e,D)));if(this.devPackages.has(s)){const U=await this.devPackages.get(s)();this.setPluginCode(U.default),this.cache.set(l,!0)}else ibiz.env.dev?c=await ur.import(l):(System.addImportMap({imports:{[s]:f},styles:{[s]:p}}),c=await System.import(s));if(c){if(c.default)this.setPluginCode(c.default);else throw new F("\u8FDC\u7A0B\u63D2\u4EF6\u52A0\u8F7D\u5931\u8D25, \u8FDC\u7A0B\u63D2\u4EF6\u672A\u627E\u5230[default]\u9ED8\u8BA4\u5BFC\u51FA");this.cache.set(l,!0)}else throw new F("\u8FDC\u7A0B\u63D2\u4EF6\u52A0\u8F7D\u5931\u8D25, \u672A\u627E\u5230\u6587\u4EF6\u6216\u6587\u4EF6\u5185\u5BB9\u683C\u5F0F\u4E0D\u6B63\u786E")}}parseUrl(t){if(this.urlReg.test(t))return t;let e="";this.urlReg.test(ibiz.env.pluginBaseUrl)?t.startsWith("/")?e=ibiz.env.pluginBaseUrl+t:e=`${ibiz.env.pluginBaseUrl}/${t}`:e=`${j.join(ibiz.env.pluginBaseUrl,t)}`;const{origin:s,pathname:r}=window.location;return r.endsWith("/")&&e.startsWith("/")&&(e=e.substring(1)),e=`${s}${r}${e}`,e}}h("PluginFactory",rn);class $t{constructor(t,e,s){this.required=!0,e&&(this.default=e),s&&(this.validator=s),this.type=t}}h("RequiredProp",$t);function g(){return{value:String,controller:new $t(Object),data:new $t(Object),disabled:{type:Boolean},readonly:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1}}}function nn(){return{change:(n,t)=>!0,blur:()=>!0,focus:()=>!0}}function sn(){return{change:(n,t)=>!0,rowSave:()=>!0}}function C(){return{hasError:{type:Boolean}}}function ke(){return{...g(),value:[String,Number]}}function on(){return{...ke(),...C()}}function Le(){return{...g(),value:Number}}function an(){return{...Le(),...C()}}function Ve(){return{...g(),value:String}}function ln(){return{...Ve(),...C()}}function je(){return{...g(),value:[String,Number,Object,Array]}}function un(){return{...je(),...C()}}function $e(){return{...g(),value:[String,Number]}}function cn(){return{...$e(),...C()}}function Me(){return{...g(),value:[String,Number]}}function dn(){return{...Me(),...C()}}function Ge(){return{...g(),value:[String,Number]}}function hn(){return{...Ge(),...C()}}function Ue(){return{...g(),value:[String,Array,Object,Number]}}function pn(){return{...Ue(),...C()}}function We(){return{...g(),value:[String,Number]}}function fn(){return{...We(),...C()}}function qe(){return{...g(),value:[String,Number]}}function mn(){return{...qe(),...C()}}function Ke(){return{...g(),value:[String,Number]}}function gn(){return{...Ke(),...C()}}function He(){return{...g(),value:[String,Number]}}function Cn(){return{...He(),...C()}}function Xe(){return{...g(),value:[String,Number]}}function vn(){return{...Xe(),...C()}}function Je(){return{...g(),value:[String,Number]}}function Pn(){return{...Je(),...C()}}function Qe(){return{...g(),value:[String,Number,Array]}}function yn(){return{...Qe(),...C()}}function Ze(){return{...g(),value:[String,Number]}}function wn(){return{...Ze(),...C()}}function Ye(){return{...g(),value:[String,Number]}}function Dn(){return{...Ye(),...C()}}function tr(){return{...g(),value:[String,Number]}}function bn(){return{...tr(),...C()}}function er(){return{...g(),value:String}}function En(){return{...er(),...C()}}function rr(){return{...g(),value:[String,Number]}}function In(){return{...rr(),...C()}}function nr(){return{...g(),value:String,language:{type:String},theme:{type:String}}}function An(){return{...nr(),...C()}}function sr(){return{...g(),value:String}}function Sn(){return{...sr(),...C()}}function or(){return{...g(),data:{type:Object,required:!1},controller:{type:Object,required:!1},disabled:{type:Boolean,required:!1}}}function Nn(){return{...or(),...C()}}function ir(){return{...g(),value:[Array,Array]}}function Rn(){return{...ir(),...C()}}function ar(){return{...g(),value:String}}function Bn(){return{...ar(),...C()}}function lr(){return{...g(),value:String}}function On(){return{...lr(),...C()}}}}});
1
+ System.register(["vue","@ibiz-template/core","ramda","qx-util","vue-router","qs","@ibiz-template/runtime","pinia","dayjs","lodash-es"],function(h,hr){"use strict";var b,W,Ut,q,Wt,qt,x,z,y,A,m,N,Z,Kt,C,d,tt,et,L,ut,K,Ht,Xt,Jt,R,Yt,Qt,F,Zt,ct,I,te,k,ee,re,ne,V,se,oe,ie,rt,dt,M,E,ae,le,ue,ce,T,B,w,de,ht,he,pe,H,nt,st,pt,ft,mt,gt,fe,vt,me,X,ge,Ct,ve,Ce,Pe;return{setters:[function(u){b=u.watch,W=u.onBeforeUnmount,Ut=u.createCommentVNode,q=u.getCurrentInstance,Wt=u.isReactive,qt=u.toRaw,x=u.inject,z=u.reactive,y=u.ref,A=u.h,m=u.resolveComponent,N=u.computed,Z=u.onUnmounted,Kt=u.provide,C=u.defineComponent,d=u.createVNode,tt=u.withDirectives,et=u.resolveDirective,L=u.isVNode,ut=u.onMounted,K=u.createTextVNode,Ht=u.onActivated,Xt=u.onDeactivated},function(u){Jt=u.onClickOutside,R=u.NOOP,Yt=u.listenJSEvent,Qt=u.Namespace,F=u.RuntimeError,Zt=u.isSvg,ct=u.ModelError,I=u.RuntimeModelError,te=u.IBizContext},function(u){k=u.isNil,ee=u.isNotNil,re=u.mergeLeft},function(u){ne=u.isFunc,V=u.notNilEmpty,se=u.QXEvent,oe=u.clearAll,ie=u.createUUID},function(u){rt=u.useRoute,dt=u.useRouter},function(u){M=u.default},function(u){E=u.ViewType,ae=u.getMatchResPath,le=u.calcDeCodeNameById,ue=u.getControlProvider,ce=u.getViewProvider,T=u.PanelItemState,B=u.PanelItemController,w=u.registerPanelItemProvider,de=u.Modal,ht=u.ViewMode,he=u.OpenAppViewCommand,pe=u.getEditorProvider,H=u.PanelItemEventName,nt=u.getAllPanelField,st=u.isDataContainer,pt=u.getPanelItemProvider,ft=u.PanelData,mt=u.PanelNotifyState,gt=u.execDELogicById,fe=u.toLocalOpenWFRedirectView,vt=u.ViewController,me=u.getControlsByView,X=u.registerViewProvider,ge=u.RemotePluginItem},function(u){Ct=u.defineStore,ve=u.createPinia},function(u){Ce=u.default},function(u){Pe=u.isNumber}],execute:function(){h({calcResRoutePath:Ee,createOverlayView:Y,generateRoutePath:br,getArrayProps:ur,getAutoCompleteProps:or,getCascaderProps:cr,getCheckboxListProps:We,getCheckboxProps:qe,getCodeProps:ir,getColorPickerProps:dr,getDataPickerProps:Ke,getDatePickerProps:He,getDateRangeProps:Xe,getDrawerPlacement:_r,getDropdownProps:Ue,getEditorEmits:un,getEditorProps:g,getGridArrayProps:_n,getGridAutoCompleteProps:Bn,getGridCascaderProps:xn,getGridCheckboxListProps:gn,getGridCheckboxProps:vn,getGridCodeProps:On,getGridColorPickerProps:Tn,getGridDataPickerProps:Cn,getGridDatePickerProps:Pn,getGridDateRangeProps:yn,getGridDropdownProps:mn,getGridEditorCommonProps:v,getGridEditorEmits:cn,getGridHtmlProps:zn,getGridInputIpProps:pn,getGridInputNumberProps:hn,getGridInputProps:dn,getGridListBoxProps:wn,getGridMarkDownProps:Fn,getGridNumberRangeProps:Dn,getGridRadioProps:bn,getGridRateProps:En,getGridRawProps:In,getGridSliderProps:An,getGridSpanProps:fn,getGridStepperProps:Nn,getGridSwitchProps:Sn,getGridUploadProps:Rn,getHtmlProps:ar,getInputIpProps:$e,getInputNumberProps:Me,getInputProps:je,getListBoxProps:Je,getMarkDownProps:lr,getNestedRoutePath:$,getNumberRangeProps:Ye,getOrigin:it,getOwnRouteContext:be,getRadioProps:Qe,getRateProps:Ze,getRawProps:tr,getSliderProps:er,getSpanProps:Ge,getStepperProps:rr,getSwitchProps:nr,getUploadProps:sr,isEmptyVNode:gr,onRouteChange:Ir,openViewDrawer:Or,openViewFloatWindow:Br,openViewModal:Rr,openViewPopover:zr,parseRouteViewData:Er,prepareControl:Ar,renderString:Nr,route2routePath:at,routePath2string:Pt,useClickOutside:u,useControlController:yr,useController:mr,useCtx:we,useEventListener:De,useFocusAndBlur:wr,useForce:J,useForceTogether:fr,useMobCtx:vr,useNamespace:P,useProps:ot,usePropsWatch:pr,useRouteKey:Mr,useRouterQuery:jr,useViewController:yt});function u(r,t,e={}){let s=R,n=R,o=R;const i=()=>{s(),s=R,n=R,o=R};return b(r,(a,l)=>{if(a!==l)if(k(a))i();else{const c=Jt(a?.$el||a,t,e);s=c.stop,n=c.pause,o=c.proceed}},{immediate:!0}),W(()=>{s!==R&&i()}),{stop:()=>s(),pause:()=>n(),proceed:()=>o()}}function ot(){return q().proxy.$props}function it(r){return Wt(r)?qt(r):r}function pr(r,t,e){const s=ot();Object.prototype.hasOwnProperty.call(s,r)&&(b(()=>s[r],(n,o)=>{t(it(n),it(o))},e),t(it(s[r]),void 0))}function J(){const r=q().proxy;return t=>{r.$forceUpdate(),t&&ne(t)&&r.$nextTick(()=>{t()})}}function fr(r,t){const e=t.force,s=J();t.force=n=>{e(n),s()}}function mr(r){r.force=J()}const ye=h("EmptyVNode",Ut("EmptyVNode"));function gr(r){return Array.isArray(r)?r.length===1&&r[0]===ye:r===ye}function we(){return x("ctx")}function vr(){return x("ctx")}function Cr(r,t){b(()=>({context:r.context,params:r.params}),e=>{t.updateContextParams({...e}),ibiz.log.debug(`${t.model.id}\u7684\u4E0A\u4E0B\u6587\u6216\u89C6\u56FE\u53C2\u6570\u53D8\u66F4\uFF1A`,e)})}function Pr(r,t){const e=["context","params","modelData"];b(()=>{const s={};return Object.keys(r).forEach(n=>{e.includes(n)||(s[n]=r[n])}),s},(s,n)=>{const o={};Object.keys(s).forEach(i=>{s[i]!==(n||{})[i]&&(o[i]=s[i])}),ibiz.log.debug(`\u90E8\u4EF6 [${t.model.name}] state \u53D8\u66F4`,o),Object.keys(o).forEach(i=>{o[i]!==void 0&&(t.state[i]=o[i])})},{immediate:!0})}function yr(r){const t=we(),e=ot();t.evt.emit("onForecast",e.modelData.name);const s=e.provider;let n;s?.createController?n=s.createController(e.modelData,e.context,e.params,t):n=r(e.modelData,e.context,e.params,t),Cr(e,n),Pr(e,n),n.state=z(n.state),n.force=J();const o=q().proxy;return n.evt.onAll((i,a)=>{o.$emit(i.slice(2),a)}),o.$emit("controllerAppear",n),n.created(),W(()=>n.destroyed()),n}function De(r,t,e,s={}){let n=R;return b(r,(o,i)=>{o!==i&&(k(o)?(n(),n=R):n=Yt(o?.$el||o,t,e,s))},{immediate:!0}),W(()=>{n!==R&&n()}),()=>{n()}}function wr(r,t){const e=y(),s=y(!1);let n;const o=()=>{s.value||ibiz.log.debug("\u6CA1\u6709\u805A\u7126\uFF0C\u4E0D\u89E6\u53D1\u5931\u7126"),t(),n.stop(),s.value=!1},i=()=>{n&&n.pause()},a=()=>{n&&n.stop()};return De(e,"click",l=>{s.value||(n=u(e,()=>{o()}),s.value=!0,r())},{capture:!0}),{componentRef:e,isFocus:s,doBlur:o,pause:i,stop:a}}function P(r){return new Qt(r,ibiz.env.namespace)}function at(r){const t=r.matched.length,e=[];for(let n=1;n<=t;n++){const o=r.path.split("/")[n*2],i=r.params[`params${n}`];let a,l,c;!i||i===ibiz.env.routePlaceholder?a=void 0:a=M.parse(i,{strictNullHandling:!0,delimiter:";"}),a&&(n===1?(l=a,a=void 0):(a.srfnavctx&&(l=JSON.parse(decodeURIComponent(a.srfnavctx)),delete a.srfnavctx),a.srfnav&&(c=a.srfnav,delete a.srfnav))),e.push({viewName:o,context:l,params:a,srfnav:c})}let s;return r.params.appContext&&r.params.appContext!==ibiz.env.routePlaceholder&&(s=M.parse(r.params.appContext,{strictNullHandling:!0,delimiter:";"})),{appContext:s,pathNodes:e}}function Pt(r){let t="";return r.appContext?t+=`/${M.stringify(r.appContext,{delimiter:";",strictNullHandling:!0})}`:t+=`/${ibiz.env.routePlaceholder}`,r.pathNodes.forEach((e,s)=>{t+=`/${e.viewName}/`;let n={};if(s===0)V(e.context)&&(n=e.context);else{if(n=V(e.params)?e.params:{},V(e.context)){const i=JSON.stringify(e.context);i!=="{}"&&(n.srfnavctx=encodeURIComponent(i))}e.srfnav&&(n.srfnav=e.srfnav)}const o=M.stringify(n,{delimiter:";",strictNullHandling:!0,skipNulls:!0});V(o)?t+=o:t+=ibiz.env.routePlaceholder}),t}function be(r){const t=r.getOwnContext(),e=["srfsessionid","srfappid"];return Object.keys(t).forEach(s=>{e.includes(s)&&delete t[s]}),t}const Dr=h("excludeViewTypes",[E.DE_GRID_VIEW,E.DE_GRID_EXP_VIEW,E.DE_LIST_VIEW,E.DE_LIST_EXP_VIEW,E.DE_DATA_VIEW,E.DE_DATAVIEW_EXP_VIEW,E.DE_CALENDAR_VIEW,E.DE_CALENDAR_EXP_VIEW,E.DE_CHART_VIEW,E.DE_CHART_EXP_VIEW,E.DE_KANBAN_VIEW]);async function Ee(r,t,e){if(!e)r.pathNodes[0].context=void 0;else{const s=await ibiz.hub.getAppDataEntity(e);let n=ae(t,s);if(n||(n={path:"",keys:[s.codeName.toLowerCase()]}),n){const o=r.pathNodes[1].context,i={};n.keys.forEach(a=>{t&&Object.prototype.hasOwnProperty.call(t,a)&&(i[a]=t[a],o&&delete o[a])}),r.pathNodes[0].context=i}}}async function br(r,t,e,s){const n=at(t);let o=2;if(e.toRouteDepth?(o=e.toRouteDepth,delete e.toRouteDepth):ibiz.env.isMob&&(n.pathNodes[0]={viewName:"home"}),n.pathNodes.splice(o-1,n.pathNodes.length-o+1),e.currentSrfNav){const i=n.pathNodes[n.pathNodes.length-1];i.params=i.params||{},i.srfnav=e.currentSrfNav,delete e.currentSrfNav}if(t.fullPath.startsWith("/appredirectview")&&(s?.srfindexname?(n.pathNodes[0].viewName=s.srfindexname,delete s.srfindexname):n.pathNodes[0].viewName="index"),n.pathNodes.push({viewName:r.codeName.toLowerCase(),context:be(e),params:s}),o===2&&(await Ee(n,e,r.appDataEntityId),Dr.includes(r.viewType))){const i=le(r.appDataEntityId);delete n.pathNodes[0].context[i]}return{path:Pt(n)}}async function Er(r,t){var e;const s=at(r);let n=s.pathNodes[t-1].viewName;if(!n)throw new F(`\u7B2C${t}\u7EA7\u8DEF\u7531\u4E0D\u5B58\u5728\u89C6\u56FE\u6807\u8BC6`);n==="index"&&(n=ibiz.hub.defaultAppIndexViewName);const o=await ibiz.hub.getAppView(n);if(!o)throw new F(`\u627E\u4E0D\u5230\u89C6\u56FE${n}`);const i={};if((e=ibiz.appData)!=null&&e.context&&Object.assign(i,ibiz.appData.context),s.appContext&&Object.assign(i,s.appContext),t!==1)for(let c=0;c<t;c++){const f=s.pathNodes[c];V(f.context)&&Object.assign(i,f.context)}const{params:a,srfnav:l}=s.pathNodes[t-1];return{viewModel:o,context:i,params:a,srfnav:l}}function $(r,t,e=!0){if(r.matched.length<t)return"";if(r.matched.length===t&&r.name)return r.path;const s=at(r);return s.pathNodes.length<t?r.path:(s.pathNodes.length>t&&(s.pathNodes=s.pathNodes.slice(0,t)),e&&delete s.pathNodes[t-1].srfnav,Pt(s))}function Ir(r,t){const e=rt();if(!e)throw new F("\u65E0\u6CD5\u6B63\u786E\u83B7\u53D6route,\u53EF\u80FD\u662F\u4F9D\u8D56\u95EE\u9898");b(()=>e?.path,()=>{const s=$(e,t);r({currentKey:s,fullPath:e.fullPath})},{immediate:!0})}class Ie{constructor(t,e){this.callbacks=[],this.timers=[],this.wait=500,e&&(this.wait=e),b(()=>t.path,(s,n)=>{if(s!==n){if(this.callbacks.length)for(let o=0;o<this.callbacks.length;o++){const i=this.callbacks[o];i()}if(this.callbacks=[],this.timers.length)for(let o=0;o<this.timers.length;o++){const i=this.timers[o];clearTimeout(i)}this.timers=[]}})}nextChange(t){t&&(this.timers.push(setTimeout(()=>{t();const e=this.callbacks.findIndex(s=>s===t);this.callbacks.splice(e,1)},this.wait)),this.callbacks.push(t))}}h("RouteListener",Ie);const O=h("withInstall",(r,t)=>(r.install=e=>{t(e)},r));function Ar(r){const t=P("control"),{controlType:e,sysCss:s,codeName:n}=r.model,o=e.toLowerCase(),i=s?.cssName,a=P(`control-${o}`),l=[t.b(),t.b(o),t.m(n)];return i&&l.push(i),{controlClass:l,ns:a}}function Nr(r){if(k(r))return"";if(typeof r=="string")return r;try{return r.toString()}catch(t){ibiz.log.error(r,"\u8F6C\u6362\u6210\u5B57\u7B26\u4E32\u5931\u8D25",t)}return""}class lt{constructor(t,e,s){this.component=t,this.render=e,this.opts=s,this.evt=new se,this.init()}static createVueApp(t,e){throw new F("\u6CA1\u6709\u6CE8\u5165createVueApp\u65B9\u6CD5")}init(){const t=this,{render:e,opts:s}=this,n=document.createElement("div");document.body.appendChild(n);const o=lt.createVueApp({mounted(){t.modal=this.$refs.root},unmounted(){document.body.removeChild(n),t.evt.emit("dismiss",t.result)},render(){return A(t.component,{ref:"root",opts:s,onDismiss(i){t.result=i,o.unmount()}},{default:e})}});ibiz.plugin.register(o),o.mount(n),this.vm=o}async present(){return this.modal.present()}async dismiss(t){this.modal.dismiss(t)}async onWillDismiss(){return new Promise(t=>{const e=s=>{t(s),this.evt.off("dismiss",e)};this.evt.on("dismiss",e)})}}h("OverlayContainer",lt);class Sr extends lt{present(t){return this.modal.present(t)}}h("OverlayPopoverContainer",Sr);function Y(r){return t=>{const e=m("IBizViewShell");return A(e,{...r,modal:t})}}async function Rr(r,t){const e=ibiz.overlay.createModal(Y(r),void 0,t);return e.present(),await e.onWillDismiss()||{ok:!1}}async function Br(r,t){const e=ibiz.overlay.createFloatWindow(Y(r),void 0,t);return e.present(),await e.onWillDismiss()||{ok:!1}}async function Or(r,t){const e=ibiz.overlay.createDrawer(Y(r),void 0,t);return await e.present(),await e.onWillDismiss()||{ok:!1}}async function zr(r,t,e){const s=ibiz.overlay.createPopover(Y(t),void 0,e);return s.present(r.target),await s.onWillDismiss()||{ok:!1}}const Fr={DRAWER_LEFT:"left",DRAWER_RIGHT:"right",DRAWER_TOP:"top",DRAWER_BOTTOM:"bottom"};function _r(r){return Fr[r]||"right"}class xr{constructor(t,e){this.from=t,this.to=e,this.isActivated=!1,ibiz.log.debug("openRouter: ",t,e)}onWillDismiss(){return this.promise||(this.promise=new Promise(t=>{this.resolve=t})),this.promise.then(t=>(ibiz.log.debug("onWillDismiss: ",this.from,this.to,t),t))}close(t){ibiz.log.debug("closeRouter: ",this.from,this.to,t),this.resolve&&(this.resolve(t),this.resolve=void 0)}active(){ibiz.log.debug("activeRouter: ",this.from,this.to),this.isActivated=!0}destroy(){ibiz.log.debug("destroyRouter: ",this.from,this.to),this.resolve&&(this.resolve({ok:!1}),this.resolve=void 0)}}class Tr{constructor(){this.map=new Map}async open(t,e){const s=t.currentRoute.value.fullPath;t.push({path:e});const n=e;if(this.map.has(n))return this.map.get(n).onWillDismiss();const o=new xr(s,n);return this.map.set(n,o),this.scheduledDestruction(o),o.onWillDismiss()}close(t,e){const s=this.map.get(t);s&&(s.close(e),this.map.delete(t))}active(t){const e=this.map.get(t);e&&(window.clearTimeout(e.timeout),e.timeout=void 0,e.active())}scheduledDestruction(t){t.timeout=window.setTimeout(()=>{t.timeout=void 0,t.destroy(),this.map.delete(t.to)},10*1e3)}}const Ln=h("routerCallback",new Tr);function Lr(r){return["begintime","endtime","createdate","updatedate"].forEach(e=>{Pe(r[e])&&(r[e]=Ce(r[e]).format("YYYY-MM-DD HH:mm:ss"))}),r}function kr(){const r=y([]),t=y(0),e=N(()=>r.value.filter((o,i)=>i<t.value)),s=async()=>{const o=await ibiz.asyncAction.fetch();r.value=o.data},n=o=>{if(!o.data||o.subtype!=="ASYNCACTION")return;const i=Lr(o.data),a=r.value.findIndex(l=>l.asyncacitonid===i.asyncacitonid);a!==-1?(r.value.unshift(i),t.value+=1):a>=t.value?(r.value.splice(a,1),r.value.unshift(i),t.value+=1):r.value.splice(a,1,i)};return s(),ibiz.mc.command.asyncAction.on(n),Z(()=>{ibiz.mc.command.asyncAction.off(n)}),{allAsyncActions:r,recentAsyncActions:e}}const kn=h("useAppStore",Ct("appStore",()=>{const{allAsyncActions:r,recentAsyncActions:t}=kr();return{appStore:z({allAsyncActions:r,get recentAsyncActions(){return t.value}})}}));function Vr(){const e=y(500);function s(){return e.value+=1,e.value}function n(){e.value-=1}return{zIndex:e,increment:s,decrement:n}}const Vn=h("useUIStore",Ct("uiStore",()=>{const r=Vr();return{UIStore:z({zIndex:r.zIndex,theme:"light"}),zIndex:r}})),jn=h("piniaInstance",ve());function jr(){const r=rt(),{query:t}=r;return t}function Mr(r,t,e){e||(e=y("")),e.value=r.value;const s=new Ie(t);return b(r,(n,o)=>{n!==o&&s.nextChange(()=>{e.value=n})}),e}function $r(r,t){b(()=>({context:r.context,params:r.params}),e=>{t.context.reset({},e.context),oe(t.params),Object.assign(t.params,e.params),t.handleContextParams(),ibiz.log.debug(`${t.model.id}\u7684\u4E0A\u4E0B\u6587\u6216\u89C6\u56FE\u53C2\u6570\u53D8\u66F4\uFF1A`,e)})}function Gr(r,t){b(()=>r.state?{...r.state}:{},(e,s)=>{const n={};Object.keys(e).forEach(o=>{e[o]!==(s||{})[o]&&(n[o]=e[o])}),ibiz.log.debug(`\u89C6\u56FE [${t.model.name}] state \u53D8\u66F4`,n),Object.keys(n).forEach(o=>{t.state[o]=n[o]})},{immediate:!0})}function yt(r){const t=ot(),e=x("ctx",void 0);e?.evt.emit("onForecast",t.modelData.name);const s=t.provider;let n;s?.createController?n=s.createController(t.modelData,t.context,t.params,e):n=r(t.modelData,t.context,t.params,e),$r(t,n),Gr(t,n),Kt("ctx",n.ctx),n.state=z(n.state),n.slotProps=z(n.slotProps),t.modal&&(n.modal=t.modal),n.force=J();const o=q().proxy;return n.evt.onAll((i,a)=>{o.$emit(i.slice(2),a)}),n.created(),W(()=>n.destroyed()),n}const Mn=h("IBizIcon",C({name:"IBizIcon",props:{icon:{type:Object},size:{type:String},baseDir:{type:String,default:"images"}},setup(r){const t=P("icon"),e=`${ibiz.env.assetsUrl}/${r.baseDir}/`;function s(o){if(o){if(o.htmlStr)return d("span",{class:t.b(),innerHTML:o.htmlStr},null);if(o.cssClass)return o.cssClass.indexOf("fa-")!==-1?d("i",{class:[t.b(),o.cssClass]},null):d("ion-icon",{class:t.b(),name:o.cssClass},null);if(o.imagePath)return o.imagePath.endsWith("svg")?o.imagePath.startsWith("http")?d("img",{class:t.b(),src:o.imagePath},null):d("ion-icon",{src:e+o.imagePath,class:t.b()},null):o.imagePath.startsWith("http")?d("img",{class:t.b(),src:o.imagePath},null):d("img",{class:t.b(),src:e+o.imagePath},null);if(o.rawContent)return Zt(o.rawContent)?d("div",{class:t.b(),innerHTML:o.rawContent},null):d("img",{class:t.b(),src:o.rawContent},null)}return null}const n=N(()=>s(r.icon));return()=>n.value}})),$n=h("IBizRouterView",C({name:"IBizRouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object,manualKey:{type:String}},setup(r,{attrs:t}){const e={};let s=!0;return b(()=>r.manualKey,(o,i)=>{ee(o)&&o!==i&&(s=!0)}),{renderComp:(o,i)=>{if(!s)return e.vNode;if(s=!1,o){const a={...o.props};delete a.onVnodeUnmounted,delete a.ref;const l=A(o.type,{...a,...t,key:r.manualKey});return e.vNode=l,l}}}},render(){return d(m("router-view"),{name:this.name,route:this.route},{default:({Component:r,route:t})=>{const e=this.renderComp(r,t);return this.$slots.default?this.$slots.default({Component:e,route:t}):e}})}})),Gn=h("IBizControlBase",C({name:"IBizControlBase",props:{controller:{type:Object,required:!0}},setup(r){const t=P("control"),{controlType:e,sysCss:s,codeName:n}=r.controller.model,o=e.toLowerCase(),i=s?.cssName,a=r.controller.model,l=r.controller.model.controls,c=p=>{r.controller.setLayoutPanel(p)},f=z({});return a.controlType.endsWith("EXPBAR")===!1&&(k(a.width)||(f.width=`${a.width}px`),k(a.height)||(f.height=`${a.height}px`)),{ns:t,typeClass:o,sysCssName:i,inlineStyle:f,codeName:n,controls:l,onLayoutPanelCreated:c}},render(){var r,t,e;const{state:s,controlPanel:n,providers:o}=this.controller;let i=null;if(s.isCreated&&n){const a={...this.$slots};(r=this.controls)!=null&&r.length&&this.controls.forEach(c=>{const f=c.name,p={context:this.controller.context,params:this.controller.params},D=a[f];D?a[f]=()=>D(p):a[f]=()=>{const U=m("IBizControlShell");return A(U,{modelData:c,...p})}});const l=o[n.name];i=A(m(l.component),{modelData:n,context:this.controller.context,params:this.controller.params,provider:l,onControllerAppear:this.onLayoutPanelCreated},a)}return d("div",{class:[this.ns.b(),this.ns.b(this.typeClass),this.ns.m(this.codeName),this.sysCssName],style:this.inlineStyle},[i||((e=(t=this.$slots).default)==null?void 0:e.call(t))])}})),Un=h("IBizControlShell",C({name:"IBizControlShell",props:{modelData:{type:Object,required:!0}},setup(r){x("ctx").evt.emit("onForecast",r.modelData.name);const e=y(!1),s=y(""),n=y();return ue(r.modelData).then(i=>{i?n.value=i:s.value="\u672A\u627E\u5230\u5BF9\u5E94\u90E8\u4EF6\u7684\u9002\u914D\u5668",e.value=!0}).catch(i=>{ibiz.log.error(i),s.value=i.message,e.value=!0}),{ns:P("control-shell"),isComplete:e,errMsg:s,provider:n}},render(){return this.isComplete&&this.provider?A(m(this.provider.component),{provider:this.provider,...this.$props,...this.$attrs},this.$slots):tt(d("div",{class:this.ns.b()},[this.isComplete?this.errMsg:null]),[[et("loading"),!this.isComplete]])}})),Wn=h("IBizViewShell",C({name:"IBizViewShell",props:{context:{type:Object,required:!0},params:{type:Object},modelData:{type:Object},viewId:{type:String}},setup(r){const t=P("view-shell"),e=y(!1),s=y(""),n=y(),o=y();return(async()=>{let a;if(r.modelData?a=r.modelData:a=await ibiz.hub.getAppView(r.viewId),!a)throw new F("\u672A\u627E\u5230\u89C6\u56FE\u6A21\u578B");o.value=a;try{n.value=await ce(a)}catch(l){ibiz.log.error(l),s.value=l.message}finally{e.value=!0}})(),{ns:t,isComplete:e,errMsg:s,viewModelData:o,provider:n}},render(){return this.isComplete&&this.provider?A(m(this.provider.component),{context:this.$props.context,params:this.$props.params,modelData:this.viewModelData,...this.$attrs,provider:this.provider},this.$slots):tt(d("div",{class:this.ns.b()},[this.isComplete?this.errMsg:null]),[[et("loading"),!this.isComplete]])}})),qn=h("IBizCodeList",C({name:"IBizCodeList",props:{codeListItems:{type:Array},codeList:{type:Object,required:!0},value:{type:[String,Number]}},setup(r){const t=P("code-list"),e=y([]),s=(o,i)=>{if(o){const a=o.find(l=>l.value==i);if(a)return a;for(let l=0;l<o.length;l++){const c=s(o[l].children,i);if(c)return c}}};b(()=>r.value,(o,i)=>{if(o!==i)if(k(o)||o==="")e.value=[];else{let a;typeof o=="string"?a=o.split(","):a=[o],e.value=a.map(l=>{const c=s(r.codeListItems,l);return{text:c?.text||l,color:c?.color,textCls:c?.textCls}})}},{immediate:!0});const n=r.codeList.emptyText==="\u672A\u5B9A\u4E49"?"- - -":r.codeList.emptyText;return{items:e,ns:t,emptyText:n}},render(){return d("span",{class:this.ns.b()},[this.items.length===0?this.emptyText:this.items.map((r,t)=>{var e;return[t!==0?(e=this.codeList)==null?void 0:e.textSeparator:null,d("span",{class:[this.ns.e("item"),r.textCls?r.textCls:null],style:this.ns.cssVarBlock({"item-color":`${r.color}`})},[r.text])]})])}})),Kn=h("ControlLoadingPlaceholder",C({name:"ControlLoadingPlaceholder",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})}},setup(r){return x("ctx").evt.emit("onForecast",r.modelData.name),{}},render(){return null}}));class Ae extends T{}h("PanelContainerState",Ae);class wt extends B{createState(){var t;return new Ae((t=this.parent)==null?void 0:t.state)}}h("PanelContainerController",wt);function Ne(r){return typeof r=="function"||Object.prototype.toString.call(r)==="[object Object]"&&!L(r)}const Dt=C({name:"IBizPanelContainer",props:{modelData:{type:Object,required:!0},controller:{type:wt,required:!0}},setup(r){const t=P("panel-container"),{id:e}=r.modelData,s=N(()=>{let n=[t.b(),t.m(e)];return n=[...n,...r.controller.containerClass,t.is("hidden",!r.controller.state.visible)],n});return{ns:t,classArr:s}},render(){var r,t;let e;const s=((t=(r=this.$slots).default)==null?void 0:t.call(r))||[],n=d(m("iBizRow"),{slot:"content",layout:this.modelData.layout},Ne(e=s.map(o=>{const i=o.props;return!i||!i.controller?o:d(m("iBizCol"),{layoutPos:i.modelData.layoutPos,state:i.controller.state},Ne(o)?o:{default:()=>[o]})}))?e:{default:()=>[e]});return d("div",{class:this.classArr,onClick:()=>{this.controller.onClick()}},[this.controller.model.cssStyle?d("style",{type:"text/css"},[this.controller.model.cssStyle]):null,n])}});class Se{constructor(){this.component="IBizPanelContainer"}async createController(t,e,s){const n=new wt(t,e,s);return await n.init(),n}}const Hn=h("IBizPanelContainer",O(Dt,function(r){r.component(Dt.name,Dt),w("CONTAINER",()=>new Se),w("CONTAINER_DEFAULT",()=>new Se)})),bt=C({name:"IBizPanelCtrlPos",props:{modelData:{type:Object,required:!0},controller:{type:Object,required:!0}},setup(r){return x("ctx").evt.on("onRegister",(s,n)=>{s===r.modelData.id&&r.controller.bindControl(n)}),{ns:P("panel-ctrl-pos")}},render(){const{state:r}=this.controller;let t;return this.$slots.default&&(t=this.$slots.default()),d("div",{class:[this.ns.b(),this.ns.m(this.modelData.id),...this.controller.containerClass,this.ns.is("hidden",!r.visible)]},[t||(ibiz.env.dev?`\u672A\u63D0\u4F9B${this.modelData.id}\u63D2\u69FD`:"")])}});class Re extends B{bindControl(t){this.control=t,t.evt.onAll((e,s)=>{this.panel.evt.emit("onControlEvent",{triggerControlName:this.model.id,triggerEventName:e,triggerEvent:s})})}}h("PanelCtrlPosController",Re);class Ur{constructor(){this.component="IBizPanelCtrlPos"}async createController(t,e,s){const n=new Re(t,e,s);return await n.init(),n}}const Xn=h("IBizPanelCtrlPos",O(bt,function(r){r.component(bt.name,bt),w("CTRLPOS",()=>new Ur)}));class Et extends B{}h("ScrollContainerItemController",Et);function Be(r){return typeof r=="function"||Object.prototype.toString.call(r)==="[object Object]"&&!L(r)}const Oe=h("ScrollContainerItem",C({name:"IBizScrollContainerItem",props:{modelData:{type:Object,required:!0},controller:{type:Et,required:!0}},setup(r){const t=P("scroll-container-item"),{id:e}=r.modelData,s=N(()=>[t.b(),t.m(e),t.is("hidden",!r.controller.state.visible)]);return{ns:t,classArr:s}},render(){var r,t;let e;const s=((t=(r=this.$slots).default)==null?void 0:t.call(r))||[];return d(m("iBizRow"),{class:this.classArr,layout:{layout:"FLEX"}},Be(e=s.map(n=>{const o=n.props;return!o||!o.controller?n:(o.modelData.layoutPos.layout="FLEX",d(m("iBizCol"),{layoutPos:o.modelData.layoutPos,state:o.controller.state},Be(n)?n:{default:()=>[n]}))}))?e:{default:()=>[e]})}}));class Q{constructor(){this.component="IBizScrollContainerItem"}async createController(t,e,s){const n=new Et(t,e,s);return await n.init(),n}}class It extends B{async onInit(){await super.onInit(),this.state.layout.width="100%",this.state.layout.height="100%"}}h("ScrollContainerController",It);const At=h("ScrollContainer",C({name:"IBizScrollContainer",props:{modelData:{type:Object,required:!0},controller:{type:It,required:!0}},setup(r){const t=P("scroll-container"),{id:e}=r.modelData,s=N(()=>[t.b(),t.m(e),...r.controller.containerClass,t.is("hidden",!r.controller.state.visible)]);return{ns:t,classArr:s}},render(){var r,t;let e=null,s=null,n=null,o=null,i=null;const a={};(((t=(r=this.$slots).default)==null?void 0:t.call(r))||[]).forEach(c=>{const f=c.props;if(!f||!f.controller)return;const{width:p,height:D}=f.controller.state.layout;switch(f.modelData.layoutPos.layoutPos){case"WEST":e=c,a.left={width:p};break;case"EAST":n=c,a.right={width:p};break;case"NORTH":s=c,a.top={height:D};break;case"SOUTH":o=c,a.bottom={height:D};break;case"CENTER":i=c;break;default:ibiz.log.debug(`\u672A\u9002\u914D\u7684\u5E03\u5C40\u5360\u4F4D${f.modelData.layoutPos.layoutPos}`);break}});for(const c in a)(a[c].width||a[c].height)&&(a[c].flexShrink=0);return d("div",{class:this.classArr},[d("div",{class:[this.ns.e("header")],style:a.top},[s]),d("div",{class:[this.ns.b("content")]},[d("div",{class:this.ns.be("content","left"),style:a.left},[e]),d("div",{class:this.ns.be("content","center")},[i]),d("div",{class:this.ns.be("content","right"),style:a.right},[n])]),d("div",{class:[this.ns.e("footer")],style:a.bottom},[o])])}}));class Wr{constructor(){this.component="IBizScrollContainer"}async createController(t,e,s){const n=new It(t,e,s);return await n.init(),n}}const Jn=h("IBizScrollContainer",O(At,function(r){r.component(At.name,At),r.component(Oe.name,Oe),w("CONTAINER_CONTAINER_SCROLL",()=>new Wr),w("CONTAINER_CONTAINER_SCROLL_LEFT",()=>new Q),w("CONTAINER_CONTAINER_SCROLL_HEADER",()=>new Q),w("CONTAINER_CONTAINER_SCROLL_RIGHT",()=>new Q),w("CONTAINER_CONTAINER_SCROLL_BOTTOM",()=>new Q),w("CONTAINER_CONTAINER_SCROLL_MAIN",()=>new Q)}));class ze extends T{constructor(){super(...arguments),this.cache=!0,this.routeOpen=!0,this.currentKey="",this.cacheKeys=["RouterShell"],this.navViewMsgs={}}}h("NavPosState",ze);const qr=["is404","isRoutePushed"];class Nt extends B{constructor(){super(...arguments),this.viewModals={},this.refCtrlKeys=[],this.rawItemParams={}}get route(){return this.router.currentRoute.value}getExpItemIsCache(t){return this.rawItemParams.expcache==="CACHE"?!0:this.rawItemParams.expcache==="NO_CACHE"?!1:t.isCache}setRouter(t){this.router=t}async onInit(){var t;await super.onInit(),this.handleRawItemParams(),(t=this.model.rawItem)!=null&&t.rawItemParams&&this.model.rawItem.rawItemParams.find(s=>s.key==="REFCTRL"&&s.value?(this.refCtrlKeys=s.value.split(";").map(n=>n.toLowerCase()),!0):!1),this.panel.evt.on("onControlEvent",s=>{if((this.refCtrlKeys.length===0||this.refCtrlKeys.includes(s.triggerControlName))&&s.triggerEventName==="onNavViewChange"){const o=s.triggerEvent;this.openView(o.navViewMsg)}});const e=this.rawItemParams.expmode||this.panel.view.params.expmode;e==="ROUTE"&&this.routeDepth?this.state.routeOpen=!0:e==="NO_ROUTE"?this.state.routeOpen=!1:this.state.routeOpen=!!this.routeDepth,this.panel.view.params.expmode&&delete this.panel.view.params.expmode}createState(){var t;return new ze((t=this.parent)==null?void 0:t.state)}get routeDepth(){return this.panel.view.modal.routeDepth}onRouteChange(t){this.curNavViewMsg&&(this.state.currentKey=this.curNavViewMsg.key,this.state.navViewMsgs[this.curNavViewMsg.key].fullPath=t.fullPath)}setNavViewMsgs(t){t.isRoutePushed=t.isRoutePushed===!0,this.state.navViewMsgs[t.key]?(re(this.state.navViewMsgs[t.key],t),qr.forEach(e=>{Object.prototype.hasOwnProperty.call(t,e)&&(this.state.navViewMsgs[t.key][e]=void 0)})):(this.state.navViewMsgs[t.key]=t,this.getExpItemIsCache(t)&&this.state.cacheKeys.push(t.key),this.viewModals[t.key]=new de({mode:this.routeDepth?ht.ROUTE:ht.EMBED,routeDepth:this.routeDepth?this.routeDepth+1:void 0,dismiss:()=>{this.dismiss(t.key)}})),this.curNavViewMsg=this.state.navViewMsgs[t.key]}dismiss(t){ibiz.log.debug(this.constructor.name,"dismiss",t)}onViewCreated(t){ibiz.log.debug(this.constructor.name,"onViewCreated",t)}toBlankRoute(){const t=$(this.route,this.routeDepth);this.router.push(t)}openView(t){if(!t.key){this.state.currentKey=t.key,this.routeDepth&&this.state.routeOpen&&this.toBlankRoute();return}this.routeDepth&&this.state.routeOpen?this.openViewByPath(t):this.openViewByModel(t)}openViewByPath(t){if(this.setNavViewMsgs(t),t.isRoutePushed===!0){this.state.currentKey=t.key,this.state.navViewMsgs[this.curNavViewMsg.key].fullPath=this.route.fullPath;return}if(t.is404){const s=$(this.route,this.routeDepth,!1);this.router.push(`${s}/404`)}else if(this.state.navViewMsgs[t.key].fullPath&&this.getExpItemIsCache(t))this.router.push(this.state.navViewMsgs[t.key].fullPath);else{const s=Object.assign(t.context.clone(),{toRouteDepth:this.routeDepth+1});this.getExpItemIsCache(t)&&this.state.cacheKeys.push(t.key),ibiz.commands.execute(he.TAG,t.viewId,s,t.params,{openMode:"INDEXVIEWTAB"})}}openViewByModel(t){this.setNavViewMsgs(t),this.state.currentKey=t.key}handleRawItemParams(){var t;let e={};const s=(t=this.model.rawItem)==null?void 0:t.rawItemParams;V(s)&&(e=s.reduce((n,o)=>(n[o.key.toLowerCase()]=o.value,n),{})),Object.assign(this.rawItemParams,e)}}h("NavPosController",Nt);function Fe(r){return typeof r=="function"||Object.prototype.toString.call(r)==="[object Object]"&&!L(r)}const St=C({name:"IBizNavPos",props:{modelData:{type:Object,required:!0},controller:{type:Nt,required:!0}},setup(r){const t=r.controller,e=P("nav-pos"),s=i=>{t.onViewCreated(i)},n=dt(),o=rt();if(t.setRouter(n),t.routeDepth){const i=$(o,t.routeDepth);b(()=>o.fullPath,()=>{const a=$(o,t.routeDepth);i===a&&o.matched.length>t.routeDepth&&t.onRouteChange(o)},{immediate:!0})}return{ns:e,c:t,onViewCreated:s}},render(){const{viewModals:r,state:t}=this.c,{currentKey:e,cacheKeys:s,navViewMsgs:n,cache:o}=t;let i=null;if(t.routeOpen)i=d(m("iBizRouterView"),{manualKey:e,modal:r[e],onCreated:this.onViewCreated},{default:({Component:a})=>{const l=e===""||!a?null:d(a,null,null);return o?d(m("keepAlive"),{include:s,max:30,isKey:!0},Fe(l)?l:{default:()=>[l]}):l}});else{const a=e?A(m("IBizViewShell"),{context:n[e].context,params:n[e].params,key:n[e].key,viewId:n[e].viewId,onCreated:this.onViewCreated}):null;i=o?d(m("keepAlive"),{include:s,max:30,isKey:!0},Fe(a)?a:{default:()=>[a]}):a}return d("div",{class:[this.ns.b(),this.ns.m(this.modelData.id),...this.controller.containerClass]},[i])}});class Kr{constructor(){this.component="IBizNavPos"}async createController(t,e,s){const n=new Nt(t,e,s);return await n.init(),n}}const Yn=h("IBizNavPos",O(St,function(r){r.component(St.name,St),w("RAWITEM_NAV_POS",()=>new Kr)}));class Hr extends T{}class Rt extends B{constructor(){super(...arguments),this.unitName=void 0}get valueFormat(){return this.model.valueFormat}get dataType(){}get context(){return this.panel.context}get params(){return this.panel.params}get data(){return this.dataParent.data}get value(){return this.data[this.model.id]}createState(){var t;return new Hr((t=this.parent)==null?void 0:t.state)}async onInit(){await super.onInit(),this.state.required=!this.model.allowEmpty,this.model.editor&&this.model.editor.editorType!=="HIDDEN"&&(this.editorProvider=await pe(this.model.editor),this.editorProvider&&(this.editor=await this.editorProvider.createController(this.model.editor,this)))}async setDataValue(t,e){const{id:s}=this.model;e=e||s,this.dataParent.setDataValue&&await this.dataParent.setDataValue(e,t),this.panel.evt.emit("onPanelItemEvent",{panelItemName:this.model.id,panelItemEventName:H.CHANGE})}onFocus(t){this.panel.evt.emit("onPanelItemEvent",{panelItemName:this.model.id,panelItemEventName:H.FOCUS,event:t})}onBlur(t){this.panel.evt.emit("onPanelItemEvent",{panelItemName:this.model.id,panelItemEventName:H.BLUR,event:t})}onEnter(t){this.panel.evt.emit("onPanelItemEvent",{panelItemName:this.model.id,panelItemEventName:H.ENTER,event:t})}}h("PanelFieldController",Rt);const Bt=C({name:"IBizPanelField",props:{modelData:{type:Object,required:!0},controller:{type:Rt,required:!0}},setup(r){const t=P("panel-field"),e=N(()=>{const{id:n}=r.modelData,o=[t.b(),t.m(n)];return o.push(...r.controller.containerClass),o});return{ns:t,classArr:e,onValueChange:(n,o)=>{r.controller.setDataValue(n,o)}}},render(){let r=null;if(this.controller.data){const t={value:this.controller.value,data:this.controller.data,controller:this.controller.editor,disabled:this.controller.state.disabled,class:this.ns.b("content"),readonly:this.controller.model.editor.readOnly,onChange:this.onValueChange,onFocus:e=>this.controller.onFocus(e),onBlur:e=>this.controller.onBlur(e),onEnter:e=>this.controller.onEnter(e)};if(this.$slots.default)r=this.$slots.default(t);else if(this.controller.editorProvider){const e=m(this.controller.editorProvider.formEditor);r=A(e,{...t})}else r=d(m("not-supported-editor"),{modelData:this.modelData.editor},null)}return d("div",{class:this.classArr,onClick:()=>{this.controller.onClick()}},[r])}});class Xr{constructor(){this.component="IBizPanelField"}async createController(t,e,s){const n=new Rt(t,e,s);return await n.init(),n}}const Qn=h("IBizPanelField",O(Bt,function(r){r.component(Bt.name,Bt),w("FIELD",()=>new Xr)}));class Ot extends B{get data(){return this.dataParent.data}async onInit(){await super.onInit()}}h("PanelRawItemController",Ot);const zt=C({name:"IBizPanelRawItem",props:{modelData:{type:Object,required:!0},controller:{type:Ot,required:!0}},setup(r){const t=P("panel-rawitem"),e=N(()=>{const{id:s}=r.modelData,n=[t.b(),t.m(s)];return n.push(...r.controller.containerClass),n});return{ns:t,classArr:e}},render(){if(this.controller.state.visible)return d("div",{class:this.classArr,onClick:()=>{this.controller.onClick()}},[d(m("iBizRawItem"),{rawItem:this.modelData},null)])}});class _e{constructor(){this.component="IBizPanelRawItem"}async createController(t,e,s){const n=new Ot(t,e,s);return await n.init(),n}}const Zn=h("IBizPanelRawItem",O(zt,function(r){r.component(zt.name,zt),w("RAWITEM",()=>new _e),w("RAWITEM_STATIC_IMAGE",()=>new _e)}));class Jr extends T{constructor(){super(...arguments),this.data={}}}class Yr{constructor(t,e,s,n){this.model=t,this.panel=e,this.parent=s,this.state=new Jr,this.isDataContainer=!0,this.panelItems={},this.state.data=n;const i=nt(this.model).map(a=>a.id);n._evt.on("change",a=>{i.includes(a)&&this.childDataChangeNotify([a])})}get data(){return this.state.data}async init(){await this.initChildrenController()}async initChildrenController(t=this.model.panelItems,e=this.panel,s=this){t&&await Promise.all(t.map(async n=>{var o,i;const a=this.parent.providers[n.id];if(!a)return;const l=await a.createController(n,e,s);this.panelItems[n.id]=l,(o=n.panelItems)!=null&&o.length&&!st(n)?await this.initChildrenController(n.panelItems,e,l):(i=n.panelTabPages)!=null&&i.length&&await this.initChildrenController(n.panelTabPages,e,l)}))}async dataChangeNotify(t){}async childDataChangeNotify(t){Object.values(this.panelItems).forEach(e=>{e.dataChangeNotify(t)})}async panelStateNotify(t){Object.values(this.panelItems).forEach(e=>{e.panelStateNotify(t)})}async setDataValue(t,e){Object.prototype.hasOwnProperty.call(this.state.data,t)&&this.state.data[t]===e||(this.state.data[t]=e,this.childDataChangeNotify([t]))}destroy(){var t,e;(e=(t=this.data).destroy)==null||e.call(t),Object.values(this.panelItems).forEach(s=>{s.destroy()})}}class xe extends T{constructor(){super(...arguments),this.items=[]}}h("MultiDataContainerState",xe);class Ft extends B{constructor(){super(...arguments),this.isDataContainer=!0,this.dataItems=[],this.providers={}}get data(){return this.state.items}createState(){var t;return new xe((t=this.parent)==null?void 0:t.state)}async onInit(){await super.onInit(),await this.initPanelItemProviders(),this.initContainerData()}async initPanelItemProviders(t=this.model.panelItems){t&&await Promise.all(t.map(async e=>{var s,n;const o=await pt(e);o&&(this.providers[e.id]=o,(s=e.panelItems)!=null&&s.length&&!st(e)&&await this.initPanelItemProviders(e.panelItems),(n=e.panelTabPages)!=null&&n.length&&await this.initPanelItemProviders(e.panelTabPages))}))}initContainerData(){const{dataSourceType:t,dataName:e}=this.model;switch(t){case"DEACTION":case"DEDATASET":this.setDataByDeMethod();break;case"APPGLOBALPARAM":this.setDataByAppGlobalParam();break;case"DELOGIC":this.setDataByDeLogic();break;case"TOPVIEWSESSIONPARAM":{if(!e)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u6570\u636E\u5BF9\u8C61\u540D\u79F0");this.bindViewData(this.panel.getTopView(),e);break}case"VIEWSESSIONPARAM":{if(!e)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u6570\u636E\u5BF9\u8C61\u540D\u79F0");this.bindViewData(this.panel.view,e);break}default:throw new ct(this.model,`\u6570\u636E\u6E90\u7C7B\u578B${t}\u6682\u672A\u652F\u6301`)}}childrenStateNotify(t){this.dataItems.forEach(e=>{e.panelStateNotify(t)})}async setData(t){const e=nt(this.model),s=t.map(n=>new ft(e,n));this.dataItems=s.map(n=>new Yr(this.model,this.panel,this,n)),this.dataItems.length&&await Promise.all(this.dataItems.map(n=>n.init())),this.state.items=s,this.childrenStateNotify(mt.LOAD)}async setDataByDeLogic(){const{appDataEntityId:t,appDELogicId:e}=this.model;if(!e)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u903B\u8F91");if(!t)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53");const s=await gt(e,t,this.panel.context,[],this.panel.params);if(!s)throw new F(`\u5B9E\u4F53\u903B\u8F91${e}\u6CA1\u6709\u8FD4\u56DE\u503C`);this.setData(s)}setDataByAppGlobalParam(){const{dataName:t}=this.model,e=t?ibiz.appData[t]:ibiz.appData;e?this.setData(e):ibiz.log.error(`\u5168\u5C40\u53D8\u91CF\u91CC\u6CA1\u6709${t}\u5C5E\u6027`)}async setDataByDeMethod(){const{appDEMethodId:t,appDataEntityId:e}=this.model;if(!t)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u884C\u4E3A");if(!e)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53");const n=await ibiz.hub.getApp(this.panel.context.srfappid).deService.exec(e,t,this.panel.context,[],this.panel.params);n.ok&&n.data&&this.setData(n.data)}bindViewData(t,e){if(!Object.prototype.hasOwnProperty.call(t.state,e)){ibiz.log.error(`\u7ED1\u5B9A\u89C6\u56FE\u7684\u4F1A\u8BDD\u4E0D\u5B58\u5728${e}`);return}const s=()=>{const n=t.state[e];n?this.setData(n):ibiz.log.error(`\u89C6\u56FEstate\u91CC\u6CA1\u6709${e}\u5C5E\u6027`)};s(),t.evt.on("onDataChange",()=>{s()})}setDataValue(t,e){throw new Error("Method not implemented.")}destroy(){super.destroy(),this.dataItems.forEach(t=>{t.destroy()})}}h("MultiDataContainerController",Ft);function Qr(r){return typeof r=="function"||Object.prototype.toString.call(r)==="[object Object]"&&!L(r)}const _t=C({name:"IBizMultiDataContainer",props:{modelData:{type:Object,required:!0},controller:{type:Ft,required:!0}},setup(r){const t=P("multi-data-container"),{id:e}=r.modelData;b(()=>r.controller.state.items,()=>{r.controller.dataItems.forEach(o=>{o.state=z(o.state),Object.keys(o.panelItems).forEach(a=>{const l=o.panelItems[a];l.state=z(l.state)})})},{immediate:!0});const s=x("renderPanelItem"),n=N(()=>[t.b(),t.m(e),...r.controller.containerClass]);return{ns:t,classArr:n,renderPanelItem:s}},render(){let r;return this.$slots.default?r=this.$slots.default():r=this.controller.state.items.map((t,e)=>{const s=this.controller.dataItems[e];return d(m("iBizRow"),{class:this.ns.b("content"),layout:this.modelData.layout},{default:()=>{var n;return[(n=this.modelData.panelItems)==null?void 0:n.map(o=>{let i;const a=s.panelItems[o.id];return d(m("iBizCol"),{layoutPos:o.layoutPos,state:a.state},Qr(i=this.renderPanelItem(o,{providers:this.controller.providers,panelItems:s.panelItems}))?i:{default:()=>[i]})})]}})}),d("div",{class:this.classArr},[r])}});class Zr{constructor(){this.component="IBizMultiDataContainer"}async createController(t,e,s){const n=new Ft(t,e,s);return await n.init(),n}}const ts=h("IBizMultiDataContainer",O(_t,function(r){r.component(_t.name,_t),w("CONTAINER_CONTAINER_MULTIDATA",()=>new Zr)}));class Te extends T{constructor(){super(...arguments),this.data={}}}h("SingleDataContainerState",Te);class xt extends B{constructor(){super(...arguments),this.isDataContainer=!0,this.panelItems={},this.providers={}}get data(){return this.state.data}createState(){var t;return new Te((t=this.parent)==null?void 0:t.state)}async onInit(){await super.onInit(),await this.initPanelItemControllers(),this.initContainerData()}async initPanelItemControllers(t=this.model.panelItems,e=this.panel,s=this){t&&await Promise.all(t.map(async n=>{var o,i;const a=await pt(n);if(!a)return;this.providers[n.id]=a;const l=await a.createController(n,e,s);this.panelItems[n.id]=l,(o=n.panelItems)!=null&&o.length&&!st(n)&&await this.initPanelItemControllers(n.panelItems,e,l),(i=n.panelTabPages)!=null&&i.length&&await this.initPanelItemControllers(n.panelTabPages,e,l)}))}initContainerData(){const{dataSourceType:t,dataName:e}=this.model;switch(t){case"DEACTION":case"DEDATASET":this.setDataByDeMethod();break;case"APPGLOBALPARAM":this.setDataByAppGlobalParam();break;case"DELOGIC":this.setDataByDeLogic();break;case"TOPVIEWSESSIONPARAM":{if(!e)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u6570\u636E\u5BF9\u8C61\u540D\u79F0");this.bindViewData(this.panel.getTopView(),e);break}case"VIEWSESSIONPARAM":{if(!e)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u6570\u636E\u5BF9\u8C61\u540D\u79F0");this.bindViewData(this.panel.view,e);break}default:throw new ct(this.model,`\u6570\u636E\u6E90\u7C7B\u578B${t}\u6682\u672A\u652F\u6301`)}}childrenStateNotify(t){Object.values(this.panelItems).forEach(e=>{e.panelStateNotify(t)})}async setData(t){var e,s;const n=nt(this.model),o=n.map(a=>a.id),i=new ft(n,t);i._evt.on("change",a=>{o.includes(a)&&this.childDataChangeNotify([a])}),(s=(e=this.data).destroy)==null||s.call(e),this.state.data=i,this.childrenStateNotify(mt.LOAD)}async setDataByDeLogic(){const{appDataEntityId:t,appDELogicId:e}=this.model;if(!e)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u903B\u8F91");if(!t)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53");const s=await gt(e,t,this.panel.context,[],this.panel.params);if(!s)throw new F(`\u5B9E\u4F53\u903B\u8F91${e}\u6CA1\u6709\u8FD4\u56DE\u503C`);this.setData(s)}setDataByAppGlobalParam(){const{dataName:t}=this.model,e=t?ibiz.appData[t]:ibiz.appData;e?this.setData(e):ibiz.log.error(`\u5168\u5C40\u53D8\u91CF\u91CC\u6CA1\u6709${t}\u5C5E\u6027`)}async setDataByDeMethod(){const{appDEMethodId:t,appDataEntityId:e}=this.model;if(!t)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53\u884C\u4E3A");if(!e)throw new I(this.model,"\u6CA1\u6709\u914D\u7F6E\u5B9E\u4F53");const n=await ibiz.hub.getApp(this.panel.context.srfappid).deService.exec(e,t,this.panel.context,[],this.panel.params);n.ok&&n.data&&this.setData(n.data)}bindViewData(t,e){if(!Object.prototype.hasOwnProperty.call(t.state,e)){ibiz.log.error(`\u7ED1\u5B9A\u89C6\u56FE\u7684\u4F1A\u8BDD\u4E0D\u5B58\u5728${e}`);return}const s=()=>{const n=t.state[e];n?this.setData(n):ibiz.log.error(`\u89C6\u56FEstate\u91CC\u6CA1\u6709${e}\u5C5E\u6027`)};s(),t.evt.on("onDataChange",()=>{s()})}childDataChangeNotify(t){Object.values(this.panelItems).forEach(e=>{e.dataChangeNotify(t)})}async setDataValue(t,e){Object.prototype.hasOwnProperty.call(this.state.data,t)&&this.state.data[t]===e||(this.state.data[t]=e)}destroy(){var t,e;super.destroy(),(e=(t=this.data).destroy)==null||e.call(t),Object.values(this.panelItems).forEach(s=>{s.destroy()})}}h("SingleDataContainerController",xt);function tn(r){return typeof r=="function"||Object.prototype.toString.call(r)==="[object Object]"&&!L(r)}const Tt=C({name:"IBizSingleDataContainer",props:{modelData:{type:Object,required:!0},controller:{type:xt,required:!0}},setup(r){const t=P("single-data-container"),{id:e}=r.modelData;Object.keys(r.controller.panelItems).forEach(i=>{const a=r.controller.panelItems[i];a.state=z(a.state)});const n=x("renderPanelItem"),o=N(()=>[t.b(),t.m(e),...r.controller.containerClass]);return{ns:t,classArr:o,renderPanelItem:n}},render(){let r;return this.$slots.default?r=this.$slots.default():r=d(m("iBizRow"),{class:this.ns.b("content"),layout:this.modelData.layout},{default:()=>{var t;return[(t=this.modelData.panelItems)==null?void 0:t.map(e=>{let s;const n=this.controller.panelItems[e.id];return d(m("iBizCol"),{layoutPos:e.layoutPos,state:n.state},tn(s=this.renderPanelItem(e,{providers:this.controller.providers,panelItems:this.controller.panelItems}))?s:{default:()=>[s]})})]}}),d("div",{class:this.classArr},[r])}});class en{constructor(){this.component="IBizSingleDataContainer"}async createController(t,e,s){const n=new xt(t,e,s);return await n.init(),n}}const es=h("IBizSingleDataContainer",O(Tt,function(r){r.component(Tt.name,Tt),w("CONTAINER_CONTAINER_SINGLEDATA",()=>new en)}));class Le extends T{}h("GridContainerState",Le);class Lt extends B{createState(){var t;return new Le((t=this.parent)==null?void 0:t.state)}}h("GridContainerController",Lt);function ke(r){return typeof r=="function"||Object.prototype.toString.call(r)==="[object Object]"&&!L(r)}const kt=C({name:"IBizGridContainer",props:{modelData:{type:Object,required:!0},controller:{type:Lt,required:!0}},setup(r){const t=P("grid-container"),{id:e}=r.modelData,s=N(()=>{let l=[t.b(),t.m(e)];return l=[...l,...r.controller.containerClass,t.is("hidden",!r.controller.state.visible)],l}),n=N(()=>({...r.modelData.layout,layout:"TABLE_12COL"})),o=(l,c)=>{const f={...l,layout:"TABLE_12COL",colXS:l.grow||c,colSM:l.grow||c,colMD:l.grow||c,colLG:l.grow||c};return delete f.grow,f},i=y(void 0),a=y(12);return{ns:t,classArr:s,layoutModel:n,convertLayoutPos:o,adaptGrow:a,adaptCols:i}},render(){var r,t;let e;const s=((t=(r=this.$slots).default)==null?void 0:t.call(r))||[];if(this.adaptCols===void 0){let n=0,o=0;s.forEach(a=>{const l=a.props;l&&l.modelData&&l.modelData.layoutPos&&(typeof l.modelData.layoutPos.grow=="number"?n+=l.modelData.layoutPos.grow:typeof l.modelData.layoutPos.grow>"u"&&(o+=1))});let i=12;o>0&&(i=(12-n)/o),this.adaptCols=o,this.adaptGrow=i}return d(m("iBizRow"),{class:this.classArr,layout:this.layoutModel},ke(e=s.map(n=>{const o=n.props;return!o||!o.controller?n:d(m("iBizCol"),{layoutPos:this.convertLayoutPos(o.modelData.layoutPos,this.adaptGrow),state:o.controller.state},ke(n)?n:{default:()=>[n]})}))?e:{default:()=>[e]})}});class rn{constructor(){this.component="IBizGridContainer"}async createController(t,e,s){const n=new Lt(t,e,s);return await n.init(),n}}const rs=h("IBizGridContainer",O(kt,function(r){r.component(kt.name,kt),w("CONTAINER_CONTAINER_GRID",()=>new rn)})),ns=h("AppRedirectView",C({setup(){var r;const t=te.create(((r=ibiz.appData)==null?void 0:r.context)||{});Z(()=>{t.destroy()});const{href:e}=window.location;async function s(){await fe(t,e)}ut(()=>ibiz.util.hiddenAppLoading()),s()},render(){return d("div",null,[K("\u91CD\u5B9A\u5411\u8DF3\u8F6C\u4E2D")])}}));class nn{constructor(){this.component="IBizView"}}const Vt=C({name:"IBizView",props:{context:Object,params:{type:Object,default:()=>({})},modelData:{type:Object,required:!0},modal:{type:Object},state:{type:Object},provider:{type:Object}},setup(){const r=P("view"),t=yt((...S)=>new vt(...S)),e=me(t.model),{viewType:s,sysCss:n,codeName:o}=t.model,i=s.toLowerCase(),a=n?.cssName,l=N(()=>[r.b(),r.b(i),r.m(o),a,t.state.viewMessages.TOP?"has-top-message":"",t.state.viewMessages.BOTTOM?"has-bottom-message":""]),c=S=>{t.setLayoutPanel(S)},f=y(null),p=ie(),D=window.devtool;return ut(()=>{D&&D.registerView(p,t,f)}),Z(()=>{D&&D.unRegisterView(p)}),Ht(()=>t.onActivated()),Xt(()=>t.onDeactivated()),{c:t,controls:e,viewClassNames:l,container:f,onLayoutPanelCreated:c,renderViewMessage:S=>{if(t.state.isCreated){const Gt=t.state.viewMessages[S];if(Gt?.length)return d(m("view-message"),{class:[r.e(`${S.toLowerCase()}-message`)],messages:Gt},null)}return null}}},render(){var r;let t=null;if(this.c.state.isCreated){const e={...this.$slots};if((r=this.controls)!=null&&r.length&&this.controls.forEach(s=>{const n=s.name||s.id,o={context:this.c.context,params:this.c.params};this.c.slotProps[n]&&Object.assign(o,this.c.slotProps[n]);const i=e[n];if(i){e[n]=()=>i(o);return}const a=this.c.providers[n];a&&(e[n]=()=>{const l=m(a.component);return A(l,{modelData:s,...o,provider:a})})}),this.c.engines.length===0)t=d("span",{style:"color:red;"},[K("\u89C6\u56FE\u7C7B\u578B"),this.modelData.viewType,K("\u6682\u672A\u652F\u6301")]);else{const s=this.c.model.viewLayoutPanel,n=this.c.providers[s.name];t=A(m(n.component),{modelData:s,context:this.c.context,params:this.c.params,provider:n,onControllerAppear:this.onLayoutPanelCreated},e)}}return tt(d("div",{ref:"container",class:this.viewClassNames},[this.renderViewMessage("TOP"),t,this.renderViewMessage("BOTTOM")]),[[et("loading"),this.c.state.isLoading]])}}),ss=h("IBizView",O(Vt,function(r){r.component(Vt.name,Vt),X("DEFAULT",()=>new nn)})),os=h("TodoRedirect",C({setup(){const r=dt(),{href:t}=window.location,e=t.lastIndexOf("?"),s=decodeURIComponent(t.substring(e+1,t.length));if(!s)throw new Error("\u91CD\u5B9A\u5411\u53C2\u6570\u4E0D\u8DB3\u65E0\u6CD5\u8DF3\u8F6C");const n=M.parse(s,{delimiter:";"}),{apptype:o,todotype:i,todoid:a}=n,l={srfapptype:"pc",srfapp:""};o||(l.todourltype="RouterUrl");async function c(){let p=(await ibiz.net.post(`/systodos/${a}/getlinkurl`,l)).data.linkurl;o?window.location.href=p:(p.indexOf("/")!==0&&(p=`/${p}`),p+=`;srfwf=${i}`,r.push(`/index${p}`))}c()},render(){return d("div",null,[K("\u5F85\u529E\u5217\u8868\u91CD\u5B9A\u5411")])}}));class jt{constructor(){this.component="IBizPortalView"}}const Mt=C({name:"IBizPortalView",props:{context:Object,params:{type:Object,default:()=>({})},modelData:{type:Object,required:!0},modal:{type:Object},state:{type:Object}},setup(){var r;const t=P("view"),e=yt((...f)=>new vt(...f)),s=((r=e.model.viewLayoutPanel)==null?void 0:r.controls)||e.model.controls,{viewType:n,sysCss:o,codeName:i}=e.model,a=n.toLowerCase(),l=o?.cssName,c=[t.b(),t.b(a),t.m(i),l];return{c:e,ns:t,controls:s,viewClassNames:c}},render(){var r;let t=null;if(this.c.state.isCreated){const e={...this.$slots};(r=this.controls)!=null&&r.length&&this.controls.forEach(s=>{const n=s.name||s.id,o={context:this.c.context,params:this.c.params};this.c.slotProps[n]&&Object.assign(o,this.c.slotProps[n]);const i=e[n];if(i){e[n]=()=>i(o);return}const a=this.c.providers[n];a&&(e[n]=()=>{const l=m(a.component);return A(l,{modelData:s,...o})})}),e.dashboard&&(t=e.dashboard())}return d("div",{class:this.viewClassNames},[t])}}),is=h("IBizPortalView",O(Mt,function(r){r.component(Mt.name,Mt),X(E.APP_PORTAL_VIEW,()=>new jt),X(E.DE_PORTAL_VIEW,()=>new jt),X(E.DE_PORTAL_VIEW9,()=>new jt)}));function sn(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function _(r){if(typeof r!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(r))}function Ve(r,t){for(var e="",s=0,n=-1,o=0,i,a=0;a<=r.length;++a){if(a<r.length)i=r.charCodeAt(a);else{if(i===47)break;i=47}if(i===47){if(!(n===a-1||o===1))if(n!==a-1&&o===2){if(e.length<2||s!==2||e.charCodeAt(e.length-1)!==46||e.charCodeAt(e.length-2)!==46){if(e.length>2){var l=e.lastIndexOf("/");if(l!==e.length-1){l===-1?(e="",s=0):(e=e.slice(0,l),s=e.length-1-e.lastIndexOf("/")),n=a,o=0;continue}}else if(e.length===2||e.length===1){e="",s=0,n=a,o=0;continue}}t&&(e.length>0?e+="/..":e="..",s=2)}else e.length>0?e+="/"+r.slice(n+1,a):e=r.slice(n+1,a),s=a-n-1;n=a,o=0}else i===46&&o!==-1?++o:o=-1}return e}function on(r,t){var e=t.dir||t.root,s=t.base||(t.name||"")+(t.ext||"");return e?e===t.root?e+s:e+r+s:s}var G={resolve:function(){for(var t="",e=!1,s,n=arguments.length-1;n>=-1&&!e;n--){var o;n>=0?o=arguments[n]:(s===void 0&&(s=process.cwd()),o=s),_(o),o.length!==0&&(t=o+"/"+t,e=o.charCodeAt(0)===47)}return t=Ve(t,!e),e?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(_(t),t.length===0)return".";var e=t.charCodeAt(0)===47,s=t.charCodeAt(t.length-1)===47;return t=Ve(t,!e),t.length===0&&!e&&(t="."),t.length>0&&s&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return _(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,e=0;e<arguments.length;++e){var s=arguments[e];_(s),s.length>0&&(t===void 0?t=s:t+="/"+s)}return t===void 0?".":G.normalize(t)},relative:function(t,e){if(_(t),_(e),t===e||(t=G.resolve(t),e=G.resolve(e),t===e))return"";for(var s=1;s<t.length&&t.charCodeAt(s)===47;++s);for(var n=t.length,o=n-s,i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var a=e.length,l=a-i,c=o<l?o:l,f=-1,p=0;p<=c;++p){if(p===c){if(l>c){if(e.charCodeAt(i+p)===47)return e.slice(i+p+1);if(p===0)return e.slice(i+p)}else o>c&&(t.charCodeAt(s+p)===47?f=p:p===0&&(f=0));break}var D=t.charCodeAt(s+p),U=e.charCodeAt(i+p);if(D!==U)break;D===47&&(f=p)}var S="";for(p=s+f+1;p<=n;++p)(p===n||t.charCodeAt(p)===47)&&(S.length===0?S+="..":S+="/..");return S.length>0?S+e.slice(i+f):(i+=f,e.charCodeAt(i)===47&&++i,e.slice(i))},_makeLong:function(t){return t},dirname:function(t){if(_(t),t.length===0)return".";for(var e=t.charCodeAt(0),s=e===47,n=-1,o=!0,i=t.length-1;i>=1;--i)if(e=t.charCodeAt(i),e===47){if(!o){n=i;break}}else o=!1;return n===-1?s?"/":".":s&&n===1?"//":t.slice(0,n)},basename:function(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');_(t);var s=0,n=-1,o=!0,i;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,l=-1;for(i=t.length-1;i>=0;--i){var c=t.charCodeAt(i);if(c===47){if(!o){s=i+1;break}}else l===-1&&(o=!1,l=i+1),a>=0&&(c===e.charCodeAt(a)?--a===-1&&(n=i):(a=-1,n=l))}return s===n?n=l:n===-1&&(n=t.length),t.slice(s,n)}else{for(i=t.length-1;i>=0;--i)if(t.charCodeAt(i)===47){if(!o){s=i+1;break}}else n===-1&&(o=!1,n=i+1);return n===-1?"":t.slice(s,n)}},extname:function(t){_(t);for(var e=-1,s=0,n=-1,o=!0,i=0,a=t.length-1;a>=0;--a){var l=t.charCodeAt(a);if(l===47){if(!o){s=a+1;break}continue}n===-1&&(o=!1,n=a+1),l===46?e===-1?e=a:i!==1&&(i=1):e!==-1&&(i=-1)}return e===-1||n===-1||i===0||i===1&&e===n-1&&e===s+1?"":t.slice(e,n)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return on("/",t)},parse:function(t){_(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;var s=t.charCodeAt(0),n=s===47,o;n?(e.root="/",o=1):o=0;for(var i=-1,a=0,l=-1,c=!0,f=t.length-1,p=0;f>=o;--f){if(s=t.charCodeAt(f),s===47){if(!c){a=f+1;break}continue}l===-1&&(c=!1,l=f+1),s===46?i===-1?i=f:p!==1&&(p=1):i!==-1&&(p=-1)}return i===-1||l===-1||p===0||p===1&&i===l-1&&i===a+1?l!==-1&&(a===0&&n?e.base=e.name=t.slice(1,l):e.base=e.name=t.slice(a,l)):(a===0&&n?(e.name=t.slice(1,i),e.base=t.slice(1,l)):(e.name=t.slice(a,i),e.base=t.slice(a,l)),e.ext=t.slice(i,l)),a>0?e.dir=t.slice(0,a-1):n&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};G.posix=G;var j=G,an=sn(j);class ln{constructor(){this.urlReg=/^http[s]?:\/\/[^\s]*/,this.cache=new Map,this.devPackages=new Map,this.pluginCache=new Map,this.pluginCodes=[],this.predefinedPlugins=new Map}registerPredefinedPlugin(t){this.predefinedPlugins.set(t.name,t)}register(t){this.pluginCodes.forEach(e=>{t.use(e)})}async loadPredefinedPlugin(t){if(this.predefinedPlugins.has(t)){const e=this.predefinedPlugins.get(t);e&&await this.loadPluginRef(e.name,e.path)}}setPluginCode(t){this.pluginCodes.push(t),window.vueInstances.forEach(e=>{e.use(t)})}setDevPlugin(t,e){this.devPackages.set(t,e)}async loadPlugin(t){if(t.runtimeObject===!0){const e=t;if(e)try{await this.loadPluginRef(e.rtobjectName,e.rtobjectRepo)}catch{throw new I(e,"\u914D\u7F6E\u52A0\u8F7D\u5931\u8D25")}}return!1}async loadPluginRef(t,e){if(this.pluginCache.has(t))return!0;let s=null;const n=this.devPackages.get(t);if(n)s=await n();else{const i=e,a=this.urlReg.test(i)?`${i}/package.json`:`${ibiz.env.pluginBaseUrl}/${j.join(i,"package.json")}`,l=await ibiz.net.axios({method:"get",headers:{"Access-Control-Allow-Origin":"*"},url:a});if(l.status!==200)throw new Error("\u914D\u7F6E\u52A0\u8F7D\u5931\u8D25");s=l.data}const o=new ge(t,e,s);if(o)try{return await this.loadScript(o),this.pluginCache.set(t,o),!0}catch(i){ibiz.log.error(i)}return!1}async loadScript(t){const e=t.repo,{name:s,version:n,system:o,module:i,styles:a}=t.config;let l="";if(this.devPackages.has(s)?l=j.join(`${s}@${n}`,i):ibiz.env.dev?l=this.urlReg.test(e)?`${e}/${j.join(i)}`:`${ibiz.env.pluginBaseUrl}/${e}/${j.join(i)}`:l=j.join(e,o),l){if(this.cache.has(l))return;let c=null;const f=this.parseUrl(l),p=(typeof a=="string"?[a]:a).map(D=>this.parseUrl(an.join(e,D)));if(this.devPackages.has(s)){const U=await this.devPackages.get(s)();this.setPluginCode(U.default),this.cache.set(l,!0)}else ibiz.env.dev?c=await hr.import(l):(System.addImportMap({imports:{[s]:f},styles:{[s]:p}}),c=await System.import(s));if(c){if(c.default)this.setPluginCode(c.default);else throw new F("\u8FDC\u7A0B\u63D2\u4EF6\u52A0\u8F7D\u5931\u8D25, \u8FDC\u7A0B\u63D2\u4EF6\u672A\u627E\u5230[default]\u9ED8\u8BA4\u5BFC\u51FA");this.cache.set(l,!0)}else throw new F("\u8FDC\u7A0B\u63D2\u4EF6\u52A0\u8F7D\u5931\u8D25, \u672A\u627E\u5230\u6587\u4EF6\u6216\u6587\u4EF6\u5185\u5BB9\u683C\u5F0F\u4E0D\u6B63\u786E")}}parseUrl(t){if(this.urlReg.test(t))return t;let e="";this.urlReg.test(ibiz.env.pluginBaseUrl)?t.startsWith("/")?e=ibiz.env.pluginBaseUrl+t:e=`${ibiz.env.pluginBaseUrl}/${t}`:e=`${j.join(ibiz.env.pluginBaseUrl,t)}`;const{origin:s,pathname:n}=window.location;return n.endsWith("/")&&e.startsWith("/")&&(e=e.substring(1)),e=`${s}${n}${e}`,e}}h("PluginFactory",ln);class $t{constructor(t,e,s){this.required=!0,e&&(this.default=e),s&&(this.validator=s),this.type=t}}h("RequiredProp",$t);function g(){return{value:String,controller:new $t(Object),data:new $t(Object),disabled:{type:Boolean},readonly:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1}}}function un(){return{change:(r,t)=>!0,blur:r=>!0,focus:r=>!0,enter:r=>!0}}function cn(){return{change:(r,t)=>!0,rowSave:()=>!0}}function v(){return{hasError:{type:Boolean}}}function je(){return{...g(),value:[String,Number]}}function dn(){return{...je(),...v()}}function Me(){return{...g(),value:Number}}function hn(){return{...Me(),...v()}}function $e(){return{...g(),value:String}}function pn(){return{...$e(),...v()}}function Ge(){return{...g(),value:[String,Number,Object,Array]}}function fn(){return{...Ge(),...v()}}function Ue(){return{...g(),value:[String,Number]}}function mn(){return{...Ue(),...v()}}function We(){return{...g(),value:[String,Number]}}function gn(){return{...We(),...v()}}function qe(){return{...g(),value:[String,Number]}}function vn(){return{...qe(),...v()}}function Ke(){return{...g(),value:[String,Array,Object,Number]}}function Cn(){return{...Ke(),...v()}}function He(){return{...g(),value:[String,Number]}}function Pn(){return{...He(),...v()}}function Xe(){return{...g(),value:[String,Number]}}function yn(){return{...Xe(),...v()}}function Je(){return{...g(),value:[String,Number]}}function wn(){return{...Je(),...v()}}function Ye(){return{...g(),value:[String,Number]}}function Dn(){return{...Ye(),...v()}}function Qe(){return{...g(),value:[String,Number]}}function bn(){return{...Qe(),...v()}}function Ze(){return{...g(),value:[String,Number]}}function En(){return{...Ze(),...v()}}function tr(){return{...g(),value:[String,Number,Array]}}function In(){return{...tr(),...v()}}function er(){return{...g(),value:[String,Number]}}function An(){return{...er(),...v()}}function rr(){return{...g(),value:[String,Number]}}function Nn(){return{...rr(),...v()}}function nr(){return{...g(),value:[String,Number]}}function Sn(){return{...nr(),...v()}}function sr(){return{...g(),value:String}}function Rn(){return{...sr(),...v()}}function or(){return{...g(),value:[String,Number]}}function Bn(){return{...or(),...v()}}function ir(){return{...g(),value:String,language:{type:String},theme:{type:String}}}function On(){return{...ir(),...v()}}function ar(){return{...g(),value:String}}function zn(){return{...ar(),...v()}}function lr(){return{...g(),data:{type:Object,required:!1},controller:{type:Object,required:!1},disabled:{type:Boolean,required:!1}}}function Fn(){return{...lr(),...v()}}function ur(){return{...g(),value:[Array,Array]}}function _n(){return{...ur(),...v()}}function cr(){return{...g(),value:String}}function xn(){return{...cr(),...v()}}function dr(){return{...g(),value:String}}function Tn(){return{...dr(),...v()}}}}});
2
2
  //# sourceMappingURL=index.system.min.js.map