@ibiz-template/core 0.0.3-beta.2 → 0.0.3-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- System.register(["lodash-es","qx-util","axios","qs","pluralize"],(function(t){"use strict";var e,n,r,o,i,s,a,c,u,l;return{setters:[function(t){e=t.debounce,n=t.merge,r=t.uniqueId,o=t.isFunction},function(t){i=t.getCookie,s=t.notNilEmpty},function(t){a=t.AxiosHeaders,c=t.default},function(t){u=t.stringify},function(t){l=t.default}],execute:function(){function f(t,e){return e.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(n){if("default"!==n&&!(n in t)){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}))})),Object.freeze(t)}t({calcMimeByFileName:J,colorBlend:function(t,e,n,r){void 0===n&&(n=.5);void 0===r&&(r="hex");t=t.trim(),e=e.trim();var o=X(t),i=X(e),s=[G((1-n)*o[0]+n*i[0]),G((1-n)*o[1]+n*i[1]),G((1-n)*o[2]+n*i[2]),(1-n)*o[3]+n*i[3]];if("hex"===r){var a=[s[0].toString(16),s[1].toString(16),s[2].toString(16),0===s[3]?"00":G(255*s[3]).toString(16)];return"#".concat(a[0]).concat(a[1]).concat(a[2]).concat(a[3])}return"rgb(".concat(s[0]," ").concat(s[1]," ").concat(s[2]," / ").concat(s[3],")")},debounce:function(t,e,n){var r;return function(){for(var o=this,i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];if(r&&clearTimeout(r),n){var a=!r;r=setTimeout((function(){r=null}),e),a&&t.apply(this,i)}else r=setTimeout((function(){t.apply(o,i)}),e)}},debounceAndAsyncMerge:function(t,n,r){var o,i=this,s=[],a=e((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return d(i,void 0,void 0,(function(){var n,r;return h(this,(function(i){switch(i.label){case 0:o=void 0,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,t.apply(void 0,m([],v(e),!1))];case 2:return n=i.sent(),s.forEach((function(t){t.resolve(n)})),s=[],[2,n];case 3:return r=i.sent(),s.forEach((function(t){t.reject(r)})),s=[],[3,4];case 4:return[2]}}))}))}),r);return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return d(i,void 0,void 0,(function(){var e;return h(this,(function(r){return e=t,o&&(e=n(o,e)),o=e,a.apply(void 0,m([],v(e),!1)),[2,new Promise((function(t,e){s.push({resolve:t,reject:e})}))]}))}))}},debounceAndMerge:function(t,n,r){var o,i=e((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return o=void 0,t.apply(void 0,m([],v(e),!1))}),r);return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t;return o&&(r=n(o,r)),o=r,i.apply(void 0,m([],v(r),!1))}},downloadFileFromBlob:function(t,e){var n=J(e),r=new Blob([t],{type:n}),o=URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o)},eventPath:D,fileListToArr:K,getToken:T,install:function(){if(window.ibiz)throw new Error("ibiz 已经存在, 无需重复安装");window.ibiz=new $,window.___fc=new Q},isEventInside:H,isImage:function(t){var e=t.split(".").pop();if(!e)return!1;return[".jpeg","jpg","gif","png","bmp","svg"].includes(e)},isOverlap:function(t,e){return Array.from(new Set(m(m([],v(t),!1),v(e),!1))).length!==t.length+e.length},listenJSEvent:V,onClickOutside:function(t,e,n){void 0===n&&(n={});var r=n.window,o=void 0===r?W:r,i=n.ignore,s=void 0===i?[]:i,a=n.capture,c=void 0===a||a;if(!t)throw new P("target元素不存在");if(!o)throw new P("找不到window");var u,l=!0,f=function(e){return!m([t],v(s),!1).some((function(t){return H(e,t)}))},p=!1,d=function(t){p||(o.clearTimeout(u),l&&f(t)&&e(t))},h=[V(o,"click",d,{passive:!0,capture:c}),V(o,"pointerdown",(function(t){p||(l=f(t))}),{passive:!0}),V(o,"pointerup",(function(t){if(!p&&0===t.button){var e=D(t);t.composedPath=function(){return e},u=o.setTimeout((function(){return d(t)}),50)}}),{passive:!0})].filter(Boolean);return{stop:function(){return h.forEach((function(t){return t()}))},pause:function(){p=!0},proceed:function(){p=!1}}},plural:B,pluralLower:function(t){return B(t).toLowerCase()},selectFile:Y,throttle:function(t,e){var n=null;return function(){for(var r=this,o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];n||(n=setTimeout((function(){t.apply(r,o),n=null}),e))}},toDisposable:w,uploadFile:function(t){var e=this,i=n({multiple:!0,accept:"",separate:!0,beforeUpload:function(t,e){return!0},finish:function(t){},success:function(t,e){},error:function(t,e){},progress:function(t){}},t),s=function(t,n){return d(e,void 0,void 0,(function(){var e;return h(this,(function(n){if(i.request&&o(i.request))return[2,i.request(t)];throw e=new FormData,t.forEach((function(t){e.append("file",t)})),new Error("多应用模式等待重新实现请求")}))}))},a=function(t){return d(e,void 0,void 0,(function(){var e,n,o;return h(this,(function(a){switch(a.label){case 0:if(e=t.map((function(t){return{status:"uploading",name:t.name,uid:r(),percentage:0}})),!i.beforeUpload(t,e))return e.forEach((function(t){t.status="cancel"})),ibiz.log.debug("取消上传",e),[2,e];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,s(t)];case 2:return n=a.sent(),e.forEach((function(t){t.status="finished"})),i.success(e,n),e.forEach((function(t){t.response=n})),[3,4];case 3:return o=a.sent(),e.forEach((function(t){t.status="fail"})),i.error(e,o),e.forEach((function(t){t.error=o})),ibiz.log.error(o),ibiz.log.error("".concat(t.map((function(t){return t.name})).join(","),"上传失败")),[3,4];case 4:return[2,e]}}))}))};Y({accept:i.accept,multiple:i.multiple,onSelected:function(t){!function(t){d(e,void 0,void 0,(function(){var e,n,r,o=this;return h(this,(function(s){switch(s.label){case 0:return e=i.separate?t.map((function(t){return[t]})):[t],[4,Promise.allSettled(e.map((function(t){return d(o,void 0,void 0,(function(){return h(this,(function(e){return[2,a(t)]}))}))})))];case 1:return n=s.sent(),r=[],n.forEach((function(t){"fulfilled"===t.status&&r.push.apply(r,m([],v(t.value),!1))})),i.finish(r),[2]}}))}))}(t)}})}});var p=function(t,e){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},p(t,e)};function d(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))}function h(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function v(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function m(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var y=function(){function t(e){this.element=e,this.next=t.Undefined,this.prev=t.Undefined}return t.Undefined=new t(void 0),t}(),g=t("LinkedList",function(){function t(){this._first=y.Undefined,this._last=y.Undefined,this._size=0}return Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),t.prototype.isEmpty=function(){return this._first===y.Undefined},t.prototype.clear=function(){for(var t=this._first;t!==y.Undefined;){var e=t.next;t.prev=y.Undefined,t.next=y.Undefined,t=e}this._first=y.Undefined,this._last=y.Undefined,this._size=0},t.prototype.unshift=function(t){return this._insert(t,!1)},t.prototype.push=function(t){return this._insert(t,!0)},t.prototype._insert=function(t,e){var n=this,r=new y(t);if(this._first===y.Undefined)this._first=r,this._last=r;else if(e){var o=this._last;this._last=r,r.prev=o,o.next=r}else{var i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;var s=!1;return function(){s||(s=!0,n._remove(r))}},t.prototype.shift=function(){if(this._first!==y.Undefined){var t=this._first.element;return this._remove(this._first),t}},t.prototype.pop=function(){if(this._last!==y.Undefined){var t=this._last.element;return this._remove(this._last),t}},t.prototype._remove=function(t){if(t.prev!==y.Undefined&&t.next!==y.Undefined){var e=t.prev;e.next=t.next,t.next.prev=e}else t.prev===y.Undefined&&t.next===y.Undefined?(this._first=y.Undefined,this._last=y.Undefined):t.next===y.Undefined?(this._last=this._last.prev,this._last.next=y.Undefined):t.prev===y.Undefined&&(this._first=this._first.next,this._first.prev=y.Undefined);this._size-=1},t.prototype[Symbol.iterator]=function(){var t;return h(this,(function(e){switch(e.label){case 0:t=this._first,e.label=1;case 1:return t===y.Undefined?[3,3]:[4,t.element];case 2:return e.sent(),t=t.next,[3,1];case 3:return[2]}}))},t}());function b(t){var e,n=this,r=!1;return function(){return r?e:(r=!0,e=t.apply(n,arguments))}}function w(t){return{dispose:b((function(){t()}))}}var _,E,U=t("CommandsRegistry",function(){function t(){this.commands=new Map}return t.prototype.registerCommand=function(t,e,n){var r=this;if(!t)throw new Error("invalid command");if("string"==typeof t){if(!e)throw new Error("invalid command");return this.registerCommand({id:t,handler:e,opts:n})}var o=t.id,i=this.commands.get(o);i||(i=new g,this.commands.set(o,i));var s=i.unshift(t);return w((function(){s();var t=r.commands.get(o);(null==t?void 0:t.isEmpty())&&r.commands.delete(o)}))},t.prototype.hasCommand=function(t){return this.commands.has(t)},t.prototype.getCommand=function(t){var e=this.commands.get(t);if(e&&!e.isEmpty())return e[Symbol.iterator]().next().value},t.prototype.getCommands=function(){var t,e,n=new Map,r=this.commands.keys();try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(r),i=o.next();!i.done;i=o.next()){var s=i.value,a=this.getCommand(s);a&&n.set(s,a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return n},t.prototype.getCommandOpt=function(t){var e=this.getCommand(t);return null==e?void 0:e.opts},t}()),x=t("CommandController",function(){function t(){this.commandRegister=new U}return t.prototype.register=function(t,e,n){return this.commandRegister.registerCommand(t,e,n)},t.prototype.execute=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return d(this,void 0,void 0,(function(){var n;return h(this,(function(r){if(n=this.commandRegister.getCommand(t))return[2,n.handler.apply(n,m([],v(e),!1))];throw new Error("未注册指令: ".concat(t,",请先注册指令"))}))}))},t.prototype.hasCommand=function(t,e){var n=!!this.commandRegister.hasCommand(t);if(!0===e&&!0===n)throw new Error("未注册指令: ".concat(t,",请先注册指令"));return n},t.prototype.getCommandOpts=function(t){return this.commandRegister.getCommandOpt(t)},t}()),R=(t("commands",new x),t("CoreConst",function(){function t(){}return t.DEFAULT_MODEL_SERVICE_TAG="default",t.TOKEN="access_token",t}())),C=t("NOOP",(function(){}));t("HttpStatusMessageConst",{200:"服务器成功返回请求的数据。",201:"新建或修改数据成功。",202:"一个请求已经进入后台排队(异步任务)。",204:"删除数据成功。",400:"发出的请求有错误,服务器没有进行新建或修改数据的操作。",401:"用户没有权限(令牌、用户名、密码错误)。",403:"用户得到授权,但是访问是被禁止的。",404:"发出的请求针对的是不存在的记录,服务器没有进行操作。",406:"请求的格式不可得。",410:"请求的资源被永久删除,且不会再得到的。",422:"当创建一个对象时,发生一个验证错误。",500:"服务器发生错误,请检查服务器。",502:"网关错误。",503:"服务不可用,服务器暂时过载或维护。",504:"网关超时。"});t("LoginMode",_),function(t){t.DEFAULT="DEFAULT",t.CUSTOM="CUSTOM",t.CAS="CAS"}(_||t("LoginMode",_={})),t("MenuPermissionMode",E),function(t){t.MIXIN="MIXIN",t.RESOURCE="RESOURCE",t.RT="RT"}(E||t("MenuPermissionMode",E={}));t("IBizContext",function(){function t(t,e){if(void 0===t&&(t={}),e){var n=this;Object.defineProperty(this,"_parent",{enumerable:!1,value:e}),Object.defineProperty(this,"_context",{enumerable:!1,value:{}});var r={};Object.keys(e).forEach((function(t){r[t]={enumerable:!0,set:function(e){n._context[t]=null==e?null:e},get:function(){return void 0!==n._context[t]?n._context[t]:e[t]}}})),Object.defineProperties(this,r)}Object.assign(this,t)}return t.prototype.getOwnContext=function(){var t=this,e={};return Object.keys(this).forEach((function(n){t._parent&&Object.prototype.hasOwnProperty.call(t._parent,n)&&!Object.prototype.hasOwnProperty.call(t._context,n)||(e[n]=t[n])})),e},t}());var k=t("Environment",{dev:!1,hub:!0,logLevel:"ERROR",baseUrl:"/api",appId:"",pluginBaseUrl:"./plugins",remoteModelUrl:"/remotemodel",assetsUrl:"./assets",dcSystem:"",downloadFileUrl:"/ibizutil/download",uploadFileUrl:"/ibizutil/upload",casLoginUrl:"",loginMode:_.DEFAULT,menuPermissionMode:E.MIXIN,enablePermission:!0,routePlaceholder:"-"}),O=t("HttpError",(function(t){this.name="HttpError";var e=t.response;this.response=t.response,e?(e.data?this.message=e.data.message:this.message=e.statusText,this.message||(this.message="网络异常,请稍后重试!"),this.status=e.status):(this.message=t.message,this.status=500)})),P=t("RuntimeError",(function(t){this.message=t,this.name="Runtime Error"}));function T(){return i(R.TOKEN)}var L,S,j,I=t("Interceptor",function(){function t(){}return t.prototype.onBeforeRequest=function(t){return d(this,void 0,void 0,(function(){return h(this,(function(e){return[2,t]}))}))},t.prototype.onRequestError=function(t){return Promise.reject(t)},t.prototype.onResponseSuccess=function(t){return d(this,void 0,void 0,(function(){return h(this,(function(e){return[2,t]}))}))},t.prototype.onResponseError=function(t){return Promise.reject(t)},t.prototype.use=function(t){this.requestTag=t.interceptors.request.use(this.onBeforeRequest,this.onRequestError),this.responseTag=t.interceptors.response.use(this.onResponseSuccess,this.onResponseError)},t.prototype.eject=function(t){this.requestTag&&t.interceptors.request.eject(this.requestTag),this.responseTag&&t.interceptors.response.eject(this.responseTag)},t}()),A=t("CoreInterceptor",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.onBeforeRequest=function(e){return d(this,void 0,void 0,(function(){var n,r;return h(this,(function(o){switch(o.label){case 0:return[4,t.prototype.onBeforeRequest.call(this,e)];case 1:return o.sent(),(n=e.headers).set("Authorization","Bearer ".concat(T())),(r=ibiz.orgData)&&(r.systemid&&n.set("srfsystemid",r.systemid),r.orgid&&n.set("srforgid",r.orgid)),[2,e]}}))}))},e}(I)),z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},M={};S=z,j=function(){var t=function(){},e="undefined",n=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"];function o(t,e){var n=t[e];if("function"==typeof n.bind)return n.bind(t);try{return Function.prototype.bind.call(n,t)}catch(e){return function(){return Function.prototype.apply.apply(n,[t,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(r){return"debug"===r&&(r="log"),typeof console!==e&&("trace"===r&&n?i:void 0!==console[r]?o(console,r):void 0!==console.log?o(console,"log"):t)}function a(e,n){for(var o=0;o<r.length;o++){var i=r[o];this[i]=o<e?t:this.methodFactory(i,e,n)}this.log=this.debug}function c(t,n,r){return function(){typeof console!==e&&(a.call(this,n,r),this[t].apply(this,arguments))}}function u(t,e,n){return s(t)||c.apply(this,arguments)}function l(t,n,o){var i,s=this;n=null==n?"WARN":n;var c="loglevel";function l(){var t;if(typeof window!==e&&c){try{t=window.localStorage[c]}catch(t){}if(typeof t===e)try{var n=window.document.cookie,r=n.indexOf(encodeURIComponent(c)+"=");-1!==r&&(t=/^([^;]+)/.exec(n.slice(r))[1])}catch(t){}return void 0===s.levels[t]&&(t=void 0),t}}"string"==typeof t?c+=":"+t:"symbol"==typeof t&&(c=void 0),s.name=t,s.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},s.methodFactory=o||u,s.getLevel=function(){return i},s.setLevel=function(n,o){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!==o&&function(t){var n=(r[t]||"silent").toUpperCase();if(typeof window!==e&&c){try{return void(window.localStorage[c]=n)}catch(t){}try{window.document.cookie=encodeURIComponent(c)+"="+n+";"}catch(t){}}}(n),a.call(s,n,t),typeof console===e&&n<s.levels.SILENT)return"No console available for logging"},s.setDefaultLevel=function(t){n=t,l()||s.setLevel(t,!1)},s.resetLevel=function(){s.setLevel(n,!1),function(){if(typeof window!==e&&c){try{return void window.localStorage.removeItem(c)}catch(t){}try{window.document.cookie=encodeURIComponent(c)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(t){}}}()},s.enableAll=function(t){s.setLevel(s.levels.TRACE,t)},s.disableAll=function(t){s.setLevel(s.levels.SILENT,t)};var f=l();null==f&&(f=n),s.setLevel(f,!1)}var f=new l,p={};f.getLogger=function(t){if("symbol"!=typeof t&&"string"!=typeof t||""===t)throw new TypeError("You must supply a name when creating a logger.");var e=p[t];return e||(e=p[t]=new l(t,f.getLevel(),f.methodFactory)),e};var d=typeof window!==e?window.log:void 0;return f.noConflict=function(){return typeof window!==e&&window.log===f&&(window.log=d),f},f.getLoggers=function(){return p},f.default=f,f},(L={get exports(){return M},set exports(t){M=t}}).exports?L.exports=j():S.log=j();var q=f({__proto__:null,default:M},[M]);t("Logger",q);function F(t,e,n,r,o){var i="".concat(t,"-").concat(e);return n&&(i+="-".concat(n)),r&&(i+="__".concat(r)),o&&(i+="--".concat(o)),i}t("Namespace",function(){function t(t,e){this.block=t,this.namespace=e||"ibiz"}return t.prototype.b=function(t){return void 0===t&&(t=""),F(this.namespace,this.block,t,"","")},t.prototype.e=function(t){return t?F(this.namespace,this.block,"",t,""):""},t.prototype.m=function(t){return t?F(this.namespace,this.block,"","",t):""},t.prototype.be=function(t,e){return t&&e?F(this.namespace,this.block,t,e,""):""},t.prototype.em=function(t,e){return t&&e?F(this.namespace,this.block,"",t,e):""},t.prototype.bm=function(t,e){return t&&e?F(this.namespace,this.block,t,"",e):""},t.prototype.bem=function(t,e,n){return t&&e&&n?F(this.namespace,this.block,t,e,n):""},t.prototype.is=function(t,e){return t&&e?"".concat("is-").concat(t):""},t.prototype.cssVar=function(t){var e={};for(var n in t)t[n]&&(e[this.cssVarName(n)]=t[n]);return e},t.prototype.cssVarBlock=function(t){var e={};for(var n in t)t[n]&&(e[this.cssVarBlockName(n)]=t[n]);return e},t.prototype.cssVarName=function(t){return"--".concat(this.namespace,"-").concat(t)},t.prototype.cssVarBlockName=function(t){return"--".concat(this.namespace,"-").concat(this.block,"-").concat(t)},t}()),t("HttpResponse",(function(t,e,n){this.local=!0,this.ok=!1,this.headers={},this.config={headers:new a},this.data=t,this.status=e||200,this.statusText=n||"",this.status>=200&&this.status<300&&(this.ok=!0)}));var N=t("Net",function(){function t(t){this.interceptors=new Map,this.instance=c.create(t),this.addInterceptor("Default",new A)}return t.prototype.addInterceptor=function(t,e){e.use(this.instance),this.interceptors.set(t,e)},t.prototype.removeInterceptor=function(t){var e=this.interceptors.get(t);e&&(e.eject(this.instance),this.interceptors.delete(t))},Object.defineProperty(t.prototype,"presetConfig",{get:function(){return{baseURL:this.instance.defaults.baseURL||"".concat(ibiz.env.baseUrl,"/").concat(ibiz.env.appId),headers:{"Content-Type":"application/json;charset=UTF-8",Accept:"application/json"}}},enumerable:!1,configurable:!0}),t.prototype.mergeConfig=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this.presetConfig:n.apply(void 0,m([this.presetConfig],v(t),!1))},t.prototype.post=function(t,e,n,r){return void 0===n&&(n={}),void 0===r&&(r={}),d(this,void 0,void 0,(function(){var o,i;return h(this,(function(s){switch(s.label){case 0:t=this.handleAppPresetParam(t,n),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.request(t,{method:"post",data:e,headers:r})];case 2:return o=s.sent(),[2,this.doResponseResult(o)];case 3:throw i=s.sent(),new O(i);case 4:return[2]}}))}))},t.prototype.get=function(t,e,r,o){return void 0===e&&(e={}),void 0===r&&(r={}),void 0===o&&(o={}),d(this,void 0,void 0,(function(){var i,s;return h(this,(function(a){switch(a.label){case 0:t=this.attachUrlParam(t,e),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.request(t,n({method:"get",headers:r},o))];case 2:return i=a.sent(),[2,this.doResponseResult(i)];case 3:throw s=a.sent(),new O(s);case 4:return[2]}}))}))},t.prototype.delete=function(t,e,n){return void 0===n&&(n={}),d(this,void 0,void 0,(function(){var r,o;return h(this,(function(i){switch(i.label){case 0:t=this.handleAppPresetParam(t,e),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.request(t,{method:"delete",headers:n})];case 2:return r=i.sent(),[2,this.doResponseResult(r)];case 3:throw o=i.sent(),new O(o);case 4:return[2]}}))}))},t.prototype.put=function(t,e,n,r){return void 0===n&&(n={}),void 0===r&&(r={}),d(this,void 0,void 0,(function(){var o,i;return h(this,(function(s){switch(s.label){case 0:t=this.handleAppPresetParam(t,n),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.request(t,{method:"put",data:e,headers:r})];case 2:return o=s.sent(),[2,this.doResponseResult(o)];case 3:throw i=s.sent(),new O(i);case 4:return[2]}}))}))},t.prototype.getModel=function(t,e){return void 0===e&&(e={}),d(this,void 0,void 0,(function(){var n,r;return h(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.instance.get(t,{headers:e})];case 1:return n=o.sent(),[2,this.doResponseResult(n)];case 2:throw r=o.sent(),new O(r);case 3:return[2]}}))}))},t.prototype.request=function(t,e){return void 0===e&&(e={}),d(this,void 0,void 0,(function(){var n,r;return h(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.instance.request(this.mergeConfig({url:t},e))];case 1:return n=o.sent(),[2,this.doResponseResult(n)];case 2:throw r=o.sent(),new O(r);case 3:return[2]}}))}))},t.prototype.doResponseResult=function(t){var e=t;return e.status>=200&&e.status<=299&&(e.ok=!0),e},t.prototype.handleAppPresetParam=function(t,e){if(e){var n=Object.keys(e),r={};return n.forEach((function(t){t.startsWith("srf")&&s(e[t])&&(r[t]=e[t])})),this.attachUrlParam(t,e)}return t},t.prototype.attachUrlParam=function(t,e){var n=u(e);return s(n)&&(t=t.endsWith("?")||-1!==t.indexOf("?")&&t.endsWith("&")?"".concat(t).concat(n):-1===t.indexOf("?")||t.endsWith("&")?"".concat(t,"?").concat(n):"".concat(t,"&").concat(n)),t},t}());function B(t){return l(t)}t("UrlHelper",function(){function t(){}return Object.defineProperty(t,"routeBase",{get:function(){return"".concat(this.appBase,"/#")},enumerable:!1,configurable:!0}),Object.defineProperty(t,"appBase",{get:function(){var t=window.location,e=t.origin,n=t.pathname;return"".concat(e).concat(n).replace(/\/$/,"")},enumerable:!1,configurable:!0}),Object.defineProperty(t,"routePath",{get:function(){return window.location.hash.replace("#","")},enumerable:!1,configurable:!0}),Object.defineProperty(t,"fullPath",{get:function(){return window.location.href},enumerable:!1,configurable:!0}),t}());function D(t){var e=t.composedPath&&t.composedPath()||t.path;if(null!=e)return e;return[t.target].concat(function t(e,n){void 0===n&&(n=[]);var r=e.parentNode;return r?t(r,n.concat([r])):n}(t.target))}function V(t,e,n,r){void 0===r&&(r={}),t.addEventListener(e,n,r);var o=function(){t.removeEventListener(e,n,r),o=C};return function(){o()}}function H(t,e){return e&&(t.target===e||D(t).includes(e))}var W="undefined"!=typeof window?window:void 0;var G=Math.round;function X(t){var e=t.length,n=[];if("rgb"===t.slice(0,3).toLowerCase()){var r=t.match(/([\d|.%]{1,3})/g);n[0]=parseInt(r[0],10),n[1]=parseInt(r[1],10),n[2]=parseInt(r[2],10),n[3]=r[3]?-1!==r[3].indexOf("%")?parseInt(r[3],10)/100:parseFloat(r[3]):1}else{r=void 0;r=e<6?parseInt(String(t[1])+t[1]+t[2]+t[2]+t[3]+t[3]+(e>4?String(t[4])+t[4]:""),16):parseInt(t.slice(1),16),n[0]=r>>16&255,n[1]=r>>8&255,n[2]=255&r,n[3]=9===e||5===e?G((r>>24&255)/255*1e4)/1e4:1}return n}function J(t){var e="";switch(t.split(".").pop()){case".wps":e="application/kswps";break;case".doc":e="application/msword";break;case".docx":e="application/vnd.openxmlformats-officedocument.wordprocessingml.document";break;case".txt":e="text/plain";break;case".zip":e="application/zip";break;case".png":e="image/png";break;case".gif":e="image/gif";break;case".jpeg":case".jpg":e="image/jpeg";break;case".rtf":e="application/rtf";break;case".avi":e="video/x-msvideo";break;case".gz":e="application/x-gzip";break;case".tar":e="application/x-tar";break;case".xlsx":e="application/vnd.ms-excel";break;default:e=""}return e}function K(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n]);return e}function Y(t){var e=n({multiple:!0,accept:""},t),r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("multiple","".concat(e.multiple)),r.setAttribute("accept",e.accept),r.onchange=function(t){var n=t.target,r=n.files?K(n.files):[];0!==r.length&&(e.onSelected(r),n.value="")},document.body.appendChild(r),r.click(),document.body.removeChild(r)}t("CountLatch",function(){function t(){this.promise=null,this.resolve=null,this.count=0}return t.prototype.startPromise=function(){var t=this;this.promise=new Promise((function(e){t.resolve=e}))},t.prototype.endPromise=function(){this.resolve&&(this.resolve(),this.resolve=null,this.promise=null)},t.prototype.lock=function(){this.count+=1,this.promise||this.startPromise()},t.prototype.unlock=function(){if(this.count<1)throw new P("lock和unlock次数不匹配!");this.count-=1,0===this.count&&this.endPromise()},t.prototype.await=function(){return d(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return this.promise?[4,this.promise]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},t}());var $=t("IBizSys",(function(){this.env=k,this.log=q,this.net=new N,this.commands=new x})),Q=t("FactoryCenter",(function(){}))}}}));
1
+ System.register(["lodash-es","qx-util","axios","qs","pluralize"],(function(t){"use strict";var e,n,r,o,i,s,a,c,u,l;return{setters:[function(t){e=t.debounce,n=t.merge,r=t.uniqueId,o=t.isFunction},function(t){i=t.getCookie,s=t.notNilEmpty},function(t){a=t.AxiosHeaders,c=t.default},function(t){u=t.stringify},function(t){l=t.default}],execute:function(){function f(t,e){return e.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(n){if("default"!==n&&!(n in t)){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}))})),Object.freeze(t)}t({calcMimeByFileName:Z,colorBlend:function(t,e,n,r){void 0===n&&(n=.5);void 0===r&&(r="hex");t=t.trim(),e=e.trim();var o=X(t),i=X(e),s=[W((1-n)*o[0]+n*i[0]),W((1-n)*o[1]+n*i[1]),W((1-n)*o[2]+n*i[2]),(1-n)*o[3]+n*i[3]];if("hex"===r){var a=[s[0].toString(16),s[1].toString(16),s[2].toString(16),0===s[3]?"00":W(255*s[3]).toString(16)];return"#".concat(a[0]).concat(a[1]).concat(a[2]).concat(a[3])}return"rgb(".concat(s[0]," ").concat(s[1]," ").concat(s[2]," / ").concat(s[3],")")},debounce:function(t,e,n){var r;return function(){for(var o=this,i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];if(r&&clearTimeout(r),n){var a=!r;r=setTimeout((function(){r=null}),e),a&&t.apply(this,i)}else r=setTimeout((function(){t.apply(o,i)}),e)}},debounceAndAsyncMerge:function(t,n,r){var o,i=this,s=[],a=e((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return d(i,void 0,void 0,(function(){var n,r;return h(this,(function(i){switch(i.label){case 0:o=void 0,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,t.apply(void 0,m([],v(e),!1))];case 2:return n=i.sent(),s.forEach((function(t){t.resolve(n)})),s=[],[2,n];case 3:return r=i.sent(),s.forEach((function(t){t.reject(r)})),s=[],[3,4];case 4:return[2]}}))}))}),r);return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return d(i,void 0,void 0,(function(){var e;return h(this,(function(r){return e=t,o&&(e=n(o,e)),o=e,a.apply(void 0,m([],v(e),!1)),[2,new Promise((function(t,e){s.push({resolve:t,reject:e})}))]}))}))}},debounceAndMerge:function(t,n,r){var o,i=e((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return o=void 0,t.apply(void 0,m([],v(e),!1))}),r);return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t;return o&&(r=n(o,r)),o=r,i.apply(void 0,m([],v(r),!1))}},downloadFileFromBlob:function(t,e){var n=Z(e),r=new Blob([t],{type:n}),o=URL.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(o)},eventPath:D,fileListToArr:G,getToken:T,install:function(){if(window.ibiz)throw new Error("ibiz 已经存在, 无需重复安装");window.ibiz=new J,window.___fc=new Y},isEventInside:V,isImage:function(t){var e=t.split(".").pop();if(!e)return!1;return[".jpeg","jpg","gif","png","bmp","svg"].includes(e)},isOverlap:function(t,e){return Array.from(new Set(m(m([],v(t),!1),v(e),!1))).length!==t.length+e.length},listenJSEvent:$,onClickOutside:function(t,e,n){void 0===n&&(n={});var r=n.window,o=void 0===r?H:r,i=n.ignore,s=void 0===i?[]:i,a=n.capture,c=void 0===a||a;if(!t)throw new P("target元素不存在");if(!o)throw new P("找不到window");var u,l=!0,f=function(e){return!m([t],v(s),!1).some((function(t){return V(e,t)}))},p=!1,d=function(t){p||(o.clearTimeout(u),l&&f(t)&&e(t))},h=[$(o,"click",d,{passive:!0,capture:c}),$(o,"pointerdown",(function(t){p||(l=f(t))}),{passive:!0}),$(o,"pointerup",(function(t){if(!p&&0===t.button){var e=D(t);t.composedPath=function(){return e},u=o.setTimeout((function(){return d(t)}),50)}}),{passive:!0})].filter(Boolean);return{stop:function(){return h.forEach((function(t){return t()}))},pause:function(){p=!0},proceed:function(){p=!1}}},plural:B,pluralLower:function(t){return B(t).toLowerCase()},selectFile:K,setRemoteStyle:function(t){return d(this,void 0,void 0,(function(){var e,n;return h(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,ibiz.net.get(t)];case 1:return e=r.sent(),(n=document.createElement("style")).setAttribute("title","app-style-css"),n.innerText=e.data,document.head.appendChild(n),[3,3];case 2:return r.sent(),M.debug("加载远程样式表失败",t),[3,3];case 3:return[2]}}))}))},throttle:function(t,e){var n=null;return function(){for(var r=this,o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];n||(n=setTimeout((function(){t.apply(r,o),n=null}),e))}},toDisposable:w,uploadFile:function(t){var e=this,i=n({multiple:!0,accept:"",separate:!0,beforeUpload:function(t,e){return!0},finish:function(t){},success:function(t,e){},error:function(t,e){},progress:function(t){}},t),s=function(t,n){return d(e,void 0,void 0,(function(){var e;return h(this,(function(n){if(i.request&&o(i.request))return[2,i.request(t)];throw e=new FormData,t.forEach((function(t){e.append("file",t)})),new Error("多应用模式等待重新实现请求")}))}))},a=function(t){return d(e,void 0,void 0,(function(){var e,n,o;return h(this,(function(a){switch(a.label){case 0:if(e=t.map((function(t){return{status:"uploading",name:t.name,uid:r(),percentage:0}})),!i.beforeUpload(t,e))return e.forEach((function(t){t.status="cancel"})),ibiz.log.debug("取消上传",e),[2,e];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,s(t)];case 2:return n=a.sent(),e.forEach((function(t){t.status="finished"})),i.success(e,n),e.forEach((function(t){t.response=n})),[3,4];case 3:return o=a.sent(),e.forEach((function(t){t.status="fail"})),i.error(e,o),e.forEach((function(t){t.error=o})),ibiz.log.error(o),ibiz.log.error("".concat(t.map((function(t){return t.name})).join(","),"上传失败")),[3,4];case 4:return[2,e]}}))}))};K({accept:i.accept,multiple:i.multiple,onSelected:function(t){!function(t){d(e,void 0,void 0,(function(){var e,n,r,o=this;return h(this,(function(s){switch(s.label){case 0:return e=i.separate?t.map((function(t){return[t]})):[t],[4,Promise.allSettled(e.map((function(t){return d(o,void 0,void 0,(function(){return h(this,(function(e){return[2,a(t)]}))}))})))];case 1:return n=s.sent(),r=[],n.forEach((function(t){"fulfilled"===t.status&&r.push.apply(r,m([],v(t.value),!1))})),i.finish(r),[2]}}))}))}(t)}})}});var p=function(t,e){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},p(t,e)};function d(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((r=r.apply(t,e||[])).next())}))}function h(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function v(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function m(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}var y=function(){function t(e){this.element=e,this.next=t.Undefined,this.prev=t.Undefined}return t.Undefined=new t(void 0),t}(),g=t("LinkedList",function(){function t(){this._first=y.Undefined,this._last=y.Undefined,this._size=0}return Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),t.prototype.isEmpty=function(){return this._first===y.Undefined},t.prototype.clear=function(){for(var t=this._first;t!==y.Undefined;){var e=t.next;t.prev=y.Undefined,t.next=y.Undefined,t=e}this._first=y.Undefined,this._last=y.Undefined,this._size=0},t.prototype.unshift=function(t){return this._insert(t,!1)},t.prototype.push=function(t){return this._insert(t,!0)},t.prototype._insert=function(t,e){var n=this,r=new y(t);if(this._first===y.Undefined)this._first=r,this._last=r;else if(e){var o=this._last;this._last=r,r.prev=o,o.next=r}else{var i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;var s=!1;return function(){s||(s=!0,n._remove(r))}},t.prototype.shift=function(){if(this._first!==y.Undefined){var t=this._first.element;return this._remove(this._first),t}},t.prototype.pop=function(){if(this._last!==y.Undefined){var t=this._last.element;return this._remove(this._last),t}},t.prototype._remove=function(t){if(t.prev!==y.Undefined&&t.next!==y.Undefined){var e=t.prev;e.next=t.next,t.next.prev=e}else t.prev===y.Undefined&&t.next===y.Undefined?(this._first=y.Undefined,this._last=y.Undefined):t.next===y.Undefined?(this._last=this._last.prev,this._last.next=y.Undefined):t.prev===y.Undefined&&(this._first=this._first.next,this._first.prev=y.Undefined);this._size-=1},t.prototype[Symbol.iterator]=function(){var t;return h(this,(function(e){switch(e.label){case 0:t=this._first,e.label=1;case 1:return t===y.Undefined?[3,3]:[4,t.element];case 2:return e.sent(),t=t.next,[3,1];case 3:return[2]}}))},t}());function b(t){var e,n=this,r=!1;return function(){return r?e:(r=!0,e=t.apply(n,arguments))}}function w(t){return{dispose:b((function(){t()}))}}var _,E,x=t("CommandsRegistry",function(){function t(){this.commands=new Map}return t.prototype.registerCommand=function(t,e,n){var r=this;if(!t)throw new Error("invalid command");if("string"==typeof t){if(!e)throw new Error("invalid command");return this.registerCommand({id:t,handler:e,opts:n})}var o=t.id,i=this.commands.get(o);i||(i=new g,this.commands.set(o,i));var s=i.unshift(t);return w((function(){s();var t=r.commands.get(o);(null==t?void 0:t.isEmpty())&&r.commands.delete(o)}))},t.prototype.hasCommand=function(t){return this.commands.has(t)},t.prototype.getCommand=function(t){var e=this.commands.get(t);if(e&&!e.isEmpty())return e[Symbol.iterator]().next().value},t.prototype.getCommands=function(){var t,e,n=new Map,r=this.commands.keys();try{for(var o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(r),i=o.next();!i.done;i=o.next()){var s=i.value,a=this.getCommand(s);a&&n.set(s,a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return n},t.prototype.getCommandOpt=function(t){var e=this.getCommand(t);return null==e?void 0:e.opts},t}()),R=t("CommandController",function(){function t(){this.commandRegister=new x}return t.prototype.register=function(t,e,n){return this.commandRegister.registerCommand(t,e,n)},t.prototype.execute=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return d(this,void 0,void 0,(function(){var n;return h(this,(function(r){if(n=this.commandRegister.getCommand(t))return[2,n.handler.apply(n,m([],v(e),!1))];throw new Error("未注册指令: ".concat(t,",请先注册指令"))}))}))},t.prototype.hasCommand=function(t,e){var n=!!this.commandRegister.hasCommand(t);if(!0===e&&!0===n)throw new Error("未注册指令: ".concat(t,",请先注册指令"));return n},t.prototype.getCommandOpts=function(t){return this.commandRegister.getCommandOpt(t)},t}()),U=(t("commands",new R),t("CoreConst",function(){function t(){}return t.DEFAULT_MODEL_SERVICE_TAG="default",t.TOKEN="access_token",t.TOKEN_EXPIRES="access_token_expires",t}())),C=t("NOOP",(function(){}));t("HttpStatusMessageConst",{200:"服务器成功返回请求的数据。",201:"新建或修改数据成功。",202:"一个请求已经进入后台排队(异步任务)。",204:"删除数据成功。",400:"发出的请求有错误,服务器没有进行新建或修改数据的操作。",401:"用户没有权限(令牌、用户名、密码错误)。",403:"用户得到授权,但是访问是被禁止的。",404:"发出的请求针对的是不存在的记录,服务器没有进行操作。",406:"请求的格式不可得。",410:"请求的资源被永久删除,且不会再得到的。",422:"当创建一个对象时,发生一个验证错误。",500:"服务器发生错误,请检查服务器。",502:"网关错误。",503:"服务不可用,服务器暂时过载或维护。",504:"网关超时。"});t("LoginMode",_),function(t){t.DEFAULT="DEFAULT",t.CUSTOM="CUSTOM",t.CAS="CAS"}(_||t("LoginMode",_={})),t("MenuPermissionMode",E),function(t){t.MIXIN="MIXIN",t.RESOURCE="RESOURCE",t.RT="RT"}(E||t("MenuPermissionMode",E={}));t("IBizContext",function(){function t(t,e){if(void 0===t&&(t={}),e){var n=this;Object.defineProperty(this,"_parent",{enumerable:!1,value:e}),Object.defineProperty(this,"_context",{enumerable:!1,value:{}});var r={};Object.keys(e).forEach((function(t){r[t]={enumerable:!0,set:function(e){n._context[t]=null==e?null:e},get:function(){return void 0!==n._context[t]?n._context[t]:e[t]}}})),Object.defineProperties(this,r)}Object.assign(this,t)}return t.prototype.getOwnContext=function(){var t=this,e={};return Object.keys(this).forEach((function(n){t._parent&&Object.prototype.hasOwnProperty.call(t._parent,n)&&!Object.prototype.hasOwnProperty.call(t._context,n)||(e[n]=t[n])})),e},t}());var k=t("Environment",{dev:!1,hub:!0,logLevel:"ERROR",baseUrl:"/api",appId:"",pluginBaseUrl:"./plugins",remoteModelUrl:"/remotemodel",assetsUrl:"./assets",dcSystem:"",downloadFileUrl:"/ibizutil/download",uploadFileUrl:"/ibizutil/upload",casLoginUrl:"",loginMode:_.DEFAULT,menuPermissionMode:E.MIXIN,enablePermission:!0,routePlaceholder:"-"}),O=t("HttpError",(function(t){this.name="HttpError";var e=t.response;this.response=t.response,e?(e.data?this.message=e.data.message:this.message=e.statusText,this.message||(this.message="网络异常,请稍后重试!"),this.status=e.status):(this.message=t.message,this.status=500)})),P=t("RuntimeError",(function(t){this.message=t,this.name="Runtime Error"}));function T(){return i(U.TOKEN)}var S,L,j,A=t("Interceptor",function(){function t(){}return t.prototype.onBeforeRequest=function(t){return d(this,void 0,void 0,(function(){return h(this,(function(e){return[2,t]}))}))},t.prototype.onRequestError=function(t){return Promise.reject(t)},t.prototype.onResponseSuccess=function(t){return d(this,void 0,void 0,(function(){return h(this,(function(e){return[2,t]}))}))},t.prototype.onResponseError=function(t){return Promise.reject(t)},t.prototype.use=function(t){this.requestTag=t.interceptors.request.use(this.onBeforeRequest,this.onRequestError),this.responseTag=t.interceptors.response.use(this.onResponseSuccess,this.onResponseError)},t.prototype.eject=function(t){this.requestTag&&t.interceptors.request.eject(this.requestTag),this.responseTag&&t.interceptors.response.eject(this.responseTag)},t}()),I=t("CoreInterceptor",function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.onBeforeRequest=function(e){return d(this,void 0,void 0,(function(){var n,r;return h(this,(function(o){switch(o.label){case 0:return[4,t.prototype.onBeforeRequest.call(this,e)];case 1:return o.sent(),(n=e.headers).set("Authorization","Bearer ".concat(T())),(r=ibiz.orgData)&&(r.systemid&&n.set("srfsystemid",r.systemid),r.orgid&&n.set("srforgid",r.orgid)),[2,e]}}))}))},e}(A)),z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},M={};L=z,j=function(){var t=function(){},e="undefined",n=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"];function o(t,e){var n=t[e];if("function"==typeof n.bind)return n.bind(t);try{return Function.prototype.bind.call(n,t)}catch(e){return function(){return Function.prototype.apply.apply(n,[t,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(r){return"debug"===r&&(r="log"),typeof console!==e&&("trace"===r&&n?i:void 0!==console[r]?o(console,r):void 0!==console.log?o(console,"log"):t)}function a(e,n){for(var o=0;o<r.length;o++){var i=r[o];this[i]=o<e?t:this.methodFactory(i,e,n)}this.log=this.debug}function c(t,n,r){return function(){typeof console!==e&&(a.call(this,n,r),this[t].apply(this,arguments))}}function u(t,e,n){return s(t)||c.apply(this,arguments)}function l(t,n,o){var i,s=this;n=null==n?"WARN":n;var c="loglevel";function l(){var t;if(typeof window!==e&&c){try{t=window.localStorage[c]}catch(t){}if(typeof t===e)try{var n=window.document.cookie,r=n.indexOf(encodeURIComponent(c)+"=");-1!==r&&(t=/^([^;]+)/.exec(n.slice(r))[1])}catch(t){}return void 0===s.levels[t]&&(t=void 0),t}}"string"==typeof t?c+=":"+t:"symbol"==typeof t&&(c=void 0),s.name=t,s.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},s.methodFactory=o||u,s.getLevel=function(){return i},s.setLevel=function(n,o){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!==o&&function(t){var n=(r[t]||"silent").toUpperCase();if(typeof window!==e&&c){try{return void(window.localStorage[c]=n)}catch(t){}try{window.document.cookie=encodeURIComponent(c)+"="+n+";"}catch(t){}}}(n),a.call(s,n,t),typeof console===e&&n<s.levels.SILENT)return"No console available for logging"},s.setDefaultLevel=function(t){n=t,l()||s.setLevel(t,!1)},s.resetLevel=function(){s.setLevel(n,!1),function(){if(typeof window!==e&&c){try{return void window.localStorage.removeItem(c)}catch(t){}try{window.document.cookie=encodeURIComponent(c)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(t){}}}()},s.enableAll=function(t){s.setLevel(s.levels.TRACE,t)},s.disableAll=function(t){s.setLevel(s.levels.SILENT,t)};var f=l();null==f&&(f=n),s.setLevel(f,!1)}var f=new l,p={};f.getLogger=function(t){if("symbol"!=typeof t&&"string"!=typeof t||""===t)throw new TypeError("You must supply a name when creating a logger.");var e=p[t];return e||(e=p[t]=new l(t,f.getLevel(),f.methodFactory)),e};var d=typeof window!==e?window.log:void 0;return f.noConflict=function(){return typeof window!==e&&window.log===f&&(window.log=d),f},f.getLoggers=function(){return p},f.default=f,f},(S={get exports(){return M},set exports(t){M=t}}).exports?S.exports=j():L.log=j();var N=f({__proto__:null,default:M},[M]);t("Logger",N);function q(t,e,n,r,o){var i="".concat(t,"-").concat(e);return n&&(i+="-".concat(n)),r&&(i+="__".concat(r)),o&&(i+="--".concat(o)),i}t("Namespace",function(){function t(t,e){this.block=t,this.namespace=e||"ibiz"}return t.prototype.b=function(t){return void 0===t&&(t=""),q(this.namespace,this.block,t,"","")},t.prototype.e=function(t){return t?q(this.namespace,this.block,"",t,""):""},t.prototype.m=function(t){return t?q(this.namespace,this.block,"","",t):""},t.prototype.be=function(t,e){return t&&e?q(this.namespace,this.block,t,e,""):""},t.prototype.em=function(t,e){return t&&e?q(this.namespace,this.block,"",t,e):""},t.prototype.bm=function(t,e){return t&&e?q(this.namespace,this.block,t,"",e):""},t.prototype.bem=function(t,e,n){return t&&e&&n?q(this.namespace,this.block,t,e,n):""},t.prototype.is=function(t,e){return t&&e?"".concat("is-").concat(t):""},t.prototype.cssVar=function(t){var e={};for(var n in t)t[n]&&(e[this.cssVarName(n)]=t[n]);return e},t.prototype.cssVarBlock=function(t){var e={};for(var n in t)t[n]&&(e[this.cssVarBlockName(n)]=t[n]);return e},t.prototype.cssVarName=function(t){return"--".concat(this.namespace,"-").concat(t)},t.prototype.cssVarBlockName=function(t){return"--".concat(this.namespace,"-").concat(this.block,"-").concat(t)},t}()),t("HttpResponse",(function(t,e,n){this.local=!0,this.ok=!1,this.headers={},this.config={headers:new a},this.data=t,this.status=e||200,this.statusText=n||"",this.status>=200&&this.status<300&&(this.ok=!0)}));var F=t("Net",function(){function t(t){this.urlReg=/^http[s]?:\/\/[^\s]*/,this.interceptors=new Map,this.instance=c.create(t),this.addInterceptor("Default",new I)}return t.prototype.addInterceptor=function(t,e){e.use(this.instance),this.interceptors.set(t,e)},t.prototype.removeInterceptor=function(t){var e=this.interceptors.get(t);e&&(e.eject(this.instance),this.interceptors.delete(t))},Object.defineProperty(t.prototype,"presetConfig",{get:function(){return{baseURL:this.instance.defaults.baseURL||"".concat(ibiz.env.baseUrl,"/").concat(ibiz.env.appId),headers:{"Content-Type":"application/json;charset=UTF-8",Accept:"application/json"}}},enumerable:!1,configurable:!0}),t.prototype.mergeConfig=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=this.presetConfig;if(0===t.length)return r;var o=t[0].url;return o&&this.urlReg.test(o)&&delete r.baseURL,n.apply(void 0,m([r],v(t),!1))},t.prototype.post=function(t,e,n,r){return void 0===n&&(n={}),void 0===r&&(r={}),d(this,void 0,void 0,(function(){var o,i;return h(this,(function(s){switch(s.label){case 0:t=this.handleAppPresetParam(t,n),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.request(t,{method:"post",data:e,headers:r})];case 2:return o=s.sent(),[2,this.doResponseResult(o)];case 3:throw i=s.sent(),new O(i);case 4:return[2]}}))}))},t.prototype.get=function(t,e,r,o){return void 0===e&&(e={}),void 0===r&&(r={}),void 0===o&&(o={}),d(this,void 0,void 0,(function(){var i,s;return h(this,(function(a){switch(a.label){case 0:t=this.attachUrlParam(t,e),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.request(t,n({method:"get",headers:r},o))];case 2:return i=a.sent(),[2,this.doResponseResult(i)];case 3:throw s=a.sent(),new O(s);case 4:return[2]}}))}))},t.prototype.delete=function(t,e,n){return void 0===n&&(n={}),d(this,void 0,void 0,(function(){var r,o;return h(this,(function(i){switch(i.label){case 0:t=this.handleAppPresetParam(t,e),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.request(t,{method:"delete",headers:n})];case 2:return r=i.sent(),[2,this.doResponseResult(r)];case 3:throw o=i.sent(),new O(o);case 4:return[2]}}))}))},t.prototype.put=function(t,e,n,r){return void 0===n&&(n={}),void 0===r&&(r={}),d(this,void 0,void 0,(function(){var o,i;return h(this,(function(s){switch(s.label){case 0:t=this.handleAppPresetParam(t,n),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.request(t,{method:"put",data:e,headers:r})];case 2:return o=s.sent(),[2,this.doResponseResult(o)];case 3:throw i=s.sent(),new O(i);case 4:return[2]}}))}))},t.prototype.getModel=function(t,e){return void 0===e&&(e={}),d(this,void 0,void 0,(function(){var n,r;return h(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.instance.get(t,{headers:e})];case 1:return n=o.sent(),[2,this.doResponseResult(n)];case 2:throw r=o.sent(),new O(r);case 3:return[2]}}))}))},t.prototype.request=function(t,e){return void 0===e&&(e={}),d(this,void 0,void 0,(function(){var n,r;return h(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.instance.request(this.mergeConfig({url:t},e))];case 1:return n=o.sent(),[2,this.doResponseResult(n)];case 2:throw r=o.sent(),new O(r);case 3:return[2]}}))}))},t.prototype.axios=function(t){return c(t)},t.prototype.doResponseResult=function(t){var e=t;return e.status>=200&&e.status<=299&&(e.ok=!0),e},t.prototype.handleAppPresetParam=function(t,e){if(e){var n=Object.keys(e),r={};return n.forEach((function(t){t.startsWith("srf")&&s(e[t])&&(r[t]=e[t])})),this.attachUrlParam(t,e)}return t},t.prototype.attachUrlParam=function(t,e){var n=u(e);return s(n)&&(t=t.endsWith("?")||-1!==t.indexOf("?")&&t.endsWith("&")?"".concat(t).concat(n):-1===t.indexOf("?")||t.endsWith("&")?"".concat(t,"?").concat(n):"".concat(t,"&").concat(n)),t},t}());function B(t){return l(t)}t("StringUtil",function(){function t(){}return t.fill=function(t,e,n){if(s(t)){var r;if(s(e))null==(r=t.match(this.contextReg))||r.forEach((function(n){var r=n.slice(10,n.length-1);t=t.replace("${context.".concat(r,"}"),e[r]||"")}));if(s(n))null==(r=t.match(this.dataReg))||r.forEach((function(e){var r=e.slice(7,e.length-1);t=t.replace("${data.".concat(r,"}"),n[r]||"")}))}return t},t.contextReg=/\$\{context.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g,t.dataReg=/\$\{data.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g,t}()),t("UrlHelper",function(){function t(){}return Object.defineProperty(t,"routeBase",{get:function(){return"".concat(this.appBase,"/#")},enumerable:!1,configurable:!0}),Object.defineProperty(t,"appBase",{get:function(){var t=window.location,e=t.origin,n=t.pathname;return"".concat(e).concat(n).replace(/\/$/,"")},enumerable:!1,configurable:!0}),Object.defineProperty(t,"routePath",{get:function(){return window.location.hash.replace("#","")},enumerable:!1,configurable:!0}),Object.defineProperty(t,"fullPath",{get:function(){return window.location.href},enumerable:!1,configurable:!0}),t}());function D(t){var e=t.composedPath&&t.composedPath()||t.path;if(null!=e)return e;return[t.target].concat(function t(e,n){void 0===n&&(n=[]);var r=e.parentNode;return r?t(r,n.concat([r])):n}(t.target))}function $(t,e,n,r){void 0===r&&(r={}),t.addEventListener(e,n,r);var o=function(){t.removeEventListener(e,n,r),o=C};return function(){o()}}function V(t,e){return e&&(t.target===e||D(t).includes(e))}var H="undefined"!=typeof window?window:void 0;var W=Math.round;function X(t){var e=t.length,n=[];if("rgb"===t.slice(0,3).toLowerCase()){var r=t.match(/([\d|.%]{1,3})/g);n[0]=parseInt(r[0],10),n[1]=parseInt(r[1],10),n[2]=parseInt(r[2],10),n[3]=r[3]?-1!==r[3].indexOf("%")?parseInt(r[3],10)/100:parseFloat(r[3]):1}else{r=void 0;r=e<6?parseInt(String(t[1])+t[1]+t[2]+t[2]+t[3]+t[3]+(e>4?String(t[4])+t[4]:""),16):parseInt(t.slice(1),16),n[0]=r>>16&255,n[1]=r>>8&255,n[2]=255&r,n[3]=9===e||5===e?W((r>>24&255)/255*1e4)/1e4:1}return n}function Z(t){var e="";switch(t.split(".").pop()){case".wps":e="application/kswps";break;case".doc":e="application/msword";break;case".docx":e="application/vnd.openxmlformats-officedocument.wordprocessingml.document";break;case".txt":e="text/plain";break;case".zip":e="application/zip";break;case".png":e="image/png";break;case".gif":e="image/gif";break;case".jpeg":case".jpg":e="image/jpeg";break;case".rtf":e="application/rtf";break;case".avi":e="video/x-msvideo";break;case".gz":e="application/x-gzip";break;case".tar":e="application/x-tar";break;case".xlsx":e="application/vnd.ms-excel";break;default:e=""}return e}function G(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n]);return e}function K(t){var e=n({multiple:!0,accept:""},t),r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("multiple","".concat(e.multiple)),r.setAttribute("accept",e.accept),r.onchange=function(t){var n=t.target,r=n.files?G(n.files):[];0!==r.length&&(e.onSelected(r),n.value="")},document.body.appendChild(r),r.click(),document.body.removeChild(r)}t("CountLatch",function(){function t(){this.promise=null,this.resolve=null,this.count=0}return t.prototype.startPromise=function(){var t=this;this.promise=new Promise((function(e){t.resolve=e}))},t.prototype.endPromise=function(){this.resolve&&(this.resolve(),this.resolve=null,this.promise=null)},t.prototype.lock=function(){this.count+=1,this.promise||this.startPromise()},t.prototype.unlock=function(){if(this.count<1)throw new P("lock和unlock次数不匹配!");this.count-=1,0===this.count&&this.endPromise()},t.prototype.await=function(){return d(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return this.promise?[4,this.promise]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},t}());var J=t("IBizSys",(function(){this.env=k,this.log=N,this.net=new F,this.commands=new R})),Y=t("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;CACxC"}
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';
@@ -4,6 +4,7 @@ export { Namespace } from './namespace/namespace';
4
4
  export { IHttpResponse, HttpResponse } from './net/http-response';
5
5
  export { Net } from './net/net';
6
6
  export { plural, pluralLower } from './plural/plural';
7
+ export { StringUtil } from './string-util/string-util';
7
8
  export * from './util/util';
8
9
  export * from './url-helper/url-helper';
9
10
  export * from './event/event';
@@ -13,4 +14,5 @@ export * from './download-file/download-file';
13
14
  export * from './upload/select-file';
14
15
  export * from './upload/upload-file';
15
16
  export * from './sync';
17
+ export * from './style/remote-style';
16
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtD,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC"}
@@ -4,6 +4,7 @@ export { Namespace } from './namespace/namespace';
4
4
  export { HttpResponse } from './net/http-response';
5
5
  export { Net } from './net/net';
6
6
  export { plural, pluralLower } from './plural/plural';
7
+ export { StringUtil } from './string-util/string-util';
7
8
  export * from './util/util';
8
9
  export * from './url-helper/url-helper';
9
10
  export * from './event/event';
@@ -13,3 +14,4 @@ export * from './download-file/download-file';
13
14
  export * from './upload/select-file';
14
15
  export * from './upload/upload-file';
15
16
  export * from './sync';
17
+ export * from './style/remote-style';
@@ -1,4 +1,4 @@
1
- import { RawAxiosRequestHeaders, AxiosRequestConfig, AxiosInstance, CreateAxiosDefaults } from 'axios';
1
+ import { RawAxiosRequestHeaders, AxiosResponse, AxiosRequestConfig, AxiosInstance, CreateAxiosDefaults } from 'axios';
2
2
  import { Interceptor } from '../interceptor/interceptor';
3
3
  import { IHttpResponse } from './http-response';
4
4
  /**
@@ -19,6 +19,14 @@ export declare class Net {
19
19
  * @type {AxiosInstance}
20
20
  */
21
21
  protected instance: AxiosInstance;
22
+ /**
23
+ * 是否为 http || https 开头
24
+ *
25
+ * @author chitanda
26
+ * @date 2022-11-07 14:11:28
27
+ * @protected
28
+ */
29
+ protected urlReg: RegExp;
22
30
  /**
23
31
  * Creates an instance of Net.
24
32
  * @author lxm
@@ -138,6 +146,15 @@ export declare class Net {
138
146
  * @returns {*} {Promise<IHttpResponse>}
139
147
  */
140
148
  request(url: string, config?: AxiosRequestConfig): Promise<IHttpResponse>;
149
+ /**
150
+ * 创建标准 axios 请求
151
+ *
152
+ * @author chitanda
153
+ * @date 2023-01-30 15:01:27
154
+ * @param {AxiosRequestConfig<IData>} config
155
+ * @return {*}
156
+ */
157
+ axios(config: AxiosRequestConfig<IData>): Promise<AxiosResponse<any, any>>;
141
158
  /**
142
159
  * 统一处理请求返回
143
160
  *
@@ -1 +1 @@
1
- {"version":3,"file":"net.d.ts","sourceRoot":"","sources":["../../../src/utils/net/net.ts"],"names":[],"mappings":"AAAA,OAAc,EAEZ,sBAAsB,EAEtB,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACpB,MAAM,OAAO,CAAC;AAMf,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;;;GAOG;AACH,qBAAa,GAAG;IACd;;;;;;;OAOG;IACH,SAAS,CAAC,QAAQ,EAAE,aAAa,CAAC;IAElC;;;;;OAKG;gBACS,MAAM,CAAC,EAAE,mBAAmB;IAKxC;;;;;;OAMG;IACH,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAa;IAEnD;;;;;;;OAOG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW;IAKrD;;;;;;OAMG;IACH,iBAAiB,CAAC,IAAI,EAAE,MAAM;IAQ9B;;;;;;;;OAQG;IACH,SAAS,KAAK,YAAY,IAAI,kBAAkB,CAW/C;IAED;;;;;;;;OAQG;IACH,SAAS,CAAC,WAAW,CAAC,GAAG,OAAO,EAAE,kBAAkB,EAAE;IAOtD;;;;;;;;;;OAUG;IACG,IAAI,CACR,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,KAAK,EACX,MAAM,GAAE,OAAY,EACpB,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,aAAa,CAAC;IAczB;;;;;;;;;;OAUG;IACG,GAAG,CACP,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,OAAY,EACpB,OAAO,GAAE,sBAA2B,EACpC,MAAM,GAAE,kBAAuB,GAC9B,OAAO,CAAC,aAAa,CAAC;IAiBzB;;;;;;;;;OASG;IACG,MAAM,CACV,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,OAAO,EAChB,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,aAAa,CAAC;IAUzB;;;;;;;;;;OAUG;IACG,GAAG,CACP,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,KAAK,EACX,MAAM,GAAE,OAAY,EACpB,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,aAAa,CAAC;IAczB;;;;;;;;OAQG;IACG,QAAQ,CACZ,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,aAAa,CAAC;IAWzB;;;;;;;;OAQG;IACG,OAAO,CACX,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,kBAAuB,GAC9B,OAAO,CAAC,aAAa,CAAC;IAWzB;;;;;;;;OAQG;IACH,OAAO,CAAC,gBAAgB;IAQxB;;;;;;;;;OASG;IACH,OAAO,CAAC,oBAAoB;IAc5B;;;;;;;;;OASG;IACH,OAAO,CAAC,cAAc;CAevB"}
1
+ {"version":3,"file":"net.d.ts","sourceRoot":"","sources":["../../../src/utils/net/net.ts"],"names":[],"mappings":"AAAA,OAAc,EAEZ,sBAAsB,EACtB,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACpB,MAAM,OAAO,CAAC;AAMf,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;;;GAOG;AACH,qBAAa,GAAG;IACd;;;;;;;OAOG;IACH,SAAS,CAAC,QAAQ,EAAE,aAAa,CAAC;IAElC;;;;;;OAMG;IACH,SAAS,CAAC,MAAM,SAA0B;IAE1C;;;;;OAKG;gBACS,MAAM,CAAC,EAAE,mBAAmB;IAKxC;;;;;;OAMG;IACH,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAa;IAEnD;;;;;;;OAOG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW;IAKrD;;;;;;OAMG;IACH,iBAAiB,CAAC,IAAI,EAAE,MAAM;IAQ9B;;;;;;;;OAQG;IACH,SAAS,KAAK,YAAY,IAAI,kBAAkB,CAW/C;IAED;;;;;;;;OAQG;IACH,SAAS,CAAC,WAAW,CAAC,GAAG,OAAO,EAAE,kBAAkB,EAAE;IAYtD;;;;;;;;;;OAUG;IACG,IAAI,CACR,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,KAAK,EACX,MAAM,GAAE,OAAY,EACpB,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,aAAa,CAAC;IAczB;;;;;;;;;;OAUG;IACG,GAAG,CACP,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,OAAY,EACpB,OAAO,GAAE,sBAA2B,EACpC,MAAM,GAAE,kBAAuB,GAC9B,OAAO,CAAC,aAAa,CAAC;IAiBzB;;;;;;;;;OASG;IACG,MAAM,CACV,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,OAAO,EAChB,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,aAAa,CAAC;IAUzB;;;;;;;;;;OAUG;IACG,GAAG,CACP,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,KAAK,EACX,MAAM,GAAE,OAAY,EACpB,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,aAAa,CAAC;IAczB;;;;;;;;OAQG;IACG,QAAQ,CACZ,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,aAAa,CAAC;IAWzB;;;;;;;;OAQG;IACG,OAAO,CACX,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,kBAAuB,GAC9B,OAAO,CAAC,aAAa,CAAC;IAWzB;;;;;;;OAOG;IACH,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,KAAK,CAAC;IAIvC;;;;;;;;OAQG;IACH,OAAO,CAAC,gBAAgB;IAQxB;;;;;;;;;OASG;IACH,OAAO,CAAC,oBAAoB;IAc5B;;;;;;;;;OASG;IACH,OAAO,CAAC,cAAc;CAevB"}
@@ -20,6 +20,14 @@ export class Net {
20
20
  * @param {CreateAxiosDefaults} [config] 创建实例用的默认配置
21
21
  */
22
22
  constructor(config) {
23
+ /**
24
+ * 是否为 http || https 开头
25
+ *
26
+ * @author chitanda
27
+ * @date 2022-11-07 14:11:28
28
+ * @protected
29
+ */
30
+ this.urlReg = /^http[s]?:\/\/[^\s]*/;
23
31
  /**
24
32
  * 注册的拦截器
25
33
  *
@@ -87,10 +95,15 @@ export class Net {
87
95
  * @returns {*}
88
96
  */
89
97
  mergeConfig(...configs) {
98
+ const config = this.presetConfig;
90
99
  if (configs.length === 0) {
91
- return this.presetConfig;
100
+ return config;
92
101
  }
93
- return merge(this.presetConfig, ...configs);
102
+ const { url } = configs[0];
103
+ if (url && this.urlReg.test(url)) {
104
+ delete config.baseURL;
105
+ }
106
+ return merge(config, ...configs);
94
107
  }
95
108
  /**
96
109
  * Post 请求
@@ -225,6 +238,17 @@ export class Net {
225
238
  throw new HttpError(error);
226
239
  }
227
240
  }
241
+ /**
242
+ * 创建标准 axios 请求
243
+ *
244
+ * @author chitanda
245
+ * @date 2023-01-30 15:01:27
246
+ * @param {AxiosRequestConfig<IData>} config
247
+ * @return {*}
248
+ */
249
+ axios(config) {
250
+ return axios(config);
251
+ }
228
252
  /**
229
253
  * 统一处理请求返回
230
254
  *
@@ -0,0 +1,39 @@
1
+ /**
2
+ * 字符串工具类
3
+ *
4
+ * @author chitanda
5
+ * @date 2021-04-23 20:04:27
6
+ * @export
7
+ * @class StringUtil
8
+ */
9
+ export declare class StringUtil {
10
+ /**
11
+ * 上下文替换正则
12
+ *
13
+ * @author chitanda
14
+ * @date 2021-04-23 20:04:01
15
+ * @static
16
+ */
17
+ static contextReg: RegExp;
18
+ /**
19
+ * 数据替换正则
20
+ *
21
+ * @author chitanda
22
+ * @date 2021-04-23 20:04:09
23
+ * @static
24
+ */
25
+ static dataReg: RegExp;
26
+ /**
27
+ * 填充字符串中的数据
28
+ *
29
+ * @author chitanda
30
+ * @date 2021-04-23 20:04:17
31
+ * @static
32
+ * @param {string} str
33
+ * @param {*} [context]
34
+ * @param {*} [data]
35
+ * @return {*} {string}
36
+ */
37
+ static fill(str: string, context?: IContext, data?: IData): string;
38
+ }
39
+ //# sourceMappingURL=string-util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string-util.d.ts","sourceRoot":"","sources":["../../../src/utils/string-util/string-util.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,qBAAa,UAAU;IACrB;;;;;;OAMG;IACH,MAAM,CAAC,UAAU,SAAgD;IAEjE;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,SAA6C;IAE3D;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,KAAK,GAAG,MAAM;CAmBnE"}
@@ -0,0 +1,57 @@
1
+ import { notNilEmpty } from 'qx-util';
2
+ /**
3
+ * 字符串工具类
4
+ *
5
+ * @author chitanda
6
+ * @date 2021-04-23 20:04:27
7
+ * @export
8
+ * @class StringUtil
9
+ */
10
+ export class StringUtil {
11
+ /**
12
+ * 填充字符串中的数据
13
+ *
14
+ * @author chitanda
15
+ * @date 2021-04-23 20:04:17
16
+ * @static
17
+ * @param {string} str
18
+ * @param {*} [context]
19
+ * @param {*} [data]
20
+ * @return {*} {string}
21
+ */
22
+ static fill(str, context, data) {
23
+ if (notNilEmpty(str)) {
24
+ if (notNilEmpty(context)) {
25
+ const strArr = str.match(this.contextReg);
26
+ strArr === null || strArr === void 0 ? void 0 : strArr.forEach(_key => {
27
+ const key = _key.slice(10, _key.length - 1);
28
+ str = str.replace(`\${context.${key}}`, context[key] || '');
29
+ });
30
+ }
31
+ if (notNilEmpty(data)) {
32
+ const strArr = str.match(this.dataReg);
33
+ strArr === null || strArr === void 0 ? void 0 : strArr.forEach(_key => {
34
+ const key = _key.slice(7, _key.length - 1);
35
+ str = str.replace(`\${data.${key}}`, data[key] || '');
36
+ });
37
+ }
38
+ }
39
+ return str;
40
+ }
41
+ }
42
+ /**
43
+ * 上下文替换正则
44
+ *
45
+ * @author chitanda
46
+ * @date 2021-04-23 20:04:01
47
+ * @static
48
+ */
49
+ StringUtil.contextReg = /\$\{context.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g;
50
+ /**
51
+ * 数据替换正则
52
+ *
53
+ * @author chitanda
54
+ * @date 2021-04-23 20:04:09
55
+ * @static
56
+ */
57
+ StringUtil.dataReg = /\$\{data.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 设置远程样式表
3
+ *
4
+ * @author lxm
5
+ * @date 2023-02-09 05:46:49
6
+ * @export
7
+ * @param {string} url
8
+ * @returns {*} {Promise<void>}
9
+ */
10
+ export declare function setRemoteStyle(url: string): Promise<void>;
11
+ //# sourceMappingURL=remote-style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-style.d.ts","sourceRoot":"","sources":["../../../src/utils/style/remote-style.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAU/D"}
@@ -0,0 +1,22 @@
1
+ import { Logger } from '../logger/logger';
2
+ /**
3
+ * 设置远程样式表
4
+ *
5
+ * @author lxm
6
+ * @date 2023-02-09 05:46:49
7
+ * @export
8
+ * @param {string} url
9
+ * @returns {*} {Promise<void>}
10
+ */
11
+ export async function setRemoteStyle(url) {
12
+ try {
13
+ const res = await ibiz.net.get(url);
14
+ const styleDom = document.createElement('style');
15
+ styleDom.setAttribute('title', 'app-style-css');
16
+ styleDom.innerText = res.data;
17
+ document.head.appendChild(styleDom);
18
+ }
19
+ catch (error) {
20
+ Logger.debug('加载远程样式表失败', url);
21
+ }
22
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"count-latch.d.ts","sourceRoot":"","sources":["../../../src/utils/sync/count-latch.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,OAAO,CAA8B;IAE7C,OAAO,CAAC,OAAO,CAAwC;IAEvD;;;;;;OAMG;IACH,KAAK,EAAE,MAAM,CAAK;IAElB;;;;;;OAMG;IACH,OAAO,CAAC,YAAY;IAMpB;;;;;;OAMG;IACH,OAAO,CAAC,UAAU;IAQlB;;;;;;OAMG;IACH,IAAI;IAOJ;;;;;;OAMG;IACH,MAAM;IAWN;;;;;OAKG;IACG,KAAK;CAKZ"}
1
+ {"version":3,"file":"count-latch.d.ts","sourceRoot":"","sources":["../../../src/utils/sync/count-latch.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,OAAO,CAA8B;IAE7C,OAAO,CAAC,OAAO,CAAwC;IAEvD;;;;;;OAMG;IACH,KAAK,EAAE,MAAM,CAAK;IAElB;;;;;;OAMG;IACH,OAAO,CAAC,YAAY;IAMpB;;;;;;OAMG;IACH,OAAO,CAAC,UAAU;IAQlB;;;;;;OAMG;IACH,IAAI;IAOJ;;;;;;OAMG;IACH,MAAM;IAUN;;;;;OAKG;IACG,KAAK;CAKZ"}
@@ -72,7 +72,6 @@ export class CountLatch {
72
72
  }
73
73
  this.count -= 1;
74
74
  if (this.count === 0) {
75
- debugger;
76
75
  this.endPromise();
77
76
  }
78
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/core",
3
- "version": "0.0.3-beta.2",
3
+ "version": "0.0.3-beta.3",
4
4
  "description": "核心包",
5
5
  "type": "module",
6
6
  "main": "out/index.js",
@@ -45,5 +45,5 @@
45
45
  "lodash-es": "^4.17.21",
46
46
  "qx-util": "^0.4.4"
47
47
  },
48
- "gitHead": "e1b8498581e0672ad4a39337ff06d9b0a0f9aa55"
48
+ "gitHead": "5db494cb73fa734ceb7d8988d63d886ddec2afee"
49
49
  }
@@ -20,4 +20,14 @@ export class CoreConst {
20
20
  * @static
21
21
  */
22
22
  static readonly TOKEN = 'access_token';
23
+
24
+ /**
25
+ * 访问令牌标识过期时间
26
+ *
27
+ * @author lxm
28
+ * @date 2023-02-13 07:11:33
29
+ * @static
30
+ * @memberof CoreConst
31
+ */
32
+ static readonly TOKEN_EXPIRES = 'access_token_expires';
23
33
  }
@@ -4,6 +4,7 @@ export { Namespace } from './namespace/namespace';
4
4
  export { IHttpResponse, HttpResponse } from './net/http-response';
5
5
  export { Net } from './net/net';
6
6
  export { plural, pluralLower } from './plural/plural';
7
+ export { StringUtil } from './string-util/string-util';
7
8
  export * from './util/util';
8
9
  export * from './url-helper/url-helper';
9
10
  export * from './event/event';
@@ -13,3 +14,4 @@ export * from './download-file/download-file';
13
14
  export * from './upload/select-file';
14
15
  export * from './upload/upload-file';
15
16
  export * from './sync';
17
+ export * from './style/remote-style';
@@ -33,6 +33,15 @@ export class Net {
33
33
  */
34
34
  protected instance: AxiosInstance;
35
35
 
36
+ /**
37
+ * 是否为 http || https 开头
38
+ *
39
+ * @author chitanda
40
+ * @date 2022-11-07 14:11:28
41
+ * @protected
42
+ */
43
+ protected urlReg = /^http[s]?:\/\/[^\s]*/;
44
+
36
45
  /**
37
46
  * Creates an instance of Net.
38
47
  * @author lxm
@@ -113,10 +122,15 @@ export class Net {
113
122
  * @returns {*}
114
123
  */
115
124
  protected mergeConfig(...configs: AxiosRequestConfig[]) {
125
+ const config = this.presetConfig;
116
126
  if (configs.length === 0) {
117
- return this.presetConfig;
127
+ return config;
128
+ }
129
+ const { url } = configs[0];
130
+ if (url && this.urlReg.test(url)) {
131
+ delete config.baseURL;
118
132
  }
119
- return merge(this.presetConfig, ...configs);
133
+ return merge(config, ...configs);
120
134
  }
121
135
 
122
136
  /**
@@ -282,6 +296,18 @@ export class Net {
282
296
  }
283
297
  }
284
298
 
299
+ /**
300
+ * 创建标准 axios 请求
301
+ *
302
+ * @author chitanda
303
+ * @date 2023-01-30 15:01:27
304
+ * @param {AxiosRequestConfig<IData>} config
305
+ * @return {*}
306
+ */
307
+ axios(config: AxiosRequestConfig<IData>) {
308
+ return axios(config);
309
+ }
310
+
285
311
  /**
286
312
  * 统一处理请求返回
287
313
  *
@@ -0,0 +1,60 @@
1
+ import { notNilEmpty } from 'qx-util';
2
+
3
+ /**
4
+ * 字符串工具类
5
+ *
6
+ * @author chitanda
7
+ * @date 2021-04-23 20:04:27
8
+ * @export
9
+ * @class StringUtil
10
+ */
11
+ export class StringUtil {
12
+ /**
13
+ * 上下文替换正则
14
+ *
15
+ * @author chitanda
16
+ * @date 2021-04-23 20:04:01
17
+ * @static
18
+ */
19
+ static contextReg = /\$\{context.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g;
20
+
21
+ /**
22
+ * 数据替换正则
23
+ *
24
+ * @author chitanda
25
+ * @date 2021-04-23 20:04:09
26
+ * @static
27
+ */
28
+ static dataReg = /\$\{data.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g;
29
+
30
+ /**
31
+ * 填充字符串中的数据
32
+ *
33
+ * @author chitanda
34
+ * @date 2021-04-23 20:04:17
35
+ * @static
36
+ * @param {string} str
37
+ * @param {*} [context]
38
+ * @param {*} [data]
39
+ * @return {*} {string}
40
+ */
41
+ static fill(str: string, context?: IContext, data?: IData): string {
42
+ if (notNilEmpty(str)) {
43
+ if (notNilEmpty(context)) {
44
+ const strArr = str.match(this.contextReg);
45
+ strArr?.forEach(_key => {
46
+ const key = _key.slice(10, _key.length - 1);
47
+ str = str.replace(`\${context.${key}}`, context![key] || '');
48
+ });
49
+ }
50
+ if (notNilEmpty(data)) {
51
+ const strArr = str.match(this.dataReg);
52
+ strArr?.forEach(_key => {
53
+ const key = _key.slice(7, _key.length - 1);
54
+ str = str.replace(`\${data.${key}}`, data![key] || '');
55
+ });
56
+ }
57
+ }
58
+ return str;
59
+ }
60
+ }
@@ -0,0 +1,22 @@
1
+ import { Logger } from '../logger/logger';
2
+
3
+ /**
4
+ * 设置远程样式表
5
+ *
6
+ * @author lxm
7
+ * @date 2023-02-09 05:46:49
8
+ * @export
9
+ * @param {string} url
10
+ * @returns {*} {Promise<void>}
11
+ */
12
+ export async function setRemoteStyle(url: string): Promise<void> {
13
+ try {
14
+ const res = await ibiz.net.get(url);
15
+ const styleDom = document.createElement('style');
16
+ styleDom.setAttribute('title', 'app-style-css');
17
+ styleDom.innerText = res.data as unknown as string;
18
+ document.head.appendChild(styleDom);
19
+ } catch (error) {
20
+ Logger.debug('加载远程样式表失败', url);
21
+ }
22
+ }
@@ -77,7 +77,6 @@ export class CountLatch {
77
77
  }
78
78
  this.count -= 1;
79
79
  if (this.count === 0) {
80
- debugger;
81
80
  this.endPromise();
82
81
  }
83
82
  }