@ibiz-template/runtime 0.0.1-alpha.39 → 0.0.1-alpha.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- System.register(["@ibiz-template/service","@ibiz-template/command","@ibiz-template/core","qx-util","@ibiz-template/model"],(function(e){"use strict";var t,n,r,i,o,a,c,u,s;return{setters:[null,function(e){t=e.commands},function(e){n=e.RuntimeError,r=e.IBizContext},function(e){i=e.notNilEmpty,o=e.isNilOrEmpty},function(e){a=e.UnsupportedModelError,c=e.DefectModelError,u=e.getPSUIActionByModelObject,s=e.AppEntityModel}],execute:function(){e({convertNavData:A,convertNavDataByArray:P,convertNavDataByObject:b,executeNewDataAppUILogic:k,executeOpenDataAppUILogic:M,executeViewLogic:function(e,t,n,r,i){void 0===i&&(i={});return f(this,void 0,void 0,(function(){var o;return d(this,(function(a){switch(a.label){case 0:return"opendata"===e.name&&e.getPSAppUILogic()?[2,M(e.getPSAppUILogic(),t,n,r,i)]:"newdata"===e.name&&e.getPSAppUILogic()?[2,k(e.getPSAppUILogic(),t,n,r,i)]:[4,u(e.getPSAppViewUIAction())];case 1:if(!(o=a.sent()))throw new Error("找不到界面行为");return[2,m.exec(o,t,n,r,i)]}}))}))},install:function(){var e=window.ibiz;e.commands=t,e.register=new y,U(),L()},installCommand:U,openRedirectView:V,presetUIActionProvider:L});var l=function(e,t){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},l(e,t)};function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function f(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function c(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}u((r=r.apply(e,t||[])).next())}))}function d(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}}function w(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function v(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var g=e("RegisterBase",function(){function e(){this.providers=new Map}return e.prototype.register=function(e,t){this.providers.set(e,t)},e.prototype.unRegister=function(e){this.providers.delete(e)},e.prototype.getByKey=function(e){return this.providers.get(e)},e}()),S=e("UIActionRegister",function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.get=function(e){return f(this,void 0,void 0,(function(){var t,r,i,o,a,c;return d(this,(function(u){switch(u.label){case 0:return e.getPSSysPFPlugin()?[4,ibiz.plugin.loadPlugin(e.getPSSysPFPlugin())]:[3,2];case 1:if(u.sent(),t=e.getPSSysPFPlugin(),r=t.pluginType,i=t.pluginCode,c="".concat(r,"_").concat(i),this.providers.has(c))return[2,this.providers.get(c)];throw new n("找不到插件标识".concat(c,"对应的适配器"));case 2:if(o=e.uIActionMode,a=e.uIActionTag,"SYS"===o){if(c="".concat(o,"_").concat(a),this.providers.has(c))return[2,this.providers.get(c)];throw new n("找不到系统预置界面行为".concat(a,"对应的适配器"))}if(this.providers.has(o))return[2,this.providers.get(o)];throw new n("找不界面行为模式".concat(o,"对应的适配器"))}}))}))},t}(g)),y=e("RegisterCenter",(function(){this.uiAction=new S}));function A(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return"[object Array]"===Object.prototype.toString.call(e)?P.apply(void 0,v([e],h(t),!1)):"[object Object]"===Object.prototype.toString.call(e)?b.apply(void 0,v([e],h(t),!1)):{}}function P(e){for(var t,n,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];var c={},u=function(e){if(i(e.value)&&!e.rawValue){var t=r.find((function(t){return!o(t)&&(t[e.value]||Object.prototype.hasOwnProperty.call(t,e.value))}));t&&(c[e.key]=t[e.value])}else c[e.key]=e.value};try{for(var s=w(e),l=s.next();!l.done;l=s.next()){var p=l.value;u(p)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return c}function b(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r={},o=/^%(.+)%$/,a=function(n){if(i(e[n])&&o.test(e[n])){var a=e[n].substring(1,e[n].length-1),c=t.find((function(e){return Object.prototype.hasOwnProperty.call(e,a)}));c&&(r[n]=c[a])}else r[n]=e[n]};for(var c in e)a(c);return r}var m=e("AppDEUIActionUtil",function(){function e(){}return e.exec=function(e,t,n,r,i){return f(this,void 0,void 0,(function(){return d(this,(function(o){switch(o.label){case 0:return[4,ibiz.register.uiAction.get(e)];case 1:return[4,o.sent().getHandler()];case 2:return[2,o.sent().exec(e,t,n,r,i)]}}))}))},e}()),E=e("UIActionHandler",function(){function e(){}return e.prototype.exec=function(e,t,n,r,i){return f(this,void 0,void 0,(function(){var o,a,c;return d(this,(function(u){switch(u.label){case 0:return[4,this.isConfirm(e)];case 1:return u.sent()?(o=i.neuron,a={refresh:e.reloadData,closeView:e.closeEditView},[4,this.execAction(e,t,n,r,i)]):[2,{}];case 2:return c=u.sent(),Object.assign(a,c),[4,this.doNextAction(e,t,n,r,i)];case 3:return u.sent(),[4,this.handleResult(a,o)];case 4:return u.sent(),[2,a]}}))}))},e.prototype.isConfirm=function(e){return f(this,void 0,void 0,(function(){return d(this,(function(t){return e.enableConfirm&&e.confirmMsg?[2,ibiz.modal.confirm({title:e.confirmMsg})]:[2,!0]}))}))},e.prototype.doNextAction=function(e,t,n,r,i){return f(this,void 0,void 0,(function(){var o;return d(this,(function(a){switch(a.label){case 0:return(o=e.getNextPSUIAction())?[4,m.exec(o,t,n,r,i)]:[3,2];case 1:a.sent(),a.label=2;case 2:return[2]}}))}))},e.prototype.handleResult=function(e,t){return f(this,void 0,void 0,(function(){return d(this,(function(r){switch(r.label){case 0:if(!e.closeView)return[3,2];if(!t.call.closeView)throw new n("该视图不存在关闭视图能力");return[4,t.call.closeView()];case 1:return r.sent(),[2];case 2:if(!e.refresh)return[3,4];if(!t.call.refresh)throw new n("该视图不存在刷新能力");return[4,t.call.refresh()];case 3:r.sent(),r.label=4;case 4:return[2]}}))}))},e.prototype.handleParams=function(e,t,n,o){return f(this,void 0,void 0,(function(){var a,c,u,s,l,p,f,w,h;return d(this,(function(d){switch(d.label){case 0:if(a=n||[],-1!==["SINGLEDATA","MULTIDATA","MULTIKEY"].indexOf(e.actionTarget))throw new Error("数据类型".concat(e.actionTarget,"暂未支持,请配置无数据或单项数据主键"));return"NONE"===e.actionTarget&&(a=[]),c={},u=e.getPSNavigateContexts()||[],(s=e.getPSAppDataEntity())&&"SINGLEKEY"===e.actionTarget?[4,null==s?void 0:s.fill(!0)]:[3,2];case 1:d.sent(),l=s.codeName.toLowerCase(),p=e.valueItem,u.unshift({key:l,value:p||"srfkey",rawValue:!1}),d.label=2;case 2:return i(u)&&(c=A(u,t,o,(null==n?void 0:n[0])||{})),f=new r(c,t),w={},h=e.getPSNavigateParams(),i(h)&&(w=A(h,t,o,(null==n?void 0:n[0])||{})),[2,{resultContext:f,resultData:a,resultParams:w}]}}))}))},e}()),x=e("CommonSysUIActionHandler",function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.execAction=function(e,t,n,r,i){return f(this,void 0,void 0,(function(){var t,r,o,a,c;return d(this,(function(u){switch(u.label){case 0:if(r=(t=i).neuron,o=t.event,a=e.uIActionTag,c={},"New"!==a)return[3,2];if(!r.call.newData)throw new Error("该视图不存在newData能力");return[4,r.call.newData(o)];case 1:u.sent(),u.label=2;case 2:if("Edit"!==a)return[3,4];if(!r.call.openData)throw new Error("该视图不存在openData能力");return[4,r.call.openData(null==n?void 0:n[0],o)];case 3:u.sent(),u.label=4;case 4:if(-1===["SaveAndExit","Save","SaveRow"].indexOf(a))return[3,6];if(!r.call.save)throw new Error("该视图不存在save能力");return[4,r.call.save()];case 5:u.sent(),u.label=6;case 6:if("SaveAndNew"!==a)return[3,8];if(!r.call.saveAndNew)throw new Error("该视图不存在saveAndNew能力");return[4,r.call.saveAndNew()];case 7:u.sent(),u.label=8;case 8:if("Remove"!==a&&"RemoveAndExit"!==a)return[3,10];if(!r.call.remove)throw new Error("该视图不存在remove能力");return[4,r.call.remove()];case 9:u.sent(),u.label=10;case 10:if("NewRow"!==a)return[3,12];if(!r.call.newRow)throw new Error("该视图不存在newRow能力");return[4,r.call.newRow()];case 11:u.sent(),u.label=12;case 12:if("ToggleFilter"===a){if(!r.call.toggleFilter)throw new Error("该视图不存在ToggleFilter能力");r.call.toggleFilter()}if("SaveAndStart"!==a)return[3,14];if(!r.call.wfStart)throw new Error("该视图不存在SaveAndStart能力");return[4,r.call.wfStart()];case 13:u.sent(),u.label=14;case 14:if("ViewWFStep"!==a)return[3,16];if(!r.call.wfSubmit)throw new Error("该视图不存在ViewWFStep能力");return[4,r.call.wfSubmit()];case 15:u.sent(),u.label=16;case 16:return-1!==["SaveAndExit","Exit","RemoveAndExit"].indexOf(a)&&(c.closeView=!0),-1!==["Refresh"].indexOf(a)&&(c.refresh=!0),[2,c]}}))}))},t}(E)),D=e("BackendUIActionHandler",function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.execAction=function(e,t,n,r,i){var o,a,c;return f(this,void 0,void 0,(function(){var i,u,s,l,p,f,w,h;return d(this,(function(d){switch(d.label){case 0:if(i=null===(o=e.getPSAppDataEntity())||void 0===o?void 0:o.codeName,u=null===(a=e.getPSAppDEMethod())||void 0===a?void 0:a.codeName,!i||!u)throw new Error("找不到实体或实体行为");return[4,this.handleParams(e,t,n,r)];case 1:return s=d.sent(),l=s.resultContext,p=s.resultParams,f=s.resultData,[4,ibiz.entityService.getService(i)];case 2:return w=d.sent(),h=f.length>0?(null===(c=f[0])||void 0===c?void 0:c.getRequestData())||f[0]:{},[4,w.exec(u,l,h,p)];case 3:return d.sent(),[2,{}]}}))}))},t}(E)),N=e("FrontUIActionHandler",function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.execAction=function(e,t,n,r,i){return f(this,void 0,void 0,(function(){var o,a,c,u;return d(this,(function(s){switch(s.label){case 0:if(!(o=e.getFrontPSAppView()))throw new Error("未配置打开视图");return[4,o.fill(!0)];case 1:return s.sent(),[4,this.handleParams(e,t,n,r)];case 2:return a=s.sent(),c=a.resultContext,u=a.resultParams,[4,ibiz.commands.execute(T.TAG,o,c,u,i)];case 3:return s.sent(),[2,{}]}}))}))},t}(E));function V(e,t,n,i){return void 0===t&&(t=new r),void 0===n&&(n={}),void 0===i&&(i=[]),f(this,void 0,void 0,(function(){return d(this,(function(r){if(e.instanceof("app.view.IPSAppDERedirectView"))return[2,O(e,t,n,i)];throw new a(e,"未支持的重定向视图类型: ".concat(e.viewType))}))}))}function O(e,t,n,i){return void 0===t&&(t=new r),void 0===n&&(n={}),void 0===i&&(i=[]),f(this,void 0,void 0,(function(){var o,a,u,s,l,p,f,w,h,v,g,S,y,P,b,m,E;return d(this,(function(d){switch(d.label){case 0:return o=e.getPSAppViewNavContexts()||[],a=A(o,t,n),t=new r(a,t),u=e.getPSAppViewNavParams()||[],s=A(u,t,n),Object.assign(n,s),[4,(l=e.getPSAppDataEntity()).fill(!0)];case 1:return d.sent(),p=l.codeName.toLowerCase(),f=i[0]||{},t[p]=f[p]||t[p]||n[p],w=e.getGetDataPSAppDEAction(),[4,ibiz.entityService.getService(l.codeName)];case 2:return h=d.sent(),ibiz.loading.showRedirect(),[4,h.exec(w?w.codeName:"Get",t,n)];case 3:return v=d.sent(),ibiz.loading.hideRedirect(),v.ok&&(f=v.data,g=f.linkurl)?g.startsWith("http://")||g.startsWith("https://")?(window.open(g,"_blank"),[2,{ok:!0,data:[]}]):[2,{ok:!1,data:[]}]:[4,R(l,e,n.srfwf,f)];case 4:return S=d.sent(),y="".concat(l.name.toUpperCase(),":").concat(S),P=e.getRedirectPSAppViewRefs(),b=null==P?void 0:P.find((function(e){return e.name===y||e.name===S})),b?(m=b.getRefPSAppView())?[4,ibiz.commands.execute(T.TAG,m,t,n,{data:[f]})]:[3,6]:[3,7];case 5:return(E=d.sent())?[2,E]:[3,7];case 6:throw new c(b,"未配置实际引用视图");case 7:return[2,{ok:!0,data:[]}]}}))}))}function R(e,t,n,r){return f(this,void 0,void 0,(function(){var a,c,u,s,l;return d(this,(function(p){return"",(a=t.getTypePSAppDEField())&&(c=r[a.codeName.toLowerCase()],i(c))?[2,c]:i(n)?[2,"EDITVIEW:".concat(n.toUpperCase())]:(u="",(s=e.getIndexTypePSAppDEField())&&(u=r[s.codeName.toLowerCase()]),o(u)&&(l=e.getFormTypePSAppDEField())&&(u=r[l.codeName.toLowerCase()]),[2,i(u)?"EDITVIEW:".concat(u):"EDITVIEW"])}))}))}var T=e("OpenAppViewCommand",function(){function e(){ibiz.commands.register(e.TAG,this.exec.bind(this))}return e.prototype.exec=function(e,t,n,r){return void 0===n&&(n={}),void 0===r&&(r={}),f(this,void 0,void 0,(function(){var i;return d(this,(function(o){switch(o.label){case 0:return[4,e.fill(!0)];case 1:if(o.sent(),e.redirectView)return[2,V(e,t,n,r.data)];switch(i=e.openMode,void 0===i?"INDEXVIEWTAB":i){case"INDEXVIEWTAB":default:return[2,this.openIndexViewTab(e,t,n)];case"POPUP":throw new Error("未支持的视图打开模式: POPUP");case"POPUPMODAL":return[2,this.openModal(e,t,n)];case"POPUPAPP":throw new Error("未支持的视图打开模式: POPUPAPP");case"POPOVER":return[2,this.openPopover(e,t,n)];case"DRAWER_LEFT":case"DRAWER_RIGHT":case"DRAWER_TOP":case"DRAWER_BOTTOM":return[2,this.openDrawer(e,t,n)];case"USER":return[2,this.openUserCustom(e,t,n)]}return[2]}}))}))},e.prototype.openIndexViewTab=function(e,t,n){return void 0===n&&(n={}),ibiz.openView.root(e,t,n)},e.prototype.openModal=function(e,t,n){return void 0===n&&(n={}),f(this,void 0,void 0,(function(){return d(this,(function(r){return[2,ibiz.openView.modal(e,t,n)]}))}))},e.prototype.openPopover=function(e,t,n){return void 0===n&&(n={}),f(this,void 0,void 0,(function(){return d(this,(function(r){return[2,ibiz.openView.popover(e,t,n)]}))}))},e.prototype.openDrawer=function(e,t,n){return void 0===n&&(n={}),f(this,void 0,void 0,(function(){return d(this,(function(r){return[2,ibiz.openView.drawer(e,t,n)]}))}))},e.prototype.openUserCustom=function(e,t,n){return void 0===n&&(n={}),f(this,void 0,void 0,(function(){return d(this,(function(r){return[2,ibiz.openView.custom(e,t,n)]}))}))},e.TAG="ibiz.app-view.open",e}()),I=e("AppFuncCommand",function(){function e(){ibiz.commands.register(e.TAG,this.exec.bind(this))}return e.prototype.exec=function(e,t,n,i){return void 0===n&&(n={}),void 0===i&&(i={}),f(this,void 0,void 0,(function(){var o,a;return d(this,(function(c){switch((o=e.getPSNavigateContexts())&&(t?Object.assign(t,o):t=new r(o)),(a=e.getPSNavigateParams())&&Object.assign(n,a),e.appFuncType){case"APPVIEW":return[2,this.openAppView(e,t,n,i)];case"OPENHTMLPAGE":return[2,this.openHtmlPage(e)];case"PDTAPPFUNC":return[2,this.openPdAppFunc(e,t,n)];case"JAVASCRIPT":return[2,this.executeJavaScript(e,t,n)];case"CUSTOM":return[2,this.custom(e,t,n)];default:throw new Error("未知的应用功能类型: ".concat(e.appFuncType))}}))}))},e.prototype.openAppView=function(e,t,n,r){var i=e.getPSAppView();if(!i)throw new Error("应用视图不存在");return ibiz.commands.execute(T.TAG,i,t,n,r)},e.prototype.openHtmlPage=function(e){var t=e.htmlPageUrl;window.open(t,"_blank")},e.prototype.openPdAppFunc=function(e,t,n){throw ibiz.log.warn("openPdAppFunc",e,t,n),new Error("未实现")},e.prototype.executeJavaScript=function(e,t,n){throw ibiz.log.warn("executeJavaScript",e,t,n),new Error("未实现")},e.prototype.custom=function(e,t,n){throw ibiz.log.warn("custom",e,t,n),new Error("未实现")},e.TAG="ibiz.app-func.exec",e}());function U(){new I,new T}var C,z=e("BackendUIActionProvider",function(){function e(){}return e.prototype.getHandler=function(){return f(this,void 0,void 0,(function(){return d(this,(function(e){return this.handler||(this.handler=new D),[2,this.handler]}))}))},e}()),_=e("CommonSysUIActionProvider",function(){function e(){}return e.prototype.getHandler=function(){return f(this,void 0,void 0,(function(){return d(this,(function(e){return this.handler||(this.handler=new x),[2,this.handler]}))}))},e}()),F=e("FrontUIActionProvider",function(){function e(){}return e.prototype.getHandler=function(){return f(this,void 0,void 0,(function(){return d(this,(function(e){return this.handler||(this.handler=new N),[2,this.handler]}))}))},e}());function L(){var e=ibiz.register.uiAction;e&&(e.register("FRONT",new F),e.register("BACKEND",new z),e.register("SYS_New",new _),e.register("SYS_New",new _),e.register("SYS_Edit",new _),e.register("SYS_Save",new _),e.register("SYS_SaveAndExit",new _),e.register("SYS_SaveRow",new _),e.register("SYS_SaveAndNew",new _),e.register("SYS_Remove",new _),e.register("SYS_RemoveAndExit",new _),e.register("SYS_NewRow",new _),e.register("SYS_SaveAndStart",new _),e.register("SYS_ViewWFStep",new _),e.register("SYS_ToggleFilter",new _),e.register("SYS_Exit",new _),e.register("SYS_Refresh",new _))}function M(e,t,n,o,a){return void 0===a&&(a={}),f(this,void 0,void 0,(function(){var c,u,l,p,f,w,h,v;return d(this,(function(d){switch(d.label){case 0:if(!(null==n?void 0:n[0]))throw Error("没有选中数据!");if(!(c=e.getOpenDataPSAppView()))throw new Error("getOpenDataPSAppView为空");if(!(u=c.getRefPSAppView()))throw new Error("openView为空");return[4,u.fill(!0)];case 1:return d.sent(),[4,(l=new s(u.getPSAppDataEntity())).init()];case 2:return d.sent(),p=c.getPSNavigateContexts()||[],f=l.deName.toLowerCase(),-1===p.findIndex((function(e){return e.key===f}))&&p.push({key:f,value:f,rawValue:!1}),w=new r(A(p,t,o,n[0]),t),h={},v=c.getPSNavigateParams(),i(v)&&(h=A(v,o,t,n[0])),[4,ibiz.commands.execute(T.TAG,u,w,h,a)];case 3:return d.sent(),a.neuron.call.refresh(),[2,{}]}}))}))}function k(e,t,n,o,a){return void 0===a&&(a={}),f(this,void 0,void 0,(function(){var c,u,l,p,f,w,h,v;return d(this,(function(d){switch(d.label){case 0:if(!(c=e.getNewDataPSAppView()))throw new Error("getNewDataPSAppView为空");if(!(u=c.getRefPSAppView()))throw new Error("newView为空");return[4,u.fill(!0)];case 1:return d.sent(),[4,(l=new s(u.getPSAppDataEntity())).init()];case 2:return d.sent(),p={},f={},w=(null==n?void 0:n[0])||{},h=c.getPSNavigateContexts(),i(h)&&(p=A(h,t,o,w)),delete(p=new r(p,t))[l.deName.toLowerCase()],p[l.deName.toLowerCase()]=void 0,v=c.getPSNavigateParams(),i(v)&&(f=A(v,o,t,w)),e.enableWizardAdd||e.enableBatchAdd||e.batchAddOnly,[4,ibiz.commands.execute(T.TAG,u,p,f,a)];case 3:return d.sent(),a.neuron.call.refresh(),[2,{}]}}))}))}e("ViewMode",C),function(e){e.ROUTE="ROUTE",e.MODAL="MODAL",e.DRAWER="DRAWER",e.EMBED="EMBED",e.POPOVER="POPOVER"}(C||e("ViewMode",C={}))}}}));
1
+ System.register(["@ibiz-template/service","@ibiz-template/command","@ibiz-template/core","qx-util","@ibiz-template/model"],(function(e){"use strict";var t,n,r,i,o,a,c,u,s;return{setters:[null,function(e){t=e.commands},function(e){n=e.RuntimeError,r=e.IBizContext},function(e){i=e.notNilEmpty,o=e.isNilOrEmpty},function(e){a=e.UnsupportedModelError,c=e.DefectModelError,u=e.getPSUIActionByModelObject,s=e.AppEntityModel}],execute:function(){e({convertNavData:A,convertNavDataByArray:P,convertNavDataByObject:m,executeNewDataAppUILogic:k,executeOpenDataAppUILogic:M,executeViewLogic:function(e,t,n,r,i){void 0===i&&(i={});return f(this,void 0,void 0,(function(){var o;return d(this,(function(a){switch(a.label){case 0:return"opendata"===e.name&&e.getPSAppUILogic()?[2,M(e.getPSAppUILogic(),t,n,r,i)]:"newdata"===e.name&&e.getPSAppUILogic()?[2,k(e.getPSAppUILogic(),t,n,r,i)]:[4,u(e.getPSAppViewUIAction())];case 1:if(!(o=a.sent()))throw new Error("找不到界面行为");return[2,b.exec(o,t,n,r,i)]}}))}))},install:function(){var e=window.ibiz;e.commands=t,e.register=new y,U(),L()},installCommand:U,openRedirectView:R,presetUIActionProvider:L});var l=function(e,t){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},l(e,t)};function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function f(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function c(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}u((r=r.apply(e,t||[])).next())}))}function d(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}}function w(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function v(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var g=e("RegisterBase",function(){function e(){this.providers=new Map}return e.prototype.register=function(e,t){this.providers.set(e,t)},e.prototype.unRegister=function(e){this.providers.delete(e)},e.prototype.getByKey=function(e){return this.providers.get(e)},e}()),S=e("UIActionRegister",function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.get=function(e){return f(this,void 0,void 0,(function(){var t,r,i,o,a,c;return d(this,(function(u){switch(u.label){case 0:return e.getPSSysPFPlugin()?[4,ibiz.plugin.loadPlugin(e.getPSSysPFPlugin())]:[3,2];case 1:if(u.sent(),t=e.getPSSysPFPlugin(),r=t.pluginType,i=t.pluginCode,c="".concat(r,"_").concat(i),this.providers.has(c))return[2,this.providers.get(c)];throw new n("找不到插件标识".concat(c,"对应的适配器"));case 2:if(o=e.uIActionMode,a=e.uIActionTag,"SYS"===o){if(c="".concat(o,"_").concat(a),this.providers.has(c))return[2,this.providers.get(c)];throw new n("找不到系统预置界面行为".concat(a,"对应的适配器"))}if(this.providers.has(o))return[2,this.providers.get(o)];throw new n("找不界面行为模式".concat(o,"对应的适配器"))}}))}))},t}(g)),y=e("RegisterCenter",(function(){this.uiAction=new S}));function A(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return"[object Array]"===Object.prototype.toString.call(e)?P.apply(void 0,v([e],h(t),!1)):"[object Object]"===Object.prototype.toString.call(e)?m.apply(void 0,v([e],h(t),!1)):{}}function P(e){for(var t,n,r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];var c={},u=function(e){if(i(e.value)&&!e.rawValue){var t=r.find((function(t){return!o(t)&&(t[e.value]||Object.prototype.hasOwnProperty.call(t,e.value))}));t&&(c[e.key]=t[e.value])}else c[e.key]=e.value};try{for(var s=w(e),l=s.next();!l.done;l=s.next()){var p=l.value;u(p)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return c}function m(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r={},o=/^%(.+)%$/,a=function(n){if(i(e[n])&&o.test(e[n])){var a=e[n].substring(1,e[n].length-1),c=t.find((function(e){return Object.prototype.hasOwnProperty.call(e,a)}));c&&(r[n]=c[a])}else r[n]=e[n]};for(var c in e)a(c);return r}var b=e("AppDEUIActionUtil",function(){function e(){}return e.exec=function(e,t,n,r,i){return f(this,void 0,void 0,(function(){return d(this,(function(o){switch(o.label){case 0:return[4,ibiz.register.uiAction.get(e)];case 1:return[4,o.sent().getHandler()];case 2:return[2,o.sent().exec(e,t,n,r,i)]}}))}))},e}()),E=e("UIActionHandler",function(){function e(){}return e.prototype.exec=function(e,t,n,r,i){return f(this,void 0,void 0,(function(){var o,a,c;return d(this,(function(u){switch(u.label){case 0:return[4,this.isConfirm(e)];case 1:return u.sent()?(o=i.neuron,a={refresh:e.reloadData,closeView:e.closeEditView},[4,this.execAction(e,t,n,r,i)]):[2,{}];case 2:return c=u.sent(),Object.assign(a,c),[4,this.doNextAction(e,t,n,r,i)];case 3:return u.sent(),[4,this.handleResult(a,o)];case 4:return u.sent(),[2,a]}}))}))},e.prototype.isConfirm=function(e){return f(this,void 0,void 0,(function(){return d(this,(function(t){return e.enableConfirm&&e.confirmMsg?[2,ibiz.modal.confirm({title:e.confirmMsg})]:[2,!0]}))}))},e.prototype.doNextAction=function(e,t,n,r,i){return f(this,void 0,void 0,(function(){var o;return d(this,(function(a){switch(a.label){case 0:return(o=e.getNextPSUIAction())?[4,b.exec(o,t,n,r,i)]:[3,2];case 1:a.sent(),a.label=2;case 2:return[2]}}))}))},e.prototype.handleResult=function(e,t){return f(this,void 0,void 0,(function(){return d(this,(function(r){switch(r.label){case 0:if(!e.closeView)return[3,2];if(!t.call.closeView)throw new n("该视图不存在关闭视图能力");return[4,t.call.closeView()];case 1:return r.sent(),[2];case 2:if(!e.refresh)return[3,4];if(!t.call.refresh)throw new n("该视图不存在刷新能力");return[4,t.call.refresh()];case 3:r.sent(),r.label=4;case 4:return[2]}}))}))},e.prototype.handleParams=function(e,t,n,o){return f(this,void 0,void 0,(function(){var a,c,u,s,l,p,f,w,h;return d(this,(function(d){switch(d.label){case 0:if(a=n||[],-1!==["SINGLEDATA","MULTIDATA","MULTIKEY"].indexOf(e.actionTarget))throw new Error("数据类型".concat(e.actionTarget,"暂未支持,请配置无数据或单项数据主键"));return"NONE"===e.actionTarget&&(a=[]),c={},u=e.getPSNavigateContexts()||[],(s=e.getPSAppDataEntity())&&"SINGLEKEY"===e.actionTarget?[4,null==s?void 0:s.fill(!0)]:[3,2];case 1:d.sent(),l=s.codeName.toLowerCase(),p=e.valueItem,u.unshift({key:l,value:p||"srfkey",rawValue:!1}),d.label=2;case 2:return i(u)&&(c=A(u,t,o,(null==n?void 0:n[0])||{})),f=new r(c,t),w={},h=e.getPSNavigateParams(),i(h)&&(w=A(h,t,o,(null==n?void 0:n[0])||{})),[2,{resultContext:f,resultData:a,resultParams:w}]}}))}))},e}()),x=e("CommonSysUIActionHandler",function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.execAction=function(e,t,n,r,i){return f(this,void 0,void 0,(function(){var t,r,o,a,c;return d(this,(function(u){switch(u.label){case 0:if(r=(t=i).neuron,o=t.event,a=e.uIActionTag,c={},"New"!==a)return[3,2];if(!r.call.newData)throw new Error("该视图不存在newData能力");return[4,r.call.newData(o)];case 1:u.sent(),u.label=2;case 2:if("Edit"!==a)return[3,4];if(!r.call.openData)throw new Error("该视图不存在openData能力");return[4,r.call.openData(null==n?void 0:n[0],o)];case 3:u.sent(),u.label=4;case 4:if(-1===["SaveAndExit","Save","SaveRow"].indexOf(a))return[3,6];if(!r.call.save)throw new Error("该视图不存在save能力");return[4,r.call.save()];case 5:u.sent(),u.label=6;case 6:if("SaveAndNew"!==a)return[3,8];if(!r.call.saveAndNew)throw new Error("该视图不存在saveAndNew能力");return[4,r.call.saveAndNew()];case 7:u.sent(),u.label=8;case 8:if("Remove"!==a&&"RemoveAndExit"!==a)return[3,10];if(!r.call.remove)throw new Error("该视图不存在remove能力");return[4,r.call.remove()];case 9:u.sent(),u.label=10;case 10:if("NewRow"!==a)return[3,12];if(!r.call.newRow)throw new Error("该视图不存在newRow能力");return[4,r.call.newRow()];case 11:u.sent(),u.label=12;case 12:if("ToggleFilter"===a){if(!r.call.toggleFilter)throw new Error("该视图不存在ToggleFilter能力");r.call.toggleFilter()}if("SaveAndStart"!==a)return[3,14];if(!r.call.wfStart)throw new Error("该视图不存在SaveAndStart能力");return[4,r.call.wfStart()];case 13:u.sent(),u.label=14;case 14:if("ViewWFStep"!==a)return[3,16];if(!r.call.wfSubmit)throw new Error("该视图不存在ViewWFStep能力");return[4,r.call.wfSubmit()];case 15:u.sent(),u.label=16;case 16:return-1!==["SaveAndExit","Exit","RemoveAndExit"].indexOf(a)&&(c.closeView=!0),-1!==["Refresh"].indexOf(a)&&(c.refresh=!0),[2,c]}}))}))},t}(E)),D=e("BackendUIActionHandler",function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.execAction=function(e,t,n,r,i){var o,a,c;return f(this,void 0,void 0,(function(){var i,u,s,l,p,f,w,h;return d(this,(function(d){switch(d.label){case 0:if(i=null===(o=e.getPSAppDataEntity())||void 0===o?void 0:o.codeName,u=null===(a=e.getPSAppDEMethod())||void 0===a?void 0:a.codeName,!i||!u)throw new Error("找不到实体或实体行为");return[4,this.handleParams(e,t,n,r)];case 1:return s=d.sent(),l=s.resultContext,p=s.resultParams,f=s.resultData,[4,ibiz.entityService.getService(i)];case 2:return w=d.sent(),h=f.length>0?(null===(c=f[0])||void 0===c?void 0:c.getRequestData())||f[0]:{},[4,w.exec(u,l,h,p)];case 3:return d.sent(),[2,{}]}}))}))},t}(E)),N=e("FrontUIActionHandler",function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),t.prototype.execAction=function(e,t,n,r,i){return f(this,void 0,void 0,(function(){var o,a,c,u;return d(this,(function(s){switch(s.label){case 0:if(!(o=e.getFrontPSAppView()))throw new Error("未配置打开视图");return[4,o.fill(!0)];case 1:return s.sent(),[4,this.handleParams(e,t,n,r)];case 2:return a=s.sent(),c=a.resultContext,u=a.resultParams,[4,ibiz.commands.execute(T.TAG,o,c,u,i)];case 3:return s.sent(),[2,{}]}}))}))},t}(E));function R(e,t,n,i){return void 0===t&&(t=new r),void 0===n&&(n={}),void 0===i&&(i=[]),f(this,void 0,void 0,(function(){return d(this,(function(r){if(e.instanceof("app.view.IPSAppDERedirectView"))return[2,V(e,t,n,i)];throw new a(e,"未支持的重定向视图类型: ".concat(e.viewType))}))}))}function V(e,t,n,i){return void 0===t&&(t=new r),void 0===n&&(n={}),void 0===i&&(i=[]),f(this,void 0,void 0,(function(){var o,a,u,s,l,p,f,w,h,v,g,S,y,P,m,b,E;return d(this,(function(d){switch(d.label){case 0:return o=e.getPSAppViewNavContexts()||[],a=A(o,t,n),t=new r(a,t),u=e.getPSAppViewNavParams()||[],s=A(u,t,n),Object.assign(n,s),[4,(l=e.getPSAppDataEntity()).fill(!0)];case 1:return d.sent(),p=l.codeName.toLowerCase(),f=i[0]||{},t[p]=f[p]||t[p]||n[p],w=e.getGetDataPSAppDEAction(),[4,ibiz.entityService.getService(l.codeName)];case 2:return h=d.sent(),ibiz.loading.showRedirect(),[4,h.exec(w?w.codeName:"Get",t,n)];case 3:return v=d.sent(),ibiz.loading.hideRedirect(),v.ok&&(f=v.data,g=f.linkurl)?g.startsWith("http://")||g.startsWith("https://")?(window.open(g,"_blank"),[2,{ok:!0,data:[]}]):[2,{ok:!1,data:[]}]:[4,O(l,e,n.srfwf,f)];case 4:return S=d.sent(),y="".concat(l.name.toUpperCase(),":").concat(S),P=e.getRedirectPSAppViewRefs(),m=null==P?void 0:P.find((function(e){return e.name===y||e.name===S})),m?(b=m.getRefPSAppView())?[4,ibiz.commands.execute(T.TAG,b,t,n,{data:[f]})]:[3,6]:[3,7];case 5:return(E=d.sent())?[2,E]:[3,7];case 6:throw new c(m,"未配置实际引用视图");case 7:return[2,{ok:!0,data:[]}]}}))}))}function O(e,t,n,r){return f(this,void 0,void 0,(function(){var a,c,u,s,l;return d(this,(function(p){return"",(a=t.getTypePSAppDEField())&&(c=r[a.codeName.toLowerCase()],i(c))?[2,c]:i(n)?[2,"EDITVIEW:".concat(n.toUpperCase())]:(u="",(s=e.getIndexTypePSAppDEField())&&(u=r[s.codeName.toLowerCase()]),o(u)&&(l=e.getFormTypePSAppDEField())&&(u=r[l.codeName.toLowerCase()]),[2,i(u)?"EDITVIEW:".concat(u):"EDITVIEW"])}))}))}var T=e("OpenAppViewCommand",function(){function e(){ibiz.commands.register(e.TAG,this.exec.bind(this))}return e.prototype.exec=function(e,t,n,r){return void 0===n&&(n={}),void 0===r&&(r={}),f(this,void 0,void 0,(function(){var i;return d(this,(function(o){switch(o.label){case 0:return[4,e.fill(!0)];case 1:if(o.sent(),e.redirectView)return[2,R(e,t,n,r.data)];switch(i=e.openMode,void 0===i?"INDEXVIEWTAB":i){case"INDEXVIEWTAB":default:return[2,this.openIndexViewTab(e,t,n)];case"POPUP":throw new Error("未支持的视图打开模式: POPUP");case"POPUPMODAL":return[2,this.openModal(e,t,n)];case"POPUPAPP":throw new Error("未支持的视图打开模式: POPUPAPP");case"POPOVER":return[2,this.openPopover(e,t,n)];case"DRAWER_LEFT":case"DRAWER_RIGHT":case"DRAWER_TOP":case"DRAWER_BOTTOM":return[2,this.openDrawer(e,t,n)];case"USER":return[2,this.openUserCustom(e,t,n)]}return[2]}}))}))},e.prototype.openIndexViewTab=function(e,t,n){return void 0===n&&(n={}),ibiz.openView.root(e,t,n)},e.prototype.openModal=function(e,t,n){return void 0===n&&(n={}),f(this,void 0,void 0,(function(){return d(this,(function(r){return[2,ibiz.openView.modal(e,t,n)]}))}))},e.prototype.openPopover=function(e,t,n){return void 0===n&&(n={}),f(this,void 0,void 0,(function(){return d(this,(function(r){return[2,ibiz.openView.popover(e,t,n)]}))}))},e.prototype.openDrawer=function(e,t,n){return void 0===n&&(n={}),f(this,void 0,void 0,(function(){return d(this,(function(r){return[2,ibiz.openView.drawer(e,t,n)]}))}))},e.prototype.openUserCustom=function(e,t,n){return void 0===n&&(n={}),f(this,void 0,void 0,(function(){return d(this,(function(r){return[2,ibiz.openView.custom(e,t,n)]}))}))},e.TAG="ibiz.app-view.open",e}()),I=e("AppFuncCommand",function(){function e(){ibiz.commands.register(e.TAG,this.exec.bind(this))}return e.prototype.exec=function(e,t,n,i){return void 0===n&&(n={}),void 0===i&&(i={}),f(this,void 0,void 0,(function(){var o,a;return d(this,(function(c){switch((o=e.getPSNavigateContexts())&&(t?Object.assign(t,o):t=new r(o)),(a=e.getPSNavigateParams())&&Object.assign(n,a),e.appFuncType){case"APPVIEW":return[2,this.openAppView(e,t,n,i)];case"OPENHTMLPAGE":return[2,this.openHtmlPage(e)];case"PDTAPPFUNC":return[2,this.openPdAppFunc(e,t,n)];case"JAVASCRIPT":return[2,this.executeJavaScript(e,t,n)];case"CUSTOM":return[2,this.custom(e,t,n)];default:throw new Error("未知的应用功能类型: ".concat(e.appFuncType))}}))}))},e.prototype.openAppView=function(e,t,n,r){var i=e.getPSAppView();if(!i)throw new Error("应用视图不存在");return ibiz.commands.execute(T.TAG,i,t,n,r)},e.prototype.openHtmlPage=function(e){var t=e.htmlPageUrl;window.open(t,"_blank")},e.prototype.openPdAppFunc=function(e,t,n){throw ibiz.log.warn("openPdAppFunc",e,t,n),new Error("未实现")},e.prototype.executeJavaScript=function(e,t,n){throw ibiz.log.warn("executeJavaScript",e,t,n),new Error("未实现")},e.prototype.custom=function(e,t,n){throw ibiz.log.warn("custom",e,t,n),new Error("未实现")},e.TAG="ibiz.app-func.exec",e}());function U(){new I,new T}var C,z=e("BackendUIActionProvider",function(){function e(){}return e.prototype.getHandler=function(){return f(this,void 0,void 0,(function(){return d(this,(function(e){return this.handler||(this.handler=new D),[2,this.handler]}))}))},e}()),_=e("CommonSysUIActionProvider",function(){function e(){}return e.prototype.getHandler=function(){return f(this,void 0,void 0,(function(){return d(this,(function(e){return this.handler||(this.handler=new x),[2,this.handler]}))}))},e}()),F=e("FrontUIActionProvider",function(){function e(){}return e.prototype.getHandler=function(){return f(this,void 0,void 0,(function(){return d(this,(function(e){return this.handler||(this.handler=new N),[2,this.handler]}))}))},e}());function L(){var e=ibiz.register.uiAction;e&&(e.register("FRONT",new F),e.register("BACKEND",new z),e.register("SYS_New",new _),e.register("SYS_New",new _),e.register("SYS_Edit",new _),e.register("SYS_Save",new _),e.register("SYS_SaveAndExit",new _),e.register("SYS_SaveRow",new _),e.register("SYS_SaveAndNew",new _),e.register("SYS_Remove",new _),e.register("SYS_RemoveAndExit",new _),e.register("SYS_NewRow",new _),e.register("SYS_SaveAndStart",new _),e.register("SYS_ViewWFStep",new _),e.register("SYS_ToggleFilter",new _),e.register("SYS_Exit",new _),e.register("SYS_Refresh",new _))}e("ViewMode",C),function(e){e.ROUTE="ROUTE",e.MODAL="MODAL",e.DRAWER="DRAWER",e.EMBED="EMBED",e.POPOVER="POPOVER"}(C||e("ViewMode",C={}));e("RemotePluginItem",(function(e,t){this.tag=e,this.config=t}));function M(e,t,n,o,a){return void 0===a&&(a={}),f(this,void 0,void 0,(function(){var c,u,l,p,f,w,h,v;return d(this,(function(d){switch(d.label){case 0:if(!(null==n?void 0:n[0]))throw Error("没有选中数据!");if(!(c=e.getOpenDataPSAppView()))throw new Error("getOpenDataPSAppView为空");if(!(u=c.getRefPSAppView()))throw new Error("openView为空");return[4,u.fill(!0)];case 1:return d.sent(),[4,(l=new s(u.getPSAppDataEntity())).init()];case 2:return d.sent(),p=c.getPSNavigateContexts()||[],f=l.deName.toLowerCase(),-1===p.findIndex((function(e){return e.key===f}))&&p.push({key:f,value:f,rawValue:!1}),w=new r(A(p,t,o,n[0]),t),h={},v=c.getPSNavigateParams(),i(v)&&(h=A(v,o,t,n[0])),[4,ibiz.commands.execute(T.TAG,u,w,h,a)];case 3:return d.sent(),a.neuron.call.refresh(),[2,{}]}}))}))}function k(e,t,n,o,a){return void 0===a&&(a={}),f(this,void 0,void 0,(function(){var c,u,l,p,f,w,h,v;return d(this,(function(d){switch(d.label){case 0:if(!(c=e.getNewDataPSAppView()))throw new Error("getNewDataPSAppView为空");if(!(u=c.getRefPSAppView()))throw new Error("newView为空");return[4,u.fill(!0)];case 1:return d.sent(),[4,(l=new s(u.getPSAppDataEntity())).init()];case 2:return d.sent(),p={},f={},w=(null==n?void 0:n[0])||{},h=c.getPSNavigateContexts(),i(h)&&(p=A(h,t,o,w)),delete(p=new r(p,t))[l.deName.toLowerCase()],p[l.deName.toLowerCase()]=void 0,v=c.getPSNavigateParams(),i(v)&&(f=A(v,o,t,w)),e.enableWizardAdd||e.enableBatchAdd||e.batchAddOnly,[4,ibiz.commands.execute(T.TAG,u,p,f,a)];case 3:return d.sent(),a.neuron.call.refresh(),[2,{}]}}))}))}}}}));
package/out/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export { install } from './install';
3
3
  export * from './command';
