@ibiz-template/core 0.4.17-dev.0 → 0.5.0-beta.0
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/index.esm.js +15 -2
- package/dist/index.system.min.js +2 -2
- package/out/utils/util/util.d.ts +10 -0
- package/out/utils/util/util.d.ts.map +1 -1
- package/out/utils/util/util.js +21 -0
- package/package.json +2 -2
- package/src/utils/util/util.ts +25 -0
package/dist/index.esm.js
CHANGED
|
@@ -770,7 +770,7 @@ var IBizParams = class {
|
|
|
770
770
|
* @return {*} {IBizParams}
|
|
771
771
|
*/
|
|
772
772
|
createProxy() {
|
|
773
|
-
function
|
|
773
|
+
function updateKeyDefine2(target, keys) {
|
|
774
774
|
keys.forEach((key) => {
|
|
775
775
|
if (!Object.prototype.hasOwnProperty.call(target, key)) {
|
|
776
776
|
Object.defineProperty(target, key, {
|
|
@@ -809,7 +809,7 @@ var IBizParams = class {
|
|
|
809
809
|
...Object.keys(target._parent || {})
|
|
810
810
|
])
|
|
811
811
|
];
|
|
812
|
-
|
|
812
|
+
updateKeyDefine2(target, allKeys);
|
|
813
813
|
return allKeys;
|
|
814
814
|
}
|
|
815
815
|
});
|
|
@@ -1092,6 +1092,18 @@ function plus(a, b) {
|
|
|
1092
1092
|
const e = 10 ** Math.max(c, d);
|
|
1093
1093
|
return (a * e + b * e) / e;
|
|
1094
1094
|
}
|
|
1095
|
+
function updateKeyDefine(target, keys) {
|
|
1096
|
+
keys.forEach((key) => {
|
|
1097
|
+
if (!Object.prototype.hasOwnProperty.call(target, key)) {
|
|
1098
|
+
Object.defineProperty(target, key, {
|
|
1099
|
+
enumerable: true,
|
|
1100
|
+
configurable: true,
|
|
1101
|
+
writable: true,
|
|
1102
|
+
value: void 0
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1105
|
+
});
|
|
1106
|
+
}
|
|
1095
1107
|
|
|
1096
1108
|
// src/utils/interceptor/interceptor.ts
|
|
1097
1109
|
var Interceptor = class {
|
|
@@ -3022,5 +3034,6 @@ export {
|
|
|
3022
3034
|
throttle,
|
|
3023
3035
|
toDisposable,
|
|
3024
3036
|
toNumberOrNil,
|
|
3037
|
+
updateKeyDefine,
|
|
3025
3038
|
uploadFile
|
|
3026
3039
|
};
|
package/dist/index.system.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["ramda","lodash-es","qx-util","axios","qs","loglevel","loglevel-plugin-prefix"],function(l){"use strict";var te,M,S,D,k,R,se,ne,re,$,ie,oe,ae,ue,ce,_,C,B,le,he,L;return{setters:[function(h){te=h.clone,M=h.isNotNil,S=h.isNil,D=h.mergeDeepRight},function(h){k=h.debounce,R=h.merge,se=h.uniqueId,ne=h.round,re=h.cloneDeep,$=h.isFunction,ie=h.cloneDeepWith,oe=h.cloneWith,ae=h.isObject},function(h){ue=h.getCookie,ce=h.QXEvent,_=h.createUUID,C=h.notNilEmpty},function(h){B=h.default},function(h){le=h.default},function(h){he=h.default},function(h){L=h.default}],execute:function(){l({awaitTimeout:
|
|
2
|
-
`+d:d;break;case"event":s.event=d;break;case"id":n(s.id=d);break;case"retry":const f=parseInt(d,10);isNaN(f)||e(s.retry=f);break}}}}function Se(n,e){const t=new Uint8Array(n.length+e.length);return t.set(n),t.set(e,n.length),t}function de(){return{data:"",event:"",id:"",retry:void 0}}var ke=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const j=l("EventStreamContentType","text/event-stream"),$e=1e3,fe="last-event-id";function pe(n,e){var{signal:t,headers:s,onopen:r,onmessage:i,onclose:a,onerror:o,openWhenHidden:u,fetch:c}=e,d=ke(e,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((f,x)=>{const b=Object.assign({},s);b.accept||(b.accept=j);let A;function m(){A.abort(),document.hidden||Q()}u||document.addEventListener("visibilitychange",m);let v=$e,X=0;function G(){document.removeEventListener("visibilitychange",m),window.clearTimeout(X),A.abort()}t?.addEventListener("abort",()=>{G(),f()});const $t=c??window.fetch,Lt=r??Le;async function Q(){var Z;A=new AbortController;try{const U=await $t(n,Object.assign(Object.assign({},d),{headers:b,signal:A.signal}));await Lt(U),await h(U.body,Ue(Me(E=>{E?b[fe]=E:delete b[fe]},E=>{v=E},i))),a?.(),G(),f()}catch(U){if(!A.signal.aborted)try{const E=(Z=o?.(U))!==null&&Z!==void 0?Z:v;window.clearTimeout(X),X=window.setTimeout(Q,E)}catch(E){G(),x(E)}}}Q()})}function Le(n){const e=n.headers.get("content-type");if(!e?.startsWith(j))throw new Error(`Expected content-type to be ${j}, Actual: ${e}`)}const q=class ee{constructor(e){this.element=e,this.next=ee.Undefined,this.prev=ee.Undefined}};q.Undefined=new q(void 0);let p=q;class me{constructor(){this._first=p.Undefined,this._last=p.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===p.Undefined}clear(){let e=this._first;for(;e!==p.Undefined;){const{next:t}=e;e.prev=p.Undefined,e.next=p.Undefined,e=t}this._first=p.Undefined,this._last=p.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const s=new p(e);if(this._first===p.Undefined)this._first=s,this._last=s;else if(t){const i=this._last;this._last=s,s.prev=i,i.next=s}else{const i=this._first;this._first=s,s.next=i,i.prev=s}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(s))}}shift(){if(this._first===p.Undefined)return;const e=this._first.element;return this._remove(this._first),e}pop(){if(this._last===p.Undefined)return;const e=this._last.element;return this._remove(this._last),e}_remove(e){if(e.prev!==p.Undefined&&e.next!==p.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===p.Undefined&&e.next===p.Undefined?(this._first=p.Undefined,this._last=p.Undefined):e.next===p.Undefined?(this._last=this._last.prev,this._last.next=p.Undefined):e.prev===p.Undefined&&(this._first=this._first.next,this._first.prev=p.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==p.Undefined;)yield e.element,e=e.next}}l("LinkedList",me);function je(n){const e=this;let t=!1,s;return function(){return t||(t=!0,s=n.apply(e,arguments)),s}}function Ee(n){return{dispose:je(()=>{n()})}}function qe(n,e,t){let s;return function(...r){if(s&&clearTimeout(s),t){const i=!s;s=setTimeout(()=>{s=null},e),i&&n.apply(this,r)}else s=setTimeout(()=>{n.apply(this,r)},e)}}function ze(n,e){let t=null;return function(...s){t||(t=setTimeout(()=>{n.apply(this,s),t=null},e))}}class ge{constructor(){this.commands=new Map}registerCommand(e,t,s){if(!e)throw new Error("invalid command");if(typeof e=="string"){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t,opts:s})}const{id:r}=e;let i=this.commands.get(r);i||(i=new me,this.commands.set(r,i));const a=i.unshift(e);return Ee(()=>{a(),this.commands.get(r)?.isEmpty()&&this.commands.delete(r)})}hasCommand(e){return this.commands.has(e)}getCommand(e){const t=this.commands.get(e);if(!(!t||t.isEmpty()))return t[Symbol.iterator]().next().value}getCommands(){const e=new Map,t=this.commands.keys();for(const s of t){const r=this.getCommand(s);r&&e.set(s,r)}return e}getCommandOpt(e){return this.getCommand(e)?.opts}}l("CommandsRegistry",ge);class z{constructor(){this.commandRegister=new ge}register(e,t,s){return this.commandRegister.registerCommand(e,t,s)}async execute(e,...t){const s=this.commandRegister.getCommand(e);if(s)return s.handler(...t);throw new Error(`\u672A\u6CE8\u518C\u6307\u4EE4: ${e}\uFF0C\u8BF7\u5148\u6CE8\u518C\u6307\u4EE4`)}hasCommand(e,t){const s=!!this.commandRegister.hasCommand(e);if(t===!0&&s===!0)throw new Error(`\u672A\u6CE8\u518C\u6307\u4EE4: ${e}\uFF0C\u8BF7\u5148\u6CE8\u518C\u6307\u4EE4`);return s}getCommandOpts(e){return this.commandRegister.getCommandOpt(e)}}l("CommandController",z);const jt=l("commands",new z);class y{}l("CoreConst",y),y.DEFAULT_MODEL_SERVICE_TAG="default",y.TOKEN="ibzuaa-token",y.TOKEN_EXPIRES="ibzuaa-token-expires",y.TOKEN_REMEMBER="ibizuaa-token-remember";const He=l("NOOP",()=>{}),qt=l("HttpStatusMessageConst",{200:"\u670D\u52A1\u5668\u6210\u529F\u8FD4\u56DE\u8BF7\u6C42\u7684\u6570\u636E\u3002",201:"\u65B0\u5EFA\u6216\u4FEE\u6539\u6570\u636E\u6210\u529F\u3002",202:"\u4E00\u4E2A\u8BF7\u6C42\u5DF2\u7ECF\u8FDB\u5165\u540E\u53F0\u6392\u961F\uFF08\u5F02\u6B65\u4EFB\u52A1\uFF09\u3002",204:"\u5220\u9664\u6570\u636E\u6210\u529F\u3002",400:"\u53D1\u51FA\u7684\u8BF7\u6C42\u6709\u9519\u8BEF\uFF0C\u670D\u52A1\u5668\u6CA1\u6709\u8FDB\u884C\u65B0\u5EFA\u6216\u4FEE\u6539\u6570\u636E\u7684\u64CD\u4F5C\u3002",401:"\u7528\u6237\u6CA1\u6709\u6743\u9650\uFF08\u4EE4\u724C\u3001\u7528\u6237\u540D\u3001\u5BC6\u7801\u9519\u8BEF\uFF09\u3002",403:"\u7528\u6237\u5F97\u5230\u6388\u6743\uFF0C\u4F46\u662F\u8BBF\u95EE\u662F\u88AB\u7981\u6B62\u7684\u3002",404:"\u53D1\u51FA\u7684\u8BF7\u6C42\u9488\u5BF9\u7684\u662F\u4E0D\u5B58\u5728\u7684\u8BB0\u5F55\uFF0C\u670D\u52A1\u5668\u6CA1\u6709\u8FDB\u884C\u64CD\u4F5C\u3002",406:"\u8BF7\u6C42\u7684\u683C\u5F0F\u4E0D\u53EF\u5F97\u3002",410:"\u8BF7\u6C42\u7684\u8D44\u6E90\u88AB\u6C38\u4E45\u5220\u9664\uFF0C\u4E14\u4E0D\u4F1A\u518D\u5F97\u5230\u7684\u3002",422:"\u5F53\u521B\u5EFA\u4E00\u4E2A\u5BF9\u8C61\u65F6\uFF0C\u53D1\u751F\u4E00\u4E2A\u9A8C\u8BC1\u9519\u8BEF\u3002",500:"\u670D\u52A1\u5668\u53D1\u751F\u9519\u8BEF\uFF0C\u8BF7\u68C0\u67E5\u670D\u52A1\u5668\u3002",502:"\u7F51\u5173\u9519\u8BEF\u3002",503:"\u670D\u52A1\u4E0D\u53EF\u7528\uFF0C\u670D\u52A1\u5668\u6682\u65F6\u8FC7\u8F7D\u6216\u7EF4\u62A4\u3002",504:"\u7F51\u5173\u8D85\u65F6\u3002"});var we=l("LoginMode",(n=>(n.DEFAULT="DEFAULT",n.CUSTOM="CUSTOM",n.CAS="CAS",n))(we||{})),be=l("MenuPermissionMode",(n=>(n.MIXIN="MIXIN",n.RESOURCE="RESOURCE",n.RT="RT",n))(be||{}));class I{constructor(e={},t){Object.defineProperty(this,"_associationContext",{enumerable:!1,value:[]}),t&&this.initWithParent(t),Object.assign(this,e)}initWithParent(e){const t=this;Object.defineProperty(this,"_parent",{enumerable:!1,writable:!0,value:e}),Object.defineProperty(this,"_context",{enumerable:!1,writable:!0,value:{}});const s={};Object.keys(e).forEach(i=>{Object.prototype.hasOwnProperty.call(this,i)||(s[i]={enumerable:!0,set(a){a==null?t._context[i]=null:t._context[i]=a},get(){return t._context[i]!==void 0?t._context[i]:t._parent[i]}})}),Object.defineProperties(this,s)}getOwnContext(){const e={};return Object.keys(this).forEach(t=>{(!this._parent||!Object.prototype.hasOwnProperty.call(this._parent,t)||Object.prototype.hasOwnProperty.call(this._context,t))&&(e[t]=this[t])}),e}destroy(){this._parent=void 0,this._context={},this._associationContext.forEach(e=>{e.destroy()})}clone(){const e=new I(te(this.getOwnContext()),this._parent);return this._associationContext.push(e),e}reset(e={},t){this._associationContext.forEach(s=>{s.destroy()}),this._parent&&(this._parent={},this._context={}),Object.keys(this).forEach(s=>{try{delete this[s]}catch{}}),t&&this.initWithParent(t),Object.assign(this,e)}static create(e,t){return new I(e,t)}}l("IBizContext",I);class We{constructor(e,t){return Object.defineProperty(this,"_parent",{enumerable:!1,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_params",{enumerable:!1,configurable:!0,writable:!0,value:e||{}}),this.createProxy()}createProxy(){function e(t,s){s.forEach(r=>{Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,configurable:!0,writable:!0,value:void 0})})}return new Proxy(this,{set(t,s,r){return["_params","_parent"].includes(s)?t[s]=r:t._params[s]=r,!0},get(t,s,r){if(t[s]!==void 0)return t[s];if(t._params[s]!==void 0)return t._params[s];if(t._parent&&t._parent[s]!==void 0)return t._parent[s]},ownKeys(t){const s=[...new Set([...Object.keys(t._params),...Object.keys(t._parent||{})])];return e(t,s),s}})}reset(e,t){this._params=e||{},this._parent=t}destroy(){this._params={},this._parent=void 0}}l("IBizParams",We);const Ve=l("Environment",{dev:!1,hub:!0,enableMqtt:!1,mqttUrl:"/portal/mqtt/mqtt",isEnableMultiLan:!1,logLevel:"ERROR",baseUrl:"/api",appId:"",pluginBaseUrl:"http://172.16.240.221",isLocalModel:!1,remoteModelUrl:"/remotemodel",assetsUrl:"./assets",dcSystem:"",downloadFileUrl:"/ibizutil/download",uploadFileUrl:"/ibizutil/upload",casLoginUrl:"",loginMode:we.DEFAULT,menuPermissionMode:be.MIXIN,enablePermission:!0,routePlaceholder:"-",enableWfAllHistory:!1,isMob:!1,isSaaSMode:!0,AppTitle:"\u5E94\u7528",favicon:"./favicon.ico"});class g extends Error{constructor(e){super("HttpError"),this.name="HttpError";const t=e.response;this.response=e.response,t?(t.data?this.message=t.data.message:this.message=t.statusText,this.message||(this.message="\u7F51\u7EDC\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5!"),this.status=t.status):(this.message=e.message||"",this.status=500)}}l("HttpError",g);class Je extends Error{constructor(e,t){super(`\u300C${e.id}\u300D\u6A21\u578B${t?`\uFF1A ${t}`:""}`),this.model=e,this.name="\u672A\u652F\u6301\u7684\u6A21\u578B"}}l("ModelError",Je);class F extends Error{constructor(e){super(e),this.message=e,this.name="Runtime Error"}}l("RuntimeError",F);class Ye extends Error{constructor(e,t){super(`\u300C${e.id}\u300D\u6A21\u578B${t?`\uFF1A ${t}`:""}`),this.model=e,this.name="\u6A21\u578B\u914D\u7F6E\u7F3A\u5931"}}l("RuntimeModelError",Ye);class Ke extends Error{constructor(e,t){super(e),this.message=e,this.duration=t,this.name="notice Error"}}l("NoticeError",Ke);function H(){return ue(y.TOKEN)}function Xe(n,e){return Array.from(new Set([...n,...e])).length!==n.length+e.length}function Ge(n,e,t){if(n.length!==e.length)return!1;const s=t?[...n.map(i=>i[t]),...e.map(i=>i[t])]:[...n,...e];return Array.from(new Set(s)).length===n.length}function Qe(n,e,t){let s;const r=k((...i)=>(s=void 0,n(...i)),t);return(...i)=>{let a=i;return s&&(a=e(s,a)),s=a,r(...a)}}function Ze(n,e,t){let s,r=[];const i=k(async(...o)=>{s=void 0;try{const u=await n(...o);return r.forEach(c=>{c.resolve(u)}),r=[],u}catch(u){r.forEach(c=>{c.reject(u)}),r=[]}},t);return async(...o)=>{let u=o;return s&&(u=e(s,u)),s=u,i(...u),new Promise((c,d)=>{r.push({resolve:c,reject:d})})}}function et(n,e){Object.keys(e).forEach(t=>{M(e[t])&&(n[t]=e[t])})}function tt(n,e){Object.keys(e).forEach(t=>{M(e[t])&&S(n[t])&&(n[t]=e[t])})}function st(n,e,t){const s=new Set([...n,...e]),r=[],i=[],a=[];if(t){const o=n.map(c=>c[t]),u=e.map(c=>c[t]);s.forEach(c=>{if(!o.includes(c[t])){i.push(c);return}if(!u.includes(c[t])){r.push(c);return}a.push(c)})}else s.forEach(o=>{if(!n.includes(o)){i.push(o);return}if(!e.includes(o)){r.push(o);return}a.push(o)});return{more:r,less:i,same:a}}function nt(n){if(S(n))return;const e=Number(n);if(!Number.isNaN(e))return e}const rt=/<svg\b[^>]*>[\s\S]*?<\/svg>/;function it(n){return rt.test(n)}function ot(n,e){let t,s;try{t=n.toString().split(".")[1].length}catch{t=0}try{s=e.toString().split(".")[1].length}catch{s=0}const r=10**Math.max(t,s);return(n*r+e*r)/r}class Ce{async onBeforeRequest(e){return e}onRequestError(e){return Promise.reject(e)}async onResponseSuccess(e){return e}onResponseError(e){return Promise.reject(e)}use(e){this.requestTag=e.interceptors.request.use(this.onBeforeRequest,this.onRequestError),this.responseTag=e.interceptors.response.use(this.onResponseSuccess,this.onResponseError)}eject(e){this.requestTag&&e.interceptors.request.eject(this.requestTag),this.responseTag&&e.interceptors.response.eject(this.responseTag)}}l("Interceptor",Ce);class ye extends Ce{async onBeforeRequest(e){e=await super.onBeforeRequest(e);const{headers:t}=e;t.set("Authorization",`Bearer ${H()}`);let s=ibiz.env.dcSystem;const{orgData:r}=ibiz;return r&&(r.systemid&&(s=r.systemid),r.orgid&&t.set("srforgid",r.orgid)),t.set("srfsystemid",s),e}}l("CoreInterceptor",ye);class N{constructor(e){this.parent=e,this.evt=new ce(1e3)}next(e){this.evt.emit("all",e),this.parent&&this.nextParent(e)}nextParent(e){this.parent&&(this.parent.evt.emit("all",e),this.parent.nextParent(e))}on(e){this.evt.on("all",e)}off(e){this.evt.off("all",e)}}class at extends N{}class O extends N{sendCommand(e,t){const s={messageid:_(),messagename:"command",type:"COMMAND",subtype:t,data:e};this.next(s)}}class ut extends O{send(e){this.sendCommand(e,"OBJECTCREATED")}}class ct extends O{send(e){this.sendCommand(e,"OBJECTUPDATED")}}class lt extends O{send(e){this.sendCommand(e,"OBJECTREMOVED")}}class ht extends O{}class dt extends O{send(e){this.sendCommand(e,"ASYNCACTION")}}class ft extends N{constructor(){super(...arguments),this.change=new ht,this.create=new ut(this),this.update=new ct(this),this.remove=new lt(this),this.asyncAction=new dt(this)}next(e){switch(e.subtype){case"OBJECTCREATED":this.create.next(e),this.change.next(e);break;case"OBJECTUPDATED":this.update.next(e),this.change.next(e);break;case"OBJECTREMOVED":this.remove.next(e),this.change.next(e);break;default:super.next(e)}}nextParent(e){switch(e.subtype){case"OBJECTCREATED":this.change.next(e);break;case"OBJECTUPDATED":this.change.next(e);break;case"OBJECTREMOVED":this.change.next(e);break}super.nextParent(e)}send(e,t){const s={messageid:_(),messagename:"command",type:"COMMAND",subtype:t,data:e};this.next(s)}}class pt extends N{send(e){const t={messageid:_(),messagename:"console",type:"CONSOLE",data:e};this.next(t)}}class Fe{constructor(){this.all=new at,this.command=new ft(this.all),this.console=new pt(this.all)}next(e){e.type==="COMMAND"?this.command.next(e):e.type==="CONSOLE"?this.console.next(e):this.all.next(e)}on(e){this.all.on(e)}off(e){this.all.off(e)}}l("MessageCenter",Fe);const mt="ibiz",Et="is-";function w(n,e,t,s,r){let i=`${n}-${e}`;return t&&(i+=`-${t}`),s&&(i+=`__${s}`),r&&(i+=`--${r}`),i}class gt{constructor(e,t){this.block=e,this.namespace=t||mt}b(e=""){return w(this.namespace,this.block,e,"","")}e(e){return e?w(this.namespace,this.block,"",e,""):""}m(e){return e?w(this.namespace,this.block,"","",e):""}be(e,t){return e&&t?w(this.namespace,this.block,e,t,""):""}em(e,t){return e&&t?w(this.namespace,this.block,"",e,t):""}bm(e,t){return e&&t?w(this.namespace,this.block,e,"",t):""}bem(e,t,s){return e&&t&&s?w(this.namespace,this.block,e,t,s):""}is(e,t){return e&&t?`${Et}${e}`:""}cssVar(e){const t={};for(const s in e)e[s]&&(t[this.cssVarName(s)]=e[s]);return t}cssVarBlock(e){const t={};for(const s in e)e[s]&&(t[this.cssVarBlockName(s)]=e[s]);return t}cssVarName(e){return`--${this.namespace}-${e}`}cssVarBlockName(e){return`--${this.namespace}-${this.block}-${e}`}}l("Namespace",gt);class wt{constructor(e,t,s){this.local=!0,this.ok=!1,this.headers={},this.config={headers:new B.AxiosHeaders},this.data=e,this.status=t||200,this.statusText=s||"",this.status>=200&&this.status<300&&(this.ok=!0)}}l("HttpResponse",wt);class Ae{constructor(e){this.urlReg=/^http[s]?:\/\/[^\s]*/,this.waitRequest=new Map,this.interceptors=new Map,this.instance=B.create(e),this.addInterceptor("Default",new ye)}get baseUrl(){return this.instance.defaults.baseURL||`${ibiz.env.baseUrl}/${ibiz.env.appId}`}addInterceptor(e,t){t.use(this.instance),this.interceptors.set(e,t)}removeInterceptor(e){const t=this.interceptors.get(e);t&&(t.eject(this.instance),this.interceptors.delete(e))}get presetConfig(){return{baseURL:this.baseUrl,headers:{"Content-Type":"application/json;charset=UTF-8",Accept:"application/json"}}}mergeConfig(...e){const t=this.presetConfig;if(e.length===0)return t;const{url:s}=e[0];return s&&this.urlReg.test(s)&&delete t.baseURL,R(t,...e)}async post(e,t,s={},r={}){e=this.handleAppPresetParam(e,s);try{const i=await this.request(e,{method:"post",data:t,headers:r});return this.doResponseResult(i)}catch(i){throw new g(i)}}async get(e,t={},s={},r={}){e=this.attachUrlParam(e,t);try{const i=await this.request(e,R({method:"get",headers:s},r));return this.doResponseResult(i)}catch(i){throw new g(i)}}async delete(e,t,s={}){e=this.handleAppPresetParam(e,t);try{const r=await this.request(e,{method:"delete",headers:s});return this.doResponseResult(r)}catch(r){throw new g(r)}}async put(e,t,s={},r={}){e=this.handleAppPresetParam(e,s);try{const i=await this.request(e,{method:"put",data:t,headers:r});return this.doResponseResult(i)}catch(i){throw new g(i)}}async getModel(e,t={}){try{const s=await this.instance.get(e,{headers:t});return this.doResponseResult(s)}catch(s){throw new g(s)}}async request(e,t={}){const s=this.mergeConfig({url:e},t),r=JSON.stringify(s);try{let i=null;this.waitRequest.has(r)?i=this.waitRequest.get(r):(i=this.instance.request(s),this.waitRequest.set(r,i));const a=await i;return this.waitRequest.has(r)&&this.waitRequest.delete(r),this.doResponseResult(a)}catch(i){throw this.waitRequest.has(r)&&this.waitRequest.delete(r),new g(i)}}axios(e){return B(e)}async sse(e,t,s={}){e=this.attachUrlParam(this.baseUrl+e,t),s.headers||(s.headers={});const r=s.headers;{r.Authorization=`Bearer ${H()}`;let a=ibiz.env.dcSystem;const{orgData:o}=ibiz;o&&(o.systemid&&(a=o.systemid),o.orgid&&(r.srforgid=o.orgid)),r.srfsystemid=a}const i=D({openWhenHidden:!0,method:"POST"},s);await pe(e,i)}doResponseResult(e){const t=e;if(t.status>=200&&t.status<=299){t.ok=!0;const s=t.data;(s===""||s===null)&&(t.data=void 0)}return t}handleAppPresetParam(e,t){return t?(Object.keys(t).forEach(r=>{r.startsWith("srf")&&C(t[r])&&t[r]}),this.attachUrlParam(e,t)):e}attachUrlParam(e,t){{const r=e.split("?");r[0]=r[0].split("/").map(i=>encodeURIComponent(i)).join("/"),e=r.length>1?r.join("?"):r[0]}const s=le.stringify(t);return C(s)&&(e.endsWith("?")?e=`${e}${s}`:e.indexOf("?")!==-1&&e.endsWith("&")?e=`${e}${s}`:e.indexOf("?")!==-1&&!e.endsWith("&")?e=`${e}&${s}`:e=`${e}?${s}`),e}}l("Net",Ae);class W{static fill(e,t,s){return C(e)&&(C(t)&&e.match(this.contextReg)?.forEach(i=>{const a=i.slice(10,i.length-1);e=e.replace(`\${context.${a}}`,t[a]||"")}),C(s)&&e.match(this.dataReg)?.forEach(i=>{const a=i.slice(7,i.length-1);e=e.replace(`\${data.${a}}`,s[a]||"")})),e}}l("StringUtil",W),W.contextReg=/\$\{context.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g,W.dataReg=/\$\{data.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g;class bt{static get routeBase(){const e=window.location.href.lastIndexOf("#/");return window.location.href.slice(0,e+1)}static get appBase(){const{origin:e,pathname:t}=window.location;return`${e}${t}`.replace(/\/$/,"")}static get routePath(){return window.location.hash.replace("#","")}static get fullPath(){return window.location.href}}l("UrlHelper",bt);function V(n){const e=n.composedPath&&n.composedPath()||n.path;if(e!=null)return e;function t(s,r=[]){const i=s.parentNode;return i?t(i,r.concat([i])):r}return[n.target].concat(t(n.target))}function P(n,e,t,s={}){n.addEventListener(e,t,s);let r=()=>{n.removeEventListener(e,t,s),r=He};return()=>{r()}}function ve(n,e){return e&&(n.target===e||V(n).includes(e))}const Ct=typeof window<"u"?window:void 0;function yt(n,e,t={}){const{window:s=Ct,ignore:r=[],capture:i=!0}=t;if(!n)throw new F("target\u5143\u7D20\u4E0D\u5B58\u5728");if(!s)throw new F("\u627E\u4E0D\u5230window");let a=!0;const o=m=>![n,...r].some(v=>ve(m,v));let u=!1;const c=()=>{u=!0},d=()=>{u=!1};let f;const x=m=>{u||(s.clearTimeout(f),a&&o(m)&&e(m))},b=[P(s,"click",x,{passive:!0,capture:i}),P(s,"pointerdown",m=>{u||(a=o(m))},{passive:!0}),P(s,"pointerup",m=>{if(!u&&m.button===0){const v=V(m);m.composedPath=()=>v,f=s.setTimeout(()=>x(m),50)}},{passive:!0})].filter(Boolean);return{stop:()=>b.forEach(m=>m()),pause:c,proceed:d}}const T=Math.round;function De(n){const e=n.length,t=[];if(n.slice(0,3).toLowerCase()==="rgb"){const s=n.match(/([\d|.%]{1,3})/g);t[0]=parseInt(s[0],10),t[1]=parseInt(s[1],10),t[2]=parseInt(s[2],10),t[3]=s[3]?s[3].indexOf("%")!==-1?parseInt(s[3],10)/100:parseFloat(s[3]):1}else{let s;e<6?s=parseInt(String(n[1])+n[1]+n[2]+n[2]+n[3]+n[3]+(e>4?String(n[4])+n[4]:""),16):s=parseInt(n.slice(1),16),t[0]=s>>16&255,t[1]=s>>8&255,t[2]=s&255,t[3]=e===9||e===5?T((s>>24&255)/255*1e4)/1e4:1}return t}function Ft(n,e,t=.5,s="hex"){n=n.trim(),e=e.trim();const r=De(n),i=De(e),a=[T((1-t)*r[0]+t*i[0]),T((1-t)*r[1]+t*i[1]),T((1-t)*r[2]+t*i[2]),(1-t)*r[3]+t*i[3]];if(s==="hex"){const o=[a[0].toString(16),a[1].toString(16),a[2].toString(16),a[3]===0?"00":T(a[3]*255).toString(16)];return`#${o[0]}${o[1]}${o[2]}${o[3]}`}return`rgb(${a[0]} ${a[1]} ${a[2]} / ${a[3]})`}function Re(n){const e=n.split(".").pop();let t="";switch(e){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":t="image/jpeg";break;case".jpg":t="image/jpeg";break;case".rtf":t="application/rtf";break;case".avi":t="video/x-msvideo";break;case".gz":t="application/x-gzip";break;case".tar":t="application/x-tar";break;case".xlsx":t="application/vnd.ms-excel";break;default:t=""}return t}function At(n){const e=n.split(".").pop();return e?[".jpeg","jpg","gif","png","bmp","svg"].includes(e):!1}function vt(n,e){const t=Re(e),s=new Blob([n],{type:t}),r=URL.createObjectURL(s),i=document.createElement("a");i.href=r,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}function Oe(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t]);return e}function Te(n){const e=R({multiple:!0,accept:""},n),t=document.createElement("input");t.setAttribute("type","file"),t.setAttribute("multiple",`${e.multiple}`),t.setAttribute("accept",e.accept),t.onchange=s=>{const r=s.target,i=r.files?Oe(r.files):[];i.length!==0&&(e.onSelected(i),r.value="")},document.body.appendChild(t),t.click(),document.body.removeChild(t)}function Dt(n){const e=R({multiple:!0,accept:"",separate:!0,beforeUpload:(o,u)=>!0,finish:o=>{},success:(o,u)=>{},error:(o,u)=>{},progress:o=>{}},n),t=(o,u)=>{u.forEach(c=>{c.percentage=ne(o.progress*100)}),e.progress(re(u))},s=async(o,u)=>{if(e.request&&$(e.request))return e.request(o);const c=new FormData;throw o.forEach(d=>{c.append("file",d)}),new F("\u591A\u5E94\u7528\u6A21\u5F0F\u7B49\u5F85\u91CD\u65B0\u5B9E\u73B0\u8BF7\u6C42")},r=async o=>{const u=o.map(d=>({status:"uploading",name:d.name,uid:se(),percentage:0}));if(!e.beforeUpload(o,u))return u.forEach(d=>{d.status="cancel"}),ibiz.log.debug("\u53D6\u6D88\u4E0A\u4F20",u),u;try{const d=await s(o,f=>{t(f,u)});u.forEach(f=>{f.status="finished"}),e.success(u,d),u.forEach(f=>{f.response=d})}catch(d){u.forEach(f=>{f.status="fail"}),e.error(u,d),u.forEach(f=>{f.error=d}),ibiz.log.error(d),ibiz.log.error(`${o.map(f=>f.name).join(",")}\u4E0A\u4F20\u5931\u8D25`)}return u},i=async o=>{const u=e.separate?o.map(f=>[f]):[o],c=await Promise.allSettled(u.map(async f=>r(f))),d=[];c.forEach(f=>{f.status==="fulfilled"&&d.push(...f.value)}),e.finish(d)};(()=>{Te({accept:e.accept,multiple:e.multiple,onSelected:o=>{i(o)}})})()}async function Rt(n,e,t){if(await new Promise(s=>{setTimeout(()=>{s(!0)},n)}),e)return e(...t||[])}class Ot{constructor(){this.promise=null,this.resolve=null,this.count=0}startPromise(){this.promise=new Promise(e=>{this.resolve=e})}endPromise(){this.resolve&&(this.resolve(),this.resolve=null,this.promise=null)}lock(){this.count+=1,this.promise||this.startPromise()}unlock(){if(this.count<1)throw new F("lock\u548Cunlock\u6B21\u6570\u4E0D\u5339\u914D\uFF01");this.count-=1,this.count===0&&this.endPromise()}async await(){this.promise&&await this.promise}}l("CountLatch",Ot);async function Tt(n){try{const e=await ibiz.net.get(n),t=document.createElement("style");t.setAttribute("title","app-style-css"),t.innerText=e.data,document.head.appendChild(t)}catch{ibiz.log.debug("\u52A0\u8F7D\u8FDC\u7A0B\u6837\u5F0F\u8868\u5931\u8D25",n)}}const _e={childrenFields:["children"]},Be=new Error("\u4E2D\u65AD\u64CD\u4F5C");function _t(n,e){for(const t of e)if(n[t]?.length)return n[t]}function Bt(n,e,t){const{childrenFields:s}=D(_e,t||{}),r=_t(n,s);if(r?.length)for(const i of r){if(e(i))throw Be;J(i,e,t)}}function J(n,e,t){try{Bt(n,e,t)}catch(s){if(s!==Be)throw s}}const It={..._e,compareField:"name"};function Nt(n,e,t){const{compareField:s,compareCallback:r}=D(It,t||{}),i=r||(o=>o[s]===e);let a;return J(n,o=>{if(i(o,e,s))return a=o,!0},t),a}class Ie{static isNumber(e){return["BIGINT","BINARY","DECIMAL","FLOAT","INT","MONEY","NUMERIC","REAL","SMALLINT","SMALLMONEY","TINYINT","VARBINARY"].includes(this.toString(e))}static isDate(e){return["DATETIME","SMALLDATETIME","DATE","TIME"].includes(this.toString(e))}static toString(e){return this.typeMap[e]}}l("DataTypes",Ie),Ie.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"};function Ne(n){if(ae(n)&&$(n.clone))return n.clone()}const Pt={deep:!0};function xt(n,e){return D(Pt,e||{}).deep?ie(n,Ne):oe(n,Ne)}function Pe(n){return!!n&&!(n&n-1)}function Y(n){if(!Pe(n))throw new F(`${n}\u4E0D\u662F2\u7684\u5E42`)}function Ut(n=0,e){return Y(e),n|e}function Mt(n=0,e){return Y(e),n&~e}function St(n=0,e){return Y(e),(n&e)!==0}const zt=l("BitMask",{validate:Pe,setPermission:Ut,removePermission:Mt,checkPermission:St}),K=he.noConflict();L.reg(K),L.apply(K);class xe{constructor(){this.env=Ve,this.log=K,this.net=new Ae,this.commands=new z,this.mc=new Fe}}l("IBizSys",xe);function kt(){if(window.ibiz)throw new Error("ibiz \u5DF2\u7ECF\u5B58\u5728, \u65E0\u9700\u91CD\u590D\u5B89\u88C5");window.ibiz=new xe}}}});
|
|
1
|
+
System.register(["ramda","lodash-es","qx-util","axios","qs","loglevel","loglevel-plugin-prefix"],function(l){"use strict";var te,M,S,D,k,R,se,ne,re,$,ie,oe,ae,ue,ce,_,C,B,le,he,L;return{setters:[function(h){te=h.clone,M=h.isNotNil,S=h.isNil,D=h.mergeDeepRight},function(h){k=h.debounce,R=h.merge,se=h.uniqueId,ne=h.round,re=h.cloneDeep,$=h.isFunction,ie=h.cloneDeepWith,oe=h.cloneWith,ae=h.isObject},function(h){ue=h.getCookie,ce=h.QXEvent,_=h.createUUID,C=h.notNilEmpty},function(h){B=h.default},function(h){le=h.default},function(h){he=h.default},function(h){L=h.default}],execute:function(){l({awaitTimeout:Ot,calcMimeByFileName:Re,clone:Ut,colorBlend:vt,compareArr:st,debounce:qe,debounceAndAsyncMerge:Ze,debounceAndMerge:Qe,downloadFileFromBlob:Dt,eventPath:V,fetchEventSource:pe,fileListToArr:Oe,findRecursiveChild:Nt,getToken:H,install:$t,isElementSame:Ge,isEventInside:Ae,isImage:At,isOverlap:Xe,isSvg:it,listenJSEvent:N,mergeDefaultInLeft:tt,mergeInLeft:et,onClickOutside:Ft,plus:ot,recursiveIterate:J,selectFile:Te,setRemoteStyle:_t,throttle:ze,toDisposable:Ee,toNumberOrNil:nt,updateKeyDefine:at,uploadFile:Rt});async function h(n,e){const t=n.getReader();let s;for(;!(s=await t.read()).done;)e(s.value)}function Ue(n){let e,t,s,r=!1;return function(a){e===void 0?(e=a,t=0,s=-1):e=Se(e,a);const o=e.length;let u=0;for(;t<o;){r&&(e[t]===10&&(u=++t),r=!1);let c=-1;for(;t<o&&c===-1;++t)switch(e[t]){case 58:s===-1&&(s=t-u);break;case 13:r=!0;case 10:c=t;break}if(c===-1)break;n(e.subarray(u,c),s),u=t,s=-1}u===o?e=void 0:u!==0&&(e=e.subarray(u),t-=u)}}function Me(n,e,t){let s=de();const r=new TextDecoder;return function(a,o){if(a.length===0)t?.(s),s=de();else if(o>0){const u=r.decode(a.subarray(0,o)),c=o+(a[o+1]===32?2:1),d=r.decode(a.subarray(c));switch(u){case"data":s.data=s.data?s.data+`
|
|
2
|
+
`+d:d;break;case"event":s.event=d;break;case"id":n(s.id=d);break;case"retry":const f=parseInt(d,10);isNaN(f)||e(s.retry=f);break}}}}function Se(n,e){const t=new Uint8Array(n.length+e.length);return t.set(n),t.set(e,n.length),t}function de(){return{data:"",event:"",id:"",retry:void 0}}var ke=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const j=l("EventStreamContentType","text/event-stream"),$e=1e3,fe="last-event-id";function pe(n,e){var{signal:t,headers:s,onopen:r,onmessage:i,onclose:a,onerror:o,openWhenHidden:u,fetch:c}=e,d=ke(e,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((f,x)=>{const b=Object.assign({},s);b.accept||(b.accept=j);let v;function m(){v.abort(),document.hidden||Q()}u||document.addEventListener("visibilitychange",m);let A=$e,X=0;function G(){document.removeEventListener("visibilitychange",m),window.clearTimeout(X),v.abort()}t?.addEventListener("abort",()=>{G(),f()});const Lt=c??window.fetch,jt=r??Le;async function Q(){var Z;v=new AbortController;try{const U=await Lt(n,Object.assign(Object.assign({},d),{headers:b,signal:v.signal}));await jt(U),await h(U.body,Ue(Me(E=>{E?b[fe]=E:delete b[fe]},E=>{A=E},i))),a?.(),G(),f()}catch(U){if(!v.signal.aborted)try{const E=(Z=o?.(U))!==null&&Z!==void 0?Z:A;window.clearTimeout(X),X=window.setTimeout(Q,E)}catch(E){G(),x(E)}}}Q()})}function Le(n){const e=n.headers.get("content-type");if(!e?.startsWith(j))throw new Error(`Expected content-type to be ${j}, Actual: ${e}`)}const q=class ee{constructor(e){this.element=e,this.next=ee.Undefined,this.prev=ee.Undefined}};q.Undefined=new q(void 0);let p=q;class me{constructor(){this._first=p.Undefined,this._last=p.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===p.Undefined}clear(){let e=this._first;for(;e!==p.Undefined;){const{next:t}=e;e.prev=p.Undefined,e.next=p.Undefined,e=t}this._first=p.Undefined,this._last=p.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const s=new p(e);if(this._first===p.Undefined)this._first=s,this._last=s;else if(t){const i=this._last;this._last=s,s.prev=i,i.next=s}else{const i=this._first;this._first=s,s.next=i,i.prev=s}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(s))}}shift(){if(this._first===p.Undefined)return;const e=this._first.element;return this._remove(this._first),e}pop(){if(this._last===p.Undefined)return;const e=this._last.element;return this._remove(this._last),e}_remove(e){if(e.prev!==p.Undefined&&e.next!==p.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===p.Undefined&&e.next===p.Undefined?(this._first=p.Undefined,this._last=p.Undefined):e.next===p.Undefined?(this._last=this._last.prev,this._last.next=p.Undefined):e.prev===p.Undefined&&(this._first=this._first.next,this._first.prev=p.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==p.Undefined;)yield e.element,e=e.next}}l("LinkedList",me);function je(n){const e=this;let t=!1,s;return function(){return t||(t=!0,s=n.apply(e,arguments)),s}}function Ee(n){return{dispose:je(()=>{n()})}}function qe(n,e,t){let s;return function(...r){if(s&&clearTimeout(s),t){const i=!s;s=setTimeout(()=>{s=null},e),i&&n.apply(this,r)}else s=setTimeout(()=>{n.apply(this,r)},e)}}function ze(n,e){let t=null;return function(...s){t||(t=setTimeout(()=>{n.apply(this,s),t=null},e))}}class ge{constructor(){this.commands=new Map}registerCommand(e,t,s){if(!e)throw new Error("invalid command");if(typeof e=="string"){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t,opts:s})}const{id:r}=e;let i=this.commands.get(r);i||(i=new me,this.commands.set(r,i));const a=i.unshift(e);return Ee(()=>{a(),this.commands.get(r)?.isEmpty()&&this.commands.delete(r)})}hasCommand(e){return this.commands.has(e)}getCommand(e){const t=this.commands.get(e);if(!(!t||t.isEmpty()))return t[Symbol.iterator]().next().value}getCommands(){const e=new Map,t=this.commands.keys();for(const s of t){const r=this.getCommand(s);r&&e.set(s,r)}return e}getCommandOpt(e){return this.getCommand(e)?.opts}}l("CommandsRegistry",ge);class z{constructor(){this.commandRegister=new ge}register(e,t,s){return this.commandRegister.registerCommand(e,t,s)}async execute(e,...t){const s=this.commandRegister.getCommand(e);if(s)return s.handler(...t);throw new Error(`\u672A\u6CE8\u518C\u6307\u4EE4: ${e}\uFF0C\u8BF7\u5148\u6CE8\u518C\u6307\u4EE4`)}hasCommand(e,t){const s=!!this.commandRegister.hasCommand(e);if(t===!0&&s===!0)throw new Error(`\u672A\u6CE8\u518C\u6307\u4EE4: ${e}\uFF0C\u8BF7\u5148\u6CE8\u518C\u6307\u4EE4`);return s}getCommandOpts(e){return this.commandRegister.getCommandOpt(e)}}l("CommandController",z);const qt=l("commands",new z);class y{}l("CoreConst",y),y.DEFAULT_MODEL_SERVICE_TAG="default",y.TOKEN="ibzuaa-token",y.TOKEN_EXPIRES="ibzuaa-token-expires",y.TOKEN_REMEMBER="ibizuaa-token-remember";const He=l("NOOP",()=>{}),zt=l("HttpStatusMessageConst",{200:"\u670D\u52A1\u5668\u6210\u529F\u8FD4\u56DE\u8BF7\u6C42\u7684\u6570\u636E\u3002",201:"\u65B0\u5EFA\u6216\u4FEE\u6539\u6570\u636E\u6210\u529F\u3002",202:"\u4E00\u4E2A\u8BF7\u6C42\u5DF2\u7ECF\u8FDB\u5165\u540E\u53F0\u6392\u961F\uFF08\u5F02\u6B65\u4EFB\u52A1\uFF09\u3002",204:"\u5220\u9664\u6570\u636E\u6210\u529F\u3002",400:"\u53D1\u51FA\u7684\u8BF7\u6C42\u6709\u9519\u8BEF\uFF0C\u670D\u52A1\u5668\u6CA1\u6709\u8FDB\u884C\u65B0\u5EFA\u6216\u4FEE\u6539\u6570\u636E\u7684\u64CD\u4F5C\u3002",401:"\u7528\u6237\u6CA1\u6709\u6743\u9650\uFF08\u4EE4\u724C\u3001\u7528\u6237\u540D\u3001\u5BC6\u7801\u9519\u8BEF\uFF09\u3002",403:"\u7528\u6237\u5F97\u5230\u6388\u6743\uFF0C\u4F46\u662F\u8BBF\u95EE\u662F\u88AB\u7981\u6B62\u7684\u3002",404:"\u53D1\u51FA\u7684\u8BF7\u6C42\u9488\u5BF9\u7684\u662F\u4E0D\u5B58\u5728\u7684\u8BB0\u5F55\uFF0C\u670D\u52A1\u5668\u6CA1\u6709\u8FDB\u884C\u64CD\u4F5C\u3002",406:"\u8BF7\u6C42\u7684\u683C\u5F0F\u4E0D\u53EF\u5F97\u3002",410:"\u8BF7\u6C42\u7684\u8D44\u6E90\u88AB\u6C38\u4E45\u5220\u9664\uFF0C\u4E14\u4E0D\u4F1A\u518D\u5F97\u5230\u7684\u3002",422:"\u5F53\u521B\u5EFA\u4E00\u4E2A\u5BF9\u8C61\u65F6\uFF0C\u53D1\u751F\u4E00\u4E2A\u9A8C\u8BC1\u9519\u8BEF\u3002",500:"\u670D\u52A1\u5668\u53D1\u751F\u9519\u8BEF\uFF0C\u8BF7\u68C0\u67E5\u670D\u52A1\u5668\u3002",502:"\u7F51\u5173\u9519\u8BEF\u3002",503:"\u670D\u52A1\u4E0D\u53EF\u7528\uFF0C\u670D\u52A1\u5668\u6682\u65F6\u8FC7\u8F7D\u6216\u7EF4\u62A4\u3002",504:"\u7F51\u5173\u8D85\u65F6\u3002"});var we=l("LoginMode",(n=>(n.DEFAULT="DEFAULT",n.CUSTOM="CUSTOM",n.CAS="CAS",n))(we||{})),be=l("MenuPermissionMode",(n=>(n.MIXIN="MIXIN",n.RESOURCE="RESOURCE",n.RT="RT",n))(be||{}));class I{constructor(e={},t){Object.defineProperty(this,"_associationContext",{enumerable:!1,value:[]}),t&&this.initWithParent(t),Object.assign(this,e)}initWithParent(e){const t=this;Object.defineProperty(this,"_parent",{enumerable:!1,writable:!0,value:e}),Object.defineProperty(this,"_context",{enumerable:!1,writable:!0,value:{}});const s={};Object.keys(e).forEach(i=>{Object.prototype.hasOwnProperty.call(this,i)||(s[i]={enumerable:!0,set(a){a==null?t._context[i]=null:t._context[i]=a},get(){return t._context[i]!==void 0?t._context[i]:t._parent[i]}})}),Object.defineProperties(this,s)}getOwnContext(){const e={};return Object.keys(this).forEach(t=>{(!this._parent||!Object.prototype.hasOwnProperty.call(this._parent,t)||Object.prototype.hasOwnProperty.call(this._context,t))&&(e[t]=this[t])}),e}destroy(){this._parent=void 0,this._context={},this._associationContext.forEach(e=>{e.destroy()})}clone(){const e=new I(te(this.getOwnContext()),this._parent);return this._associationContext.push(e),e}reset(e={},t){this._associationContext.forEach(s=>{s.destroy()}),this._parent&&(this._parent={},this._context={}),Object.keys(this).forEach(s=>{try{delete this[s]}catch{}}),t&&this.initWithParent(t),Object.assign(this,e)}static create(e,t){return new I(e,t)}}l("IBizContext",I);class We{constructor(e,t){return Object.defineProperty(this,"_parent",{enumerable:!1,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_params",{enumerable:!1,configurable:!0,writable:!0,value:e||{}}),this.createProxy()}createProxy(){function e(t,s){s.forEach(r=>{Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,configurable:!0,writable:!0,value:void 0})})}return new Proxy(this,{set(t,s,r){return["_params","_parent"].includes(s)?t[s]=r:t._params[s]=r,!0},get(t,s,r){if(t[s]!==void 0)return t[s];if(t._params[s]!==void 0)return t._params[s];if(t._parent&&t._parent[s]!==void 0)return t._parent[s]},ownKeys(t){const s=[...new Set([...Object.keys(t._params),...Object.keys(t._parent||{})])];return e(t,s),s}})}reset(e,t){this._params=e||{},this._parent=t}destroy(){this._params={},this._parent=void 0}}l("IBizParams",We);const Ve=l("Environment",{dev:!1,hub:!0,enableMqtt:!1,mqttUrl:"/portal/mqtt/mqtt",isEnableMultiLan:!1,logLevel:"ERROR",baseUrl:"/api",appId:"",pluginBaseUrl:"http://172.16.240.221",isLocalModel:!1,remoteModelUrl:"/remotemodel",assetsUrl:"./assets",dcSystem:"",downloadFileUrl:"/ibizutil/download",uploadFileUrl:"/ibizutil/upload",casLoginUrl:"",loginMode:we.DEFAULT,menuPermissionMode:be.MIXIN,enablePermission:!0,routePlaceholder:"-",enableWfAllHistory:!1,isMob:!1,isSaaSMode:!0,AppTitle:"\u5E94\u7528",favicon:"./favicon.ico"});class g extends Error{constructor(e){super("HttpError"),this.name="HttpError";const t=e.response;this.response=e.response,t?(t.data?this.message=t.data.message:this.message=t.statusText,this.message||(this.message="\u7F51\u7EDC\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5!"),this.status=t.status):(this.message=e.message||"",this.status=500)}}l("HttpError",g);class Je extends Error{constructor(e,t){super(`\u300C${e.id}\u300D\u6A21\u578B${t?`\uFF1A ${t}`:""}`),this.model=e,this.name="\u672A\u652F\u6301\u7684\u6A21\u578B"}}l("ModelError",Je);class F extends Error{constructor(e){super(e),this.message=e,this.name="Runtime Error"}}l("RuntimeError",F);class Ke extends Error{constructor(e,t){super(`\u300C${e.id}\u300D\u6A21\u578B${t?`\uFF1A ${t}`:""}`),this.model=e,this.name="\u6A21\u578B\u914D\u7F6E\u7F3A\u5931"}}l("RuntimeModelError",Ke);class Ye extends Error{constructor(e,t){super(e),this.message=e,this.duration=t,this.name="notice Error"}}l("NoticeError",Ye);function H(){return ue(y.TOKEN)}function Xe(n,e){return Array.from(new Set([...n,...e])).length!==n.length+e.length}function Ge(n,e,t){if(n.length!==e.length)return!1;const s=t?[...n.map(i=>i[t]),...e.map(i=>i[t])]:[...n,...e];return Array.from(new Set(s)).length===n.length}function Qe(n,e,t){let s;const r=k((...i)=>(s=void 0,n(...i)),t);return(...i)=>{let a=i;return s&&(a=e(s,a)),s=a,r(...a)}}function Ze(n,e,t){let s,r=[];const i=k(async(...o)=>{s=void 0;try{const u=await n(...o);return r.forEach(c=>{c.resolve(u)}),r=[],u}catch(u){r.forEach(c=>{c.reject(u)}),r=[]}},t);return async(...o)=>{let u=o;return s&&(u=e(s,u)),s=u,i(...u),new Promise((c,d)=>{r.push({resolve:c,reject:d})})}}function et(n,e){Object.keys(e).forEach(t=>{M(e[t])&&(n[t]=e[t])})}function tt(n,e){Object.keys(e).forEach(t=>{M(e[t])&&S(n[t])&&(n[t]=e[t])})}function st(n,e,t){const s=new Set([...n,...e]),r=[],i=[],a=[];if(t){const o=n.map(c=>c[t]),u=e.map(c=>c[t]);s.forEach(c=>{if(!o.includes(c[t])){i.push(c);return}if(!u.includes(c[t])){r.push(c);return}a.push(c)})}else s.forEach(o=>{if(!n.includes(o)){i.push(o);return}if(!e.includes(o)){r.push(o);return}a.push(o)});return{more:r,less:i,same:a}}function nt(n){if(S(n))return;const e=Number(n);if(!Number.isNaN(e))return e}const rt=/<svg\b[^>]*>[\s\S]*?<\/svg>/;function it(n){return rt.test(n)}function ot(n,e){let t,s;try{t=n.toString().split(".")[1].length}catch{t=0}try{s=e.toString().split(".")[1].length}catch{s=0}const r=10**Math.max(t,s);return(n*r+e*r)/r}function at(n,e){e.forEach(t=>{Object.prototype.hasOwnProperty.call(n,t)||Object.defineProperty(n,t,{enumerable:!0,configurable:!0,writable:!0,value:void 0})})}class Ce{async onBeforeRequest(e){return e}onRequestError(e){return Promise.reject(e)}async onResponseSuccess(e){return e}onResponseError(e){return Promise.reject(e)}use(e){this.requestTag=e.interceptors.request.use(this.onBeforeRequest,this.onRequestError),this.responseTag=e.interceptors.response.use(this.onResponseSuccess,this.onResponseError)}eject(e){this.requestTag&&e.interceptors.request.eject(this.requestTag),this.responseTag&&e.interceptors.response.eject(this.responseTag)}}l("Interceptor",Ce);class ye extends Ce{async onBeforeRequest(e){e=await super.onBeforeRequest(e);const{headers:t}=e;t.set("Authorization",`Bearer ${H()}`);let s=ibiz.env.dcSystem;const{orgData:r}=ibiz;return r&&(r.systemid&&(s=r.systemid),r.orgid&&t.set("srforgid",r.orgid)),t.set("srfsystemid",s),e}}l("CoreInterceptor",ye);class P{constructor(e){this.parent=e,this.evt=new ce(1e3)}next(e){this.evt.emit("all",e),this.parent&&this.nextParent(e)}nextParent(e){this.parent&&(this.parent.evt.emit("all",e),this.parent.nextParent(e))}on(e){this.evt.on("all",e)}off(e){this.evt.off("all",e)}}class ut extends P{}class O extends P{sendCommand(e,t){const s={messageid:_(),messagename:"command",type:"COMMAND",subtype:t,data:e};this.next(s)}}class ct extends O{send(e){this.sendCommand(e,"OBJECTCREATED")}}class lt extends O{send(e){this.sendCommand(e,"OBJECTUPDATED")}}class ht extends O{send(e){this.sendCommand(e,"OBJECTREMOVED")}}class dt extends O{}class ft extends O{send(e){this.sendCommand(e,"ASYNCACTION")}}class pt extends P{constructor(){super(...arguments),this.change=new dt,this.create=new ct(this),this.update=new lt(this),this.remove=new ht(this),this.asyncAction=new ft(this)}next(e){switch(e.subtype){case"OBJECTCREATED":this.create.next(e),this.change.next(e);break;case"OBJECTUPDATED":this.update.next(e),this.change.next(e);break;case"OBJECTREMOVED":this.remove.next(e),this.change.next(e);break;default:super.next(e)}}nextParent(e){switch(e.subtype){case"OBJECTCREATED":this.change.next(e);break;case"OBJECTUPDATED":this.change.next(e);break;case"OBJECTREMOVED":this.change.next(e);break}super.nextParent(e)}send(e,t){const s={messageid:_(),messagename:"command",type:"COMMAND",subtype:t,data:e};this.next(s)}}class mt extends P{send(e){const t={messageid:_(),messagename:"console",type:"CONSOLE",data:e};this.next(t)}}class Fe{constructor(){this.all=new ut,this.command=new pt(this.all),this.console=new mt(this.all)}next(e){e.type==="COMMAND"?this.command.next(e):e.type==="CONSOLE"?this.console.next(e):this.all.next(e)}on(e){this.all.on(e)}off(e){this.all.off(e)}}l("MessageCenter",Fe);const Et="ibiz",gt="is-";function w(n,e,t,s,r){let i=`${n}-${e}`;return t&&(i+=`-${t}`),s&&(i+=`__${s}`),r&&(i+=`--${r}`),i}class wt{constructor(e,t){this.block=e,this.namespace=t||Et}b(e=""){return w(this.namespace,this.block,e,"","")}e(e){return e?w(this.namespace,this.block,"",e,""):""}m(e){return e?w(this.namespace,this.block,"","",e):""}be(e,t){return e&&t?w(this.namespace,this.block,e,t,""):""}em(e,t){return e&&t?w(this.namespace,this.block,"",e,t):""}bm(e,t){return e&&t?w(this.namespace,this.block,e,"",t):""}bem(e,t,s){return e&&t&&s?w(this.namespace,this.block,e,t,s):""}is(e,t){return e&&t?`${gt}${e}`:""}cssVar(e){const t={};for(const s in e)e[s]&&(t[this.cssVarName(s)]=e[s]);return t}cssVarBlock(e){const t={};for(const s in e)e[s]&&(t[this.cssVarBlockName(s)]=e[s]);return t}cssVarName(e){return`--${this.namespace}-${e}`}cssVarBlockName(e){return`--${this.namespace}-${this.block}-${e}`}}l("Namespace",wt);class bt{constructor(e,t,s){this.local=!0,this.ok=!1,this.headers={},this.config={headers:new B.AxiosHeaders},this.data=e,this.status=t||200,this.statusText=s||"",this.status>=200&&this.status<300&&(this.ok=!0)}}l("HttpResponse",bt);class ve{constructor(e){this.urlReg=/^http[s]?:\/\/[^\s]*/,this.waitRequest=new Map,this.interceptors=new Map,this.instance=B.create(e),this.addInterceptor("Default",new ye)}get baseUrl(){return this.instance.defaults.baseURL||`${ibiz.env.baseUrl}/${ibiz.env.appId}`}addInterceptor(e,t){t.use(this.instance),this.interceptors.set(e,t)}removeInterceptor(e){const t=this.interceptors.get(e);t&&(t.eject(this.instance),this.interceptors.delete(e))}get presetConfig(){return{baseURL:this.baseUrl,headers:{"Content-Type":"application/json;charset=UTF-8",Accept:"application/json"}}}mergeConfig(...e){const t=this.presetConfig;if(e.length===0)return t;const{url:s}=e[0];return s&&this.urlReg.test(s)&&delete t.baseURL,R(t,...e)}async post(e,t,s={},r={}){e=this.handleAppPresetParam(e,s);try{const i=await this.request(e,{method:"post",data:t,headers:r});return this.doResponseResult(i)}catch(i){throw new g(i)}}async get(e,t={},s={},r={}){e=this.attachUrlParam(e,t);try{const i=await this.request(e,R({method:"get",headers:s},r));return this.doResponseResult(i)}catch(i){throw new g(i)}}async delete(e,t,s={}){e=this.handleAppPresetParam(e,t);try{const r=await this.request(e,{method:"delete",headers:s});return this.doResponseResult(r)}catch(r){throw new g(r)}}async put(e,t,s={},r={}){e=this.handleAppPresetParam(e,s);try{const i=await this.request(e,{method:"put",data:t,headers:r});return this.doResponseResult(i)}catch(i){throw new g(i)}}async getModel(e,t={}){try{const s=await this.instance.get(e,{headers:t});return this.doResponseResult(s)}catch(s){throw new g(s)}}async request(e,t={}){const s=this.mergeConfig({url:e},t),r=JSON.stringify(s);try{let i=null;this.waitRequest.has(r)?i=this.waitRequest.get(r):(i=this.instance.request(s),this.waitRequest.set(r,i));const a=await i;return this.waitRequest.has(r)&&this.waitRequest.delete(r),this.doResponseResult(a)}catch(i){throw this.waitRequest.has(r)&&this.waitRequest.delete(r),new g(i)}}axios(e){return B(e)}async sse(e,t,s={}){e=this.attachUrlParam(this.baseUrl+e,t),s.headers||(s.headers={});const r=s.headers;{r.Authorization=`Bearer ${H()}`;let a=ibiz.env.dcSystem;const{orgData:o}=ibiz;o&&(o.systemid&&(a=o.systemid),o.orgid&&(r.srforgid=o.orgid)),r.srfsystemid=a}const i=D({openWhenHidden:!0,method:"POST"},s);await pe(e,i)}doResponseResult(e){const t=e;if(t.status>=200&&t.status<=299){t.ok=!0;const s=t.data;(s===""||s===null)&&(t.data=void 0)}return t}handleAppPresetParam(e,t){return t?(Object.keys(t).forEach(r=>{r.startsWith("srf")&&C(t[r])&&t[r]}),this.attachUrlParam(e,t)):e}attachUrlParam(e,t){{const r=e.split("?");r[0]=r[0].split("/").map(i=>encodeURIComponent(i)).join("/"),e=r.length>1?r.join("?"):r[0]}const s=le.stringify(t);return C(s)&&(e.endsWith("?")?e=`${e}${s}`:e.indexOf("?")!==-1&&e.endsWith("&")?e=`${e}${s}`:e.indexOf("?")!==-1&&!e.endsWith("&")?e=`${e}&${s}`:e=`${e}?${s}`),e}}l("Net",ve);class W{static fill(e,t,s){return C(e)&&(C(t)&&e.match(this.contextReg)?.forEach(i=>{const a=i.slice(10,i.length-1);e=e.replace(`\${context.${a}}`,t[a]||"")}),C(s)&&e.match(this.dataReg)?.forEach(i=>{const a=i.slice(7,i.length-1);e=e.replace(`\${data.${a}}`,s[a]||"")})),e}}l("StringUtil",W),W.contextReg=/\$\{context.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g,W.dataReg=/\$\{data.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g;class Ct{static get routeBase(){const e=window.location.href.lastIndexOf("#/");return window.location.href.slice(0,e+1)}static get appBase(){const{origin:e,pathname:t}=window.location;return`${e}${t}`.replace(/\/$/,"")}static get routePath(){return window.location.hash.replace("#","")}static get fullPath(){return window.location.href}}l("UrlHelper",Ct);function V(n){const e=n.composedPath&&n.composedPath()||n.path;if(e!=null)return e;function t(s,r=[]){const i=s.parentNode;return i?t(i,r.concat([i])):r}return[n.target].concat(t(n.target))}function N(n,e,t,s={}){n.addEventListener(e,t,s);let r=()=>{n.removeEventListener(e,t,s),r=He};return()=>{r()}}function Ae(n,e){return e&&(n.target===e||V(n).includes(e))}const yt=typeof window<"u"?window:void 0;function Ft(n,e,t={}){const{window:s=yt,ignore:r=[],capture:i=!0}=t;if(!n)throw new F("target\u5143\u7D20\u4E0D\u5B58\u5728");if(!s)throw new F("\u627E\u4E0D\u5230window");let a=!0;const o=m=>![n,...r].some(A=>Ae(m,A));let u=!1;const c=()=>{u=!0},d=()=>{u=!1};let f;const x=m=>{u||(s.clearTimeout(f),a&&o(m)&&e(m))},b=[N(s,"click",x,{passive:!0,capture:i}),N(s,"pointerdown",m=>{u||(a=o(m))},{passive:!0}),N(s,"pointerup",m=>{if(!u&&m.button===0){const A=V(m);m.composedPath=()=>A,f=s.setTimeout(()=>x(m),50)}},{passive:!0})].filter(Boolean);return{stop:()=>b.forEach(m=>m()),pause:c,proceed:d}}const T=Math.round;function De(n){const e=n.length,t=[];if(n.slice(0,3).toLowerCase()==="rgb"){const s=n.match(/([\d|.%]{1,3})/g);t[0]=parseInt(s[0],10),t[1]=parseInt(s[1],10),t[2]=parseInt(s[2],10),t[3]=s[3]?s[3].indexOf("%")!==-1?parseInt(s[3],10)/100:parseFloat(s[3]):1}else{let s;e<6?s=parseInt(String(n[1])+n[1]+n[2]+n[2]+n[3]+n[3]+(e>4?String(n[4])+n[4]:""),16):s=parseInt(n.slice(1),16),t[0]=s>>16&255,t[1]=s>>8&255,t[2]=s&255,t[3]=e===9||e===5?T((s>>24&255)/255*1e4)/1e4:1}return t}function vt(n,e,t=.5,s="hex"){n=n.trim(),e=e.trim();const r=De(n),i=De(e),a=[T((1-t)*r[0]+t*i[0]),T((1-t)*r[1]+t*i[1]),T((1-t)*r[2]+t*i[2]),(1-t)*r[3]+t*i[3]];if(s==="hex"){const o=[a[0].toString(16),a[1].toString(16),a[2].toString(16),a[3]===0?"00":T(a[3]*255).toString(16)];return`#${o[0]}${o[1]}${o[2]}${o[3]}`}return`rgb(${a[0]} ${a[1]} ${a[2]} / ${a[3]})`}function Re(n){const e=n.split(".").pop();let t="";switch(e){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":t="image/jpeg";break;case".jpg":t="image/jpeg";break;case".rtf":t="application/rtf";break;case".avi":t="video/x-msvideo";break;case".gz":t="application/x-gzip";break;case".tar":t="application/x-tar";break;case".xlsx":t="application/vnd.ms-excel";break;default:t=""}return t}function At(n){const e=n.split(".").pop();return e?[".jpeg","jpg","gif","png","bmp","svg"].includes(e):!1}function Dt(n,e){const t=Re(e),s=new Blob([n],{type:t}),r=URL.createObjectURL(s),i=document.createElement("a");i.href=r,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}function Oe(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t]);return e}function Te(n){const e=R({multiple:!0,accept:""},n),t=document.createElement("input");t.setAttribute("type","file"),t.setAttribute("multiple",`${e.multiple}`),t.setAttribute("accept",e.accept),t.onchange=s=>{const r=s.target,i=r.files?Oe(r.files):[];i.length!==0&&(e.onSelected(i),r.value="")},document.body.appendChild(t),t.click(),document.body.removeChild(t)}function Rt(n){const e=R({multiple:!0,accept:"",separate:!0,beforeUpload:(o,u)=>!0,finish:o=>{},success:(o,u)=>{},error:(o,u)=>{},progress:o=>{}},n),t=(o,u)=>{u.forEach(c=>{c.percentage=ne(o.progress*100)}),e.progress(re(u))},s=async(o,u)=>{if(e.request&&$(e.request))return e.request(o);const c=new FormData;throw o.forEach(d=>{c.append("file",d)}),new F("\u591A\u5E94\u7528\u6A21\u5F0F\u7B49\u5F85\u91CD\u65B0\u5B9E\u73B0\u8BF7\u6C42")},r=async o=>{const u=o.map(d=>({status:"uploading",name:d.name,uid:se(),percentage:0}));if(!e.beforeUpload(o,u))return u.forEach(d=>{d.status="cancel"}),ibiz.log.debug("\u53D6\u6D88\u4E0A\u4F20",u),u;try{const d=await s(o,f=>{t(f,u)});u.forEach(f=>{f.status="finished"}),e.success(u,d),u.forEach(f=>{f.response=d})}catch(d){u.forEach(f=>{f.status="fail"}),e.error(u,d),u.forEach(f=>{f.error=d}),ibiz.log.error(d),ibiz.log.error(`${o.map(f=>f.name).join(",")}\u4E0A\u4F20\u5931\u8D25`)}return u},i=async o=>{const u=e.separate?o.map(f=>[f]):[o],c=await Promise.allSettled(u.map(async f=>r(f))),d=[];c.forEach(f=>{f.status==="fulfilled"&&d.push(...f.value)}),e.finish(d)};(()=>{Te({accept:e.accept,multiple:e.multiple,onSelected:o=>{i(o)}})})()}async function Ot(n,e,t){if(await new Promise(s=>{setTimeout(()=>{s(!0)},n)}),e)return e(...t||[])}class Tt{constructor(){this.promise=null,this.resolve=null,this.count=0}startPromise(){this.promise=new Promise(e=>{this.resolve=e})}endPromise(){this.resolve&&(this.resolve(),this.resolve=null,this.promise=null)}lock(){this.count+=1,this.promise||this.startPromise()}unlock(){if(this.count<1)throw new F("lock\u548Cunlock\u6B21\u6570\u4E0D\u5339\u914D\uFF01");this.count-=1,this.count===0&&this.endPromise()}async await(){this.promise&&await this.promise}}l("CountLatch",Tt);async function _t(n){try{const e=await ibiz.net.get(n),t=document.createElement("style");t.setAttribute("title","app-style-css"),t.innerText=e.data,document.head.appendChild(t)}catch{ibiz.log.debug("\u52A0\u8F7D\u8FDC\u7A0B\u6837\u5F0F\u8868\u5931\u8D25",n)}}const _e={childrenFields:["children"]},Be=new Error("\u4E2D\u65AD\u64CD\u4F5C");function Bt(n,e){for(const t of e)if(n[t]?.length)return n[t]}function It(n,e,t){const{childrenFields:s}=D(_e,t||{}),r=Bt(n,s);if(r?.length)for(const i of r){if(e(i))throw Be;J(i,e,t)}}function J(n,e,t){try{It(n,e,t)}catch(s){if(s!==Be)throw s}}const Pt={..._e,compareField:"name"};function Nt(n,e,t){const{compareField:s,compareCallback:r}=D(Pt,t||{}),i=r||(o=>o[s]===e);let a;return J(n,o=>{if(i(o,e,s))return a=o,!0},t),a}class Ie{static isNumber(e){return["BIGINT","BINARY","DECIMAL","FLOAT","INT","MONEY","NUMERIC","REAL","SMALLINT","SMALLMONEY","TINYINT","VARBINARY"].includes(this.toString(e))}static isDate(e){return["DATETIME","SMALLDATETIME","DATE","TIME"].includes(this.toString(e))}static toString(e){return this.typeMap[e]}}l("DataTypes",Ie),Ie.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"};function Pe(n){if(ae(n)&&$(n.clone))return n.clone()}const xt={deep:!0};function Ut(n,e){return D(xt,e||{}).deep?ie(n,Pe):oe(n,Pe)}function Ne(n){return!!n&&!(n&n-1)}function K(n){if(!Ne(n))throw new F(`${n}\u4E0D\u662F2\u7684\u5E42`)}function Mt(n=0,e){return K(e),n|e}function St(n=0,e){return K(e),n&~e}function kt(n=0,e){return K(e),(n&e)!==0}const Ht=l("BitMask",{validate:Ne,setPermission:Mt,removePermission:St,checkPermission:kt}),Y=he.noConflict();L.reg(Y),L.apply(Y);class xe{constructor(){this.env=Ve,this.log=Y,this.net=new ve,this.commands=new z,this.mc=new Fe}}l("IBizSys",xe);function $t(){if(window.ibiz)throw new Error("ibiz \u5DF2\u7ECF\u5B58\u5728, \u65E0\u9700\u91CD\u590D\u5B89\u88C5");window.ibiz=new xe}}}});
|
package/out/utils/util/util.d.ts
CHANGED
|
@@ -128,4 +128,14 @@ export declare function isSvg(str: string): boolean;
|
|
|
128
128
|
* @Date: 2023-11-08 17:04:09
|
|
129
129
|
*/
|
|
130
130
|
export declare function plus(a: number, b: number): number;
|
|
131
|
+
/**
|
|
132
|
+
* 根据给定的属性名称集合,
|
|
133
|
+
* 查看目标对象是否具有该属性,如果没有设置undefined的定义
|
|
134
|
+
* @author lxm
|
|
135
|
+
* @date 2023-12-20 05:21:47
|
|
136
|
+
* @export
|
|
137
|
+
* @param {IParams} target 目标对象
|
|
138
|
+
* @param {s(string | symbol)[]} keys 需要支持的属性名称集合
|
|
139
|
+
*/
|
|
140
|
+
export declare function updateKeyDefine(target: IParams, keys: (string | symbol)[]): void;
|
|
131
141
|
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/utils/util/util.ts"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,wBAAgB,QAAQ,IAAI,MAAM,GAAG,IAAI,CAExC;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAG3D;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,GAAG,EAAE,EACX,IAAI,EAAE,GAAG,EAAE,EACX,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAUT;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAChE,IAAI,EAAE,CAAC,EACP,SAAS,EAAE,CACT,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,EACxB,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,KACrB,UAAU,CAAC,CAAC,CAAC,EAClB,IAAI,CAAC,EAAE,MAAM,GACZ,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,GAAG,CAiBjC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACnC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,EAE1C,IAAI,EAAE,CAAC,EACP,SAAS,EAAE,CACT,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,EACxB,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,KACrB,UAAU,CAAC,CAAC,CAAC,EAClB,IAAI,CAAC,EAAE,MAAM,GACZ,CAAC,CAoCH;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAMpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAM3D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,KAAK,EAAE,EACb,IAAI,EAAE,KAAK,EAAE,EACb,QAAQ,CAAC,EAAE,MAAM,GAChB;IACD,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,IAAI,EAAE,KAAK,EAAE,CAAC;CACf,CAuCA;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAShE;AAID;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE1C;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAejD"}
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/utils/util/util.ts"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,wBAAgB,QAAQ,IAAI,MAAM,GAAG,IAAI,CAExC;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAG3D;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,GAAG,EAAE,EACX,IAAI,EAAE,GAAG,EAAE,EACX,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAUT;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAChE,IAAI,EAAE,CAAC,EACP,SAAS,EAAE,CACT,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,EACxB,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,KACrB,UAAU,CAAC,CAAC,CAAC,EAClB,IAAI,CAAC,EAAE,MAAM,GACZ,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,GAAG,CAiBjC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACnC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,EAE1C,IAAI,EAAE,CAAC,EACP,SAAS,EAAE,CACT,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,EACxB,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,KACrB,UAAU,CAAC,CAAC,CAAC,EAClB,IAAI,CAAC,EAAE,MAAM,GACZ,CAAC,CAoCH;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAMpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAM3D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,KAAK,EAAE,EACb,IAAI,EAAE,KAAK,EAAE,EACb,QAAQ,CAAC,EAAE,MAAM,GAChB;IACD,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,IAAI,EAAE,KAAK,EAAE,CAAC;CACf,CAuCA;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAShE;AAID;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE1C;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAejD;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GACxB,IAAI,CAWN"}
|
package/out/utils/util/util.js
CHANGED
|
@@ -276,3 +276,24 @@ export function plus(a, b) {
|
|
|
276
276
|
const e = 10 ** Math.max(c, d);
|
|
277
277
|
return (a * e + b * e) / e;
|
|
278
278
|
}
|
|
279
|
+
/**
|
|
280
|
+
* 根据给定的属性名称集合,
|
|
281
|
+
* 查看目标对象是否具有该属性,如果没有设置undefined的定义
|
|
282
|
+
* @author lxm
|
|
283
|
+
* @date 2023-12-20 05:21:47
|
|
284
|
+
* @export
|
|
285
|
+
* @param {IParams} target 目标对象
|
|
286
|
+
* @param {s(string | symbol)[]} keys 需要支持的属性名称集合
|
|
287
|
+
*/
|
|
288
|
+
export function updateKeyDefine(target, keys) {
|
|
289
|
+
keys.forEach(key => {
|
|
290
|
+
if (!Object.prototype.hasOwnProperty.call(target, key)) {
|
|
291
|
+
Object.defineProperty(target, key, {
|
|
292
|
+
enumerable: true,
|
|
293
|
+
configurable: true,
|
|
294
|
+
writable: true,
|
|
295
|
+
value: undefined,
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-beta.0",
|
|
4
4
|
"description": "核心包",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/index.js",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"qx-util": "^0.4.8",
|
|
51
51
|
"ramda": "^0.29.0"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "06600ef120d5aaca67336eb6afdf5281195d507a"
|
|
54
54
|
}
|
package/src/utils/util/util.ts
CHANGED
|
@@ -315,3 +315,28 @@ export function plus(a: number, b: number): number {
|
|
|
315
315
|
const e = 10 ** Math.max(c, d);
|
|
316
316
|
return (a * e + b * e) / e;
|
|
317
317
|
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* 根据给定的属性名称集合,
|
|
321
|
+
* 查看目标对象是否具有该属性,如果没有设置undefined的定义
|
|
322
|
+
* @author lxm
|
|
323
|
+
* @date 2023-12-20 05:21:47
|
|
324
|
+
* @export
|
|
325
|
+
* @param {IParams} target 目标对象
|
|
326
|
+
* @param {s(string | symbol)[]} keys 需要支持的属性名称集合
|
|
327
|
+
*/
|
|
328
|
+
export function updateKeyDefine(
|
|
329
|
+
target: IParams,
|
|
330
|
+
keys: (string | symbol)[],
|
|
331
|
+
): void {
|
|
332
|
+
keys.forEach(key => {
|
|
333
|
+
if (!Object.prototype.hasOwnProperty.call(target, key)) {
|
|
334
|
+
Object.defineProperty(target, key, {
|
|
335
|
+
enumerable: true,
|
|
336
|
+
configurable: true,
|
|
337
|
+
writable: true,
|
|
338
|
+
value: undefined,
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
}
|