@ibiz-template/runtime 0.0.1-alpha.30 → 0.0.1-alpha.32

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","@ibiz-template/model","qx-util"],(function(e){"use strict";var t,n,r,o,i,a,c,u;return{setters:[null,function(e){t=e.commands},function(e){n=e.IBizContext},function(e){r=e.UnsupportedModelError,o=e.DefectModelError,i=e.getPSUIActionByModelObject,a=e.AppEntityModel},function(e){c=e.notNilEmpty,u=e.isNilOrEmpty}],execute:function(){e({convertNavData:v,convertNavDataByArray:h,convertNavDataByObject:g,executeNewDataAppUILogic:O,executeOpenDataAppUILogic:D,executeViewLogic:function(e,t,n,r,o){void 0===o&&(o={});return l(this,void 0,void 0,(function(){var a;return p(this,(function(c){switch(c.label){case 0:return"opendata"===e.name&&e.getPSAppUILogic()?[2,D(e.getPSAppUILogic(),t,n,r,o)]:"newdata"===e.name&&e.getPSAppUILogic()?[2,O(e.getPSAppUILogic(),t,n,r,o)]:[4,i(e.getPSAppViewUIAction())];case 1:if(!(a=c.sent()))throw new Error("找不到界面行为");return[2,A.exec(a,t,n,r,o)]}}))}))},install:function(){var e=window.ibiz;e.commands=t,e.plugin=new E,e.register=new s,V()},installCommand:V,openRedirectView:b});var s=e("RegisterCenter",(function(){}));function l(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(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 p(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}function f(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 d(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function w(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function v(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return"[object Array]"===Object.prototype.toString.call(e)?h.apply(void 0,w([e],d(t),!1)):"[object Object]"===Object.prototype.toString.call(e)?g.apply(void 0,w([e],d(t),!1)):{}}function h(e){for(var t,n,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];var i={},a=function(e){if(c(e.value)&&!e.rawValue){var t=r.find((function(t){return!u(t)&&(t[e.value]||Object.prototype.hasOwnProperty.call(t,e.value))}));t&&(i[e.key]=t[e.value])}else i[e.key]=e.value};try{for(var s=f(e),l=s.next();!l.done;l=s.next()){var p=l.value;a(p)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return i}function g(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r={},o=/^%(.+)%$/,i=function(n){if(c(e[n])&&o.test(e[n])){var i=e[n].substring(1,e[n].length-1),a=t.find((function(e){return Object.prototype.hasOwnProperty.call(e,i)}));a&&(r[n]=a[i])}else r[n]=e[n]};for(var a in e)i(a);return r}var A=e("AppDEUIActionUtil",function(){function e(){}return e.exec=function(e,t,n,r,o){return l(this,void 0,void 0,(function(){var i,a,c,u,s,l,f;return p(this,(function(p){switch(p.label){case 0:return e.enableConfirm&&e.confirmMsg,i=o.neuron,a={refresh:e.reloadData,closeView:e.closeEditView},"SYS"!==e.uIActionMode?[3,2]:[4,this.executeSysUIAction(e,n,o)];case 1:return f=p.sent(),Object.assign(a,f),[3,6];case 2:return[4,this.handleParams(e,t,n,r)];case 3:return c=p.sent(),u=c.resultContext,s=c.resultData,l=c.resultParams,"FRONT"!==e.uIActionMode?[3,5]:[4,this.executeFrontUIAction(e,u,s,l,o)];case 4:return f=p.sent(),Object.assign(a,f),[3,6];case 5:"BACKEND"===e.uIActionMode&&(f=this.executeBackEndUIAction(e,u,s,l),Object.assign(a,f)),p.label=6;case 6:if(e.getNextPSUIAction(),!a.refresh)return[3,8];if(!i.call.refresh)throw new Error("该视图不存在刷新能力");return[4,i.call.refresh()];case 7:p.sent(),p.label=8;case 8:if(!a.closeView)return[3,10];if(!i.call.closeView)throw new Error("该视图不存在关闭视图能力");return[4,i.call.closeView()];case 9:p.sent(),p.label=10;case 10:return[2,a]}}))}))},e.handleParams=function(e,t,r,o){return l(this,void 0,void 0,(function(){var i,a,u,s,l,f,d,w,h;return p(this,(function(p){switch(p.label){case 0:if(i=r||[],-1!==["SINGLEDATA","MULTIDATA","MULTIKEY"].indexOf(e.actionTarget))throw new Error("数据类型".concat(e.actionTarget,"暂未支持,请配置无数据或单项数据主键"));return"NONE"===e.actionTarget&&(i=[]),a={},u=e.getPSNavigateContexts()||[],(s=e.getPSAppDataEntity())&&"SINGLEKEY"===e.actionTarget?[4,null==s?void 0:s.fill(!0)]:[3,2];case 1:p.sent(),l=s.codeName.toLowerCase(),f=e.valueItem,u.unshift({key:l,value:f||"srfkey",rawValue:!1}),p.label=2;case 2:return c(u)&&(a=v(u,t,o,(null==r?void 0:r[0])||{})),d=new n(a,t),w={},h=e.getPSNavigateParams(),c(h)&&(w=v(h,t,o,(null==r?void 0:r[0])||{})),[2,{resultContext:d,resultData:i,resultParams:w}]}}))}))},e.executeSysUIAction=function(e,t,n){return l(this,void 0,void 0,(function(){var o,i,a,c,u;return p(this,(function(s){switch(s.label){case 0:if(i=(o=n).neuron,a=o.event,c=e.uIActionTag,u={},-1!==["HELP","PRINT","ViewWFStep","RefreshParent","RefreshAll","Import"].indexOf(c))throw new r(e,"".concat(c,"暂未支持"));if("New"!==c)return[3,2];if(!i.call.newData)throw new Error("该视图不存在newData能力");return[4,i.call.newData(a)];case 1:s.sent(),s.label=2;case 2:if("Edit"!==c)return[3,4];if(!i.call.openData)throw new Error("该视图不存在openData能力");return[4,i.call.openData(null==t?void 0:t[0],a)];case 3:s.sent(),s.label=4;case 4:if(-1===["SaveAndExit","Save","SaveRow"].indexOf(c))return[3,6];if(!i.call.save)throw new Error("该视图不存在save能力");return[4,i.call.save()];case 5:s.sent(),s.label=6;case 6:if("SaveAndNew"!==c)return[3,8];if(!i.call.saveAndNew)throw new Error("该视图不存在saveAndNew能力");return[4,i.call.saveAndNew()];case 7:s.sent(),s.label=8;case 8:if("Remove"!==c&&"RemoveAndExit"!==c)return[3,10];if(!i.call.remove)throw new Error("该视图不存在remove能力");return[4,i.call.remove()];case 9:s.sent(),s.label=10;case 10:if("NewRow"!==c)return[3,12];if(!i.call.newRow)throw new Error("该视图不存在newRow能力");return[4,i.call.newRow()];case 11:s.sent(),s.label=12;case 12:if("ToggleFilter"===c){if(!i.call.toggleFilter)throw new Error("该视图不存在ToggleFilter能力");i.call.toggleFilter()}if("SaveAndStart"!==c)return[3,14];if(!i.call.wfStart)throw new Error("该视图不存在SaveAndStart能力");return[4,i.call.wfStart()];case 13:s.sent(),s.label=14;case 14:if("ViewWFStep"!==c)return[3,16];if(!i.call.wfSubmit)throw new Error("该视图不存在ViewWFStep能力");return[4,i.call.wfSubmit()];case 15:s.sent(),s.label=16;case 16:return-1!==["SaveAndExit","Exit","RemoveAndExit"].indexOf(c)&&(u.closeView=!0),-1!==["Refresh"].indexOf(c)&&(u.refresh=!0),[2,u]}}))}))},e.executeFrontUIAction=function(e,t,n,r,o){return l(this,void 0,void 0,(function(){var n;return p(this,(function(i){switch(i.label){case 0:if(!(n=e.getFrontPSAppView()))throw new Error("未配置打开视图");return[4,n.fill(!0)];case 1:return i.sent(),[4,ibiz.commands.execute(S.TAG,n,t,r,o)];case 2:return i.sent(),[2,{}]}}))}))},e.executeBackEndUIAction=function(e,t,n,r){var o,i;return l(this,void 0,void 0,(function(){var n,a;return p(this,(function(c){switch(c.label){case 0:if(n=null===(o=e.getPSAppDataEntity())||void 0===o?void 0:o.codeName,a=null===(i=e.getPSAppDEMethod())||void 0===i?void 0:i.codeName,!n||!a)throw new Error("找不到实体或实体行为");return[4,ibiz.entityService.getService(n)];case 1:return[4,c.sent().exec(a,t,r)];case 2:return c.sent(),[2,{}]}}))}))},e}());function b(e,t,o,i){return void 0===t&&(t=new n),void 0===o&&(o={}),void 0===i&&(i=[]),l(this,void 0,void 0,(function(){return p(this,(function(n){if(e.instanceof("app.view.IPSAppDERedirectView"))return[2,m(e,t,o,i)];throw new r(e,"未支持的重定向视图类型: ".concat(e.viewType))}))}))}function m(e,t,r,i){return void 0===t&&(t=new n),void 0===r&&(r={}),void 0===i&&(i=[]),l(this,void 0,void 0,(function(){var a,c,u,s,l,f,d,w,h,g,A,b,m,P,E,x,V,D;return p(this,(function(p){switch(p.label){case 0:return a=e.getPSAppViewNavContexts()||[],c=v(a,t,r),t=new n(c,t),u=e.getPSAppViewNavParams()||[],s=v(u,t,r),Object.assign(r,s),[4,(l=e.getPSAppDataEntity()).fill(!0)];case 1:return p.sent(),f=l.codeName.toLowerCase(),d=i[0]||{},t[f]=d[f]||t[f]||r[f],w=e.getGetDataPSAppDEAction(),[4,ibiz.entityService.getService(l.codeName)];case 2:return h=p.sent(),ibiz.loading.showRedirect(),[4,h.exec(w?w.codeName:"Get",t,r)];case 3:return g=p.sent(),ibiz.loading.hideRedirect(),g.ok&&(d=g.data,A=d.linkurl)?A.startsWith("http://")||A.startsWith("https://")?(window.open(A,"_blank"),[2,{ok:!0,data:[]}]):[2,{ok:!1,data:[]}]:(b=!!r.srfwf,[4,y(l,e,b,d)]);case 4:return m=p.sent(),P=m,b&&(P="".concat(m.split(":")[0],":").concat(r.srfwf.toUpperCase())),E=e.getRedirectPSAppViewRefs(),x=null==E?void 0:E.find((function(e){return e.name===P})),x||(P="".concat(m.split(":")[0]),x=null==E?void 0:E.find((function(e){return e.name===P}))),x?(V=x.getRefPSAppView())?[4,ibiz.commands.execute(S.TAG,V,t,r,{data:[d]})]:[3,6]:[3,7];case 5:return(D=p.sent())?[2,D]:[3,7];case 6:throw new o(x,"未配置实际引用视图");case 7:return[2,{ok:!0,data:[]}]}}))}))}function y(e,t,n,r){return l(this,void 0,void 0,(function(){var o,i,a,c,u;return p(this,(function(s){return o=e.getFormTypePSAppDEField(),i=e.getIndexTypePSAppDEField(),"",(a=t.getTypePSAppDEField())&&(c=r[a.codeName.toLowerCase()])?[2,c]:(u="",o?u=r[o.codeName.toLowerCase()]:i&&(u=r[i.codeName.toLowerCase()]),[2,u?n?"WFEDITVIEW:".concat(u):"EDITVIEW:".concat(u):n?"WFEDITVIEW:":"EDITVIEW:"])}))}))}var P,E=e("PluginFactory",function(){function e(){}return e.prototype.loadPlugin=function(e){return l(this,void 0,void 0,(function(){var t,n;return p(this,(function(r){switch(r.label){case 0:return e.runtimeObject?"VIEW_CUSTOM:remoteView"!==(t="".concat(e.pluginType,":").concat(e.pluginCode))?[3,3]:System.has(t)?[3,2]:[4,System.import(e.pluginCode)]:[3,3];case 1:(n=r.sent())&&System.set(t,n),r.label=2;case 2:return[2,System.get(t)];case 3:return[2]}}))}))},e}()),S=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={}),l(this,void 0,void 0,(function(){var o;return p(this,(function(i){switch(i.label){case 0:return[4,e.fill(!0)];case 1:if(i.sent(),e.redirectView)return[2,b(e,t,n,r.data)];switch(o=e.openMode,void 0===o?"INDEXVIEWTAB":o){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={}),l(this,void 0,void 0,(function(){return p(this,(function(r){return[2,ibiz.openView.modal(e,t,n)]}))}))},e.prototype.openPopover=function(e,t,n){return void 0===n&&(n={}),l(this,void 0,void 0,(function(){return p(this,(function(r){return[2,ibiz.openView.popover(e,t,n)]}))}))},e.prototype.openDrawer=function(e,t,n){return void 0===n&&(n={}),l(this,void 0,void 0,(function(){return p(this,(function(r){return[2,ibiz.openView.drawer(e,t,n)]}))}))},e.prototype.openUserCustom=function(e,t,n){return void 0===n&&(n={}),l(this,void 0,void 0,(function(){return p(this,(function(r){return[2,ibiz.openView.custom(e,t,n)]}))}))},e.TAG="ibiz.app-view.open",e}()),x=e("AppFuncCommand",function(){function e(){ibiz.commands.register(e.TAG,this.exec.bind(this))}return e.prototype.exec=function(e,t,r,o){return void 0===r&&(r={}),void 0===o&&(o={}),l(this,void 0,void 0,(function(){var i,a;return p(this,(function(c){switch((i=e.getPSNavigateContexts())&&(t?Object.assign(t,i):t=new n(i)),(a=e.getPSNavigateParams())&&Object.assign(r,a),e.appFuncType){case"APPVIEW":return[2,this.openAppView(e,t,r,o)];case"OPENHTMLPAGE":return[2,this.openHtmlPage(e)];case"PDTAPPFUNC":return[2,this.openPdAppFunc(e,t,r)];case"JAVASCRIPT":return[2,this.executeJavaScript(e,t,r)];case"CUSTOM":return[2,this.custom(e,t,r)];default:throw new Error("未知的应用功能类型: ".concat(e.appFuncType))}}))}))},e.prototype.openAppView=function(e,t,n,r){var o=e.getPSAppView();if(!o)throw new Error("应用视图不存在");return ibiz.commands.execute(S.TAG,o,t,n,r)},e.prototype.openHtmlPage=function(e){var t=e.htmlPageUrl;window.open(t,"_blank")},e.prototype.openPdAppFunc=function(e,t,n){throw console.log("openPdAppFunc",e,t,n),new Error("未实现")},e.prototype.executeJavaScript=function(e,t,n){throw console.log("executeJavaScript",e,t,n),new Error("未实现")},e.prototype.custom=function(e,t,n){throw console.log("custom",e,t,n),new Error("未实现")},e.TAG="ibiz.app-func.exec",e}());function V(){new x,new S}e("ViewMode",P),function(e){e.ROUTE="ROUTE",e.MODAL="MODAL",e.DRAWER="DRAWER",e.EMBED="EMBED",e.POPOVER="POPOVER"}(P||e("ViewMode",P={}));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}());function D(e,t,r,o,i){return void 0===i&&(i={}),l(this,void 0,void 0,(function(){var u,s,l,f,d,w,h,g;return p(this,(function(p){switch(p.label){case 0:if(!(null==r?void 0:r[0]))throw Error("没有选中数据!");if(!(u=e.getOpenDataPSAppView()))throw new Error("getOpenDataPSAppView为空");if(!(s=u.getRefPSAppView()))throw new Error("openView为空");return[4,s.fill(!0)];case 1:return p.sent(),[4,(l=new a(s.getPSAppDataEntity())).init()];case 2:return p.sent(),f=u.getPSNavigateContexts()||[],d=l.deName.toLowerCase(),-1===f.findIndex((function(e){return e.key===d}))&&f.push({key:d,value:d,rawValue:!1}),w=new n(v(f,t,o,r[0]),t),h={},g=u.getPSNavigateParams(),c(g)&&(h=v(g,o,t,r[0])),[4,ibiz.commands.execute(S.TAG,s,w,h,i)];case 3:return p.sent(),i.neuron.call.refresh(),[2,{}]}}))}))}function O(e,t,r,o,i){return void 0===i&&(i={}),l(this,void 0,void 0,(function(){var u,s,l,f,d,w,h,g;return p(this,(function(p){switch(p.label){case 0:if(!(u=e.getNewDataPSAppView()))throw new Error("getNewDataPSAppView为空");if(!(s=u.getRefPSAppView()))throw new Error("newView为空");return[4,s.fill(!0)];case 1:return p.sent(),[4,(l=new a(s.getPSAppDataEntity())).init()];case 2:return p.sent(),f={},d={},w=(null==r?void 0:r[0])||{},h=u.getPSNavigateContexts(),c(h)&&(f=v(h,t,o,w)),delete(f=new n(f,t))[l.deName.toLowerCase()],f[l.deName.toLowerCase()]=void 0,g=u.getPSNavigateParams(),c(g)&&(d=v(g,o,t,w)),e.enableWizardAdd||e.enableBatchAdd||e.batchAddOnly,[4,ibiz.commands.execute(S.TAG,s,f,d,i)];case 3:return p.sent(),i.neuron.call.refresh(),[2,{}]}}))}))}}}}));
1
+ System.register(["@ibiz-template/service","@ibiz-template/command","@ibiz-template/core","@ibiz-template/model","qx-util"],(function(e){"use strict";var t,n,r,o,i,a,c,u;return{setters:[null,function(e){t=e.commands},function(e){n=e.IBizContext},function(e){r=e.UnsupportedModelError,o=e.DefectModelError,i=e.getPSUIActionByModelObject,a=e.AppEntityModel},function(e){c=e.notNilEmpty,u=e.isNilOrEmpty}],execute:function(){e({convertNavData:v,convertNavDataByArray:h,convertNavDataByObject:g,executeNewDataAppUILogic:V,executeOpenDataAppUILogic:D,executeViewLogic:function(e,t,n,r,o){void 0===o&&(o={});return l(this,void 0,void 0,(function(){var a;return p(this,(function(c){switch(c.label){case 0:return"opendata"===e.name&&e.getPSAppUILogic()?[2,D(e.getPSAppUILogic(),t,n,r,o)]:"newdata"===e.name&&e.getPSAppUILogic()?[2,V(e.getPSAppUILogic(),t,n,r,o)]:[4,i(e.getPSAppViewUIAction())];case 1:if(!(a=c.sent()))throw new Error("找不到界面行为");return[2,A.exec(a,t,n,r,o)]}}))}))},install:function(){var e=window.ibiz;e.commands=t,e.register=new s,x()},installCommand:x,openRedirectView:b});var s=e("RegisterCenter",(function(){}));function l(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(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 p(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}function f(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 d(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function w(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function v(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return"[object Array]"===Object.prototype.toString.call(e)?h.apply(void 0,w([e],d(t),!1)):"[object Object]"===Object.prototype.toString.call(e)?g.apply(void 0,w([e],d(t),!1)):{}}function h(e){for(var t,n,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];var i={},a=function(e){if(c(e.value)&&!e.rawValue){var t=r.find((function(t){return!u(t)&&(t[e.value]||Object.prototype.hasOwnProperty.call(t,e.value))}));t&&(i[e.key]=t[e.value])}else i[e.key]=e.value};try{for(var s=f(e),l=s.next();!l.done;l=s.next()){var p=l.value;a(p)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return i}function g(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r={},o=/^%(.+)%$/,i=function(n){if(c(e[n])&&o.test(e[n])){var i=e[n].substring(1,e[n].length-1),a=t.find((function(e){return Object.prototype.hasOwnProperty.call(e,i)}));a&&(r[n]=a[i])}else r[n]=e[n]};for(var a in e)i(a);return r}var A=e("AppDEUIActionUtil",function(){function e(){}return e.exec=function(e,t,n,r,o){return l(this,void 0,void 0,(function(){var i,a,c,u,s,l,f;return p(this,(function(p){switch(p.label){case 0:return e.enableConfirm&&e.confirmMsg,i=o.neuron,a={refresh:e.reloadData,closeView:e.closeEditView},"SYS"!==e.uIActionMode?[3,2]:[4,this.executeSysUIAction(e,n,o)];case 1:return f=p.sent(),Object.assign(a,f),[3,6];case 2:return[4,this.handleParams(e,t,n,r)];case 3:return c=p.sent(),u=c.resultContext,s=c.resultData,l=c.resultParams,"FRONT"!==e.uIActionMode?[3,5]:[4,this.executeFrontUIAction(e,u,s,l,o)];case 4:return f=p.sent(),Object.assign(a,f),[3,6];case 5:"BACKEND"===e.uIActionMode&&(f=this.executeBackEndUIAction(e,u,s,l),Object.assign(a,f)),p.label=6;case 6:if(e.getNextPSUIAction(),!a.refresh)return[3,8];if(!i.call.refresh)throw new Error("该视图不存在刷新能力");return[4,i.call.refresh()];case 7:p.sent(),p.label=8;case 8:if(!a.closeView)return[3,10];if(!i.call.closeView)throw new Error("该视图不存在关闭视图能力");return[4,i.call.closeView()];case 9:p.sent(),p.label=10;case 10:return[2,a]}}))}))},e.handleParams=function(e,t,r,o){return l(this,void 0,void 0,(function(){var i,a,u,s,l,f,d,w,h;return p(this,(function(p){switch(p.label){case 0:if(i=r||[],-1!==["SINGLEDATA","MULTIDATA","MULTIKEY"].indexOf(e.actionTarget))throw new Error("数据类型".concat(e.actionTarget,"暂未支持,请配置无数据或单项数据主键"));return"NONE"===e.actionTarget&&(i=[]),a={},u=e.getPSNavigateContexts()||[],(s=e.getPSAppDataEntity())&&"SINGLEKEY"===e.actionTarget?[4,null==s?void 0:s.fill(!0)]:[3,2];case 1:p.sent(),l=s.codeName.toLowerCase(),f=e.valueItem,u.unshift({key:l,value:f||"srfkey",rawValue:!1}),p.label=2;case 2:return c(u)&&(a=v(u,t,o,(null==r?void 0:r[0])||{})),d=new n(a,t),w={},h=e.getPSNavigateParams(),c(h)&&(w=v(h,t,o,(null==r?void 0:r[0])||{})),[2,{resultContext:d,resultData:i,resultParams:w}]}}))}))},e.executeSysUIAction=function(e,t,n){return l(this,void 0,void 0,(function(){var o,i,a,c,u;return p(this,(function(s){switch(s.label){case 0:if(i=(o=n).neuron,a=o.event,c=e.uIActionTag,u={},-1!==["HELP","PRINT","ViewWFStep","RefreshParent","RefreshAll","Import"].indexOf(c))throw new r(e,"".concat(c,"暂未支持"));if("New"!==c)return[3,2];if(!i.call.newData)throw new Error("该视图不存在newData能力");return[4,i.call.newData(a)];case 1:s.sent(),s.label=2;case 2:if("Edit"!==c)return[3,4];if(!i.call.openData)throw new Error("该视图不存在openData能力");return[4,i.call.openData(null==t?void 0:t[0],a)];case 3:s.sent(),s.label=4;case 4:if(-1===["SaveAndExit","Save","SaveRow"].indexOf(c))return[3,6];if(!i.call.save)throw new Error("该视图不存在save能力");return[4,i.call.save()];case 5:s.sent(),s.label=6;case 6:if("SaveAndNew"!==c)return[3,8];if(!i.call.saveAndNew)throw new Error("该视图不存在saveAndNew能力");return[4,i.call.saveAndNew()];case 7:s.sent(),s.label=8;case 8:if("Remove"!==c&&"RemoveAndExit"!==c)return[3,10];if(!i.call.remove)throw new Error("该视图不存在remove能力");return[4,i.call.remove()];case 9:s.sent(),s.label=10;case 10:if("NewRow"!==c)return[3,12];if(!i.call.newRow)throw new Error("该视图不存在newRow能力");return[4,i.call.newRow()];case 11:s.sent(),s.label=12;case 12:if("ToggleFilter"===c){if(!i.call.toggleFilter)throw new Error("该视图不存在ToggleFilter能力");i.call.toggleFilter()}if("SaveAndStart"!==c)return[3,14];if(!i.call.wfStart)throw new Error("该视图不存在SaveAndStart能力");return[4,i.call.wfStart()];case 13:s.sent(),s.label=14;case 14:if("ViewWFStep"!==c)return[3,16];if(!i.call.wfSubmit)throw new Error("该视图不存在ViewWFStep能力");return[4,i.call.wfSubmit()];case 15:s.sent(),s.label=16;case 16:return-1!==["SaveAndExit","Exit","RemoveAndExit"].indexOf(c)&&(u.closeView=!0),-1!==["Refresh"].indexOf(c)&&(u.refresh=!0),[2,u]}}))}))},e.executeFrontUIAction=function(e,t,n,r,o){return l(this,void 0,void 0,(function(){var n;return p(this,(function(i){switch(i.label){case 0:if(!(n=e.getFrontPSAppView()))throw new Error("未配置打开视图");return[4,n.fill(!0)];case 1:return i.sent(),[4,ibiz.commands.execute(y.TAG,n,t,r,o)];case 2:return i.sent(),[2,{}]}}))}))},e.executeBackEndUIAction=function(e,t,n,r){var o,i;return l(this,void 0,void 0,(function(){var n,a;return p(this,(function(c){switch(c.label){case 0:if(n=null===(o=e.getPSAppDataEntity())||void 0===o?void 0:o.codeName,a=null===(i=e.getPSAppDEMethod())||void 0===i?void 0:i.codeName,!n||!a)throw new Error("找不到实体或实体行为");return[4,ibiz.entityService.getService(n)];case 1:return[4,c.sent().exec(a,t,r)];case 2:return c.sent(),[2,{}]}}))}))},e}());function b(e,t,o,i){return void 0===t&&(t=new n),void 0===o&&(o={}),void 0===i&&(i=[]),l(this,void 0,void 0,(function(){return p(this,(function(n){if(e.instanceof("app.view.IPSAppDERedirectView"))return[2,P(e,t,o,i)];throw new r(e,"未支持的重定向视图类型: ".concat(e.viewType))}))}))}function P(e,t,r,i){return void 0===t&&(t=new n),void 0===r&&(r={}),void 0===i&&(i=[]),l(this,void 0,void 0,(function(){var a,c,u,s,l,f,d,w,h,g,A,b,P,m,S,x,D,V;return p(this,(function(p){switch(p.label){case 0:return a=e.getPSAppViewNavContexts()||[],c=v(a,t,r),t=new n(c,t),u=e.getPSAppViewNavParams()||[],s=v(u,t,r),Object.assign(r,s),[4,(l=e.getPSAppDataEntity()).fill(!0)];case 1:return p.sent(),f=l.codeName.toLowerCase(),d=i[0]||{},t[f]=d[f]||t[f]||r[f],w=e.getGetDataPSAppDEAction(),[4,ibiz.entityService.getService(l.codeName)];case 2:return h=p.sent(),ibiz.loading.showRedirect(),[4,h.exec(w?w.codeName:"Get",t,r)];case 3:return g=p.sent(),ibiz.loading.hideRedirect(),g.ok&&(d=g.data,A=d.linkurl)?A.startsWith("http://")||A.startsWith("https://")?(window.open(A,"_blank"),[2,{ok:!0,data:[]}]):[2,{ok:!1,data:[]}]:(b=!!r.srfwf,[4,E(l,e,b,d)]);case 4:return P=p.sent(),m=P,b&&(m="".concat(P.split(":")[0],":").concat(r.srfwf.toUpperCase())),S=e.getRedirectPSAppViewRefs(),x=null==S?void 0:S.find((function(e){return e.name===m})),x||(m="".concat(P.split(":")[0]),x=null==S?void 0:S.find((function(e){return e.name===m}))),x?(D=x.getRefPSAppView())?[4,ibiz.commands.execute(y.TAG,D,t,r,{data:[d]})]:[3,6]:[3,7];case 5:return(V=p.sent())?[2,V]:[3,7];case 6:throw new o(x,"未配置实际引用视图");case 7:return[2,{ok:!0,data:[]}]}}))}))}function E(e,t,n,r){return l(this,void 0,void 0,(function(){var o,i,a,c,u;return p(this,(function(s){return o=e.getFormTypePSAppDEField(),i=e.getIndexTypePSAppDEField(),"",(a=t.getTypePSAppDEField())&&(c=r[a.codeName.toLowerCase()])?[2,c]:(u="",o?u=r[o.codeName.toLowerCase()]:i&&(u=r[i.codeName.toLowerCase()]),[2,u?n?"WFEDITVIEW:".concat(u):"EDITVIEW:".concat(u):n?"WFEDITVIEW:":"EDITVIEW:"])}))}))}var m,y=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={}),l(this,void 0,void 0,(function(){var o;return p(this,(function(i){switch(i.label){case 0:return[4,e.fill(!0)];case 1:if(i.sent(),e.redirectView)return[2,b(e,t,n,r.data)];switch(o=e.openMode,void 0===o?"INDEXVIEWTAB":o){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={}),l(this,void 0,void 0,(function(){return p(this,(function(r){return[2,ibiz.openView.modal(e,t,n)]}))}))},e.prototype.openPopover=function(e,t,n){return void 0===n&&(n={}),l(this,void 0,void 0,(function(){return p(this,(function(r){return[2,ibiz.openView.popover(e,t,n)]}))}))},e.prototype.openDrawer=function(e,t,n){return void 0===n&&(n={}),l(this,void 0,void 0,(function(){return p(this,(function(r){return[2,ibiz.openView.drawer(e,t,n)]}))}))},e.prototype.openUserCustom=function(e,t,n){return void 0===n&&(n={}),l(this,void 0,void 0,(function(){return p(this,(function(r){return[2,ibiz.openView.custom(e,t,n)]}))}))},e.TAG="ibiz.app-view.open",e}()),S=e("AppFuncCommand",function(){function e(){ibiz.commands.register(e.TAG,this.exec.bind(this))}return e.prototype.exec=function(e,t,r,o){return void 0===r&&(r={}),void 0===o&&(o={}),l(this,void 0,void 0,(function(){var i,a;return p(this,(function(c){switch((i=e.getPSNavigateContexts())&&(t?Object.assign(t,i):t=new n(i)),(a=e.getPSNavigateParams())&&Object.assign(r,a),e.appFuncType){case"APPVIEW":return[2,this.openAppView(e,t,r,o)];case"OPENHTMLPAGE":return[2,this.openHtmlPage(e)];case"PDTAPPFUNC":return[2,this.openPdAppFunc(e,t,r)];case"JAVASCRIPT":return[2,this.executeJavaScript(e,t,r)];case"CUSTOM":return[2,this.custom(e,t,r)];default:throw new Error("未知的应用功能类型: ".concat(e.appFuncType))}}))}))},e.prototype.openAppView=function(e,t,n,r){var o=e.getPSAppView();if(!o)throw new Error("应用视图不存在");return ibiz.commands.execute(y.TAG,o,t,n,r)},e.prototype.openHtmlPage=function(e){var t=e.htmlPageUrl;window.open(t,"_blank")},e.prototype.openPdAppFunc=function(e,t,n){throw console.log("openPdAppFunc",e,t,n),new Error("未实现")},e.prototype.executeJavaScript=function(e,t,n){throw console.log("executeJavaScript",e,t,n),new Error("未实现")},e.prototype.custom=function(e,t,n){throw console.log("custom",e,t,n),new Error("未实现")},e.TAG="ibiz.app-func.exec",e}());function x(){new S,new y}e("ViewMode",m),function(e){e.ROUTE="ROUTE",e.MODAL="MODAL",e.DRAWER="DRAWER",e.EMBED="EMBED",e.POPOVER="POPOVER"}(m||e("ViewMode",m={}));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}());function D(e,t,r,o,i){return void 0===i&&(i={}),l(this,void 0,void 0,(function(){var u,s,l,f,d,w,h,g;return p(this,(function(p){switch(p.label){case 0:if(!(null==r?void 0:r[0]))throw Error("没有选中数据!");if(!(u=e.getOpenDataPSAppView()))throw new Error("getOpenDataPSAppView为空");if(!(s=u.getRefPSAppView()))throw new Error("openView为空");return[4,s.fill(!0)];case 1:return p.sent(),[4,(l=new a(s.getPSAppDataEntity())).init()];case 2:return p.sent(),f=u.getPSNavigateContexts()||[],d=l.deName.toLowerCase(),-1===f.findIndex((function(e){return e.key===d}))&&f.push({key:d,value:d,rawValue:!1}),w=new n(v(f,t,o,r[0]),t),h={},g=u.getPSNavigateParams(),c(g)&&(h=v(g,o,t,r[0])),[4,ibiz.commands.execute(y.TAG,s,w,h,i)];case 3:return p.sent(),i.neuron.call.refresh(),[2,{}]}}))}))}function V(e,t,r,o,i){return void 0===i&&(i={}),l(this,void 0,void 0,(function(){var u,s,l,f,d,w,h,g;return p(this,(function(p){switch(p.label){case 0:if(!(u=e.getNewDataPSAppView()))throw new Error("getNewDataPSAppView为空");if(!(s=u.getRefPSAppView()))throw new Error("newView为空");return[4,s.fill(!0)];case 1:return p.sent(),[4,(l=new a(s.getPSAppDataEntity())).init()];case 2:return p.sent(),f={},d={},w=(null==r?void 0:r[0])||{},h=u.getPSNavigateContexts(),c(h)&&(f=v(h,t,o,w)),delete(f=new n(f,t))[l.deName.toLowerCase()],f[l.deName.toLowerCase()]=void 0,g=u.getPSNavigateParams(),c(g)&&(d=v(g,o,t,w)),e.enableWizardAdd||e.enableBatchAdd||e.batchAddOnly,[4,ibiz.commands.execute(y.TAG,s,f,d,i)];case 3:return p.sent(),i.neuron.call.refresh(),[2,{}]}}))}))}}}}));
@@ -1 +1 @@
1
- {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,wBAAgB,OAAO,IAAI,IAAI,CAU9B"}
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wBAAgB,OAAO,IAAI,IAAI,CAQ9B"}
package/out/install.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { commands } from '@ibiz-template/command';
2
2
  import { RegisterCenter } from './register/register-center';
3
3
  import { installCommand } from './command';
4
- import { PluginFactory } from './utils';
5
4
  /**
6
5
  * 安装运行时
7
6
  *
@@ -13,8 +12,6 @@ export function install() {
13
12
  const { ibiz } = window;
14
13
  // 挂载指令控制器
15
14
  ibiz.commands = commands;
16
- // 挂载插件工厂
17
- ibiz.plugin = new PluginFactory();
18
15
  // 挂载注册中心
19
16
  ibiz.register = new RegisterCenter();
20
17
  // 安装默认指令
@@ -0,0 +1,21 @@
1
+ import { IPSSysPFPlugin } from '@ibiz-template/model';
2
+ /**
3
+ * 插件工厂
4
+ *
5
+ * @author chitanda
6
+ * @date 2022-10-21 16:10:19
7
+ * @export
8
+ * @interface IPluginFactory
9
+ */
10
+ export interface IPluginFactory {
11
+ /**
12
+ * 加载插件
13
+ *
14
+ * @author chitanda
15
+ * @date 2022-10-21 16:10:27
16
+ * @param {IPSSysPFPlugin} plugin
17
+ * @return {*} {Promise<void>}
18
+ */
19
+ loadPlugin(plugin: IPSSysPFPlugin): Promise<void>;
20
+ }
21
+ //# sourceMappingURL=i-plugin-factory.d.ts.map
@@ -0,0 +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,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;;OAOG;IACH,UAAU,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,6 @@
1
1
  export { IModal } from './i-modal/i-modal';
2
2
  export { IModalData } from './i-modal-data/i-modal-data';
3
+ export { IPluginFactory } from './i-plugin-factory/i-plugin-factory';
3
4
  export { IUIActionResult } from './i-ui-action-result/i-ui-action-result';
4
5
  export * from './util';
5
6
  export * from './register/i-register';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interface/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,cAAc,QAAQ,CAAC;AACvB,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interface/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,cAAc,QAAQ,CAAC;AACvB,cAAc,uBAAuB,CAAC"}
package/out/types.d.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  import { CommandController } from '@ibiz-template/command';
2
2
  import '@ibiz-template/service';
3
- import { IMessageUtil, INotificationUtil, IOpenViewUtil, IModalUtil, ILoadingUtil } from './interface';
3
+ import { IMessageUtil, INotificationUtil, IOpenViewUtil, IModalUtil, ILoadingUtil, IPluginFactory } from './interface';
4
4
  import { RegisterCenter } from './register/register-center';
5
- import { PluginFactory } from './utils';
6
5
  declare module '@ibiz-template/core' {
7
6
  interface IBizSys {
8
7
  /**
@@ -62,9 +61,9 @@ declare module '@ibiz-template/core' {
62
61
  *
63
62
  * @author chitanda
64
63
  * @date 2022-10-20 16:10:36
65
- * @type {PluginFactory}
64
+ * @type {IPluginFactory}
66
65
  */
67
- plugin: PluginFactory;
66
+ plugin: IPluginFactory;
68
67
  /**
69
68
  * 注册中心
70
69
  *
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,wBAAwB,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,YAAY,EACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf;;;;;;WAMG;QACH,QAAQ,EAAE,iBAAiB,CAAC;QAC5B;;;;;;WAMG;QACH,OAAO,EAAE,YAAY,CAAC;QACtB;;;;;;;WAOG;QACH,KAAK,EAAE,UAAU,CAAC;QAClB;;;;;;;WAOG;QACH,OAAO,EAAE,YAAY,CAAC;QACtB;;;;;;;WAOG;QACH,YAAY,EAAE,iBAAiB,CAAC;QAChC;;;;;;;WAOG;QACH,QAAQ,EAAE,aAAa,CAAC;QACxB;;;;;;WAMG;QACH,MAAM,EAAE,aAAa,CAAC;QACtB;;;;;;WAMG;QACH,QAAQ,EAAE,cAAc,CAAC;KAC1B;CACF"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,wBAAwB,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,YAAY,EACZ,cAAc,EACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf;;;;;;WAMG;QACH,QAAQ,EAAE,iBAAiB,CAAC;QAC5B;;;;;;WAMG;QACH,OAAO,EAAE,YAAY,CAAC;QACtB;;;;;;;WAOG;QACH,KAAK,EAAE,UAAU,CAAC;QAClB;;;;;;;WAOG;QACH,OAAO,EAAE,YAAY,CAAC;QACtB;;;;;;;WAOG;QACH,YAAY,EAAE,iBAAiB,CAAC;QAChC;;;;;;;WAOG;QACH,QAAQ,EAAE,aAAa,CAAC;QACxB;;;;;;WAMG;QACH,MAAM,EAAE,cAAc,CAAC;QACvB;;;;;;WAMG;QACH,QAAQ,EAAE,cAAc,CAAC;KAC1B;CACF"}
@@ -1,5 +1,4 @@
1
1
  export { AppDEUIActionUtil } from './app-de-ui-action-util/app-de-ui-action-util';
2
2
  export * from './nav-params/nav-params';
3
3
  export { openRedirectView } from './open-redirect-view/open-redirect-view';
4
- export { PluginFactory } from './plugin-factory/plugin-factory';
5
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC"}
@@ -1,4 +1,3 @@
1
1
  export { AppDEUIActionUtil } from './app-de-ui-action-util/app-de-ui-action-util';
2
2
  export * from './nav-params/nav-params';
3
3
  export { openRedirectView } from './open-redirect-view/open-redirect-view';
4
- export { PluginFactory } from './plugin-factory/plugin-factory';
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@ibiz-template/runtime",
3
- "version": "0.0.1-alpha.30",
3
+ "version": "0.0.1-alpha.32",
4
4
  "description": "控制器包",
5
5
  "type": "module",
6
6
  "main": "out/index.js",
7
7
  "types": "out/index.d.ts",
8
+ "exports": {
9
+ "system": "./dist/system/index.system.js"
10
+ },
8
11
  "repository": {
9
12
  "type": "git",
10
13
  "url": "https://gitee.com/iBizModeling/ibiz-template.git"
@@ -27,12 +30,12 @@
27
30
  "author": "chitanda",
28
31
  "license": "MIT",
29
32
  "dependencies": {
30
- "@ibiz-template/command": "^0.0.1-alpha.26"
33
+ "@ibiz-template/command": "^0.0.1-alpha.32"
31
34
  },
32
35
  "devDependencies": {
33
- "@ibiz-template/core": "^0.0.1-alpha.26",
34
- "@ibiz-template/model": "^0.0.1-alpha.30",
35
- "@ibiz-template/service": "^0.0.1-alpha.30",
36
+ "@ibiz-template/core": "^0.0.1-alpha.32",
37
+ "@ibiz-template/model": "^0.0.1-alpha.32",
38
+ "@ibiz-template/service": "^0.0.1-alpha.32",
36
39
  "@types/systemjs": "^6.1.1",
37
40
  "qx-util": "0.4.3"
38
41
  },
@@ -42,5 +45,5 @@
42
45
  "@ibiz-template/service": "^0.0.1-alpha.2",
43
46
  "qx-util": "^0.4.1"
44
47
  },
45
- "gitHead": "a0ab4929e6fcae56e01372be6b777b24f86ab122"
48
+ "gitHead": "810108ae44074a1ff8fe4366ec2ca5f421737627"
46
49
  }
package/src/install.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { commands } from '@ibiz-template/command';
2
2
  import { RegisterCenter } from './register/register-center';
3
3
  import { installCommand } from './command';
4
- import { PluginFactory } from './utils';
5
4
 
6
5
  /**
7
6
  * 安装运行时
@@ -14,8 +13,6 @@ export function install(): void {
14
13
  const { ibiz } = window;
15
14
  // 挂载指令控制器
16
15
  ibiz.commands = commands;
17
- // 挂载插件工厂
18
- ibiz.plugin = new PluginFactory();
19
16
  // 挂载注册中心
20
17
  ibiz.register = new RegisterCenter();
21
18
  // 安装默认指令
@@ -0,0 +1,21 @@
1
+ import { IPSSysPFPlugin } from '@ibiz-template/model';
2
+
3
+ /**
4
+ * 插件工厂
5
+ *
6
+ * @author chitanda
7
+ * @date 2022-10-21 16:10:19
8
+ * @export
9
+ * @interface IPluginFactory
10
+ */
11
+ export interface IPluginFactory {
12
+ /**
13
+ * 加载插件
14
+ *
15
+ * @author chitanda
16
+ * @date 2022-10-21 16:10:27
17
+ * @param {IPSSysPFPlugin} plugin
18
+ * @return {*} {Promise<void>}
19
+ */
20
+ loadPlugin(plugin: IPSSysPFPlugin): Promise<void>;
21
+ }
@@ -1,5 +1,6 @@
1
1
  export { IModal } from './i-modal/i-modal';
2
2
  export { IModalData } from './i-modal-data/i-modal-data';
3
+ export { IPluginFactory } from './i-plugin-factory/i-plugin-factory';
3
4
  export { IUIActionResult } from './i-ui-action-result/i-ui-action-result';
4
5
  export * from './util';
5
6
  export * from './register/i-register';
package/src/types.ts CHANGED
@@ -6,9 +6,9 @@ import {
6
6
  IOpenViewUtil,
7
7
  IModalUtil,
8
8
  ILoadingUtil,
9
+ IPluginFactory,
9
10
  } from './interface';
10
11
  import { RegisterCenter } from './register/register-center';
11
- import { PluginFactory } from './utils';
12
12
 
13
13
  declare module '@ibiz-template/core' {
14
14
  interface IBizSys {
@@ -69,9 +69,9 @@ declare module '@ibiz-template/core' {
69
69
  *
70
70
  * @author chitanda
71
71
  * @date 2022-10-20 16:10:36
72
- * @type {PluginFactory}
72
+ * @type {IPluginFactory}
73
73
  */
74
- plugin: PluginFactory;
74
+ plugin: IPluginFactory;
75
75
  /**
76
76
  * 注册中心
77
77
  *
@@ -1,4 +1,3 @@
1
1
  export { AppDEUIActionUtil } from './app-de-ui-action-util/app-de-ui-action-util';
2
2
  export * from './nav-params/nav-params';
3
3
  export { openRedirectView } from './open-redirect-view/open-redirect-view';
4
- export { PluginFactory } from './plugin-factory/plugin-factory';
@@ -1,21 +0,0 @@
1
- import { IPSSysPFPlugin } from '@ibiz-template/model';
2
- /**
3
- * System js 插件加载工厂,负责加载与缓存插件
4
- *
5
- * @author chitanda
6
- * @date 2022-10-20 16:10:47
7
- * @export
8
- * @class PluginFactory
9
- */
10
- export declare class PluginFactory {
11
- /**
12
- * 加载插件并返回模块
13
- *
14
- * @author chitanda
15
- * @date 2022-10-20 16:10:28
16
- * @param {IPSSysPFPlugin} plugin
17
- * @return {*} {Promise<any>}
18
- */
19
- loadPlugin(plugin: IPSSysPFPlugin): Promise<any>;
20
- }
21
- //# sourceMappingURL=plugin-factory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-factory.d.ts","sourceRoot":"","sources":["../../../src/utils/plugin-factory/plugin-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD;;;;;;;GAOG;AACH,qBAAa,aAAa;IACxB;;;;;;;OAOG;IAEG,UAAU,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC;CAcvD"}
@@ -1,33 +0,0 @@
1
- /**
2
- * System js 插件加载工厂,负责加载与缓存插件
3
- *
4
- * @author chitanda
5
- * @date 2022-10-20 16:10:47
6
- * @export
7
- * @class PluginFactory
8
- */
9
- export class PluginFactory {
10
- /**
11
- * 加载插件并返回模块
12
- *
13
- * @author chitanda
14
- * @date 2022-10-20 16:10:28
15
- * @param {IPSSysPFPlugin} plugin
16
- * @return {*} {Promise<any>}
17
- */
18
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
19
- async loadPlugin(plugin) {
20
- if (plugin.runtimeObject) {
21
- const code = `${plugin.pluginType}:${plugin.pluginCode}`;
22
- if (code === 'VIEW_CUSTOM:remoteView') {
23
- if (!System.has(code)) {
24
- const module = await System.import(plugin.pluginCode);
25
- if (module) {
26
- System.set(code, module);
27
- }
28
- }
29
- return System.get(code);
30
- }
31
- }
32
- }
33
- }
@@ -1,35 +0,0 @@
1
- import { IPSSysPFPlugin } from '@ibiz-template/model';
2
-
3
- /**
4
- * System js 插件加载工厂,负责加载与缓存插件
5
- *
6
- * @author chitanda
7
- * @date 2022-10-20 16:10:47
8
- * @export
9
- * @class PluginFactory
10
- */
11
- export class PluginFactory {
12
- /**
13
- * 加载插件并返回模块
14
- *
15
- * @author chitanda
16
- * @date 2022-10-20 16:10:28
17
- * @param {IPSSysPFPlugin} plugin
18
- * @return {*} {Promise<any>}
19
- */
20
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
- async loadPlugin(plugin: IPSSysPFPlugin): Promise<any> {
22
- if (plugin.runtimeObject) {
23
- const code = `${plugin.pluginType}:${plugin.pluginCode}`;
24
- if (code === 'VIEW_CUSTOM:remoteView') {
25
- if (!System.has(code)) {
26
- const module = await System.import(plugin.pluginCode);
27
- if (module) {
28
- System.set(code, module);
29
- }
30
- }
31
- return System.get(code);
32
- }
33
- }
34
- }
35
- }