@ibiz-template/runtime 0.0.1-beta.1 → 0.0.1-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/system/index.system.js +1 -1
- package/out/config/global-config.d.ts +14 -0
- package/out/config/global-config.d.ts.map +1 -0
- package/out/config/global-config.js +14 -0
- package/out/install.d.ts.map +1 -1
- package/out/install.js +3 -0
- package/out/interface/i-global-config/i-global-config.d.ts +21 -0
- package/out/interface/i-global-config/i-global-config.d.ts.map +1 -0
- package/out/interface/i-global-config/i-global-config.js +1 -0
- package/out/interface/i-modal-options/i-modal-options.d.ts +8 -0
- package/out/interface/i-modal-options/i-modal-options.d.ts.map +1 -1
- package/out/interface/index.d.ts +1 -0
- package/out/interface/index.d.ts.map +1 -1
- package/out/provider/ui-action/index.d.ts +2 -1
- package/out/provider/ui-action/index.d.ts.map +1 -1
- package/out/provider/ui-action/index.js +5 -1
- package/out/provider/ui-action/wf-withdraw-ui-action-provider.d.ts +15 -0
- package/out/provider/ui-action/wf-withdraw-ui-action-provider.d.ts.map +1 -0
- package/out/provider/ui-action/wf-withdraw-ui-action-provider.js +18 -0
- package/out/types.d.ts +9 -1
- package/out/types.d.ts.map +1 -1
- package/out/utils/app-de-ui-action-util/handler/index.d.ts +1 -0
- package/out/utils/app-de-ui-action-util/handler/index.d.ts.map +1 -1
- package/out/utils/app-de-ui-action-util/handler/index.js +1 -0
- package/out/utils/app-de-ui-action-util/handler/ui-action-handler.d.ts.map +1 -1
- package/out/utils/app-de-ui-action-util/handler/ui-action-handler.js +3 -2
- package/out/utils/app-de-ui-action-util/handler/wf-withdraw-handler.d.ts +17 -0
- package/out/utils/app-de-ui-action-util/handler/wf-withdraw-handler.d.ts.map +1 -0
- package/out/utils/app-de-ui-action-util/handler/wf-withdraw-handler.js +27 -0
- package/out/utils/nav-params/nav-params.js +4 -4
- package/package.json +10 -11
- package/src/config/global-config.ts +14 -0
- package/src/install.ts +3 -0
- package/src/interface/i-global-config/i-global-config.ts +20 -0
- package/src/interface/i-modal-options/i-modal-options.ts +9 -0
- package/src/interface/index.ts +2 -0
- package/src/provider/ui-action/index.ts +6 -0
- package/src/provider/ui-action/wf-withdraw-ui-action-provider.ts +22 -0
- package/src/types.ts +10 -0
- package/src/utils/app-de-ui-action-util/handler/index.ts +1 -0
- package/src/utils/app-de-ui-action-util/handler/ui-action-handler.ts +3 -2
- package/src/utils/app-de-ui-action-util/handler/wf-withdraw-handler.ts +37 -0
- package/src/utils/nav-params/nav-params.ts +4 -4
- package/LICENSE +0 -21
|
@@ -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:m,convertNavDataByObject:P,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:O,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)?m.apply(void 0,v([e],h(t),!1)):"[object Object]"===Object.prototype.toString.call(e)?P.apply(void 0,v([e],h(t),!1)):{}}function m(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 P(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("Import"===a){if(!r.call.importData)throw new Error("该视图不存在Import能力");r.call.importData()}if("ExportExcel"===a){if(!r.call.exportData)throw new Error("该视图不存在ExportExcel能力");r.call.exportData(o)}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)),R=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(I.TAG,o,c,u,i)];case 3:return s.sent(),[2,{}]}}))}))},t}(E));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(){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,m,P,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,N(l,e,n.srfwf,f)];case 4:return S=d.sent(),y="".concat(l.name.toUpperCase(),":").concat(S),m=e.getRedirectPSAppViewRefs(),P=null==m?void 0:m.find((function(e){return e.name===y||e.name===S})),P?(b=P.getRefPSAppView())?[4,ibiz.commands.execute(I.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(P,"未配置实际引用视图");case 7:return[2,{ok:!0,data:[]}]}}))}))}function N(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 I=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,O(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,r.event,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,r){return void 0===r&&(r={}),f(this,void 0,void 0,(function(){return d(this,(function(i){return[2,ibiz.openView.popover(e,t,n,r)]}))}))},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}()),T=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(I.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 T,new I}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 R),[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_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.register("SYS_Import",new _),e.register("SYS_ExportExcel",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("PluginStaticResource",function(){function e(e){this.baseDir=e.substring(0,e.lastIndexOf("/"))}return e.prototype.dir=function(e){return this.baseDir+e},e}()),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(I.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(I.TAG,u,p,f,a)];case 3:return d.sent(),a.neuron.call.refresh(),[2,{}]}}))}))}}}}));
|
|
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:m,convertNavDataByArray:b,convertNavDataByObject:P,executeNewDataAppUILogic:j,executeOpenDataAppUILogic:Y,executeViewLogic:function(e,t,n,r,i){void 0===i&&(i={});return d(this,void 0,void 0,(function(){var o;return w(this,(function(a){switch(a.label){case 0:return"opendata"===e.name&&e.getPSAppUILogic()?[2,Y(e.getPSAppUILogic(),t,n,r,i)]:"newdata"===e.name&&e.getPSAppUILogic()?[2,j(e.getPSAppUILogic(),t,n,r,i)]:[4,u(e.getPSAppViewUIAction())];case 1:if(!(o=a.sent()))throw new Error("找不到界面行为");return[2,E.exec(o,t,n,r,i)]}}))}))},install:function(){var e=window.ibiz;e.commands=t,e.register=new A,e.config=new l,z(),k()},installCommand:z,openRedirectView:V,presetUIActionProvider:k});var l=function(){this.enableDataInfoBar=!0},p=function(e,t){return p=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])},p(e,t)};function f(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}p(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function d(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 w(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(c){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){a.label=c[1];break}if(6===c[0]&&a.label<i[1]){a.label=i[1],i=c;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(c);break}i[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}function h(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 v(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 g(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 S=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}()),y=e("UIActionRegister",function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return f(t,e),t.prototype.get=function(e){return d(this,void 0,void 0,(function(){var t,r,i,o,a,c;return w(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}(S)),A=e("RegisterCenter",(function(){this.uiAction=new y}));function m(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return"[object Array]"===Object.prototype.toString.call(e)?b.apply(void 0,g([e],v(t),!1)):"[object Object]"===Object.prototype.toString.call(e)?P.apply(void 0,g([e],v(t),!1)):{}}function b(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.toLowerCase()]=t[e.value])}else c[e.key.toLowerCase()]=e.value};try{for(var s=h(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 P(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.toLowerCase()]=c[a])}else r[n.toLowerCase()]=e[n]};for(var c in e)a(c);return r}var E=e("AppDEUIActionUtil",function(){function e(){}return e.exec=function(e,t,n,r,i){return d(this,void 0,void 0,(function(){return w(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}()),x=e("UIActionHandler",function(){function e(){}return e.prototype.exec=function(e,t,n,r,i){return d(this,void 0,void 0,(function(){var o,a,c;return w(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 d(this,void 0,void 0,(function(){return w(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 d(this,void 0,void 0,(function(){var o;return w(this,(function(a){switch(a.label){case 0:return(o=e.getNextPSUIAction())?[4,E.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 d(this,void 0,void 0,(function(){return w(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 d(this,void 0,void 0,(function(){var a,c,u,s,l,p,f,d,h,v;return w(this,(function(w){switch(w.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(),l=e.valueItem,p=e.paramItem,s&&"SINGLEKEY"===e.actionTarget?[4,null==s?void 0:s.fill(!0)]:[3,2];case 1:w.sent(),f=s.codeName.toLowerCase(),u.unshift({key:p||f,value:l||"srfkey",rawValue:!1}),w.label=2;case 2:return i(u)&&(c=m(u,t,o,(null==n?void 0:n[0])||{})),d=new r(c,t),h={},v=e.getPSNavigateParams(),i(v)&&(h=m(v,t,o,(null==n?void 0:n[0])||{})),[2,{resultContext:d,resultData:a,resultParams:h}]}}))}))},e}()),D=e("CommonSysUIActionHandler",function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return f(t,e),t.prototype.execAction=function(e,t,n,r,i){return d(this,void 0,void 0,(function(){var t,r,o,a,c;return w(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("Import"===a){if(!r.call.importData)throw new Error("该视图不存在Import能力");r.call.importData()}if("ExportExcel"===a){if(!r.call.exportData)throw new Error("该视图不存在ExportExcel能力");r.call.exportData(o)}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}(x)),I=e("BackendUIActionHandler",function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return f(t,e),t.prototype.execAction=function(e,t,n,r,i){var o,a,c;return d(this,void 0,void 0,(function(){var i,u,s,l,p,f,d,h;return w(this,(function(w){switch(w.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=w.sent(),l=s.resultContext,p=s.resultParams,f=s.resultData,[4,ibiz.entityService.getService(i)];case 2:return d=w.sent(),h=f.length>0?(null===(c=f[0])||void 0===c?void 0:c.getRequestData())||f[0]:{},[4,d.exec(u,l,h,p)];case 3:return w.sent(),[2,{}]}}))}))},t}(x)),O=e("FrontUIActionHandler",function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return f(t,e),t.prototype.execAction=function(e,t,n,r,i){return d(this,void 0,void 0,(function(){var o,a,c,u;return w(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(C.TAG,o,c,u,i)];case 3:return s.sent(),[2,{}]}}))}))},t}(x)),R=e("WFWithdrawUIActionHandler",function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return f(t,e),t.prototype.execAction=function(e,t,n,r,i){return d(this,void 0,void 0,(function(){var e,o;return w(this,(function(a){switch(a.label){case 0:return[4,ibiz.modal.confirm({title:"提示",desc:"是否确认执行撤回操作?"})];case 1:return e=a.sent(),o=!1,e&&(null==i?void 0:i.neuron)?[4,i.neuron.call.wfWithdraw(t,r,(null==n?void 0:n[0])||[])]:[3,3];case 2:a.sent(),o=!0,a.label=3;case 3:return[2,{refresh:!1,closeView:o}]}}))}))},t}(x));function V(e,t,n,i){return void 0===t&&(t=new r),void 0===n&&(n={}),void 0===i&&(i=[]),d(this,void 0,void 0,(function(){return w(this,(function(r){if(e.instanceof("app.view.IPSAppDERedirectView"))return[2,N(e,t,n,i)];throw new a(e,"未支持的重定向视图类型: ".concat(e.viewType))}))}))}function N(e,t,n,i){return void 0===t&&(t=new r),void 0===n&&(n={}),void 0===i&&(i=[]),d(this,void 0,void 0,(function(){var o,a,u,s,l,p,f,d,h,v,g,S,y,A,b,P,E;return w(this,(function(w){switch(w.label){case 0:return o=e.getPSAppViewNavContexts()||[],a=m(o,t,n),t=new r(a,t),u=e.getPSAppViewNavParams()||[],s=m(u,t,n),Object.assign(n,s),[4,(l=e.getPSAppDataEntity()).fill(!0)];case 1:return w.sent(),p=l.codeName.toLowerCase(),f=i[0]||{},t[p]=f[p]||t[p]||n[p],d=e.getGetDataPSAppDEAction(),[4,ibiz.entityService.getService(l.codeName)];case 2:return h=w.sent(),ibiz.loading.showRedirect(),[4,h.exec(d?d.codeName:"Get",t,n)];case 3:return v=w.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,T(l,e,n.srfwf,f)];case 4:return S=w.sent(),y="".concat(l.name.toUpperCase(),":").concat(S),A=e.getRedirectPSAppViewRefs(),b=null==A?void 0:A.find((function(e){return e.name===y||e.name===S})),b?(P=b.getRefPSAppView())?[4,ibiz.commands.execute(C.TAG,P,t,n,{data:[f]})]:[3,6]:[3,7];case 5:return(E=w.sent())?[2,E]:[3,7];case 6:throw new c(b,"未配置实际引用视图");case 7:return[2,{ok:!0,data:[]}]}}))}))}function T(e,t,n,r){return d(this,void 0,void 0,(function(){var a,c,u,s,l;return w(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 C=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={}),d(this,void 0,void 0,(function(){var i;return w(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,r.event,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={}),d(this,void 0,void 0,(function(){return w(this,(function(r){return[2,ibiz.openView.modal(e,t,n)]}))}))},e.prototype.openPopover=function(e,t,n,r){return void 0===r&&(r={}),d(this,void 0,void 0,(function(){return w(this,(function(i){return[2,ibiz.openView.popover(e,t,n,r)]}))}))},e.prototype.openDrawer=function(e,t,n){return void 0===n&&(n={}),d(this,void 0,void 0,(function(){return w(this,(function(r){return[2,ibiz.openView.drawer(e,t,n)]}))}))},e.prototype.openUserCustom=function(e,t,n){return void 0===n&&(n={}),d(this,void 0,void 0,(function(){return w(this,(function(r){return[2,ibiz.openView.custom(e,t,n)]}))}))},e.TAG="ibiz.app-view.open",e}()),U=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={}),d(this,void 0,void 0,(function(){var o,a;return w(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(C.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 z(){new U,new C}var _,F=e("BackendUIActionProvider",function(){function e(){}return e.prototype.getHandler=function(){return d(this,void 0,void 0,(function(){return w(this,(function(e){return this.handler||(this.handler=new I),[2,this.handler]}))}))},e}()),L=e("CommonSysUIActionProvider",function(){function e(){}return e.prototype.getHandler=function(){return d(this,void 0,void 0,(function(){return w(this,(function(e){return this.handler||(this.handler=new D),[2,this.handler]}))}))},e}()),W=e("FrontUIActionProvider",function(){function e(){}return e.prototype.getHandler=function(){return d(this,void 0,void 0,(function(){return w(this,(function(e){return this.handler||(this.handler=new O),[2,this.handler]}))}))},e}()),M=e("WFWithdrawUIActionProvider",function(){function e(){}return e.prototype.getHandler=function(){return d(this,void 0,void 0,(function(){return w(this,(function(e){return this.handler||(this.handler=new R),[2,this.handler]}))}))},e}());function k(){var e=ibiz.register.uiAction;e&&(e.register("FRONT",new W),e.register("BACKEND",new F),e.register("SYS_New",new L),e.register("SYS_Edit",new L),e.register("SYS_Save",new L),e.register("SYS_SaveAndExit",new L),e.register("SYS_SaveRow",new L),e.register("SYS_SaveAndNew",new L),e.register("SYS_Remove",new L),e.register("SYS_RemoveAndExit",new L),e.register("SYS_NewRow",new L),e.register("SYS_SaveAndStart",new L),e.register("SYS_ViewWFStep",new L),e.register("SYS_ToggleFilter",new L),e.register("SYS_Exit",new L),e.register("SYS_Refresh",new L),e.register("SYS_Import",new L),e.register("SYS_ExportExcel",new L),e.register("DEUIACTION_WFWithdraw",new M))}e("ViewMode",_),function(e){e.ROUTE="ROUTE",e.MODAL="MODAL",e.DRAWER="DRAWER",e.EMBED="EMBED",e.POPOVER="POPOVER"}(_||e("ViewMode",_={}));e("PluginStaticResource",function(){function e(e){this.baseDir=e.substring(0,e.lastIndexOf("/"))}return e.prototype.dir=function(e){return this.baseDir+e},e}()),e("RemotePluginItem",(function(e,t){this.tag=e,this.config=t}));function Y(e,t,n,o,a){return void 0===a&&(a={}),d(this,void 0,void 0,(function(){var c,u,l,p,f,d,h,v;return w(this,(function(w){switch(w.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 w.sent(),[4,(l=new s(u.getPSAppDataEntity())).init()];case 2:return w.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}),d=new r(m(p,t,o,n[0]),t),h={},v=c.getPSNavigateParams(),i(v)&&(h=m(v,o,t,n[0])),[4,ibiz.commands.execute(C.TAG,u,d,h,a)];case 3:return w.sent(),a.neuron.call.refresh(),[2,{}]}}))}))}function j(e,t,n,o,a){return void 0===a&&(a={}),d(this,void 0,void 0,(function(){var c,u,l,p,f,d,h,v;return w(this,(function(w){switch(w.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 w.sent(),[4,(l=new s(u.getPSAppDataEntity())).init()];case 2:return w.sent(),p={},f={},d=(null==n?void 0:n[0])||{},h=c.getPSNavigateContexts(),i(h)&&(p=m(h,t,o,d)),delete(p=new r(p,t))[l.deName.toLowerCase()],p[l.deName.toLowerCase()]=void 0,v=c.getPSNavigateParams(),i(v)&&(f=m(v,o,t,d)),e.enableWizardAdd||e.enableBatchAdd||e.batchAddOnly,[4,ibiz.commands.execute(C.TAG,u,p,f,a)];case 3:return w.sent(),a.neuron.call.refresh(),[2,{}]}}))}))}}}}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IGlobalConfig } from '../interface/i-global-config/i-global-config';
|
|
2
|
+
/**
|
|
3
|
+
* 全局配置类,控制应用的功能开关。
|
|
4
|
+
*
|
|
5
|
+
* @author lxm
|
|
6
|
+
* @date 2022-12-09 14:12:28
|
|
7
|
+
* @export
|
|
8
|
+
* @class GlobalConfig
|
|
9
|
+
* @implements {IGlobalConfig}
|
|
10
|
+
*/
|
|
11
|
+
export declare class GlobalConfig implements IGlobalConfig {
|
|
12
|
+
enableDataInfoBar: boolean;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=global-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-config.d.ts","sourceRoot":"","sources":["../../src/config/global-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAE7E;;;;;;;;GAQG;AACH,qBAAa,YAAa,YAAW,aAAa;IAChD,iBAAiB,EAAE,OAAO,CAAQ;CACnC"}
|
package/out/install.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,wBAAgB,OAAO,IAAI,IAAI,CAY9B"}
|
package/out/install.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { commands } from '@ibiz-template/command';
|
|
2
|
+
import { GlobalConfig } from './config/global-config';
|
|
2
3
|
import { RegisterCenter } from './register/register-center';
|
|
3
4
|
import { installCommand } from './command';
|
|
4
5
|
import { presetUIActionProvider } from './provider';
|
|
@@ -15,6 +16,8 @@ export function install() {
|
|
|
15
16
|
ibiz.commands = commands;
|
|
16
17
|
// 挂载注册中心
|
|
17
18
|
ibiz.register = new RegisterCenter();
|
|
19
|
+
// 初始化全局配置
|
|
20
|
+
ibiz.config = new GlobalConfig();
|
|
18
21
|
// 安装默认指令
|
|
19
22
|
installCommand();
|
|
20
23
|
// 注册预置的界面行为适配器
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 全局配置类,控制应用的功能开关。
|
|
3
|
+
*
|
|
4
|
+
* @author lxm
|
|
5
|
+
* @date 2022-12-09 14:12:44
|
|
6
|
+
* @export
|
|
7
|
+
* @interface IGlobalConfig
|
|
8
|
+
*/
|
|
9
|
+
export interface IGlobalConfig {
|
|
10
|
+
/**
|
|
11
|
+
* 是否启用信息栏
|
|
12
|
+
* - true:后才会识别模型的isShowDataInfoBar来控制是否显示信息栏
|
|
13
|
+
* - false:则一律不显示信息栏
|
|
14
|
+
*
|
|
15
|
+
* @author lxm
|
|
16
|
+
* @date 2022-12-09 14:12:13
|
|
17
|
+
* @type {boolean}
|
|
18
|
+
*/
|
|
19
|
+
enableDataInfoBar: boolean;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=i-global-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i-global-config.d.ts","sourceRoot":"","sources":["../../../src/interface/i-global-config/i-global-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;;;OAQG;IACH,iBAAiB,EAAE,OAAO,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -31,5 +31,13 @@ export interface IModalOptions {
|
|
|
31
31
|
* @type {'center'}
|
|
32
32
|
*/
|
|
33
33
|
placement?: 'center';
|
|
34
|
+
/**
|
|
35
|
+
* 自定义模态的类名,用来自定义模态样式
|
|
36
|
+
*
|
|
37
|
+
* @author lxm
|
|
38
|
+
* @date 2022-11-21 15:11:29
|
|
39
|
+
* @type {string}
|
|
40
|
+
*/
|
|
41
|
+
modalClass?: string;
|
|
34
42
|
}
|
|
35
43
|
//# sourceMappingURL=i-modal-options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i-modal-options.d.ts","sourceRoot":"","sources":["../../../src/interface/i-modal-options/i-modal-options.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"i-modal-options.d.ts","sourceRoot":"","sources":["../../../src/interface/i-modal-options/i-modal-options.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC;IAErB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
package/out/interface/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { IModalOptions } from './i-modal-options/i-modal-options';
|
|
|
6
6
|
export { IPluginFactory } from './i-plugin-factory/i-plugin-factory';
|
|
7
7
|
export { IUIActionResult } from './i-ui-action-result/i-ui-action-result';
|
|
8
8
|
export { IUIActionHandler } from './i-ui-action-handler/i-ui-action-handler';
|
|
9
|
+
export { IGlobalConfig } from './i-global-config/i-global-config';
|
|
9
10
|
export * from './util';
|
|
10
11
|
export * from './provider';
|
|
11
12
|
export * from './register';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interface/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EACL,eAAe,EACf,SAAS,GACV,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interface/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EACL,eAAe,EACf,SAAS,GACV,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BackendUIActionProvider } from './backend-ui-action-provider';
|
|
2
2
|
import { CommonSysUIActionProvider } from './common-sys-ui-action-provider';
|
|
3
3
|
import { FrontUIActionProvider } from './front-ui-action-provider';
|
|
4
|
+
import { WFWithdrawUIActionProvider } from './wf-withdraw-ui-action-provider';
|
|
4
5
|
/**
|
|
5
6
|
* 预置默认的界面行为适配器
|
|
6
7
|
*
|
|
@@ -9,5 +10,5 @@ import { FrontUIActionProvider } from './front-ui-action-provider';
|
|
|
9
10
|
* @export
|
|
10
11
|
*/
|
|
11
12
|
export declare function presetUIActionProvider(): void;
|
|
12
|
-
export { FrontUIActionProvider, CommonSysUIActionProvider, BackendUIActionProvider, };
|
|
13
|
+
export { FrontUIActionProvider, CommonSysUIActionProvider, BackendUIActionProvider, WFWithdrawUIActionProvider, };
|
|
13
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/provider/ui-action/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/provider/ui-action/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAE9E;;;;;;GAMG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAoC7C;AAED,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,GAC3B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BackendUIActionProvider } from './backend-ui-action-provider';
|
|
2
2
|
import { CommonSysUIActionProvider } from './common-sys-ui-action-provider';
|
|
3
3
|
import { FrontUIActionProvider } from './front-ui-action-provider';
|
|
4
|
+
import { WFWithdrawUIActionProvider } from './wf-withdraw-ui-action-provider';
|
|
4
5
|
/**
|
|
5
6
|
* 预置默认的界面行为适配器
|
|
6
7
|
*
|
|
@@ -40,5 +41,8 @@ export function presetUIActionProvider() {
|
|
|
40
41
|
uiAction.register('SYS_Refresh', new CommonSysUIActionProvider());
|
|
41
42
|
uiAction.register('SYS_Import', new CommonSysUIActionProvider());
|
|
42
43
|
uiAction.register('SYS_ExportExcel', new CommonSysUIActionProvider());
|
|
44
|
+
// 预置插件
|
|
45
|
+
// 工作流撤回
|
|
46
|
+
uiAction.register('DEUIACTION_WFWithdraw', new WFWithdrawUIActionProvider());
|
|
43
47
|
}
|
|
44
|
-
export { FrontUIActionProvider, CommonSysUIActionProvider, BackendUIActionProvider, };
|
|
48
|
+
export { FrontUIActionProvider, CommonSysUIActionProvider, BackendUIActionProvider, WFWithdrawUIActionProvider, };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IUIActionHandler, IUIActionProvider } from '../../interface';
|
|
2
|
+
/**
|
|
3
|
+
* 工作流流程撤回界面行为适配器
|
|
4
|
+
*
|
|
5
|
+
* @author lxm
|
|
6
|
+
* @date 2022-10-25 15:10:51
|
|
7
|
+
* @export
|
|
8
|
+
* @class WFWithdrawUIActionProvider
|
|
9
|
+
* @implements {IUIActionProvider}
|
|
10
|
+
*/
|
|
11
|
+
export declare class WFWithdrawUIActionProvider implements IUIActionProvider {
|
|
12
|
+
private handler?;
|
|
13
|
+
getHandler(): Promise<IUIActionHandler>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=wf-withdraw-ui-action-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wf-withdraw-ui-action-provider.d.ts","sourceRoot":"","sources":["../../../src/provider/ui-action/wf-withdraw-ui-action-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGtE;;;;;;;;GAQG;AACH,qBAAa,0BAA2B,YAAW,iBAAiB;IAClE,OAAO,CAAC,OAAO,CAAC,CAAmB;IAE7B,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAM9C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { WFWithdrawUIActionHandler } from '../../utils';
|
|
2
|
+
/**
|
|
3
|
+
* 工作流流程撤回界面行为适配器
|
|
4
|
+
*
|
|
5
|
+
* @author lxm
|
|
6
|
+
* @date 2022-10-25 15:10:51
|
|
7
|
+
* @export
|
|
8
|
+
* @class WFWithdrawUIActionProvider
|
|
9
|
+
* @implements {IUIActionProvider}
|
|
10
|
+
*/
|
|
11
|
+
export class WFWithdrawUIActionProvider {
|
|
12
|
+
async getHandler() {
|
|
13
|
+
if (!this.handler) {
|
|
14
|
+
this.handler = new WFWithdrawUIActionHandler();
|
|
15
|
+
}
|
|
16
|
+
return this.handler;
|
|
17
|
+
}
|
|
18
|
+
}
|
package/out/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CommandController } from '@ibiz-template/command';
|
|
2
2
|
import '@ibiz-template/service';
|
|
3
|
-
import { IMessageUtil, INotificationUtil, IOpenViewUtil, IModalUtil, ILoadingUtil, IPluginFactory, IOverlayController } from './interface';
|
|
3
|
+
import { IMessageUtil, INotificationUtil, IOpenViewUtil, IModalUtil, ILoadingUtil, IPluginFactory, IOverlayController, IGlobalConfig } from './interface';
|
|
4
4
|
import { RegisterCenter } from './register/register-center';
|
|
5
5
|
declare module '@ibiz-template/core' {
|
|
6
6
|
interface IBizSys {
|
|
@@ -80,6 +80,14 @@ declare module '@ibiz-template/core' {
|
|
|
80
80
|
* @type {Register}
|
|
81
81
|
*/
|
|
82
82
|
register: RegisterCenter;
|
|
83
|
+
/**
|
|
84
|
+
* 全局配置
|
|
85
|
+
*
|
|
86
|
+
* @author lxm
|
|
87
|
+
* @date 2022-12-09 14:12:14
|
|
88
|
+
* @type {IGlobalConfig}
|
|
89
|
+
*/
|
|
90
|
+
config: IGlobalConfig;
|
|
83
91
|
}
|
|
84
92
|
}
|
|
85
93
|
//# sourceMappingURL=types.d.ts.map
|
package/out/types.d.ts.map
CHANGED
|
@@ -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,EACZ,cAAc,EACd,kBAAkB,
|
|
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,EACd,kBAAkB,EAClB,aAAa,EACd,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,OAAO,EAAE,kBAAkB,CAAC;QAC5B;;;;;;WAMG;QACH,MAAM,EAAE,cAAc,CAAC;QACvB;;;;;;WAMG;QACH,QAAQ,EAAE,cAAc,CAAC;QAEzB;;;;;;WAMG;QACH,MAAM,EAAE,aAAa,CAAC;KACvB;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/app-de-ui-action-util/handler/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/app-de-ui-action-util/handler/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-action-handler.d.ts","sourceRoot":"","sources":["../../../../src/utils/app-de-ui-action-util/handler/ui-action-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAsB,MAAM,sBAAsB,CAAC;AAE5E,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIvE;;;;;;;GAOG;AACH,8BAAsB,eAAgB,YAAW,gBAAgB;IACzD,IAAI,CACR,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EACpB,MAAM,EAAE,OAAO,EACf,IAAI,CAAC,EAAE,KAAK,GAAG,SAAS,GACvB,OAAO,CAAC,eAAe,CAAC;IAqB3B;;;;;;;OAOG;IACG,SAAS,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAO3D;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,UAAU,CACjB,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EACpB,MAAM,EAAE,OAAO,EACf,IAAI,CAAC,EAAE,KAAK,GAAG,SAAS,GACvB,OAAO,CAAC,eAAe,CAAC;IAE3B;;;;;;;;;;;OAWG;IACG,YAAY,CAChB,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EACpB,MAAM,EAAE,OAAO,EACf,IAAI,CAAC,EAAE,KAAK,GAAG,SAAS,GACvB,OAAO,CAAC,IAAI,CAAC;IAOhB;;;;;;;OAOG;IACG,YAAY,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBzE;;;;;;;;;;;;;;;;OAgBG;cACa,YAAY,CAC1B,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EACpB,MAAM,EAAE,OAAO,GACd,OAAO,CAAC;QACT,aAAa,EAAE,WAAW,CAAC;QAC3B,UAAU,EAAE,KAAK,EAAE,CAAC;QACpB,YAAY,EAAE,OAAO,CAAC;KACvB,CAAC;
|
|
1
|
+
{"version":3,"file":"ui-action-handler.d.ts","sourceRoot":"","sources":["../../../../src/utils/app-de-ui-action-util/handler/ui-action-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAgB,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAsB,MAAM,sBAAsB,CAAC;AAE5E,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIvE;;;;;;;GAOG;AACH,8BAAsB,eAAgB,YAAW,gBAAgB;IACzD,IAAI,CACR,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EACpB,MAAM,EAAE,OAAO,EACf,IAAI,CAAC,EAAE,KAAK,GAAG,SAAS,GACvB,OAAO,CAAC,eAAe,CAAC;IAqB3B;;;;;;;OAOG;IACG,SAAS,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAO3D;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,UAAU,CACjB,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EACpB,MAAM,EAAE,OAAO,EACf,IAAI,CAAC,EAAE,KAAK,GAAG,SAAS,GACvB,OAAO,CAAC,eAAe,CAAC;IAE3B;;;;;;;;;;;OAWG;IACG,YAAY,CAChB,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EACpB,MAAM,EAAE,OAAO,EACf,IAAI,CAAC,EAAE,KAAK,GAAG,SAAS,GACvB,OAAO,CAAC,IAAI,CAAC;IAOhB;;;;;;;OAOG;IACG,YAAY,CAAC,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBzE;;;;;;;;;;;;;;;;OAgBG;cACa,YAAY,CAC1B,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EACpB,MAAM,EAAE,OAAO,GACd,OAAO,CAAC;QACT,aAAa,EAAE,WAAW,CAAC;QAC3B,UAAU,EAAE,KAAK,EAAE,CAAC;QACpB,YAAY,EAAE,OAAO,CAAC;KACvB,CAAC;CA0DH"}
|
|
@@ -117,13 +117,14 @@ export class UIActionHandler {
|
|
|
117
117
|
let tempContext = {};
|
|
118
118
|
const navContexts = action.getPSNavigateContexts() || [];
|
|
119
119
|
// 单项数据主键时,在导航参数开头加一个主键的导航参数,可以被配置的同名导航参数覆盖。
|
|
120
|
+
// 数据项名称替换主键的取值属性,参数项名称替换处理后主键在上下文的名称
|
|
120
121
|
const appDataEntity = action.getPSAppDataEntity();
|
|
122
|
+
const { valueItem, paramItem } = action;
|
|
121
123
|
if (appDataEntity && action.actionTarget === 'SINGLEKEY') {
|
|
122
124
|
await (appDataEntity === null || appDataEntity === void 0 ? void 0 : appDataEntity.fill(true));
|
|
123
125
|
const appDeName = appDataEntity.codeName.toLowerCase();
|
|
124
|
-
const { valueItem } = action;
|
|
125
126
|
navContexts.unshift({
|
|
126
|
-
key: appDeName,
|
|
127
|
+
key: paramItem || appDeName,
|
|
127
128
|
value: valueItem || 'srfkey',
|
|
128
129
|
rawValue: false,
|
|
129
130
|
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IBizContext } from '@ibiz-template/core';
|
|
2
|
+
import { IPSAppDEUIAction } from '@ibiz-template/model';
|
|
3
|
+
import { IUIActionResult } from '../../../interface';
|
|
4
|
+
import { UIActionHandler } from './ui-action-handler';
|
|
5
|
+
/**
|
|
6
|
+
* 工作流流程撤回界面行为处理器
|
|
7
|
+
*
|
|
8
|
+
* @author lxm
|
|
9
|
+
* @date 2022-10-25 15:10:20
|
|
10
|
+
* @export
|
|
11
|
+
* @class WFWithdrawUIActionHandler
|
|
12
|
+
* @extends {UIActionHandler}
|
|
13
|
+
*/
|
|
14
|
+
export declare class WFWithdrawUIActionHandler extends UIActionHandler {
|
|
15
|
+
execAction(action: IPSAppDEUIAction, context: IBizContext, data: IData[] | null, params: IParams, opts?: IData | undefined): Promise<IUIActionResult>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=wf-withdraw-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wf-withdraw-handler.d.ts","sourceRoot":"","sources":["../../../../src/utils/app-de-ui-action-util/handler/wf-withdraw-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;;;;;;;GAQG;AACH,qBAAa,yBAA0B,SAAQ,eAAe;IACtD,UAAU,CACd,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EACpB,MAAM,EAAE,OAAO,EACf,IAAI,CAAC,EAAE,KAAK,GAAG,SAAS,GACvB,OAAO,CAAC,eAAe,CAAC;CAe5B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { UIActionHandler } from './ui-action-handler';
|
|
2
|
+
/**
|
|
3
|
+
* 工作流流程撤回界面行为处理器
|
|
4
|
+
*
|
|
5
|
+
* @author lxm
|
|
6
|
+
* @date 2022-10-25 15:10:20
|
|
7
|
+
* @export
|
|
8
|
+
* @class WFWithdrawUIActionHandler
|
|
9
|
+
* @extends {UIActionHandler}
|
|
10
|
+
*/
|
|
11
|
+
export class WFWithdrawUIActionHandler extends UIActionHandler {
|
|
12
|
+
async execAction(action, context, data, params, opts) {
|
|
13
|
+
const isWithdraw = await ibiz.modal.confirm({
|
|
14
|
+
title: '提示',
|
|
15
|
+
desc: '是否确认执行撤回操作?',
|
|
16
|
+
});
|
|
17
|
+
let isCloseView = false;
|
|
18
|
+
if (isWithdraw && (opts === null || opts === void 0 ? void 0 : opts.neuron)) {
|
|
19
|
+
await opts.neuron.call.wfWithdraw(context, params, (data === null || data === void 0 ? void 0 : data[0]) || []);
|
|
20
|
+
isCloseView = true;
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
refresh: false,
|
|
24
|
+
closeView: isCloseView,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -50,11 +50,11 @@ export function convertNavDataByArray(naviDatas, ...origins) {
|
|
|
50
50
|
Object.prototype.hasOwnProperty.call(item, naviData.value));
|
|
51
51
|
});
|
|
52
52
|
if (findOrigin) {
|
|
53
|
-
result[naviData.key] = findOrigin[naviData.value];
|
|
53
|
+
result[naviData.key.toLowerCase()] = findOrigin[naviData.value];
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
else {
|
|
57
|
-
result[naviData.key] = naviData.value;
|
|
57
|
+
result[naviData.key.toLowerCase()] = naviData.value;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
return result;
|
|
@@ -84,11 +84,11 @@ export function convertNavDataByObject(naviData, ...origins) {
|
|
|
84
84
|
return Object.prototype.hasOwnProperty.call(item, valueKey);
|
|
85
85
|
});
|
|
86
86
|
if (findOrigin) {
|
|
87
|
-
result[key] = findOrigin[valueKey];
|
|
87
|
+
result[key.toLowerCase()] = findOrigin[valueKey];
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
else {
|
|
91
|
-
result[key] = naviData[key];
|
|
91
|
+
result[key.toLowerCase()] = naviData[key];
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
return result;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/runtime",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.16",
|
|
4
4
|
"description": "控制器包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -29,20 +29,19 @@
|
|
|
29
29
|
"author": "chitanda",
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@ibiz-template/command": "^0.0.1-beta.
|
|
32
|
+
"@ibiz-template/command": "^0.0.1-beta.30"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@ibiz-template/core": "^0.0.1-beta.
|
|
36
|
-
"@ibiz-template/model": "^0.0.1-beta.
|
|
37
|
-
"@ibiz-template/service": "^0.0.1-beta.
|
|
38
|
-
"@types/systemjs": "^6.
|
|
35
|
+
"@ibiz-template/core": "^0.0.1-beta.30",
|
|
36
|
+
"@ibiz-template/model": "^0.0.1-beta.30",
|
|
37
|
+
"@ibiz-template/service": "^0.0.1-beta.30",
|
|
38
|
+
"@types/systemjs": "^6.13.0",
|
|
39
39
|
"qx-util": "^0.4.4"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@ibiz-template/core": "^0.0.1-
|
|
43
|
-
"@ibiz-template/model": "^0.0.1-
|
|
44
|
-
"@ibiz-template/service": "^0.0.1-
|
|
42
|
+
"@ibiz-template/core": "^0.0.1-beta.30",
|
|
43
|
+
"@ibiz-template/model": "^0.0.1-beta.30",
|
|
44
|
+
"@ibiz-template/service": "^0.0.1-beta.30",
|
|
45
45
|
"qx-util": "^0.4.4"
|
|
46
|
-
}
|
|
47
|
-
"gitHead": "9514cbc720208af6160c67bc43e822262274da1f"
|
|
46
|
+
}
|
|
48
47
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IGlobalConfig } from '../interface/i-global-config/i-global-config';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 全局配置类,控制应用的功能开关。
|
|
5
|
+
*
|
|
6
|
+
* @author lxm
|
|
7
|
+
* @date 2022-12-09 14:12:28
|
|
8
|
+
* @export
|
|
9
|
+
* @class GlobalConfig
|
|
10
|
+
* @implements {IGlobalConfig}
|
|
11
|
+
*/
|
|
12
|
+
export class GlobalConfig implements IGlobalConfig {
|
|
13
|
+
enableDataInfoBar: boolean = true;
|
|
14
|
+
}
|
package/src/install.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { commands } from '@ibiz-template/command';
|
|
2
|
+
import { GlobalConfig } from './config/global-config';
|
|
2
3
|
import { RegisterCenter } from './register/register-center';
|
|
3
4
|
import { installCommand } from './command';
|
|
4
5
|
import { presetUIActionProvider } from './provider';
|
|
@@ -16,6 +17,8 @@ export function install(): void {
|
|
|
16
17
|
ibiz.commands = commands;
|
|
17
18
|
// 挂载注册中心
|
|
18
19
|
ibiz.register = new RegisterCenter();
|
|
20
|
+
// 初始化全局配置
|
|
21
|
+
ibiz.config = new GlobalConfig();
|
|
19
22
|
// 安装默认指令
|
|
20
23
|
installCommand();
|
|
21
24
|
// 注册预置的界面行为适配器
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 全局配置类,控制应用的功能开关。
|
|
3
|
+
*
|
|
4
|
+
* @author lxm
|
|
5
|
+
* @date 2022-12-09 14:12:44
|
|
6
|
+
* @export
|
|
7
|
+
* @interface IGlobalConfig
|
|
8
|
+
*/
|
|
9
|
+
export interface IGlobalConfig {
|
|
10
|
+
/**
|
|
11
|
+
* 是否启用信息栏
|
|
12
|
+
* - true:后才会识别模型的isShowDataInfoBar来控制是否显示信息栏
|
|
13
|
+
* - false:则一律不显示信息栏
|
|
14
|
+
*
|
|
15
|
+
* @author lxm
|
|
16
|
+
* @date 2022-12-09 14:12:13
|
|
17
|
+
* @type {boolean}
|
|
18
|
+
*/
|
|
19
|
+
enableDataInfoBar: boolean;
|
|
20
|
+
}
|
package/src/interface/index.ts
CHANGED
|
@@ -9,6 +9,8 @@ export { IModalOptions } from './i-modal-options/i-modal-options';
|
|
|
9
9
|
export { IPluginFactory } from './i-plugin-factory/i-plugin-factory';
|
|
10
10
|
export { IUIActionResult } from './i-ui-action-result/i-ui-action-result';
|
|
11
11
|
export { IUIActionHandler } from './i-ui-action-handler/i-ui-action-handler';
|
|
12
|
+
export { IGlobalConfig } from './i-global-config/i-global-config';
|
|
13
|
+
|
|
12
14
|
export * from './util';
|
|
13
15
|
export * from './provider';
|
|
14
16
|
export * from './register';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BackendUIActionProvider } from './backend-ui-action-provider';
|
|
2
2
|
import { CommonSysUIActionProvider } from './common-sys-ui-action-provider';
|
|
3
3
|
import { FrontUIActionProvider } from './front-ui-action-provider';
|
|
4
|
+
import { WFWithdrawUIActionProvider } from './wf-withdraw-ui-action-provider';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* 预置默认的界面行为适配器
|
|
@@ -41,10 +42,15 @@ export function presetUIActionProvider(): void {
|
|
|
41
42
|
uiAction.register('SYS_Refresh', new CommonSysUIActionProvider());
|
|
42
43
|
uiAction.register('SYS_Import', new CommonSysUIActionProvider());
|
|
43
44
|
uiAction.register('SYS_ExportExcel', new CommonSysUIActionProvider());
|
|
45
|
+
|
|
46
|
+
// 预置插件
|
|
47
|
+
// 工作流撤回
|
|
48
|
+
uiAction.register('DEUIACTION_WFWithdraw', new WFWithdrawUIActionProvider());
|
|
44
49
|
}
|
|
45
50
|
|
|
46
51
|
export {
|
|
47
52
|
FrontUIActionProvider,
|
|
48
53
|
CommonSysUIActionProvider,
|
|
49
54
|
BackendUIActionProvider,
|
|
55
|
+
WFWithdrawUIActionProvider,
|
|
50
56
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IUIActionHandler, IUIActionProvider } from '../../interface';
|
|
2
|
+
import { WFWithdrawUIActionHandler } from '../../utils';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 工作流流程撤回界面行为适配器
|
|
6
|
+
*
|
|
7
|
+
* @author lxm
|
|
8
|
+
* @date 2022-10-25 15:10:51
|
|
9
|
+
* @export
|
|
10
|
+
* @class WFWithdrawUIActionProvider
|
|
11
|
+
* @implements {IUIActionProvider}
|
|
12
|
+
*/
|
|
13
|
+
export class WFWithdrawUIActionProvider implements IUIActionProvider {
|
|
14
|
+
private handler?: IUIActionHandler;
|
|
15
|
+
|
|
16
|
+
async getHandler(): Promise<IUIActionHandler> {
|
|
17
|
+
if (!this.handler) {
|
|
18
|
+
this.handler = new WFWithdrawUIActionHandler();
|
|
19
|
+
}
|
|
20
|
+
return this.handler;
|
|
21
|
+
}
|
|
22
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
ILoadingUtil,
|
|
9
9
|
IPluginFactory,
|
|
10
10
|
IOverlayController,
|
|
11
|
+
IGlobalConfig,
|
|
11
12
|
} from './interface';
|
|
12
13
|
import { RegisterCenter } from './register/register-center';
|
|
13
14
|
|
|
@@ -89,5 +90,14 @@ declare module '@ibiz-template/core' {
|
|
|
89
90
|
* @type {Register}
|
|
90
91
|
*/
|
|
91
92
|
register: RegisterCenter;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* 全局配置
|
|
96
|
+
*
|
|
97
|
+
* @author lxm
|
|
98
|
+
* @date 2022-12-09 14:12:14
|
|
99
|
+
* @type {IGlobalConfig}
|
|
100
|
+
*/
|
|
101
|
+
config: IGlobalConfig;
|
|
92
102
|
}
|
|
93
103
|
}
|
|
@@ -177,13 +177,14 @@ export abstract class UIActionHandler implements IUIActionHandler {
|
|
|
177
177
|
const navContexts = action.getPSNavigateContexts() || [];
|
|
178
178
|
|
|
179
179
|
// 单项数据主键时,在导航参数开头加一个主键的导航参数,可以被配置的同名导航参数覆盖。
|
|
180
|
+
// 数据项名称替换主键的取值属性,参数项名称替换处理后主键在上下文的名称
|
|
180
181
|
const appDataEntity = action.getPSAppDataEntity();
|
|
182
|
+
const { valueItem, paramItem } = action;
|
|
181
183
|
if (appDataEntity && action.actionTarget === 'SINGLEKEY') {
|
|
182
184
|
await appDataEntity?.fill(true);
|
|
183
185
|
const appDeName = appDataEntity.codeName.toLowerCase();
|
|
184
|
-
const { valueItem } = action;
|
|
185
186
|
navContexts.unshift({
|
|
186
|
-
key: appDeName,
|
|
187
|
+
key: paramItem || appDeName,
|
|
187
188
|
value: valueItem || 'srfkey',
|
|
188
189
|
rawValue: false,
|
|
189
190
|
} as IPSNavigateContext);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IBizContext } from '@ibiz-template/core';
|
|
2
|
+
import { IPSAppDEUIAction } from '@ibiz-template/model';
|
|
3
|
+
import { IUIActionResult } from '../../../interface';
|
|
4
|
+
import { UIActionHandler } from './ui-action-handler';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 工作流流程撤回界面行为处理器
|
|
8
|
+
*
|
|
9
|
+
* @author lxm
|
|
10
|
+
* @date 2022-10-25 15:10:20
|
|
11
|
+
* @export
|
|
12
|
+
* @class WFWithdrawUIActionHandler
|
|
13
|
+
* @extends {UIActionHandler}
|
|
14
|
+
*/
|
|
15
|
+
export class WFWithdrawUIActionHandler extends UIActionHandler {
|
|
16
|
+
async execAction(
|
|
17
|
+
action: IPSAppDEUIAction,
|
|
18
|
+
context: IBizContext,
|
|
19
|
+
data: IData[] | null,
|
|
20
|
+
params: IParams,
|
|
21
|
+
opts?: IData | undefined,
|
|
22
|
+
): Promise<IUIActionResult> {
|
|
23
|
+
const isWithdraw = await ibiz.modal.confirm({
|
|
24
|
+
title: '提示',
|
|
25
|
+
desc: '是否确认执行撤回操作?',
|
|
26
|
+
});
|
|
27
|
+
let isCloseView = false;
|
|
28
|
+
if (isWithdraw && opts?.neuron) {
|
|
29
|
+
await opts!.neuron.call.wfWithdraw(context, params, data?.[0] || []);
|
|
30
|
+
isCloseView = true;
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
refresh: false,
|
|
34
|
+
closeView: isCloseView,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -60,10 +60,10 @@ export function convertNavDataByArray(
|
|
|
60
60
|
);
|
|
61
61
|
});
|
|
62
62
|
if (findOrigin) {
|
|
63
|
-
result[naviData.key] = findOrigin[naviData.value];
|
|
63
|
+
result[naviData.key.toLowerCase()] = findOrigin[naviData.value];
|
|
64
64
|
}
|
|
65
65
|
} else {
|
|
66
|
-
result[naviData.key] = naviData.value;
|
|
66
|
+
result[naviData.key.toLowerCase()] = naviData.value;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
return result;
|
|
@@ -95,10 +95,10 @@ export function convertNavDataByObject(naviData: IData, ...origins: IData[]) {
|
|
|
95
95
|
return Object.prototype.hasOwnProperty.call(item, valueKey);
|
|
96
96
|
});
|
|
97
97
|
if (findOrigin) {
|
|
98
|
-
result[key] = findOrigin[valueKey];
|
|
98
|
+
result[key.toLowerCase()] = findOrigin[valueKey];
|
|
99
99
|
}
|
|
100
100
|
} else {
|
|
101
|
-
result[key] = naviData[key];
|
|
101
|
+
result[key.toLowerCase()] = naviData[key];
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
return result;
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 千反田丷
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|