4
4
  export * from './constant';
5
5
  export * from './interface';
6
+ export * from './plugin';
6
7
  export * from './provider';
7
8
  export * from './register';
8
9
  export * from './utils';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAC;AAEjB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAC;AAEjB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
package/out/index.js CHANGED
@@ -3,6 +3,7 @@ export { install } from './install';
3
3
  export * from './command';
4
4
  export * from './constant';
5
5
  export * from './interface';
6
+ export * from './plugin';
6
7
  export * from './provider';
7
8
  export * from './register';
8
9
  export * from './utils';
@@ -8,6 +8,15 @@ import { IPSAppPFPluginRef, IPSSysPFPlugin } from '@ibiz-template/model';
8
8
  * @interface IPluginFactory
9
9
  */
10
10
  export interface IPluginFactory {
11
+ /**
12
+ * 设置开发插件,用于本地调试
13
+ *
14
+ * @author chitanda
15
+ * @date 2022-11-02 21:11:01
16
+ * @param {string} name
17
+ * @param {() => Promise<unknown>} fn
18
+ */
19
+ setDevPlugin(name: string, fn: () => Promise<unknown>): void;
11
20
  /**
12
21
  * 加载插件
13
22
  *
@@ -1 +1 @@
1
- {"version":3,"file":"i-plugin-factory.d.ts","sourceRoot":"","sources":["../../../src/interface/i-plugin-factory/i-plugin-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEzE;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;;OAOG;IACH,UAAU,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACrD;;;;;;;OAOG;IACH,aAAa,CAAC,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC/D"}
1
+ {"version":3,"file":"i-plugin-factory.d.ts","sourceRoot":"","sources":["../../../src/interface/i-plugin-factory/i-plugin-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEzE;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;;OAOG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAC7D;;;;;;;OAOG;IACH,UAAU,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACrD;;;;;;;OAOG;IACH,aAAa,CAAC,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC/D"}
@@ -0,0 +1,2 @@
1
+ export { RemotePluginConfig, RemotePluginItem, } from './remote-plugin-item/remote-plugin-item';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,yCAAyC,CAAC"}
@@ -0,0 +1 @@
1
+ export { RemotePluginItem, } from './remote-plugin-item/remote-plugin-item';
@@ -0,0 +1,102 @@
1
+ /**
2
+ * 远程插件配置
3
+ *
4
+ * @author chitanda
5
+ * @date 2022-10-31 16:10:34
6
+ * @export
7
+ * @interface RemotePluginConfig
8
+ */
9
+ export interface RemotePluginConfig {
10
+ /**
11
+ * 所有配置文件基础路径
12
+ *
13
+ * @author chitanda
14
+ * @date 2022-11-02 14:11:06
15
+ * @type {string}
16
+ */
17
+ baseUrl: string;
18
+ /**
19
+ * 包名称
20
+ *
21
+ * @author chitanda
22
+ * @date 2022-10-31 16:10:42
23
+ * @type {string}
24
+ */
25
+ name: string;
26
+ /**
27
+ * 版本
28
+ *
29
+ * @author chitanda
30
+ * @date 2022-11-02 15:11:03
31
+ * @type {string}
32
+ */
33
+ version: string;
34
+ /**
35
+ * system js 入口脚本
36
+ *
37
+ * @author chitanda
38
+ * @date 2022-11-02 15:11:28
39
+ * @type {string}
40
+ */
41
+ system: string;
42
+ /**
43
+ * 模块文件 入口脚本
44
+ *
45
+ * @author chitanda
46
+ * @date 2022-11-02 16:11:50
47
+ * @type {string}
48
+ */
49
+ module: string;
50
+ /**
51
+ * 样式地址
52
+ *
53
+ * @author chitanda
54
+ * @date 2022-10-31 16:10:46
55
+ * @type {(string | string[])}
56
+ */
57
+ styles: string | string[];
58
+ /**
59
+ * 是否为应用级
60
+ *
61
+ * @author chitanda
62
+ * @date 2022-10-31 16:10:51
63
+ * @type {boolean}
64
+ */
65
+ app?: boolean;
66
+ }
67
+ /**
68
+ * 远程插件项
69
+ *
70
+ * @author chitanda
71
+ * @date 2022-10-31 12:10:41
72
+ * @export
73
+ * @class RemotePluginItem
74
+ */
75
+ export declare class RemotePluginItem {
76
+ /**
77
+ * 唯一标识
78
+ *
79
+ * @author chitanda
80
+ * @date 2022-10-31 12:10:48
81
+ * @type {string}
82
+ */
83
+ readonly tag: string;
84
+ /**
85
+ * 配置参数
86
+ *
87
+ * @author chitanda
88
+ * @date 2022-11-02 15:11:38
89
+ * @type {RemotePluginConfig}
90
+ */
91
+ readonly config: RemotePluginConfig;
92
+ /**
93
+ * Creates an instance of RemotePluginItem.
94
+ *
95
+ * @author chitanda
96
+ * @date 2022-10-31 12:10:28
97
+ * @param {string} tag 插件唯一标识
98
+ * @param {RemotePluginConfig} config
99
+ */
100
+ constructor(tag: string, config: RemotePluginConfig);
101
+ }
102
+ //# sourceMappingURL=remote-plugin-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-plugin-item.d.ts","sourceRoot":"","sources":["../../../src/plugin/remote-plugin-item/remote-plugin-item.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED;;;;;;;GAOG;AACH,qBAAa,gBAAgB;IAC3B;;;;;;OAMG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IAEpC;;;;;;;OAOG;gBACS,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB;CAIpD"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * 远程插件项
3
+ *
4
+ * @author chitanda
5
+ * @date 2022-10-31 12:10:41
6
+ * @export
7
+ * @class RemotePluginItem
8
+ */
9
+ export class RemotePluginItem {
10
+ /**
11
+ * Creates an instance of RemotePluginItem.
12
+ *
13
+ * @author chitanda
14
+ * @date 2022-10-31 12:10:28
15
+ * @param {string} tag 插件唯一标识
16
+ * @param {RemotePluginConfig} config
17
+ */
18
+ constructor(tag, config) {
19
+ this.tag = tag;
20
+ this.config = config;
21
+ }
22
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/runtime",
3
- "version": "0.0.1-alpha.39",
3
+ "version": "0.0.1-alpha.40",
4
4
  "description": "控制器包",
5
5
  "type": "module",
6
6
  "main": "out/index.js",
@@ -31,9 +31,9 @@
31
31
  "@ibiz-template/command": "^0.0.1-alpha.37"
32
32
  },
33
33
  "devDependencies": {
34
- "@ibiz-template/core": "^0.0.1-alpha.39",
34
+ "@ibiz-template/core": "^0.0.1-alpha.40",
35
35
  "@ibiz-template/model": "^0.0.1-alpha.39",
36
- "@ibiz-template/service": "^0.0.1-alpha.39",
36
+ "@ibiz-template/service": "^0.0.1-alpha.40",
37
37
  "@types/systemjs": "^6.1.1",
38
38
  "qx-util": "^0.4.4"
39
39
  },
@@ -43,5 +43,5 @@
43
43
  "@ibiz-template/service": "^0.0.1-alpha.2",
44
44
  "qx-util": "^0.4.4"
45
45
  },
