@ibiz-template/vue3-util 0.5.3-beta.6 → 0.5.3-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/es/common/view-shell/view-shell.d.ts.map +1 -1
- package/es/common/view-shell/view-shell.mjs +58 -35
- package/es/util/store/async-action/async-action.d.ts.map +1 -1
- package/es/util/store/async-action/async-action.mjs +1 -1
- package/package.json +4 -4
- package/src/common/view-shell/view-shell.tsx +79 -39
- package/src/util/store/async-action/async-action.ts +2 -1
package/dist/index.min.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-control-shell{position:relative;width:100%;height:100%}.ibiz-
|
|
1
|
+
.ibiz-control-shell{position:relative;width:100%;height:100%}.ibiz-code-list__item{display:flex;align-items:center;color:var(--ibiz-code-list-item-color);display:flex;align-items:center;justify-content:flex-start}.ibiz-code-list .ibiz-icon{display:inline-flex;padding-right:var(--ibiz-spacing-tight)}.ibiz-view-shell{position:relative;width:100%;height:100%}.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-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-panel-container-image{position:relative;width:100%;height:100%;background-repeat:no-repeat;background-position:center center}.ibiz-panel-container-image>.ibiz-row{height:100%;overflow-x:hidden;overflow-y:auto}.ibiz-panel-container-image.is-hidden{display:none}.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-multi-data-container{width:100%;height:100%}.ibiz-single-data-container{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-container-group{--ibiz-panel-container-group-bg-color:transparent;--ibiz-panel-container-group-header-bg-color:transparent;--ibiz-panel-container-group-header-padding:var(--ibiz-spacing-base-tight);--ibiz-panel-container-group-header-border-color:var(--ibiz-color-border);--ibiz-panel-container-group-header-height:49px;--ibiz-panel-container-group-caption-text-color:var(--ibiz-color-text-0);--ibiz-panel-container-group-caption-font-size:var(--ibiz-font-size-header-5);--ibiz-panel-container-group-caption-font-weight:var(--ibiz-font-weight-bold);--ibiz-panel-container-group-content-bg-color:transparent;--ibiz-panel-container-group-content-padding:var(--ibiz-spacing-tight)}.ibiz-panel-container-group{height:100%;background-color:var(--ibiz-panel-container-group-bg-color);border-radius:var(--ibiz-border-radius-base)}.ibiz-panel-container-group__caption{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--ibiz-panel-container-group-caption-font-size);font-weight:var(--ibiz-panel-container-group-caption-font-weight);color:var(--ibiz-panel-container-group-caption-text-color)}.ibiz-panel-container-group-collapse>.ibiz-panel-container-group-content{display:block}.ibiz-panel-container-group-collapse.is-collapse>.ibiz-panel-container-group-content{display:none}.ibiz-panel-container-group-header{display:flex;height:var(--ibiz-panel-container-group-header-height);padding:var(--ibiz-panel-container-group-header-padding);margin:var(--ibiz-panel-container-group-header-margin);border-bottom:1px solid var(--ibiz-panel-container-group-header-border-color)}.ibiz-panel-container-group-header__left,.ibiz-panel-container-group-header__right{display:inline-block;width:50%}.ibiz-panel-container-group-header__right{text-align:right;display:flex;align-items:center;justify-content:flex-end}.ibiz-panel-container-group-content{width:100%;height:100%}.ibiz-panel-container-group-content>.ibiz-row{width:100%;height:100%}.ibiz-panel-container-group--show-header>.ibiz-panel-container-group-content{height:calc(100% - var(--ibiz-panel-container-group-header-height));padding:var(--ibiz-panel-container-group-content-padding);background-color:var(--ibiz-panel-container-group-content-bg-color)}.ibiz-control-panel{width:100%;height:100%}.ibiz-control-panel-content{width:100%;height:100%}.ibiz-control-viewlayoutpanel{width:100%;height:100%}.ibiz-control-viewlayoutpanel-content{width:100%;height:100%}
|
package/dist/index.system.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["vue","@ibiz-template/core","ramda","qx-util","vue-router","qs","@ibiz-template/runtime","pinia","dayjs","lodash-es"],(function(t){"use strict";var e,n,o,a,s,r,i,l,c,u,d,h,p,m,f,v,g,y,w,C,b,I,P,D,N,E,O,A,x,R,S,z,B,T,j,V,L,M,k,_,G,W,q,$,F,U,K,H,X,Q,Y,J,Z,tt,et,nt,ot,at,st,rt,it,lt,ct,ut,dt,ht,pt,mt,ft,vt,gt,yt,wt,Ct,bt,It,Pt,Dt,Nt,Et,Ot,At;return{setters:[function(t){e=t.watch,n=t.onBeforeUnmount,o=t.createCommentVNode,a=t.getCurrentInstance,s=t.isReactive,r=t.toRaw,i=t.inject,l=t.reactive,c=t.onActivated,u=t.onDeactivated,d=t.ref,h=t.h,p=t.resolveComponent,m=t.computed,f=t.onUnmounted,v=t.provide,g=t.defineComponent,y=t.createVNode,w=t.withDirectives,C=t.resolveDirective,b=t.isVNode,I=t.onMounted,P=t.createTextVNode},function(t){D=t.onClickOutside,N=t.NOOP,E=t.listenJSEvent,O=t.Namespace,A=t.RuntimeError,x=t.isBase64Image,R=t.isSvg,S=t.ModelError,z=t.RuntimeModelError,B=t.IBizContext},function(t){T=t.isNil,j=t.isNotNil,V=t.isEmpty,L=t.mergeLeft},function(t){M=t.isFunc,k=t.notNilEmpty,_=t.QXEvent,G=t.clearAll,W=t.createUUID},function(t){q=t.useRoute,$=t.useRouter},function(t){F=t.default},function(t){U=t.ViewType,K=t.getMatchResPath,H=t.calcDeCodeNameById,X=t.getControlProvider,Q=t.convertNavData,Y=t.getControl,J=t.getViewProvider,Z=t.PanelItemState,tt=t.PanelItemController,et=t.registerPanelItemProvider,nt=t.Modal,ot=t.ViewMode,at=t.OpenAppViewCommand,st=t.getEditorProvider,rt=t.PanelItemEventName,it=t.getAllPanelField,lt=t.isDataContainer,ct=t.getPanelItemProvider,ut=t.PanelData,dt=t.PanelNotifyState,ht=t.execDELogicById,pt=t.ScriptFactory,mt=t.toLocalOpenWFRedirectView,ft=t.ViewController,vt=t.getControlsByView,gt=t.registerViewProvider,yt=t.getDERedirectToView,wt=t.ViewLayoutPanelController,Ct=t.registerControlProvider,bt=t.ControlType,It=t.PanelController,Pt=t.RemotePluginItem},function(t){Dt=t.defineStore,Nt=t.createPinia},function(t){Et=t.default},function(t){Ot=t.isNumber,At=t.isNil}],execute:function(){function xt(t,o,a={}){let s=N,r=N,i=N;const l=()=>{s(),s=N,r=N,i=N};return e(t,((t,e)=>{if(t!==e)if(T(t))l();else{const e=D((null==t?void 0:t.$el)||t,o,a);s=e.stop,r=e.pause,i=e.proceed}}),{immediate:!0}),n((()=>{s!==N&&l()})),{stop:()=>s(),pause:()=>r(),proceed:()=>i()}}function Rt(){return a().proxy.$props}function St(t){return s(t)?r(t):t}function zt(){const t=a().proxy;return e=>{t.$forceUpdate(),e&&M(e)&&t.$nextTick((()=>{e()}))}}t({calcResRoutePath:Wt,createOverlayView:Kt,generateRoutePath:async function(t,e,n,o){const a=Mt(e);let s=n.srfdefaulttoroutedepth||2;n.toRouteDepth?(s=n.toRouteDepth,n.toRouteDepth=void 0):ibiz.env.isMob&&(a.pathNodes[0]={viewName:"home"});if(a.pathNodes.splice(s-1,a.pathNodes.length-s+1),n.currentSrfNav){const t=a.pathNodes[a.pathNodes.length-1];t.params=t.params||{},t.srfnav=n.currentSrfNav,n.currentSrfNav=void 0}e.fullPath.startsWith("/appredirectview")&&((null==o?void 0:o.srfindexname)?(a.pathNodes[0].viewName=o.srfindexname,delete o.srfindexname):a.pathNodes[0].viewName="index");if(a.pathNodes.push({viewName:t.codeName.toLowerCase(),context:_t(n),params:o}),2===s&&(await Wt(a,n,t.appDataEntityId,t.appId),Gt.includes(t.viewType))){const e=H(t.appDataEntityId);delete a.pathNodes[0].context[e]}return{path:kt(a)}},getArrayProps:Kn,getAutoCompleteProps:qn,getCascaderProps:Hn,getCheckboxListProps:xn,getCheckboxProps:Rn,getCodeProps:$n,getColorPickerProps:Xn,getDataPickerProps:Sn,getDatePickerProps:zn,getDateRangeProps:Bn,getDrawerPlacement:function(t){return Ht[t]||"right"},getDropdownProps:An,getEditorEmits:function(){return{change:(t,e)=>!0,blur:t=>!0,focus:t=>!0,enter:t=>!0,infoTextChange:t=>!0}},getEditorProps:In,getGridArrayProps:function(){return{...Kn(),...Pn()}},getGridAutoCompleteProps:function(){return{...qn(),...Pn()}},getGridCascaderProps:function(){return{...Hn(),...Pn()}},getGridCheckboxListProps:function(){return{...xn(),...Pn()}},getGridCheckboxProps:function(){return{...Rn(),...Pn()}},getGridCodeProps:function(){return{...$n(),...Pn()}},getGridColorPickerProps:function(){return{...Xn(),...Pn()}},getGridDataPickerProps:function(){return{...Sn(),...Pn()}},getGridDatePickerProps:function(){return{...zn(),...Pn()}},getGridDateRangeProps:function(){return{...Bn(),...Pn()}},getGridDropdownProps:function(){return{...An(),...Pn()}},getGridEditorCommonProps:Pn,getGridEditorEmits:function(){return{change:(t,e)=>!0,rowSave:()=>!0}},getGridHtmlProps:function(){return{...Fn(),...Pn()}},getGridInputIpProps:function(){return{...En(),...Pn()}},getGridInputNumberProps:function(){return{...Nn(),...Pn()}},getGridInputProps:function(){return{...Dn(),...Pn()}},getGridListBoxProps:function(){return{...Tn(),...Pn()}},getGridMarkDownProps:function(){return{...Un(),...Pn()}},getGridNumberRangeProps:function(){return{...jn(),...Pn()}},getGridRadioProps:function(){return{...Vn(),...Pn()}},getGridRateProps:function(){return{...Ln(),...Pn()}},getGridRawProps:function(){return{...Mn(),...Pn()}},getGridSliderProps:function(){return{...kn(),...Pn()}},getGridSpanProps:function(){return{...On(),...Pn()}},getGridStepperProps:function(){return{..._n(),...Pn()}},getGridSwitchProps:function(){return{...Gn(),...Pn()}},getGridUploadProps:function(){return{...Wn(),...Pn()}},getHtmlProps:Fn,getInputIpProps:En,getInputNumberProps:Nn,getInputProps:Dn,getListBoxProps:Tn,getMarkDownProps:Un,getNestedRoutePath:qt,getNumberRangeProps:jn,getOrigin:St,getOwnRouteContext:_t,getRadioProps:Vn,getRateProps:Ln,getRawProps:Mn,getSliderProps:kn,getSpanProps:On,getStepperProps:_n,getSwitchProps:Gn,getUploadProps:Wn,isEmptyVNode:function(t){if(!Array.isArray(t))return t===Bt;return 1===t.length&&t[0]===Bt},onRouteChange:function(t,n){const o=q();if(!o)throw new A("无法正确获取route,可能是依赖问题");e((()=>null==o?void 0:o.path),(()=>{const e=qt(o,n);t({currentKey:e,fullPath:o.fullPath})}),{immediate:!0})},openViewDrawer:async function(t,e){const n=ibiz.overlay.createDrawer(Kt(t),void 0,e);await n.present();return await n.onWillDismiss()||{ok:!1}},openViewFloatWindow:async function(t,e){const n=ibiz.overlay.createFloatWindow(Kt(t),void 0,e);n.present();return await n.onWillDismiss()||{ok:!1}},openViewModal:async function(t,e){const n=ibiz.overlay.createModal(Kt(t),void 0,e);n.present();return await n.onWillDismiss()||{ok:!1}},openViewPopover:async function(t,e,n){const o=ibiz.overlay.createPopover(Kt(e),void 0,n);o.present(t.target);return await o.onWillDismiss()||{ok:!1}},parseRouteViewData:async function(t,e){var n;const o=Mt(t);let a=o.pathNodes[e-1].viewName;if(!a)throw new A("第".concat(e,"级路由不存在视图标识"));"index"===a&&(a=ibiz.hub.defaultAppIndexViewName);const s=await ibiz.hub.getAppView(a);if(!s)throw new A("找不到视图".concat(a));const r={};(null==(n=ibiz.appData)?void 0:n.context)&&Object.assign(r,ibiz.appData.context);o.appContext&&Object.assign(r,o.appContext);if(1!==e)for(let t=0;t<e;t++){const e=o.pathNodes[t];k(e.context)&&Object.assign(r,e.context)}const{params:i,srfnav:l}=o.pathNodes[e-1];return{viewModel:s,context:r,params:i,srfnav:l}},prepareControl:function(t){const e=Lt("control"),{controlType:n,sysCss:o,codeName:a}=t.model,s=n.toLowerCase(),r=null==o?void 0:o.cssName,i=Lt("control-".concat(s)),l=[e.b(),e.b(s),e.m(a)];r&&l.push(r);return{controlClass:l,ns:i}},renderString:function(t){if(T(t))return"";if("string"==typeof t)return t;try{return t.toString()}catch(e){ibiz.log.error(t,"转换成字符串失败",e)}return""},route2routePath:Mt,routePath2string:kt,useClickOutside:xt,useControlController:jt,useController:function(t){t.force=zt()},useCtx:Tt,useEventListener:Vt,useFocusAndBlur:function(t,e){const n=d(),o=d(!1);let a;const s=()=>{o.value||ibiz.log.debug("没有聚焦,不触发失焦"),e(),a.stop(),o.value=!1};return Vt(n,"click",(e=>{o.value||(a=xt(n,(()=>{s()})),o.value=!0,t())}),{capture:!0}),{componentRef:n,isFocus:o,doBlur:s,pause:()=>{a&&a.pause()},stop:()=>{a&&a.stop()}}},useForce:zt,useForceTogether:function(t,e){const n=e.force,o=zt();e.force=t=>{n(t),o()}},useMobCtx:function(){return i("ctx")},useNamespace:Lt,useProps:Rt,usePropsWatch:function(t,n,o){const a=Rt();Object.prototype.hasOwnProperty.call(a,t)&&(e((()=>a[t]),((t,e)=>{n(St(t),St(e))}),o),n(St(a[t]),void 0))},useRouteKey:function(t,n,o){o||(o=d(""));o.value=t.value;const a=new $t(n);return e(t,((t,e)=>{t!==e&&a.nextChange((()=>{o.value=t}))})),o},useRouterQuery:function(){const t=q(),{query:e}=t;return e},useViewController:Yt});const Bt=t("EmptyVNode",o("EmptyVNode"));function Tt(){return i("ctx")}function jt(t,o){const s=Tt(),r=Rt();s.evt.emit("onForecast",r.modelData.name);const i=r.provider;let d;d=(null==i?void 0:i.createController)?i.createController(r.modelData,r.context,r.params,s):t(r.modelData,r.context,r.params,s),function(t,n){e((()=>({context:t.context,params:t.params})),(t=>{n.updateContextParams({...t}),ibiz.log.debug("".concat(n.model.id,"的上下文或视图参数变更:"),t)}))}(r,d),function(t,n,o=[]){const a=["context","params","modelData",...o];e((()=>{const e={};return Object.keys(t).forEach((n=>{a.includes(n)||(e[n]=t[n])})),e}),((t,e)=>{const o={};Object.keys(t).forEach((n=>{t[n]!==(e||{})[n]&&(o[n]=t[n])})),ibiz.log.debug("部件 [".concat(n.model.name,"] state 变更"),o),Object.keys(o).forEach((t=>{void 0!==o[t]&&(n.state[t]=o[t])}))}),{immediate:!0})}(r,d,null==o?void 0:o.excludePropsKeys),d.state=l(d.state),c((()=>d.onActivated())),u((()=>d.onDeactivated())),d.force=zt();const h=a().proxy;return d.evt.onAll(((t,e)=>{h.$emit(t.slice(2),e)})),h.$emit("controllerAppear",d),d.created(),n((()=>d.destroyed())),d}function Vt(t,o,a,s={}){let r=N;return e(t,((t,e)=>{t!==e&&(T(t)?(r(),r=N):r=E((null==t?void 0:t.$el)||t,o,a,s))}),{immediate:!0}),n((()=>{r!==N&&r()})),()=>{r()}}function Lt(t){return new O(t,ibiz.env.namespace)}function Mt(t){const e=t.matched.length,n=[];for(let o=1;o<=e;o++){const e=t.path.split("/")[2*o],a=t.params["params".concat(o)];let s,r,i;s=a&&a!==ibiz.env.routePlaceholder?F.parse(a,{strictNullHandling:!0,delimiter:";"}):void 0,s&&(1===o?(r=s,s=void 0):(s.srfnavctx&&(r=JSON.parse(decodeURIComponent(s.srfnavctx)),delete s.srfnavctx),s.srfnav&&(i=s.srfnav,delete s.srfnav))),n.push({viewName:e,context:r,params:s,srfnav:i})}let o;return t.params.appContext&&t.params.appContext!==ibiz.env.routePlaceholder&&(o=F.parse(t.params.appContext,{strictNullHandling:!0,delimiter:";"})),{appContext:o,pathNodes:n}}function kt(t){let e="";return t.appContext?e+="/".concat(F.stringify(t.appContext,{delimiter:";",strictNullHandling:!0})):e+="/".concat(ibiz.env.routePlaceholder),t.pathNodes.forEach(((t,n)=>{e+="/".concat(t.viewName,"/");let o={};if(0===n)k(t.context)&&(o=t.context);else{if(o=k(t.params)?t.params:{},k(t.context)){const e=JSON.stringify(t.context);"{}"!==e&&(o.srfnavctx=encodeURIComponent(e))}t.srfnav&&(o.srfnav=t.srfnav)}const a=F.stringify(o,{delimiter:";",strictNullHandling:!0,skipNulls:!0});k(a)?e+=a:e+=ibiz.env.routePlaceholder})),e}function _t(t){const e=t.getOwnContext(),n=["srfsessionid","srfappid","currentSrfNav","toRouteDepth"];return Object.keys(e).forEach((t=>{n.includes(t)&&delete e[t]})),e}const Gt=t("excludeViewTypes",[U.DE_GRID_VIEW,U.DE_GRID_EXP_VIEW,U.DE_LIST_VIEW,U.DE_LIST_EXP_VIEW,U.DE_DATA_VIEW,U.DE_DATAVIEW_EXP_VIEW,U.DE_CALENDAR_VIEW,U.DE_CALENDAR_EXP_VIEW,U.DE_CHART_VIEW,U.DE_CHART_EXP_VIEW,U.DE_KANBAN_VIEW]);async function Wt(t,e,n,o){if(n){const a=await ibiz.hub.getAppDataEntity(n,o);let s=K(e,a);if(s||(s={path:"",keys:[a.codeName.toLowerCase()]}),s){const n=t.pathNodes[1].context,o={};s.keys.forEach((t=>{e&&Object.prototype.hasOwnProperty.call(e,t)&&(o[t]=e[t],n&&delete n[t])})),t.pathNodes[0].context=o}}else t.pathNodes[0].context=void 0}function qt(t,e,n=!0){if(t.matched.length<e)return"";if(t.matched.length===e&&t.name)return t.path;const o=Mt(t);return o.pathNodes.length<e?t.path:(o.pathNodes.length>e&&(o.pathNodes=o.pathNodes.slice(0,e)),n&&delete o.pathNodes[e-1].srfnav,kt(o))}class $t{constructor(t,n){this.callbacks=[],this.timers=[],this.wait=500,n&&(this.wait=n),e((()=>t.path),((t,e)=>{if(t!==e){if(this.callbacks.length)for(let t=0;t<this.callbacks.length;t++){(0,this.callbacks[t])()}if(this.callbacks=[],this.timers.length)for(let t=0;t<this.timers.length;t++){const e=this.timers[t];clearTimeout(e)}this.timers=[]}}))}nextChange(t){t&&(this.timers.push(setTimeout((()=>{t();const e=this.callbacks.findIndex((e=>e===t));this.callbacks.splice(e,1)}),this.wait)),this.callbacks.push(t))}}t("RouteListener",$t);const Ft=t("withInstall",((t,e)=>(t.install=t=>{e(t)},t)));class Ut{constructor(t,e,n){this.component=t,this.render=e,this.opts=n,this.evt=new _,this.init()}static createVueApp(t,e){throw new A("没有注入createVueApp方法")}init(){const t=this,{render:e,opts:n}=this,o=document.createElement("div");document.body.appendChild(o);const a=Ut.createVueApp({mounted(){t.modal=this.$refs.root},unmounted(){document.body.removeChild(o),t.evt.emit("dismiss",t.result)},render:()=>h(t.component,{ref:"root",opts:n,onDismiss(e){t.result=e,a.unmount()}},{default:e})});ibiz.plugin.register(a),a.mount(o),this.vm=a}async present(){return this.modal.present()}async dismiss(t){this.modal.dismiss(t)}async onWillDismiss(){return new Promise((t=>{const e=n=>{t(n),this.evt.off("dismiss",e)};this.evt.on("dismiss",e)}))}}t("OverlayContainer",Ut);function Kt(t){return e=>{const n=p("IBizViewShell");return h(n,{...t,modal:e})}}t("OverlayPopoverContainer",class extends Ut{present(t){return this.modal.present(t)}});const Ht={DRAWER_LEFT:"left",DRAWER_RIGHT:"right",DRAWER_TOP:"top",DRAWER_BOTTOM:"bottom"};class Xt{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)}}t("routerCallback",new class{constructor(){this.map=new Map}async open(t,e){const n=t.currentRoute.value.fullPath;t.push({path:e});const o=e;if(this.map.has(o)){return this.map.get(o).onWillDismiss()}const a=new Xt(n,o);return this.map.set(o,a),this.scheduledDestruction(a),a.onWillDismiss()}close(t,e){const n=this.map.get(t);n&&(n.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)}),1e4)}});function Qt(t){if(["begintime","endtime","createdate","updatedate"].forEach((e=>{Ot(t[e])&&(t[e]=Et(t[e]).format("YYYY-MM-DD HH:mm:ss"))})),!At(t.actionresult))try{const e=JSON.parse(t.actionresult);t.actionresult=e}catch(t){}return t}t("useAppStore",Dt("appStore",(()=>{const{allAsyncActions:t,recentAsyncActions:e}=function(){const t=d([]),e=d(0),n=m((()=>t.value.filter(((t,n)=>n<e.value)))),o=n=>{if(!n.data||"ASYNCACTION"!==n.subtype)return;const o=Qt(n.data),a=t.value.findIndex((t=>t.asyncacitonid===o.asyncacitonid));-1!==a?(t.value.unshift(o),e.value+=1):a>=e.value?(t.value.splice(a,1),t.value.unshift(o),e.value+=1):t.value.splice(a,1,o)};return(async()=>{const e=await ibiz.asyncAction.fetch();e.data.forEach(Qt),t.value=e.data})(),ibiz.mc.command.asyncAction.on(o),f((()=>{ibiz.mc.command.asyncAction.off(o)})),{allAsyncActions:t,recentAsyncActions:n}}();return{appStore:l({allAsyncActions:t,get recentAsyncActions(){return e.value}})}})));t("useUIStore",Dt("uiStore",(()=>{const t=function(){const t=d(500);return{zIndex:t,increment:function(){return t.value+=1,t.value},decrement:function(){t.value-=1}}}();return{UIStore:l({zIndex:t.zIndex,theme:"light"}),zIndex:t}}))),t("piniaInstance",Nt());function Yt(t){const o=Rt(),s=i("ctx",void 0);null==s||s.evt.emit("onForecast",o.modelData.name);const r=o.provider;let d;d=(null==r?void 0:r.createController)?r.createController(o.modelData,o.context,o.params,s):t(o.modelData,o.context,o.params,s),function(t,n){e((()=>({context:t.context,params:t.params})),(t=>{n.context.reset({},t.context),G(n.params),Object.assign(n.params,t.params),n.handleContextParams(),ibiz.log.debug("".concat(n.model.id,"的上下文或视图参数变更:"),t)}))}(o,d),function(t,n){e((()=>t.state?{...t.state}:{}),((t,e)=>{const o={};Object.keys(t).forEach((n=>{t[n]!==(e||{})[n]&&(o[n]=t[n])})),ibiz.log.debug("视图 [".concat(n.model.name,"] state 变更"),o),Object.keys(o).forEach((t=>{n.state[t]=o[t]}))}),{immediate:!0})}(o,d),v("ctx",d.ctx),d.state=l(d.state),d.slotProps=l(d.slotProps),o.modal&&(d.modal=o.modal),c((()=>d.onActivated())),u((()=>d.onDeactivated())),d.force=zt();const h=a().proxy;return d.evt.onAll(((t,e)=>{h.$emit(t.slice(2),e)})),d.created(),n((()=>d.destroyed())),d}t("IBizIcon",g({name:"IBizIcon",props:{icon:{type:Object},size:{type:String},baseDir:{type:String,default:"images"}},setup(t){const e=Lt("icon"),n="".concat(ibiz.env.assetsUrl,"/").concat(t.baseDir,"/");const o=m((()=>function(t){if(t){if(t.htmlStr)return y("span",{class:e.b(),innerHTML:t.htmlStr},null);if(t.cssClass)return-1!==t.cssClass.indexOf("fa-")?y("i",{class:[e.b(),t.cssClass]},null):y("ion-icon",{class:e.b(),name:t.cssClass},null);if(t.imagePath)return x(t.imagePath)?y("img",{class:e.b(),src:t.imagePath},null):R(t.imagePath)?y("div",{class:e.b(),innerHTML:t.imagePath},null):t.imagePath.endsWith("svg")?t.imagePath.startsWith("http")?y("img",{class:e.b(),src:t.imagePath},null):y("ion-icon",{src:n+t.imagePath,class:e.b()},null):t.imagePath.startsWith("http")?y("img",{class:e.b(),src:t.imagePath},null):y("img",{class:e.b(),src:n+t.imagePath},null);if(t.rawContent)return R(t.rawContent)?y("div",{class:e.b(),innerHTML:t.rawContent},null):y("img",{class:e.b(),src:t.rawContent},null)}return null}(t.icon)));return()=>o.value}})),t("IBizRouterView",g({name:"IBizRouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object,manualKey:{type:String}},setup(t,{attrs:n}){const o={};let a=!0;e((()=>t.manualKey),((t,e)=>{j(t)&&t!==e&&(a=!0)}));return{renderComp:(e,s)=>{if(!a)return o.vNode;if(a=!1,e){const a={...e.props};delete a.onVnodeUnmounted,delete a.ref;const s=h(e.type,{...a,...n,key:t.manualKey});return o.vNode=s,s}}}},render(){return y(p("router-view"),{name:this.name,route:this.route},{default:({Component:t,route:e})=>{const n=this.renderComp(t,e);return this.$slots.default?this.$slots.default({Component:n,route:e}):n}})}})),t("IBizControlBase",g({name:"IBizControlBase",props:{controller:{type:Object,required:!0}},setup(t){const e=Lt("control"),{controlType:n,sysCss:o,codeName:a}=t.controller.model,s=n.toLowerCase(),r=null==o?void 0:o.cssName,i=t.controller.model,c=t.controller.model.controls,u=l({});return!1===i.controlType.endsWith("EXPBAR")&&(T(i.width)||(u.width="".concat(i.width,"px")),T(i.height)||(u.height="".concat(i.height,"px"))),{ns:e,typeClass:s,sysCssName:r,inlineStyle:u,codeName:a,controls:c,onLayoutPanelCreated:e=>{t.controller.setLayoutPanel(e)}}},render(){var t,e,n;const{state:o,controlPanel:a,providers:s}=this.controller;let r=null;if(o.isCreated&&a){const e={...this.$slots};(null==(t=this.controls)?void 0:t.length)&&this.controls.forEach((t=>{const n=t.name,o={context:this.controller.context,params:this.controller.params},a=e[n];e[n]=a?()=>a(o):()=>{const e=p("IBizControlShell");return h(e,{modelData:t,...o})}}));const n=s[a.name];r=h(p(n.component),{modelData:a,context:this.controller.context,params:this.controller.params,provider:n,container:this.controller,onControllerAppear:this.onLayoutPanelCreated},e)}return y("div",{class:[this.ns.b(),this.ns.b(this.typeClass),this.ns.m(this.codeName),this.sysCssName],style:this.inlineStyle},[r||(null==(n=(e=this.$slots).default)?void 0:n.call(e))])}})),t("IBizControlShell",g({name:"IBizControlShell",props:{modelData:{type:Object,required:!0}},setup(t){i("ctx").evt.emit("onForecast",t.modelData.name);const e=d(!1),n=d(""),o=d();X(t.modelData).then((t=>{t?o.value=t:n.value="未找到对应部件的适配器",e.value=!0})).catch((t=>{ibiz.log.error(t),n.value=t.message,e.value=!0}));return{ns:Lt("control-shell"),isComplete:e,errMsg:n,provider:o}},render(){return this.isComplete&&this.provider?h(p(this.provider.component),{provider:this.provider,...this.$props,...this.$attrs},this.$slots):w(y("div",{class:this.ns.b()},[this.isComplete?this.errMsg:null]),[[C("loading"),!this.isComplete]])}})),t("IBizViewShell",g({name:"IBizViewShell",props:{context:{type:Object,required:!0},params:{type:Object},modelData:{type:Object},viewId:{type:String}},setup(t){const e=Lt("view-shell"),n=d(!1),o=d(""),a=d(),s=d();return(async()=>{let e;if(e=t.modelData?t.modelData:await ibiz.hub.getAppView(t.viewId),!e)throw new A("未找到视图模型");if(1===e.dynaSysMode){const n=e.appViewNavContexts;let o={};k(n)&&(o=Q(n,t.params||{},t.context));const a=e.appViewNavParams;let r={};k(a)&&(r=Q(a,t.params||{},t.context));const{xdataControlName:i}=e;if(i){const n=Y(e,i);if(!n)throw new A("未找到数据控件");{const e=H(n.appDataEntityId);if(o[e]||t.context[e]){const e=W();if(T(t.context.srfsessionid)||V(t.context.srfsessionid)){const t=ibiz.uiDomainManager.create(e);o.srfsessionid=t.id}const a=ibiz.hub.getApp(n.appId),s=await a.deService.getService(t.context,n.appDataEntityId),i=await s.get({...t.context,...o,srfsessionid:e},t.params||{});if(i.ok&&i.data){const{data:t}=i,{srfwftag:e}=t;e&&(r.srfwftag=e)}ibiz.uiDomainManager.destroy(e)}}}s.value=await ibiz.hub.loadAppView(e.appId,e.id,{...t.context,...o,...r})}else s.value=e;try{a.value=await J(e)}catch(t){ibiz.log.error(t),o.value=t.message}finally{n.value=!0}})(),{ns:e,isComplete:n,errMsg:o,viewModelData:s,provider:a}},render(){return this.isComplete&&this.provider?h(p(this.provider.component),{context:this.$props.context,params:this.$props.params,modelData:this.viewModelData,...this.$attrs,provider:this.provider},this.$slots):w(y("div",{class:this.ns.b()},[this.isComplete?this.errMsg:null]),[[C("loading"),!this.isComplete]])}})),t("IBizCodeList",g({name:"IBizCodeList",props:{codeListItems:{type:Array},codeList:{type:Object,required:!0},value:{type:[String,Number]}},emits:{infoTextChange:t=>!0},setup(t,{emit:n}){var o,a;const s=Lt("code-list"),r=d([]),i=(null==(o=t.codeList)?void 0:o.textSeparator)||"、",l=(null==(a=t.codeList)?void 0:a.valueSeparator)||",";e(r,(t=>{let e="";t.length>0&&(e=t.map((t=>t.text)).join(i)),n("infoTextChange",e)}));const c=(t,e)=>{if(t){const n=t.find((t=>t.value==e));if(n)return n;for(let n=0;n<t.length;n++){const o=c(t[n].children,e);if(o)return o}}};e((()=>t.value),((e,n)=>{if(e!==n)if(T(e)||""===e)r.value=[];else{let n;n="string"==typeof e?e.split(l):[e],r.value=n.map((e=>{const n=c(t.codeListItems,e);return{text:(null==n?void 0:n.text)||e,color:null==n?void 0:n.color,textCls:null==n?void 0:n.textCls,sysImage:null==n?void 0:n.sysImage}}))}}),{immediate:!0});const u="未定义"===t.codeList.emptyText?"- - -":t.codeList.emptyText;return{items:r,ns:s,emptyText:u,textSeparator:i}},render(){return y("span",{class:this.ns.b()},[0===this.items.length?this.emptyText:this.items.map(((t,e)=>[0!==e?this.textSeparator:null,y("span",{class:[this.ns.e("item"),t.textCls?t.textCls:null],style:t.color?this.ns.cssVarBlock({"item-color":"".concat(t.color)}):null},[t.sysImage&&y(p("iBizIcon"),{icon:t.sysImage},null),t.text])]))])}})),t("ControlLoadingPlaceholder",g({name:"ControlLoadingPlaceholder",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})}},setup:t=>(i("ctx").evt.emit("onForecast",t.modelData.name),{}),render:()=>null}));class Jt extends Z{}t("PanelContainerState",Jt);class Zt extends tt{createState(){var t;return new Jt(null==(t=this.parent)?void 0:t.state)}}function te(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)}t("PanelContainerController",Zt);const ee=g({name:"IBizPanelContainer",props:{modelData:{type:Object,required:!0},controller:{type:Zt,required:!0}},setup(t){const e=Lt("panel-container"),{id:n}=t.modelData,o=m((()=>{let o=[e.b(),e.m(n)];return o=[...o,...t.controller.containerClass,e.is("hidden",!t.controller.state.visible)],o}));return{ns:e,classArr:o}},render(){var t,e;let n;const o=(null==(e=(t=this.$slots).default)?void 0:e.call(t))||[],a=y(p("iBizRow"),{slot:"content",layout:this.modelData.layout},te(n=o.map((t=>{const e=t.props;return e&&e.controller?y(p("iBizCol"),{layoutPos:e.modelData.layoutPos,state:e.controller.state},te(t)?t:{default:()=>[t]}):t})))?n:{default:()=>[n]});return y("div",{class:this.classArr,onClick:()=>{this.controller.onClick()}},[this.controller.model.cssStyle?y("style",{type:"text/css"},[this.controller.model.cssStyle]):null,a])}});class ne{constructor(){this.component="IBizPanelContainer"}async createController(t,e,n){const o=new Zt(t,e,n);return await o.init(),o}}t("IBizPanelContainer",Ft(ee,(function(t){t.component(ee.name,ee),et("CONTAINER",(()=>new ne)),et("CONTAINER_DEFAULT",(()=>new ne))})));const oe=g({name:"IBizPanelCtrlPos",props:{modelData:{type:Object,required:!0},controller:{type:Object,required:!0}},setup(t){i("ctx").evt.on("onRegister",((e,n)=>{e===t.modelData.id&&t.controller.bindControl(n)}));return{ns:Lt("panel-ctrl-pos")}},render(){const{state:t}=this.controller;let e;return this.$slots.default&&(e=this.$slots.default()),y("div",{class:[this.ns.b(),this.ns.m(this.modelData.id),...this.controller.containerClass,this.ns.is("hidden",!t.visible)]},[e||(ibiz.env.dev?"未提供".concat(this.modelData.id,"插槽"):"")])}});class ae extends tt{bindControl(t){this.control=t,t.evt.onAll(((t,e)=>{this.panel.evt.emit("onControlEvent",{triggerControlName:this.model.id,triggerEventName:t,triggerEvent:e})}))}}t("PanelCtrlPosController",ae);class se{constructor(){this.component="IBizPanelCtrlPos"}async createController(t,e,n){const o=new ae(t,e,n);return await o.init(),o}}t("IBizPanelCtrlPos",Ft(oe,(function(t){t.component(oe.name,oe),et("CTRLPOS",(()=>new se))})));class re extends tt{}function ie(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)}t("ScrollContainerItemController",re);const le=t("ScrollContainerItem",g({name:"IBizScrollContainerItem",props:{modelData:{type:Object,required:!0},controller:{type:re,required:!0}},setup(t){const e=Lt("scroll-container-item"),{id:n}=t.modelData,o=m((()=>[e.b(),e.m(n),e.is("hidden",!t.controller.state.visible)]));return{ns:e,classArr:o}},render(){var t,e;let n;const o=(null==(e=(t=this.$slots).default)?void 0:e.call(t))||[];return y(p("iBizRow"),{class:this.classArr,layout:{layout:"FLEX"}},ie(n=o.map((t=>{const e=t.props;return e&&e.controller?(e.modelData.layoutPos.layout="FLEX",y(p("iBizCol"),{layoutPos:e.modelData.layoutPos,state:e.controller.state},ie(t)?t:{default:()=>[t]})):t})))?n:{default:()=>[n]})}}));class ce{constructor(){this.component="IBizScrollContainerItem"}async createController(t,e,n){const o=new re(t,e,n);return await o.init(),o}}class ue extends tt{async onInit(){await super.onInit(),this.state.layout.width="100%",this.state.layout.height="100%"}}t("ScrollContainerController",ue);const de=t("ScrollContainer",g({name:"IBizScrollContainer",props:{modelData:{type:Object,required:!0},controller:{type:ue,required:!0}},setup(t){const e=Lt("scroll-container"),{id:n}=t.modelData,o=m((()=>[e.b(),e.m(n),...t.controller.containerClass,e.is("hidden",!t.controller.state.visible)]));return{ns:e,classArr:o}},render(){var t,e;let n=null,o=null,a=null,s=null,r=null;const i={};((null==(e=(t=this.$slots).default)?void 0:e.call(t))||[]).forEach((t=>{const e=t.props;if(!e||!e.controller)return;const{width:l,height:c}=e.controller.state.layout;switch(e.modelData.layoutPos.layoutPos){case"WEST":n=t,i.left={width:l};break;case"EAST":a=t,i.right={width:l};break;case"NORTH":o=t,i.top={height:c};break;case"SOUTH":s=t,i.bottom={height:c};break;case"CENTER":r=t;break;default:ibiz.log.debug("未适配的布局占位".concat(e.modelData.layoutPos.layoutPos))}}));for(const t in i)(i[t].width||i[t].height)&&(i[t].flexShrink=0);return y("div",{class:this.classArr},[y("div",{class:[this.ns.e("header")],style:i.top},[o]),y("div",{class:[this.ns.b("content")]},[y("div",{class:this.ns.be("content","left"),style:i.left},[n]),y("div",{class:this.ns.be("content","center")},[r]),y("div",{class:this.ns.be("content","right"),style:i.right},[a])]),y("div",{class:[this.ns.e("footer")],style:i.bottom},[s])])}}));class he{constructor(){this.component="IBizScrollContainer"}async createController(t,e,n){const o=new ue(t,e,n);return await o.init(),o}}t("IBizScrollContainer",Ft(de,(function(t){t.component(de.name,de),t.component(le.name,le),et("CONTAINER_CONTAINER_SCROLL",(()=>new he)),et("CONTAINER_CONTAINER_SCROLL_LEFT",(()=>new ce)),et("CONTAINER_CONTAINER_SCROLL_HEADER",(()=>new ce)),et("CONTAINER_CONTAINER_SCROLL_RIGHT",(()=>new ce)),et("CONTAINER_CONTAINER_SCROLL_BOTTOM",(()=>new ce)),et("CONTAINER_CONTAINER_SCROLL_MAIN",(()=>new ce))})));class pe extends Z{constructor(){super(...arguments),this.cache=!0,this.routeOpen=!0,this.currentKey="",this.cacheKeys=["RouterShell"],this.navViewMsgs={}}}t("NavPosState",pe);const me=["is404","isRoutePushed"];class fe extends tt{constructor(){super(...arguments),this.viewModals={},this.refCtrlKeys=[],this.rawItemParams={}}get route(){return this.router.currentRoute.value}getExpItemIsCache(t){return"CACHE"===this.rawItemParams.expcache||"NO_CACHE"!==this.rawItemParams.expcache&&t.isCache}setRouter(t){this.router=t}async onInit(){var t;await super.onInit(),this.handleRawItemParams(),(null==(t=this.model.rawItem)?void 0:t.rawItemParams)&&this.model.rawItem.rawItemParams.find((t=>!("REFCTRL"!==t.key||!t.value)&&(this.refCtrlKeys=t.value.split(";").map((t=>t.toLowerCase())),!0))),this.panel.evt.on("onControlEvent",(t=>{if((0===this.refCtrlKeys.length||this.refCtrlKeys.includes(t.triggerControlName))&&"onNavViewChange"===t.triggerEventName){const e=t.triggerEvent;this.openView(e.navViewMsg)}}));const e=this.rawItemParams.expmode||this.panel.view.params.expmode;"ROUTE"===e&&this.routeDepth?this.state.routeOpen=!0:this.state.routeOpen="NO_ROUTE"!==e&&!!this.routeDepth,this.panel.view.params.expmode&&delete this.panel.view.params.expmode}createState(){var t;return new pe(null==(t=this.parent)?void 0:t.state)}get routeDepth(){return this.panel.view.modal.routeDepth}calcCacheKey(t){return t?"".concat(t.viewId,"___").concat(t.key):""}onRouteChange(t){if(this.curNavViewMsg){const e=this.calcCacheKey(this.curNavViewMsg);this.state.currentKey=e,this.state.navViewMsgs[e].fullPath=t.fullPath}}setNavViewMsgs(t){t.isRoutePushed=!0===t.isRoutePushed;const e=this.calcCacheKey(t);this.state.navViewMsgs[e]?(L(this.state.navViewMsgs[e],t),me.forEach((n=>{Object.prototype.hasOwnProperty.call(t,n)&&(this.state.navViewMsgs[e][n]=void 0)}))):(this.state.navViewMsgs[e]=t,this.getExpItemIsCache(t)&&this.state.cacheKeys.push(e),this.viewModals[e]=new nt({mode:this.routeDepth?ot.ROUTE:ot.EMBED,routeDepth:this.routeDepth?this.routeDepth+1:void 0,dismiss:()=>{this.dismiss(e)}})),this.curNavViewMsg=this.state.navViewMsgs[e]}dismiss(t){ibiz.log.debug(this.constructor.name,"dismiss",t)}onViewCreated(t){ibiz.log.debug(this.constructor.name,"onViewCreated",t)}toBlankRoute(){const t=qt(this.route,this.routeDepth);this.router.push(t)}openView(t){if(!t.key)return this.state.currentKey=this.calcCacheKey(t),void(this.routeDepth&&this.state.routeOpen&&this.toBlankRoute());this.routeDepth&&this.state.routeOpen?this.openViewByPath(t):this.openViewByModel(t)}openViewByPath(t){const e=this.calcCacheKey(t);this.setNavViewMsgs(t);if(!0===t.isRoutePushed)return this.state.currentKey=e,void(this.state.navViewMsgs[this.calcCacheKey(this.curNavViewMsg)].fullPath=this.route.fullPath);if(t.is404){const t=qt(this.route,this.routeDepth,!1);this.router.push("".concat(t,"/404"))}else if(this.state.navViewMsgs[e].fullPath&&this.getExpItemIsCache(t))this.router.push(this.state.navViewMsgs[e].fullPath);else{const n=Object.assign(t.context.clone(),{toRouteDepth:this.routeDepth+1});this.getExpItemIsCache(t)&&this.state.cacheKeys.push(e),ibiz.commands.execute(at.TAG,t.viewId,n,t.params,{openMode:"INDEXVIEWTAB"})}}openViewByModel(t){this.setNavViewMsgs(t),this.state.currentKey=this.calcCacheKey(t)}handleRawItemParams(){var t;let e={};const n=null==(t=this.model.rawItem)?void 0:t.rawItemParams;k(n)&&(e=n.reduce(((t,e)=>(t[e.key.toLowerCase()]=e.value,t)),{})),Object.assign(this.rawItemParams,e)}}function ve(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)}t("NavPosController",fe);const ge=g({name:"IBizNavPos",props:{modelData:{type:Object,required:!0},controller:{type:fe,required:!0}},setup(t){const n=t.controller,o=Lt("nav-pos"),a=$(),s=q();if(n.setRouter(a),n.routeDepth){const t=qt(s,n.routeDepth);e((()=>s.fullPath),(()=>{const e=qt(s,n.routeDepth);t===e&&s.matched.length>n.routeDepth&&n.onRouteChange(s)}),{immediate:!0})}return{ns:o,c:n,onViewCreated:t=>{n.onViewCreated(t)}}},render(){const{viewModals:t,state:e}=this.c,{currentKey:n,cacheKeys:o,navViewMsgs:a,cache:s}=e;let r=null;if(e.routeOpen)r=y(p("iBizRouterView"),{manualKey:n,modal:t[n],onCreated:this.onViewCreated},{default:({Component:t})=>{const e=""!==n&&t?y(t,null,null):null;return s?y(p("keepAlive"),{include:o,max:30,isKey:!0},ve(e)?e:{default:()=>[e]}):e}});else{const t=n?h(p("IBizViewShell"),{context:a[n].context,params:a[n].params,key:n,viewId:a[n].viewId,onCreated:this.onViewCreated}):null;r=s?y(p("keepAlive"),{include:o,max:30,isKey:!0},ve(t)?t:{default:()=>[t]}):t}return y("div",{class:[this.ns.b(),this.ns.m(this.modelData.id),...this.controller.containerClass]},[r])}});class ye{constructor(){this.component="IBizNavPos"}async createController(t,e,n){const o=new fe(t,e,n);return await o.init(),o}}t("IBizNavPos",Ft(ge,(function(t){t.component(ge.name,ge),et("RAWITEM_NAV_POS",(()=>new ye))})));class we extends Z{}class Ce extends tt{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 we(null==(t=this.parent)?void 0:t.state)}async onInit(){await super.onInit(),this.state.required=!this.model.allowEmpty,this.model.editor&&"HIDDEN"!==this.model.editor.editorType&&(this.editorProvider=await st(this.model.editor),this.editorProvider&&(this.editor=await this.editorProvider.createController(this.model.editor,this)))}async setDataValue(t,e){const{id:n}=this.model;e=e||n,this.dataParent.setDataValue&&await this.dataParent.setDataValue(e,t),this.panel.evt.emit("onPanelItemEvent",{panelItemName:this.model.id,panelItemEventName:rt.CHANGE})}onFocus(t){this.panel.evt.emit("onPanelItemEvent",{panelItemName:this.model.id,panelItemEventName:rt.FOCUS,event:t})}onBlur(t){this.panel.evt.emit("onPanelItemEvent",{panelItemName:this.model.id,panelItemEventName:rt.BLUR,event:t})}onEnter(t){this.panel.evt.emit("onPanelItemEvent",{panelItemName:this.model.id,panelItemEventName:rt.ENTER,event:t})}}t("PanelFieldController",Ce);const be=g({name:"IBizPanelField",props:{modelData:{type:Object,required:!0},controller:{type:Ce,required:!0}},setup(t){const e=Lt("panel-field"),n=m((()=>{const{id:n}=t.modelData,o=[e.b(),e.m(n)];return o.push(...t.controller.containerClass),o}));return{ns:e,classArr:n,onValueChange:(e,n)=>{t.controller.setDataValue(e,n)}}},render(){let t=null;if(this.controller.data){const e={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:t=>this.controller.onFocus(t),onBlur:t=>this.controller.onBlur(t),onEnter:t=>this.controller.onEnter(t)};if(this.$slots.default)t=this.$slots.default(e);else if(this.controller.editorProvider){const n=p(this.controller.editorProvider.formEditor);t=h(n,{...e})}else t=y(p("not-supported-editor"),{modelData:this.modelData.editor},null)}return y("div",{class:this.classArr,onClick:()=>{this.controller.onClick()}},[t])}});class Ie{constructor(){this.component="IBizPanelField"}async createController(t,e,n){const o=new Ce(t,e,n);return await o.init(),o}}t("IBizPanelField",Ft(be,(function(t){t.component(be.name,be),et("FIELD",(()=>new Ie))})));class Pe extends tt{get data(){return this.dataParent.data}async onInit(){await super.onInit()}}t("PanelRawItemController",Pe);const De=g({name:"IBizPanelRawItem",props:{modelData:{type:Object,required:!0},controller:{type:Pe,required:!0}},setup(t){const e=Lt("panel-rawitem"),n=m((()=>{const{id:n}=t.modelData,o=[e.b(),e.m(n)];return o.push(...t.controller.containerClass),o}));return{ns:e,classArr:n}},render(){if(this.controller.state.visible)return y("div",{class:this.classArr,onClick:()=>{this.controller.onClick()}},[y(p("iBizRawItem"),{rawItem:this.modelData},null)])}});class Ne{constructor(){this.component="IBizPanelRawItem"}async createController(t,e,n){const o=new Pe(t,e,n);return await o.init(),o}}t("IBizPanelRawItem",Ft(De,(function(t){t.component(De.name,De),et("RAWITEM",(()=>new Ne)),et("RAWITEM_STATIC_IMAGE",(()=>new Ne)),et("RAWITEM_STATIC_LABEL",(()=>new Ne)),et("RAWITEM_STATIC_TEXT",(()=>new Ne))})));class Ee extends Z{constructor(){super(...arguments),this.data={}}}class Oe{constructor(t,e,n,o){this.model=t,this.panel=e,this.parent=n,this.state=new Ee,this.isDataContainer=!0,this.panelItems={},this.state.data=o;const a=it(this.model).map((t=>t.id));o._evt.on("change",(t=>{a.includes(t)&&this.childDataChangeNotify([t])}))}get data(){return this.state.data}async init(){await this.initChildrenController()}async initChildrenController(t=this.model.panelItems,e=this.panel,n=this){t&&await Promise.all(t.map((async t=>{var o,a;const s=this.parent.providers[t.id];if(!s)return;const r=await s.createController(t,e,n);this.panelItems[t.id]=r,(null==(o=t.panelItems)?void 0:o.length)&&!lt(t)?await this.initChildrenController(t.panelItems,e,r):(null==(a=t.panelTabPages)?void 0:a.length)&&await this.initChildrenController(t.panelTabPages,e,r)})))}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;null==(e=(t=this.data).destroy)||e.call(t),Object.values(this.panelItems).forEach((t=>{t.destroy()}))}}class Ae extends Z{constructor(){super(...arguments),this.items=[]}}t("MultiDataContainerState",Ae);class xe extends tt{constructor(){super(...arguments),this.isDataContainer=!0,this.dataItems=[],this.providers={}}get data(){return this.state.items}createState(){var t;return new Ae(null==(t=this.parent)?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 t=>{var e,n;const o=await ct(t);o&&(this.providers[t.id]=o,(null==(e=t.panelItems)?void 0:e.length)&&!lt(t)&&await this.initPanelItemProviders(t.panelItems),(null==(n=t.panelTabPages)?void 0:n.length)&&await this.initPanelItemProviders(t.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 z(this.model,"没有配置数据对象名称");this.bindViewData(this.panel.getTopView(),e);break;case"VIEWSESSIONPARAM":if(!e)throw new z(this.model,"没有配置数据对象名称");this.bindViewData(this.panel.view,e);break;default:throw new S(this.model,"数据源类型".concat(t,"暂未支持"))}}childrenStateNotify(t){this.dataItems.forEach((e=>{e.panelStateNotify(t)}))}async setData(t){const e=it(this.model),n=t.map((t=>new ut(e,t)));this.dataItems=n.map((t=>new Oe(this.model,this.panel,this,t))),this.dataItems.length&&await Promise.all(this.dataItems.map((t=>t.init()))),this.state.items=n,this.childrenStateNotify(dt.LOAD)}async setDataByDeLogic(){const{appDataEntityId:t,appDELogicId:e}=this.model;if(!e)throw new z(this.model,"没有配置实体逻辑");if(!t)throw new z(this.model,"没有配置实体");const n=await ht(e,t,this.panel.context,[],this.panel.params);if(!n)throw new A("实体逻辑".concat(e,"没有返回值"));this.setData(n)}setDataByAppGlobalParam(){const{dataName:t}=this.model,e=t?ibiz.appData[t]:ibiz.appData;e?this.setData(e):ibiz.log.error("全局变量里没有".concat(t,"属性"))}async setDataByDeMethod(){const{appDEMethodId:t,appDataEntityId:e}=this.model;if(!t)throw new z(this.model,"没有配置实体行为");if(!e)throw new z(this.model,"没有配置实体");const n=ibiz.hub.getApp(this.panel.context.srfappid),o=await n.deService.exec(e,t,this.panel.context,[],this.panel.params);o.ok&&o.data&&this.setData(o.data)}bindViewData(t,e){if(!Object.prototype.hasOwnProperty.call(t.state,e))return void ibiz.log.error("绑定视图的会话不存在".concat(e));const n=()=>{const n=t.state[e];n?this.setData(n):ibiz.log.error("视图state里没有".concat(e,"属性"))};n(),t.evt.on("onDataChange",(()=>{n()}))}setDataValue(t,e){throw new Error("Method not implemented.")}destroy(){super.destroy(),this.dataItems.forEach((t=>{t.destroy()}))}}t("MultiDataContainerController",xe);const Re=g({name:"IBizMultiDataContainer",props:{modelData:{type:Object,required:!0},controller:{type:xe,required:!0}},setup(t){const n=Lt("multi-data-container"),{id:o}=t.modelData;e((()=>t.controller.state.items),(()=>{t.controller.dataItems.forEach((t=>{t.state=l(t.state);Object.keys(t.panelItems).forEach((e=>{const n=t.panelItems[e];n.state=l(n.state)}))}))}),{immediate:!0});const a=i("renderPanelItem"),s=m((()=>[n.b(),n.m(o),...t.controller.containerClass]));return{ns:n,classArr:s,renderPanelItem:a}},render(){let t;return t=this.$slots.default?this.$slots.default():this.controller.state.items.map(((t,e)=>{const n=this.controller.dataItems[e];return y(p("iBizRow"),{class:this.ns.b("content"),layout:this.modelData.layout},{default:()=>{var t;return[null==(t=this.modelData.panelItems)?void 0:t.map((t=>{let e;const o=n.panelItems[t.id];return y(p("iBizCol"),{layoutPos:t.layoutPos,state:o.state},"function"==typeof(a=e=this.renderPanelItem(t,{providers:this.controller.providers,panelItems:n.panelItems}))||"[object Object]"===Object.prototype.toString.call(a)&&!b(a)?e:{default:()=>[e]});var a}))]}})})),y("div",{class:this.classArr},[t])}});class Se{constructor(){this.component="IBizMultiDataContainer"}async createController(t,e,n){const o=new xe(t,e,n);return await o.init(),o}}t("IBizMultiDataContainer",Ft(Re,(function(t){t.component(Re.name,Re),et("CONTAINER_CONTAINER_MULTIDATA",(()=>new Se))})));class ze extends Z{constructor(){super(...arguments),this.data={}}}t("SingleDataContainerState",ze);class Be extends tt{constructor(){super(...arguments),this.isDataContainer=!0,this.panelItems={},this.providers={}}get data(){return this.state.data}createState(){var t;return new ze(null==(t=this.parent)?void 0:t.state)}async onInit(){await super.onInit(),await this.initPanelItemControllers(),this.initContainerData()}async initPanelItemControllers(t=this.model.panelItems,e=this.panel,n=this){t&&await Promise.all(t.map((async t=>{var o,a;const s=await ct(t);if(!s)return;this.providers[t.id]=s;const r=await s.createController(t,e,n);this.panelItems[t.id]=r,(null==(o=t.panelItems)?void 0:o.length)&&!lt(t)&&await this.initPanelItemControllers(t.panelItems,e,r),(null==(a=t.panelTabPages)?void 0:a.length)&&await this.initPanelItemControllers(t.panelTabPages,e,r)})))}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 z(this.model,"没有配置数据对象名称");this.bindViewData(this.panel.getTopView(),e);break;case"VIEWSESSIONPARAM":if(!e)throw new z(this.model,"没有配置数据对象名称");this.bindViewData(this.panel.view,e);break;default:throw new S(this.model,"数据源类型".concat(t,"暂未支持"))}}childrenStateNotify(t){Object.values(this.panelItems).forEach((e=>{e.panelStateNotify(t)}))}async setData(t){var e,n;const o=it(this.model),a=o.map((t=>t.id)),s=new ut(o,t);s._evt.on("change",(t=>{a.includes(t)&&this.childDataChangeNotify([t])})),null==(n=(e=this.data).destroy)||n.call(e),this.state.data=s,this.childrenStateNotify(dt.LOAD)}async setDataByDeLogic(){const{appDataEntityId:t,appDELogicId:e}=this.model;if(!e)throw new z(this.model,"没有配置实体逻辑");if(!t)throw new z(this.model,"没有配置实体");const n=await ht(e,t,this.panel.context,[],this.panel.params);if(!n)throw new A("实体逻辑".concat(e,"没有返回值"));this.setData(n)}setDataByAppGlobalParam(){const{dataName:t}=this.model,e=t?ibiz.appData[t]:ibiz.appData;e?this.setData(e):ibiz.log.error("全局变量里没有".concat(t,"属性"))}async setDataByDeMethod(){const{appDEMethodId:t,appDataEntityId:e}=this.model;if(!t)throw new z(this.model,"没有配置实体行为");if(!e)throw new z(this.model,"没有配置实体");const n=ibiz.hub.getApp(this.panel.context.srfappid),o=await n.deService.exec(e,t,this.panel.context,[],this.panel.params);o.ok&&o.data&&this.setData(o.data)}bindViewData(t,e){if(!Object.prototype.hasOwnProperty.call(t.state,e))return void ibiz.log.error("绑定视图的会话不存在".concat(e));const n=()=>{const n=t.state[e];n?this.setData(n):ibiz.log.error("视图state里没有".concat(e,"属性"))};n(),t.evt.on("onDataChange",(()=>{n()}))}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(),null==(e=(t=this.data).destroy)||e.call(t),Object.values(this.panelItems).forEach((t=>{t.destroy()}))}}t("SingleDataContainerController",Be);const Te=g({name:"IBizSingleDataContainer",props:{modelData:{type:Object,required:!0},controller:{type:Be,required:!0}},setup(t){const e=Lt("single-data-container"),{id:n}=t.modelData;Object.keys(t.controller.panelItems).forEach((e=>{const n=t.controller.panelItems[e];n.state=l(n.state)}));const o=i("renderPanelItem"),a=m((()=>[e.b(),e.m(n),...t.controller.containerClass]));return{ns:e,classArr:a,renderPanelItem:o}},render(){let t;return t=this.$slots.default?this.$slots.default():y(p("iBizRow"),{class:this.ns.b("content"),layout:this.modelData.layout},{default:()=>{var t;return[null==(t=this.modelData.panelItems)?void 0:t.map((t=>{let e;const n=this.controller.panelItems[t.id];return y(p("iBizCol"),{layoutPos:t.layoutPos,state:n.state},"function"==typeof(o=e=this.renderPanelItem(t,{providers:this.controller.providers,panelItems:this.controller.panelItems}))||"[object Object]"===Object.prototype.toString.call(o)&&!b(o)?e:{default:()=>[e]});var o}))]}}),y("div",{class:this.classArr},[t])}});class je{constructor(){this.component="IBizSingleDataContainer"}async createController(t,e,n){const o=new Be(t,e,n);return await o.init(),o}}t("IBizSingleDataContainer",Ft(Te,(function(t){t.component(Te.name,Te),et("CONTAINER_CONTAINER_SINGLEDATA",(()=>new je))})));class Ve extends Z{}t("GridContainerState",Ve);class Le extends tt{createState(){var t;return new Ve(null==(t=this.parent)?void 0:t.state)}}function Me(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)}t("GridContainerController",Le);const ke=g({name:"IBizGridContainer",props:{modelData:{type:Object,required:!0},controller:{type:Le,required:!0}},setup(t){const e=Lt("grid-container"),{id:n}=t.modelData,o=m((()=>{let o=[e.b(),e.m(n)];return o=[...o,...t.controller.containerClass,e.is("hidden",!t.controller.state.visible)],o})),a=m((()=>({...t.modelData.layout,layout:"TABLE_12COL"}))),s=d(void 0),r=d(12);return{ns:e,classArr:o,layoutModel:a,convertLayoutPos:(t,e)=>{const n={...t,layout:"TABLE_12COL",colXS:t.grow||e,colSM:t.grow||e,colMD:t.grow||e,colLG:t.grow||e};return delete n.grow,n},adaptGrow:r,adaptCols:s}},render(){var t,e;let n;const o=(null==(e=(t=this.$slots).default)?void 0:e.call(t))||[];if(void 0===this.adaptCols){let t=0,e=0;o.forEach((n=>{const o=n.props;o&&o.modelData&&o.modelData.layoutPos&&("number"==typeof o.modelData.layoutPos.grow?t+=o.modelData.layoutPos.grow:void 0===o.modelData.layoutPos.grow&&(e+=1))}));let n=12;e>0&&(n=(12-t)/e),this.adaptCols=e,this.adaptGrow=n}return y(p("iBizRow"),{class:this.classArr,layout:this.layoutModel},Me(n=o.map((t=>{const e=t.props;return e&&e.controller?y(p("iBizCol"),{layoutPos:this.convertLayoutPos(e.modelData.layoutPos,this.adaptGrow),state:e.controller.state},Me(t)?t:{default:()=>[t]}):t})))?n:{default:()=>[n]})}});class _e{constructor(){this.component="IBizGridContainer"}async createController(t,e,n){const o=new Le(t,e,n);return await o.init(),o}}t("IBizGridContainer",Ft(ke,(function(t){t.component(ke.name,ke),et("CONTAINER_CONTAINER_GRID",(()=>new _e))})));class Ge extends Z{}t("PanelContainerImageState",Ge);class We extends tt{createState(){var t;return new Ge(null==(t=this.parent)?void 0:t.state)}}function qe(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)}t("PanelContainerImageController",We);const $e=g({name:"IBizPanelContainerImage",props:{modelData:{type:Object,required:!0},controller:{type:We,required:!0}},setup(t){const e=Lt("panel-container-image"),{id:n}=t.modelData,o=m((()=>{let o=[e.b(),e.m(n)];return o=[...o,...t.controller.containerClass,e.is("hidden",!t.controller.state.visible)],o})),a=m((()=>{const e=t.controller.model.sysImage,n={};let o="";return(null==e?void 0:e.rawContent)?o=R(e.rawContent)?"url(data:image/svg+xml;base64,".concat(btoa(e.rawContent),")"):"url(".concat(e.rawContent,")"):(null==e?void 0:e.imagePath)&&(o="url(".concat(e.imagePath,")")),o&&Object.assign(n,{backgroundImage:o}),n}));return{ns:e,classArr:o,backgroundStyle:a}},render(){var t,e;let n;const o=(null==(e=(t=this.$slots).default)?void 0:e.call(t))||[],a=y(p("iBizRow"),{slot:"content",layout:this.modelData.layout},qe(n=o.map((t=>{const e=t.props;return e&&e.controller?y(p("iBizCol"),{layoutPos:e.modelData.layoutPos,state:e.controller.state},qe(t)?t:{default:()=>[t]}):t})))?n:{default:()=>[n]});return y("div",{class:this.classArr,onClick:()=>{this.controller.onClick()},style:this.backgroundStyle},[this.controller.model.cssStyle?y("style",{type:"text/css"},[this.controller.model.cssStyle]):null,a])}});class Fe{constructor(){this.component="IBizPanelContainerImage"}async createController(t,e,n){const o=new We(t,e,n);return await o.init(),o}}t("IBizPanelContainerImage",Ft($e,(function(t){t.component($e.name,$e),et("CONTAINER_CONTAINER_IMAGE",(()=>new Fe))})));class Ue extends Z{}t("PanelContainerGroupState",Ue);class Ke extends tt{createState(){var t;return new Ue(null==(t=this.parent)?void 0:t.state)}get disableClose(){const{titleBarCloseMode:t}=this.model;return 0===t||void 0===t}get defaultExpansion(){const{titleBarCloseMode:t}=this.model;return this.disableClose||1===t}}t("PanelContainerGroupController",Ke);class He{constructor(){this.component="IBizPanelContainerGroup"}async createController(t,e,n){const o=new Ke(t,e,n);return await o.init(),o}}function Xe(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)}const Qe=g({name:"IBizPanelContainerGroup",props:{modelData:{type:Object,required:!0},controller:{type:Ke,required:!0}},setup(t){const e=Lt("panel-container-group"),n=d(!t.controller.defaultExpansion);return{ns:e,captionText:m((()=>{const{captionItemName:e,caption:n,capLanguageRes:o}=t.modelData;if(e)return t.controller.data[e];let a=n;return o&&(a=ibiz.i18n.t(o.lanResTag,n)),a})),changeCollapse:()=>{t.controller.disableClose||(n.value=!n.value)},isCollapse:n}},render(){var t,e;let n;const o=[this.ns.b(),this.ns.m(this.modelData.id),...this.controller.containerClass,this.ns.is("hidden",!this.controller.state.visible)];!0===this.modelData.showCaption&&(o.push(this.ns.m("show-header")),o.push(this.ns.b("collapse")),o.push(this.ns.is("collapse",this.isCollapse)),this.controller.disableClose&&o.push(this.ns.bm("collapse","disable-close")));const a=(null==(e=(t=this.$slots).default)?void 0:e.call(t))||[],s=y(p("iBizRow"),{slot:"content",layout:this.modelData.layout},Xe(n=a.map((t=>{const e=t.props;return e&&e.controller?y(p("iBizCol"),{layoutPos:e.modelData.layoutPos,state:e.controller.state},Xe(t)?t:{default:()=>[t]}):t})))?n:{default:()=>[n]});let r=null;return this.modelData.showCaption&&(r=y("div",{class:[this.ns.b("header")],onClick:this.changeCollapse},[y("div",{class:[this.ns.be("header","left")]},[y("div",{class:[this.ns.e("caption"),...this.controller.labelClass]},[this.captionText])]),y("div",{class:[this.ns.be("header","right")]},[void 0!==this.modelData.titleBarCloseMode&&0!==this.modelData.titleBarCloseMode&&(this.isCollapse?y("ion-icon",{name:"caret-forward-sharp"},null):y("ion-icon",{name:"caret-down-sharp"},null))])])),y("div",{class:o},[r,y("div",{class:[this.ns.b("content")]},[s])])}});t("IBizPanelContainerGroup",Ft(Qe,(function(t){t.component(Qe.name,Qe),et("CONTAINER_CONTAINER_GROUP",(()=>new He))})));function Ye(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)}const Je=g({name:"IBizPanelTabPage",props:{modelData:{type:Object,required:!0},controller:{type:tt,required:!0}},setup(t){const e=Lt("panel-tab-page"),n=m((()=>{const{id:n}=t.modelData,o=[e.b(),e.m(n)];return o.push(...t.controller.containerClass),o}));return{ns:e,classArr:n}},render(){var t,e;let n;const o=(null==(e=(t=this.$slots).default)?void 0:e.call(t))||[];return y(p("iBizRow"),{class:[this.ns.b(),this.ns.m(this.modelData.codeName),this.classArr],layout:this.modelData.layout},Ye(n=o.map((t=>{const e=t.props;if(!e||!e.controller)return t;const n=e.controller;return y(p("iBizCol"),{layoutPos:n.model.layoutPos,state:n.state},Ye(t)?t:{default:()=>[t]})})))?n:{default:()=>[n]})}});class Ze{constructor(){this.component="IBizPanelTabPage"}async createController(t,e,n){const o=new tt(t,e,n);return await o.init(),o}}t("IBizPanelTabPage",Ft(Je,(function(t){t.component(Je.name,Je),et("TABPAGE",(()=>new Ze))})));class tn extends tt{getPanelItemCustomHtml(t,e){if(0===t.length)return;const n=t[0];return n.layoutPanelModel?pt.execScriptFn({data:e||{}},n.layoutPanelModel,{singleRowReturn:!0,isAsync:!1}):void 0}}const en=g({name:"IBizPanelItemRender",props:{modelData:{type:Object,required:!0},controller:{type:tn,required:!0}},setup(t){var e;const n=Lt("panel-item-render"),o=Lt("panel-".concat(null==(e=t.modelData.itemType)?void 0:e.toLowerCase())),{id:a}=t.modelData,s=m((()=>[n.b(),n.m(a),o.b(),n.is("hidden",!t.controller.state.visible)])),r=m((()=>t.controller.getPanelItemCustomHtml(t.modelData.controlRenders,t.controller.data)));return{ns:n,classArr:s,htmlCode:r}},render(){return y("div",{class:this.classArr,innerHTML:this.htmlCode},null)}});class nn{constructor(){this.component="IBizPanelItemRender"}async createController(t,e,n){const o=new tn(t,e,n);return await o.init(),o}}t("IBizPanelItemRender",Ft(en,(function(t){t.component(en.name,en),et("PREDEFINE_RENDER",(()=>new nn))}))),t("AppRedirectView",g({setup(){var t;const e=B.create((null==(t=ibiz.appData)?void 0:t.context)||{});f((()=>{e.destroy()}));const{href:n}=window.location;I((()=>ibiz.util.hiddenAppLoading())),async function(){await mt(e,n)}()},render:()=>y("div",null,[P("重定向跳转中")])}));class on{constructor(){this.component="IBizView"}}const an=g({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 t=Lt("view"),e=Yt(((...t)=>new ft(...t))),n=vt(e.model),{viewType:o,sysCss:a,codeName:s}=e.model,r=o.toLowerCase(),i=null==a?void 0:a.cssName,l=m((()=>[t.b(),t.b(r),t.m(s),i,e.state.viewMessages.TOP?"has-top-message":"",e.state.viewMessages.BOTTOM?"has-bottom-message":""])),c=d(null),u=W(),h=window.devtool;I((()=>{h&&h.registerView(u,e,c)})),f((()=>{h&&h.unRegisterView(u)}));return{c:e,controls:n,viewClassNames:l,container:c,onLayoutPanelCreated:t=>{e.setLayoutPanel(t)},renderViewMessage:n=>{if(e.state.isCreated){const o=e.state.viewMessages[n];if(null==o?void 0:o.length)return y(p("view-message"),{class:[t.e("".concat(n.toLowerCase(),"-message"))],messages:o},null)}return null}}},render(){var t;let e=null;if(this.c.state.isCreated){const n={...this.$slots};if((null==(t=this.controls)?void 0:t.length)&&this.controls.forEach((t=>{const e=t.name||t.id,o={context:this.c.context,params:this.c.params};this.c.slotProps[e]&&Object.assign(o,this.c.slotProps[e]);const a=n[e];if(a)return void(n[e]=()=>a(o));const s=this.c.providers[e];s&&(n[e]=()=>{const e=p(s.component);return h(e,{modelData:t,...o,provider:s})})})),0===this.c.engines.length)e=y("span",{style:"color:red;"},[P("视图类型"),this.modelData.viewType,P("暂未支持")]);else{const t=this.c.model.viewLayoutPanel,o=this.c.providers[t.name];e=h(p(o.component),{modelData:t,context:this.c.context,params:this.c.params,provider:o,container:this.c,onControllerAppear:this.onLayoutPanelCreated},n)}}return w(y("div",{ref:"container",class:this.viewClassNames},[this.renderViewMessage("TOP"),e,this.renderViewMessage("BOTTOM")]),[[C("loading"),this.c.state.isLoading]])}});t("IBizView",Ft(an,(function(t){t.component(an.name,an),gt("DEFAULT",(()=>new on))}))),t("TodoRedirect",g({setup(){const t=$(),{href:e}=window.location,n=e.lastIndexOf("?"),o=decodeURIComponent(e.substring(n+1,e.length));if(!o)throw new Error("重定向参数不足无法跳转");const a=F.parse(o,{delimiter:";"}),{apptype:s,todotype:r,todoid:i}=a,l={srfapptype:"pc",srfapp:""};s||(l.todourltype="RouterUrl"),async function(){let e=(await ibiz.net.post("/systodos/".concat(i,"/getlinkurl"),l)).data.linkurl;s?window.location.href=e:(0!==e.indexOf("/")&&(e="/".concat(e)),e+=";srfwf=".concat(r),t.push("/index".concat(e)))}()},render:()=>y("div",null,[P("待办列表重定向")])}));class sn{constructor(){this.component="IBizPortalView"}}const rn=g({name:"IBizPortalView",props:{context:Object,params:{type:Object,default:()=>({})},modelData:{type:Object,required:!0},modal:{type:Object},state:{type:Object}},setup(){var t;const e=Lt("view"),n=Yt(((...t)=>new ft(...t))),o=(null==(t=n.model.viewLayoutPanel)?void 0:t.controls)||n.model.controls,{viewType:a,sysCss:s,codeName:r}=n.model,i=a.toLowerCase(),l=null==s?void 0:s.cssName,c=[e.b(),e.b(i),e.m(r),l];return{c:n,ns:e,controls:o,viewClassNames:c}},render(){var t;let e=null;if(this.c.state.isCreated){const n={...this.$slots};(null==(t=this.controls)?void 0:t.length)&&this.controls.forEach((t=>{const e=t.name||t.id,o={context:this.c.context,params:this.c.params};this.c.slotProps[e]&&Object.assign(o,this.c.slotProps[e]);const a=n[e];if(a)return void(n[e]=()=>a(o));const s=this.c.providers[e];s&&(n[e]=()=>{const e=p(s.component);return h(e,{modelData:t,...o})})})),n.dashboard&&(e=n.dashboard())}return y("div",{class:this.viewClassNames},[e])}}),ln=(t("IBizPortalView",Ft(rn,(function(t){t.component(rn.name,rn),gt(U.APP_PORTAL_VIEW,(()=>new sn)),gt(U.DE_PORTAL_VIEW,(()=>new sn)),gt(U.DE_PORTAL_VIEW9,(()=>new sn))}))),g({name:"IBizDeRedirectView",props:{context:{type:Object,required:!0},params:{type:Object,default:()=>({})},modelData:{type:Object,required:!0}},setup(t){const e=Yt(((...t)=>new ft(...t))),n=d(),o=d(),a=d();return e.evt.on("onCreated",(()=>{yt(r(t.modelData),r(e.context),r(e.params)).then((async t=>{if("view"!==t.type)throw new A("嵌入重定向视图不支持url跳转");n.value=t.viewId,o.value=t.context,a.value=t.params}))})),{c:e,toViewId:n,toViewContext:o,toViewParams:a}},render(){return this.toViewId?h(p("IBizViewShell"),{context:this.toViewContext,params:this.toViewParams,viewId:this.toViewId,...this.$attrs},this.$slots):w(y("div",{style:"width: 100%; height: 100%;"},null),[[C("loading"),!this.toViewId]])}}));class cn{constructor(){this.component="IBizDeRedirectView"}}t("IBizDeRedirectView",Ft(ln,(function(t){t.component(ln.name,ln);const e=new cn;gt(U.DE_REDIRECT_VIEW,(()=>e))})));const un=g({name:"IBizViewLayoutPanelControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},container:{type:Object},data:Object},setup(t,{slots:n}){const o=jt(((...e)=>new wt(...e,t.container))),a=Lt("control-".concat(o.model.controlType.toLowerCase()));e((()=>t.data),(t=>{t&&(o.setInputData(t),o.load())}),{immediate:!0}),o.evt.on("onCreated",(()=>{Object.keys(o.panelItems).forEach((t=>{const e=o.panelItems[t];e.state=l(e.state)}))}));const s=(t,e)=>{var a,r;if(t.hidden)return null;const{providers:i,panelItems:l}=e||o,c=i[t.id];if(!c)return y("div",null,[P("暂未支持的面板项: "),t.id,P(" - "),t.itemType]);const u=p(c.component);let d;return"CTRLPOS"===t.itemType&&n[t.id]?d=()=>n[t.id]():"TABPANEL"===t.itemType&&(null==(a=t.panelTabPages)?void 0:a.length)?d=()=>t.panelTabPages.map((t=>s(t,e))):lt(t)?d=void 0:(null==(r=t.panelItems)?void 0:r.length)&&(d=()=>t.panelItems.map((t=>s(t,e)))),h(u,{modelData:t,controller:l[t.id],key:t.id},d)};return v("renderPanelItem",s),{c:o,ns:a,renderPanelItem:s}},render(){const{state:t,model:e}=this.c;return y(p("iBizControlBase"),{controller:this.c},{default:()=>[y(p("iBizRow"),{class:this.ns.b("content"),layout:{layout:"FLEX"}},{default:()=>{var n;return[t.isCreated&&(this.$slots.default?this.$slots.default({panelItems:this.c.panelItems}):null==(n=e.rootPanelItems)?void 0:n.map((t=>{let e;const n=this.c.panelItems[t.id];return t.layoutPos.layout="FLEX",y(p("iBizCol"),{layoutPos:t.layoutPos,state:n.state},"function"==typeof(o=e=this.renderPanelItem(t))||"[object Object]"===Object.prototype.toString.call(o)&&!b(o)?e:{default:()=>[e]});var o})))]}})]})}});class dn{constructor(){this.component="IBizViewLayoutPanelControl"}}t("IBizViewLayoutPanelControl",Ft(un,(function(t){t.component(un.name,un),Ct(bt.VIEW_LAYOUT_PANEL,(()=>new dn))})));function hn(t,e,n){var o,a;if(t.hidden)return;const{providers:s,panelItems:r}=e,i=s[t.id];if(!i)return y("div",null,[P("暂未支持的面板项: "),t.id,P(" - "),t.itemType]);const l=p(i.component);let c;return"CTRLPOS"===t.itemType&&n.$slots[t.id]?c=()=>n.$slots[t.id]():"TABPANEL"===t.itemType&&(null==(o=t.panelTabPages)?void 0:o.length)?c=()=>t.panelTabPages.map((t=>hn(t,e,n))):(null==(a=t.panelItems)?void 0:a.length)&&(c=()=>t.panelItems.map((t=>hn(t,e,n)))),h(l,{modelData:t,controller:r[t.id],key:t.id},c)}const pn=g({name:"IBizPanelControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},container:{type:Object},data:Object,loadDefault:{type:Boolean,default:!0}},setup(t){const n=jt(((...e)=>new It(...e,t.container))),o=Lt("control-".concat(n.model.controlType.toLowerCase()));return e((()=>t.data),(t=>{t&&(n.setInputData(t),n.load())}),{immediate:!0}),n.evt.on("onCreated",(()=>{Object.keys(n.panelItems).forEach((t=>{const e=n.panelItems[t];e.state=l(e.state)}))})),{c:n,ns:o}},render(){const{state:t,model:e}=this.c;return y(p("iBizControlBase"),{controller:this.c},{default:()=>[y(p("iBizRow"),{class:this.ns.b("content"),layout:{layout:"FLEX"}},{default:()=>{var n;return[t.isCreated&&(this.$slots.default?this.$slots.default({panelItems:this.c.panelItems}):null==(n=e.rootPanelItems)?void 0:n.map((t=>{let e;const n=this.c.panelItems[t.id];return t.layoutPos.layout="FLEX",y(p("iBizCol"),{layoutPos:t.layoutPos,state:n.state},"function"==typeof(o=e=hn(t,this.c,this))||"[object Object]"===Object.prototype.toString.call(o)&&!b(o)?e:{default:()=>[e]});var o})))]}})]})}});class mn{constructor(){this.component="IBizPanelControl"}}t("IBizPanelControl",Ft(pn,(function(t){t.component(pn.name,pn),Ct(bt.PANEL,(()=>new mn))})));function fn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function vn(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function gn(t,e){for(var n,o="",a=0,s=-1,r=0,i=0;i<=t.length;++i){if(i<t.length)n=t.charCodeAt(i);else{if(47===n)break;n=47}if(47===n){if(s===i-1||1===r);else if(s!==i-1&&2===r){if(o.length<2||2!==a||46!==o.charCodeAt(o.length-1)||46!==o.charCodeAt(o.length-2))if(o.length>2){var l=o.lastIndexOf("/");if(l!==o.length-1){-1===l?(o="",a=0):a=(o=o.slice(0,l)).length-1-o.lastIndexOf("/"),s=i,r=0;continue}}else if(2===o.length||1===o.length){o="",a=0,s=i,r=0;continue}e&&(o.length>0?o+="/..":o="..",a=2)}else o.length>0?o+="/"+t.slice(s+1,i):o=t.slice(s+1,i),a=i-s-1;s=i,r=0}else 46===n&&-1!==r?++r:r=-1}return o}var yn={resolve:function(){for(var t,e="",n=!1,o=arguments.length-1;o>=-1&&!n;o--){var a;o>=0?a=arguments[o]:(void 0===t&&(t=process.cwd()),a=t),vn(a),0!==a.length&&(e=a+"/"+e,n=47===a.charCodeAt(0))}return e=gn(e,!n),n?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(vn(t),0===t.length)return".";var e=47===t.charCodeAt(0),n=47===t.charCodeAt(t.length-1);return 0!==(t=gn(t,!e)).length||e||(t="."),t.length>0&&n&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return vn(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var n=arguments[e];vn(n),n.length>0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":yn.normalize(t)},relative:function(t,e){if(vn(t),vn(e),t===e)return"";if((t=yn.resolve(t))===(e=yn.resolve(e)))return"";for(var n=1;n<t.length&&47===t.charCodeAt(n);++n);for(var o=t.length,a=o-n,s=1;s<e.length&&47===e.charCodeAt(s);++s);for(var r=e.length-s,i=a<r?a:r,l=-1,c=0;c<=i;++c){if(c===i){if(r>i){if(47===e.charCodeAt(s+c))return e.slice(s+c+1);if(0===c)return e.slice(s+c)}else a>i&&(47===t.charCodeAt(n+c)?l=c:0===c&&(l=0));break}var u=t.charCodeAt(n+c);if(u!==e.charCodeAt(s+c))break;47===u&&(l=c)}var d="";for(c=n+l+1;c<=o;++c)c!==o&&47!==t.charCodeAt(c)||(0===d.length?d+="..":d+="/..");return d.length>0?d+e.slice(s+l):(s+=l,47===e.charCodeAt(s)&&++s,e.slice(s))},_makeLong:function(t){return t},dirname:function(t){if(vn(t),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,o=-1,a=!0,s=t.length-1;s>=1;--s)if(47===(e=t.charCodeAt(s))){if(!a){o=s;break}}else a=!1;return-1===o?n?"/":".":n&&1===o?"//":t.slice(0,o)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');vn(t);var n,o=0,a=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var r=e.length-1,i=-1;for(n=t.length-1;n>=0;--n){var l=t.charCodeAt(n);if(47===l){if(!s){o=n+1;break}}else-1===i&&(s=!1,i=n+1),r>=0&&(l===e.charCodeAt(r)?-1==--r&&(a=n):(r=-1,a=i))}return o===a?a=i:-1===a&&(a=t.length),t.slice(o,a)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!s){o=n+1;break}}else-1===a&&(s=!1,a=n+1);return-1===a?"":t.slice(o,a)},extname:function(t){vn(t);for(var e=-1,n=0,o=-1,a=!0,s=0,r=t.length-1;r>=0;--r){var i=t.charCodeAt(r);if(47!==i)-1===o&&(a=!1,o=r+1),46===i?-1===e?e=r:1!==s&&(s=1):-1!==e&&(s=-1);else if(!a){n=r+1;break}}return-1===e||-1===o||0===s||1===s&&e===o-1&&e===n+1?"":t.slice(e,o)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var n=e.dir||e.root,o=e.base||(e.name||"")+(e.ext||"");return n?n===e.root?n+o:n+t+o:o}("/",t)},parse:function(t){vn(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,o=t.charCodeAt(0),a=47===o;a?(e.root="/",n=1):n=0;for(var s=-1,r=0,i=-1,l=!0,c=t.length-1,u=0;c>=n;--c)if(47!==(o=t.charCodeAt(c)))-1===i&&(l=!1,i=c+1),46===o?-1===s?s=c:1!==u&&(u=1):-1!==s&&(u=-1);else if(!l){r=c+1;break}return-1===s||-1===i||0===u||1===u&&s===i-1&&s===r+1?-1!==i&&(e.base=e.name=0===r&&a?t.slice(1,i):t.slice(r,i)):(0===r&&a?(e.name=t.slice(1,s),e.base=t.slice(1,i)):(e.name=t.slice(r,s),e.base=t.slice(r,i)),e.ext=t.slice(s,i)),r>0?e.dir=t.slice(0,r-1):a&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};yn.posix=yn;var wn=yn,Cn=fn(wn);t("PluginFactory",class{constructor(){this.urlReg=/^http[s]?:\/\/[^\s]*/,this.cache=new Map,this.pluginCache=new Map,this.pluginCodes=[],this.predefinedPlugins=new Map,this.ignoreRules=[],this.loadQueue=new Map}isIgnore(t){return this.ignoreRules.some((e=>"string"==typeof e?t===e:e.test(t)))}setDevIgnore(t){this.ignoreRules.push(t)}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)}))}async loadPlugin(t){if(!0===t.runtimeObject){const e=t;if(e){const t=e.rtobjectName,n=e.rtobjectRepo;if(this.isIgnore(n))return!0;if(this.pluginCache.has(t))return!0;if(this.loadQueue.has(n)){const t=await this.loadQueue.get(n);try{return await t}catch(t){return!1}}try{const t=this.loadPluginRef(e.rtobjectName,e.rtobjectRepo);this.loadQueue.set(n,t);return await t}catch(t){throw new z(e,"配置加载失败")}finally{this.loadQueue.delete(n)}}}return!1}async loadPluginRef(t,e){if(this.isIgnore(e))return!0;if(this.pluginCache.has(t))return!0;let n=null;{const t=e,o=this.urlReg.test(t)?"".concat(t,"/package.json"):"".concat(ibiz.env.pluginBaseUrl,"/").concat(wn.join(t,"package.json")),a=await ibiz.net.axios({method:"get",headers:{"Access-Control-Allow-Origin":"*"},url:o});if(200!==a.status)throw new Error("配置加载失败");n=a.data}const o=new Pt(t,e,n);if(o){if(o.config["systemjs-importmap"]){const t=this.handleSystemImportMap(o.config["systemjs-importmap"]);t&&System.addImportMap(t)}try{return await this.loadScript(o),this.pluginCache.set(t,o),!0}catch(t){ibiz.log.error(t)}}return!1}async loadScript(t){const e=t.repo,{name:n,system:o,styles:a=[]}=t.config;let s="";if(s=wn.join(e,o),s){if(this.cache.has(s))return;let t=null;const o=this.parseUrl(s),r=("string"==typeof a?[a]:a).map((t=>this.parseUrl(Cn.join(e,t))));if(System.addImportMap({imports:{[n]:o},styles:{[n]:r}}),t=await System.import(n),!t)throw new A("远程插件加载失败, 未找到文件或文件内容格式不正确");if(!t.default)throw new A("远程插件加载失败, 远程插件未找到[default]默认导出");this.setPluginCode(t.default),this.cache.set(s,!0)}}parseUrl(t,e=ibiz.env.pluginBaseUrl){if(this.urlReg.test(t))return t;let n="";n=this.urlReg.test(e)?t.startsWith("/")?e+t:"".concat(e,"/").concat(t):"".concat(wn.join(e,t));const{origin:o,pathname:a}=window.location;return a.endsWith("/")&&n.startsWith("/")&&(n=n.substring(1)),!1===this.urlReg.test(n)&&(n="".concat(o).concat(a).concat(n)),n}handleSystemImportMap(t){if(t){if(t.imports){const e=t.imports;for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const o=e[n];e[n]=this.parseUrl(o,t.baseUrl)}}if(t.styles){const e=t.styles;for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const o=e[n];e[n]="string"==typeof o?this.parseUrl(o,t.baseUrl):o.map((e=>this.parseUrl(e,t.baseUrl)))}}return t}return null}});class bn{constructor(t,e,n){this.required=!0,e&&(this.default=e),n&&(this.validator=n),this.type=t}}function In(){return{value:String,controller:new bn(Object),data:new bn(Object),disabled:{type:Boolean},readonly:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1},overflowMode:{type:String},controlParams:{type:Object,required:!1}}}function Pn(){return{hasError:{type:Boolean}}}function Dn(){return{...In(),value:[String,Number]}}function Nn(){return{...In(),value:Number}}function En(){return{...In(),value:String}}function On(){return{...In(),value:[String,Number,Object,Array]}}function An(){return{...In(),value:[String,Number]}}function xn(){return{...In(),value:[String,Number]}}function Rn(){return{...In(),value:[String,Number]}}function Sn(){return{...In(),value:[String,Array,Object,Number]}}function zn(){return{...In(),value:[String,Number]}}function Bn(){return{...In(),value:[String,Number]}}function Tn(){return{...In(),value:[String,Number]}}function jn(){return{...In(),value:[String,Number]}}function Vn(){return{...In(),value:[String,Number]}}function Ln(){return{...In(),value:[String,Number]}}function Mn(){return{...In(),value:[String,Number,Array]}}function kn(){return{...In(),value:[String,Number]}}function _n(){return{...In(),value:[String,Number]}}function Gn(){return{...In(),value:[String,Number]}}function Wn(){return{...In(),value:String}}function qn(){return{...In(),value:[String,Number]}}function $n(){return{...In(),value:String,language:{type:String},theme:{type:String}}}function Fn(){return{...In(),value:String}}function Un(){return{...In(),data:{type:Object,required:!1},controller:{type:Object,required:!1},disabled:{type:Boolean,required:!1}}}function Kn(){return{...In(),value:[Array,Array]}}function Hn(){return{...In(),value:String}}function Xn(){return{...In(),value:String}}t("RequiredProp",bn)}}}));
|
|
1
|
+
System.register(["vue","@ibiz-template/core","ramda","qx-util","vue-router","qs","@ibiz-template/runtime","pinia","dayjs","lodash-es"],(function(t){"use strict";var e,n,o,a,s,r,i,l,c,u,d,p,h,m,f,v,g,y,w,C,b,I,P,D,E,N,O,A,x,R,S,z,T,B,j,V,L,M,k,_,G,W,q,$,F,U,K,H,X,Y,Q,J,Z,tt,et,nt,ot,at,st,rt,it,lt,ct,ut,dt,pt,ht,mt,ft,vt,gt,yt,wt,Ct,bt,It,Pt,Dt,Et,Nt,Ot;return{setters:[function(t){e=t.watch,n=t.onBeforeUnmount,o=t.createCommentVNode,a=t.getCurrentInstance,s=t.isReactive,r=t.toRaw,i=t.inject,l=t.reactive,c=t.onActivated,u=t.onDeactivated,d=t.ref,p=t.h,h=t.resolveComponent,m=t.computed,f=t.onUnmounted,v=t.provide,g=t.defineComponent,y=t.createVNode,w=t.withDirectives,C=t.resolveDirective,b=t.isVNode,I=t.onMounted,P=t.createTextVNode},function(t){D=t.onClickOutside,E=t.NOOP,N=t.listenJSEvent,O=t.Namespace,A=t.RuntimeError,x=t.isBase64Image,R=t.isSvg,S=t.ModelError,z=t.RuntimeModelError,T=t.IBizContext},function(t){B=t.isNil,j=t.isNotNil,V=t.isEmpty,L=t.mergeLeft},function(t){M=t.isFunc,k=t.notNilEmpty,_=t.QXEvent,G=t.clearAll,W=t.createUUID},function(t){q=t.useRoute,$=t.useRouter},function(t){F=t.default},function(t){U=t.ViewType,K=t.getMatchResPath,H=t.calcDeCodeNameById,X=t.getControlProvider,Y=t.convertNavData,Q=t.getViewProvider,J=t.PanelItemState,Z=t.PanelItemController,tt=t.registerPanelItemProvider,et=t.Modal,nt=t.ViewMode,ot=t.OpenAppViewCommand,at=t.getEditorProvider,st=t.PanelItemEventName,rt=t.getAllPanelField,it=t.isDataContainer,lt=t.getPanelItemProvider,ct=t.PanelData,ut=t.PanelNotifyState,dt=t.execDELogicById,pt=t.ScriptFactory,ht=t.toLocalOpenWFRedirectView,mt=t.ViewController,ft=t.getControlsByView,vt=t.registerViewProvider,gt=t.getDERedirectToView,yt=t.ViewLayoutPanelController,wt=t.registerControlProvider,Ct=t.ControlType,bt=t.PanelController,It=t.RemotePluginItem},function(t){Pt=t.defineStore,Dt=t.createPinia},function(t){Et=t.default},function(t){Nt=t.isNumber,Ot=t.isNil}],execute:function(){function At(t,o,a={}){let s=E,r=E,i=E;const l=()=>{s(),s=E,r=E,i=E};return e(t,((t,e)=>{if(t!==e)if(B(t))l();else{const e=D((null==t?void 0:t.$el)||t,o,a);s=e.stop,r=e.pause,i=e.proceed}}),{immediate:!0}),n((()=>{s!==E&&l()})),{stop:()=>s(),pause:()=>r(),proceed:()=>i()}}function xt(){return a().proxy.$props}function Rt(t){return s(t)?r(t):t}function St(){const t=a().proxy;return e=>{t.$forceUpdate(),e&&M(e)&&t.$nextTick((()=>{e()}))}}t({calcResRoutePath:Gt,createOverlayView:Ut,generateRoutePath:async function(t,e,n,o){const a=Lt(e);let s=n.srfdefaulttoroutedepth||2;n.toRouteDepth?(s=n.toRouteDepth,n.toRouteDepth=void 0):ibiz.env.isMob&&(a.pathNodes[0]={viewName:"home"});if(a.pathNodes.splice(s-1,a.pathNodes.length-s+1),n.currentSrfNav){const t=a.pathNodes[a.pathNodes.length-1];t.params=t.params||{},t.srfnav=n.currentSrfNav,n.currentSrfNav=void 0}e.fullPath.startsWith("/appredirectview")&&((null==o?void 0:o.srfindexname)?(a.pathNodes[0].viewName=o.srfindexname,delete o.srfindexname):a.pathNodes[0].viewName="index");if(a.pathNodes.push({viewName:t.codeName.toLowerCase(),context:kt(n),params:o}),2===s&&(await Gt(a,n,t.appDataEntityId,t.appId),_t.includes(t.viewType))){const e=H(t.appDataEntityId);delete a.pathNodes[0].context[e]}return{path:Mt(a)}},getArrayProps:Un,getAutoCompleteProps:Wn,getCascaderProps:Kn,getCheckboxListProps:An,getCheckboxProps:xn,getCodeProps:qn,getColorPickerProps:Hn,getDataPickerProps:Rn,getDatePickerProps:Sn,getDateRangeProps:zn,getDrawerPlacement:function(t){return Kt[t]||"right"},getDropdownProps:On,getEditorEmits:function(){return{change:(t,e)=>!0,blur:t=>!0,focus:t=>!0,enter:t=>!0,infoTextChange:t=>!0}},getEditorProps:bn,getGridArrayProps:function(){return{...Un(),...In()}},getGridAutoCompleteProps:function(){return{...Wn(),...In()}},getGridCascaderProps:function(){return{...Kn(),...In()}},getGridCheckboxListProps:function(){return{...An(),...In()}},getGridCheckboxProps:function(){return{...xn(),...In()}},getGridCodeProps:function(){return{...qn(),...In()}},getGridColorPickerProps:function(){return{...Hn(),...In()}},getGridDataPickerProps:function(){return{...Rn(),...In()}},getGridDatePickerProps:function(){return{...Sn(),...In()}},getGridDateRangeProps:function(){return{...zn(),...In()}},getGridDropdownProps:function(){return{...On(),...In()}},getGridEditorCommonProps:In,getGridEditorEmits:function(){return{change:(t,e)=>!0,rowSave:()=>!0}},getGridHtmlProps:function(){return{...$n(),...In()}},getGridInputIpProps:function(){return{...En(),...In()}},getGridInputNumberProps:function(){return{...Dn(),...In()}},getGridInputProps:function(){return{...Pn(),...In()}},getGridListBoxProps:function(){return{...Tn(),...In()}},getGridMarkDownProps:function(){return{...Fn(),...In()}},getGridNumberRangeProps:function(){return{...Bn(),...In()}},getGridRadioProps:function(){return{...jn(),...In()}},getGridRateProps:function(){return{...Vn(),...In()}},getGridRawProps:function(){return{...Ln(),...In()}},getGridSliderProps:function(){return{...Mn(),...In()}},getGridSpanProps:function(){return{...Nn(),...In()}},getGridStepperProps:function(){return{...kn(),...In()}},getGridSwitchProps:function(){return{..._n(),...In()}},getGridUploadProps:function(){return{...Gn(),...In()}},getHtmlProps:$n,getInputIpProps:En,getInputNumberProps:Dn,getInputProps:Pn,getListBoxProps:Tn,getMarkDownProps:Fn,getNestedRoutePath:Wt,getNumberRangeProps:Bn,getOrigin:Rt,getOwnRouteContext:kt,getRadioProps:jn,getRateProps:Vn,getRawProps:Ln,getSliderProps:Mn,getSpanProps:Nn,getStepperProps:kn,getSwitchProps:_n,getUploadProps:Gn,isEmptyVNode:function(t){if(!Array.isArray(t))return t===zt;return 1===t.length&&t[0]===zt},onRouteChange:function(t,n){const o=q();if(!o)throw new A("无法正确获取route,可能是依赖问题");e((()=>null==o?void 0:o.path),(()=>{const e=Wt(o,n);t({currentKey:e,fullPath:o.fullPath})}),{immediate:!0})},openViewDrawer:async function(t,e){const n=ibiz.overlay.createDrawer(Ut(t),void 0,e);await n.present();return await n.onWillDismiss()||{ok:!1}},openViewFloatWindow:async function(t,e){const n=ibiz.overlay.createFloatWindow(Ut(t),void 0,e);n.present();return await n.onWillDismiss()||{ok:!1}},openViewModal:async function(t,e){const n=ibiz.overlay.createModal(Ut(t),void 0,e);n.present();return await n.onWillDismiss()||{ok:!1}},openViewPopover:async function(t,e,n){const o=ibiz.overlay.createPopover(Ut(e),void 0,n);o.present(t.target);return await o.onWillDismiss()||{ok:!1}},parseRouteViewData:async function(t,e){var n;const o=Lt(t);let a=o.pathNodes[e-1].viewName;if(!a)throw new A("第".concat(e,"级路由不存在视图标识"));"index"===a&&(a=ibiz.hub.defaultAppIndexViewName);const s=await ibiz.hub.getAppView(a);if(!s)throw new A("找不到视图".concat(a));const r={};(null==(n=ibiz.appData)?void 0:n.context)&&Object.assign(r,ibiz.appData.context);o.appContext&&Object.assign(r,o.appContext);if(1!==e)for(let t=0;t<e;t++){const e=o.pathNodes[t];k(e.context)&&Object.assign(r,e.context)}const{params:i,srfnav:l}=o.pathNodes[e-1];return{viewModel:s,context:r,params:i,srfnav:l}},prepareControl:function(t){const e=Vt("control"),{controlType:n,sysCss:o,codeName:a}=t.model,s=n.toLowerCase(),r=null==o?void 0:o.cssName,i=Vt("control-".concat(s)),l=[e.b(),e.b(s),e.m(a)];r&&l.push(r);return{controlClass:l,ns:i}},renderString:function(t){if(B(t))return"";if("string"==typeof t)return t;try{return t.toString()}catch(e){ibiz.log.error(t,"转换成字符串失败",e)}return""},route2routePath:Lt,routePath2string:Mt,useClickOutside:At,useControlController:Bt,useController:function(t){t.force=St()},useCtx:Tt,useEventListener:jt,useFocusAndBlur:function(t,e){const n=d(),o=d(!1);let a;const s=()=>{o.value||ibiz.log.debug("没有聚焦,不触发失焦"),e(),a.stop(),o.value=!1};return jt(n,"click",(e=>{o.value||(a=At(n,(()=>{s()})),o.value=!0,t())}),{capture:!0}),{componentRef:n,isFocus:o,doBlur:s,pause:()=>{a&&a.pause()},stop:()=>{a&&a.stop()}}},useForce:St,useForceTogether:function(t,e){const n=e.force,o=St();e.force=t=>{n(t),o()}},useMobCtx:function(){return i("ctx")},useNamespace:Vt,useProps:xt,usePropsWatch:function(t,n,o){const a=xt();Object.prototype.hasOwnProperty.call(a,t)&&(e((()=>a[t]),((t,e)=>{n(Rt(t),Rt(e))}),o),n(Rt(a[t]),void 0))},useRouteKey:function(t,n,o){o||(o=d(""));o.value=t.value;const a=new qt(n);return e(t,((t,e)=>{t!==e&&a.nextChange((()=>{o.value=t}))})),o},useRouterQuery:function(){const t=q(),{query:e}=t;return e},useViewController:Yt});const zt=t("EmptyVNode",o("EmptyVNode"));function Tt(){return i("ctx")}function Bt(t,o){const s=Tt(),r=xt();s.evt.emit("onForecast",r.modelData.name);const i=r.provider;let d;d=(null==i?void 0:i.createController)?i.createController(r.modelData,r.context,r.params,s):t(r.modelData,r.context,r.params,s),function(t,n){e((()=>({context:t.context,params:t.params})),(t=>{n.updateContextParams({...t}),ibiz.log.debug("".concat(n.model.id,"的上下文或视图参数变更:"),t)}))}(r,d),function(t,n,o=[]){const a=["context","params","modelData",...o];e((()=>{const e={};return Object.keys(t).forEach((n=>{a.includes(n)||(e[n]=t[n])})),e}),((t,e)=>{const o={};Object.keys(t).forEach((n=>{t[n]!==(e||{})[n]&&(o[n]=t[n])})),ibiz.log.debug("部件 [".concat(n.model.name,"] state 变更"),o),Object.keys(o).forEach((t=>{void 0!==o[t]&&(n.state[t]=o[t])}))}),{immediate:!0})}(r,d,null==o?void 0:o.excludePropsKeys),d.state=l(d.state),c((()=>d.onActivated())),u((()=>d.onDeactivated())),d.force=St();const p=a().proxy;return d.evt.onAll(((t,e)=>{p.$emit(t.slice(2),e)})),p.$emit("controllerAppear",d),d.created(),n((()=>d.destroyed())),d}function jt(t,o,a,s={}){let r=E;return e(t,((t,e)=>{t!==e&&(B(t)?(r(),r=E):r=N((null==t?void 0:t.$el)||t,o,a,s))}),{immediate:!0}),n((()=>{r!==E&&r()})),()=>{r()}}function Vt(t){return new O(t,ibiz.env.namespace)}function Lt(t){const e=t.matched.length,n=[];for(let o=1;o<=e;o++){const e=t.path.split("/")[2*o],a=t.params["params".concat(o)];let s,r,i;s=a&&a!==ibiz.env.routePlaceholder?F.parse(a,{strictNullHandling:!0,delimiter:";"}):void 0,s&&(1===o?(r=s,s=void 0):(s.srfnavctx&&(r=JSON.parse(decodeURIComponent(s.srfnavctx)),delete s.srfnavctx),s.srfnav&&(i=s.srfnav,delete s.srfnav))),n.push({viewName:e,context:r,params:s,srfnav:i})}let o;return t.params.appContext&&t.params.appContext!==ibiz.env.routePlaceholder&&(o=F.parse(t.params.appContext,{strictNullHandling:!0,delimiter:";"})),{appContext:o,pathNodes:n}}function Mt(t){let e="";return t.appContext?e+="/".concat(F.stringify(t.appContext,{delimiter:";",strictNullHandling:!0})):e+="/".concat(ibiz.env.routePlaceholder),t.pathNodes.forEach(((t,n)=>{e+="/".concat(t.viewName,"/");let o={};if(0===n)k(t.context)&&(o=t.context);else{if(o=k(t.params)?t.params:{},k(t.context)){const e=JSON.stringify(t.context);"{}"!==e&&(o.srfnavctx=encodeURIComponent(e))}t.srfnav&&(o.srfnav=t.srfnav)}const a=F.stringify(o,{delimiter:";",strictNullHandling:!0,skipNulls:!0});k(a)?e+=a:e+=ibiz.env.routePlaceholder})),e}function kt(t){const e=t.getOwnContext(),n=["srfsessionid","srfappid","currentSrfNav","toRouteDepth"];return Object.keys(e).forEach((t=>{n.includes(t)&&delete e[t]})),e}const _t=t("excludeViewTypes",[U.DE_GRID_VIEW,U.DE_GRID_EXP_VIEW,U.DE_LIST_VIEW,U.DE_LIST_EXP_VIEW,U.DE_DATA_VIEW,U.DE_DATAVIEW_EXP_VIEW,U.DE_CALENDAR_VIEW,U.DE_CALENDAR_EXP_VIEW,U.DE_CHART_VIEW,U.DE_CHART_EXP_VIEW,U.DE_KANBAN_VIEW]);async function Gt(t,e,n,o){if(n){const a=await ibiz.hub.getAppDataEntity(n,o);let s=K(e,a);if(s||(s={path:"",keys:[a.codeName.toLowerCase()]}),s){const n=t.pathNodes[1].context,o={};s.keys.forEach((t=>{e&&Object.prototype.hasOwnProperty.call(e,t)&&(o[t]=e[t],n&&delete n[t])})),t.pathNodes[0].context=o}}else t.pathNodes[0].context=void 0}function Wt(t,e,n=!0){if(t.matched.length<e)return"";if(t.matched.length===e&&t.name)return t.path;const o=Lt(t);return o.pathNodes.length<e?t.path:(o.pathNodes.length>e&&(o.pathNodes=o.pathNodes.slice(0,e)),n&&delete o.pathNodes[e-1].srfnav,Mt(o))}class qt{constructor(t,n){this.callbacks=[],this.timers=[],this.wait=500,n&&(this.wait=n),e((()=>t.path),((t,e)=>{if(t!==e){if(this.callbacks.length)for(let t=0;t<this.callbacks.length;t++){(0,this.callbacks[t])()}if(this.callbacks=[],this.timers.length)for(let t=0;t<this.timers.length;t++){const e=this.timers[t];clearTimeout(e)}this.timers=[]}}))}nextChange(t){t&&(this.timers.push(setTimeout((()=>{t();const e=this.callbacks.findIndex((e=>e===t));this.callbacks.splice(e,1)}),this.wait)),this.callbacks.push(t))}}t("RouteListener",qt);const $t=t("withInstall",((t,e)=>(t.install=t=>{e(t)},t)));class Ft{constructor(t,e,n){this.component=t,this.render=e,this.opts=n,this.evt=new _,this.init()}static createVueApp(t,e){throw new A("没有注入createVueApp方法")}init(){const t=this,{render:e,opts:n}=this,o=document.createElement("div");document.body.appendChild(o);const a=Ft.createVueApp({mounted(){t.modal=this.$refs.root},unmounted(){document.body.removeChild(o),t.evt.emit("dismiss",t.result)},render:()=>p(t.component,{ref:"root",opts:n,onDismiss(e){t.result=e,a.unmount()}},{default:e})});ibiz.plugin.register(a),a.mount(o),this.vm=a}async present(){return this.modal.present()}async dismiss(t){this.modal.dismiss(t)}async onWillDismiss(){return new Promise((t=>{const e=n=>{t(n),this.evt.off("dismiss",e)};this.evt.on("dismiss",e)}))}}t("OverlayContainer",Ft);function Ut(t){return e=>{const n=h("IBizViewShell");return p(n,{...t,modal:e})}}t("OverlayPopoverContainer",class extends Ft{present(t){return this.modal.present(t)}});const Kt={DRAWER_LEFT:"left",DRAWER_RIGHT:"right",DRAWER_TOP:"top",DRAWER_BOTTOM:"bottom"};class Ht{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)}}t("routerCallback",new class{constructor(){this.map=new Map}async open(t,e){const n=t.currentRoute.value.fullPath;t.push({path:e});const o=e;if(this.map.has(o)){return this.map.get(o).onWillDismiss()}const a=new Ht(n,o);return this.map.set(o,a),this.scheduledDestruction(a),a.onWillDismiss()}close(t,e){const n=this.map.get(t);n&&(n.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)}),1e4)}});function Xt(t){if(["begintime","endtime","createdate","updatedate"].forEach((e=>{Nt(t[e])&&(t[e]=Et(t[e]).format("YYYY-MM-DD HH:mm:ss"))})),!Ot(t.actionresult))try{const e=JSON.parse(t.actionresult);t.actionresult=e}catch(t){}return t}t("useAppStore",Pt("appStore",(()=>{const{allAsyncActions:t,recentAsyncActions:e}=function(){const t=d([]),e=d(0),n=m((()=>t.value.filter(((t,n)=>n<e.value)))),o=n=>{if(!n.data||"ASYNCACTION"!==n.subtype)return;const o=Xt(n.data),a=t.value.findIndex((t=>t.asyncacitonid===o.asyncacitonid));-1===a?(t.value.unshift(o),e.value+=1):a>=e.value?(t.value.splice(a,1),t.value.unshift(o),e.value+=1):t.value.splice(a,1,o)};return(async()=>{const e=await ibiz.asyncAction.fetch();e.data.forEach(Xt),t.value=e.data})(),ibiz.mc.command.asyncAction.on(o),f((()=>{ibiz.mc.command.asyncAction.off(o)})),{allAsyncActions:t,recentAsyncActions:n}}();return{appStore:l({allAsyncActions:t,get recentAsyncActions(){return e.value}})}})));t("useUIStore",Pt("uiStore",(()=>{const t=function(){const t=d(500);return{zIndex:t,increment:function(){return t.value+=1,t.value},decrement:function(){t.value-=1}}}();return{UIStore:l({zIndex:t.zIndex,theme:"light"}),zIndex:t}}))),t("piniaInstance",Dt());function Yt(t){const o=xt(),s=i("ctx",void 0);null==s||s.evt.emit("onForecast",o.modelData.name);const r=o.provider;let d;d=(null==r?void 0:r.createController)?r.createController(o.modelData,o.context,o.params,s):t(o.modelData,o.context,o.params,s),function(t,n){e((()=>({context:t.context,params:t.params})),(t=>{n.context.reset({},t.context),G(n.params),Object.assign(n.params,t.params),n.handleContextParams(),ibiz.log.debug("".concat(n.model.id,"的上下文或视图参数变更:"),t)}))}(o,d),function(t,n){e((()=>t.state?{...t.state}:{}),((t,e)=>{const o={};Object.keys(t).forEach((n=>{t[n]!==(e||{})[n]&&(o[n]=t[n])})),ibiz.log.debug("视图 [".concat(n.model.name,"] state 变更"),o),Object.keys(o).forEach((t=>{n.state[t]=o[t]}))}),{immediate:!0})}(o,d),v("ctx",d.ctx),d.state=l(d.state),d.slotProps=l(d.slotProps),o.modal&&(d.modal=o.modal),c((()=>d.onActivated())),u((()=>d.onDeactivated())),d.force=St();const p=a().proxy;return d.evt.onAll(((t,e)=>{p.$emit(t.slice(2),e)})),d.created(),n((()=>d.destroyed())),d}t("IBizIcon",g({name:"IBizIcon",props:{icon:{type:Object},size:{type:String},baseDir:{type:String,default:"images"}},setup(t){const e=Vt("icon"),n="".concat(ibiz.env.assetsUrl,"/").concat(t.baseDir,"/");const o=m((()=>function(t){if(t){if(t.htmlStr)return y("span",{class:e.b(),innerHTML:t.htmlStr},null);if(t.cssClass)return-1!==t.cssClass.indexOf("fa-")?y("i",{class:[e.b(),t.cssClass]},null):y("ion-icon",{class:e.b(),name:t.cssClass},null);if(t.imagePath)return x(t.imagePath)?y("img",{class:e.b(),src:t.imagePath},null):R(t.imagePath)?y("div",{class:e.b(),innerHTML:t.imagePath},null):t.imagePath.endsWith("svg")?t.imagePath.startsWith("http")?y("img",{class:e.b(),src:t.imagePath},null):y("ion-icon",{src:n+t.imagePath,class:e.b()},null):t.imagePath.startsWith("http")?y("img",{class:e.b(),src:t.imagePath},null):y("img",{class:e.b(),src:n+t.imagePath},null);if(t.rawContent)return R(t.rawContent)?y("div",{class:e.b(),innerHTML:t.rawContent},null):y("img",{class:e.b(),src:t.rawContent},null)}return null}(t.icon)));return()=>o.value}})),t("IBizRouterView",g({name:"IBizRouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object,manualKey:{type:String}},setup(t,{attrs:n}){const o={};let a=!0;e((()=>t.manualKey),((t,e)=>{j(t)&&t!==e&&(a=!0)}));return{renderComp:(e,s)=>{if(!a)return o.vNode;if(a=!1,e){const a={...e.props};delete a.onVnodeUnmounted,delete a.ref;const s=p(e.type,{...a,...n,key:t.manualKey});return o.vNode=s,s}}}},render(){return y(h("router-view"),{name:this.name,route:this.route},{default:({Component:t,route:e})=>{const n=this.renderComp(t,e);return this.$slots.default?this.$slots.default({Component:n,route:e}):n}})}})),t("IBizControlBase",g({name:"IBizControlBase",props:{controller:{type:Object,required:!0}},setup(t){const e=Vt("control"),{controlType:n,sysCss:o,codeName:a}=t.controller.model,s=n.toLowerCase(),r=null==o?void 0:o.cssName,i=t.controller.model,c=t.controller.model.controls,u=l({});return!1===i.controlType.endsWith("EXPBAR")&&(B(i.width)||(u.width="".concat(i.width,"px")),B(i.height)||(u.height="".concat(i.height,"px"))),{ns:e,typeClass:s,sysCssName:r,inlineStyle:u,codeName:a,controls:c,onLayoutPanelCreated:e=>{t.controller.setLayoutPanel(e)}}},render(){var t,e,n;const{state:o,controlPanel:a,providers:s}=this.controller;let r=null;if(o.isCreated&&a){const e={...this.$slots};(null==(t=this.controls)?void 0:t.length)&&this.controls.forEach((t=>{const n=t.name,o={context:this.controller.context,params:this.controller.params},a=e[n];e[n]=a?()=>a(o):()=>{const e=h("IBizControlShell");return p(e,{modelData:t,...o})}}));const n=s[a.name];r=p(h(n.component),{modelData:a,context:this.controller.context,params:this.controller.params,provider:n,container:this.controller,onControllerAppear:this.onLayoutPanelCreated},e)}return y("div",{class:[this.ns.b(),this.ns.b(this.typeClass),this.ns.m(this.codeName),this.sysCssName],style:this.inlineStyle},[r||(null==(n=(e=this.$slots).default)?void 0:n.call(e))])}})),t("IBizControlShell",g({name:"IBizControlShell",props:{modelData:{type:Object,required:!0}},setup(t){i("ctx").evt.emit("onForecast",t.modelData.name);const e=d(!1),n=d(""),o=d();X(t.modelData).then((t=>{t?o.value=t:n.value="未找到对应部件的适配器",e.value=!0})).catch((t=>{ibiz.log.error(t),n.value=t.message,e.value=!0}));return{ns:Vt("control-shell"),isComplete:e,errMsg:n,provider:o}},render(){return this.isComplete&&this.provider?p(h(this.provider.component),{provider:this.provider,...this.$props,...this.$attrs},this.$slots):w(y("div",{class:this.ns.b()},[this.isComplete?this.errMsg:null]),[[C("loading"),!this.isComplete]])}})),t("IBizViewShell",g({name:"IBizViewShell",props:{context:{type:Object,required:!0},params:{type:Object},modelData:{type:Object},viewId:{type:String}},setup(t){const e=Vt("view-shell"),n=d(!1),o=d(""),a=d(),s=d();return(async()=>{let e;if(e=t.modelData?t.modelData:await ibiz.hub.getAppView(t.viewId),!e)throw new A("未找到视图模型");if(1===e.dynaSysMode){const n=e.appViewNavContexts,o={...t.context};if(k(n)){const e=Y(n,t.params||{},t.context);Object.assign(o,e)}const a=e.appViewNavParams;let r={};k(a)&&(r=Y(a,t.params||{},t.context));const i=e.appDataEntityId;let l;i&&(l=await ibiz.hub.getAppDataEntity(i,e.appId));const c={};if(l){const t=o[l.codeName.toLowerCase()];t&&(c.srfkey=t);const e=K(o,l);if(e&&e.keys.length>1){const t=e.keys[e.keys.length-2];c.srfparentkey=o[t],c.srfparentdeanme=t}}if(l&&e.enableWF){if(o[l.codeName.toLowerCase()]){const n=B(t.context.srfsessionid)||V(t.context.srfsessionid),a=W();if(n){const t=ibiz.uiDomainManager.create(a);o.srfsessionid=t.id}const s=ibiz.hub.getApp(e.appId),l=await s.deService.getService(t.context,i),c=await l.get({...t.context,...o},t.params||{});if(c.ok&&c.data){const{srfwftag:n,processdefinitionkey:o,taskdefinitionkey:a}=c.data;if(n&&(r.srfwftag=n),["DEWFDYNAEDITVIEW3","DEWFDYNAEDITVIEW"].includes(e.viewType)){const e=t.params;B(e.processDefinitionKey)&&(e.processDefinitionKey=o),B(e.taskDefinitionKey)&&(e.taskDefinitionKey=a)}}n&&ibiz.uiDomainManager.destroy(a)}}s.value=await ibiz.hub.loadAppView(e.appId,e.id,{...o,...c,...r})}else s.value=e;try{a.value=await Q(e)}catch(t){ibiz.log.error(t),o.value=t.message}finally{n.value=!0}})(),{ns:e,isComplete:n,errMsg:o,viewModelData:s,provider:a}},render(){return this.isComplete&&this.provider?p(h(this.provider.component),{context:this.$props.context,params:this.$props.params,modelData:this.viewModelData,...this.$attrs,provider:this.provider},this.$slots):w(y("div",{class:this.ns.b()},[this.isComplete?this.errMsg:null]),[[C("loading"),!this.isComplete]])}})),t("IBizCodeList",g({name:"IBizCodeList",props:{codeListItems:{type:Array},codeList:{type:Object,required:!0},value:{type:[String,Number]}},emits:{infoTextChange:t=>!0},setup(t,{emit:n}){var o,a;const s=Vt("code-list"),r=d([]),i=(null==(o=t.codeList)?void 0:o.textSeparator)||"、",l=(null==(a=t.codeList)?void 0:a.valueSeparator)||",";e(r,(t=>{let e="";t.length>0&&(e=t.map((t=>t.text)).join(i)),n("infoTextChange",e)}));const c=(t,e)=>{if(t){const n=t.find((t=>t.value==e));if(n)return n;for(let n=0;n<t.length;n++){const o=c(t[n].children,e);if(o)return o}}};e((()=>t.value),((e,n)=>{if(e!==n)if(B(e)||""===e)r.value=[];else{let n;n="string"==typeof e?e.split(l):[e],r.value=n.map((e=>{const n=c(t.codeListItems,e);return{text:(null==n?void 0:n.text)||e,color:null==n?void 0:n.color,textCls:null==n?void 0:n.textCls,sysImage:null==n?void 0:n.sysImage}}))}}),{immediate:!0});const u="未定义"===t.codeList.emptyText?"- - -":t.codeList.emptyText;return{items:r,ns:s,emptyText:u,textSeparator:i}},render(){return y("span",{class:this.ns.b()},[0===this.items.length?this.emptyText:this.items.map(((t,e)=>[0!==e?this.textSeparator:null,y("span",{class:[this.ns.e("item"),t.textCls?t.textCls:null],style:t.color?this.ns.cssVarBlock({"item-color":"".concat(t.color)}):null},[t.sysImage&&y(h("iBizIcon"),{icon:t.sysImage},null),t.text])]))])}})),t("ControlLoadingPlaceholder",g({name:"ControlLoadingPlaceholder",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})}},setup:t=>(i("ctx").evt.emit("onForecast",t.modelData.name),{}),render:()=>null}));class Qt extends J{}t("PanelContainerState",Qt);class Jt extends Z{createState(){var t;return new Qt(null==(t=this.parent)?void 0:t.state)}}function Zt(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)}t("PanelContainerController",Jt);const te=g({name:"IBizPanelContainer",props:{modelData:{type:Object,required:!0},controller:{type:Jt,required:!0}},setup(t){const e=Vt("panel-container"),{id:n}=t.modelData,o=m((()=>{let o=[e.b(),e.m(n)];return o=[...o,...t.controller.containerClass,e.is("hidden",!t.controller.state.visible)],o}));return{ns:e,classArr:o}},render(){var t,e;let n;const o=(null==(e=(t=this.$slots).default)?void 0:e.call(t))||[],a=y(h("iBizRow"),{slot:"content",layout:this.modelData.layout},Zt(n=o.map((t=>{const e=t.props;return e&&e.controller?y(h("iBizCol"),{layoutPos:e.modelData.layoutPos,state:e.controller.state},Zt(t)?t:{default:()=>[t]}):t})))?n:{default:()=>[n]});return y("div",{class:this.classArr,onClick:()=>{this.controller.onClick()}},[this.controller.model.cssStyle?y("style",{type:"text/css"},[this.controller.model.cssStyle]):null,a])}});class ee{constructor(){this.component="IBizPanelContainer"}async createController(t,e,n){const o=new Jt(t,e,n);return await o.init(),o}}t("IBizPanelContainer",$t(te,(function(t){t.component(te.name,te),tt("CONTAINER",(()=>new ee)),tt("CONTAINER_DEFAULT",(()=>new ee))})));const ne=g({name:"IBizPanelCtrlPos",props:{modelData:{type:Object,required:!0},controller:{type:Object,required:!0}},setup(t){i("ctx").evt.on("onRegister",((e,n)=>{e===t.modelData.id&&t.controller.bindControl(n)}));return{ns:Vt("panel-ctrl-pos")}},render(){const{state:t}=this.controller;let e;return this.$slots.default&&(e=this.$slots.default()),y("div",{class:[this.ns.b(),this.ns.m(this.modelData.id),...this.controller.containerClass,this.ns.is("hidden",!t.visible)]},[e||(ibiz.env.dev?"未提供".concat(this.modelData.id,"插槽"):"")])}});class oe extends Z{bindControl(t){this.control=t,t.evt.onAll(((t,e)=>{this.panel.evt.emit("onControlEvent",{triggerControlName:this.model.id,triggerEventName:t,triggerEvent:e})}))}}t("PanelCtrlPosController",oe);class ae{constructor(){this.component="IBizPanelCtrlPos"}async createController(t,e,n){const o=new oe(t,e,n);return await o.init(),o}}t("IBizPanelCtrlPos",$t(ne,(function(t){t.component(ne.name,ne),tt("CTRLPOS",(()=>new ae))})));class se extends Z{}function re(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)}t("ScrollContainerItemController",se);const ie=t("ScrollContainerItem",g({name:"IBizScrollContainerItem",props:{modelData:{type:Object,required:!0},controller:{type:se,required:!0}},setup(t){const e=Vt("scroll-container-item"),{id:n}=t.modelData,o=m((()=>[e.b(),e.m(n),e.is("hidden",!t.controller.state.visible)]));return{ns:e,classArr:o}},render(){var t,e;let n;const o=(null==(e=(t=this.$slots).default)?void 0:e.call(t))||[];return y(h("iBizRow"),{class:this.classArr,layout:{layout:"FLEX"}},re(n=o.map((t=>{const e=t.props;return e&&e.controller?(e.modelData.layoutPos.layout="FLEX",y(h("iBizCol"),{layoutPos:e.modelData.layoutPos,state:e.controller.state},re(t)?t:{default:()=>[t]})):t})))?n:{default:()=>[n]})}}));class le{constructor(){this.component="IBizScrollContainerItem"}async createController(t,e,n){const o=new se(t,e,n);return await o.init(),o}}class ce extends Z{async onInit(){await super.onInit(),this.state.layout.width="100%",this.state.layout.height="100%"}}t("ScrollContainerController",ce);const ue=t("ScrollContainer",g({name:"IBizScrollContainer",props:{modelData:{type:Object,required:!0},controller:{type:ce,required:!0}},setup(t){const e=Vt("scroll-container"),{id:n}=t.modelData,o=m((()=>[e.b(),e.m(n),...t.controller.containerClass,e.is("hidden",!t.controller.state.visible)]));return{ns:e,classArr:o}},render(){var t,e;let n=null,o=null,a=null,s=null,r=null;const i={};((null==(e=(t=this.$slots).default)?void 0:e.call(t))||[]).forEach((t=>{const e=t.props;if(!e||!e.controller)return;const{width:l,height:c}=e.controller.state.layout;switch(e.modelData.layoutPos.layoutPos){case"WEST":n=t,i.left={width:l};break;case"EAST":a=t,i.right={width:l};break;case"NORTH":o=t,i.top={height:c};break;case"SOUTH":s=t,i.bottom={height:c};break;case"CENTER":r=t;break;default:ibiz.log.debug("未适配的布局占位".concat(e.modelData.layoutPos.layoutPos))}}));for(const t in i)(i[t].width||i[t].height)&&(i[t].flexShrink=0);return y("div",{class:this.classArr},[y("div",{class:[this.ns.e("header")],style:i.top},[o]),y("div",{class:[this.ns.b("content")]},[y("div",{class:this.ns.be("content","left"),style:i.left},[n]),y("div",{class:this.ns.be("content","center")},[r]),y("div",{class:this.ns.be("content","right"),style:i.right},[a])]),y("div",{class:[this.ns.e("footer")],style:i.bottom},[s])])}}));class de{constructor(){this.component="IBizScrollContainer"}async createController(t,e,n){const o=new ce(t,e,n);return await o.init(),o}}t("IBizScrollContainer",$t(ue,(function(t){t.component(ue.name,ue),t.component(ie.name,ie),tt("CONTAINER_CONTAINER_SCROLL",(()=>new de)),tt("CONTAINER_CONTAINER_SCROLL_LEFT",(()=>new le)),tt("CONTAINER_CONTAINER_SCROLL_HEADER",(()=>new le)),tt("CONTAINER_CONTAINER_SCROLL_RIGHT",(()=>new le)),tt("CONTAINER_CONTAINER_SCROLL_BOTTOM",(()=>new le)),tt("CONTAINER_CONTAINER_SCROLL_MAIN",(()=>new le))})));class pe extends J{constructor(){super(...arguments),this.cache=!0,this.routeOpen=!0,this.currentKey="",this.cacheKeys=["RouterShell"],this.navViewMsgs={}}}t("NavPosState",pe);const he=["is404","isRoutePushed"];class me extends Z{constructor(){super(...arguments),this.viewModals={},this.refCtrlKeys=[],this.rawItemParams={}}get route(){return this.router.currentRoute.value}getExpItemIsCache(t){return"CACHE"===this.rawItemParams.expcache||"NO_CACHE"!==this.rawItemParams.expcache&&t.isCache}setRouter(t){this.router=t}async onInit(){var t;await super.onInit(),this.handleRawItemParams(),(null==(t=this.model.rawItem)?void 0:t.rawItemParams)&&this.model.rawItem.rawItemParams.find((t=>!("REFCTRL"!==t.key||!t.value)&&(this.refCtrlKeys=t.value.split(";").map((t=>t.toLowerCase())),!0))),this.panel.evt.on("onControlEvent",(t=>{if((0===this.refCtrlKeys.length||this.refCtrlKeys.includes(t.triggerControlName))&&"onNavViewChange"===t.triggerEventName){const e=t.triggerEvent;this.openView(e.navViewMsg)}}));const e=this.rawItemParams.expmode||this.panel.view.params.expmode;"ROUTE"===e&&this.routeDepth?this.state.routeOpen=!0:this.state.routeOpen="NO_ROUTE"!==e&&!!this.routeDepth,this.panel.view.params.expmode&&delete this.panel.view.params.expmode}createState(){var t;return new pe(null==(t=this.parent)?void 0:t.state)}get routeDepth(){return this.panel.view.modal.routeDepth}calcCacheKey(t){return t?"".concat(t.viewId,"___").concat(t.key):""}onRouteChange(t){if(this.curNavViewMsg){const e=this.calcCacheKey(this.curNavViewMsg);this.state.currentKey=e,this.state.navViewMsgs[e].fullPath=t.fullPath}}setNavViewMsgs(t){t.isRoutePushed=!0===t.isRoutePushed;const e=this.calcCacheKey(t);this.state.navViewMsgs[e]?(L(this.state.navViewMsgs[e],t),he.forEach((n=>{Object.prototype.hasOwnProperty.call(t,n)&&(this.state.navViewMsgs[e][n]=void 0)}))):(this.state.navViewMsgs[e]=t,this.getExpItemIsCache(t)&&this.state.cacheKeys.push(e),this.viewModals[e]=new et({mode:this.routeDepth?nt.ROUTE:nt.EMBED,routeDepth:this.routeDepth?this.routeDepth+1:void 0,dismiss:()=>{this.dismiss(e)}})),this.curNavViewMsg=this.state.navViewMsgs[e]}dismiss(t){ibiz.log.debug(this.constructor.name,"dismiss",t)}onViewCreated(t){ibiz.log.debug(this.constructor.name,"onViewCreated",t)}toBlankRoute(){const t=Wt(this.route,this.routeDepth);this.router.push(t)}openView(t){if(!t.key)return this.state.currentKey=this.calcCacheKey(t),void(this.routeDepth&&this.state.routeOpen&&this.toBlankRoute());this.routeDepth&&this.state.routeOpen?this.openViewByPath(t):this.openViewByModel(t)}openViewByPath(t){const e=this.calcCacheKey(t);this.setNavViewMsgs(t);if(!0===t.isRoutePushed)return this.state.currentKey=e,void(this.state.navViewMsgs[this.calcCacheKey(this.curNavViewMsg)].fullPath=this.route.fullPath);if(t.is404){const t=Wt(this.route,this.routeDepth,!1);this.router.push("".concat(t,"/404"))}else if(this.state.navViewMsgs[e].fullPath&&this.getExpItemIsCache(t))this.router.push(this.state.navViewMsgs[e].fullPath);else{const n=Object.assign(t.context.clone(),{toRouteDepth:this.routeDepth+1});this.getExpItemIsCache(t)&&this.state.cacheKeys.push(e),ibiz.commands.execute(ot.TAG,t.viewId,n,t.params,{openMode:"INDEXVIEWTAB"})}}openViewByModel(t){this.setNavViewMsgs(t),this.state.currentKey=this.calcCacheKey(t)}handleRawItemParams(){var t;let e={};const n=null==(t=this.model.rawItem)?void 0:t.rawItemParams;k(n)&&(e=n.reduce(((t,e)=>(t[e.key.toLowerCase()]=e.value,t)),{})),Object.assign(this.rawItemParams,e)}}function fe(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)}t("NavPosController",me);const ve=g({name:"IBizNavPos",props:{modelData:{type:Object,required:!0},controller:{type:me,required:!0}},setup(t){const n=t.controller,o=Vt("nav-pos"),a=$(),s=q();if(n.setRouter(a),n.routeDepth){const t=Wt(s,n.routeDepth);e((()=>s.fullPath),(()=>{const e=Wt(s,n.routeDepth);t===e&&s.matched.length>n.routeDepth&&n.onRouteChange(s)}),{immediate:!0})}return{ns:o,c:n,onViewCreated:t=>{n.onViewCreated(t)}}},render(){const{viewModals:t,state:e}=this.c,{currentKey:n,cacheKeys:o,navViewMsgs:a,cache:s}=e;let r=null;if(e.routeOpen)r=y(h("iBizRouterView"),{manualKey:n,modal:t[n],onCreated:this.onViewCreated},{default:({Component:t})=>{const e=""!==n&&t?y(t,null,null):null;return s?y(h("keepAlive"),{include:o,max:30,isKey:!0},fe(e)?e:{default:()=>[e]}):e}});else{const t=n?p(h("IBizViewShell"),{context:a[n].context,params:a[n].params,key:n,viewId:a[n].viewId,onCreated:this.onViewCreated}):null;r=s?y(h("keepAlive"),{include:o,max:30,isKey:!0},fe(t)?t:{default:()=>[t]}):t}return y("div",{class:[this.ns.b(),this.ns.m(this.modelData.id),...this.controller.containerClass]},[r])}});class ge{constructor(){this.component="IBizNavPos"}async createController(t,e,n){const o=new me(t,e,n);return await o.init(),o}}t("IBizNavPos",$t(ve,(function(t){t.component(ve.name,ve),tt("RAWITEM_NAV_POS",(()=>new ge))})));class ye extends J{}class we extends Z{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 ye(null==(t=this.parent)?void 0:t.state)}async onInit(){await super.onInit(),this.state.required=!this.model.allowEmpty,this.model.editor&&"HIDDEN"!==this.model.editor.editorType&&(this.editorProvider=await at(this.model.editor),this.editorProvider&&(this.editor=await this.editorProvider.createController(this.model.editor,this)))}async setDataValue(t,e){const{id:n}=this.model;e=e||n,this.dataParent.setDataValue&&await this.dataParent.setDataValue(e,t),this.panel.evt.emit("onPanelItemEvent",{panelItemName:this.model.id,panelItemEventName:st.CHANGE})}onFocus(t){this.panel.evt.emit("onPanelItemEvent",{panelItemName:this.model.id,panelItemEventName:st.FOCUS,event:t})}onBlur(t){this.panel.evt.emit("onPanelItemEvent",{panelItemName:this.model.id,panelItemEventName:st.BLUR,event:t})}onEnter(t){this.panel.evt.emit("onPanelItemEvent",{panelItemName:this.model.id,panelItemEventName:st.ENTER,event:t})}}t("PanelFieldController",we);const Ce=g({name:"IBizPanelField",props:{modelData:{type:Object,required:!0},controller:{type:we,required:!0}},setup(t){const e=Vt("panel-field"),n=m((()=>{const{id:n}=t.modelData,o=[e.b(),e.m(n)];return o.push(...t.controller.containerClass),o}));return{ns:e,classArr:n,onValueChange:(e,n)=>{t.controller.setDataValue(e,n)}}},render(){let t=null;if(this.controller.data){const e={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:t=>this.controller.onFocus(t),onBlur:t=>this.controller.onBlur(t),onEnter:t=>this.controller.onEnter(t)};if(this.$slots.default)t=this.$slots.default(e);else if(this.controller.editorProvider){const n=h(this.controller.editorProvider.formEditor);t=p(n,{...e})}else t=y(h("not-supported-editor"),{modelData:this.modelData.editor},null)}return y("div",{class:this.classArr,onClick:()=>{this.controller.onClick()}},[t])}});class be{constructor(){this.component="IBizPanelField"}async createController(t,e,n){const o=new we(t,e,n);return await o.init(),o}}t("IBizPanelField",$t(Ce,(function(t){t.component(Ce.name,Ce),tt("FIELD",(()=>new be))})));class Ie extends Z{get data(){return this.dataParent.data}async onInit(){await super.onInit()}}t("PanelRawItemController",Ie);const Pe=g({name:"IBizPanelRawItem",props:{modelData:{type:Object,required:!0},controller:{type:Ie,required:!0}},setup(t){const e=Vt("panel-rawitem"),n=m((()=>{const{id:n}=t.modelData,o=[e.b(),e.m(n)];return o.push(...t.controller.containerClass),o}));return{ns:e,classArr:n}},render(){if(this.controller.state.visible)return y("div",{class:this.classArr,onClick:()=>{this.controller.onClick()}},[y(h("iBizRawItem"),{rawItem:this.modelData},null)])}});class De{constructor(){this.component="IBizPanelRawItem"}async createController(t,e,n){const o=new Ie(t,e,n);return await o.init(),o}}t("IBizPanelRawItem",$t(Pe,(function(t){t.component(Pe.name,Pe),tt("RAWITEM",(()=>new De)),tt("RAWITEM_STATIC_IMAGE",(()=>new De)),tt("RAWITEM_STATIC_LABEL",(()=>new De)),tt("RAWITEM_STATIC_TEXT",(()=>new De))})));class Ee extends J{constructor(){super(...arguments),this.data={}}}class Ne{constructor(t,e,n,o){this.model=t,this.panel=e,this.parent=n,this.state=new Ee,this.isDataContainer=!0,this.panelItems={},this.state.data=o;const a=rt(this.model).map((t=>t.id));o._evt.on("change",(t=>{a.includes(t)&&this.childDataChangeNotify([t])}))}get data(){return this.state.data}async init(){await this.initChildrenController()}async initChildrenController(t=this.model.panelItems,e=this.panel,n=this){t&&await Promise.all(t.map((async t=>{var o,a;const s=this.parent.providers[t.id];if(!s)return;const r=await s.createController(t,e,n);this.panelItems[t.id]=r,(null==(o=t.panelItems)?void 0:o.length)&&!it(t)?await this.initChildrenController(t.panelItems,e,r):(null==(a=t.panelTabPages)?void 0:a.length)&&await this.initChildrenController(t.panelTabPages,e,r)})))}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;null==(e=(t=this.data).destroy)||e.call(t),Object.values(this.panelItems).forEach((t=>{t.destroy()}))}}class Oe extends J{constructor(){super(...arguments),this.items=[]}}t("MultiDataContainerState",Oe);class Ae extends Z{constructor(){super(...arguments),this.isDataContainer=!0,this.dataItems=[],this.providers={}}get data(){return this.state.items}createState(){var t;return new Oe(null==(t=this.parent)?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 t=>{var e,n;const o=await lt(t);o&&(this.providers[t.id]=o,(null==(e=t.panelItems)?void 0:e.length)&&!it(t)&&await this.initPanelItemProviders(t.panelItems),(null==(n=t.panelTabPages)?void 0:n.length)&&await this.initPanelItemProviders(t.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 z(this.model,"没有配置数据对象名称");this.bindViewData(this.panel.getTopView(),e);break;case"VIEWSESSIONPARAM":if(!e)throw new z(this.model,"没有配置数据对象名称");this.bindViewData(this.panel.view,e);break;default:throw new S(this.model,"数据源类型".concat(t,"暂未支持"))}}childrenStateNotify(t){this.dataItems.forEach((e=>{e.panelStateNotify(t)}))}async setData(t){const e=rt(this.model),n=t.map((t=>new ct(e,t)));this.dataItems=n.map((t=>new Ne(this.model,this.panel,this,t))),this.dataItems.length&&await Promise.all(this.dataItems.map((t=>t.init()))),this.state.items=n,this.childrenStateNotify(ut.LOAD)}async setDataByDeLogic(){const{appDataEntityId:t,appDELogicId:e}=this.model;if(!e)throw new z(this.model,"没有配置实体逻辑");if(!t)throw new z(this.model,"没有配置实体");const n=await dt(e,t,this.panel.context,[],this.panel.params);if(!n)throw new A("实体逻辑".concat(e,"没有返回值"));this.setData(n)}setDataByAppGlobalParam(){const{dataName:t}=this.model,e=t?ibiz.appData[t]:ibiz.appData;e?this.setData(e):ibiz.log.error("全局变量里没有".concat(t,"属性"))}async setDataByDeMethod(){const{appDEMethodId:t,appDataEntityId:e}=this.model;if(!t)throw new z(this.model,"没有配置实体行为");if(!e)throw new z(this.model,"没有配置实体");const n=ibiz.hub.getApp(this.panel.context.srfappid),o=await n.deService.exec(e,t,this.panel.context,[],this.panel.params);o.ok&&o.data&&this.setData(o.data)}bindViewData(t,e){if(!Object.prototype.hasOwnProperty.call(t.state,e))return void ibiz.log.error("绑定视图的会话不存在".concat(e));const n=()=>{const n=t.state[e];n?this.setData(n):ibiz.log.error("视图state里没有".concat(e,"属性"))};n(),t.evt.on("onDataChange",(()=>{n()}))}setDataValue(t,e){throw new Error("Method not implemented.")}destroy(){super.destroy(),this.dataItems.forEach((t=>{t.destroy()}))}}t("MultiDataContainerController",Ae);const xe=g({name:"IBizMultiDataContainer",props:{modelData:{type:Object,required:!0},controller:{type:Ae,required:!0}},setup(t){const n=Vt("multi-data-container"),{id:o}=t.modelData;e((()=>t.controller.state.items),(()=>{t.controller.dataItems.forEach((t=>{t.state=l(t.state);Object.keys(t.panelItems).forEach((e=>{const n=t.panelItems[e];n.state=l(n.state)}))}))}),{immediate:!0});const a=i("renderPanelItem"),s=m((()=>[n.b(),n.m(o),...t.controller.containerClass]));return{ns:n,classArr:s,renderPanelItem:a}},render(){let t;return t=this.$slots.default?this.$slots.default():this.controller.state.items.map(((t,e)=>{const n=this.controller.dataItems[e];return y(h("iBizRow"),{class:this.ns.b("content"),layout:this.modelData.layout},{default:()=>{var t;return[null==(t=this.modelData.panelItems)?void 0:t.map((t=>{let e;const o=n.panelItems[t.id];return y(h("iBizCol"),{layoutPos:t.layoutPos,state:o.state},"function"==typeof(a=e=this.renderPanelItem(t,{providers:this.controller.providers,panelItems:n.panelItems}))||"[object Object]"===Object.prototype.toString.call(a)&&!b(a)?e:{default:()=>[e]});var a}))]}})})),y("div",{class:this.classArr},[t])}});class Re{constructor(){this.component="IBizMultiDataContainer"}async createController(t,e,n){const o=new Ae(t,e,n);return await o.init(),o}}t("IBizMultiDataContainer",$t(xe,(function(t){t.component(xe.name,xe),tt("CONTAINER_CONTAINER_MULTIDATA",(()=>new Re))})));class Se extends J{constructor(){super(...arguments),this.data={}}}t("SingleDataContainerState",Se);class ze extends Z{constructor(){super(...arguments),this.isDataContainer=!0,this.panelItems={},this.providers={}}get data(){return this.state.data}createState(){var t;return new Se(null==(t=this.parent)?void 0:t.state)}async onInit(){await super.onInit(),await this.initPanelItemControllers(),this.initContainerData()}async initPanelItemControllers(t=this.model.panelItems,e=this.panel,n=this){t&&await Promise.all(t.map((async t=>{var o,a;const s=await lt(t);if(!s)return;this.providers[t.id]=s;const r=await s.createController(t,e,n);this.panelItems[t.id]=r,(null==(o=t.panelItems)?void 0:o.length)&&!it(t)&&await this.initPanelItemControllers(t.panelItems,e,r),(null==(a=t.panelTabPages)?void 0:a.length)&&await this.initPanelItemControllers(t.panelTabPages,e,r)})))}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 z(this.model,"没有配置数据对象名称");this.bindViewData(this.panel.getTopView(),e);break;case"VIEWSESSIONPARAM":if(!e)throw new z(this.model,"没有配置数据对象名称");this.bindViewData(this.panel.view,e);break;default:throw new S(this.model,"数据源类型".concat(t,"暂未支持"))}}childrenStateNotify(t){Object.values(this.panelItems).forEach((e=>{e.panelStateNotify(t)}))}async setData(t){var e,n;const o=rt(this.model),a=o.map((t=>t.id)),s=new ct(o,t);s._evt.on("change",(t=>{a.includes(t)&&this.childDataChangeNotify([t])})),null==(n=(e=this.data).destroy)||n.call(e),this.state.data=s,this.childrenStateNotify(ut.LOAD)}async setDataByDeLogic(){const{appDataEntityId:t,appDELogicId:e}=this.model;if(!e)throw new z(this.model,"没有配置实体逻辑");if(!t)throw new z(this.model,"没有配置实体");const n=await dt(e,t,this.panel.context,[],this.panel.params);if(!n)throw new A("实体逻辑".concat(e,"没有返回值"));this.setData(n)}setDataByAppGlobalParam(){const{dataName:t}=this.model,e=t?ibiz.appData[t]:ibiz.appData;e?this.setData(e):ibiz.log.error("全局变量里没有".concat(t,"属性"))}async setDataByDeMethod(){const{appDEMethodId:t,appDataEntityId:e}=this.model;if(!t)throw new z(this.model,"没有配置实体行为");if(!e)throw new z(this.model,"没有配置实体");const n=ibiz.hub.getApp(this.panel.context.srfappid),o=await n.deService.exec(e,t,this.panel.context,[],this.panel.params);o.ok&&o.data&&this.setData(o.data)}bindViewData(t,e){if(!Object.prototype.hasOwnProperty.call(t.state,e))return void ibiz.log.error("绑定视图的会话不存在".concat(e));const n=()=>{const n=t.state[e];n?this.setData(n):ibiz.log.error("视图state里没有".concat(e,"属性"))};n(),t.evt.on("onDataChange",(()=>{n()}))}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(),null==(e=(t=this.data).destroy)||e.call(t),Object.values(this.panelItems).forEach((t=>{t.destroy()}))}}t("SingleDataContainerController",ze);const Te=g({name:"IBizSingleDataContainer",props:{modelData:{type:Object,required:!0},controller:{type:ze,required:!0}},setup(t){const e=Vt("single-data-container"),{id:n}=t.modelData;Object.keys(t.controller.panelItems).forEach((e=>{const n=t.controller.panelItems[e];n.state=l(n.state)}));const o=i("renderPanelItem"),a=m((()=>[e.b(),e.m(n),...t.controller.containerClass]));return{ns:e,classArr:a,renderPanelItem:o}},render(){let t;return t=this.$slots.default?this.$slots.default():y(h("iBizRow"),{class:this.ns.b("content"),layout:this.modelData.layout},{default:()=>{var t;return[null==(t=this.modelData.panelItems)?void 0:t.map((t=>{let e;const n=this.controller.panelItems[t.id];return y(h("iBizCol"),{layoutPos:t.layoutPos,state:n.state},"function"==typeof(o=e=this.renderPanelItem(t,{providers:this.controller.providers,panelItems:this.controller.panelItems}))||"[object Object]"===Object.prototype.toString.call(o)&&!b(o)?e:{default:()=>[e]});var o}))]}}),y("div",{class:this.classArr},[t])}});class Be{constructor(){this.component="IBizSingleDataContainer"}async createController(t,e,n){const o=new ze(t,e,n);return await o.init(),o}}t("IBizSingleDataContainer",$t(Te,(function(t){t.component(Te.name,Te),tt("CONTAINER_CONTAINER_SINGLEDATA",(()=>new Be))})));class je extends J{}t("GridContainerState",je);class Ve extends Z{createState(){var t;return new je(null==(t=this.parent)?void 0:t.state)}}function Le(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)}t("GridContainerController",Ve);const Me=g({name:"IBizGridContainer",props:{modelData:{type:Object,required:!0},controller:{type:Ve,required:!0}},setup(t){const e=Vt("grid-container"),{id:n}=t.modelData,o=m((()=>{let o=[e.b(),e.m(n)];return o=[...o,...t.controller.containerClass,e.is("hidden",!t.controller.state.visible)],o})),a=m((()=>({...t.modelData.layout,layout:"TABLE_12COL"}))),s=d(void 0),r=d(12);return{ns:e,classArr:o,layoutModel:a,convertLayoutPos:(t,e)=>{const n={...t,layout:"TABLE_12COL",colXS:t.grow||e,colSM:t.grow||e,colMD:t.grow||e,colLG:t.grow||e};return delete n.grow,n},adaptGrow:r,adaptCols:s}},render(){var t,e;let n;const o=(null==(e=(t=this.$slots).default)?void 0:e.call(t))||[];if(void 0===this.adaptCols){let t=0,e=0;o.forEach((n=>{const o=n.props;o&&o.modelData&&o.modelData.layoutPos&&("number"==typeof o.modelData.layoutPos.grow?t+=o.modelData.layoutPos.grow:void 0===o.modelData.layoutPos.grow&&(e+=1))}));let n=12;e>0&&(n=(12-t)/e),this.adaptCols=e,this.adaptGrow=n}return y(h("iBizRow"),{class:this.classArr,layout:this.layoutModel},Le(n=o.map((t=>{const e=t.props;return e&&e.controller?y(h("iBizCol"),{layoutPos:this.convertLayoutPos(e.modelData.layoutPos,this.adaptGrow),state:e.controller.state},Le(t)?t:{default:()=>[t]}):t})))?n:{default:()=>[n]})}});class ke{constructor(){this.component="IBizGridContainer"}async createController(t,e,n){const o=new Ve(t,e,n);return await o.init(),o}}t("IBizGridContainer",$t(Me,(function(t){t.component(Me.name,Me),tt("CONTAINER_CONTAINER_GRID",(()=>new ke))})));class _e extends J{}t("PanelContainerImageState",_e);class Ge extends Z{createState(){var t;return new _e(null==(t=this.parent)?void 0:t.state)}}function We(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)}t("PanelContainerImageController",Ge);const qe=g({name:"IBizPanelContainerImage",props:{modelData:{type:Object,required:!0},controller:{type:Ge,required:!0}},setup(t){const e=Vt("panel-container-image"),{id:n}=t.modelData,o=m((()=>{let o=[e.b(),e.m(n)];return o=[...o,...t.controller.containerClass,e.is("hidden",!t.controller.state.visible)],o})),a=m((()=>{const e=t.controller.model.sysImage,n={};let o="";return(null==e?void 0:e.rawContent)?o=R(e.rawContent)?"url(data:image/svg+xml;base64,".concat(btoa(e.rawContent),")"):"url(".concat(e.rawContent,")"):(null==e?void 0:e.imagePath)&&(o="url(".concat(e.imagePath,")")),o&&Object.assign(n,{backgroundImage:o}),n}));return{ns:e,classArr:o,backgroundStyle:a}},render(){var t,e;let n;const o=(null==(e=(t=this.$slots).default)?void 0:e.call(t))||[],a=y(h("iBizRow"),{slot:"content",layout:this.modelData.layout},We(n=o.map((t=>{const e=t.props;return e&&e.controller?y(h("iBizCol"),{layoutPos:e.modelData.layoutPos,state:e.controller.state},We(t)?t:{default:()=>[t]}):t})))?n:{default:()=>[n]});return y("div",{class:this.classArr,onClick:()=>{this.controller.onClick()},style:this.backgroundStyle},[this.controller.model.cssStyle?y("style",{type:"text/css"},[this.controller.model.cssStyle]):null,a])}});class $e{constructor(){this.component="IBizPanelContainerImage"}async createController(t,e,n){const o=new Ge(t,e,n);return await o.init(),o}}t("IBizPanelContainerImage",$t(qe,(function(t){t.component(qe.name,qe),tt("CONTAINER_CONTAINER_IMAGE",(()=>new $e))})));class Fe extends J{}t("PanelContainerGroupState",Fe);class Ue extends Z{createState(){var t;return new Fe(null==(t=this.parent)?void 0:t.state)}get disableClose(){const{titleBarCloseMode:t}=this.model;return 0===t||void 0===t}get defaultExpansion(){const{titleBarCloseMode:t}=this.model;return this.disableClose||1===t}}t("PanelContainerGroupController",Ue);class Ke{constructor(){this.component="IBizPanelContainerGroup"}async createController(t,e,n){const o=new Ue(t,e,n);return await o.init(),o}}function He(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)}const Xe=g({name:"IBizPanelContainerGroup",props:{modelData:{type:Object,required:!0},controller:{type:Ue,required:!0}},setup(t){const e=Vt("panel-container-group"),n=d(!t.controller.defaultExpansion);return{ns:e,captionText:m((()=>{const{captionItemName:e,caption:n,capLanguageRes:o}=t.modelData;if(e)return t.controller.data[e];let a=n;return o&&(a=ibiz.i18n.t(o.lanResTag,n)),a})),changeCollapse:()=>{t.controller.disableClose||(n.value=!n.value)},isCollapse:n}},render(){var t,e;let n;const o=[this.ns.b(),this.ns.m(this.modelData.id),...this.controller.containerClass,this.ns.is("hidden",!this.controller.state.visible)];!0===this.modelData.showCaption&&(o.push(this.ns.m("show-header")),o.push(this.ns.b("collapse")),o.push(this.ns.is("collapse",this.isCollapse)),this.controller.disableClose&&o.push(this.ns.bm("collapse","disable-close")));const a=(null==(e=(t=this.$slots).default)?void 0:e.call(t))||[],s=y(h("iBizRow"),{slot:"content",layout:this.modelData.layout},He(n=a.map((t=>{const e=t.props;return e&&e.controller?y(h("iBizCol"),{layoutPos:e.modelData.layoutPos,state:e.controller.state},He(t)?t:{default:()=>[t]}):t})))?n:{default:()=>[n]});let r=null;return this.modelData.showCaption&&(r=y("div",{class:[this.ns.b("header")],onClick:this.changeCollapse},[y("div",{class:[this.ns.be("header","left")]},[y("div",{class:[this.ns.e("caption"),...this.controller.labelClass]},[this.captionText])]),y("div",{class:[this.ns.be("header","right")]},[void 0!==this.modelData.titleBarCloseMode&&0!==this.modelData.titleBarCloseMode&&(this.isCollapse?y("ion-icon",{name:"caret-forward-sharp"},null):y("ion-icon",{name:"caret-down-sharp"},null))])])),y("div",{class:o},[r,y("div",{class:[this.ns.b("content")]},[s])])}});t("IBizPanelContainerGroup",$t(Xe,(function(t){t.component(Xe.name,Xe),tt("CONTAINER_CONTAINER_GROUP",(()=>new Ke))})));function Ye(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)}const Qe=g({name:"IBizPanelTabPage",props:{modelData:{type:Object,required:!0},controller:{type:Z,required:!0}},setup(t){const e=Vt("panel-tab-page"),n=m((()=>{const{id:n}=t.modelData,o=[e.b(),e.m(n)];return o.push(...t.controller.containerClass),o}));return{ns:e,classArr:n}},render(){var t,e;let n;const o=(null==(e=(t=this.$slots).default)?void 0:e.call(t))||[];return y(h("iBizRow"),{class:[this.ns.b(),this.ns.m(this.modelData.codeName),this.classArr],layout:this.modelData.layout},Ye(n=o.map((t=>{const e=t.props;if(!e||!e.controller)return t;const n=e.controller;return y(h("iBizCol"),{layoutPos:n.model.layoutPos,state:n.state},Ye(t)?t:{default:()=>[t]})})))?n:{default:()=>[n]})}});class Je{constructor(){this.component="IBizPanelTabPage"}async createController(t,e,n){const o=new Z(t,e,n);return await o.init(),o}}t("IBizPanelTabPage",$t(Qe,(function(t){t.component(Qe.name,Qe),tt("TABPAGE",(()=>new Je))})));class Ze extends Z{getPanelItemCustomHtml(t,e){if(0===t.length)return;const n=t[0];return n.layoutPanelModel?pt.execScriptFn({data:e||{}},n.layoutPanelModel,{singleRowReturn:!0,isAsync:!1}):void 0}}const tn=g({name:"IBizPanelItemRender",props:{modelData:{type:Object,required:!0},controller:{type:Ze,required:!0}},setup(t){var e;const n=Vt("panel-item-render"),o=Vt("panel-".concat(null==(e=t.modelData.itemType)?void 0:e.toLowerCase())),{id:a}=t.modelData,s=m((()=>[n.b(),n.m(a),o.b(),n.is("hidden",!t.controller.state.visible)])),r=m((()=>t.controller.getPanelItemCustomHtml(t.modelData.controlRenders,t.controller.data)));return{ns:n,classArr:s,htmlCode:r}},render(){return y("div",{class:this.classArr,innerHTML:this.htmlCode},null)}});class en{constructor(){this.component="IBizPanelItemRender"}async createController(t,e,n){const o=new Ze(t,e,n);return await o.init(),o}}t("IBizPanelItemRender",$t(tn,(function(t){t.component(tn.name,tn),tt("PREDEFINE_RENDER",(()=>new en))}))),t("AppRedirectView",g({setup(){var t;const e=T.create((null==(t=ibiz.appData)?void 0:t.context)||{});f((()=>{e.destroy()}));const{href:n}=window.location;I((()=>ibiz.util.hiddenAppLoading())),async function(){await ht(e,n)}()},render:()=>y("div",null,[P("重定向跳转中")])}));class nn{constructor(){this.component="IBizView"}}const on=g({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 t=Vt("view"),e=Yt(((...t)=>new mt(...t))),n=ft(e.model),{viewType:o,sysCss:a,codeName:s}=e.model,r=o.toLowerCase(),i=null==a?void 0:a.cssName,l=m((()=>[t.b(),t.b(r),t.m(s),i,e.state.viewMessages.TOP?"has-top-message":"",e.state.viewMessages.BOTTOM?"has-bottom-message":""])),c=d(null),u=W(),p=window.devtool;I((()=>{p&&p.registerView(u,e,c)})),f((()=>{p&&p.unRegisterView(u)}));return{c:e,controls:n,viewClassNames:l,container:c,onLayoutPanelCreated:t=>{e.setLayoutPanel(t)},renderViewMessage:n=>{if(e.state.isCreated){const o=e.state.viewMessages[n];if(null==o?void 0:o.length)return y(h("view-message"),{class:[t.e("".concat(n.toLowerCase(),"-message"))],messages:o},null)}return null}}},render(){var t;let e=null;if(this.c.state.isCreated){const n={...this.$slots};if((null==(t=this.controls)?void 0:t.length)&&this.controls.forEach((t=>{const e=t.name||t.id,o={context:this.c.context,params:this.c.params};this.c.slotProps[e]&&Object.assign(o,this.c.slotProps[e]);const a=n[e];if(a)return void(n[e]=()=>a(o));const s=this.c.providers[e];s&&(n[e]=()=>{const e=h(s.component);return p(e,{modelData:t,...o,provider:s})})})),0===this.c.engines.length)e=y("span",{style:"color:red;"},[P("视图类型"),this.modelData.viewType,P("暂未支持")]);else{const t=this.c.model.viewLayoutPanel,o=this.c.providers[t.name];e=p(h(o.component),{modelData:t,context:this.c.context,params:this.c.params,provider:o,container:this.c,onControllerAppear:this.onLayoutPanelCreated},n)}}return w(y("div",{ref:"container",class:this.viewClassNames},[this.renderViewMessage("TOP"),e,this.renderViewMessage("BOTTOM")]),[[C("loading"),this.c.state.isLoading]])}});t("IBizView",$t(on,(function(t){t.component(on.name,on),vt("DEFAULT",(()=>new nn))}))),t("TodoRedirect",g({setup(){const t=$(),{href:e}=window.location,n=e.lastIndexOf("?"),o=decodeURIComponent(e.substring(n+1,e.length));if(!o)throw new Error("重定向参数不足无法跳转");const a=F.parse(o,{delimiter:";"}),{apptype:s,todotype:r,todoid:i}=a,l={srfapptype:"pc",srfapp:""};s||(l.todourltype="RouterUrl"),async function(){let e=(await ibiz.net.post("/systodos/".concat(i,"/getlinkurl"),l)).data.linkurl;s?window.location.href=e:(0!==e.indexOf("/")&&(e="/".concat(e)),e+=";srfwf=".concat(r),t.push("/index".concat(e)))}()},render:()=>y("div",null,[P("待办列表重定向")])}));class an{constructor(){this.component="IBizPortalView"}}const sn=g({name:"IBizPortalView",props:{context:Object,params:{type:Object,default:()=>({})},modelData:{type:Object,required:!0},modal:{type:Object},state:{type:Object}},setup(){var t;const e=Vt("view"),n=Yt(((...t)=>new mt(...t))),o=(null==(t=n.model.viewLayoutPanel)?void 0:t.controls)||n.model.controls,{viewType:a,sysCss:s,codeName:r}=n.model,i=a.toLowerCase(),l=null==s?void 0:s.cssName,c=[e.b(),e.b(i),e.m(r),l];return{c:n,ns:e,controls:o,viewClassNames:c}},render(){var t;let e=null;if(this.c.state.isCreated){const n={...this.$slots};(null==(t=this.controls)?void 0:t.length)&&this.controls.forEach((t=>{const e=t.name||t.id,o={context:this.c.context,params:this.c.params};this.c.slotProps[e]&&Object.assign(o,this.c.slotProps[e]);const a=n[e];if(a)return void(n[e]=()=>a(o));const s=this.c.providers[e];s&&(n[e]=()=>{const e=h(s.component);return p(e,{modelData:t,...o})})})),n.dashboard&&(e=n.dashboard())}return y("div",{class:this.viewClassNames},[e])}}),rn=(t("IBizPortalView",$t(sn,(function(t){t.component(sn.name,sn),vt(U.APP_PORTAL_VIEW,(()=>new an)),vt(U.DE_PORTAL_VIEW,(()=>new an)),vt(U.DE_PORTAL_VIEW9,(()=>new an))}))),g({name:"IBizDeRedirectView",props:{context:{type:Object,required:!0},params:{type:Object,default:()=>({})},modelData:{type:Object,required:!0}},setup(t){const e=Yt(((...t)=>new mt(...t))),n=d(),o=d(),a=d();return e.evt.on("onCreated",(()=>{gt(r(t.modelData),r(e.context),r(e.params)).then((async t=>{if("view"!==t.type)throw new A("嵌入重定向视图不支持url跳转");n.value=t.viewId,o.value=t.context,a.value=t.params}))})),{c:e,toViewId:n,toViewContext:o,toViewParams:a}},render(){return this.toViewId?p(h("IBizViewShell"),{context:this.toViewContext,params:this.toViewParams,viewId:this.toViewId,...this.$attrs},this.$slots):w(y("div",{style:"width: 100%; height: 100%;"},null),[[C("loading"),!this.toViewId]])}}));class ln{constructor(){this.component="IBizDeRedirectView"}}t("IBizDeRedirectView",$t(rn,(function(t){t.component(rn.name,rn);const e=new ln;vt(U.DE_REDIRECT_VIEW,(()=>e))})));const cn=g({name:"IBizViewLayoutPanelControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},container:{type:Object},data:Object},setup(t,{slots:n}){const o=Bt(((...e)=>new yt(...e,t.container))),a=Vt("control-".concat(o.model.controlType.toLowerCase()));e((()=>t.data),(t=>{t&&(o.setInputData(t),o.load())}),{immediate:!0}),o.evt.on("onCreated",(()=>{Object.keys(o.panelItems).forEach((t=>{const e=o.panelItems[t];e.state=l(e.state)}))}));const s=(t,e)=>{var a,r;if(t.hidden)return null;const{providers:i,panelItems:l}=e||o,c=i[t.id];if(!c)return y("div",null,[P("暂未支持的面板项: "),t.id,P(" - "),t.itemType]);const u=h(c.component);let d;return"CTRLPOS"===t.itemType&&n[t.id]?d=()=>n[t.id]():"TABPANEL"===t.itemType&&(null==(a=t.panelTabPages)?void 0:a.length)?d=()=>t.panelTabPages.map((t=>s(t,e))):it(t)?d=void 0:(null==(r=t.panelItems)?void 0:r.length)&&(d=()=>t.panelItems.map((t=>s(t,e)))),p(u,{modelData:t,controller:l[t.id],key:t.id},d)};return v("renderPanelItem",s),{c:o,ns:a,renderPanelItem:s}},render(){const{state:t,model:e}=this.c;return y(h("iBizControlBase"),{controller:this.c},{default:()=>[y(h("iBizRow"),{class:this.ns.b("content"),layout:{layout:"FLEX"}},{default:()=>{var n;return[t.isCreated&&(this.$slots.default?this.$slots.default({panelItems:this.c.panelItems}):null==(n=e.rootPanelItems)?void 0:n.map((t=>{let e;const n=this.c.panelItems[t.id];return t.layoutPos.layout="FLEX",y(h("iBizCol"),{layoutPos:t.layoutPos,state:n.state},"function"==typeof(o=e=this.renderPanelItem(t))||"[object Object]"===Object.prototype.toString.call(o)&&!b(o)?e:{default:()=>[e]});var o})))]}})]})}});class un{constructor(){this.component="IBizViewLayoutPanelControl"}}t("IBizViewLayoutPanelControl",$t(cn,(function(t){t.component(cn.name,cn),wt(Ct.VIEW_LAYOUT_PANEL,(()=>new un))})));function dn(t,e,n){var o,a;if(t.hidden)return;const{providers:s,panelItems:r}=e,i=s[t.id];if(!i)return y("div",null,[P("暂未支持的面板项: "),t.id,P(" - "),t.itemType]);const l=h(i.component);let c;return"CTRLPOS"===t.itemType&&n.$slots[t.id]?c=()=>n.$slots[t.id]():"TABPANEL"===t.itemType&&(null==(o=t.panelTabPages)?void 0:o.length)?c=()=>t.panelTabPages.map((t=>dn(t,e,n))):(null==(a=t.panelItems)?void 0:a.length)&&(c=()=>t.panelItems.map((t=>dn(t,e,n)))),p(l,{modelData:t,controller:r[t.id],key:t.id},c)}const pn=g({name:"IBizPanelControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},container:{type:Object},data:Object,loadDefault:{type:Boolean,default:!0}},setup(t){const n=Bt(((...e)=>new bt(...e,t.container))),o=Vt("control-".concat(n.model.controlType.toLowerCase()));return e((()=>t.data),(t=>{t&&(n.setInputData(t),n.load())}),{immediate:!0}),n.evt.on("onCreated",(()=>{Object.keys(n.panelItems).forEach((t=>{const e=n.panelItems[t];e.state=l(e.state)}))})),{c:n,ns:o}},render(){const{state:t,model:e}=this.c;return y(h("iBizControlBase"),{controller:this.c},{default:()=>[y(h("iBizRow"),{class:this.ns.b("content"),layout:{layout:"FLEX"}},{default:()=>{var n;return[t.isCreated&&(this.$slots.default?this.$slots.default({panelItems:this.c.panelItems}):null==(n=e.rootPanelItems)?void 0:n.map((t=>{let e;const n=this.c.panelItems[t.id];return t.layoutPos.layout="FLEX",y(h("iBizCol"),{layoutPos:t.layoutPos,state:n.state},"function"==typeof(o=e=dn(t,this.c,this))||"[object Object]"===Object.prototype.toString.call(o)&&!b(o)?e:{default:()=>[e]});var o})))]}})]})}});class hn{constructor(){this.component="IBizPanelControl"}}t("IBizPanelControl",$t(pn,(function(t){t.component(pn.name,pn),wt(Ct.PANEL,(()=>new hn))})));function mn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function fn(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function vn(t,e){for(var n,o="",a=0,s=-1,r=0,i=0;i<=t.length;++i){if(i<t.length)n=t.charCodeAt(i);else{if(47===n)break;n=47}if(47===n){if(s===i-1||1===r);else if(s!==i-1&&2===r){if(o.length<2||2!==a||46!==o.charCodeAt(o.length-1)||46!==o.charCodeAt(o.length-2))if(o.length>2){var l=o.lastIndexOf("/");if(l!==o.length-1){-1===l?(o="",a=0):a=(o=o.slice(0,l)).length-1-o.lastIndexOf("/"),s=i,r=0;continue}}else if(2===o.length||1===o.length){o="",a=0,s=i,r=0;continue}e&&(o.length>0?o+="/..":o="..",a=2)}else o.length>0?o+="/"+t.slice(s+1,i):o=t.slice(s+1,i),a=i-s-1;s=i,r=0}else 46===n&&-1!==r?++r:r=-1}return o}var gn={resolve:function(){for(var t,e="",n=!1,o=arguments.length-1;o>=-1&&!n;o--){var a;o>=0?a=arguments[o]:(void 0===t&&(t=process.cwd()),a=t),fn(a),0!==a.length&&(e=a+"/"+e,n=47===a.charCodeAt(0))}return e=vn(e,!n),n?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(fn(t),0===t.length)return".";var e=47===t.charCodeAt(0),n=47===t.charCodeAt(t.length-1);return 0!==(t=vn(t,!e)).length||e||(t="."),t.length>0&&n&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return fn(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var n=arguments[e];fn(n),n.length>0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":gn.normalize(t)},relative:function(t,e){if(fn(t),fn(e),t===e)return"";if((t=gn.resolve(t))===(e=gn.resolve(e)))return"";for(var n=1;n<t.length&&47===t.charCodeAt(n);++n);for(var o=t.length,a=o-n,s=1;s<e.length&&47===e.charCodeAt(s);++s);for(var r=e.length-s,i=a<r?a:r,l=-1,c=0;c<=i;++c){if(c===i){if(r>i){if(47===e.charCodeAt(s+c))return e.slice(s+c+1);if(0===c)return e.slice(s+c)}else a>i&&(47===t.charCodeAt(n+c)?l=c:0===c&&(l=0));break}var u=t.charCodeAt(n+c);if(u!==e.charCodeAt(s+c))break;47===u&&(l=c)}var d="";for(c=n+l+1;c<=o;++c)c!==o&&47!==t.charCodeAt(c)||(0===d.length?d+="..":d+="/..");return d.length>0?d+e.slice(s+l):(s+=l,47===e.charCodeAt(s)&&++s,e.slice(s))},_makeLong:function(t){return t},dirname:function(t){if(fn(t),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,o=-1,a=!0,s=t.length-1;s>=1;--s)if(47===(e=t.charCodeAt(s))){if(!a){o=s;break}}else a=!1;return-1===o?n?"/":".":n&&1===o?"//":t.slice(0,o)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');fn(t);var n,o=0,a=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var r=e.length-1,i=-1;for(n=t.length-1;n>=0;--n){var l=t.charCodeAt(n);if(47===l){if(!s){o=n+1;break}}else-1===i&&(s=!1,i=n+1),r>=0&&(l===e.charCodeAt(r)?-1==--r&&(a=n):(r=-1,a=i))}return o===a?a=i:-1===a&&(a=t.length),t.slice(o,a)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!s){o=n+1;break}}else-1===a&&(s=!1,a=n+1);return-1===a?"":t.slice(o,a)},extname:function(t){fn(t);for(var e=-1,n=0,o=-1,a=!0,s=0,r=t.length-1;r>=0;--r){var i=t.charCodeAt(r);if(47!==i)-1===o&&(a=!1,o=r+1),46===i?-1===e?e=r:1!==s&&(s=1):-1!==e&&(s=-1);else if(!a){n=r+1;break}}return-1===e||-1===o||0===s||1===s&&e===o-1&&e===n+1?"":t.slice(e,o)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var n=e.dir||e.root,o=e.base||(e.name||"")+(e.ext||"");return n?n===e.root?n+o:n+t+o:o}("/",t)},parse:function(t){fn(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,o=t.charCodeAt(0),a=47===o;a?(e.root="/",n=1):n=0;for(var s=-1,r=0,i=-1,l=!0,c=t.length-1,u=0;c>=n;--c)if(47!==(o=t.charCodeAt(c)))-1===i&&(l=!1,i=c+1),46===o?-1===s?s=c:1!==u&&(u=1):-1!==s&&(u=-1);else if(!l){r=c+1;break}return-1===s||-1===i||0===u||1===u&&s===i-1&&s===r+1?-1!==i&&(e.base=e.name=0===r&&a?t.slice(1,i):t.slice(r,i)):(0===r&&a?(e.name=t.slice(1,s),e.base=t.slice(1,i)):(e.name=t.slice(r,s),e.base=t.slice(r,i)),e.ext=t.slice(s,i)),r>0?e.dir=t.slice(0,r-1):a&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};gn.posix=gn;var yn=gn,wn=mn(yn);t("PluginFactory",class{constructor(){this.urlReg=/^http[s]?:\/\/[^\s]*/,this.cache=new Map,this.pluginCache=new Map,this.pluginCodes=[],this.predefinedPlugins=new Map,this.ignoreRules=[],this.loadQueue=new Map}isIgnore(t){return this.ignoreRules.some((e=>"string"==typeof e?t===e:e.test(t)))}setDevIgnore(t){this.ignoreRules.push(t)}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)}))}async loadPlugin(t){if(!0===t.runtimeObject){const e=t;if(e){const t=e.rtobjectName,n=e.rtobjectRepo;if(this.isIgnore(n))return!0;if(this.pluginCache.has(t))return!0;if(this.loadQueue.has(n)){const t=await this.loadQueue.get(n);try{return await t}catch(t){return!1}}try{const t=this.loadPluginRef(e.rtobjectName,e.rtobjectRepo);this.loadQueue.set(n,t);return await t}catch(t){throw new z(e,"配置加载失败")}finally{this.loadQueue.delete(n)}}}return!1}async loadPluginRef(t,e){if(this.isIgnore(e))return!0;if(this.pluginCache.has(t))return!0;let n=null;{const t=e,o=this.urlReg.test(t)?"".concat(t,"/package.json"):"".concat(ibiz.env.pluginBaseUrl,"/").concat(yn.join(t,"package.json")),a=await ibiz.net.axios({method:"get",headers:{"Access-Control-Allow-Origin":"*"},url:o});if(200!==a.status)throw new Error("配置加载失败");n=a.data}const o=new It(t,e,n);if(o){if(o.config["systemjs-importmap"]){const t=this.handleSystemImportMap(o.config["systemjs-importmap"]);t&&System.addImportMap(t)}try{return await this.loadScript(o),this.pluginCache.set(t,o),!0}catch(t){ibiz.log.error(t)}}return!1}async loadScript(t){const e=t.repo,{name:n,system:o,styles:a=[]}=t.config;let s="";if(s=yn.join(e,o),s){if(this.cache.has(s))return;let t=null;const o=this.parseUrl(s),r=("string"==typeof a?[a]:a).map((t=>this.parseUrl(wn.join(e,t))));if(System.addImportMap({imports:{[n]:o},styles:{[n]:r}}),t=await System.import(n),!t)throw new A("远程插件加载失败, 未找到文件或文件内容格式不正确");if(!t.default)throw new A("远程插件加载失败, 远程插件未找到[default]默认导出");this.setPluginCode(t.default),this.cache.set(s,!0)}}parseUrl(t,e=ibiz.env.pluginBaseUrl){if(this.urlReg.test(t))return t;let n="";n=this.urlReg.test(e)?t.startsWith("/")?e+t:"".concat(e,"/").concat(t):"".concat(yn.join(e,t));const{origin:o,pathname:a}=window.location;return a.endsWith("/")&&n.startsWith("/")&&(n=n.substring(1)),!1===this.urlReg.test(n)&&(n="".concat(o).concat(a).concat(n)),n}handleSystemImportMap(t){if(t){if(t.imports){const e=t.imports;for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const o=e[n];e[n]=this.parseUrl(o,t.baseUrl)}}if(t.styles){const e=t.styles;for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const o=e[n];e[n]="string"==typeof o?this.parseUrl(o,t.baseUrl):o.map((e=>this.parseUrl(e,t.baseUrl)))}}return t}return null}});class Cn{constructor(t,e,n){this.required=!0,e&&(this.default=e),n&&(this.validator=n),this.type=t}}function bn(){return{value:String,controller:new Cn(Object),data:new Cn(Object),disabled:{type:Boolean},readonly:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1},overflowMode:{type:String},controlParams:{type:Object,required:!1}}}function In(){return{hasError:{type:Boolean}}}function Pn(){return{...bn(),value:[String,Number]}}function Dn(){return{...bn(),value:Number}}function En(){return{...bn(),value:String}}function Nn(){return{...bn(),value:[String,Number,Object,Array]}}function On(){return{...bn(),value:[String,Number]}}function An(){return{...bn(),value:[String,Number]}}function xn(){return{...bn(),value:[String,Number]}}function Rn(){return{...bn(),value:[String,Array,Object,Number]}}function Sn(){return{...bn(),value:[String,Number]}}function zn(){return{...bn(),value:[String,Number]}}function Tn(){return{...bn(),value:[String,Number]}}function Bn(){return{...bn(),value:[String,Number]}}function jn(){return{...bn(),value:[String,Number]}}function Vn(){return{...bn(),value:[String,Number]}}function Ln(){return{...bn(),value:[String,Number,Array]}}function Mn(){return{...bn(),value:[String,Number]}}function kn(){return{...bn(),value:[String,Number]}}function _n(){return{...bn(),value:[String,Number]}}function Gn(){return{...bn(),value:String}}function Wn(){return{...bn(),value:[String,Number]}}function qn(){return{...bn(),value:String,language:{type:String},theme:{type:String}}}function $n(){return{...bn(),value:String}}function Fn(){return{...bn(),data:{type:Object,required:!1},controller:{type:Object,required:!1},disabled:{type:Boolean,required:!1}}}function Un(){return{...bn(),value:[Array,Array]}}function Kn(){return{...bn(),value:String}}function Hn(){return{...bn(),value:String}}t("RequiredProp",Cn)}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-shell.d.ts","sourceRoot":"","sources":["../../../src/common/view-shell/view-shell.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"view-shell.d.ts","sourceRoot":"","sources":["../../../src/common/view-shell/view-shell.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,aAAa,EAEd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAsB,QAAQ,EAAyB,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAkB,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAK5D,OAAO,mBAAmB,CAAC;AAE3B,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA+KxB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref, resolveComponent, h, createVNode, resolveDirective, withDirectives, defineComponent } from 'vue';
|
|
2
|
-
import { convertNavData,
|
|
2
|
+
import { convertNavData, getMatchResPath, getViewProvider } from '@ibiz-template/runtime';
|
|
3
3
|
import { RuntimeError } from '@ibiz-template/core';
|
|
4
4
|
import { notNilEmpty, createUUID } from 'qx-util';
|
|
5
5
|
import { isNil, isEmpty } from 'ramda';
|
|
@@ -43,56 +43,79 @@ const IBizViewShell = /* @__PURE__ */ defineComponent({
|
|
|
43
43
|
}
|
|
44
44
|
if (viewModel.dynaSysMode === 1) {
|
|
45
45
|
const navContexts = viewModel.appViewNavContexts;
|
|
46
|
-
|
|
46
|
+
const context = {
|
|
47
|
+
...props.context
|
|
48
|
+
};
|
|
47
49
|
if (notNilEmpty(navContexts)) {
|
|
48
|
-
|
|
50
|
+
const tempContext = convertNavData(navContexts, props.params || {}, props.context);
|
|
51
|
+
Object.assign(context, tempContext);
|
|
49
52
|
}
|
|
50
53
|
const navParams = viewModel.appViewNavParams;
|
|
51
54
|
let params = {};
|
|
52
55
|
if (notNilEmpty(navParams)) {
|
|
53
56
|
params = convertNavData(navParams, props.params || {}, props.context);
|
|
54
57
|
}
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
58
|
+
const appDataEntityId = viewModel.appDataEntityId;
|
|
59
|
+
let appDe;
|
|
60
|
+
if (appDataEntityId) {
|
|
61
|
+
appDe = await ibiz.hub.getAppDataEntity(appDataEntityId, viewModel.appId);
|
|
62
|
+
}
|
|
63
|
+
const resContext = {};
|
|
64
|
+
if (appDe) {
|
|
65
|
+
const srfkey = context[appDe.codeName.toLowerCase()];
|
|
66
|
+
if (srfkey) {
|
|
67
|
+
resContext.srfkey = srfkey;
|
|
68
|
+
}
|
|
69
|
+
const match = getMatchResPath(context, appDe);
|
|
70
|
+
if (match && match.keys.length > 1) {
|
|
71
|
+
const parentDeKey = match.keys[match.keys.length - 2];
|
|
72
|
+
resContext.srfparentkey = context[parentDeKey];
|
|
73
|
+
resContext.srfparentdeanme = parentDeKey;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (appDe && viewModel.enableWF) {
|
|
77
|
+
const deCodeName = appDe.codeName.toLowerCase();
|
|
78
|
+
const key = context[deCodeName];
|
|
79
|
+
if (key) {
|
|
80
|
+
const noSrfSessionId = isNil(props.context.srfsessionid) || isEmpty(props.context.srfsessionid);
|
|
81
|
+
const id = createUUID();
|
|
82
|
+
if (noSrfSessionId) {
|
|
83
|
+
const domain = ibiz.uiDomainManager.create(id);
|
|
84
|
+
context.srfsessionid = domain.id;
|
|
85
|
+
}
|
|
86
|
+
const app = ibiz.hub.getApp(viewModel.appId);
|
|
87
|
+
const service = await app.deService.getService(props.context, appDataEntityId);
|
|
88
|
+
const res = await service.get({
|
|
89
|
+
...props.context,
|
|
90
|
+
...context
|
|
91
|
+
}, props.params || {});
|
|
92
|
+
if (res.ok && res.data) {
|
|
93
|
+
const {
|
|
94
|
+
srfwftag,
|
|
95
|
+
processdefinitionkey,
|
|
96
|
+
taskdefinitionkey
|
|
97
|
+
} = res.data;
|
|
98
|
+
if (srfwftag) {
|
|
99
|
+
params.srfwftag = srfwftag;
|
|
68
100
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (res.ok && res.data) {
|
|
77
|
-
const {
|
|
78
|
-
data
|
|
79
|
-
} = res;
|
|
80
|
-
const {
|
|
81
|
-
srfwftag
|
|
82
|
-
} = data;
|
|
83
|
-
if (srfwftag) {
|
|
84
|
-
params.srfwftag = srfwftag;
|
|
101
|
+
if (["DEWFDYNAEDITVIEW3", "DEWFDYNAEDITVIEW"].includes(viewModel.viewType)) {
|
|
102
|
+
const viewParams = props.params;
|
|
103
|
+
if (isNil(viewParams.processDefinitionKey)) {
|
|
104
|
+
viewParams.processDefinitionKey = processdefinitionkey;
|
|
105
|
+
}
|
|
106
|
+
if (isNil(viewParams.taskDefinitionKey)) {
|
|
107
|
+
viewParams.taskDefinitionKey = taskdefinitionkey;
|
|
85
108
|
}
|
|
86
109
|
}
|
|
110
|
+
}
|
|
111
|
+
if (noSrfSessionId) {
|
|
87
112
|
ibiz.uiDomainManager.destroy(id);
|
|
88
113
|
}
|
|
89
|
-
} else {
|
|
90
|
-
throw new RuntimeError("\u672A\u627E\u5230\u6570\u636E\u63A7\u4EF6");
|
|
91
114
|
}
|
|
92
115
|
}
|
|
93
116
|
viewModelData.value = await ibiz.hub.loadAppView(viewModel.appId, viewModel.id, {
|
|
94
|
-
...props.context,
|
|
95
117
|
...context,
|
|
118
|
+
...resContext,
|
|
96
119
|
...params
|
|
97
120
|
});
|
|
98
121
|
} else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-action.d.ts","sourceRoot":"","sources":["../../../../src/util/store/async-action/async-action.ts"],"names":[],"mappings":"AAwCA;;;;;;GAMG;AACH,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"async-action.d.ts","sourceRoot":"","sources":["../../../../src/util/store/async-action/async-action.ts"],"names":[],"mappings":"AAwCA;;;;;;GAMG;AACH,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6D7B"}
|
|
@@ -45,7 +45,7 @@ function useAsyncAction() {
|
|
|
45
45
|
const findIndex = allAsyncActions.value.findIndex(
|
|
46
46
|
(item) => item.asyncacitonid === asyncAction.asyncacitonid
|
|
47
47
|
);
|
|
48
|
-
if (findIndex
|
|
48
|
+
if (findIndex === -1) {
|
|
49
49
|
allAsyncActions.value.unshift(asyncAction);
|
|
50
50
|
showLength.value += 1;
|
|
51
51
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/vue3-util",
|
|
3
|
-
"version": "0.5.3-beta.
|
|
3
|
+
"version": "0.5.3-beta.7",
|
|
4
4
|
"description": "vue3 工具包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@ibiz-template/cli": "^0.3.10",
|
|
34
|
-
"@ibiz-template/core": "^0.5.
|
|
35
|
-
"@ibiz-template/runtime": "^0.5.3-beta.
|
|
34
|
+
"@ibiz-template/core": "^0.5.3-beta.7",
|
|
35
|
+
"@ibiz-template/runtime": "^0.5.3-beta.7",
|
|
36
36
|
"@ibiz-template/theme": "^0.5.0",
|
|
37
37
|
"@ibiz/model-core": "^0.1.3",
|
|
38
38
|
"@types/path-browserify": "^1.0.2",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"vue": "^3.3.4",
|
|
62
62
|
"vue-router": "^4.2.4"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "8a6d086ba278298213201f71876fc18d1a1995c3"
|
|
65
65
|
}
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
/* eslint-disable vue/no-mutating-props */
|
|
3
3
|
import {
|
|
4
4
|
convertNavData,
|
|
5
|
-
getControl,
|
|
6
5
|
getViewProvider,
|
|
7
6
|
IViewProvider,
|
|
8
|
-
|
|
7
|
+
getMatchResPath,
|
|
9
8
|
} from '@ibiz-template/runtime';
|
|
10
9
|
import { defineComponent, h, PropType, ref, resolveComponent } from 'vue';
|
|
11
|
-
import {
|
|
10
|
+
import { IAppDataEntity, IAppView } from '@ibiz/model-core';
|
|
12
11
|
import { RuntimeError } from '@ibiz-template/core';
|
|
13
12
|
import { createUUID, notNilEmpty } from 'qx-util';
|
|
14
13
|
import { isEmpty, isNil } from 'ramda';
|
|
@@ -44,13 +43,14 @@ export const IBizViewShell = defineComponent({
|
|
|
44
43
|
if (viewModel.dynaSysMode === 1) {
|
|
45
44
|
// 处理自定义导航上下文
|
|
46
45
|
const navContexts = viewModel.appViewNavContexts;
|
|
47
|
-
|
|
46
|
+
const context: IParams = { ...props.context };
|
|
48
47
|
if (notNilEmpty(navContexts)) {
|
|
49
|
-
|
|
48
|
+
const tempContext = convertNavData(
|
|
50
49
|
navContexts!,
|
|
51
50
|
props.params || {},
|
|
52
51
|
props.context,
|
|
53
52
|
);
|
|
53
|
+
Object.assign(context, tempContext);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
// 处理自定义视图参数
|
|
@@ -64,52 +64,92 @@ export const IBizViewShell = defineComponent({
|
|
|
64
64
|
);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
67
|
+
//* 计算实体资源路径上下文参数
|
|
68
|
+
const appDataEntityId = viewModel.appDataEntityId;
|
|
69
|
+
let appDe: IAppDataEntity | undefined;
|
|
70
|
+
if (appDataEntityId) {
|
|
71
|
+
appDe = await ibiz.hub.getAppDataEntity(
|
|
72
|
+
appDataEntityId,
|
|
73
|
+
viewModel.appId,
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const resContext: IParams = {};
|
|
78
|
+
if (appDe) {
|
|
79
|
+
// 主键
|
|
80
|
+
const srfkey = context[appDe.codeName!.toLowerCase()];
|
|
81
|
+
if (srfkey) {
|
|
82
|
+
resContext.srfkey = srfkey;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// 上层资源路径主实体名称和主键
|
|
86
|
+
const match = getMatchResPath(context, appDe);
|
|
87
|
+
if (match && match.keys.length > 1) {
|
|
88
|
+
const parentDeKey = match.keys[match.keys.length - 2];
|
|
89
|
+
resContext.srfparentkey = context[parentDeKey];
|
|
90
|
+
resContext.srfparentdeanme = parentDeKey;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// 工作流视图加载数据补充srfwftag
|
|
95
|
+
if (appDe && viewModel.enableWF) {
|
|
96
|
+
const deCodeName = appDe.codeName!.toLowerCase();
|
|
97
|
+
const key = context[deCodeName];
|
|
98
|
+
if (key) {
|
|
99
|
+
const noSrfSessionId =
|
|
100
|
+
isNil(props.context.srfsessionid) ||
|
|
101
|
+
isEmpty(props.context.srfsessionid);
|
|
102
|
+
const id = createUUID();
|
|
103
|
+
// 只要上下文中无 srfsessionid 则生成一个
|
|
104
|
+
if (noSrfSessionId) {
|
|
105
|
+
// 生成一个界面域,界面域标识为当前控制器实例的标识
|
|
106
|
+
const domain = ibiz.uiDomainManager.create(id);
|
|
107
|
+
context.srfsessionid = domain.id;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const app = ibiz.hub.getApp(viewModel.appId);
|
|
111
|
+
const service = await app.deService.getService(
|
|
112
|
+
props.context,
|
|
113
|
+
appDataEntityId!,
|
|
114
|
+
);
|
|
115
|
+
const res = await service.get(
|
|
116
|
+
{ ...props.context, ...context },
|
|
117
|
+
props.params || {},
|
|
118
|
+
);
|
|
119
|
+
if (res.ok && res.data) {
|
|
120
|
+
const { srfwftag, processdefinitionkey, taskdefinitionkey } =
|
|
121
|
+
res.data;
|
|
122
|
+
if (srfwftag) {
|
|
123
|
+
params.srfwftag = srfwftag;
|
|
84
124
|
}
|
|
85
125
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
params.srfwftag = srfwftag;
|
|
126
|
+
// *动态工作流编辑视图从数据里额外获取参数
|
|
127
|
+
if (
|
|
128
|
+
['DEWFDYNAEDITVIEW3', 'DEWFDYNAEDITVIEW'].includes(
|
|
129
|
+
viewModel.viewType!,
|
|
130
|
+
)
|
|
131
|
+
) {
|
|
132
|
+
const viewParams = props.params!;
|
|
133
|
+
// 如果视图参数中没有获取到对应流程实例标识与步骤标识,则从请求回来的数据中获取对应信息
|
|
134
|
+
if (isNil(viewParams.processDefinitionKey)) {
|
|
135
|
+
viewParams.processDefinitionKey = processdefinitionkey;
|
|
136
|
+
}
|
|
137
|
+
if (isNil(viewParams.taskDefinitionKey)) {
|
|
138
|
+
viewParams.taskDefinitionKey = taskdefinitionkey;
|
|
100
139
|
}
|
|
101
140
|
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (noSrfSessionId) {
|
|
102
144
|
ibiz.uiDomainManager.destroy(id);
|
|
103
145
|
}
|
|
104
|
-
} else {
|
|
105
|
-
throw new RuntimeError('未找到数据控件');
|
|
106
146
|
}
|
|
107
147
|
}
|
|
108
148
|
|
|
109
149
|
viewModelData.value = await ibiz.hub.loadAppView(
|
|
110
150
|
viewModel.appId,
|
|
111
151
|
viewModel.id!,
|
|
112
|
-
{ ...
|
|
152
|
+
{ ...context, ...resContext, ...params },
|
|
113
153
|
);
|
|
114
154
|
} else {
|
|
115
155
|
viewModelData.value = viewModel;
|
|
@@ -74,10 +74,11 @@ export function useAsyncAction() {
|
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
76
|
const asyncAction = formatAsyncAction(msg.data as IPortalAsyncAction);
|
|
77
|
+
|
|
77
78
|
const findIndex = allAsyncActions.value.findIndex(
|
|
78
79
|
item => item.asyncacitonid === asyncAction.asyncacitonid,
|
|
79
80
|
);
|
|
80
|
-
if (findIndex
|
|
81
|
+
if (findIndex === -1) {
|
|
81
82
|
// 不存在的数据补充到最开始,并显示长度加一
|
|
82
83
|
allAsyncActions.value.unshift(asyncAction);
|
|
83
84
|
showLength.value += 1;
|