@ibiz-template/core 0.4.11 → 0.4.17-dev.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 +8 -0
- package/dist/index.system.min.js +2 -2
- package/out/constant/core/core.d.ts +8 -0
- package/out/constant/core/core.d.ts.map +1 -1
- package/out/constant/core/core.js +8 -0
- package/out/context/index.d.ts +9 -1
- package/out/context/index.d.ts.map +1 -1
- package/out/types.d.ts +4 -2
- package/out/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/constant/core/core.ts +9 -0
- package/src/context/index.ts +10 -1
- package/src/types.ts +4 -2
package/dist/index.esm.js
CHANGED
|
@@ -550,6 +550,14 @@ CoreConst.TOKEN = "ibzuaa-token";
|
|
|
550
550
|
* @memberof CoreConst
|
|
551
551
|
*/
|
|
552
552
|
CoreConst.TOKEN_EXPIRES = "ibzuaa-token-expires";
|
|
553
|
+
/**
|
|
554
|
+
* 认证信息是走记住我模式的 cookie 标识
|
|
555
|
+
*
|
|
556
|
+
* @author chitanda
|
|
557
|
+
* @date 2023-12-13 15:12:28
|
|
558
|
+
* @static
|
|
559
|
+
*/
|
|
560
|
+
CoreConst.TOKEN_REMEMBER = "ibizuaa-token-remember";
|
|
553
561
|
|
|
554
562
|
// src/constant/util/util.ts
|
|
555
563
|
var NOOP = () => {
|
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,
|
|
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 F;function m(){F.abort(),document.hidden||Q()}u||document.addEventListener("visibilitychange",m);let A=$e,X=0;function G(){document.removeEventListener("visibilitychange",m),window.clearTimeout(X),F.abort()}t?.addEventListener("abort",()=>{G(),f()});const $t=c??window.fetch,Lt=r??Le;async function Q(){var Z;F=new AbortController;try{const U=await $t(n,Object.assign(Object.assign({},d),{headers:b,signal:F.signal}));await Lt(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(!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 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 R{}l("CoreConst",R),R.DEFAULT_MODEL_SERVICE_TAG="default",R.TOKEN="ibzuaa-token",R.TOKEN_EXPIRES="ibzuaa-token-expires";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 y extends Error{constructor(e){super(e),this.message=e,this.name="Runtime Error"}}l("RuntimeError",y);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(R.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,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 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 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=>ve(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 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=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?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=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)};(()=>{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 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",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}=v(_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}=v(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 v(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 y(`${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:Rt,calcMimeByFileName:Re,clone:xt,colorBlend:Ft,compareArr:st,debounce:qe,debounceAndAsyncMerge:Ze,debounceAndMerge:Qe,downloadFileFromBlob:vt,eventPath:V,fetchEventSource:pe,fileListToArr:Oe,findRecursiveChild:Nt,getToken:H,install:kt,isElementSame:Ge,isEventInside:ve,isImage:At,isOverlap:Xe,isSvg:it,listenJSEvent:P,mergeDefaultInLeft:tt,mergeInLeft:et,onClickOutside:yt,plus:ot,recursiveIterate:J,selectFile:Te,setRemoteStyle:Tt,throttle:ze,toDisposable:Ee,toNumberOrNil:nt,uploadFile:Dt});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 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}}}});
|
|
@@ -28,5 +28,13 @@ export declare class CoreConst {
|
|
|
28
28
|
* @memberof CoreConst
|
|
29
29
|
*/
|
|
30
30
|
static readonly TOKEN_EXPIRES = "ibzuaa-token-expires";
|
|
31
|
+
/**
|
|
32
|
+
* 认证信息是走记住我模式的 cookie 标识
|
|
33
|
+
*
|
|
34
|
+
* @author chitanda
|
|
35
|
+
* @date 2023-12-13 15:12:28
|
|
36
|
+
* @static
|
|
37
|
+
*/
|
|
38
|
+
static readonly TOKEN_REMEMBER = "ibizuaa-token-remember";
|
|
31
39
|
}
|
|
32
40
|
//# sourceMappingURL=core.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/constant/core/core.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,SAAS;IACpB;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,yBAAyB,aAAa;IAEtD;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,KAAK,kBAAkB;IAEvC;;;;;;;OAOG;IACH,MAAM,CAAC,QAAQ,CAAC,aAAa,0BAA0B;
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/constant/core/core.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,SAAS;IACpB;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,yBAAyB,aAAa;IAEtD;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,KAAK,kBAAkB;IAEvC;;;;;;;OAOG;IACH,MAAM,CAAC,QAAQ,CAAC,aAAa,0BAA0B;IAEvD;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,cAAc,4BAA4B;CAC3D"}
|
|
@@ -29,3 +29,11 @@ CoreConst.TOKEN = 'ibzuaa-token';
|
|
|
29
29
|
* @memberof CoreConst
|
|
30
30
|
*/
|
|
31
31
|
CoreConst.TOKEN_EXPIRES = 'ibzuaa-token-expires';
|
|
32
|
+
/**
|
|
33
|
+
* 认证信息是走记住我模式的 cookie 标识
|
|
34
|
+
*
|
|
35
|
+
* @author chitanda
|
|
36
|
+
* @date 2023-12-13 15:12:28
|
|
37
|
+
* @static
|
|
38
|
+
*/
|
|
39
|
+
CoreConst.TOKEN_REMEMBER = 'ibizuaa-token-remember';
|
package/out/context/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @export
|
|
7
7
|
* @class IBizContext
|
|
8
8
|
*/
|
|
9
|
-
export declare class IBizContext implements
|
|
9
|
+
export declare class IBizContext implements IIBizContext {
|
|
10
10
|
[key: string | symbol]: any;
|
|
11
11
|
/**
|
|
12
12
|
* 当前所归属的应用
|
|
@@ -16,6 +16,14 @@ export declare class IBizContext implements IContext {
|
|
|
16
16
|
* @type {string}
|
|
17
17
|
*/
|
|
18
18
|
srfappid: string;
|
|
19
|
+
/**
|
|
20
|
+
* 界面域标识,每个独立路由导航的视图生成
|
|
21
|
+
*
|
|
22
|
+
* @author chitanda
|
|
23
|
+
* @date 2023-12-22 10:12:06
|
|
24
|
+
* @type {string}
|
|
25
|
+
*/
|
|
26
|
+
srfsessionid: string;
|
|
19
27
|
/**
|
|
20
28
|
* clone 后引用的上下文实例,需要在实例销毁时,同时销毁
|
|
21
29
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,qBAAa,WAAY,YAAW,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context/index.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,qBAAa,WAAY,YAAW,YAAY;IAE9C,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;IAE5B;;;;;;OAMG;IACK,QAAQ,EAAE,MAAM,CAAC;IAEzB;;;;;;OAMG;IACK,YAAY,EAAE,MAAM,CAAC;IAE7B;;;;;;;OAOG;IACH,UAAkB,mBAAmB,EAAE,WAAW,EAAE,CAAC;IAErD;;;;;;;OAOG;IACH,UAAkB,QAAQ,EAAE,KAAK,CAAC;IAElC;;;;;;OAMG;IACK,OAAO,CAAC,EAAE,QAAQ,CAAC;IAE3B;;;;;;;OAOG;IAEH,OAAO;IAcP,OAAO,CAAC,cAAc;IA6CtB;;;;;;OAMG;IACH,aAAa,IAAI,KAAK;IAgBtB;;;;;OAKG;IACH,OAAO,IAAI,IAAI;IAQf;;;;;;OAMG;IACH,KAAK,IAAI,WAAW;IASpB;;;;;;;OAOG;IAEH,KAAK,CAAC,OAAO,GAAE,KAAU,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,IAAI;IA0BnD;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,WAAW;CAG/D"}
|
package/out/types.d.ts
CHANGED
|
@@ -14,13 +14,13 @@ declare global {
|
|
|
14
14
|
interface IContext {
|
|
15
15
|
[key: string | symbol]: any;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* 界面域标识,每个独立路由导航的视图生成
|
|
18
18
|
*
|
|
19
19
|
* @author chitanda
|
|
20
20
|
* @date 2022-07-22 15:07:23
|
|
21
21
|
* @type {string}
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
srfsessionid: string;
|
|
24
24
|
/**
|
|
25
25
|
* 应用标识
|
|
26
26
|
*
|
|
@@ -29,6 +29,8 @@ declare global {
|
|
|
29
29
|
* @type {string}
|
|
30
30
|
*/
|
|
31
31
|
srfappid: string;
|
|
32
|
+
}
|
|
33
|
+
interface IIBizContext extends IContext {
|
|
32
34
|
/**
|
|
33
35
|
* 返回自身的上下文,独有的和与父有差异的
|
|
34
36
|
*
|
package/out/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,CAAC,MAAM,CAAC;IACb,MAAM,IAAI,EAAE,OAAO,CAAC;IAEpB,UAAU,MAAM;QACd,IAAI,EAAE,OAAO,CAAC;KACf;IAED;;;;;;OAMG;IACH,UAAU,QAAQ;QAChB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;QAE5B;;;;;;WAMG;QACH,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,CAAC,MAAM,CAAC;IACb,MAAM,IAAI,EAAE,OAAO,CAAC;IAEpB,UAAU,MAAM;QACd,IAAI,EAAE,OAAO,CAAC;KACf;IAED;;;;;;OAMG;IACH,UAAU,QAAQ;QAChB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;QAE5B;;;;;;WAMG;QACH,YAAY,EAAE,MAAM,CAAC;QAErB;;;;;;WAMG;QACH,QAAQ,EAAE,MAAM,CAAC;KAClB;IAED,UAAU,YAAa,SAAQ,QAAQ;QACrC;;;;;;WAMG;QACH,aAAa,IAAI,KAAK,CAAC;QAEvB;;;;;WAKG;QACH,OAAO,IAAI,IAAI,CAAC;QAEhB;;;;;;WAMG;QACH,KAAK,IAAI,QAAQ,CAAC;QAElB;;;;;;;WAOG;QACH,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;KACjD;IAED;;;;;;OAMG;IACH,UAAU,OAAO;QACf,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;KAC7B;IAED;;;;;;OAMG;IACH,UAAU,KAAK;QACb,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;KAC7B;IAED;;;;;;OAMG;IACH,UAAU,OAAO;QACf,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;KAC7B;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ibiz-template/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.17-dev.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": "b0dfe9a357b41c7a97b640704a460cc485315ed9"
|
|
54
54
|
}
|
|
@@ -30,4 +30,13 @@ export class CoreConst {
|
|
|
30
30
|
* @memberof CoreConst
|
|
31
31
|
*/
|
|
32
32
|
static readonly TOKEN_EXPIRES = 'ibzuaa-token-expires';
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 认证信息是走记住我模式的 cookie 标识
|
|
36
|
+
*
|
|
37
|
+
* @author chitanda
|
|
38
|
+
* @date 2023-12-13 15:12:28
|
|
39
|
+
* @static
|
|
40
|
+
*/
|
|
41
|
+
static readonly TOKEN_REMEMBER = 'ibizuaa-token-remember';
|
|
33
42
|
}
|
package/src/context/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { clone } from 'ramda';
|
|
|
8
8
|
* @export
|
|
9
9
|
* @class IBizContext
|
|
10
10
|
*/
|
|
11
|
-
export class IBizContext implements
|
|
11
|
+
export class IBizContext implements IIBizContext {
|
|
12
12
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
13
|
[key: string | symbol]: any;
|
|
14
14
|
|
|
@@ -21,6 +21,15 @@ export class IBizContext implements IContext {
|
|
|
21
21
|
*/
|
|
22
22
|
declare srfappid: string;
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* 界面域标识,每个独立路由导航的视图生成
|
|
26
|
+
*
|
|
27
|
+
* @author chitanda
|
|
28
|
+
* @date 2023-12-22 10:12:06
|
|
29
|
+
* @type {string}
|
|
30
|
+
*/
|
|
31
|
+
declare srfsessionid: string;
|
|
32
|
+
|
|
24
33
|
/**
|
|
25
34
|
* clone 后引用的上下文实例,需要在实例销毁时,同时销毁
|
|
26
35
|
*
|
package/src/types.ts
CHANGED
|
@@ -19,13 +19,13 @@ declare global {
|
|
|
19
19
|
[key: string | symbol]: any;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* 界面域标识,每个独立路由导航的视图生成
|
|
23
23
|
*
|
|
24
24
|
* @author chitanda
|
|
25
25
|
* @date 2022-07-22 15:07:23
|
|
26
26
|
* @type {string}
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
srfsessionid: string;
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* 应用标识
|
|
@@ -35,7 +35,9 @@ declare global {
|
|
|
35
35
|
* @type {string}
|
|
36
36
|
*/
|
|
37
37
|
srfappid: string;
|
|
38
|
+
}
|
|
38
39
|
|
|
40
|
+
interface IIBizContext extends IContext {
|
|
39
41
|
/**
|
|
40
42
|
* 返回自身的上下文,独有的和与父有差异的
|
|
41
43
|
*
|