@ibiz-template/core 0.0.1-alpha.6 → 0.0.1-beta.130
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 -0
- package/out/constant/core/core.d.ts +9 -0
- package/out/constant/core/core.d.ts.map +1 -1
- package/out/constant/core/core.js +9 -0
- package/out/constant/index.d.ts +3 -0
- package/out/constant/index.d.ts.map +1 -1
- package/out/constant/index.js +3 -0
- package/out/constant/login-mode/login-mode.d.ts +23 -0
- package/out/constant/login-mode/login-mode.d.ts.map +1 -0
- package/out/constant/login-mode/login-mode.js +24 -0
- package/out/constant/menu-permission-mode/menu-permission-mode.d.ts +23 -0
- package/out/constant/menu-permission-mode/menu-permission-mode.d.ts.map +1 -0
- package/out/constant/menu-permission-mode/menu-permission-mode.js +24 -0
- package/out/constant/util/util.d.ts +5 -0
- package/out/constant/util/util.d.ts.map +1 -0
- package/out/constant/util/util.js +5 -0
- package/out/context/index.d.ts +49 -27
- package/out/context/index.d.ts.map +1 -1
- package/out/context/index.js +94 -55
- package/out/environment/environment.d.ts.map +1 -1
- package/out/environment/environment.js +16 -2
- package/out/error/http-error/http-error.d.ts.map +1 -1
- package/out/error/http-error/http-error.js +0 -4
- package/out/factory-center.d.ts +11 -0
- package/out/factory-center.d.ts.map +1 -0
- package/out/factory-center.js +10 -0
- package/out/ibizsys.d.ts +8 -1
- package/out/ibizsys.d.ts.map +1 -1
- package/out/ibizsys.js +8 -1
- package/out/index.d.ts +2 -1
- package/out/index.d.ts.map +1 -1
- package/out/index.js +2 -1
- package/out/install.d.ts.map +1 -1
- package/out/install.js +4 -2
- package/out/interface/click-outside/click-outside.d.ts +70 -0
- package/out/interface/click-outside/click-outside.d.ts.map +1 -0
- package/out/interface/click-outside/click-outside.js +1 -0
- package/out/interface/i-environment/i-environment.d.ts +108 -4
- package/out/interface/i-environment/i-environment.d.ts.map +1 -1
- package/out/interface/index.d.ts +1 -0
- package/out/interface/index.d.ts.map +1 -1
- package/out/interface/index.js +1 -1
- package/out/types.d.ts +41 -0
- package/out/types.d.ts.map +1 -1
- package/out/utils/click-outside/click-outside.d.ts +14 -0
- package/out/utils/click-outside/click-outside.d.ts.map +1 -0
- package/out/utils/click-outside/click-outside.js +85 -0
- package/out/utils/color/color.d.ts +13 -0
- package/out/utils/color/color.d.ts.map +1 -0
- package/out/utils/color/color.js +76 -0
- package/out/utils/download-file/download-file.d.ts +31 -0
- package/out/utils/download-file/download-file.d.ts.map +1 -0
- package/out/utils/download-file/download-file.js +107 -0
- package/out/utils/event/event.d.ts +34 -0
- package/out/utils/event/event.d.ts.map +1 -0
- package/out/utils/event/event.js +60 -0
- package/out/utils/index.d.ts +11 -1
- package/out/utils/index.d.ts.map +1 -1
- package/out/utils/index.js +11 -1
- package/out/utils/interceptor/core-interceptor.d.ts +15 -0
- package/out/utils/interceptor/core-interceptor.d.ts.map +1 -0
- package/out/utils/interceptor/core-interceptor.js +30 -0
- package/out/utils/interceptor/index.d.ts +3 -0
- package/out/utils/interceptor/index.d.ts.map +1 -0
- package/out/utils/interceptor/index.js +2 -0
- package/out/utils/interceptor/interceptor.d.ts +74 -3
- package/out/utils/interceptor/interceptor.d.ts.map +1 -1
- package/out/utils/interceptor/interceptor.js +73 -22
- package/out/utils/logger/logger.d.ts +3 -0
- package/out/utils/logger/logger.d.ts.map +1 -0
- package/out/utils/logger/logger.js +2 -0
- package/out/utils/net/http-response.d.ts +4 -9
- package/out/utils/net/http-response.d.ts.map +1 -1
- package/out/utils/net/http-response.js +0 -7
- package/out/utils/net/net.d.ts +98 -30
- package/out/utils/net/net.d.ts.map +1 -1
- package/out/utils/net/net.js +133 -38
- package/out/utils/plural/plural.d.ts.map +1 -1
- package/out/utils/plural/plural.js +2 -0
- package/out/utils/string-util/string-util.d.ts +46 -0
- package/out/utils/string-util/string-util.d.ts.map +1 -0
- package/out/utils/string-util/string-util.js +71 -0
- package/out/utils/sync/await-timeout.d.ts +14 -0
- package/out/utils/sync/await-timeout.d.ts.map +1 -0
- package/out/utils/sync/await-timeout.js +23 -0
- package/out/utils/sync/count-latch.d.ts +60 -0
- package/out/utils/sync/count-latch.d.ts.map +1 -0
- package/out/utils/sync/count-latch.js +90 -0
- package/out/utils/sync/index.d.ts +3 -0
- package/out/utils/sync/index.d.ts.map +1 -0
- package/out/utils/sync/index.js +2 -0
- package/out/utils/upload/select-file.d.ts +53 -0
- package/out/utils/upload/select-file.d.ts.map +1 -0
- package/out/utils/upload/select-file.js +47 -0
- package/out/utils/upload/upload-file.d.ts +46 -0
- package/out/utils/upload/upload-file.d.ts.map +1 -0
- package/out/utils/upload/upload-file.js +150 -0
- package/out/utils/url-helper/url-helper.d.ts +51 -0
- package/out/utils/url-helper/url-helper.d.ts.map +1 -0
- package/out/utils/url-helper/url-helper.js +59 -0
- package/out/utils/util/util.d.ts +20 -4
- package/out/utils/util/util.d.ts.map +1 -1
- package/out/utils/util/util.js +59 -5
- package/package.json +21 -10
- package/src/constant/core/core.ts +10 -0
- package/src/constant/index.ts +3 -0
- package/src/constant/login-mode/login-mode.ts +23 -0
- package/src/constant/menu-permission-mode/menu-permission-mode.ts +23 -0
- package/src/constant/util/util.ts +5 -0
- package/src/context/index.ts +127 -51
- package/src/environment/environment.ts +16 -2
- package/src/error/http-error/http-error.ts +0 -4
- package/src/factory-center.ts +9 -0
- package/src/ibizsys.ts +9 -1
- package/src/index.ts +2 -1
- package/src/install.ts +4 -2
- package/src/interface/click-outside/click-outside.ts +71 -0
- package/src/interface/i-environment/i-environment.ts +122 -4
- package/src/interface/index.ts +1 -0
- package/src/types.ts +45 -0
- package/src/utils/click-outside/click-outside.ts +110 -0
- package/src/utils/color/color.ts +84 -0
- package/src/utils/download-file/download-file.ts +109 -0
- package/src/utils/event/event.ts +77 -0
- package/src/utils/index.ts +11 -1
- package/src/utils/interceptor/core-interceptor.ts +35 -0
- package/src/utils/interceptor/index.ts +2 -0
- package/src/utils/interceptor/interceptor.ts +109 -22
- package/src/utils/logger/logger.ts +3 -0
- package/src/utils/net/http-response.ts +6 -9
- package/src/utils/net/net.ts +171 -50
- package/src/utils/plural/plural.ts +3 -0
- package/src/utils/string-util/string-util.ts +75 -0
- package/src/utils/sync/await-timeout.ts +27 -0
- package/src/utils/sync/count-latch.ts +96 -0
- package/src/utils/sync/index.ts +2 -0
- package/src/utils/upload/select-file.ts +86 -0
- package/src/utils/upload/upload-file.ts +206 -0
- package/src/utils/url-helper/url-helper.ts +62 -0
- package/src/utils/util/util.ts +72 -14
- package/LICENSE +0 -21
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["ramda","lodash-es","qx-util","axios","qs","pluralize"],(function(e){"use strict";var t,n,o,r,i,s,c,a,u,l,p,f;return{setters:[function(e){t=e.clone},function(e){n=e.debounce,o=e.merge,r=e.uniqueId,i=e.isFunction,s=e.round,c=e.cloneDeep},function(e){a=e.getCookie,u=e.notNilEmpty},function(e){l=e.default},function(e){p=e.stringify},function(e){f=e.default}],execute:function(){function h(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}e({awaitTimeout:function(e,t,n){return R(this,void 0,void 0,(function(){return x(this,(function(o){switch(o.label){case 0:return[4,new Promise((function(t){setTimeout((function(){t(!0)}),e)}))];case 1:return o.sent(),t?[2,t.apply(void 0,P([],k(n||[]),!1))]:[2]}}))}))},calcMimeByFileName:V,colorBlend:function(e,t,n,o){void 0===n&&(n=.5);void 0===o&&(o="hex");e=e.trim(),t=t.trim();var r=$(e),i=$(t),s=[D((1-n)*r[0]+n*i[0]),D((1-n)*r[1]+n*i[1]),D((1-n)*r[2]+n*i[2]),(1-n)*r[3]+n*i[3]];if("hex"===o){var c=[s[0].toString(16),s[1].toString(16),s[2].toString(16),0===s[3]?"00":D(255*s[3]).toString(16)];return"#".concat(c[0]).concat(c[1]).concat(c[2]).concat(c[3])}return"rgb(".concat(s[0]," ").concat(s[1]," ").concat(s[2]," / ").concat(s[3],")")},debounceAndAsyncMerge:function(e,t,o){var r,i=this,s=[],c=n((function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return R(i,void 0,void 0,(function(){var n,o;return x(this,(function(i){switch(i.label){case 0:r=void 0,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,e.apply(void 0,P([],k(t),!1))];case 2:return n=i.sent(),s.forEach((function(e){e.resolve(n)})),s=[],[2,n];case 3:return o=i.sent(),s.forEach((function(e){e.reject(o)})),s=[],[3,4];case 4:return[2]}}))}))}),o);return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return R(i,void 0,void 0,(function(){var n;return x(this,(function(o){return n=e,r&&(n=t(r,n)),r=n,c.apply(void 0,P([],k(n),!1)),[2,new Promise((function(e,t){s.push({resolve:e,reject:t})}))]}))}))}},debounceAndMerge:function(e,t,o){var r,i=n((function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r=void 0,e.apply(void 0,P([],k(t),!1))}),o);return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var o=e;return r&&(o=t(r,o)),r=o,i.apply(void 0,P([],k(o),!1))}},downloadFileFromBlob:function(e,t){var n=V(t),o=new Blob([e],{type:n}),r=URL.createObjectURL(o),i=document.createElement("a");i.href=r,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)},eventPath:q,fileListToArr:W,getToken:O,install:function(){if(window.ibiz)throw new Error("ibiz 已经存在, 无需重复安装");window.ibiz=new X,window.___fc=new Z,ibiz.net.addInterceptor("CoreInterceptor",new _)},isEventInside:F,isImage:function(e){var t=e.split(".").pop();if(!t)return!1;return[".jpeg","jpg","gif","png","bmp","svg"].includes(t)},isOverlap:function(e,t){return Array.from(new Set(P(P([],k(e),!1),k(t),!1))).length!==e.length+t.length},listenJSEvent:M,onClickOutside:function(e,t,n){void 0===n&&(n={});var o=n.window,r=void 0===o?B:o,i=n.ignore,s=void 0===i?[]:i,c=n.capture,a=void 0===c||c;if(!e)throw new w("target元素不存在");if(!r)throw new w("找不到window");var u,l=!0,p=function(t){return!P([e],k(s),!1).some((function(e){return F(t,e)}))},f=!1,h=function(e){f||(r.clearTimeout(u),l&&p(e)&&t(e))},d=[M(r,"click",h,{passive:!0,capture:a}),M(r,"pointerdown",(function(e){f||(l=p(e))}),{passive:!0}),M(r,"pointerup",(function(e){if(!f&&0===e.button){var t=q(e);e.composedPath=function(){return t},u=r.setTimeout((function(){return h(e)}),50)}}),{passive:!0})].filter(Boolean);return{stop:function(){return d.forEach((function(e){return e()}))},pause:function(){f=!0},proceed:function(){f=!1}}},plural:N,pluralLower:function(e){return N(e).toLowerCase()},selectFile:H,uploadFile:function(e){var t=this,n=o({multiple:!0,accept:"",separate:!0,beforeUpload:function(e,t){return!0},finish:function(e){},success:function(e,t){},error:function(e,t){},progress:function(e){}},e),a=function(e,o){return R(t,void 0,void 0,(function(){var t;return x(this,(function(r){switch(r.label){case 0:return n.request&&i(n.request)?[2,n.request(e)]:(t=new FormData,e.forEach((function(e){t.append("file",e)})),[4,ibiz.net.request(n.uploadUrl,{method:"post",baseURL:"",data:t,headers:{"Content-Type":"multipart/form-data"},onUploadProgress:o})]);case 1:return[2,r.sent()]}}))}))},u=function(e){return R(t,void 0,void 0,(function(){var t,o,i;return x(this,(function(u){switch(u.label){case 0:if(t=e.map((function(e){return{status:"uploading",name:e.name,uid:r(),percentage:0}})),!n.beforeUpload(e,t))return t.forEach((function(e){e.status="cancel"})),ibiz.log.debug("取消上传",t),[2,t];u.label=1;case 1:return u.trys.push([1,3,,4]),[4,a(e,(function(e){!function(e,t){t.forEach((function(t){t.percentage=s(100*e.progress)})),n.progress(c(t))}(e,t)}))];case 2:return o=u.sent(),t.forEach((function(e){e.status="finished"})),n.success(t,o),t.forEach((function(e){e.response=o})),[3,4];case 3:return i=u.sent(),t.forEach((function(e){e.status="fail"})),n.error(t,i),t.forEach((function(e){e.error=i})),ibiz.log.error(i),ibiz.log.error("".concat(e.map((function(e){return e.name})).join(","),"上传失败")),[3,4];case 4:return[2,t]}}))}))};H({accept:n.accept,multiple:n.multiple,onSelected:function(e){!function(e){R(t,void 0,void 0,(function(){var t,o,r,i=this;return x(this,(function(s){switch(s.label){case 0:return t=n.separate?e.map((function(e){return[e]})):[e],[4,Promise.allSettled(t.map((function(e){return R(i,void 0,void 0,(function(){return x(this,(function(t){return[2,u(e)]}))}))})))];case 1:return o=s.sent(),r=[],o.forEach((function(e){"fulfilled"===e.status&&r.push.apply(r,P([],k(e.value),!1))})),n.finish(r),[2]}}))}))}(e)}})}});var d,v,g=e("CoreConst",function(){function e(){}return e.DEFAULT_MODEL_SERVICE_TAG="default",e.TOKEN="access_token",e.TOKEN_EXPIRES="access_token_expires",e}()),y=e("NOOP",(function(){}));e("HttpStatusMessageConst",{200:"服务器成功返回请求的数据。",201:"新建或修改数据成功。",202:"一个请求已经进入后台排队(异步任务)。",204:"删除数据成功。",400:"发出的请求有错误,服务器没有进行新建或修改数据的操作。",401:"用户没有权限(令牌、用户名、密码错误)。",403:"用户得到授权,但是访问是被禁止的。",404:"发出的请求针对的是不存在的记录,服务器没有进行操作。",406:"请求的格式不可得。",410:"请求的资源被永久删除,且不会再得到的。",422:"当创建一个对象时,发生一个验证错误。",500:"服务器发生错误,请检查服务器。",502:"网关错误。",503:"服务不可用,服务器暂时过载或维护。",504:"网关超时。"});e("LoginMode",d),function(e){e.DEFAULT="DEFAULT",e.CUSTOM="CUSTOM",e.CAS="CAS"}(d||e("LoginMode",d={})),e("MenuPermissionMode",v),function(e){e.MIXIN="MIXIN",e.RESOURCE="RESOURCE",e.RT="RT"}(v||e("MenuPermissionMode",v={}));e("IBizContext",function(){function e(e,t){if(void 0===e&&(e={}),Object.defineProperty(this,"_associationContext",{enumerable:!1,value:[]}),t){var n=this;Object.defineProperty(this,"_parent",{enumerable:!1,writable:!0,value:t}),Object.defineProperty(this,"_context",{enumerable:!1,writable:!0,value:{}});var o={};Object.keys(t).forEach((function(e){o[e]={enumerable:!0,set:function(t){n._context[e]=null==t?null:t},get:function(){return void 0!==n._context[e]?n._context[e]:t[e]}}})),Object.defineProperties(this,o)}Object.assign(this,e)}return e.prototype.getOwnContext=function(){var e=this,t={};return Object.keys(this).forEach((function(n){e._parent&&Object.prototype.hasOwnProperty.call(e._parent,n)&&!Object.prototype.hasOwnProperty.call(e._context,n)||(t[n]=e[n])})),t},e.prototype.destroy=function(){this._parent=void 0,this._context={},this._associationContext.forEach((function(e){e.destroy()}))},e.prototype.clone=function(){var n=new e(t(this.getOwnContext()),this._parent);return this._associationContext.push(n),n},e.create=function(t,n){return new e(t,n)},e}());var m=e("Environment",{dev:!1,logLevel:"ERROR",jsCdn:"https://cdn.jsdelivr.net",baseUrl:"",pluginBaseUrl:"./plugins",remoteModelUrl:"/remotemodel",assetsUrl:"./assets",dcSystem:"",downloadFileUrl:"/ibizutil/download",uploadFileUrl:"/ibizutil/upload",casLoginUrl:"",loginMode:d.DEFAULT,menuPermissionMode:v.MIXIN,enablePermission:!0,enableWfAllHistory:!1,routePlaceholder:"-",loginViewName:"AppLoginView",version:"0.0.1",favicon:"./favicon.ico"}),b=e("HttpError",(function(e){this.name="HttpError";var t=e.response;this.response=e.response,t?(t.data?this.message=t.data.message:this.message=t.statusText,this.message||(this.message="网络异常,请稍后重试!"),this.status=t.status):(this.message=e.message,this.status=500)})),w=e("RuntimeError",(function(e){this.message=e,this.name="Runtime Error"})),E=function(e,t){return E=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])},E(e,t)};function R(e,t,n,o){return new(n||(n=Promise))((function(r,i){function s(e){try{a(o.next(e))}catch(e){i(e)}}function c(e){try{a(o.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,c)}a((o=o.apply(e,t||[])).next())}))}function x(e,t){var n,o,r,i,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[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(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(s=0)),s;)try{if(n=1,o&&(r=2&c[0]?o.return:c[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,c[1])).done)return r;switch(o=0,r&&(c=[2&c[0],r.value]),c[0]){case 0:case 1:r=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,o=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==c[0]&&2!==c[0])){s=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]<r[3])){s.label=c[1];break}if(6===c[0]&&s.label<r[1]){s.label=r[1],r=c;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(c);break}r[2]&&s.ops.pop(),s.trys.pop();continue}c=t.call(e,s)}catch(e){c=[6,e],o=0}finally{n=r=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}}function k(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return s}function P(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function O(){return a(g.TOKEN)}var C,T,j,L=e("Interceptor",function(){function e(){}return e.prototype.onBeforeRequest=function(e){return R(this,void 0,void 0,(function(){return x(this,(function(t){return[2,e]}))}))},e.prototype.onRequestError=function(e){return Promise.reject(e)},e.prototype.onResponseSuccess=function(e){return R(this,void 0,void 0,(function(){return x(this,(function(t){return[2,e]}))}))},e.prototype.onResponseError=function(e){return Promise.reject(e)},e.prototype.use=function(e){this.requestTag=e.interceptors.request.use(this.onBeforeRequest,this.onRequestError),this.responseTag=e.interceptors.response.use(this.onResponseSuccess,this.onResponseError)},e.prototype.eject=function(e){this.requestTag&&e.interceptors.request.eject(this.requestTag),this.responseTag&&e.interceptors.response.eject(this.responseTag)},e}()),_=e("CoreInterceptor",function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return function(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}E(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.onBeforeRequest=function(t){return R(this,void 0,void 0,(function(){var n;return x(this,(function(o){switch(o.label){case 0:return[4,e.prototype.onBeforeRequest.call(this,t)];case 1:return o.sent(),t.headers||(t.headers={}),t.headers.Authorization="Bearer ".concat(O()),(n=ibiz.orgData)&&(n.systemid&&(t.headers.srfsystemid=n.systemid),n.orgid&&(t.headers.srforgid=n.orgid)),[2,t]}}))}))},t}(L)),U="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},A={};T=U,j=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),o=["trace","debug","info","warn","error"];function r(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function i(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function s(o){return"debug"===o&&(o="log"),typeof console!==t&&("trace"===o&&n?i:void 0!==console[o]?r(console,o):void 0!==console.log?r(console,"log"):e)}function c(t,n){for(var r=0;r<o.length;r++){var i=o[r];this[i]=r<t?e:this.methodFactory(i,t,n)}this.log=this.debug}function a(e,n,o){return function(){typeof console!==t&&(c.call(this,n,o),this[e].apply(this,arguments))}}function u(e,t,n){return s(e)||a.apply(this,arguments)}function l(e,n,r){var i,s=this;n=null==n?"WARN":n;var a="loglevel";function l(){var e;if(typeof window!==t&&a){try{e=window.localStorage[a]}catch(e){}if(typeof e===t)try{var n=window.document.cookie,o=n.indexOf(encodeURIComponent(a)+"=");-1!==o&&(e=/^([^;]+)/.exec(n.slice(o))[1])}catch(e){}return void 0===s.levels[e]&&(e=void 0),e}}"string"==typeof e?a+=":"+e:"symbol"==typeof e&&(a=void 0),s.name=e,s.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},s.methodFactory=r||u,s.getLevel=function(){return i},s.setLevel=function(n,r){if("string"==typeof n&&void 0!==s.levels[n.toUpperCase()]&&(n=s.levels[n.toUpperCase()]),!("number"==typeof n&&n>=0&&n<=s.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(i=n,!1!==r&&function(e){var n=(o[e]||"silent").toUpperCase();if(typeof window!==t&&a){try{return void(window.localStorage[a]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(a)+"="+n+";"}catch(e){}}}(n),c.call(s,n,e),typeof console===t&&n<s.levels.SILENT)return"No console available for logging"},s.setDefaultLevel=function(e){n=e,l()||s.setLevel(e,!1)},s.resetLevel=function(){s.setLevel(n,!1),function(){if(typeof window!==t&&a){try{return void window.localStorage.removeItem(a)}catch(e){}try{window.document.cookie=encodeURIComponent(a)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}()},s.enableAll=function(e){s.setLevel(s.levels.TRACE,e)},s.disableAll=function(e){s.setLevel(s.levels.SILENT,e)};var p=l();null==p&&(p=n),s.setLevel(p,!1)}var p=new l,f={};p.getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=f[e];return t||(t=f[e]=new l(e,p.getLevel(),p.methodFactory)),t};var h=typeof window!==t?window.log:void 0;return p.noConflict=function(){return typeof window!==t&&window.log===p&&(window.log=h),p},p.getLoggers=function(){return f},p.default=p,p},(C={get exports(){return A},set exports(e){A=e}}).exports?C.exports=j():T.log=j();var S=h({__proto__:null,default:A},[A]);e("Logger",S);function I(e,t,n,o,r){var i="".concat(e,"-").concat(t);return n&&(i+="-".concat(n)),o&&(i+="__".concat(o)),r&&(i+="--".concat(r)),i}e("Namespace",function(){function e(e,t){this.block=e,this.namespace=t||"ibiz"}return e.prototype.b=function(e){return void 0===e&&(e=""),I(this.namespace,this.block,e,"","")},e.prototype.e=function(e){return e?I(this.namespace,this.block,"",e,""):""},e.prototype.m=function(e){return e?I(this.namespace,this.block,"","",e):""},e.prototype.be=function(e,t){return e&&t?I(this.namespace,this.block,e,t,""):""},e.prototype.em=function(e,t){return e&&t?I(this.namespace,this.block,"",e,t):""},e.prototype.bm=function(e,t){return e&&t?I(this.namespace,this.block,e,"",t):""},e.prototype.bem=function(e,t,n){return e&&t&&n?I(this.namespace,this.block,e,t,n):""},e.prototype.is=function(e,t){return e&&t?"".concat("is-").concat(e):""},e.prototype.cssVar=function(e){var t={};for(var n in e)e[n]&&(t[this.cssVarName(n)]=e[n]);return t},e.prototype.cssVarBlock=function(e){var t={};for(var n in e)e[n]&&(t[this.cssVarBlockName(n)]=e[n]);return t},e.prototype.cssVarName=function(e){return"--".concat(this.namespace,"-").concat(e)},e.prototype.cssVarBlockName=function(e){return"--".concat(this.namespace,"-").concat(this.block,"-").concat(e)},e}()),e("HttpResponse",(function(e,t,n){this.local=!0,this.ok=!1,this.headers={},this.config={},this.data=e,this.status=t||200,this.statusText=n||"",this.status>=200&&this.status<300&&(this.ok=!0)}));var z=e("Net",function(){function e(e){this.urlReg=/^http[s]?:\/\/[^\s]*/,this.interceptors=new Map,this.instance=l.create(e),this.addInterceptor("Default",new _)}return e.prototype.addInterceptor=function(e,t){t.use(this.instance),this.interceptors.set(e,t)},e.prototype.removeInterceptor=function(e){var t=this.interceptors.get(e);t&&(t.eject(this.instance),this.interceptors.delete(e))},Object.defineProperty(e.prototype,"presetConfig",{get:function(){return{baseURL:ibiz.env.baseUrl,headers:{"Content-Type":"application/json;charset=UTF-8",Accept:"application/json"}}},enumerable:!1,configurable:!0}),e.prototype.mergeConfig=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.presetConfig;if(0===e.length)return n;var r=e[0].url;return r&&this.urlReg.test(r)&&delete n.baseURL,o.apply(void 0,P([n],k(e),!1))},e.prototype.post=function(e,t,n,o){return void 0===n&&(n={}),void 0===o&&(o={}),R(this,void 0,void 0,(function(){var r,i;return x(this,(function(s){switch(s.label){case 0:e=this.handleAppPresetParam(e,n),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.request(e,{method:"post",data:t,headers:o})];case 2:return r=s.sent(),[2,this.doResponseResult(r)];case 3:throw i=s.sent(),new b(i);case 4:return[2]}}))}))},e.prototype.get=function(e,t,n,r){return void 0===t&&(t={}),void 0===n&&(n={}),void 0===r&&(r={}),R(this,void 0,void 0,(function(){var i,s;return x(this,(function(c){switch(c.label){case 0:e=this.attachUrlParam(e,t),c.label=1;case 1:return c.trys.push([1,3,,4]),[4,this.request(e,o({method:"get",headers:n},r))];case 2:return i=c.sent(),[2,this.doResponseResult(i)];case 3:throw s=c.sent(),new b(s);case 4:return[2]}}))}))},e.prototype.delete=function(e,t,n){return void 0===n&&(n={}),R(this,void 0,void 0,(function(){var o,r;return x(this,(function(i){switch(i.label){case 0:e=this.handleAppPresetParam(e,t),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.request(e,{method:"delete",headers:n})];case 2:return o=i.sent(),[2,this.doResponseResult(o)];case 3:throw r=i.sent(),new b(r);case 4:return[2]}}))}))},e.prototype.put=function(e,t,n,o){return void 0===n&&(n={}),void 0===o&&(o={}),R(this,void 0,void 0,(function(){var r,i;return x(this,(function(s){switch(s.label){case 0:e=this.handleAppPresetParam(e,n),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.request(e,{method:"put",data:t,headers:o})];case 2:return r=s.sent(),[2,this.doResponseResult(r)];case 3:throw i=s.sent(),new b(i);case 4:return[2]}}))}))},e.prototype.getModel=function(e,t){return void 0===t&&(t={}),R(this,void 0,void 0,(function(){var n,o;return x(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.instance.get(e,{headers:t})];case 1:return n=r.sent(),[2,this.doResponseResult(n)];case 2:throw o=r.sent(),new b(o);case 3:return[2]}}))}))},e.prototype.request=function(e,t){return void 0===t&&(t={}),R(this,void 0,void 0,(function(){var n,o;return x(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.instance.request(this.mergeConfig({url:e},t))];case 1:return n=r.sent(),[2,this.doResponseResult(n)];case 2:throw o=r.sent(),new b(o);case 3:return[2]}}))}))},e.prototype.axios=function(e){return l(e)},e.prototype.doResponseResult=function(e){var t=e;return t.status>=200&&t.status<=299&&(t.ok=!0),t},e.prototype.handleAppPresetParam=function(e,t){if(t){var n=Object.keys(t),o={};return n.forEach((function(e){e.startsWith("srf")&&u(t[e])&&(o[e]=t[e])})),this.attachUrlParam(e,t)}return e},e.prototype.attachUrlParam=function(e,t){var n=p(t);return u(n)&&(e=e.endsWith("?")||-1!==e.indexOf("?")&&e.endsWith("&")?"".concat(e).concat(n):-1===e.indexOf("?")||e.endsWith("&")?"".concat(e,"?").concat(n):"".concat(e,"&").concat(n)),e},e}());function N(e){return f(e)}f.addPluralRule(/(matr|vert|ind)ix|ex$/,"$1ices");e("UrlHelper",function(){function e(){}return Object.defineProperty(e,"routeBase",{get:function(){return"".concat(this.appBase,"/#")},enumerable:!1,configurable:!0}),Object.defineProperty(e,"appBase",{get:function(){var e=window.location,t=e.origin,n=e.pathname;return"".concat(t).concat(n).replace(/\/$/,"")},enumerable:!1,configurable:!0}),Object.defineProperty(e,"routePath",{get:function(){return window.location.hash.replace("#","")},enumerable:!1,configurable:!0}),Object.defineProperty(e,"fullPath",{get:function(){return window.location.href},enumerable:!1,configurable:!0}),e}());function q(e){var t=e.composedPath&&e.composedPath()||e.path;if(null!=t)return t;return[e.target].concat(function e(t,n){void 0===n&&(n=[]);var o=t.parentNode;return o?e(o,n.concat([o])):n}(e.target))}function M(e,t,n,o){void 0===o&&(o={}),e.addEventListener(t,n,o);var r=function(){e.removeEventListener(t,n,o),r=y};return function(){r()}}function F(e,t){return t&&(e.target===t||q(e).includes(t))}var B="undefined"!=typeof window?window:void 0;var D=Math.round;function $(e){var t=e.length,n=[];if("rgb"===e.slice(0,3).toLowerCase()){var o=e.match(/([\d|.%]{1,3})/g);n[0]=parseInt(o[0],10),n[1]=parseInt(o[1],10),n[2]=parseInt(o[2],10),n[3]=o[3]?-1!==o[3].indexOf("%")?parseInt(o[3],10)/100:parseFloat(o[3]):1}else{o=void 0;o=t<6?parseInt(String(e[1])+e[1]+e[2]+e[2]+e[3]+e[3]+(t>4?String(e[4])+e[4]:""),16):parseInt(e.slice(1),16),n[0]=o>>16&255,n[1]=o>>8&255,n[2]=255&o,n[3]=9===t||5===t?D((o>>24&255)/255*1e4)/1e4:1}return n}function V(e){var t="";switch(e.split(".").pop()){case".wps":t="application/kswps";break;case".doc":t="application/msword";break;case".docx":t="application/vnd.openxmlformats-officedocument.wordprocessingml.document";break;case".txt":t="text/plain";break;case".zip":t="application/zip";break;case".png":t="image/png";break;case".gif":t="image/gif";break;case".jpeg":case".jpg":t="image/jpeg";break;case".rtf":t="application/rtf";break;case".avi":t="video/x-msvideo";break;case".gz":t="application/x-gzip";break;case".tar":t="application/x-tar";break;case".xlsx":t="application/vnd.ms-excel";break;default:t=""}return t}function W(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t}function H(e){var t=o({multiple:!0,accept:""},e),n=document.createElement("input");n.setAttribute("type","file"),n.setAttribute("multiple","".concat(t.multiple)),n.setAttribute("accept",t.accept),n.onchange=function(e){var n=e.target,o=n.files?W(n.files):[];0!==o.length&&(t.onSelected(o),n.value="")},document.body.appendChild(n),n.click(),document.body.removeChild(n)}e("CountLatch",function(){function e(){this.promise=null,this.resolve=null,this.count=0}return e.prototype.startPromise=function(){var e=this;this.promise=new Promise((function(t){e.resolve=t}))},e.prototype.endPromise=function(){this.resolve&&(this.resolve(),this.resolve=null,this.promise=null)},e.prototype.lock=function(){this.count+=1,this.promise||this.startPromise()},e.prototype.unlock=function(){if(this.count<1)throw new w("lock和unlock次数不匹配!");this.count-=1,0===this.count&&this.endPromise()},e.prototype.await=function(){return R(this,void 0,void 0,(function(){return x(this,(function(e){switch(e.label){case 0:return this.promise?[4,this.promise]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))},e}()),e("StringUtil",function(){function e(){}return e.fill=function(e,t,n){if(u(e)){var o;if(u(t))null==(o=e.match(this.contextReg))||o.forEach((function(n){var o=n.slice(10,n.length-1);e=e.replace("${context.".concat(o,"}"),t[o]||"")}));if(u(n))null==(o=e.match(this.dataReg))||o.forEach((function(t){var o=t.slice(7,t.length-1);e=e.replace("${data.".concat(o,"}"),n[o]||"")}))}return e},e.dynamicMatch=function(e,t){return e.replace(/\${(.*?)}/g,(function(e,n){var o=k(n.split("."),2),r=o[0],i=o[1],s=t[r];return s?s[i]:""}))},e.contextReg=/\$\{context.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g,e.dataReg=/\$\{data.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g,e}());var X=e("IBizSys",(function(){this.env=m,this.log=S,this.net=new z})),Z=e("FactoryCenter",(function(){}))}}}));
|
|
@@ -19,5 +19,14 @@ export declare class CoreConst {
|
|
|
19
19
|
* @static
|
|
20
20
|
*/
|
|
21
21
|
static readonly TOKEN = "access_token";
|
|
22
|
+
/**
|
|
23
|
+
* 访问令牌标识过期时间
|
|
24
|
+
*
|
|
25
|
+
* @author lxm
|
|
26
|
+
* @date 2023-02-13 07:11:33
|
|
27
|
+
* @static
|
|
28
|
+
* @memberof CoreConst
|
|
29
|
+
*/
|
|
30
|
+
static readonly TOKEN_EXPIRES = "access_token_expires";
|
|
22
31
|
}
|
|
23
32
|
//# sourceMappingURL=core.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/constant/core/core.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,SAAS;IACpB;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,yBAAyB,aAAa;IAEtD;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,KAAK,kBAAkB;
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/constant/core/core.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,SAAS;IACpB;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,yBAAyB,aAAa;IAEtD;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,KAAK,kBAAkB;IAEvC;;;;;;;OAOG;IACH,MAAM,CAAC,QAAQ,CAAC,aAAa,0BAA0B;CACxD"}
|
|
@@ -20,3 +20,12 @@ CoreConst.DEFAULT_MODEL_SERVICE_TAG = 'default';
|
|
|
20
20
|
* @static
|
|
21
21
|
*/
|
|
22
22
|
CoreConst.TOKEN = 'access_token';
|
|
23
|
+
/**
|
|
24
|
+
* 访问令牌标识过期时间
|
|
25
|
+
*
|
|
26
|
+
* @author lxm
|
|
27
|
+
* @date 2023-02-13 07:11:33
|
|
28
|
+
* @static
|
|
29
|
+
* @memberof CoreConst
|
|
30
|
+
*/
|
|
31
|
+
CoreConst.TOKEN_EXPIRES = 'access_token_expires';
|
package/out/constant/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export { CoreConst } from './core/core';
|
|
2
|
+
export * from './util/util';
|
|
2
3
|
export { HttpStatusMessageConst } from './http-status-message/http-status-message';
|
|
4
|
+
export { LoginMode } from './login-mode/login-mode';
|
|
5
|
+
export { MenuPermissionMode } from './menu-permission-mode/menu-permission-mode';
|
|
3
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constant/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constant/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC"}
|
package/out/constant/index.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
export { CoreConst } from './core/core';
|
|
2
|
+
export * from './util/util';
|
|
2
3
|
export { HttpStatusMessageConst } from './http-status-message/http-status-message';
|
|
4
|
+
export { LoginMode } from './login-mode/login-mode';
|
|
5
|
+
export { MenuPermissionMode } from './menu-permission-mode/menu-permission-mode';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 登录模式
|
|
3
|
+
*
|
|
4
|
+
* @author lxm
|
|
5
|
+
* @date 2022-10-12 14:10:56
|
|
6
|
+
* @export
|
|
7
|
+
* @enum {number}
|
|
8
|
+
*/
|
|
9
|
+
export declare enum LoginMode {
|
|
10
|
+
/**
|
|
11
|
+
* 默认标准登录
|
|
12
|
+
*/
|
|
13
|
+
DEFAULT = "DEFAULT",
|
|
14
|
+
/**
|
|
15
|
+
* 自定义登录
|
|
16
|
+
*/
|
|
17
|
+
CUSTOM = "CUSTOM",
|
|
18
|
+
/**
|
|
19
|
+
* 中央认证登录
|
|
20
|
+
*/
|
|
21
|
+
CAS = "CAS"
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=login-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login-mode.d.ts","sourceRoot":"","sources":["../../../src/constant/login-mode/login-mode.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AACH,oBAAY,SAAS;IACnB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,MAAM,WAAW;IACjB;;OAEG;IACH,GAAG,QAAQ;CACZ"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* eslint-disable no-shadow */
|
|
2
|
+
/**
|
|
3
|
+
* 登录模式
|
|
4
|
+
*
|
|
5
|
+
* @author lxm
|
|
6
|
+
* @date 2022-10-12 14:10:56
|
|
7
|
+
* @export
|
|
8
|
+
* @enum {number}
|
|
9
|
+
*/
|
|
10
|
+
export var LoginMode;
|
|
11
|
+
(function (LoginMode) {
|
|
12
|
+
/**
|
|
13
|
+
* 默认标准登录
|
|
14
|
+
*/
|
|
15
|
+
LoginMode["DEFAULT"] = "DEFAULT";
|
|
16
|
+
/**
|
|
17
|
+
* 自定义登录
|
|
18
|
+
*/
|
|
19
|
+
LoginMode["CUSTOM"] = "CUSTOM";
|
|
20
|
+
/**
|
|
21
|
+
* 中央认证登录
|
|
22
|
+
*/
|
|
23
|
+
LoginMode["CAS"] = "CAS";
|
|
24
|
+
})(LoginMode || (LoginMode = {}));
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 菜单权限校验模式
|
|
3
|
+
*
|
|
4
|
+
* @author lxm
|
|
5
|
+
* @date 2022-10-12 14:10:56
|
|
6
|
+
* @export
|
|
7
|
+
* @enum {number}
|
|
8
|
+
*/
|
|
9
|
+
export declare enum MenuPermissionMode {
|
|
10
|
+
/**
|
|
11
|
+
* 混合模式(默认)
|
|
12
|
+
*/
|
|
13
|
+
MIXIN = "MIXIN",
|
|
14
|
+
/**
|
|
15
|
+
* 统一资源模式
|
|
16
|
+
*/
|
|
17
|
+
RESOURCE = "RESOURCE",
|
|
18
|
+
/**
|
|
19
|
+
* RT模式
|
|
20
|
+
*/
|
|
21
|
+
RT = "RT"
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=menu-permission-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-permission-mode.d.ts","sourceRoot":"","sources":["../../../src/constant/menu-permission-mode/menu-permission-mode.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AACH,oBAAY,kBAAkB;IAC5B;;OAEG;IACH,KAAK,UAAU;IACf;;OAEG;IACH,QAAQ,aAAa;IACrB;;OAEG;IACH,EAAE,OAAO;CACV"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* eslint-disable no-shadow */
|
|
2
|
+
/**
|
|
3
|
+
* 菜单权限校验模式
|
|
4
|
+
*
|
|
5
|
+
* @author lxm
|
|
6
|
+
* @date 2022-10-12 14:10:56
|
|
7
|
+
* @export
|
|
8
|
+
* @enum {number}
|
|
9
|
+
*/
|
|
10
|
+
export var MenuPermissionMode;
|
|
11
|
+
(function (MenuPermissionMode) {
|
|
12
|
+
/**
|
|
13
|
+
* 混合模式(默认)
|
|
14
|
+
*/
|
|
15
|
+
MenuPermissionMode["MIXIN"] = "MIXIN";
|
|
16
|
+
/**
|
|
17
|
+
* 统一资源模式
|
|
18
|
+
*/
|
|
19
|
+
MenuPermissionMode["RESOURCE"] = "RESOURCE";
|
|
20
|
+
/**
|
|
21
|
+
* RT模式
|
|
22
|
+
*/
|
|
23
|
+
MenuPermissionMode["RT"] = "RT";
|
|
24
|
+
})(MenuPermissionMode || (MenuPermissionMode = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/constant/util/util.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,eAAO,MAAM,IAAI,YAAW,CAAC"}
|
package/out/context/index.d.ts
CHANGED
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 上下文代理处理
|
|
3
|
-
*
|
|
4
|
-
* @author chitanda
|
|
5
|
-
* @date 2022-07-14 10:07:45
|
|
6
|
-
* @class IBizContextProxyHandle
|
|
7
|
-
* @implements {ProxyHandler<IBizContext>}
|
|
8
|
-
*/
|
|
9
|
-
export declare class IBizContextProxyHandle implements ProxyHandler<IBizContext> {
|
|
10
|
-
set(target: IBizContext, p: string | symbol, value: unknown): boolean;
|
|
11
|
-
get(target: IBizContext, p: string | symbol, _receiver: unknown): unknown;
|
|
12
|
-
}
|
|
13
1
|
/**
|
|
14
2
|
* 上下文处理类
|
|
15
3
|
*
|
|
@@ -19,41 +7,75 @@ export declare class IBizContextProxyHandle implements ProxyHandler<IBizContext>
|
|
|
19
7
|
* @class IBizContext
|
|
20
8
|
*/
|
|
21
9
|
export declare class IBizContext implements IContext {
|
|
22
|
-
context: IContext;
|
|
23
10
|
[key: string | symbol]: any;
|
|
24
11
|
/**
|
|
25
|
-
*
|
|
12
|
+
* clone 后引用的上下文实例,需要在实例销毁时,同时销毁
|
|
26
13
|
*
|
|
27
14
|
* @author chitanda
|
|
28
|
-
* @date
|
|
15
|
+
* @date 2023-03-13 16:03:31
|
|
29
16
|
* @protected
|
|
30
|
-
* @type {
|
|
17
|
+
* @type {IBizContext[]}
|
|
18
|
+
*/
|
|
19
|
+
protected _associationContext: IBizContext[];
|
|
20
|
+
/**
|
|
21
|
+
* 修改的父上下文
|
|
22
|
+
*
|
|
23
|
+
* @author lxm
|
|
24
|
+
* @date 2022-12-08 18:12:16
|
|
25
|
+
* @protected
|
|
26
|
+
* @type {IData}
|
|
27
|
+
*/
|
|
28
|
+
protected _context: IData;
|
|
29
|
+
/**
|
|
30
|
+
* 父的上下文源对象
|
|
31
|
+
*
|
|
32
|
+
* @author lxm
|
|
33
|
+
* @date 2022-12-08 18:12:31
|
|
34
|
+
* @type {IContext}
|
|
31
35
|
*/
|
|
32
|
-
|
|
36
|
+
_parent?: IContext;
|
|
33
37
|
/**
|
|
34
38
|
* Creates an instance of IBizContext.
|
|
35
39
|
*
|
|
36
40
|
* @author chitanda
|
|
37
41
|
* @date 2022-07-14 10:07:15
|
|
38
|
-
* @param {
|
|
39
|
-
* @param {
|
|
42
|
+
* @param {IData} [context={}] 自身的上下文
|
|
43
|
+
* @param {IContext} [parent]
|
|
44
|
+
*/
|
|
45
|
+
private constructor();
|
|
46
|
+
/**
|
|
47
|
+
* 返回自身的上下文,独有的和与父有差异的。
|
|
48
|
+
*
|
|
49
|
+
* @author lxm
|
|
50
|
+
* @date 2022-12-08 17:12:26
|
|
51
|
+
* @returns {*} {IData}
|
|
40
52
|
*/
|
|
41
|
-
|
|
53
|
+
getOwnContext(): IData;
|
|
42
54
|
/**
|
|
43
|
-
*
|
|
55
|
+
* 销毁当前上下文对象
|
|
44
56
|
*
|
|
45
57
|
* @author chitanda
|
|
46
|
-
* @date
|
|
47
|
-
|
|
58
|
+
* @date 2023-03-13 15:03:04
|
|
59
|
+
*/
|
|
60
|
+
destroy(): void;
|
|
61
|
+
/**
|
|
62
|
+
* 在非视图中,需要断开视图上下文联系时。只能使用 clone 创建新的局部上下文
|
|
63
|
+
*
|
|
64
|
+
* @author chitanda
|
|
65
|
+
* @date 2023-03-13 16:03:13
|
|
48
66
|
* @return {*} {IBizContext}
|
|
49
67
|
*/
|
|
50
|
-
|
|
68
|
+
clone(): IBizContext;
|
|
51
69
|
/**
|
|
52
|
-
*
|
|
70
|
+
* 上下文只有在视图初始化时,调用 create 方法
|
|
53
71
|
*
|
|
54
72
|
* @author chitanda
|
|
55
|
-
* @date
|
|
73
|
+
* @date 2023-03-13 16:03:32
|
|
74
|
+
* @static
|
|
75
|
+
* @param {IData} [context]
|
|
76
|
+
* @param {IContext} [parent]
|
|
77
|
+
* @return {*} {IContext}
|
|
56
78
|
*/
|
|
57
|
-
|
|
79
|
+
static create(context?: IData, parent?: IContext): IBizContext;
|
|
58
80
|
}
|
|
59
81
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,qBAAa,WAAY,YAAW,QAAQ;IAE1C,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;IAE5B;;;;;;;OAOG;IACH,UAAkB,mBAAmB,EAAE,WAAW,EAAE,CAAC;IAErD;;;;;;;OAOG;IACH,UAAkB,QAAQ,EAAE,KAAK,CAAC;IAElC;;;;;;OAMG;IACK,OAAO,CAAC,EAAE,QAAQ,CAAC;IAE3B;;;;;;;OAOG;IAEH,OAAO;IAkDP;;;;;;OAMG;IACH,aAAa,IAAI,KAAK;IAgBtB;;;;;OAKG;IACH,OAAO,IAAI,IAAI;IAQf;;;;;;OAMG;IACH,KAAK,IAAI,WAAW;IASpB;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,WAAW;CAG/D"}
|
package/out/context/index.js
CHANGED
|
@@ -1,34 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
/* eslint-disable no-constructor-return */
|
|
3
|
-
/* eslint-disable no-underscore-dangle */
|
|
4
|
-
/* eslint-disable max-classes-per-file */
|
|
5
|
-
/**
|
|
6
|
-
* 上下文代理处理
|
|
7
|
-
*
|
|
8
|
-
* @author chitanda
|
|
9
|
-
* @date 2022-07-14 10:07:45
|
|
10
|
-
* @class IBizContextProxyHandle
|
|
11
|
-
* @implements {ProxyHandler<IBizContext>}
|
|
12
|
-
*/
|
|
13
|
-
export class IBizContextProxyHandle {
|
|
14
|
-
set(target, p, value) {
|
|
15
|
-
target.context[p] = value;
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
get(target, p, _receiver) {
|
|
19
|
-
if (target[p] !== undefined) {
|
|
20
|
-
return target[p];
|
|
21
|
-
}
|
|
22
|
-
if (target.context[p] !== undefined) {
|
|
23
|
-
return target.context[p];
|
|
24
|
-
}
|
|
25
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
|
-
if (target._parent && target._parent[p] !== undefined) {
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
-
return target._parent[p];
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
import { clone } from 'ramda';
|
|
32
2
|
/**
|
|
33
3
|
* 上下文处理类
|
|
34
4
|
*
|
|
@@ -43,44 +13,113 @@ export class IBizContext {
|
|
|
43
13
|
*
|
|
44
14
|
* @author chitanda
|
|
45
15
|
* @date 2022-07-14 10:07:15
|
|
46
|
-
* @param {
|
|
47
|
-
* @param {
|
|
16
|
+
* @param {IData} [context={}] 自身的上下文
|
|
17
|
+
* @param {IContext} [parent]
|
|
48
18
|
*/
|
|
19
|
+
// eslint-disable-next-line default-param-last
|
|
49
20
|
constructor(context = {}, parent) {
|
|
50
|
-
this
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
* @author chitanda
|
|
55
|
-
* @date 2022-07-14 10:07:06
|
|
56
|
-
* @protected
|
|
57
|
-
* @type {(IBizContext | null)}
|
|
58
|
-
*/
|
|
59
|
-
this._parent = null;
|
|
21
|
+
Object.defineProperty(this, '_associationContext', {
|
|
22
|
+
enumerable: false,
|
|
23
|
+
value: [],
|
|
24
|
+
});
|
|
60
25
|
if (parent) {
|
|
61
|
-
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
27
|
+
const self = this;
|
|
28
|
+
// 定义私有变量,存放父上下文源对象
|
|
29
|
+
Object.defineProperty(this, '_parent', {
|
|
30
|
+
enumerable: false,
|
|
31
|
+
writable: true,
|
|
32
|
+
value: parent,
|
|
33
|
+
});
|
|
34
|
+
// 定义私有变量,用于存储对父已有上下文的修改。
|
|
35
|
+
Object.defineProperty(this, '_context', {
|
|
36
|
+
enumerable: false,
|
|
37
|
+
writable: true,
|
|
38
|
+
value: {},
|
|
39
|
+
});
|
|
40
|
+
// 监控父上下文参数,自身不存在时从父取
|
|
41
|
+
const properties = {};
|
|
42
|
+
const keys = Object.keys(parent);
|
|
43
|
+
keys.forEach(key => {
|
|
44
|
+
properties[key] = {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
set(val) {
|
|
47
|
+
if (val == null) {
|
|
48
|
+
self._context[key] = null;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
self._context[key] = val;
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
get() {
|
|
55
|
+
if (self._context[key] !== undefined) {
|
|
56
|
+
return self._context[key];
|
|
57
|
+
}
|
|
58
|
+
return parent[key];
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperties(this, properties);
|
|
62
63
|
}
|
|
63
|
-
|
|
64
|
+
// 合并给入上下文
|
|
65
|
+
Object.assign(this, context);
|
|
64
66
|
}
|
|
65
67
|
/**
|
|
66
|
-
*
|
|
68
|
+
* 返回自身的上下文,独有的和与父有差异的。
|
|
69
|
+
*
|
|
70
|
+
* @author lxm
|
|
71
|
+
* @date 2022-12-08 17:12:26
|
|
72
|
+
* @returns {*} {IData}
|
|
73
|
+
*/
|
|
74
|
+
getOwnContext() {
|
|
75
|
+
const result = {};
|
|
76
|
+
Object.keys(this).forEach(key => {
|
|
77
|
+
// 父没有的,或者修改了父的上下文
|
|
78
|
+
// 父不存在则返回所有自身的属性
|
|
79
|
+
if (!this._parent ||
|
|
80
|
+
!Object.prototype.hasOwnProperty.call(this._parent, key) ||
|
|
81
|
+
Object.prototype.hasOwnProperty.call(this._context, key)) {
|
|
82
|
+
result[key] = this[key];
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* 销毁当前上下文对象
|
|
89
|
+
*
|
|
90
|
+
* @author chitanda
|
|
91
|
+
* @date 2023-03-13 15:03:04
|
|
92
|
+
*/
|
|
93
|
+
destroy() {
|
|
94
|
+
this._parent = undefined;
|
|
95
|
+
this._context = {};
|
|
96
|
+
this._associationContext.forEach(item => {
|
|
97
|
+
item.destroy();
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* 在非视图中,需要断开视图上下文联系时。只能使用 clone 创建新的局部上下文
|
|
67
102
|
*
|
|
68
103
|
* @author chitanda
|
|
69
|
-
* @date
|
|
70
|
-
* @protected
|
|
104
|
+
* @date 2023-03-13 16:03:13
|
|
71
105
|
* @return {*} {IBizContext}
|
|
72
106
|
*/
|
|
73
|
-
|
|
74
|
-
|
|
107
|
+
clone() {
|
|
108
|
+
const newContext = new IBizContext(clone(this.getOwnContext()), this._parent);
|
|
109
|
+
this._associationContext.push(newContext);
|
|
110
|
+
return newContext;
|
|
75
111
|
}
|
|
76
112
|
/**
|
|
77
|
-
*
|
|
113
|
+
* 上下文只有在视图初始化时,调用 create 方法
|
|
78
114
|
*
|
|
79
115
|
* @author chitanda
|
|
80
|
-
* @date
|
|
116
|
+
* @date 2023-03-13 16:03:32
|
|
117
|
+
* @static
|
|
118
|
+
* @param {IData} [context]
|
|
119
|
+
* @param {IContext} [parent]
|
|
120
|
+
* @return {*} {IContext}
|
|
81
121
|
*/
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
this._parent = null;
|
|
122
|
+
static create(context, parent) {
|
|
123
|
+
return new IBizContext(context, parent);
|
|
85
124
|
}
|
|
86
125
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/environment/environment.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/environment/environment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,YAoBzB,CAAC"}
|
|
@@ -1,11 +1,25 @@
|
|
|
1
|
+
import { LoginMode, MenuPermissionMode } from '../constant';
|
|
1
2
|
/**
|
|
2
3
|
* 环境变量
|
|
3
4
|
*/
|
|
4
5
|
export const Environment = {
|
|
6
|
+
dev: false,
|
|
7
|
+
logLevel: 'ERROR',
|
|
8
|
+
jsCdn: 'https://cdn.jsdelivr.net',
|
|
5
9
|
baseUrl: '',
|
|
10
|
+
pluginBaseUrl: './plugins',
|
|
6
11
|
remoteModelUrl: '/remotemodel',
|
|
7
12
|
assetsUrl: './assets',
|
|
8
13
|
dcSystem: '',
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
downloadFileUrl: '/ibizutil/download',
|
|
15
|
+
uploadFileUrl: '/ibizutil/upload',
|
|
16
|
+
casLoginUrl: '',
|
|
17
|
+
loginMode: LoginMode.DEFAULT,
|
|
18
|
+
menuPermissionMode: MenuPermissionMode.MIXIN,
|
|
19
|
+
enablePermission: true,
|
|
20
|
+
enableWfAllHistory: false,
|
|
21
|
+
routePlaceholder: '-',
|
|
22
|
+
loginViewName: 'AppLoginView',
|
|
23
|
+
version: '0.0.1',
|
|
24
|
+
favicon: './favicon.ico',
|
|
11
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-error.d.ts","sourceRoot":"","sources":["../../../src/error/http-error/http-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"http-error.d.ts","sourceRoot":"","sources":["../../../src/error/http-error/http-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAElD;;;;;;;;GAQG;AACH,qBAAa,SAAU,YAAW,KAAK;IACrC,IAAI,EAAE,MAAM,CAAe;IAE3B,OAAO,EAAE,MAAM,CAAC;IAEhB,MAAM,EAAE,MAAM,CAAC;IAEf,QAAQ,CAAC,EAAE,aAAa,CAAC;gBAEb,GAAG,EAAE,UAAU;CAkB5B"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { HttpStatusMessageConst } from '../../constant';
|
|
2
1
|
/**
|
|
3
2
|
* 请求异常
|
|
4
3
|
*
|
|
@@ -20,9 +19,6 @@ export class HttpError {
|
|
|
20
19
|
else {
|
|
21
20
|
this.message = res.statusText;
|
|
22
21
|
}
|
|
23
|
-
if (!this.message) {
|
|
24
|
-
this.message = HttpStatusMessageConst[res.status];
|
|
25
|
-
}
|
|
26
22
|
if (!this.message) {
|
|
27
23
|
this.message = '网络异常,请稍后重试!';
|
|
28
24
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory-center.d.ts","sourceRoot":"","sources":["../src/factory-center.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,aAAa;CAAG"}
|
package/out/ibizsys.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OrgData } from './interface';
|
|
2
|
-
import { Net } from './utils';
|
|
2
|
+
import { Logger, Net } from './utils';
|
|
3
3
|
/**
|
|
4
4
|
* 全局对象
|
|
5
5
|
*
|
|
@@ -16,6 +16,13 @@ export declare class IBizSys {
|
|
|
16
16
|
* @date 2022-07-19 18:07:04
|
|
17
17
|
*/
|
|
18
18
|
env: import("./interface").IEnvironment;
|
|
19
|
+
/**
|
|
20
|
+
* 日志对象
|
|
21
|
+
*
|
|
22
|
+
* @author chitanda
|
|
23
|
+
* @date 2022-10-25 20:10:22
|
|
24
|
+
*/
|
|
25
|
+
log: Logger.RootLogger;
|
|
19
26
|
/**
|
|
20
27
|
* 网络请求工具类
|
|
21
28
|
*
|
package/out/ibizsys.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ibizsys.d.ts","sourceRoot":"","sources":["../src/ibizsys.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ibizsys.d.ts","sourceRoot":"","sources":["../src/ibizsys.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;;;GAOG;AACH,qBAAa,OAAO;IAClB;;;;;OAKG;IACH,GAAG,qCAAe;IAElB;;;;;OAKG;IACH,GAAG,oBAAU;IAEb;;;;;;OAMG;IACH,GAAG,EAAE,GAAG,CAAa;IAErB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB"}
|