@ibiz-template/core 0.2.18-dev.0 → 0.2.18
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 +9 -8
- package/dist/index.system.min.js +2 -2
- package/dist/index.system.min.js.map +1 -1
- package/out/interface/i-portal-async-action/i-portal-async-action.d.ts +72 -0
- package/out/interface/i-portal-async-action/i-portal-async-action.d.ts.map +1 -1
- package/out/utils/net/http-response.d.ts.map +1 -1
- package/out/utils/net/http-response.js +2 -2
- package/out/utils/net/net.d.ts.map +1 -1
- package/out/utils/net/net.js +4 -1
- package/package.json +2 -2
- package/src/interface/i-portal-async-action/i-portal-async-action.ts +78 -0
- package/src/utils/net/http-response.ts +2 -3
- package/src/utils/net/net.ts +4 -1
package/dist/index.esm.js
CHANGED
|
@@ -1717,9 +1717,7 @@ var Namespace = class {
|
|
|
1717
1717
|
};
|
|
1718
1718
|
|
|
1719
1719
|
// src/utils/net/http-response.ts
|
|
1720
|
-
import
|
|
1721
|
-
AxiosHeaders
|
|
1722
|
-
} from "axios";
|
|
1720
|
+
import axios from "axios";
|
|
1723
1721
|
var HttpResponse = class {
|
|
1724
1722
|
/**
|
|
1725
1723
|
* Creates an instance of HttpResponse.
|
|
@@ -1741,7 +1739,7 @@ var HttpResponse = class {
|
|
|
1741
1739
|
this.ok = false;
|
|
1742
1740
|
this.headers = {};
|
|
1743
1741
|
this.config = {
|
|
1744
|
-
headers: new AxiosHeaders()
|
|
1742
|
+
headers: new axios.AxiosHeaders()
|
|
1745
1743
|
};
|
|
1746
1744
|
this.data = data;
|
|
1747
1745
|
this.status = status || 200;
|
|
@@ -1753,10 +1751,10 @@ var HttpResponse = class {
|
|
|
1753
1751
|
};
|
|
1754
1752
|
|
|
1755
1753
|
// src/utils/net/net.ts
|
|
1756
|
-
import
|
|
1754
|
+
import axios2 from "axios";
|
|
1757
1755
|
import { merge } from "lodash-es";
|
|
1758
1756
|
import qs from "qs";
|
|
1759
|
-
import { notNilEmpty } from "qx-util";
|
|
1757
|
+
import { isNilOrEmpty, notNilEmpty } from "qx-util";
|
|
1760
1758
|
import { mergeDeepRight } from "ramda";
|
|
1761
1759
|
var Net = class {
|
|
1762
1760
|
/**
|
|
@@ -1792,7 +1790,7 @@ var Net = class {
|
|
|
1792
1790
|
* @type {Map<string, Interceptor>}
|
|
1793
1791
|
*/
|
|
1794
1792
|
this.interceptors = /* @__PURE__ */ new Map();
|
|
1795
|
-
this.instance =
|
|
1793
|
+
this.instance = axios2.create(config);
|
|
1796
1794
|
this.addInterceptor("Default", new CoreInterceptor());
|
|
1797
1795
|
}
|
|
1798
1796
|
get baseUrl() {
|
|
@@ -2013,7 +2011,7 @@ var Net = class {
|
|
|
2013
2011
|
* @return {*}
|
|
2014
2012
|
*/
|
|
2015
2013
|
axios(config) {
|
|
2016
|
-
return
|
|
2014
|
+
return axios2(config);
|
|
2017
2015
|
}
|
|
2018
2016
|
/**
|
|
2019
2017
|
* 触发 sse 请求
|
|
@@ -2067,6 +2065,9 @@ var Net = class {
|
|
|
2067
2065
|
const res = response;
|
|
2068
2066
|
if (res.status >= 200 && res.status <= 299) {
|
|
2069
2067
|
res.ok = true;
|
|
2068
|
+
if (isNilOrEmpty(res.data)) {
|
|
2069
|
+
res.data = void 0;
|
|
2070
|
+
}
|
|
2070
2071
|
}
|
|
2071
2072
|
return res;
|
|
2072
2073
|
}
|
package/dist/index.system.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
System.register(["ramda","lodash-es","qx-util","axios","qs","loglevel","loglevel-plugin-prefix"],function(l){"use strict";var te,
|
|
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 ke(n,e){const t=new Uint8Array(n.length+e.length);return t.set(n),t.set(e,n.length),t}function fe(){return{data:"",event:"",id:"",retry:void 0}}var $e=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"),Le=1e3,pe="last-event-id";function me(n,e){var{signal:t,headers:s,onopen:r,onmessage:i,onclose:a,onerror:o,openWhenHidden:u,fetch:c}=e,d=$e(e,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((f,P)=>{const b=Object.assign({},s);b.accept||(b.accept=j);let F;function m(){F.abort(),document.hidden||Q()}u||document.addEventListener("visibilitychange",m);let A=Le,X=0;function G(){document.removeEventListener("visibilitychange",m),window.clearTimeout(X),F.abort()}t?.addEventListener("abort",()=>{G(),f()});const Lt=c??window.fetch,jt=r??je;async function Q(){var Z;F=new AbortController;try{const x=await Lt(n,Object.assign(Object.assign({},d),{headers:b,signal:F.signal}));await jt(x),await h(x.body,Me(Se(E=>{E?b[pe]=E:delete b[pe]},E=>{A=E},i))),a?.(),G(),f()}catch(x){if(!F.signal.aborted)try{const E=(Z=o?.(x))!==null&&Z!==void 0?Z:A;window.clearTimeout(X),X=window.setTimeout(Q,E)}catch(E){G(),P(E)}}}Q()})}function je(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 Ee{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",Ee);function qe(n){const e=this;let t=!1,s;return function(){return t||(t=!0,s=n.apply(e,arguments)),s}}function ge(n){return{dispose:qe(()=>{n()})}}function ze(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 He(n,e){let t=null;return function(...s){t||(t=setTimeout(()=>{n.apply(this,s),t=null},e))}}class we{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 Ee,this.commands.set(r,i));const a=i.unshift(e);return ge(()=>{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",we);class z{constructor(){this.commandRegister=new we}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 R{}l("CoreConst",R),R.DEFAULT_MODEL_SERVICE_TAG="default",R.TOKEN="ibzuaa-token",R.TOKEN_EXPIRES="ibzuaa-token-expires";const We=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 be=l("LoginMode",(n=>(n.DEFAULT="DEFAULT",n.CUSTOM="CUSTOM",n.CAS="CAS",n))(be||{})),Ce=l("MenuPermissionMode",(n=>(n.MIXIN="MIXIN",n.RESOURCE="RESOURCE",n.RT="RT",n))(Ce||{}));class B{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 B(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 B(e,t)}}l("IBizContext",B);class Ve{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",Ve);const Je=l("Environment",{dev:!1,hub:!0,enableMqtt:!1,mqttUrl:"/portal/mqtt/mqtt",isEnableMultiLan:!1,logLevel:"ERROR",baseUrl:"/api",appId:"",pluginBaseUrl:"./plugins",isLocalModel:!1,remoteModelUrl:"/remotemodel",assetsUrl:"./assets",dcSystem:"",downloadFileUrl:"/ibizutil/download",uploadFileUrl:"/ibizutil/upload",casLoginUrl:"",loginMode:be.DEFAULT,menuPermissionMode:Ce.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 Ye 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",Ye);class y extends Error{constructor(e){super(e),this.message=e,this.name="Runtime Error"}}l("RuntimeError",y);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 Xe extends Error{constructor(e,t){super(e),this.message=e,this.duration=t,this.name="notice Error"}}l("NoticeError",Xe);function H(){return ue(R.TOKEN)}function Ge(n,e){return Array.from(new Set([...n,...e])).length!==n.length+e.length}function Qe(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 Ze(n,e,t){let s;const r=S((...i)=>(s=void 0,n(...i)),t);return(...i)=>{let a=i;return s&&(a=e(s,a)),s=a,r(...a)}}function et(n,e,t){let s,r=[];const i=S(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 tt(n,e){Object.keys(e).forEach(t=>{U(e[t])&&(n[t]=e[t])})}function st(n,e){Object.keys(e).forEach(t=>{U(e[t])&&M(n[t])&&(n[t]=e[t])})}function nt(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 rt(n){if(M(n))return;const e=Number(n);if(!Number.isNaN(e))return e}const it=/<svg\b[^>]*>[\s\S]*?<\/svg>/;function ot(n){return it.test(n)}function at(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 ye{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",ye);class Fe extends ye{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",Fe);class I{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 I{}class O extends I{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 I{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 I{send(e){const t={messageid:_(),messagename:"console",type:"CONSOLE",data:e};this.next(t)}}class Ae{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",Ae);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 le},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=$.create(e),this.addInterceptor("Default",new Fe)}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,D(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,D({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 $(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=v({openWhenHidden:!0,method:"POST"},s);await me(e,i)}doResponseResult(e){const t=e;return t.status>=200&&t.status<=299&&(t.ok=!0),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=he.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=We};return()=>{r()}}function De(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 y("target\u5143\u7D20\u4E0D\u5B58\u5728");if(!s)throw new y("\u627E\u4E0D\u5230window");let a=!0;const o=m=>![n,...r].some(A=>De(m,A));let u=!1;const c=()=>{u=!0},d=()=>{u=!1};let f;const P=m=>{u||(s.clearTimeout(f),a&&o(m)&&e(m))},b=[N(s,"click",P,{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(()=>P(m),50)}},{passive:!0})].filter(Boolean);return{stop:()=>b.forEach(m=>m()),pause:c,proceed:d}}const T=Math.round;function Re(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 At(n,e,t=.5,s="hex"){n=n.trim(),e=e.trim();const r=Re(n),i=Re(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 Oe(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 vt(n){const e=n.split(".").pop();return e?[".jpeg","jpg","gif","png","bmp","svg"].includes(e):!1}function Dt(n,e){const t=Oe(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 Te(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t]);return e}function _e(n){const e=D({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?Te(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=D({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&&k(e.request))return e.request(o);const c=new FormData;throw o.forEach(d=>{c.append("file",d)}),new y("\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)};(()=>{_e({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 y("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 Be={childrenFields:["children"]},Ie=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}=v(Be,t||{}),r=Bt(n,s);if(r?.length)for(const i of r){if(e(i))throw Ie;J(i,e,t)}}function J(n,e,t){try{It(n,e,t)}catch(s){if(s!==Ie)throw s}}const Nt={...Be,compareField:"name"};function Pt(n,e,t){const{compareField:s,compareCallback:r}=v(Nt,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 Ne{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",Ne),Ne.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)&&k(n.clone))return n.clone()}const xt={deep:!0};function Ut(n,e){return v(xt,e||{}).deep?ie(n,Pe):oe(n,Pe)}function xe(n){return!!n&&!(n&n-1)}function Y(n){if(!xe(n))throw new y(`${n}\u4E0D\u662F2\u7684\u5E42`)}function Mt(n=0,e){return Y(e),n|e}function St(n=0,e){return Y(e),n&~e}function kt(n=0,e){return Y(e),(n&e)!==0}const Ht=l("BitMask",{validate:xe,setPermission:Mt,removePermission:St,checkPermission:kt}),K=de.noConflict();L.reg(K),L.apply(K);class Ue{constructor(){this.env=Je,this.log=K,this.net=new ve,this.commands=new z,this.mc=new Ae}}l("IBizSys",Ue);function $t(){if(window.ibiz)throw new Error("ibiz \u5DF2\u7ECF\u5B58\u5728, \u65E0\u9700\u91CD\u590D\u5B89\u88C5");window.ibiz=new Ue}}}});
|
|
1
|
+
System.register(["ramda","lodash-es","qx-util","axios","qs","loglevel","loglevel-plugin-prefix"],function(l){"use strict";var te,M,S,v,k,D,se,ne,re,$,ie,oe,ae,ue,ce,_,le,C,B,he,de,L;return{setters:[function(h){te=h.clone,M=h.isNotNil,S=h.isNil,v=h.mergeDeepRight},function(h){k=h.debounce,D=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,le=h.isNilOrEmpty,C=h.notNilEmpty},function(h){B=h.default},function(h){he=h.default},function(h){de=h.default},function(h){L=h.default}],execute:function(){l({awaitTimeout:Ot,calcMimeByFileName:Oe,clone:Ut,colorBlend:At,compareArr:nt,debounce:ze,debounceAndAsyncMerge:et,debounceAndMerge:Ze,downloadFileFromBlob:Dt,eventPath:V,fetchEventSource:me,fileListToArr:Te,findRecursiveChild:Pt,getToken:H,install:$t,isElementSame:Qe,isEventInside:De,isImage:vt,isOverlap:Ge,isSvg:ot,listenJSEvent:P,mergeDefaultInLeft:st,mergeInLeft:tt,onClickOutside:Ft,plus:at,recursiveIterate:J,selectFile:_e,setRemoteStyle:_t,throttle:He,toDisposable:ge,toNumberOrNil:rt,uploadFile:Rt});async function h(n,e){const t=n.getReader();let s;for(;!(s=await t.read()).done;)e(s.value)}function Me(n){let e,t,s,r=!1;return function(a){e===void 0?(e=a,t=0,s=-1):e=ke(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 Se(n,e,t){let s=fe();const r=new TextDecoder;return function(a,o){if(a.length===0)t?.(s),s=fe();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 ke(n,e){const t=new Uint8Array(n.length+e.length);return t.set(n),t.set(e,n.length),t}function fe(){return{data:"",event:"",id:"",retry:void 0}}var $e=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"),Le=1e3,pe="last-event-id";function me(n,e){var{signal:t,headers:s,onopen:r,onmessage:i,onclose:a,onerror:o,openWhenHidden:u,fetch:c}=e,d=$e(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 F;function m(){F.abort(),document.hidden||Q()}u||document.addEventListener("visibilitychange",m);let A=Le,X=0;function G(){document.removeEventListener("visibilitychange",m),window.clearTimeout(X),F.abort()}t?.addEventListener("abort",()=>{G(),f()});const Lt=c??window.fetch,jt=r??je;async function Q(){var Z;F=new AbortController;try{const U=await Lt(n,Object.assign(Object.assign({},d),{headers:b,signal:F.signal}));await jt(U),await h(U.body,Me(Se(E=>{E?b[pe]=E:delete b[pe]},E=>{A=E},i))),a?.(),G(),f()}catch(U){if(!F.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 je(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 Ee{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",Ee);function qe(n){const e=this;let t=!1,s;return function(){return t||(t=!0,s=n.apply(e,arguments)),s}}function ge(n){return{dispose:qe(()=>{n()})}}function ze(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 He(n,e){let t=null;return function(...s){t||(t=setTimeout(()=>{n.apply(this,s),t=null},e))}}class we{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 Ee,this.commands.set(r,i));const a=i.unshift(e);return ge(()=>{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",we);class z{constructor(){this.commandRegister=new we}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 R{}l("CoreConst",R),R.DEFAULT_MODEL_SERVICE_TAG="default",R.TOKEN="ibzuaa-token",R.TOKEN_EXPIRES="ibzuaa-token-expires";const We=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 be=l("LoginMode",(n=>(n.DEFAULT="DEFAULT",n.CUSTOM="CUSTOM",n.CAS="CAS",n))(be||{})),Ce=l("MenuPermissionMode",(n=>(n.MIXIN="MIXIN",n.RESOURCE="RESOURCE",n.RT="RT",n))(Ce||{}));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 Ve{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",Ve);const Je=l("Environment",{dev:!1,hub:!0,enableMqtt:!1,mqttUrl:"/portal/mqtt/mqtt",isEnableMultiLan:!1,logLevel:"ERROR",baseUrl:"/api",appId:"",pluginBaseUrl:"./plugins",isLocalModel:!1,remoteModelUrl:"/remotemodel",assetsUrl:"./assets",dcSystem:"",downloadFileUrl:"/ibizutil/download",uploadFileUrl:"/ibizutil/upload",casLoginUrl:"",loginMode:be.DEFAULT,menuPermissionMode:Ce.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 Ye 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",Ye);class y extends Error{constructor(e){super(e),this.message=e,this.name="Runtime Error"}}l("RuntimeError",y);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 Xe extends Error{constructor(e,t){super(e),this.message=e,this.duration=t,this.name="notice Error"}}l("NoticeError",Xe);function H(){return ue(R.TOKEN)}function Ge(n,e){return Array.from(new Set([...n,...e])).length!==n.length+e.length}function Qe(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 Ze(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 et(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 tt(n,e){Object.keys(e).forEach(t=>{M(e[t])&&(n[t]=e[t])})}function st(n,e){Object.keys(e).forEach(t=>{M(e[t])&&S(n[t])&&(n[t]=e[t])})}function nt(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 rt(n){if(S(n))return;const e=Number(n);if(!Number.isNaN(e))return e}const it=/<svg\b[^>]*>[\s\S]*?<\/svg>/;function ot(n){return it.test(n)}function at(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 ye{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",ye);class Fe extends ye{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",Fe);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 ut extends N{}class O extends N{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 N{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 N{send(e){const t={messageid:_(),messagename:"console",type:"CONSOLE",data:e};this.next(t)}}class Ae{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",Ae);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 Fe)}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,D(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,D({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=v({openWhenHidden:!0,method:"POST"},s);await me(e,i)}doResponseResult(e){const t=e;return t.status>=200&&t.status<=299&&(t.ok=!0,le(t.data)&&(t.data=void 0)),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=he.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 P(n,e,t,s={}){n.addEventListener(e,t,s);let r=()=>{n.removeEventListener(e,t,s),r=We};return()=>{r()}}function De(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 y("target\u5143\u7D20\u4E0D\u5B58\u5728");if(!s)throw new y("\u627E\u4E0D\u5230window");let a=!0;const o=m=>![n,...r].some(A=>De(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=[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 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 Re(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 At(n,e,t=.5,s="hex"){n=n.trim(),e=e.trim();const r=Re(n),i=Re(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 Oe(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 vt(n){const e=n.split(".").pop();return e?[".jpeg","jpg","gif","png","bmp","svg"].includes(e):!1}function Dt(n,e){const t=Oe(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 Te(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t]);return e}function _e(n){const e=D({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?Te(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=D({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 y("\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)};(()=>{_e({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 y("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 Be={childrenFields:["children"]},Ie=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}=v(Be,t||{}),r=Bt(n,s);if(r?.length)for(const i of r){if(e(i))throw Ie;J(i,e,t)}}function J(n,e,t){try{It(n,e,t)}catch(s){if(s!==Ie)throw s}}const Nt={...Be,compareField:"name"};function Pt(n,e,t){const{compareField:s,compareCallback:r}=v(Nt,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 Ne{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",Ne),Ne.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 v(xt,e||{}).deep?ie(n,Pe):oe(n,Pe)}function xe(n){return!!n&&!(n&n-1)}function Y(n){if(!xe(n))throw new y(`${n}\u4E0D\u662F2\u7684\u5E42`)}function Mt(n=0,e){return Y(e),n|e}function St(n=0,e){return Y(e),n&~e}function kt(n=0,e){return Y(e),(n&e)!==0}const Ht=l("BitMask",{validate:xe,setPermission:Mt,removePermission:St,checkPermission:kt}),K=de.noConflict();L.reg(K),L.apply(K);class Ue{constructor(){this.env=Je,this.log=K,this.net=new ve,this.commands=new z,this.mc=new Ae}}l("IBizSys",Ue);function $t(){if(window.ibiz)throw new Error("ibiz \u5DF2\u7ECF\u5B58\u5728, \u65E0\u9700\u91CD\u590D\u5B89\u88C5");window.ibiz=new Ue}}}});
|
|
3
3
|
//# sourceMappingURL=index.system.min.js.map
|