46
- "gitHead": "0c3339c9aa6fd4e59d180bb7b804dbbc8240e3ae"
46
+ "gitHead": "be7fae93941fcce8a2c0fa9f4158e9525bcdb55d"
47
47
  }
package/src/index.ts CHANGED
@@ -4,6 +4,7 @@ export { install } from './install';
4
4
  export * from './command';
5
5
  export * from './constant';
6
6
  export * from './interface';
7
+ export * from './plugin';
7
8
  export * from './provider';
8
9
  export * from './register';
9
10
  export * from './utils';
@@ -9,6 +9,15 @@ import { IPSAppPFPluginRef, IPSSysPFPlugin } from '@ibiz-template/model';
9
9
  * @interface IPluginFactory
10
10
  */
11
11
  export interface IPluginFactory {
12
+ /**
13
+ * 设置开发插件,用于本地调试
14
+ *
15
+ * @author chitanda
16
+ * @date 2022-11-02 21:11:01
17
+ * @param {string} name
18
+ * @param {() => Promise<unknown>} fn
19
+ */
20
+ setDevPlugin(name: string, fn: () => Promise<unknown>): void;
12
21
  /**
13
22
  * 加载插件
14
23
  *
@@ -0,0 +1,4 @@
1
+ export {
2
+ RemotePluginConfig,
3
+ RemotePluginItem,
4
+ } from './remote-plugin-item/remote-plugin-item';
@@ -0,0 +1,107 @@
1
+ /**
2
+ * 远程插件配置
3
+ *
4
+ * @author chitanda
5
+ * @date 2022-10-31 16:10:34
6
+ * @export
7
+ * @interface RemotePluginConfig
8
+ */
9
+ export interface RemotePluginConfig {
10
+ /**
11
+ * 所有配置文件基础路径
12
+ *
13
+ * @author chitanda
14
+ * @date 2022-11-02 14:11:06
15
+ * @type {string}
16
+ */
17
+ baseUrl: string;
18
+ /**
19
+ * 包名称
20
+ *
21
+ * @author chitanda
22
+ * @date 2022-10-31 16:10:42
23
+ * @type {string}
24
+ */
25
+ name: string;
26
+ /**
27
+ * 版本
28
+ *
29
+ * @author chitanda
30
+ * @date 2022-11-02 15:11:03
31
+ * @type {string}
32
+ */
33
+ version: string;
34
+ /**
35
+ * system js 入口脚本
36
+ *
37
+ * @author chitanda
38
+ * @date 2022-11-02 15:11:28
39
+ * @type {string}
40
+ */
41
+ system: string;
42
+ /**
43
+ * 模块文件 入口脚本
44
+ *
45
+ * @author chitanda
46
+ * @date 2022-11-02 16:11:50
47
+ * @type {string}
48
+ */
49
+ module: string;
50
+ /**
51
+ * 样式地址
52
+ *
53
+ * @author chitanda
54
+ * @date 2022-10-31 16:10:46
55
+ * @type {(string | string[])}
56
+ */
57
+ styles: string | string[];
58
+ /**
59
+ * 是否为应用级
60
+ *
61
+ * @author chitanda
62
+ * @date 2022-10-31 16:10:51
63
+ * @type {boolean}
64
+ */
65
+ app?: boolean;
66
+ }
67
+
68
+ /**
69
+ * 远程插件项
70
+ *
71
+ * @author chitanda
72
+ * @date 2022-10-31 12:10:41
73
+ * @export
74
+ * @class RemotePluginItem
75
+ */
76
+ export class RemotePluginItem {
77
+ /**
78
+ * 唯一标识
79
+ *
80
+ * @author chitanda
81
+ * @date 2022-10-31 12:10:48
82
+ * @type {string}
83
+ */
84
+ readonly tag: string;
85
+
86
+ /**
87
+ * 配置参数
88
+ *
89
+ * @author chitanda
90
+ * @date 2022-11-02 15:11:38
91
+ * @type {RemotePluginConfig}
92
+ */
93
+ readonly config: RemotePluginConfig;
94
+
95
+ /**
96
+ * Creates an instance of RemotePluginItem.
97
+ *
98
+ * @author chitanda
99
+ * @date 2022-10-31 12:10:28
100
+ * @param {string} tag 插件唯一标识
101
+ * @param {RemotePluginConfig} config
102
+ */
103
+ constructor(tag: string, config: RemotePluginConfig) {
104
+ this.tag = tag;
105
+ this.config = config;
106
+ }
107
+ }