@ibiz-template/vue3-util 0.5.3-beta.6 → 0.5.3-beta.8
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 +50 -46
- 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 +74 -56
- package/src/util/store/async-action/async-action.ts +2 -1
package/dist/index.min.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-
|
|
1
|
+
.ibiz-view-shell{position:relative;width:100%;height:100%}.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{--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-rawitem{width:100%;height:100%}.ibiz-panel-rawitem .ibiz-panel-rawitem-content{width:100%}.ibiz-single-data-container{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-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-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-multi-data-container{width:100%;height: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-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-viewlayoutpanel{width:100%;height:100%}.ibiz-control-viewlayoutpanel-content{width:100%;height:100%}.ibiz-control-panel{width:100%;height:100%}.ibiz-control-panel-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,h,p,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,ht,pt,mt,ft,vt,gt,yt,wt,Ct,bt,It,Pt,Dt,Et,Nt;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,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.getViewProvider,Q=t.PanelItemState,J=t.PanelItemController,Z=t.registerPanelItemProvider,tt=t.Modal,et=t.ViewMode,nt=t.OpenAppViewCommand,ot=t.getEditorProvider,at=t.PanelItemEventName,st=t.getAllPanelField,rt=t.isDataContainer,it=t.getPanelItemProvider,lt=t.PanelData,ct=t.PanelNotifyState,ut=t.execDELogicById,dt=t.ScriptFactory,ht=t.toLocalOpenWFRedirectView,pt=t.ViewController,mt=t.getControlsByView,ft=t.registerViewProvider,vt=t.getDERedirectToView,gt=t.ViewLayoutPanelController,yt=t.registerControlProvider,wt=t.ControlType,Ct=t.PanelController,bt=t.RemotePluginItem},function(t){It=t.defineStore,Pt=t.createPinia},function(t){Dt=t.default},function(t){Et=t.isNumber,Nt=t.isNil}],execute:function(){function Ot(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 At(){return a().proxy.$props}function xt(t){return s(t)?r(t):t}function Rt(){const t=a().proxy;return e=>{t.$forceUpdate(),e&&M(e)&&t.$nextTick((()=>{e()}))}}t({calcResRoutePath:_t,createOverlayView:Ft,generateRoutePath:async function(t,e,n,o){const a=Vt(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:Mt(n),params:o}),2===s&&(await _t(a,n,t.appDataEntityId,t.appId),kt.includes(t.viewType))){const e=H(t.appDataEntityId);delete a.pathNodes[0].context[e]}return{path:Lt(a)}},getArrayProps:Fn,getAutoCompleteProps:Gn,getCascaderProps:Un,getCheckboxListProps:On,getCheckboxProps:An,getCodeProps:Wn,getColorPickerProps:Kn,getDataPickerProps:xn,getDatePickerProps:Rn,getDateRangeProps:Sn,getDrawerPlacement:function(t){return Ut[t]||"right"},getDropdownProps:Nn,getEditorEmits:function(){return{change:(t,e)=>!0,blur:t=>!0,focus:t=>!0,enter:t=>!0,infoTextChange:t=>!0}},getEditorProps:Cn,getGridArrayProps:function(){return{...Fn(),...bn()}},getGridAutoCompleteProps:function(){return{...Gn(),...bn()}},getGridCascaderProps:function(){return{...Un(),...bn()}},getGridCheckboxListProps:function(){return{...On(),...bn()}},getGridCheckboxProps:function(){return{...An(),...bn()}},getGridCodeProps:function(){return{...Wn(),...bn()}},getGridColorPickerProps:function(){return{...Kn(),...bn()}},getGridDataPickerProps:function(){return{...xn(),...bn()}},getGridDatePickerProps:function(){return{...Rn(),...bn()}},getGridDateRangeProps:function(){return{...Sn(),...bn()}},getGridDropdownProps:function(){return{...Nn(),...bn()}},getGridEditorCommonProps:bn,getGridEditorEmits:function(){return{change:(t,e)=>!0,rowSave:()=>!0}},getGridHtmlProps:function(){return{...qn(),...bn()}},getGridInputIpProps:function(){return{...Dn(),...bn()}},getGridInputNumberProps:function(){return{...Pn(),...bn()}},getGridInputProps:function(){return{...In(),...bn()}},getGridListBoxProps:function(){return{...zn(),...bn()}},getGridMarkDownProps:function(){return{...$n(),...bn()}},getGridNumberRangeProps:function(){return{...Tn(),...bn()}},getGridRadioProps:function(){return{...Bn(),...bn()}},getGridRateProps:function(){return{...jn(),...bn()}},getGridRawProps:function(){return{...Vn(),...bn()}},getGridSliderProps:function(){return{...Ln(),...bn()}},getGridSpanProps:function(){return{...En(),...bn()}},getGridStepperProps:function(){return{...Mn(),...bn()}},getGridSwitchProps:function(){return{...kn(),...bn()}},getGridUploadProps:function(){return{..._n(),...bn()}},getHtmlProps:qn,getInputIpProps:Dn,getInputNumberProps:Pn,getInputProps:In,getListBoxProps:zn,getMarkDownProps:$n,getNestedRoutePath:Gt,getNumberRangeProps:Tn,getOrigin:xt,getOwnRouteContext:Mt,getRadioProps:Bn,getRateProps:jn,getRawProps:Vn,getSliderProps:Ln,getSpanProps:En,getStepperProps:Mn,getSwitchProps:kn,getUploadProps:_n,isEmptyVNode:function(t){if(!Array.isArray(t))return t===St;return 1===t.length&&t[0]===St},onRouteChange:function(t,n){const o=q();if(!o)throw new A("无法正确获取route,可能是依赖问题");e((()=>null==o?void 0:o.path),(()=>{const e=Gt(o,n);t({currentKey:e,fullPath:o.fullPath})}),{immediate:!0})},openViewDrawer:async function(t,e){const n=ibiz.overlay.createDrawer(Ft(t),void 0,e);await n.present();return await n.onWillDismiss()||{ok:!1}},openViewFloatWindow:async function(t,e){const n=ibiz.overlay.createFloatWindow(Ft(t),void 0,e);n.present();return await n.onWillDismiss()||{ok:!1}},openViewModal:async function(t,e){const n=ibiz.overlay.createModal(Ft(t),void 0,e);n.present();return await n.onWillDismiss()||{ok:!1}},openViewPopover:async function(t,e,n){const o=ibiz.overlay.createPopover(Ft(e),void 0,n);o.present(t.target);return await o.onWillDismiss()||{ok:!1}},parseRouteViewData:async function(t,e){var n;const o=Vt(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=jt("control"),{controlType:n,sysCss:o,codeName:a}=t.model,s=n.toLowerCase(),r=null==o?void 0:o.cssName,i=jt("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:Vt,routePath2string:Lt,useClickOutside:Ot,useControlController:Tt,useController:function(t){t.force=Rt()},useCtx:zt,useEventListener:Bt,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 Bt(n,"click",(e=>{o.value||(a=Ot(n,(()=>{s()})),o.value=!0,t())}),{capture:!0}),{componentRef:n,isFocus:o,doBlur:s,pause:()=>{a&&a.pause()},stop:()=>{a&&a.stop()}}},useForce:Rt,useForceTogether:function(t,e){const n=e.force,o=Rt();e.force=t=>{n(t),o()}},useMobCtx:function(){return i("ctx")},useNamespace:jt,useProps:At,usePropsWatch:function(t,n,o){const a=At();Object.prototype.hasOwnProperty.call(a,t)&&(e((()=>a[t]),((t,e)=>{n(xt(t),xt(e))}),o),n(xt(a[t]),void 0))},useRouteKey:function(t,n,o){o||(o=d(""));o.value=t.value;const a=new Wt(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:Xt});const St=t("EmptyVNode",o("EmptyVNode"));function zt(){return i("ctx")}function Tt(t,o){const s=zt(),r=At();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=Rt();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 Bt(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 jt(t){return new O(t,ibiz.env.namespace)}function Vt(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 Lt(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 Mt(t){const e=t.getOwnContext(),n=["srfsessionid","srfappid","currentSrfNav","toRouteDepth"];return Object.keys(e).forEach((t=>{n.includes(t)&&delete e[t]})),e}const kt=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 _t(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 Gt(t,e,n=!0){if(t.matched.length<e)return"";if(t.matched.length===e&&t.name)return t.path;const o=Vt(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,Lt(o))}class Wt{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",Wt);const qt=t("withInstall",((t,e)=>(t.install=t=>{e(t)},t)));class $t{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=$t.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",$t);function Ft(t){return e=>{const n=p("IBizViewShell");return h(n,{...t,modal:e})}}t("OverlayPopoverContainer",class extends $t{present(t){return this.modal.present(t)}});const Ut={DRAWER_LEFT:"left",DRAWER_RIGHT:"right",DRAWER_TOP:"top",DRAWER_BOTTOM:"bottom"};class Kt{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 Kt(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 Ht(t){if(["begintime","endtime","createdate","updatedate"].forEach((e=>{Et(t[e])&&(t[e]=Dt(t[e]).format("YYYY-MM-DD HH:mm:ss"))})),!Nt(t.actionresult))try{const e=JSON.parse(t.actionresult);t.actionresult=e}catch(t){}return t}t("useAppStore",It("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=Ht(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(Ht),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",It("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",Pt());function Xt(t){const o=At(),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=Rt();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=jt("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=jt("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=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:jt("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=jt("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.appDataEntityId;let o;if(!n)throw new A("".concat(e.codeName,"无实体,暂不支持加载动态模型"));o=await ibiz.hub.getAppDataEntity(n,e.appId);const a={},r=t.context[o.codeName.toLowerCase()];r&&(a.srfkey=r);const i=K(t.context,o);if(i&&i.keys.length>1){const e=i.keys[i.keys.length-2];a.srfparentkey=t.context[e],a.srfparentdeanme=e}if(o&&e.enableWF){const o={...t.context};if(a.srfkey){const s=B(t.context.srfsessionid)||V(t.context.srfsessionid),r=W();if(s){const t=ibiz.uiDomainManager.create(r);o.srfsessionid=t.id}const i=ibiz.hub.getApp(e.appId),l=await i.deService.getService(t.context,n),c=await l.get(o,t.params||{});if(c.ok&&c.data){const{srfwftag:n,processdefinitionkey:o,taskdefinitionkey:s}=c.data;if(n&&(a.srfwftag=n),["DEWFDYNAEDITVIEW3","DEWFDYNAEDITVIEW"].includes(e.viewType)){const e=t.params;B(e.processDefinitionKey)&&(e.processDefinitionKey=o),B(e.taskDefinitionKey)&&(e.taskDefinitionKey=s)}}s&&ibiz.uiDomainManager.destroy(r)}}s.value=await ibiz.hub.loadAppView(e.appId,e.id,a)}else s.value=e;try{a.value=await Y(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=jt("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(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 Yt extends Q{}t("PanelContainerState",Yt);class Qt extends J{createState(){var t;return new Yt(null==(t=this.parent)?void 0:t.state)}}function Jt(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)}t("PanelContainerController",Qt);const Zt=g({name:"IBizPanelContainer",props:{modelData:{type:Object,required:!0},controller:{type:Qt,required:!0}},setup(t){const e=jt("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},Jt(n=o.map((t=>{const e=t.props;return e&&e.controller?y(p("iBizCol"),{layoutPos:e.modelData.layoutPos,state:e.controller.state},Jt(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 te{constructor(){this.component="IBizPanelContainer"}async createController(t,e,n){const o=new Qt(t,e,n);return await o.init(),o}}t("IBizPanelContainer",qt(Zt,(function(t){t.component(Zt.name,Zt),Z("CONTAINER",(()=>new te)),Z("CONTAINER_DEFAULT",(()=>new te))})));const ee=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:jt("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 ne extends J{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",ne);class oe{constructor(){this.component="IBizPanelCtrlPos"}async createController(t,e,n){const o=new ne(t,e,n);return await o.init(),o}}t("IBizPanelCtrlPos",qt(ee,(function(t){t.component(ee.name,ee),Z("CTRLPOS",(()=>new oe))})));class ae extends J{}function se(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)}t("ScrollContainerItemController",ae);const re=t("ScrollContainerItem",g({name:"IBizScrollContainerItem",props:{modelData:{type:Object,required:!0},controller:{type:ae,required:!0}},setup(t){const e=jt("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"}},se(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},se(t)?t:{default:()=>[t]})):t})))?n:{default:()=>[n]})}}));class ie{constructor(){this.component="IBizScrollContainerItem"}async createController(t,e,n){const o=new ae(t,e,n);return await o.init(),o}}class le extends J{async onInit(){await super.onInit(),this.state.layout.width="100%",this.state.layout.height="100%"}}t("ScrollContainerController",le);const ce=t("ScrollContainer",g({name:"IBizScrollContainer",props:{modelData:{type:Object,required:!0},controller:{type:le,required:!0}},setup(t){const e=jt("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 ue{constructor(){this.component="IBizScrollContainer"}async createController(t,e,n){const o=new le(t,e,n);return await o.init(),o}}t("IBizScrollContainer",qt(ce,(function(t){t.component(ce.name,ce),t.component(re.name,re),Z("CONTAINER_CONTAINER_SCROLL",(()=>new ue)),Z("CONTAINER_CONTAINER_SCROLL_LEFT",(()=>new ie)),Z("CONTAINER_CONTAINER_SCROLL_HEADER",(()=>new ie)),Z("CONTAINER_CONTAINER_SCROLL_RIGHT",(()=>new ie)),Z("CONTAINER_CONTAINER_SCROLL_BOTTOM",(()=>new ie)),Z("CONTAINER_CONTAINER_SCROLL_MAIN",(()=>new ie))})));class de extends Q{constructor(){super(...arguments),this.cache=!0,this.routeOpen=!0,this.currentKey="",this.cacheKeys=["RouterShell"],this.navViewMsgs={}}}t("NavPosState",de);const he=["is404","isRoutePushed"];class pe extends J{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 de(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 tt({mode:this.routeDepth?et.ROUTE:et.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=Gt(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=Gt(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(nt.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 me(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)}t("NavPosController",pe);const fe=g({name:"IBizNavPos",props:{modelData:{type:Object,required:!0},controller:{type:pe,required:!0}},setup(t){const n=t.controller,o=jt("nav-pos"),a=$(),s=q();if(n.setRouter(a),n.routeDepth){const t=Gt(s,n.routeDepth);e((()=>s.fullPath),(()=>{const e=Gt(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},me(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},me(t)?t:{default:()=>[t]}):t}return y("div",{class:[this.ns.b(),this.ns.m(this.modelData.id),...this.controller.containerClass]},[r])}});class ve{constructor(){this.component="IBizNavPos"}async createController(t,e,n){const o=new pe(t,e,n);return await o.init(),o}}t("IBizNavPos",qt(fe,(function(t){t.component(fe.name,fe),Z("RAWITEM_NAV_POS",(()=>new ve))})));class ge extends Q{}class ye extends J{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 ge(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 ot(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:at.CHANGE})}onFocus(t){this.panel.evt.emit("onPanelItemEvent",{panelItemName:this.model.id,panelItemEventName:at.FOCUS,event:t})}onBlur(t){this.panel.evt.emit("onPanelItemEvent",{panelItemName:this.model.id,panelItemEventName:at.BLUR,event:t})}onEnter(t){this.panel.evt.emit("onPanelItemEvent",{panelItemName:this.model.id,panelItemEventName:at.ENTER,event:t})}}t("PanelFieldController",ye);const we=g({name:"IBizPanelField",props:{modelData:{type:Object,required:!0},controller:{type:ye,required:!0}},setup(t){const e=jt("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 Ce{constructor(){this.component="IBizPanelField"}async createController(t,e,n){const o=new ye(t,e,n);return await o.init(),o}}t("IBizPanelField",qt(we,(function(t){t.component(we.name,we),Z("FIELD",(()=>new Ce))})));class be extends J{get data(){return this.dataParent.data}async onInit(){await super.onInit()}}t("PanelRawItemController",be);const Ie=g({name:"IBizPanelRawItem",props:{modelData:{type:Object,required:!0},controller:{type:be,required:!0}},setup(t){const e=jt("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 Pe{constructor(){this.component="IBizPanelRawItem"}async createController(t,e,n){const o=new be(t,e,n);return await o.init(),o}}t("IBizPanelRawItem",qt(Ie,(function(t){t.component(Ie.name,Ie),Z("RAWITEM",(()=>new Pe)),Z("RAWITEM_STATIC_IMAGE",(()=>new Pe)),Z("RAWITEM_STATIC_LABEL",(()=>new Pe)),Z("RAWITEM_STATIC_TEXT",(()=>new Pe))})));class De extends Q{constructor(){super(...arguments),this.data={}}}class Ee{constructor(t,e,n,o){this.model=t,this.panel=e,this.parent=n,this.state=new De,this.isDataContainer=!0,this.panelItems={},this.state.data=o;const a=st(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)&&!rt(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 Ne extends Q{constructor(){super(...arguments),this.items=[]}}t("MultiDataContainerState",Ne);class Oe extends J{constructor(){super(...arguments),this.isDataContainer=!0,this.dataItems=[],this.providers={}}get data(){return this.state.items}createState(){var t;return new Ne(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 it(t);o&&(this.providers[t.id]=o,(null==(e=t.panelItems)?void 0:e.length)&&!rt(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=st(this.model),n=t.map((t=>new lt(e,t)));this.dataItems=n.map((t=>new Ee(this.model,this.panel,this,t))),this.dataItems.length&&await Promise.all(this.dataItems.map((t=>t.init()))),this.state.items=n,this.childrenStateNotify(ct.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 ut(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",Oe);const Ae=g({name:"IBizMultiDataContainer",props:{modelData:{type:Object,required:!0},controller:{type:Oe,required:!0}},setup(t){const n=jt("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 xe{constructor(){this.component="IBizMultiDataContainer"}async createController(t,e,n){const o=new Oe(t,e,n);return await o.init(),o}}t("IBizMultiDataContainer",qt(Ae,(function(t){t.component(Ae.name,Ae),Z("CONTAINER_CONTAINER_MULTIDATA",(()=>new xe))})));class Re extends Q{constructor(){super(...arguments),this.data={}}}t("SingleDataContainerState",Re);class Se extends J{constructor(){super(...arguments),this.isDataContainer=!0,this.panelItems={},this.providers={}}get data(){return this.state.data}createState(){var t;return new Re(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 it(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)&&!rt(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=st(this.model),a=o.map((t=>t.id)),s=new lt(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(ct.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 ut(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",Se);const ze=g({name:"IBizSingleDataContainer",props:{modelData:{type:Object,required:!0},controller:{type:Se,required:!0}},setup(t){const e=jt("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 Te{constructor(){this.component="IBizSingleDataContainer"}async createController(t,e,n){const o=new Se(t,e,n);return await o.init(),o}}t("IBizSingleDataContainer",qt(ze,(function(t){t.component(ze.name,ze),Z("CONTAINER_CONTAINER_SINGLEDATA",(()=>new Te))})));class Be extends Q{}t("GridContainerState",Be);class je extends J{createState(){var t;return new Be(null==(t=this.parent)?void 0:t.state)}}function Ve(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)}t("GridContainerController",je);const Le=g({name:"IBizGridContainer",props:{modelData:{type:Object,required:!0},controller:{type:je,required:!0}},setup(t){const e=jt("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},Ve(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},Ve(t)?t:{default:()=>[t]}):t})))?n:{default:()=>[n]})}});class Me{constructor(){this.component="IBizGridContainer"}async createController(t,e,n){const o=new je(t,e,n);return await o.init(),o}}t("IBizGridContainer",qt(Le,(function(t){t.component(Le.name,Le),Z("CONTAINER_CONTAINER_GRID",(()=>new Me))})));class ke extends Q{}t("PanelContainerImageState",ke);class _e extends J{createState(){var t;return new ke(null==(t=this.parent)?void 0:t.state)}}function Ge(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)}t("PanelContainerImageController",_e);const We=g({name:"IBizPanelContainerImage",props:{modelData:{type:Object,required:!0},controller:{type:_e,required:!0}},setup(t){const e=jt("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},Ge(n=o.map((t=>{const e=t.props;return e&&e.controller?y(p("iBizCol"),{layoutPos:e.modelData.layoutPos,state:e.controller.state},Ge(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 qe{constructor(){this.component="IBizPanelContainerImage"}async createController(t,e,n){const o=new _e(t,e,n);return await o.init(),o}}t("IBizPanelContainerImage",qt(We,(function(t){t.component(We.name,We),Z("CONTAINER_CONTAINER_IMAGE",(()=>new qe))})));class $e extends Q{}t("PanelContainerGroupState",$e);class Fe extends J{createState(){var t;return new $e(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",Fe);class Ue{constructor(){this.component="IBizPanelContainerGroup"}async createController(t,e,n){const o=new Fe(t,e,n);return await o.init(),o}}function Ke(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)}const He=g({name:"IBizPanelContainerGroup",props:{modelData:{type:Object,required:!0},controller:{type:Fe,required:!0}},setup(t){const e=jt("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},Ke(n=a.map((t=>{const e=t.props;return e&&e.controller?y(p("iBizCol"),{layoutPos:e.modelData.layoutPos,state:e.controller.state},Ke(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",qt(He,(function(t){t.component(He.name,He),Z("CONTAINER_CONTAINER_GROUP",(()=>new Ue))})));function Xe(t){return"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!b(t)}const Ye=g({name:"IBizPanelTabPage",props:{modelData:{type:Object,required:!0},controller:{type:J,required:!0}},setup(t){const e=jt("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},Xe(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},Xe(t)?t:{default:()=>[t]})})))?n:{default:()=>[n]})}});class Qe{constructor(){this.component="IBizPanelTabPage"}async createController(t,e,n){const o=new J(t,e,n);return await o.init(),o}}t("IBizPanelTabPage",qt(Ye,(function(t){t.component(Ye.name,Ye),Z("TABPAGE",(()=>new Qe))})));class Je extends J{getPanelItemCustomHtml(t,e){if(0===t.length)return;const n=t[0];return n.layoutPanelModel?dt.execScriptFn({data:e||{}},n.layoutPanelModel,{singleRowReturn:!0,isAsync:!1}):void 0}}const Ze=g({name:"IBizPanelItemRender",props:{modelData:{type:Object,required:!0},controller:{type:Je,required:!0}},setup(t){var e;const n=jt("panel-item-render"),o=jt("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 tn{constructor(){this.component="IBizPanelItemRender"}async createController(t,e,n){const o=new Je(t,e,n);return await o.init(),o}}t("IBizPanelItemRender",qt(Ze,(function(t){t.component(Ze.name,Ze),Z("PREDEFINE_RENDER",(()=>new tn))}))),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 en{constructor(){this.component="IBizView"}}const nn=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=jt("view"),e=Xt(((...t)=>new pt(...t))),n=mt(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",qt(nn,(function(t){t.component(nn.name,nn),ft("DEFAULT",(()=>new en))}))),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 on{constructor(){this.component="IBizPortalView"}}const an=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=jt("view"),n=Xt(((...t)=>new pt(...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])}}),sn=(t("IBizPortalView",qt(an,(function(t){t.component(an.name,an),ft(U.APP_PORTAL_VIEW,(()=>new on)),ft(U.DE_PORTAL_VIEW,(()=>new on)),ft(U.DE_PORTAL_VIEW9,(()=>new on))}))),g({name:"IBizDeRedirectView",props:{context:{type:Object,required:!0},params:{type:Object,default:()=>({})},modelData:{type:Object,required:!0}},setup(t){const e=Xt(((...t)=>new pt(...t))),n=d(),o=d(),a=d();return e.evt.on("onCreated",(()=>{vt(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 rn{constructor(){this.component="IBizDeRedirectView"}}t("IBizDeRedirectView",qt(sn,(function(t){t.component(sn.name,sn);const e=new rn;ft(U.DE_REDIRECT_VIEW,(()=>e))})));const ln=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=Tt(((...e)=>new gt(...e,t.container))),a=jt("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))):rt(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 cn{constructor(){this.component="IBizViewLayoutPanelControl"}}t("IBizViewLayoutPanelControl",qt(ln,(function(t){t.component(ln.name,ln),yt(wt.VIEW_LAYOUT_PANEL,(()=>new cn))})));function un(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=>un(t,e,n))):(null==(a=t.panelItems)?void 0:a.length)&&(c=()=>t.panelItems.map((t=>un(t,e,n)))),h(l,{modelData:t,controller:r[t.id],key:t.id},c)}const dn=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=Tt(((...e)=>new Ct(...e,t.container))),o=jt("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=un(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",qt(dn,(function(t){t.component(dn.name,dn),yt(wt.PANEL,(()=>new hn))})));function pn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function mn(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function fn(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 vn={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),mn(a),0!==a.length&&(e=a+"/"+e,n=47===a.charCodeAt(0))}return e=fn(e,!n),n?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(mn(t),0===t.length)return".";var e=47===t.charCodeAt(0),n=47===t.charCodeAt(t.length-1);return 0!==(t=fn(t,!e)).length||e||(t="."),t.length>0&&n&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return mn(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];mn(n),n.length>0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":vn.normalize(t)},relative:function(t,e){if(mn(t),mn(e),t===e)return"";if((t=vn.resolve(t))===(e=vn.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(mn(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');mn(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){mn(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){mn(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};vn.posix=vn;var gn=vn,yn=pn(gn);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(gn.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 bt(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=gn.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(yn.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(gn.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 wn{constructor(t,e,n){this.required=!0,e&&(this.default=e),n&&(this.validator=n),this.type=t}}function Cn(){return{value:String,controller:new wn(Object),data:new wn(Object),disabled:{type:Boolean},readonly:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1},overflowMode:{type:String},controlParams:{type:Object,required:!1}}}function bn(){return{hasError:{type:Boolean}}}function In(){return{...Cn(),value:[String,Number]}}function Pn(){return{...Cn(),value:Number}}function Dn(){return{...Cn(),value:String}}function En(){return{...Cn(),value:[String,Number,Object,Array]}}function Nn(){return{...Cn(),value:[String,Number]}}function On(){return{...Cn(),value:[String,Number]}}function An(){return{...Cn(),value:[String,Number]}}function xn(){return{...Cn(),value:[String,Array,Object,Number]}}function Rn(){return{...Cn(),value:[String,Number]}}function Sn(){return{...Cn(),value:[String,Number]}}function zn(){return{...Cn(),value:[String,Number]}}function Tn(){return{...Cn(),value:[String,Number]}}function Bn(){return{...Cn(),value:[String,Number]}}function jn(){return{...Cn(),value:[String,Number]}}function Vn(){return{...Cn(),value:[String,Number,Array]}}function Ln(){return{...Cn(),value:[String,Number]}}function Mn(){return{...Cn(),value:[String,Number]}}function kn(){return{...Cn(),value:[String,Number]}}function _n(){return{...Cn(),value:String}}function Gn(){return{...Cn(),value:[String,Number]}}function Wn(){return{...Cn(),value:String,language:{type:String},theme:{type:String}}}function qn(){return{...Cn(),value:String}}function $n(){return{...Cn(),data:{type:Object,required:!1},controller:{type:Object,required:!1},disabled:{type:Boolean,required:!1}}}function Fn(){return{...Cn(),value:[Array,Array]}}function Un(){return{...Cn(),value:String}}function Kn(){return{...Cn(),value:String}}t("RequiredProp",wn)}}}));
|
|
@@ -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,EAEL,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA0JxB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ref, resolveComponent, h, createVNode, resolveDirective, withDirectives, defineComponent } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { getMatchResPath, getViewProvider } from '@ibiz-template/runtime';
|
|
3
3
|
import { RuntimeError } from '@ibiz-template/core';
|
|
4
|
-
import {
|
|
4
|
+
import { createUUID } from 'qx-util';
|
|
5
5
|
import { isNil, isEmpty } from 'ramda';
|
|
6
6
|
import '../../use/index.mjs';
|
|
7
7
|
import './view-shell.css';
|
|
@@ -42,59 +42,63 @@ const IBizViewShell = /* @__PURE__ */ defineComponent({
|
|
|
42
42
|
throw new RuntimeError("\u672A\u627E\u5230\u89C6\u56FE\u6A21\u578B");
|
|
43
43
|
}
|
|
44
44
|
if (viewModel.dynaSysMode === 1) {
|
|
45
|
-
const
|
|
46
|
-
let
|
|
47
|
-
if (
|
|
48
|
-
|
|
45
|
+
const appDataEntityId = viewModel.appDataEntityId;
|
|
46
|
+
let appDe;
|
|
47
|
+
if (appDataEntityId) {
|
|
48
|
+
appDe = await ibiz.hub.getAppDataEntity(appDataEntityId, viewModel.appId);
|
|
49
|
+
} else {
|
|
50
|
+
throw new RuntimeError("".concat(viewModel.codeName, "\u65E0\u5B9E\u4F53,\u6682\u4E0D\u652F\u6301\u52A0\u8F7D\u52A8\u6001\u6A21\u578B"));
|
|
49
51
|
}
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
if (
|
|
53
|
-
|
|
52
|
+
const loadModelParams = {};
|
|
53
|
+
const srfkey = props.context[appDe.codeName.toLowerCase()];
|
|
54
|
+
if (srfkey) {
|
|
55
|
+
loadModelParams.srfkey = srfkey;
|
|
54
56
|
}
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
57
|
+
const match = getMatchResPath(props.context, appDe);
|
|
58
|
+
if (match && match.keys.length > 1) {
|
|
59
|
+
const parentDeKey = match.keys[match.keys.length - 2];
|
|
60
|
+
loadModelParams.srfparentkey = props.context[parentDeKey];
|
|
61
|
+
loadModelParams.srfparentdeanme = parentDeKey;
|
|
62
|
+
}
|
|
63
|
+
if (appDe && viewModel.enableWF) {
|
|
64
|
+
const context = {
|
|
65
|
+
...props.context
|
|
66
|
+
};
|
|
67
|
+
if (loadModelParams.srfkey) {
|
|
68
|
+
const noSrfSessionId = isNil(props.context.srfsessionid) || isEmpty(props.context.srfsessionid);
|
|
69
|
+
const id = createUUID();
|
|
70
|
+
if (noSrfSessionId) {
|
|
71
|
+
const domain = ibiz.uiDomainManager.create(id);
|
|
72
|
+
context.srfsessionid = domain.id;
|
|
73
|
+
}
|
|
74
|
+
const app = ibiz.hub.getApp(viewModel.appId);
|
|
75
|
+
const service = await app.deService.getService(props.context, appDataEntityId);
|
|
76
|
+
const res = await service.get(context, props.params || {});
|
|
77
|
+
if (res.ok && res.data) {
|
|
78
|
+
const {
|
|
79
|
+
srfwftag,
|
|
80
|
+
processdefinitionkey,
|
|
81
|
+
taskdefinitionkey
|
|
82
|
+
} = res.data;
|
|
83
|
+
if (srfwftag) {
|
|
84
|
+
loadModelParams.srfwftag = srfwftag;
|
|
68
85
|
}
|
|
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;
|
|
86
|
+
if (["DEWFDYNAEDITVIEW3", "DEWFDYNAEDITVIEW"].includes(viewModel.viewType)) {
|
|
87
|
+
const viewParams = props.params;
|
|
88
|
+
if (isNil(viewParams.processDefinitionKey)) {
|
|
89
|
+
viewParams.processDefinitionKey = processdefinitionkey;
|
|
90
|
+
}
|
|
91
|
+
if (isNil(viewParams.taskDefinitionKey)) {
|
|
92
|
+
viewParams.taskDefinitionKey = taskdefinitionkey;
|
|
85
93
|
}
|
|
86
94
|
}
|
|
95
|
+
}
|
|
96
|
+
if (noSrfSessionId) {
|
|
87
97
|
ibiz.uiDomainManager.destroy(id);
|
|
88
98
|
}
|
|
89
|
-
} else {
|
|
90
|
-
throw new RuntimeError("\u672A\u627E\u5230\u6570\u636E\u63A7\u4EF6");
|
|
91
99
|
}
|
|
92
100
|
}
|
|
93
|
-
viewModelData.value = await ibiz.hub.loadAppView(viewModel.appId, viewModel.id,
|
|
94
|
-
...props.context,
|
|
95
|
-
...context,
|
|
96
|
-
...params
|
|
97
|
-
});
|
|
101
|
+
viewModelData.value = await ibiz.hub.loadAppView(viewModel.appId, viewModel.id, loadModelParams);
|
|
98
102
|
} else {
|
|
99
103
|
viewModelData.value = viewModel;
|
|
100
104
|
}
|
|
@@ -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.8",
|
|
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.8",
|
|
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": "cb713ab80cb0e89e6fe89cddb752e774174f99d0"
|
|
65
65
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
/* eslint-disable no-param-reassign */
|
|
2
2
|
/* eslint-disable vue/no-mutating-props */
|
|
3
3
|
import {
|
|
4
|
-
convertNavData,
|
|
5
|
-
getControl,
|
|
6
4
|
getViewProvider,
|
|
7
5
|
IViewProvider,
|
|
8
|
-
|
|
6
|
+
getMatchResPath,
|
|
9
7
|
} from '@ibiz-template/runtime';
|
|
10
8
|
import { defineComponent, h, PropType, ref, resolveComponent } from 'vue';
|
|
11
|
-
import {
|
|
9
|
+
import { IAppDataEntity, IAppView } from '@ibiz/model-core';
|
|
12
10
|
import { RuntimeError } from '@ibiz-template/core';
|
|
13
|
-
import { createUUID
|
|
11
|
+
import { createUUID } from 'qx-util';
|
|
14
12
|
import { isEmpty, isNil } from 'ramda';
|
|
15
13
|
import { useNamespace } from '../../use';
|
|
16
14
|
import './view-shell.scss';
|
|
@@ -42,74 +40,94 @@ export const IBizViewShell = defineComponent({
|
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
if (viewModel.dynaSysMode === 1) {
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
let
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
//* 计算实体资源路径上下文参数
|
|
44
|
+
const appDataEntityId = viewModel.appDataEntityId;
|
|
45
|
+
let appDe: IAppDataEntity | undefined;
|
|
46
|
+
if (appDataEntityId) {
|
|
47
|
+
appDe = await ibiz.hub.getAppDataEntity(
|
|
48
|
+
appDataEntityId,
|
|
49
|
+
viewModel.appId,
|
|
50
|
+
);
|
|
51
|
+
} else {
|
|
52
|
+
throw new RuntimeError(
|
|
53
|
+
`${viewModel.codeName}无实体,暂不支持加载动态模型`,
|
|
53
54
|
);
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
/** 加载动态模型的请求参数 */
|
|
58
|
+
const loadModelParams: IParams = {};
|
|
59
|
+
// * 计算资源路径上下文参数
|
|
60
|
+
// 主键
|
|
61
|
+
const srfkey = props.context[appDe.codeName!.toLowerCase()];
|
|
62
|
+
if (srfkey) {
|
|
63
|
+
loadModelParams.srfkey = srfkey;
|
|
64
|
+
}
|
|
65
|
+
// 上层资源路径主实体名称和主键
|
|
66
|
+
const match = getMatchResPath(props.context, appDe);
|
|
67
|
+
if (match && match.keys.length > 1) {
|
|
68
|
+
const parentDeKey = match.keys[match.keys.length - 2];
|
|
69
|
+
loadModelParams.srfparentkey = props.context[parentDeKey];
|
|
70
|
+
loadModelParams.srfparentdeanme = parentDeKey;
|
|
65
71
|
}
|
|
66
72
|
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
)
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
73
|
+
// 工作流视图加载数据补充srfwftag
|
|
74
|
+
if (appDe && viewModel.enableWF) {
|
|
75
|
+
// 处理数据请求的上下文
|
|
76
|
+
const context: IContext = { ...props.context };
|
|
77
|
+
// 存在主键则加载数据计算对应的参数
|
|
78
|
+
if (loadModelParams.srfkey) {
|
|
79
|
+
const noSrfSessionId =
|
|
80
|
+
isNil(props.context.srfsessionid) ||
|
|
81
|
+
isEmpty(props.context.srfsessionid);
|
|
82
|
+
const id = createUUID();
|
|
83
|
+
// 只要上下文中无 srfsessionid 则生成一个
|
|
84
|
+
if (noSrfSessionId) {
|
|
85
|
+
// 生成一个界面域,界面域标识为当前控制器实例的标识
|
|
86
|
+
const domain = ibiz.uiDomainManager.create(id);
|
|
87
|
+
context.srfsessionid = domain.id;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const app = ibiz.hub.getApp(viewModel.appId);
|
|
91
|
+
const service = await app.deService.getService(
|
|
92
|
+
props.context,
|
|
93
|
+
appDataEntityId!,
|
|
94
|
+
);
|
|
95
|
+
const res = await service.get(context, props.params || {});
|
|
96
|
+
if (res.ok && res.data) {
|
|
97
|
+
const { srfwftag, processdefinitionkey, taskdefinitionkey } =
|
|
98
|
+
res.data;
|
|
99
|
+
if (srfwftag) {
|
|
100
|
+
loadModelParams.srfwftag = srfwftag;
|
|
84
101
|
}
|
|
85
102
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
params.srfwftag = srfwftag;
|
|
103
|
+
// *动态工作流编辑视图从数据里额外获取参数
|
|
104
|
+
if (
|
|
105
|
+
['DEWFDYNAEDITVIEW3', 'DEWFDYNAEDITVIEW'].includes(
|
|
106
|
+
viewModel.viewType!,
|
|
107
|
+
)
|
|
108
|
+
) {
|
|
109
|
+
const viewParams = props.params!;
|
|
110
|
+
// 如果视图参数中没有获取到对应流程实例标识与步骤标识,则从请求回来的数据中获取对应信息
|
|
111
|
+
if (isNil(viewParams.processDefinitionKey)) {
|
|
112
|
+
viewParams.processDefinitionKey = processdefinitionkey;
|
|
113
|
+
}
|
|
114
|
+
if (isNil(viewParams.taskDefinitionKey)) {
|
|
115
|
+
viewParams.taskDefinitionKey = taskdefinitionkey;
|
|
100
116
|
}
|
|
101
117
|
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (noSrfSessionId) {
|
|
102
121
|
ibiz.uiDomainManager.destroy(id);
|
|
103
122
|
}
|
|
104
|
-
} else {
|
|
105
|
-
throw new RuntimeError('未找到数据控件');
|
|
106
123
|
}
|
|
107
124
|
}
|
|
108
125
|
|
|
126
|
+
// *加载动态模型
|
|
109
127
|
viewModelData.value = await ibiz.hub.loadAppView(
|
|
110
128
|
viewModel.appId,
|
|
111
129
|
viewModel.id!,
|
|
112
|
-
|
|
130
|
+
loadModelParams,
|
|
113
131
|
);
|
|
114
132
|
} else {
|
|
115
133
|
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;
|