@ibiz-template/core 0.0.1-beta.1 → 0.0.1-beta.141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/system/index.system.js +1 -1
- package/out/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/context/index.d.ts +63 -4
- package/out/context/index.d.ts.map +1 -1
- package/out/context/index.js +73 -3
- package/out/environment/environment.d.ts.map +1 -1
- package/out/environment/environment.js +6 -0
- package/out/error/http-error/http-error.d.ts.map +1 -1
- package/out/error/http-error/http-error.js +0 -4
- package/out/interface/click-outside/click-outside.d.ts +1 -1
- package/out/interface/click-outside/click-outside.d.ts.map +1 -1
- package/out/interface/i-environment/i-environment.d.ts +44 -0
- package/out/interface/i-environment/i-environment.d.ts.map +1 -1
- package/out/types.d.ts +31 -0
- package/out/types.d.ts.map +1 -1
- package/out/utils/data-type/data-types.d.ts +47 -0
- package/out/utils/data-type/data-types.d.ts.map +1 -0
- package/out/utils/data-type/data-types.js +96 -0
- package/out/utils/download-file/download-file.d.ts +10 -0
- package/out/utils/download-file/download-file.d.ts.map +1 -1
- package/out/utils/download-file/download-file.js +20 -0
- package/out/utils/index.d.ts +6 -0
- package/out/utils/index.d.ts.map +1 -1
- package/out/utils/index.js +6 -0
- package/out/utils/interceptor/core-interceptor.d.ts +1 -2
- package/out/utils/interceptor/core-interceptor.d.ts.map +1 -1
- package/out/utils/interceptor/core-interceptor.js +12 -7
- package/out/utils/interceptor/interceptor.d.ts +6 -6
- package/out/utils/interceptor/interceptor.d.ts.map +1 -1
- package/out/utils/interceptor/interceptor.js +2 -2
- package/out/utils/logger/logger.d.ts +1 -1
- package/out/utils/logger/logger.d.ts.map +1 -1
- package/out/utils/logger/logger.js +1 -1
- package/out/utils/net/http-response.d.ts +1 -3
- package/out/utils/net/http-response.d.ts.map +1 -1
- package/out/utils/net/net.d.ts +30 -13
- package/out/utils/net/net.d.ts.map +1 -1
- package/out/utils/net/net.js +37 -11
- 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 +151 -0
- package/out/utils/util/ie-helper.d.ts +12 -0
- package/out/utils/util/ie-helper.d.ts.map +1 -0
- package/out/utils/util/ie-helper.js +20 -0
- package/package.json +13 -11
- package/src/constant/core/core.ts +10 -0
- package/src/context/index.ts +115 -5
- package/src/environment/environment.ts +6 -0
- package/src/error/http-error/http-error.ts +0 -4
- package/src/interface/i-environment/i-environment.ts +50 -0
- package/src/types.ts +35 -0
- package/src/utils/data-type/data-types.ts +99 -0
- package/src/utils/download-file/download-file.ts +21 -0
- package/src/utils/index.ts +6 -0
- package/src/utils/interceptor/core-interceptor.ts +16 -11
- package/src/utils/interceptor/interceptor.ts +7 -9
- package/src/utils/logger/logger.ts +1 -1
- package/src/utils/net/http-response.ts +1 -5
- package/src/utils/net/net.ts +45 -22
- 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 +207 -0
- package/src/utils/util/ie-helper.ts +42 -0
- package/LICENSE +0 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["lodash-es","qx-util","axios","qs","pluralize"],(function(e){"use strict";var t,n,o,r,i,s,c;return{setters:[function(e){t=e.debounce,n=e.merge},function(e){o=e.getCookie,r=e.notNilEmpty},function(e){i=e.default},function(e){s=e.stringify},function(e){c=e.default}],execute:function(){function a(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({calcMimeByFileName:F,colorBlend:function(e,t,n,o){void 0===n&&(n=.5);void 0===o&&(o="hex");e=e.trim(),t=t.trim();var r=q(e),i=q(t),s=[B((1-n)*r[0]+n*i[0]),B((1-n)*r[1]+n*i[1]),B((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":B(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,n,o){var r,i=this,s=[],c=t((function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return w(i,void 0,void 0,(function(){var n,o;return b(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,R([],m(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=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return w(i,void 0,void 0,(function(){var t;return b(this,(function(o){return t=e,r&&(t=n(r,t)),r=t,c.apply(void 0,R([],m(t),!1)),[2,new Promise((function(e,t){s.push({resolve:e,reject:t})}))]}))}))}},debounceAndMerge:function(e,n,o){var r,i=t((function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r=void 0,e.apply(void 0,R([],m(t),!1))}),o);return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var o=e;return r&&(o=n(r,o)),r=o,i.apply(void 0,R([],m(o),!1))}},downloadFileFromBlob:function(e,t){var n=F(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:A,getToken:E,install:function(){if(window.ibiz)throw new Error("ibiz 已经存在, 无需重复安装");window.ibiz=new z,window.___fc=new D,ibiz.net.addInterceptor("CoreInterceptor",new T)},isEventInside:M,isOverlap:function(e,t){return Array.from(new Set(R(R([],m(e),!1),m(t),!1))).length!==e.length+t.length},listenJSEvent:_,onClickOutside:function(e,t,n){void 0===n&&(n={});var o=n.window,r=void 0===o?N:o,i=n.ignore,s=void 0===i?[]:i,c=n.capture,a=void 0===c||c;if(!e)throw new y("target元素不存在");if(!r)throw new y("找不到window");var u,l=!0,p=function(t){return!R([e],m(s),!1).some((function(e){return M(t,e)}))},f=!1,d=function(e){f||(r.clearTimeout(u),l&&p(e)&&t(e))},h=[_(r,"click",d,{passive:!0,capture:a}),_(r,"pointerdown",(function(e){f||(l=p(e))}),{passive:!0}),_(r,"pointerup",(function(e){if(!f&&0===e.button){var t=A(e);e.composedPath=function(){return t},u=r.setTimeout((function(){return d(e)}),50)}}),{passive:!0})].filter(Boolean);return{stop:function(){return h.forEach((function(e){return e()}))},pause:function(){f=!0},proceed:function(){f=!1}}},plural:I,pluralLower:function(e){return I(e).toLowerCase()}});var u,l,p=e("CoreConst",function(){function e(){}return e.DEFAULT_MODEL_SERVICE_TAG="default",e.TOKEN="access_token",e}()),f=e("NOOP",(function(){})),d=e("HttpStatusMessageConst",{200:"服务器成功返回请求的数据。",201:"新建或修改数据成功。",202:"一个请求已经进入后台排队(异步任务)。",204:"删除数据成功。",400:"发出的请求有错误,服务器没有进行新建或修改数据的操作。",401:"用户没有权限(令牌、用户名、密码错误)。",403:"用户得到授权,但是访问是被禁止的。",404:"发出的请求针对的是不存在的记录,服务器没有进行操作。",406:"请求的格式不可得。",410:"请求的资源被永久删除,且不会再得到的。",422:"当创建一个对象时,发生一个验证错误。",500:"服务器发生错误,请检查服务器。",502:"网关错误。",503:"服务不可用,服务器暂时过载或维护。",504:"网关超时。"});e("LoginMode",u),function(e){e.DEFAULT="DEFAULT",e.CUSTOM="CUSTOM",e.CAS="CAS"}(u||e("LoginMode",u={})),e("MenuPermissionMode",l),function(e){e.MIXIN="MIXIN",e.RESOURCE="RESOURCE",e.RT="RT"}(l||e("MenuPermissionMode",l={}));e("IBizContext",(function(e,t){if(void 0===e&&(e={}),t){var n=this;Object.defineProperty(this,"_context",{enumerable:!1,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)}));var h=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:u.DEFAULT,menuPermissionMode:l.MIXIN,enablePermission:!0}),v=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=d[t.status]),this.message||(this.message="网络异常,请稍后重试!"),this.status=t.status):(this.message=e.message,this.status=500)})),y=e("RuntimeError",(function(e){this.message=e,this.name="Runtime Error"})),g=function(e,t){return g=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])},g(e,t)};function w(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 b(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(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){s.label=i[1];break}if(6===i[0]&&s.label<r[1]){s.label=r[1],r=i;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(i);break}r[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}function m(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 R(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 E(){return o(p.TOKEN)}var k,O,C,L=e("Interceptor",function(){function e(){}return e.prototype.onBeforeRequest=function(e){return w(this,void 0,void 0,(function(){return b(this,(function(t){return[2,e]}))}))},e.prototype.onRequestError=function(e){return Promise.reject(e)},e.prototype.onResponseSuccess=function(e){return w(this,void 0,void 0,(function(){return b(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}()),T=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}g(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.onBeforeRequest=function(t){return w(this,void 0,void 0,(function(){var n;return b(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(E()),(n=ibiz.orgData)&&(n.systemid&&(t.headers.srfsystemid=n.systemid),n.orgid&&(t.headers.srforgid=n.orgid)),[2,t]}}))}))},t}(L)),x="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},P={exports:{}};O=x,C=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 d=typeof window!==t?window.log:void 0;return p.noConflict=function(){return typeof window!==t&&window.log===p&&(window.log=d),p},p.getLoggers=function(){return f},p.default=p,p},(k=P).exports?k.exports=C():O.log=C();var U=a({__proto__:null,default:P.exports},[P.exports]);e("Logger",U);function j(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=""),j(this.namespace,this.block,e,"","")},e.prototype.e=function(e){return e?j(this.namespace,this.block,"",e,""):""},e.prototype.m=function(e){return e?j(this.namespace,this.block,"","",e):""},e.prototype.be=function(e,t){return e&&t?j(this.namespace,this.block,e,t,""):""},e.prototype.em=function(e,t){return e&&t?j(this.namespace,this.block,"",e,t):""},e.prototype.bm=function(e,t){return e&&t?j(this.namespace,this.block,e,"",t):""},e.prototype.bem=function(e,t,n){return e&&t&&n?j(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 S=e("Net",function(){function e(e){this.interceptors=new Map,this.instance=i.create(e)}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:this.instance.defaults.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];return 0===e.length?this.presetConfig:n.apply(void 0,R([this.presetConfig],m(e),!1))},e.prototype.post=function(e,t,n,o){return void 0===n&&(n={}),void 0===o&&(o={}),w(this,void 0,void 0,(function(){var r,i;return b(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 v(i);case 4:return[2]}}))}))},e.prototype.get=function(e,t,o,r){return void 0===t&&(t={}),void 0===o&&(o={}),void 0===r&&(r={}),w(this,void 0,void 0,(function(){var i,s;return b(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,n({method:"get",headers:o},r))];case 2:return i=c.sent(),[2,this.doResponseResult(i)];case 3:throw s=c.sent(),new v(s);case 4:return[2]}}))}))},e.prototype.delete=function(e,t,n){return void 0===n&&(n={}),w(this,void 0,void 0,(function(){var o,r;return b(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 v(r);case 4:return[2]}}))}))},e.prototype.put=function(e,t,n,o){return void 0===n&&(n={}),void 0===o&&(o={}),w(this,void 0,void 0,(function(){var r,i;return b(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 v(i);case 4:return[2]}}))}))},e.prototype.getModel=function(e,t){return void 0===t&&(t={}),w(this,void 0,void 0,(function(){var n,o;return b(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 v(o);case 3:return[2]}}))}))},e.prototype.request=function(e,t){return void 0===t&&(t={}),w(this,void 0,void 0,(function(){var n,o;return b(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 v(o);case 3:return[2]}}))}))},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")&&r(t[e])&&(o[e]=t[e])})),this.attachUrlParam(e,t)}return e},e.prototype.attachUrlParam=function(e,t){var n=s(t);return r(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 I(e){return c(e)}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 A(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 _(e,t,n,o){void 0===o&&(o={}),e.addEventListener(t,n,o);var r=function(){e.removeEventListener(t,n,o),r=f};return function(){r()}}function M(e,t){return t&&(e.target===t||A(e).includes(t))}var N="undefined"!=typeof window?window:void 0;var B=Math.round;function q(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?B((o>>24&255)/255*1e4)/1e4:1}return n}function F(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;default:t=""}return t}var z=e("IBizSys",(function(){this.env=h,this.log=U,this.net=new S})),D=e("FactoryCenter",(function(){}))}}}));
|
|
1
|
+
System.register(["ramda","lodash-es","qx-util","loglevel","axios","qs","pluralize"],(function(t){"use strict";var e,n,r,o,i,s,c,a,u,l,p,f,h;return{setters:[function(t){e=t.clone},function(t){n=t.debounce,r=t.merge,o=t.uniqueId,i=t.isFunction,s=t.round,c=t.cloneDeep},function(t){a=t.getCookie,u=t.notNilEmpty},function(e){l=e.default,t("Logger",e.default)},function(t){p=t.default},function(t){f=t.default},function(t){h=t.default}],execute:function(){t({awaitTimeout:function(t,e,n){return R(this,void 0,void 0,(function(){return A(this,(function(r){switch(r.label){case 0:return[4,new Promise((function(e){setTimeout((function(){e(!0)}),t)}))];case 1:return r.sent(),e?[2,e.apply(void 0,I([],T(n||[]),!1))]:[2]}}))}))},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=B(t),i=B(e),s=[U((1-n)*o[0]+n*i[0]),U((1-n)*o[1]+n*i[1]),U((1-n)*o[2]+n*i[2]),(1-n)*o[3]+n*i[3]];if("hex"===r){var c=[s[0].toString(16),s[1].toString(16),s[2].toString(16),0===s[3]?"00":U(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(t,e,r){var o,i=this,s=[],c=n((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return R(i,void 0,void 0,(function(){var n,r;return A(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,I([],T(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=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return R(i,void 0,void 0,(function(){var n;return A(this,(function(r){return n=t,o&&(n=e(o,n)),o=n,c.apply(void 0,I([],T(n),!1)),[2,new Promise((function(t,e){s.push({resolve:t,reject:e})}))]}))}))}},debounceAndMerge:function(t,e,r){var o,i=n((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return o=void 0,t.apply(void 0,I([],T(e),!1))}),r);return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t;return o&&(r=e(o,r)),o=r,i.apply(void 0,I([],T(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:C,fileListToArr:q,getToken:P,install:function(){if(window.ibiz)throw new Error("ibiz 已经存在, 无需重复安装");window.ibiz=new F,window.___fc=new V,ibiz.net.addInterceptor("CoreInterceptor",new k)},isEventInside:j,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(I(I([],T(t),!1),T(e),!1))).length!==t.length+e.length},listenJSEvent:S,onClickOutside:function(t,e,n){void 0===n&&(n={});var r=n.window,o=void 0===r?_:r,i=n.ignore,s=void 0===i?[]:i,c=n.capture,a=void 0===c||c;if(!t)throw new w("target元素不存在");if(!o)throw new w("找不到window");var u,l=!0,p=function(e){return!I([t],T(s),!1).some((function(t){return j(e,t)}))},f=!1,h=function(t){f||(o.clearTimeout(u),l&&p(t)&&e(t))},d=[S(o,"click",h,{passive:!0,capture:a}),S(o,"pointerdown",(function(t){f||(l=p(t))}),{passive:!0}),S(o,"pointerup",(function(t){if(!f&&0===t.button){var e=C(t);t.composedPath=function(){return e},u=o.setTimeout((function(){return h(t)}),50)}}),{passive:!0})].filter(Boolean);return{stop:function(){return d.forEach((function(t){return t()}))},pause:function(){f=!0},proceed:function(){f=!1}}},plural:x,pluralLower:function(t){return x(t).toLowerCase()},promiseAllSettled:L,selectFile:D,uploadFile:function(t){var e=this,n=r({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),a=function(t,r){return R(e,void 0,void 0,(function(){var e;return A(this,(function(o){switch(o.label){case 0:return n.request&&i(n.request)?[2,n.request(t)]:(e=new FormData,t.forEach((function(t){e.append("file",t)})),[4,ibiz.net.request(n.uploadUrl,{method:"post",baseURL:"",data:e,headers:{"Content-Type":"multipart/form-data"},onUploadProgress:r})]);case 1:return[2,o.sent()]}}))}))},u=function(t){return R(e,void 0,void 0,(function(){var e,r,i;return A(this,(function(u){switch(u.label){case 0:if(e=t.map((function(t){return{status:"uploading",name:t.name,uid:o(),percentage:0}})),!n.beforeUpload(t,e))return e.forEach((function(t){t.status="cancel"})),ibiz.log.debug("取消上传",e),[2,e];u.label=1;case 1:return u.trys.push([1,3,,4]),[4,a(t,(function(t){!function(t,e){e.forEach((function(e){e.percentage=s(100*t.progress)})),n.progress(c(e))}(t,e)}))];case 2:return r=u.sent(),e.forEach((function(t){t.status="finished"})),n.success(e,r),e.forEach((function(t){t.response=r})),[3,4];case 3:return i=u.sent(),e.forEach((function(t){t.status="fail"})),n.error(e,i),e.forEach((function(t){t.error=i})),ibiz.log.error(i),ibiz.log.error("".concat(t.map((function(t){return t.name})).join(","),"上传失败")),[3,4];case 4:return[2,e]}}))}))};D({accept:n.accept,multiple:n.multiple,onSelected:function(t){!function(t){R(e,void 0,void 0,(function(){var e,r,o=this;return A(this,(function(i){switch(i.label){case 0:return[4,L((n.separate?t.map((function(t){return[t]})):[t]).map((function(t){return R(o,void 0,void 0,(function(){return A(this,(function(e){return[2,u(t)]}))}))})))];case 1:return e=i.sent(),r=[],e.forEach((function(t){"fulfilled"===t.status&&r.push.apply(r,I([],T(t.value),!1))})),n.finish(r),[2]}}))}))}(t)}})}});var d,v,m=t("CoreConst",function(){function t(){}return t.DEFAULT_MODEL_SERVICE_TAG="default",t.TOKEN="access_token",t.TOKEN_EXPIRES="access_token_expires",t}()),g=t("NOOP",(function(){}));t("HttpStatusMessageConst",{200:"服务器成功返回请求的数据。",201:"新建或修改数据成功。",202:"一个请求已经进入后台排队(异步任务)。",204:"删除数据成功。",400:"发出的请求有错误,服务器没有进行新建或修改数据的操作。",401:"用户没有权限(令牌、用户名、密码错误)。",403:"用户得到授权,但是访问是被禁止的。",404:"发出的请求针对的是不存在的记录,服务器没有进行操作。",406:"请求的格式不可得。",410:"请求的资源被永久删除,且不会再得到的。",422:"当创建一个对象时,发生一个验证错误。",500:"服务器发生错误,请检查服务器。",502:"网关错误。",503:"服务不可用,服务器暂时过载或维护。",504:"网关超时。"});t("LoginMode",d),function(t){t.DEFAULT="DEFAULT",t.CUSTOM="CUSTOM",t.CAS="CAS"}(d||t("LoginMode",d={})),t("MenuPermissionMode",v),function(t){t.MIXIN="MIXIN",t.RESOURCE="RESOURCE",t.RT="RT"}(v||t("MenuPermissionMode",v={}));t("IBizContext",function(){function t(t,e){if(void 0===t&&(t={}),Object.defineProperty(this,"_associationContext",{enumerable:!1,value:[]}),e){var n=this;Object.defineProperty(this,"_parent",{enumerable:!1,writable:!0,value:e}),Object.defineProperty(this,"_context",{enumerable:!1,writable:!0,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.prototype.destroy=function(){this._parent=void 0,this._context={},this._associationContext.forEach((function(t){t.destroy()}))},t.prototype.clone=function(){var n=new t(e(this.getOwnContext()),this._parent);return this._associationContext.push(n),n},t.create=function(e,n){return new t(e,n)},t}());var b=t("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",disableLogout:!1}),y=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)})),w=t("RuntimeError",(function(t){this.message=t,this.name="Runtime Error"})),E=function(t,e){return E=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])},E(t,e)};function R(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{a(r.next(t))}catch(t){i(t)}}function c(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,c)}a((r=r.apply(t,e||[])).next())}))}function A(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: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,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,r=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){s=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){s.label=c[1];break}if(6===c[0]&&s.label<o[1]){s.label=o[1],o=c;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(c);break}o[2]&&s.ops.pop(),s.trys.pop();continue}c=e.call(t,s)}catch(t){c=[6,t],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}}function T(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 I(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))}function P(){return a(m.TOKEN)}var M=t("Interceptor",function(){function t(){}return t.prototype.onBeforeRequest=function(t){return R(this,void 0,void 0,(function(){return A(this,(function(e){return[2,t]}))}))},t.prototype.onRequestError=function(t){return Promise.reject(t)},t.prototype.onResponseSuccess=function(t){return R(this,void 0,void 0,(function(){return A(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}()),k=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}E(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.onBeforeRequest=function(e){return R(this,void 0,void 0,(function(){var n,r,o;return A(this,(function(i){switch(i.label){case 0:return[4,t.prototype.onBeforeRequest.call(this,e)];case 1:return e=i.sent(),(n=e.headers).Authorization="Bearer ".concat(P()),r=ibiz.env.dcSystem,(o=ibiz.orgData)&&(o.systemid&&(r=o.systemid),o.orgid&&(n.srforgid=o.orgid)),n.srfsystemid=r,[2,e]}}))}))},e}(M));function O(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=""),O(this.namespace,this.block,t,"","")},t.prototype.e=function(t){return t?O(this.namespace,this.block,"",t,""):""},t.prototype.m=function(t){return t?O(this.namespace,this.block,"","",t):""},t.prototype.be=function(t,e){return t&&e?O(this.namespace,this.block,t,e,""):""},t.prototype.em=function(t,e){return t&&e?O(this.namespace,this.block,"",t,e):""},t.prototype.bm=function(t,e){return t&&e?O(this.namespace,this.block,t,"",e):""},t.prototype.bem=function(t,e,n){return t&&e&&n?O(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={},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.urlReg=/^http[s]?:\/\/[^\s]*/,this.interceptors=new Map,this.instance=p.create(t),this.addInterceptor("Default",new k)}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:ibiz.env.baseUrl,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 n=this.presetConfig;if(0===t.length)return n;var o=t[0].url;return o&&this.urlReg.test(o)&&delete n.baseURL,r.apply(void 0,I([n],T(t),!1))},t.prototype.post=function(t,e,n,r){return void 0===n&&(n={}),void 0===r&&(r={}),R(this,void 0,void 0,(function(){var o,i;return A(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 y(i);case 4:return[2]}}))}))},t.prototype.get=function(t,e,n,o){return void 0===e&&(e={}),void 0===n&&(n={}),void 0===o&&(o={}),R(this,void 0,void 0,(function(){var i,s;return A(this,(function(c){switch(c.label){case 0:t=this.attachUrlParam(t,e),c.label=1;case 1:return c.trys.push([1,3,,4]),[4,this.request(t,r({method:"get",headers:n},o))];case 2:return i=c.sent(),[2,this.doResponseResult(i)];case 3:throw s=c.sent(),new y(s);case 4:return[2]}}))}))},t.prototype.delete=function(t,e,n){return void 0===n&&(n={}),R(this,void 0,void 0,(function(){var r,o;return A(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 y(o);case 4:return[2]}}))}))},t.prototype.put=function(t,e,n,r){return void 0===n&&(n={}),void 0===r&&(r={}),R(this,void 0,void 0,(function(){var o,i;return A(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 y(i);case 4:return[2]}}))}))},t.prototype.getModel=function(t,e){return void 0===e&&(e={}),R(this,void 0,void 0,(function(){var n,r;return A(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 y(r);case 3:return[2]}}))}))},t.prototype.request=function(t,e){return void 0===e&&(e={}),R(this,void 0,void 0,(function(){var n,r;return A(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 y(r);case 3:return[2]}}))}))},t.prototype.axios=function(t){return p(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")&&u(e[t])&&(r[t]=e[t])})),this.attachUrlParam(t,e)}return t},t.prototype.attachUrlParam=function(t,e){var n=f.stringify(e);return u(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 x(t){return h(t)}function L(t){return Promise.all(function(t){return t.map((function(t){return t.then((function(t){return{status:"fulfilled",value:t}}),(function(t){return{status:"rejected",reason:t}}))}))}(t))}h.addPluralRule(/(matr|vert|ind)ix|ex$/,"$1ices");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 C(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 S(t,e,n,r){void 0===r&&(r={}),t.addEventListener(e,n,r);var o=function(){t.removeEventListener(e,n,r),o=g};return function(){o()}}function j(t,e){return e&&(t.target===e||C(t).includes(e))}var _="undefined"!=typeof window?window:void 0;var U=Math.round;function B(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?U((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 q(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n]);return e}function D(t){var e=r({multiple:!0,accept:""},t),n=document.createElement("input");n.setAttribute("type","file"),n.setAttribute("multiple","".concat(e.multiple)),n.setAttribute("accept",e.accept),n.onchange=function(t){var n=t.target,r=n.files?q(n.files):[];0!==r.length&&(e.onSelected(r),n.value="")},document.body.appendChild(n),n.click(),document.body.removeChild(n)}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 w("lock和unlock次数不匹配!");this.count-=1,0===this.count&&this.endPromise()},t.prototype.await=function(){return R(this,void 0,void 0,(function(){return A(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}()),t("StringUtil",function(){function t(){}return t.fill=function(t,e,n){if(u(t)){var r;if(u(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(u(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.dynamicMatch=function(t,e){return t.replace(/\${(.*?)}/g,(function(t,n){var r=T(n.split("."),2),o=r[0],i=r[1],s=e[o];return s?s[i]:""}))},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("DataTypes",function(){function t(){}return t.isNumber=function(t){return["BIGINT","BINARY","DECIMAL","FLOAT","INT","MONEY","NUMERIC","REAL","SMALLINT","SMALLMONEY","TINYINT","VARBINARY"].includes(this.toString(t))},t.isDate=function(t){return["DATETIME","SMALLDATETIME","DATE","TIME"].includes(this.toString(t))},t.toString=function(t){return this.typeMap[t]},t.typeMap={0:"UNKNOWN",1:"BIGINT",2:"BINARY",3:"BIT",4:"CHAR",5:"DATETIME",6:"DECIMAL",7:"FLOAT",8:"IMAGE",9:"INT",10:"MONEY",11:"NCHAR",12:"NTEXT",13:"NVARCHAR",14:"NUMERIC",15:"REAL",16:"SMALLDATETIME",17:"SMALLINT",18:"SMALLMONEY",19:"SQL_VARIANT",20:"SYSNAME",21:"TEXT",22:"TIMESTAMP",23:"TINYINT",24:"VARBINARY",25:"VARCHAR",26:"UNIQUEIDENTIFIER",27:"DATE",28:"TIME",29:"BIGDECIMAL"},t}());var F=t("IBizSys",(function(){this.env=b,this.log=l,this.net=new N})),V=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;
|
|
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/context/index.d.ts
CHANGED
|
@@ -8,15 +8,74 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export declare class IBizContext implements IContext {
|
|
10
10
|
[key: string | symbol]: any;
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* clone 后引用的上下文实例,需要在实例销毁时,同时销毁
|
|
13
|
+
*
|
|
14
|
+
* @author chitanda
|
|
15
|
+
* @date 2023-03-13 16:03:31
|
|
16
|
+
* @protected
|
|
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}
|
|
35
|
+
*/
|
|
36
|
+
_parent?: IContext;
|
|
12
37
|
/**
|
|
13
38
|
* Creates an instance of IBizContext.
|
|
14
39
|
*
|
|
15
40
|
* @author chitanda
|
|
16
41
|
* @date 2022-07-14 10:07:15
|
|
17
|
-
* @param {
|
|
18
|
-
* @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}
|
|
52
|
+
*/
|
|
53
|
+
getOwnContext(): IData;
|
|
54
|
+
/**
|
|
55
|
+
* 销毁当前上下文对象
|
|
56
|
+
*
|
|
57
|
+
* @author chitanda
|
|
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
|
|
66
|
+
* @return {*} {IBizContext}
|
|
67
|
+
*/
|
|
68
|
+
clone(): IBizContext;
|
|
69
|
+
/**
|
|
70
|
+
* 上下文只有在视图初始化时,调用 create 方法
|
|
71
|
+
*
|
|
72
|
+
* @author chitanda
|
|
73
|
+
* @date 2023-03-13 16:03:32
|
|
74
|
+
* @static
|
|
75
|
+
* @param {IData} [context]
|
|
76
|
+
* @param {IContext} [parent]
|
|
77
|
+
* @return {*} {IContext}
|
|
19
78
|
*/
|
|
20
|
-
|
|
79
|
+
static create(context?: IData, parent?: IContext): IBizContext;
|
|
21
80
|
}
|
|
22
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,3 +1,4 @@
|
|
|
1
|
+
import { clone } from 'ramda';
|
|
1
2
|
/**
|
|
2
3
|
* 上下文处理类
|
|
3
4
|
*
|
|
@@ -12,17 +13,28 @@ export class IBizContext {
|
|
|
12
13
|
*
|
|
13
14
|
* @author chitanda
|
|
14
15
|
* @date 2022-07-14 10:07:15
|
|
15
|
-
* @param {
|
|
16
|
-
* @param {
|
|
16
|
+
* @param {IData} [context={}] 自身的上下文
|
|
17
|
+
* @param {IContext} [parent]
|
|
17
18
|
*/
|
|
18
19
|
// eslint-disable-next-line default-param-last
|
|
19
20
|
constructor(context = {}, parent) {
|
|
21
|
+
Object.defineProperty(this, '_associationContext', {
|
|
22
|
+
enumerable: false,
|
|
23
|
+
value: [],
|
|
24
|
+
});
|
|
20
25
|
if (parent) {
|
|
21
26
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
22
27
|
const self = this;
|
|
23
|
-
//
|
|
28
|
+
// 定义私有变量,存放父上下文源对象
|
|
29
|
+
Object.defineProperty(this, '_parent', {
|
|
30
|
+
enumerable: false,
|
|
31
|
+
writable: true,
|
|
32
|
+
value: parent,
|
|
33
|
+
});
|
|
34
|
+
// 定义私有变量,用于存储对父已有上下文的修改。
|
|
24
35
|
Object.defineProperty(this, '_context', {
|
|
25
36
|
enumerable: false,
|
|
37
|
+
writable: true,
|
|
26
38
|
value: {},
|
|
27
39
|
});
|
|
28
40
|
// 监控父上下文参数,自身不存在时从父取
|
|
@@ -52,4 +64,62 @@ export class IBizContext {
|
|
|
52
64
|
// 合并给入上下文
|
|
53
65
|
Object.assign(this, context);
|
|
54
66
|
}
|
|
67
|
+
/**
|
|
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 创建新的局部上下文
|
|
102
|
+
*
|
|
103
|
+
* @author chitanda
|
|
104
|
+
* @date 2023-03-13 16:03:13
|
|
105
|
+
* @return {*} {IBizContext}
|
|
106
|
+
*/
|
|
107
|
+
clone() {
|
|
108
|
+
const newContext = new IBizContext(clone(this.getOwnContext()), this._parent);
|
|
109
|
+
this._associationContext.push(newContext);
|
|
110
|
+
return newContext;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* 上下文只有在视图初始化时,调用 create 方法
|
|
114
|
+
*
|
|
115
|
+
* @author chitanda
|
|
116
|
+
* @date 2023-03-13 16:03:32
|
|
117
|
+
* @static
|
|
118
|
+
* @param {IData} [context]
|
|
119
|
+
* @param {IContext} [parent]
|
|
120
|
+
* @return {*} {IContext}
|
|
121
|
+
*/
|
|
122
|
+
static create(context, parent) {
|
|
123
|
+
return new IBizContext(context, parent);
|
|
124
|
+
}
|
|
55
125
|
}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,YAqBzB,CAAC"}
|
|
@@ -17,4 +17,10 @@ export const Environment = {
|
|
|
17
17
|
loginMode: LoginMode.DEFAULT,
|
|
18
18
|
menuPermissionMode: MenuPermissionMode.MIXIN,
|
|
19
19
|
enablePermission: true,
|
|
20
|
+
enableWfAllHistory: false,
|
|
21
|
+
routePlaceholder: '-',
|
|
22
|
+
loginViewName: 'AppLoginView',
|
|
23
|
+
version: '0.0.1',
|
|
24
|
+
favicon: './favicon.ico',
|
|
25
|
+
disableLogout: false,
|
|
20
26
|
};
|
|
@@ -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
|
}
|
|
@@ -35,7 +35,7 @@ export interface OnClickOutsideOptions {
|
|
|
35
35
|
/**
|
|
36
36
|
* 回调处理函数类型
|
|
37
37
|
*/
|
|
38
|
-
export
|
|
38
|
+
export type OnClickOutsideHandler = (_evt: PointerEvent | MouseEvent) => void;
|
|
39
39
|
/**
|
|
40
40
|
* OnClickOutside返回对象类型
|
|
41
41
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"click-outside.d.ts","sourceRoot":"","sources":["../../../src/interface/click-outside/click-outside.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"click-outside.d.ts","sourceRoot":"","sources":["../../../src/interface/click-outside/click-outside.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,IAAI,EAAE,YAAY,GAAG,UAAU,KAAK,IAAI,CAAC;AAE9E;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB;;;;;OAKG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB;;;;;OAKG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB"}
|
|
@@ -131,5 +131,49 @@ export interface IEnvironment {
|
|
|
131
131
|
* @type {MenuPermissionMode}
|
|
132
132
|
*/
|
|
133
133
|
menuPermissionMode: MenuPermissionMode;
|
|
134
|
+
/**
|
|
135
|
+
* 是否让所有工作流history接口走all
|
|
136
|
+
*
|
|
137
|
+
* @type {boolean}
|
|
138
|
+
* @memberof IEnvironment
|
|
139
|
+
*/
|
|
140
|
+
enableWfAllHistory: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* 路由占位符
|
|
143
|
+
*
|
|
144
|
+
* @type {string}
|
|
145
|
+
* @memberof IEnvironment
|
|
146
|
+
*/
|
|
147
|
+
routePlaceholder: string;
|
|
148
|
+
/**
|
|
149
|
+
* 登录页视图组件名称
|
|
150
|
+
*
|
|
151
|
+
* @type {string}
|
|
152
|
+
* @memberof IEnvironment
|
|
153
|
+
*/
|
|
154
|
+
loginViewName: string;
|
|
155
|
+
/**
|
|
156
|
+
* 版本
|
|
157
|
+
*
|
|
158
|
+
* @type {string}
|
|
159
|
+
* @memberof IEnvironment
|
|
160
|
+
*/
|
|
161
|
+
version: string;
|
|
162
|
+
/**
|
|
163
|
+
* 应用图标地址
|
|
164
|
+
*
|
|
165
|
+
* @author chitanda
|
|
166
|
+
* @date 2023-07-17 17:07:23
|
|
167
|
+
* @type {string}
|
|
168
|
+
*/
|
|
169
|
+
favicon?: string;
|
|
170
|
+
/**
|
|
171
|
+
* 是否禁止退出登录
|
|
172
|
+
*
|
|
173
|
+
* @author zhanghengfeng
|
|
174
|
+
* @date 2023-12-18 14:12:55
|
|
175
|
+
* @type {boolean}
|
|
176
|
+
*/
|
|
177
|
+
disableLogout: boolean;
|
|
134
178
|
}
|
|
135
179
|
//# sourceMappingURL=i-environment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i-environment.d.ts","sourceRoot":"","sources":["../../../src/interface/i-environment/i-environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAE/D;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;OAOG;IACH,GAAG,EAAE,OAAO,CAAC;IAEb;;;;;;OAMG;IACH,QAAQ,EAAE,YAAY,CAAC;IAEvB;;;;;;;OAOG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;;OAMG;IACH,SAAS,EAAE,SAAS,CAAC;IAErB;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;OAMG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;;;;;OAMG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;;OAMG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAE1B;;;;;;OAMG;IACH,kBAAkB,EAAE,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"i-environment.d.ts","sourceRoot":"","sources":["../../../src/interface/i-environment/i-environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAE/D;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;OAOG;IACH,GAAG,EAAE,OAAO,CAAC;IAEb;;;;;;OAMG;IACH,QAAQ,EAAE,YAAY,CAAC;IAEvB;;;;;;;OAOG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;;OAMG;IACH,SAAS,EAAE,SAAS,CAAC;IAErB;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;OAMG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;;;;;OAMG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;;OAMG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAE1B;;;;;;OAMG;IACH,kBAAkB,EAAE,kBAAkB,CAAC;IAEvC;;;;;OAKG;IACH,kBAAkB,EAAE,OAAO,CAAC;IAE5B;;;;;OAKG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;;;;OAKG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,aAAa,EAAE,OAAO,CAAC;CACxB"}
|
package/out/types.d.ts
CHANGED
|
@@ -23,6 +23,37 @@ declare global {
|
|
|
23
23
|
*/
|
|
24
24
|
interface IContext {
|
|
25
25
|
[key: string | symbol]: any;
|
|
26
|
+
/**
|
|
27
|
+
* 沙箱标识
|
|
28
|
+
*
|
|
29
|
+
* @author chitanda
|
|
30
|
+
* @date 2022-07-22 15:07:23
|
|
31
|
+
* @type {string}
|
|
32
|
+
*/
|
|
33
|
+
srfsandbox?: string;
|
|
34
|
+
/**
|
|
35
|
+
* 返回自身的上下文,独有的和与父有差异的
|
|
36
|
+
*
|
|
37
|
+
* @author chitanda
|
|
38
|
+
* @date 2023-03-13 17:03:10
|
|
39
|
+
* @return {*} {IData}
|
|
40
|
+
*/
|
|
41
|
+
getOwnContext(): IData;
|
|
42
|
+
/**
|
|
43
|
+
* 销毁当前上下文
|
|
44
|
+
*
|
|
45
|
+
* @author chitanda
|
|
46
|
+
* @date 2023-03-13 17:03:37
|
|
47
|
+
*/
|
|
48
|
+
destroy(): void;
|
|
49
|
+
/**
|
|
50
|
+
* 克隆当前上下文
|
|
51
|
+
*
|
|
52
|
+
* @author chitanda
|
|
53
|
+
* @date 2023-03-13 17:03:45
|
|
54
|
+
* @return {*} {IContext}
|
|
55
|
+
*/
|
|
56
|
+
clone(): IContext;
|
|
26
57
|
}
|
|
27
58
|
/**
|
|
28
59
|
* 参数
|
package/out/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,CAAC,MAAM,CAAC;IACb,MAAM,IAAI,EAAE,OAAO,CAAC;IACpB,MAAM,KAAK,EAAE,aAAa,CAAC;IAE3B,UAAU,MAAM;QACd,IAAI,EAAE,OAAO,CAAC;QACd;;;;;;WAMG;QACH,KAAK,EAAE,aAAa,CAAC;KACtB;IAED;;;;;;OAMG;IACH,UAAU,QAAQ;QAChB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,CAAC,MAAM,CAAC;IACb,MAAM,IAAI,EAAE,OAAO,CAAC;IACpB,MAAM,KAAK,EAAE,aAAa,CAAC;IAE3B,UAAU,MAAM;QACd,IAAI,EAAE,OAAO,CAAC;QACd;;;;;;WAMG;QACH,KAAK,EAAE,aAAa,CAAC;KACtB;IAED;;;;;;OAMG;IACH,UAAU,QAAQ;QAChB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;QAE5B;;;;;;WAMG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;QAEpB;;;;;;WAMG;QACH,aAAa,IAAI,KAAK,CAAC;QAEvB;;;;;WAKG;QACH,OAAO,IAAI,IAAI,CAAC;QAEhB;;;;;;WAMG;QACH,KAAK,IAAI,QAAQ,CAAC;KACnB;IAED;;;;;;OAMG;IACH,UAAU,OAAO;QACf,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;KAC7B;IAED;;;;;;OAMG;IACH,UAAU,KAAK;QACb,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;KAC7B;IAED;;;;;;OAMG;IACH,UAAU,OAAO;QACf,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;KAC7B;CACF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 数据类型转换识别工具类
|
|
3
|
+
* @author lxm
|
|
4
|
+
* @date 2023-08-25 04:33:49
|
|
5
|
+
* @export
|
|
6
|
+
* @class DataTypes
|
|
7
|
+
*/
|
|
8
|
+
export declare class DataTypes {
|
|
9
|
+
/**
|
|
10
|
+
* 数字类型映射字符串类型
|
|
11
|
+
* @author lxm
|
|
12
|
+
* @date 2023-08-25 04:49:52
|
|
13
|
+
* @static
|
|
14
|
+
* @type {{ [p: number]: string }}
|
|
15
|
+
*/
|
|
16
|
+
static readonly typeMap: {
|
|
17
|
+
[p: number]: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* 是否是数值类型
|
|
21
|
+
* @author lxm
|
|
22
|
+
* @date 2023-08-25 04:53:30
|
|
23
|
+
* @static
|
|
24
|
+
* @param {number} dataType 数据类型(数值)
|
|
25
|
+
* @return {*} {boolean}
|
|
26
|
+
*/
|
|
27
|
+
static isNumber(dataType: number): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 是否是日期类型数据
|
|
30
|
+
*
|
|
31
|
+
* @static
|
|
32
|
+
* @param {number} dataType
|
|
33
|
+
* @return {*}
|
|
34
|
+
* @memberof DataTypes
|
|
35
|
+
*/
|
|
36
|
+
static isDate(dataType: number): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* 获取字符串数据类型
|
|
39
|
+
* @author lxm
|
|
40
|
+
* @date 2023-08-25 04:53:58
|
|
41
|
+
* @static
|
|
42
|
+
* @param {number} dataType 数据类型(数值)
|
|
43
|
+
* @return {*} {string}
|
|
44
|
+
*/
|
|
45
|
+
static toString(dataType: number): string;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=data-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-types.d.ts","sourceRoot":"","sources":["../../../src/utils/data-type/data-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,qBAAa,SAAS;IACpB;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CA+B9C;IAEF;;;;;;;OAOG;WACW,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAkBjD;;;;;;;OAOG;WACW,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAK/C;;;;;;;OAOG;WACW,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;CAGjD"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 数据类型转换识别工具类
|
|
3
|
+
* @author lxm
|
|
4
|
+
* @date 2023-08-25 04:33:49
|
|
5
|
+
* @export
|
|
6
|
+
* @class DataTypes
|
|
7
|
+
*/
|
|
8
|
+
export class DataTypes {
|
|
9
|
+
/**
|
|
10
|
+
* 是否是数值类型
|
|
11
|
+
* @author lxm
|
|
12
|
+
* @date 2023-08-25 04:53:30
|
|
13
|
+
* @static
|
|
14
|
+
* @param {number} dataType 数据类型(数值)
|
|
15
|
+
* @return {*} {boolean}
|
|
16
|
+
*/
|
|
17
|
+
static isNumber(dataType) {
|
|
18
|
+
const numberTypes = [
|
|
19
|
+
'BIGINT',
|
|
20
|
+
'BINARY',
|
|
21
|
+
'DECIMAL',
|
|
22
|
+
'FLOAT',
|
|
23
|
+
'INT',
|
|
24
|
+
'MONEY',
|
|
25
|
+
'NUMERIC',
|
|
26
|
+
'REAL',
|
|
27
|
+
'SMALLINT',
|
|
28
|
+
'SMALLMONEY',
|
|
29
|
+
'TINYINT',
|
|
30
|
+
'VARBINARY',
|
|
31
|
+
];
|
|
32
|
+
return numberTypes.includes(this.toString(dataType));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 是否是日期类型数据
|
|
36
|
+
*
|
|
37
|
+
* @static
|
|
38
|
+
* @param {number} dataType
|
|
39
|
+
* @return {*}
|
|
40
|
+
* @memberof DataTypes
|
|
41
|
+
*/
|
|
42
|
+
static isDate(dataType) {
|
|
43
|
+
const dateTypes = ['DATETIME', 'SMALLDATETIME', 'DATE', 'TIME'];
|
|
44
|
+
return dateTypes.includes(this.toString(dataType));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 获取字符串数据类型
|
|
48
|
+
* @author lxm
|
|
49
|
+
* @date 2023-08-25 04:53:58
|
|
50
|
+
* @static
|
|
51
|
+
* @param {number} dataType 数据类型(数值)
|
|
52
|
+
* @return {*} {string}
|
|
53
|
+
*/
|
|
54
|
+
static toString(dataType) {
|
|
55
|
+
return this.typeMap[dataType];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 数字类型映射字符串类型
|
|
60
|
+
* @author lxm
|
|
61
|
+
* @date 2023-08-25 04:49:52
|
|
62
|
+
* @static
|
|
63
|
+
* @type {{ [p: number]: string }}
|
|
64
|
+
*/
|
|
65
|
+
DataTypes.typeMap = {
|
|
66
|
+
0: 'UNKNOWN',
|
|
67
|
+
1: 'BIGINT',
|
|
68
|
+
2: 'BINARY',
|
|
69
|
+
3: 'BIT',
|
|
70
|
+
4: 'CHAR',
|
|
71
|
+
5: 'DATETIME',
|
|
72
|
+
6: 'DECIMAL',
|
|
73
|
+
7: 'FLOAT',
|
|
74
|
+
8: 'IMAGE',
|
|
75
|
+
9: 'INT',
|
|
76
|
+
10: 'MONEY',
|
|
77
|
+
11: 'NCHAR',
|
|
78
|
+
12: 'NTEXT',
|
|
79
|
+
13: 'NVARCHAR',
|
|
80
|
+
14: 'NUMERIC',
|
|
81
|
+
15: 'REAL',
|
|
82
|
+
16: 'SMALLDATETIME',
|
|
83
|
+
17: 'SMALLINT',
|
|
84
|
+
18: 'SMALLMONEY',
|
|
85
|
+
19: 'SQL_VARIANT',
|
|
86
|
+
20: 'SYSNAME',
|
|
87
|
+
21: 'TEXT',
|
|
88
|
+
22: 'TIMESTAMP',
|
|
89
|
+
23: 'TINYINT',
|
|
90
|
+
24: 'VARBINARY',
|
|
91
|
+
25: 'VARCHAR',
|
|
92
|
+
26: 'UNIQUEIDENTIFIER',
|
|
93
|
+
27: 'DATE',
|
|
94
|
+
28: 'TIME',
|
|
95
|
+
29: 'BIGDECIMAL', // 大数值
|
|
96
|
+
};
|
|
@@ -8,6 +8,16 @@
|
|
|
8
8
|
* @returns {*}
|
|
9
9
|
*/
|
|
10
10
|
export declare function calcMimeByFileName(fileName: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* 判断是否是图片格式
|
|
13
|
+
*
|
|
14
|
+
* @author lxm
|
|
15
|
+
* @date 2022-11-21 13:11:23
|
|
16
|
+
* @export
|
|
17
|
+
* @param {string} fileName
|
|
18
|
+
* @returns {*} {boolean}
|
|
19
|
+
*/
|
|
20
|
+
export declare function isImage(fileName: string): boolean;
|
|
11
21
|
/**
|
|
12
22
|
* 纯JS触发下载文件
|
|
13
23
|
*
|