@ibiz-template/core 0.5.0-beta.2 → 0.5.0-beta.4

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 CHANGED
@@ -1106,6 +1106,9 @@ function updateKeyDefine(target, keys) {
1106
1106
  }
1107
1107
  });
1108
1108
  }
1109
+ function isBase64Image(str) {
1110
+ return /^data:image\/[a-zA-Z+]+;base64,([/+=\w\s]+|[^,]+)$/.test(str);
1111
+ }
1109
1112
 
1110
1113
  // src/utils/interceptor/interceptor.ts
1111
1114
  var Interceptor = class {
@@ -2279,6 +2282,152 @@ function isEventInside(event, el) {
2279
2282
  return el && (event.target === el || eventPath(event).includes(el));
2280
2283
  }
2281
2284
 
2285
+ // src/utils/history-list/history-item.ts
2286
+ import { clone as clone2 } from "ramda";
2287
+ var _HistoryItem = class _HistoryItem {
2288
+ constructor(data = {}) {
2289
+ this.data = data;
2290
+ this._prev = _HistoryItem.Undefined;
2291
+ this._next = _HistoryItem.Undefined;
2292
+ }
2293
+ /**
2294
+ * 克隆整个历史链
2295
+ *
2296
+ * @author chitanda
2297
+ * @date 2023-12-28 23:12:56
2298
+ * @return {*} {HistoryItem<E>}
2299
+ */
2300
+ clone() {
2301
+ const history = new _HistoryItem(clone2(this.data));
2302
+ if (history._prev && history._prev !== _HistoryItem.Undefined) {
2303
+ history._prev = clone2(this._prev);
2304
+ }
2305
+ if (history._next && history._next !== _HistoryItem.Undefined) {
2306
+ history._next = clone2(this._next);
2307
+ }
2308
+ return history;
2309
+ }
2310
+ };
2311
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2312
+ _HistoryItem.Undefined = new _HistoryItem(void 0);
2313
+ var HistoryItem = _HistoryItem;
2314
+
2315
+ // src/utils/history-list/history-list.ts
2316
+ import { clone as clone3 } from "ramda";
2317
+ var HistoryList = class _HistoryList {
2318
+ /**
2319
+ * 当前的数据
2320
+ *
2321
+ * @author chitanda
2322
+ * @date 2023-12-28 18:12:27
2323
+ * @type {E}
2324
+ */
2325
+ get data() {
2326
+ return this._cur.data;
2327
+ }
2328
+ constructor(data) {
2329
+ this._cur = new HistoryItem(data);
2330
+ }
2331
+ /**
2332
+ * 先创建一次历史记录,再赋值
2333
+ *
2334
+ * @author chitanda
2335
+ * @date 2023-12-28 17:12:05
2336
+ * @param {IData} data
2337
+ */
2338
+ assign(data) {
2339
+ if (data) {
2340
+ this.save();
2341
+ Object.assign(this._cur.data, data);
2342
+ }
2343
+ }
2344
+ /**
2345
+ * 创建一次历史记录
2346
+ *
2347
+ * @author chitanda
2348
+ * @date 2023-12-28 20:12:13
2349
+ */
2350
+ save() {
2351
+ const oldCur = this._cur;
2352
+ const data = clone3(oldCur.data);
2353
+ const history = new HistoryItem(data);
2354
+ history._prev = oldCur;
2355
+ oldCur._next._prev = HistoryItem.Undefined;
2356
+ this._clear(oldCur._next);
2357
+ oldCur._next = history;
2358
+ this._cur = history;
2359
+ }
2360
+ /**
2361
+ * 上一步
2362
+ *
2363
+ * @author chitanda
2364
+ * @date 2023-12-28 16:12:28
2365
+ * @return {*} {boolean}
2366
+ */
2367
+ prev() {
2368
+ if (this._cur._prev && this._cur._prev !== HistoryItem.Undefined) {
2369
+ this._cur = this._cur._prev;
2370
+ return true;
2371
+ }
2372
+ return false;
2373
+ }
2374
+ /**
2375
+ * 下一步
2376
+ *
2377
+ * @author chitanda
2378
+ * @date 2023-12-28 16:12:20
2379
+ * @return {*} {boolean}
2380
+ */
2381
+ next() {
2382
+ if (this._cur._next && this._cur._next !== HistoryItem.Undefined) {
2383
+ this._cur = this._cur._next;
2384
+ return true;
2385
+ }
2386
+ return false;
2387
+ }
2388
+ /**
2389
+ * 清空引用,避免内存泄漏
2390
+ *
2391
+ * @author chitanda
2392
+ * @date 2023-12-28 22:12:43
2393
+ * @protected
2394
+ * @param {HistoryItem<E>} h
2395
+ */
2396
+ _clear(h) {
2397
+ if (h._prev && h._prev !== HistoryItem.Undefined) {
2398
+ this._clear(h._prev);
2399
+ h._prev = HistoryItem.Undefined;
2400
+ }
2401
+ if (h._next && h._next !== HistoryItem.Undefined) {
2402
+ this._clear(h._next);
2403
+ h._next = HistoryItem.Undefined;
2404
+ }
2405
+ h.data = {};
2406
+ }
2407
+ /**
2408
+ * 禁止克隆,直接返回当前实例
2409
+ *
2410
+ * @author chitanda
2411
+ * @date 2023-12-28 22:12:49
2412
+ * @private
2413
+ * @return {*} {HistoryList<E>}
2414
+ */
2415
+ clone() {
2416
+ const history = new _HistoryList({});
2417
+ history._cur = clone3(this._cur);
2418
+ return this;
2419
+ }
2420
+ /**
2421
+ * 销毁
2422
+ *
2423
+ * @author chitanda
2424
+ * @date 2023-12-28 21:12:34
2425
+ */
2426
+ destroy() {
2427
+ this._clear(this._cur);
2428
+ }
2429
+ };
2430
+
2282
2431
  // src/utils/click-outside/click-outside.ts
2283
2432
  var defaultWindow = typeof window !== "undefined" ? window : void 0;
2284
2433
  function onClickOutside(target, handler, options = {}) {
@@ -2878,7 +3027,7 @@ function customizeFn(value) {
2878
3027
  var DefaultCloneOpts = {
2879
3028
  deep: true
2880
3029
  };
2881
- function clone2(value, opts) {
3030
+ function clone4(value, opts) {
2882
3031
  const options = mergeDeepRight3(DefaultCloneOpts, opts || {});
2883
3032
  if (options.deep) {
2884
3033
  return cloneDeepWith(value, customizeFn);
@@ -2984,6 +3133,8 @@ export {
2984
3133
  DataTypes,
2985
3134
  Environment,
2986
3135
  EventStreamContentType,
3136
+ HistoryItem,
3137
+ HistoryList,
2987
3138
  HttpError,
2988
3139
  HttpResponse,
2989
3140
  HttpStatusMessageConst,
@@ -3006,7 +3157,7 @@ export {
3006
3157
  UrlHelper,
3007
3158
  awaitTimeout,
3008
3159
  calcMimeByFileName,
3009
- clone2 as clone,
3160
+ clone4 as clone,
3010
3161
  colorBlend,
3011
3162
  commands,
3012
3163
  compareArr,
@@ -3020,6 +3171,7 @@ export {
3020
3171
  findRecursiveChild,
3021
3172
  getToken,
3022
3173
  install,
3174
+ isBase64Image,
3023
3175
  isElementSame,
3024
3176
  isEventInside,
3025
3177
  isImage,
@@ -1,2 +1 @@
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,_,y,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,y=h.notNilEmpty},function(h){B=h.default},function(h){le=h.default},function(h){he=h.default},function(h){L=h.default}],execute:function(){l({awaitTimeout:Ot,calcMimeByFileName:Re,clone:Ut,colorBlend:vt,compareArr:st,debounce:qe,debounceAndAsyncMerge:Ze,debounceAndMerge:Qe,downloadFileFromBlob:Dt,eventPath:V,fetchEventSource:pe,fileListToArr:Oe,findRecursiveChild:Nt,getToken:H,install:$t,isElementSame:Ge,isEventInside:Ae,isImage:At,isOverlap:Xe,isSvg:it,listenJSEvent:N,mergeDefaultInLeft:tt,mergeInLeft:et,onClickOutside:Ft,plus:ot,recursiveIterate:J,selectFile:Te,setRemoteStyle:_t,throttle:ze,toDisposable:Ee,toNumberOrNil:nt,updateKeyDefine:at,uploadFile:Rt});async function h(n,e){const t=n.getReader();let s;for(;!(s=await t.read()).done;)e(s.value)}function Ue(n){let e,t,s,r=!1;return function(a){e===void 0?(e=a,t=0,s=-1):e=Se(e,a);const o=e.length;let u=0;for(;t<o;){r&&(e[t]===10&&(u=++t),r=!1);let c=-1;for(;t<o&&c===-1;++t)switch(e[t]){case 58:s===-1&&(s=t-u);break;case 13:r=!0;case 10:c=t;break}if(c===-1)break;n(e.subarray(u,c),s),u=t,s=-1}u===o?e=void 0:u!==0&&(e=e.subarray(u),t-=u)}}function Me(n,e,t){let s=de();const r=new TextDecoder;return function(a,o){if(a.length===0)t?.(s),s=de();else if(o>0){const u=r.decode(a.subarray(0,o)),c=o+(a[o+1]===32?2:1),d=r.decode(a.subarray(c));switch(u){case"data":s.data=s.data?s.data+`
2
- `+d:d;break;case"event":s.event=d;break;case"id":n(s.id=d);break;case"retry":const f=parseInt(d,10);isNaN(f)||e(s.retry=f);break}}}}function Se(n,e){const t=new Uint8Array(n.length+e.length);return t.set(n),t.set(e,n.length),t}function de(){return{data:"",event:"",id:"",retry:void 0}}var ke=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(n,s[r])&&(t[s[r]]=n[s[r]]);return t};const j=l("EventStreamContentType","text/event-stream"),$e=1e3,fe="last-event-id";function pe(n,e){var{signal:t,headers:s,onopen:r,onmessage:i,onclose:a,onerror:o,openWhenHidden:u,fetch:c}=e,d=ke(e,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((f,x)=>{const b=Object.assign({},s);b.accept||(b.accept=j);let v;function m(){v.abort(),document.hidden||Q()}u||document.addEventListener("visibilitychange",m);let A=$e,X=0;function G(){document.removeEventListener("visibilitychange",m),window.clearTimeout(X),v.abort()}t?.addEventListener("abort",()=>{G(),f()});const Lt=c??window.fetch,jt=r??Le;async function Q(){var Z;v=new AbortController;try{const U=await Lt(n,Object.assign(Object.assign({},d),{headers:b,signal:v.signal}));await jt(U),await h(U.body,Ue(Me(E=>{E?b[fe]=E:delete b[fe]},E=>{A=E},i))),a?.(),G(),f()}catch(U){if(!v.signal.aborted)try{const E=(Z=o?.(U))!==null&&Z!==void 0?Z:A;window.clearTimeout(X),X=window.setTimeout(Q,E)}catch(E){G(),x(E)}}}Q()})}function Le(n){const e=n.headers.get("content-type");if(!e?.startsWith(j))throw new Error(`Expected content-type to be ${j}, Actual: ${e}`)}const q=class ee{constructor(e){this.element=e,this.next=ee.Undefined,this.prev=ee.Undefined}};q.Undefined=new q(void 0);let p=q;class me{constructor(){this._first=p.Undefined,this._last=p.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===p.Undefined}clear(){let e=this._first;for(;e!==p.Undefined;){const{next:t}=e;e.prev=p.Undefined,e.next=p.Undefined,e=t}this._first=p.Undefined,this._last=p.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const s=new p(e);if(this._first===p.Undefined)this._first=s,this._last=s;else if(t){const i=this._last;this._last=s,s.prev=i,i.next=s}else{const i=this._first;this._first=s,s.next=i,i.prev=s}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(s))}}shift(){if(this._first===p.Undefined)return;const e=this._first.element;return this._remove(this._first),e}pop(){if(this._last===p.Undefined)return;const e=this._last.element;return this._remove(this._last),e}_remove(e){if(e.prev!==p.Undefined&&e.next!==p.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===p.Undefined&&e.next===p.Undefined?(this._first=p.Undefined,this._last=p.Undefined):e.next===p.Undefined?(this._last=this._last.prev,this._last.next=p.Undefined):e.prev===p.Undefined&&(this._first=this._first.next,this._first.prev=p.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==p.Undefined;)yield e.element,e=e.next}}l("LinkedList",me);function je(n){const e=this;let t=!1,s;return function(){return t||(t=!0,s=n.apply(e,arguments)),s}}function Ee(n){return{dispose:je(()=>{n()})}}function qe(n,e,t){let s;return function(...r){if(s&&clearTimeout(s),t){const i=!s;s=setTimeout(()=>{s=null},e),i&&n.apply(this,r)}else s=setTimeout(()=>{n.apply(this,r)},e)}}function ze(n,e){let t=null;return function(...s){t||(t=setTimeout(()=>{n.apply(this,s),t=null},e))}}class ge{constructor(){this.commands=new Map}registerCommand(e,t,s){if(!e)throw new Error("invalid command");if(typeof e=="string"){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t,opts:s})}const{id:r}=e;let i=this.commands.get(r);i||(i=new me,this.commands.set(r,i));const a=i.unshift(e);return Ee(()=>{a(),this.commands.get(r)?.isEmpty()&&this.commands.delete(r)})}hasCommand(e){return this.commands.has(e)}getCommand(e){const t=this.commands.get(e);if(!(!t||t.isEmpty()))return t[Symbol.iterator]().next().value}getCommands(){const e=new Map,t=this.commands.keys();for(const s of t){const r=this.getCommand(s);r&&e.set(s,r)}return e}getCommandOpt(e){return this.getCommand(e)?.opts}}l("CommandsRegistry",ge);class z{constructor(){this.commandRegister=new ge}register(e,t,s){return this.commandRegister.registerCommand(e,t,s)}async execute(e,...t){const s=this.commandRegister.getCommand(e);if(s)return s.handler(...t);throw new Error(`\u672A\u6CE8\u518C\u6307\u4EE4: ${e}\uFF0C\u8BF7\u5148\u6CE8\u518C\u6307\u4EE4`)}hasCommand(e,t){const s=!!this.commandRegister.hasCommand(e);if(t===!0&&s===!0)throw new Error(`\u672A\u6CE8\u518C\u6307\u4EE4: ${e}\uFF0C\u8BF7\u5148\u6CE8\u518C\u6307\u4EE4`);return s}getCommandOpts(e){return this.commandRegister.getCommandOpt(e)}}l("CommandController",z);const qt=l("commands",new z);class C{}l("CoreConst",C),C.DEFAULT_MODEL_SERVICE_TAG="default",C.TOKEN="ibzuaa-token",C.TOKEN_EXPIRES="ibzuaa-token-expires",C.TOKEN_REMEMBER="ibizuaa-token-remember";const He=l("NOOP",()=>{}),zt=l("HttpStatusMessageConst",{200:"\u670D\u52A1\u5668\u6210\u529F\u8FD4\u56DE\u8BF7\u6C42\u7684\u6570\u636E\u3002",201:"\u65B0\u5EFA\u6216\u4FEE\u6539\u6570\u636E\u6210\u529F\u3002",202:"\u4E00\u4E2A\u8BF7\u6C42\u5DF2\u7ECF\u8FDB\u5165\u540E\u53F0\u6392\u961F\uFF08\u5F02\u6B65\u4EFB\u52A1\uFF09\u3002",204:"\u5220\u9664\u6570\u636E\u6210\u529F\u3002",400:"\u53D1\u51FA\u7684\u8BF7\u6C42\u6709\u9519\u8BEF\uFF0C\u670D\u52A1\u5668\u6CA1\u6709\u8FDB\u884C\u65B0\u5EFA\u6216\u4FEE\u6539\u6570\u636E\u7684\u64CD\u4F5C\u3002",401:"\u7528\u6237\u6CA1\u6709\u6743\u9650\uFF08\u4EE4\u724C\u3001\u7528\u6237\u540D\u3001\u5BC6\u7801\u9519\u8BEF\uFF09\u3002",403:"\u7528\u6237\u5F97\u5230\u6388\u6743\uFF0C\u4F46\u662F\u8BBF\u95EE\u662F\u88AB\u7981\u6B62\u7684\u3002",404:"\u53D1\u51FA\u7684\u8BF7\u6C42\u9488\u5BF9\u7684\u662F\u4E0D\u5B58\u5728\u7684\u8BB0\u5F55\uFF0C\u670D\u52A1\u5668\u6CA1\u6709\u8FDB\u884C\u64CD\u4F5C\u3002",406:"\u8BF7\u6C42\u7684\u683C\u5F0F\u4E0D\u53EF\u5F97\u3002",410:"\u8BF7\u6C42\u7684\u8D44\u6E90\u88AB\u6C38\u4E45\u5220\u9664\uFF0C\u4E14\u4E0D\u4F1A\u518D\u5F97\u5230\u7684\u3002",422:"\u5F53\u521B\u5EFA\u4E00\u4E2A\u5BF9\u8C61\u65F6\uFF0C\u53D1\u751F\u4E00\u4E2A\u9A8C\u8BC1\u9519\u8BEF\u3002",500:"\u670D\u52A1\u5668\u53D1\u751F\u9519\u8BEF\uFF0C\u8BF7\u68C0\u67E5\u670D\u52A1\u5668\u3002",502:"\u7F51\u5173\u9519\u8BEF\u3002",503:"\u670D\u52A1\u4E0D\u53EF\u7528\uFF0C\u670D\u52A1\u5668\u6682\u65F6\u8FC7\u8F7D\u6216\u7EF4\u62A4\u3002",504:"\u7F51\u5173\u8D85\u65F6\u3002"});var we=l("LoginMode",(n=>(n.DEFAULT="DEFAULT",n.CUSTOM="CUSTOM",n.CAS="CAS",n))(we||{})),be=l("MenuPermissionMode",(n=>(n.MIXIN="MIXIN",n.RESOURCE="RESOURCE",n.RT="RT",n))(be||{}));class I{constructor(e={},t){Object.defineProperty(this,"_associationContext",{enumerable:!1,value:[]}),t&&this.initWithParent(t),Object.assign(this,e)}initWithParent(e){const t=this;Object.defineProperty(this,"_parent",{enumerable:!1,writable:!0,value:e}),Object.defineProperty(this,"_context",{enumerable:!1,writable:!0,value:{}});const s={};Object.keys(e).forEach(i=>{Object.prototype.hasOwnProperty.call(this,i)||(s[i]={enumerable:!0,set(a){a==null?t._context[i]=null:t._context[i]=a},get(){return t._context[i]!==void 0?t._context[i]:t._parent[i]}})}),Object.defineProperties(this,s)}getOwnContext(){const e={};return Object.keys(this).forEach(t=>{(!this._parent||!Object.prototype.hasOwnProperty.call(this._parent,t)||Object.prototype.hasOwnProperty.call(this._context,t))&&(e[t]=this[t])}),e}destroy(){this._parent=void 0,this._context={},this._associationContext.forEach(e=>{e.destroy()})}clone(){const e=new I(te(this.getOwnContext()),this._parent);return this._associationContext.push(e),e}reset(e={},t){this._associationContext.forEach(s=>{s.destroy()}),this._parent&&(this._parent={},this._context={}),Object.keys(this).forEach(s=>{try{delete this[s]}catch{}}),t&&this.initWithParent(t),Object.assign(this,e)}static create(e,t){return new I(e,t)}}l("IBizContext",I);class We{constructor(e,t){return Object.defineProperty(this,"_parent",{enumerable:!1,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_params",{enumerable:!1,configurable:!0,writable:!0,value:e||{}}),this.createProxy()}createProxy(){function e(t,s){s.forEach(r=>{Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,configurable:!0,writable:!0,value:void 0})})}return new Proxy(this,{set(t,s,r){return["_params","_parent"].includes(s)?t[s]=r:t._params[s]=r,!0},get(t,s,r){if(t[s]!==void 0)return t[s];if(t._params[s]!==void 0)return t._params[s];if(t._parent&&t._parent[s]!==void 0)return t._parent[s]},ownKeys(t){const s=[...new Set([...Object.keys(t._params),...Object.keys(t._parent||{})])];return e(t,s),s}})}reset(e,t){this._params=e||{},this._parent=t}destroy(){this._params={},this._parent=void 0}}l("IBizParams",We);const Ve=l("Environment",{dev:!1,hub:!0,enableMqtt:!1,mqttUrl:"/portal/mqtt/mqtt",isEnableMultiLan:!1,anonymousUser:"",anonymousPwd:"",logLevel:"ERROR",baseUrl:"/api",appId:"",pluginBaseUrl:"http://172.16.240.221",isLocalModel:!1,remoteModelUrl:"/remotemodel",assetsUrl:"./assets",dcSystem:"",downloadFileUrl:"/ibizutil/download",uploadFileUrl:"/ibizutil/upload",casLoginUrl:"",loginMode:we.DEFAULT,menuPermissionMode:be.MIXIN,enablePermission:!0,routePlaceholder:"-",enableWfAllHistory:!1,isMob:!1,isSaaSMode:!0,AppTitle:"\u5E94\u7528",favicon:"./favicon.ico"});class g extends Error{constructor(e){super("HttpError"),this.name="HttpError";const t=e.response;this.response=e.response,t?(t.data?this.message=t.data.message:this.message=t.statusText,this.message||(this.message="\u7F51\u7EDC\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5!"),this.status=t.status):(this.message=e.message||"",this.status=500)}}l("HttpError",g);class Je extends Error{constructor(e,t){super(`\u300C${e.id}\u300D\u6A21\u578B${t?`\uFF1A ${t}`:""}`),this.model=e,this.name="\u672A\u652F\u6301\u7684\u6A21\u578B"}}l("ModelError",Je);class F extends Error{constructor(e){super(e),this.message=e,this.name="Runtime Error"}}l("RuntimeError",F);class Ke extends Error{constructor(e,t){super(`\u300C${e.id}\u300D\u6A21\u578B${t?`\uFF1A ${t}`:""}`),this.model=e,this.name="\u6A21\u578B\u914D\u7F6E\u7F3A\u5931"}}l("RuntimeModelError",Ke);class Ye extends Error{constructor(e,t){super(e),this.message=e,this.duration=t,this.name="notice Error"}}l("NoticeError",Ye);function H(){return ue(C.TOKEN)}function Xe(n,e){return Array.from(new Set([...n,...e])).length!==n.length+e.length}function Ge(n,e,t){if(n.length!==e.length)return!1;const s=t?[...n.map(i=>i[t]),...e.map(i=>i[t])]:[...n,...e];return Array.from(new Set(s)).length===n.length}function Qe(n,e,t){let s;const r=k((...i)=>(s=void 0,n(...i)),t);return(...i)=>{let a=i;return s&&(a=e(s,a)),s=a,r(...a)}}function Ze(n,e,t){let s,r=[];const i=k(async(...o)=>{s=void 0;try{const u=await n(...o);return r.forEach(c=>{c.resolve(u)}),r=[],u}catch(u){r.forEach(c=>{c.reject(u)}),r=[]}},t);return async(...o)=>{let u=o;return s&&(u=e(s,u)),s=u,i(...u),new Promise((c,d)=>{r.push({resolve:c,reject:d})})}}function et(n,e){Object.keys(e).forEach(t=>{M(e[t])&&(n[t]=e[t])})}function tt(n,e){Object.keys(e).forEach(t=>{M(e[t])&&S(n[t])&&(n[t]=e[t])})}function st(n,e,t){const s=new Set([...n,...e]),r=[],i=[],a=[];if(t){const o=n.map(c=>c[t]),u=e.map(c=>c[t]);s.forEach(c=>{if(!o.includes(c[t])){i.push(c);return}if(!u.includes(c[t])){r.push(c);return}a.push(c)})}else s.forEach(o=>{if(!n.includes(o)){i.push(o);return}if(!e.includes(o)){r.push(o);return}a.push(o)});return{more:r,less:i,same:a}}function nt(n){if(S(n))return;const e=Number(n);if(!Number.isNaN(e))return e}const rt=/<svg\b[^>]*>[\s\S]*?<\/svg>/;function it(n){return rt.test(n)}function ot(n,e){let t,s;try{t=n.toString().split(".")[1].length}catch{t=0}try{s=e.toString().split(".")[1].length}catch{s=0}const r=10**Math.max(t,s);return(n*r+e*r)/r}function at(n,e){e.forEach(t=>{Object.prototype.hasOwnProperty.call(n,t)||Object.defineProperty(n,t,{enumerable:!0,configurable:!0,writable:!0,value:void 0})})}class 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 Ce 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",Ce);class P{constructor(e){this.parent=e,this.evt=new ce(1e3)}next(e){this.evt.emit("all",e),this.parent&&this.nextParent(e)}nextParent(e){this.parent&&(this.parent.evt.emit("all",e),this.parent.nextParent(e))}on(e){this.evt.on("all",e)}off(e){this.evt.off("all",e)}}class ut extends P{}class O extends P{sendCommand(e,t){const s={messageid:_(),messagename:"command",type:"COMMAND",subtype:t,data:e};this.next(s)}}class ct extends O{send(e){this.sendCommand(e,"OBJECTCREATED")}}class lt extends O{send(e){this.sendCommand(e,"OBJECTUPDATED")}}class ht extends O{send(e){this.sendCommand(e,"OBJECTREMOVED")}}class dt extends O{}class ft extends O{send(e){this.sendCommand(e,"ASYNCACTION")}}class pt extends P{constructor(){super(...arguments),this.change=new dt,this.create=new ct(this),this.update=new lt(this),this.remove=new ht(this),this.asyncAction=new ft(this)}next(e){switch(e.subtype){case"OBJECTCREATED":this.create.next(e),this.change.next(e);break;case"OBJECTUPDATED":this.update.next(e),this.change.next(e);break;case"OBJECTREMOVED":this.remove.next(e),this.change.next(e);break;default:super.next(e)}}nextParent(e){switch(e.subtype){case"OBJECTCREATED":this.change.next(e);break;case"OBJECTUPDATED":this.change.next(e);break;case"OBJECTREMOVED":this.change.next(e);break}super.nextParent(e)}send(e,t){const s={messageid:_(),messagename:"command",type:"COMMAND",subtype:t,data:e};this.next(s)}}class mt extends P{send(e){const t={messageid:_(),messagename:"console",type:"CONSOLE",data:e};this.next(t)}}class Fe{constructor(){this.all=new ut,this.command=new pt(this.all),this.console=new mt(this.all)}next(e){e.type==="COMMAND"?this.command.next(e):e.type==="CONSOLE"?this.console.next(e):this.all.next(e)}on(e){this.all.on(e)}off(e){this.all.off(e)}}l("MessageCenter",Fe);const Et="ibiz",gt="is-";function w(n,e,t,s,r){let i=`${n}-${e}`;return t&&(i+=`-${t}`),s&&(i+=`__${s}`),r&&(i+=`--${r}`),i}class wt{constructor(e,t){this.block=e,this.namespace=t||Et}b(e=""){return w(this.namespace,this.block,e,"","")}e(e){return e?w(this.namespace,this.block,"",e,""):""}m(e){return e?w(this.namespace,this.block,"","",e):""}be(e,t){return e&&t?w(this.namespace,this.block,e,t,""):""}em(e,t){return e&&t?w(this.namespace,this.block,"",e,t):""}bm(e,t){return e&&t?w(this.namespace,this.block,e,"",t):""}bem(e,t,s){return e&&t&&s?w(this.namespace,this.block,e,t,s):""}is(e,t){return e&&t?`${gt}${e}`:""}cssVar(e){const t={};for(const s in e)e[s]&&(t[this.cssVarName(s)]=e[s]);return t}cssVarBlock(e){const t={};for(const s in e)e[s]&&(t[this.cssVarBlockName(s)]=e[s]);return t}cssVarName(e){return`--${this.namespace}-${e}`}cssVarBlockName(e){return`--${this.namespace}-${this.block}-${e}`}}l("Namespace",wt);class bt{constructor(e,t,s){this.local=!0,this.ok=!1,this.headers={},this.config={headers:new B.AxiosHeaders},this.data=e,this.status=t||200,this.statusText=s||"",this.status>=200&&this.status<300&&(this.ok=!0)}}l("HttpResponse",bt);class ve{constructor(e){this.urlReg=/^http[s]?:\/\/[^\s]*/,this.waitRequest=new Map,this.interceptors=new Map,this.instance=B.create(e),this.addInterceptor("Default",new Ce)}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")&&y(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 y(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 y(e)&&(y(t)&&e.match(this.contextReg)?.forEach(i=>{const a=i.slice(10,i.length-1);e=e.replace(`\${context.${a}}`,t[a]||"")}),y(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 yt{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",yt);function V(n){const e=n.composedPath&&n.composedPath()||n.path;if(e!=null)return e;function t(s,r=[]){const i=s.parentNode;return i?t(i,r.concat([i])):r}return[n.target].concat(t(n.target))}function N(n,e,t,s={}){n.addEventListener(e,t,s);let r=()=>{n.removeEventListener(e,t,s),r=He};return()=>{r()}}function Ae(n,e){return e&&(n.target===e||V(n).includes(e))}const Ct=typeof window<"u"?window:void 0;function Ft(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(A=>Ae(m,A));let u=!1;const c=()=>{u=!0},d=()=>{u=!1};let f;const x=m=>{u||(s.clearTimeout(f),a&&o(m)&&e(m))},b=[N(s,"click",x,{passive:!0,capture:i}),N(s,"pointerdown",m=>{u||(a=o(m))},{passive:!0}),N(s,"pointerup",m=>{if(!u&&m.button===0){const A=V(m);m.composedPath=()=>A,f=s.setTimeout(()=>x(m),50)}},{passive:!0})].filter(Boolean);return{stop:()=>b.forEach(m=>m()),pause:c,proceed:d}}const T=Math.round;function De(n){const e=n.length,t=[];if(n.slice(0,3).toLowerCase()==="rgb"){const s=n.match(/([\d|.%]{1,3})/g);t[0]=parseInt(s[0],10),t[1]=parseInt(s[1],10),t[2]=parseInt(s[2],10),t[3]=s[3]?s[3].indexOf("%")!==-1?parseInt(s[3],10)/100:parseFloat(s[3]):1}else{let s;e<6?s=parseInt(String(n[1])+n[1]+n[2]+n[2]+n[3]+n[3]+(e>4?String(n[4])+n[4]:""),16):s=parseInt(n.slice(1),16),t[0]=s>>16&255,t[1]=s>>8&255,t[2]=s&255,t[3]=e===9||e===5?T((s>>24&255)/255*1e4)/1e4:1}return t}function vt(n,e,t=.5,s="hex"){n=n.trim(),e=e.trim();const r=De(n),i=De(e),a=[T((1-t)*r[0]+t*i[0]),T((1-t)*r[1]+t*i[1]),T((1-t)*r[2]+t*i[2]),(1-t)*r[3]+t*i[3]];if(s==="hex"){const o=[a[0].toString(16),a[1].toString(16),a[2].toString(16),a[3]===0?"00":T(a[3]*255).toString(16)];return`#${o[0]}${o[1]}${o[2]}${o[3]}`}return`rgb(${a[0]} ${a[1]} ${a[2]} / ${a[3]})`}function Re(n){const e=n.split(".").pop();let t="";switch(e){case".wps":t="application/kswps";break;case".doc":t="application/msword";break;case".docx":t="application/vnd.openxmlformats-officedocument.wordprocessingml.document";break;case".txt":t="text/plain";break;case".zip":t="application/zip";break;case".png":t="image/png";break;case".gif":t="image/gif";break;case".jpeg":t="image/jpeg";break;case".jpg":t="image/jpeg";break;case".rtf":t="application/rtf";break;case".avi":t="video/x-msvideo";break;case".gz":t="application/x-gzip";break;case".tar":t="application/x-tar";break;case".xlsx":t="application/vnd.ms-excel";break;default:t=""}return t}function At(n){const e=n.split(".").pop();return e?[".jpeg","jpg","gif","png","bmp","svg"].includes(e):!1}function Dt(n,e){const t=Re(e),s=new Blob([n],{type:t}),r=URL.createObjectURL(s),i=document.createElement("a");i.href=r,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}function Oe(n){const e=[];for(let t=0;t<n.length;t++)e.push(n[t]);return e}function Te(n){const e=R({multiple:!0,accept:""},n),t=document.createElement("input");t.setAttribute("type","file"),t.setAttribute("multiple",`${e.multiple}`),t.setAttribute("accept",e.accept),t.onchange=s=>{const r=s.target,i=r.files?Oe(r.files):[];i.length!==0&&(e.onSelected(i),r.value="")},document.body.appendChild(t),t.click(),document.body.removeChild(t)}function Rt(n){const e=R({multiple:!0,accept:"",separate:!0,beforeUpload:(o,u)=>!0,finish:o=>{},success:(o,u)=>{},error:(o,u)=>{},progress:o=>{}},n),t=(o,u)=>{u.forEach(c=>{c.percentage=ne(o.progress*100)}),e.progress(re(u))},s=async(o,u)=>{if(e.request&&$(e.request))return e.request(o);const c=new FormData;throw o.forEach(d=>{c.append("file",d)}),new F("\u591A\u5E94\u7528\u6A21\u5F0F\u7B49\u5F85\u91CD\u65B0\u5B9E\u73B0\u8BF7\u6C42")},r=async o=>{const u=o.map(d=>({status:"uploading",name:d.name,uid:se(),percentage:0}));if(!e.beforeUpload(o,u))return u.forEach(d=>{d.status="cancel"}),ibiz.log.debug("\u53D6\u6D88\u4E0A\u4F20",u),u;try{const d=await s(o,f=>{t(f,u)});u.forEach(f=>{f.status="finished"}),e.success(u,d),u.forEach(f=>{f.response=d})}catch(d){u.forEach(f=>{f.status="fail"}),e.error(u,d),u.forEach(f=>{f.error=d}),ibiz.log.error(d),ibiz.log.error(`${o.map(f=>f.name).join(",")}\u4E0A\u4F20\u5931\u8D25`)}return u},i=async o=>{const u=e.separate?o.map(f=>[f]):[o],c=await Promise.allSettled(u.map(async f=>r(f))),d=[];c.forEach(f=>{f.status==="fulfilled"&&d.push(...f.value)}),e.finish(d)};(()=>{Te({accept:e.accept,multiple:e.multiple,onSelected:o=>{i(o)}})})()}async function Ot(n,e,t){if(await new Promise(s=>{setTimeout(()=>{s(!0)},n)}),e)return e(...t||[])}class Tt{constructor(){this.promise=null,this.resolve=null,this.count=0}startPromise(){this.promise=new Promise(e=>{this.resolve=e})}endPromise(){this.resolve&&(this.resolve(),this.resolve=null,this.promise=null)}lock(){this.count+=1,this.promise||this.startPromise()}unlock(){if(this.count<1)throw new F("lock\u548Cunlock\u6B21\u6570\u4E0D\u5339\u914D\uFF01");this.count-=1,this.count===0&&this.endPromise()}async await(){this.promise&&await this.promise}}l("CountLatch",Tt);async function _t(n){try{const e=await ibiz.net.get(n),t=document.createElement("style");t.setAttribute("title","app-style-css"),t.innerText=e.data,document.head.appendChild(t)}catch{ibiz.log.debug("\u52A0\u8F7D\u8FDC\u7A0B\u6837\u5F0F\u8868\u5931\u8D25",n)}}const _e={childrenFields:["children"]},Be=new Error("\u4E2D\u65AD\u64CD\u4F5C");function Bt(n,e){for(const t of e)if(n[t]?.length)return n[t]}function It(n,e,t){const{childrenFields:s}=D(_e,t||{}),r=Bt(n,s);if(r?.length)for(const i of r){if(e(i))throw Be;J(i,e,t)}}function J(n,e,t){try{It(n,e,t)}catch(s){if(s!==Be)throw s}}const Pt={..._e,compareField:"name"};function Nt(n,e,t){const{compareField:s,compareCallback:r}=D(Pt,t||{}),i=r||(o=>o[s]===e);let a;return J(n,o=>{if(i(o,e,s))return a=o,!0},t),a}class Ie{static isNumber(e){return["BIGINT","BINARY","DECIMAL","FLOAT","INT","MONEY","NUMERIC","REAL","SMALLINT","SMALLMONEY","TINYINT","VARBINARY"].includes(this.toString(e))}static isDate(e){return["DATETIME","SMALLDATETIME","DATE","TIME"].includes(this.toString(e))}static toString(e){return this.typeMap[e]}}l("DataTypes",Ie),Ie.typeMap={0:"UNKNOWN",1:"BIGINT",2:"BINARY",3:"BIT",4:"CHAR",5:"DATETIME",6:"DECIMAL",7:"FLOAT",8:"IMAGE",9:"INT",10:"MONEY",11:"NCHAR",12:"NTEXT",13:"NVARCHAR",14:"NUMERIC",15:"REAL",16:"SMALLDATETIME",17:"SMALLINT",18:"SMALLMONEY",19:"SQL_VARIANT",20:"SYSNAME",21:"TEXT",22:"TIMESTAMP",23:"TINYINT",24:"VARBINARY",25:"VARCHAR",26:"UNIQUEIDENTIFIER",27:"DATE",28:"TIME",29:"BIGDECIMAL"};function Pe(n){if(ae(n)&&$(n.clone))return n.clone()}const xt={deep:!0};function Ut(n,e){return D(xt,e||{}).deep?ie(n,Pe):oe(n,Pe)}function Ne(n){return!!n&&!(n&n-1)}function K(n){if(!Ne(n))throw new F(`${n}\u4E0D\u662F2\u7684\u5E42`)}function Mt(n=0,e){return K(e),n|e}function St(n=0,e){return K(e),n&~e}function kt(n=0,e){return K(e),(n&e)!==0}const Ht=l("BitMask",{validate:Ne,setPermission:Mt,removePermission:St,checkPermission:kt}),Y=he.noConflict();L.reg(Y),L.apply(Y);class xe{constructor(){this.env=Ve,this.log=Y,this.net=new ve,this.commands=new z,this.mc=new Fe}}l("IBizSys",xe);function $t(){if(window.ibiz)throw new Error("ibiz \u5DF2\u7ECF\u5B58\u5728, \u65E0\u9700\u91CD\u590D\u5B89\u88C5");window.ibiz=new xe}}}});
1
+ System.register(["ramda","lodash-es","qx-util","axios","qs","loglevel","loglevel-plugin-prefix"],(function(e){"use strict";var t,n,s,r,i,a,o,c,l,h,u,d,p,m,f,g,w,b,v;return{setters:[function(e){t=e.clone,n=e.isNotNil,s=e.isNil,r=e.mergeDeepRight},function(e){i=e.debounce,a=e.merge,o=e.cloneDeepWith,c=e.cloneWith,l=e.isObject,h=e.isFunction,u=e.uniqueId,e.round,e.cloneDeep},function(e){d=e.getCookie,p=e.notNilEmpty,m=e.createUUID,f=e.QXEvent},function(e){g=e.default},function(e){w=e.default},function(e){b=e.default},function(e){v=e.default}],execute:function(){function y(e){let t,n,s,r=!1;return function(i){void 0===t?(t=i,n=0,s=-1):t=function(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(t,i);const a=t.length;let o=0;for(;n<a;){r&&(10===t[n]&&(o=++n),r=!1);let i=-1;for(;n<a&&-1===i;++n)switch(t[n]){case 58:-1===s&&(s=n-o);break;case 13:r=!0;case 10:i=n}if(-1===i)break;e(t.subarray(o,i),s),o=n,s=-1}o===a?t=void 0:0!==o&&(t=t.subarray(o),n-=o)}}e({awaitTimeout:async function(e,t,n){if(await new Promise((t=>{setTimeout((()=>{t(!0)}),e)})),t)return t(...n||[])},calcMimeByFileName:pe,clone:function(e,t){if(r(Ee,t||{}).deep)return o(e,ye);return c(e,ye)},colorBlend:function(e,t,n=.5,s="hex"){e=e.trim(),t=t.trim();const r=de(e),i=de(t),a=[ue((1-n)*r[0]+n*i[0]),ue((1-n)*r[1]+n*i[1]),ue((1-n)*r[2]+n*i[2]),(1-n)*r[3]+n*i[3]];if("hex"===s){const e=[a[0].toString(16),a[1].toString(16),a[2].toString(16),0===a[3]?"00":ue(255*a[3]).toString(16)];return"#".concat(e[0]).concat(e[1]).concat(e[2]).concat(e[3])}return"rgb(".concat(a[0]," ").concat(a[1]," ").concat(a[2]," / ").concat(a[3],")")},compareArr:function(e,t,n){const s=new Set([...e,...t]),r=[],i=[],a=[];if(n){const o=e.map((e=>e[n])),c=t.map((e=>e[n]));s.forEach((e=>{o.includes(e[n])?c.includes(e[n])?a.push(e):r.push(e):i.push(e)}))}else s.forEach((n=>{e.includes(n)?t.includes(n)?a.push(n):r.push(n):i.push(n)}));return{more:r,less:i,same:a}},debounce:function(e,t,n){let s;return function(...r){if(s&&clearTimeout(s),n){const n=!s;s=setTimeout((()=>{s=null}),t),n&&e.apply(this,r)}else s=setTimeout((()=>{e.apply(this,r)}),t)}},debounceAndAsyncMerge:function(e,t,n){let s,r=[];const a=i((async(...t)=>{s=void 0;try{const n=await e(...t);return r.forEach((e=>{e.resolve(n)})),r=[],n}catch(e){r.forEach((t=>{t.reject(e)})),r=[]}}),n);return async(...e)=>{let n=e;return s&&(n=t(s,n)),s=n,a(...n),new Promise(((e,t)=>{r.push({resolve:e,reject:t})}))}},debounceAndMerge:function(e,t,n){let s;const r=i(((...t)=>(s=void 0,e(...t))),n);return(...e)=>{let n=e;return s&&(n=t(s,n)),s=n,r(...n)}},downloadFileFromBlob:function(e,t){const n=pe(t),s=new Blob([e],{type:n}),r=URL.createObjectURL(s),i=document.createElement("a");i.href=r,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)},eventPath:ie,fetchEventSource:R,fileListToArr:me,findRecursiveChild:function(e,t,n){const{compareField:s,compareCallback:i}=r(ve,n||{}),a=i||(e=>e[s]===t);let o;return be(e,(e=>{if(a(e,t,s))return o=e,!0}),n),o},getToken:q,install:function(){if(window.ibiz)throw new Error("ibiz 已经存在, 无需重复安装");window.ibiz=new Re},isBase64Image:function(e){return/^data:image\/[a-zA-Z+]+;base64,([/+=\w\s]+|[^,]+)$/.test(e)},isElementSame:function(e,t,n){if(e.length!==t.length)return!1;const s=n?[...e.map((e=>e[n])),...t.map((e=>e[n]))]:[...e,...t];return Array.from(new Set(s)).length===e.length},isEventInside:oe,isImage:function(e){const t=e.split(".").pop();if(!t)return!1;return[".jpeg","jpg","gif","png","bmp","svg"].includes(t)},isOverlap:function(e,t){return Array.from(new Set([...e,...t])).length!==e.length+t.length},isSvg:function(e){return F.test(e)},listenJSEvent:ae,mergeDefaultInLeft:function(e,t){Object.keys(t).forEach((r=>{n(t[r])&&s(e[r])&&(e[r]=t[r])}))},mergeInLeft:function(e,t){Object.keys(t).forEach((s=>{n(t[s])&&(e[s]=t[s])}))},onClickOutside:function(e,t,n={}){const{window:s=he,ignore:r=[],capture:i=!0}=n;if(!e)throw new B("target元素不存在");if(!s)throw new B("找不到window");let a=!0;const o=t=>![e,...r].some((e=>oe(t,e)));let c=!1;let l;const h=e=>{c||(s.clearTimeout(l),a&&o(e)&&t(e))},u=[ae(s,"click",h,{passive:!0,capture:i}),ae(s,"pointerdown",(e=>{c||(a=o(e))}),{passive:!0}),ae(s,"pointerup",(e=>{if(!c&&0===e.button){const t=ie(e);e.composedPath=()=>t,l=s.setTimeout((()=>h(e)),50)}}),{passive:!0})].filter(Boolean);return{stop:()=>u.forEach((e=>e())),pause:()=>{c=!0},proceed:()=>{c=!1}}},plus:function(e,t){let n,s;try{n=e.toString().split(".")[1].length}catch(e){n=0}try{s=t.toString().split(".")[1].length}catch(e){s=0}const r=10**Math.max(n,s);return(e*r+t*r)/r},recursiveIterate:be,selectFile:fe,setRemoteStyle:async function(e){try{const t=await ibiz.net.get(e),n=document.createElement("style");n.setAttribute("title","app-style-css"),n.innerText=t.data,document.head.appendChild(n)}catch(t){ibiz.log.debug("加载远程样式表失败",e)}},throttle:function(e,t){let n=null;return function(...s){n||(n=setTimeout((()=>{e.apply(this,s),n=null}),t))}},toDisposable:P,toNumberOrNil:function(e){if(s(e))return;const t=Number(e);if(Number.isNaN(t))return;return t},updateKeyDefine:function(e,t){t.forEach((t=>{Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,writable:!0,value:void 0})}))},uploadFile:function(e){const t=a({multiple:!0,accept:"",separate:!0,beforeUpload:(e,t)=>!0,finish:e=>{},success:(e,t)=>{},error:(e,t)=>{},progress:e=>{}},e),n=async e=>{const n=e.map((e=>({status:"uploading",name:e.name,uid:u(),percentage:0})));if(!t.beforeUpload(e,n))return n.forEach((e=>{e.status="cancel"})),ibiz.log.debug("取消上传",n),n;try{const s=await(async(e,n)=>{if(t.request&&h(t.request))return t.request(e);const s=new FormData;throw e.forEach((e=>{s.append("file",e)})),new B("多应用模式等待重新实现请求")})(e);n.forEach((e=>{e.status="finished"})),t.success(n,s),n.forEach((e=>{e.response=s}))}catch(s){n.forEach((e=>{e.status="fail"})),t.error(n,s),n.forEach((e=>{e.error=s})),ibiz.log.error(s),ibiz.log.error("".concat(e.map((e=>e.name)).join(","),"上传失败"))}return n};fe({accept:t.accept,multiple:t.multiple,onSelected:e=>{(async e=>{const s=t.separate?e.map((e=>[e])):[e],r=await Promise.allSettled(s.map((async e=>n(e)))),i=[];r.forEach((e=>{"fulfilled"===e.status&&i.push(...e.value)})),t.finish(i)})(e)}})}});var E=function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]])}return n},_=e("EventStreamContentType","text/event-stream"),x=1e3,O="last-event-id";function R(e,t){var{signal:n,headers:s,onopen:r,onmessage:i,onclose:a,onerror:o,openWhenHidden:c,fetch:l}=t,h=E(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise(((t,u)=>{const d=Object.assign({},s);let p;function m(){p.abort(),document.hidden||E()}d.accept||(d.accept=_),c||document.addEventListener("visibilitychange",m);let f=x,g=0;function w(){document.removeEventListener("visibilitychange",m),window.clearTimeout(g),p.abort()}null==n||n.addEventListener("abort",(()=>{w(),t()}));const b=null!=l?l:window.fetch,v=null!=r?r:T;async function E(){var n;p=new AbortController;try{const n=await b(e,Object.assign(Object.assign({},h),{headers:d,signal:p.signal}));await v(n),await async function(e,t){const n=e.getReader();let s;for(;!(s=await n.read()).done;)t(s.value)}(n.body,y(function(e,t,n){let s={data:"",event:"",id:"",retry:void 0};const r=new TextDecoder;return function(i,a){if(0===i.length)null==n||n(s),s={data:"",event:"",id:"",retry:void 0};else if(a>0){const n=r.decode(i.subarray(0,a)),o=a+(32===i[a+1]?2:1),c=r.decode(i.subarray(o));switch(n){case"data":s.data=s.data?s.data+"\n"+c:c;break;case"event":s.event=c;break;case"id":e(s.id=c);break;case"retry":const n=parseInt(c,10);isNaN(n)||t(s.retry=n)}}}}((e=>{e?d[O]=e:delete d[O]}),(e=>{f=e}),i))),null==a||a(),w(),t()}catch(e){if(!p.signal.aborted)try{const t=null!==(n=null==o?void 0:o(e))&&void 0!==n?n:f;window.clearTimeout(g),g=window.setTimeout(E,t)}catch(e){w(),u(e)}}}E()}))}function T(e){const t=e.headers.get("content-type");if(!(null==t?void 0:t.startsWith(_)))throw new Error("Expected content-type to be ".concat(_,", Actual: ").concat(t))}var C=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};C.Undefined=new C(void 0);var U=C,A=e("LinkedList",class{constructor(){this._first=U.Undefined,this._last=U.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===U.Undefined}clear(){let e=this._first;for(;e!==U.Undefined;){const{next:t}=e;e.prev=U.Undefined,e.next=U.Undefined,e=t}this._first=U.Undefined,this._last=U.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const n=new U(e);if(this._first===U.Undefined)this._first=n,this._last=n;else if(t){const e=this._last;this._last=n,n.prev=e,e.next=n}else{const e=this._first;this._first=n,n.next=e,e.prev=n}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(n))}}shift(){if(this._first===U.Undefined)return;const e=this._first.element;return this._remove(this._first),e}pop(){if(this._last===U.Undefined)return;const e=this._last.element;return this._remove(this._last),e}_remove(e){if(e.prev!==U.Undefined&&e.next!==U.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===U.Undefined&&e.next===U.Undefined?(this._first=U.Undefined,this._last=U.Undefined):e.next===U.Undefined?(this._last=this._last.prev,this._last.next=U.Undefined):e.prev===U.Undefined&&(this._first=this._first.next,this._first.prev=U.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==U.Undefined;)yield e.element,e=e.next}});function I(e){const t=this;let n,s=!1;return function(){return s||(s=!0,n=e.apply(t,arguments)),n}}function P(e){return{dispose:I((()=>{e()}))}}var M=e("CommandsRegistry",class{constructor(){this.commands=new Map}registerCommand(e,t,n){if(!e)throw new Error("invalid command");if("string"==typeof e){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t,opts:n})}const{id:s}=e;let r=this.commands.get(s);r||(r=new A,this.commands.set(s,r));const i=r.unshift(e);return P((()=>{i();const e=this.commands.get(s);(null==e?void 0:e.isEmpty())&&this.commands.delete(s)}))}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 n of t){const t=this.getCommand(n);t&&e.set(n,t)}return e}getCommandOpt(e){const t=this.getCommand(e);return null==t?void 0:t.opts}}),N=e("CommandController",class{constructor(){this.commandRegister=new M}register(e,t,n){return this.commandRegister.registerCommand(e,t,n)}async execute(e,...t){const n=this.commandRegister.getCommand(e);if(n)return n.handler(...t);throw new Error("未注册指令: ".concat(e,",请先注册指令"))}hasCommand(e,t){const n=!!this.commandRegister.hasCommand(e);if(!0===t&&!0===n)throw new Error("未注册指令: ".concat(e,",请先注册指令"));return n}getCommandOpts(e){return this.commandRegister.getCommandOpt(e)}}),k=(e("commands",new N),e("CoreConst",class{}));k.DEFAULT_MODEL_SERVICE_TAG="default",k.TOKEN="ibzuaa-token",k.TOKEN_EXPIRES="ibzuaa-token-expires",k.TOKEN_REMEMBER="ibizuaa-token-remember";var S=e("NOOP",(()=>{})),j=(e("HttpStatusMessageConst",{200:"服务器成功返回请求的数据。",201:"新建或修改数据成功。",202:"一个请求已经进入后台排队(异步任务)。",204:"删除数据成功。",400:"发出的请求有错误,服务器没有进行新建或修改数据的操作。",401:"用户没有权限(令牌、用户名、密码错误)。",403:"用户得到授权,但是访问是被禁止的。",404:"发出的请求针对的是不存在的记录,服务器没有进行操作。",406:"请求的格式不可得。",410:"请求的资源被永久删除,且不会再得到的。",422:"当创建一个对象时,发生一个验证错误。",500:"服务器发生错误,请检查服务器。",502:"网关错误。",503:"服务不可用,服务器暂时过载或维护。",504:"网关超时。"}),e("LoginMode",(e=>(e.DEFAULT="DEFAULT",e.CUSTOM="CUSTOM",e.CAS="CAS",e))(j||{}))),L=e("MenuPermissionMode",(e=>(e.MIXIN="MIXIN",e.RESOURCE="RESOURCE",e.RT="RT",e))(L||{})),D=(e("IBizContext",class e{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 n={};Object.keys(e).forEach((e=>{Object.prototype.hasOwnProperty.call(this,e)||(n[e]={enumerable:!0,set(n){t._context[e]=null==n?null:n},get:()=>void 0!==t._context[e]?t._context[e]:t._parent[e]})})),Object.defineProperties(this,n)}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 n=new e(t(this.getOwnContext()),this._parent);return this._associationContext.push(n),n}reset(e={},t){this._associationContext.forEach((e=>{e.destroy()})),this._parent&&(this._parent={},this._context={}),Object.keys(this).forEach((e=>{try{delete this[e]}catch(e){}})),t&&this.initWithParent(t),Object.assign(this,e)}static create(t,n){return new e(t,n)}}),e("IBizParams",class{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(){return new Proxy(this,{set:(e,t,n)=>(["_params","_parent"].includes(t)?e[t]=n:e._params[t]=n,!0),get:(e,t,n)=>void 0!==e[t]?e[t]:void 0!==e._params[t]?e._params[t]:e._parent&&void 0!==e._parent[t]?e._parent[t]:void 0,ownKeys(e){const t=[...new Set([...Object.keys(e._params),...Object.keys(e._parent||{})])];return function(e,t){t.forEach((t=>{Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,writable:!0,value:void 0})}))}(e,t),t}})}reset(e,t){this._params=e||{},this._parent=t}destroy(){this._params={},this._parent=void 0}}),e("Environment",{dev:!1,hub:!0,enableMqtt:!1,mqttUrl:"/portal/mqtt/mqtt",isEnableMultiLan:!1,anonymousUser:"",anonymousPwd:"",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:"DEFAULT",menuPermissionMode:"MIXIN",enablePermission:!0,routePlaceholder:"-",enableWfAllHistory:!1,isMob:!1,isSaaSMode:!0,AppTitle:"应用",favicon:"./favicon.ico"})),z=e("HttpError",class 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="网络异常,请稍后重试!"),this.status=t.status):(this.message=e.message||"",this.status=500)}}),B=(e("ModelError",class extends Error{constructor(e,t){super("「".concat(e.id,"」模型").concat(t?": ".concat(t):"")),this.model=e,this.name="未支持的模型"}}),e("RuntimeError",class extends Error{constructor(e){super(e),this.message=e,this.name="Runtime Error"}}));e("RuntimeModelError",class extends Error{constructor(e,t){super("「".concat(e.id,"」模型").concat(t?": ".concat(t):"")),this.model=e,this.name="模型配置缺失"}}),e("NoticeError",class extends Error{constructor(e,t){super(e),this.message=e,this.duration=t,this.name="notice Error"}});function q(){return d(k.TOKEN)}var F=/<svg\b[^>]*>[\s\S]*?<\/svg>/;var H=e("Interceptor",class{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)}}),V=e("CoreInterceptor",class extends H{async onBeforeRequest(e){e=await super.onBeforeRequest(e);const{headers:t}=e;t.set("Authorization","Bearer ".concat(q()));let n=ibiz.env.dcSystem;const{orgData:s}=ibiz;return s&&(s.systemid&&(n=s.systemid),s.orgid&&t.set("srforgid",s.orgid)),t.set("srfsystemid",n),e}}),W=class{constructor(e){this.parent=e,this.evt=new f(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)}},Y=class extends W{},J=class extends W{sendCommand(e,t){const n={messageid:m(),messagename:"command",type:"COMMAND",subtype:t,data:e};this.next(n)}},$=class extends J{send(e){this.sendCommand(e,"OBJECTCREATED")}},K=class extends J{send(e){this.sendCommand(e,"OBJECTUPDATED")}},X=class extends J{send(e){this.sendCommand(e,"OBJECTREMOVED")}},G=class extends J{},Z=class extends J{send(e){this.sendCommand(e,"ASYNCACTION")}},Q=class extends W{constructor(){super(...arguments),this.change=new G,this.create=new $(this),this.update=new K(this),this.remove=new X(this),this.asyncAction=new Z(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":case"OBJECTUPDATED":case"OBJECTREMOVED":this.change.next(e)}super.nextParent(e)}send(e,t){const n={messageid:m(),messagename:"command",type:"COMMAND",subtype:t,data:e};this.next(n)}},ee=class extends W{send(e){const t={messageid:m(),messagename:"console",type:"CONSOLE",data:e};this.next(t)}},te=e("MessageCenter",class{constructor(){this.all=new Y,this.command=new Q(this.all),this.console=new ee(this.all)}next(e){"COMMAND"===e.type?this.command.next(e):"CONSOLE"===e.type?this.console.next(e):this.all.next(e)}on(e){this.all.on(e)}off(e){this.all.off(e)}});function ne(e,t,n,s,r){let i="".concat(e,"-").concat(t);return n&&(i+="-".concat(n)),s&&(i+="__".concat(s)),r&&(i+="--".concat(r)),i}e("Namespace",class{constructor(e,t){this.block=e,this.namespace=t||"ibiz"}b(e=""){return ne(this.namespace,this.block,e,"","")}e(e){return e?ne(this.namespace,this.block,"",e,""):""}m(e){return e?ne(this.namespace,this.block,"","",e):""}be(e,t){return e&&t?ne(this.namespace,this.block,e,t,""):""}em(e,t){return e&&t?ne(this.namespace,this.block,"",e,t):""}bm(e,t){return e&&t?ne(this.namespace,this.block,e,"",t):""}bem(e,t,n){return e&&t&&n?ne(this.namespace,this.block,e,t,n):""}is(e,t){return e&&t?"".concat("is-").concat(e):""}cssVar(e){const t={};for(const n in e)e[n]&&(t[this.cssVarName(n)]=e[n]);return t}cssVarBlock(e){const t={};for(const n in e)e[n]&&(t[this.cssVarBlockName(n)]=e[n]);return t}cssVarName(e){return"--".concat(this.namespace,"-").concat(e)}cssVarBlockName(e){return"--".concat(this.namespace,"-").concat(this.block,"-").concat(e)}}),e("HttpResponse",class{constructor(e,t,n){this.local=!0,this.ok=!1,this.headers={},this.config={headers:new g.AxiosHeaders},this.data=e,this.status=t||200,this.statusText=n||"",this.status>=200&&this.status<300&&(this.ok=!0)}});var se=e("Net",class{constructor(e){this.urlReg=/^http[s]?:\/\/[^\s]*/,this.waitRequest=new Map,this.interceptors=new Map,this.instance=g.create(e),this.addInterceptor("Default",new V)}get baseUrl(){return this.instance.defaults.baseURL||"".concat(ibiz.env.baseUrl,"/").concat(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(0===e.length)return t;const{url:n}=e[0];return n&&this.urlReg.test(n)&&delete t.baseURL,a(t,...e)}async post(e,t,n={},s={}){e=this.handleAppPresetParam(e,n);try{const n=await this.request(e,{method:"post",data:t,headers:s});return this.doResponseResult(n)}catch(e){throw new z(e)}}async get(e,t={},n={},s={}){e=this.attachUrlParam(e,t);try{const t=await this.request(e,a({method:"get",headers:n},s));return this.doResponseResult(t)}catch(e){throw new z(e)}}async delete(e,t,n={}){e=this.handleAppPresetParam(e,t);try{const t=await this.request(e,{method:"delete",headers:n});return this.doResponseResult(t)}catch(e){throw new z(e)}}async put(e,t,n={},s={}){e=this.handleAppPresetParam(e,n);try{const n=await this.request(e,{method:"put",data:t,headers:s});return this.doResponseResult(n)}catch(e){throw new z(e)}}async getModel(e,t={}){try{const n=await this.instance.get(e,{headers:t});return this.doResponseResult(n)}catch(e){throw new z(e)}}async request(e,t={}){const n=this.mergeConfig({url:e},t),s=JSON.stringify(n);try{let e=null;this.waitRequest.has(s)?e=this.waitRequest.get(s):(e=this.instance.request(n),this.waitRequest.set(s,e));const t=await e;return this.waitRequest.has(s)&&this.waitRequest.delete(s),this.doResponseResult(t)}catch(e){throw this.waitRequest.has(s)&&this.waitRequest.delete(s),new z(e)}}axios(e){return g(e)}async sse(e,t,n={}){e=this.attachUrlParam(this.baseUrl+e,t),n.headers||(n.headers={});const s=n.headers;{s.Authorization="Bearer ".concat(q());let e=ibiz.env.dcSystem;const{orgData:t}=ibiz;t&&(t.systemid&&(e=t.systemid),t.orgid&&(s.srforgid=t.orgid)),s.srfsystemid=e}const i=r({openWhenHidden:!0,method:"POST"},n);await R(e,i)}doResponseResult(e){const t=e;if(t.status>=200&&t.status<=299){t.ok=!0;const e=t.data;""!==e&&null!==e||(t.data=void 0)}return t}handleAppPresetParam(e,t){if(t){return Object.keys(t).forEach((e=>{e.startsWith("srf")&&p(t[e])&&t[e]})),this.attachUrlParam(e,t)}return e}attachUrlParam(e,t){{const t=e.split("?");t[0]=t[0].split("/").map((e=>encodeURIComponent(e))).join("/"),e=t.length>1?t.join("?"):t[0]}const n=w.stringify(t);return p(n)&&(e=e.endsWith("?")||-1!==e.indexOf("?")&&e.endsWith("&")?"".concat(e).concat(n):-1===e.indexOf("?")||e.endsWith("&")?"".concat(e,"?").concat(n):"".concat(e,"&").concat(n)),e}}),re=e("StringUtil",class{static fill(e,t,n){if(p(e)){if(p(t)){const n=e.match(this.contextReg);null==n||n.forEach((n=>{const s=n.slice(10,n.length-1);e=e.replace("${context.".concat(s,"}"),t[s]||"")}))}if(p(n)){const t=e.match(this.dataReg);null==t||t.forEach((t=>{const s=t.slice(7,t.length-1);e=e.replace("${data.".concat(s,"}"),n[s]||"")}))}}return e}});re.contextReg=/\$\{context.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g,re.dataReg=/\$\{data.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g;e("UrlHelper",class{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"".concat(e).concat(t).replace(/\/$/,"")}static get routePath(){return window.location.hash.replace("#","")}static get fullPath(){return window.location.href}});function ie(e){const t=e.composedPath&&e.composedPath()||e.path;if(null!=t)return t;return[e.target].concat(function e(t,n=[]){const s=t.parentNode;return s?e(s,n.concat([s])):n}(e.target))}function ae(e,t,n,s={}){e.addEventListener(t,n,s);let r=()=>{e.removeEventListener(t,n,s),r=S};return()=>{r()}}function oe(e,t){return t&&(e.target===t||ie(e).includes(t))}var ce=class e{constructor(t={}){this.data=t,this._prev=e.Undefined,this._next=e.Undefined}clone(){const n=new e(t(this.data));return n._prev&&n._prev!==e.Undefined&&(n._prev=t(this._prev)),n._next&&n._next!==e.Undefined&&(n._next=t(this._next)),n}};ce.Undefined=new ce(void 0);var le=e("HistoryItem",ce),he=(e("HistoryList",class e{get data(){return this._cur.data}constructor(e){this._cur=new le(e)}assign(e){e&&(this.save(),Object.assign(this._cur.data,e))}save(){const e=this._cur,n=t(e.data),s=new le(n);s._prev=e,e._next._prev=le.Undefined,this._clear(e._next),e._next=s,this._cur=s}prev(){return!(!this._cur._prev||this._cur._prev===le.Undefined)&&(this._cur=this._cur._prev,!0)}next(){return!(!this._cur._next||this._cur._next===le.Undefined)&&(this._cur=this._cur._next,!0)}_clear(e){e._prev&&e._prev!==le.Undefined&&(this._clear(e._prev),e._prev=le.Undefined),e._next&&e._next!==le.Undefined&&(this._clear(e._next),e._next=le.Undefined),e.data={}}clone(){return new e({})._cur=t(this._cur),this}destroy(){this._clear(this._cur)}}),"undefined"!=typeof window?window:void 0);var ue=Math.round;function de(e){const t=e.length,n=[];if("rgb"===e.slice(0,3).toLowerCase()){const t=e.match(/([\d|.%]{1,3})/g);n[0]=parseInt(t[0],10),n[1]=parseInt(t[1],10),n[2]=parseInt(t[2],10),n[3]=t[3]?-1!==t[3].indexOf("%")?parseInt(t[3],10)/100:parseFloat(t[3]):1}else{let s;s=t<6?parseInt(String(e[1])+e[1]+e[2]+e[2]+e[3]+e[3]+(t>4?String(e[4])+e[4]:""),16):parseInt(e.slice(1),16),n[0]=s>>16&255,n[1]=s>>8&255,n[2]=255&s,n[3]=9===t||5===t?ue((s>>24&255)/255*1e4)/1e4:1}return n}function pe(e){let t="";switch(e.split(".").pop()){case".wps":t="application/kswps";break;case".doc":t="application/msword";break;case".docx":t="application/vnd.openxmlformats-officedocument.wordprocessingml.document";break;case".txt":t="text/plain";break;case".zip":t="application/zip";break;case".png":t="image/png";break;case".gif":t="image/gif";break;case".jpeg":case".jpg":t="image/jpeg";break;case".rtf":t="application/rtf";break;case".avi":t="video/x-msvideo";break;case".gz":t="application/x-gzip";break;case".tar":t="application/x-tar";break;case".xlsx":t="application/vnd.ms-excel";break;default:t=""}return t}function me(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t}function fe(e){const t=a({multiple:!0,accept:""},e),n=document.createElement("input");n.setAttribute("type","file"),n.setAttribute("multiple","".concat(t.multiple)),n.setAttribute("accept",t.accept),n.onchange=e=>{const n=e.target,s=n.files?me(n.files):[];0!==s.length&&(t.onSelected(s),n.value="")},document.body.appendChild(n),n.click(),document.body.removeChild(n)}e("CountLatch",class{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 B("lock和unlock次数不匹配!");this.count-=1,0===this.count&&this.endPromise()}async await(){this.promise&&await this.promise}});var ge={childrenFields:["children"]},we=new Error("中断操作");function be(e,t,n){try{!function(e,t,n){const{childrenFields:s}=r(ge,n||{}),i=function(e,t){var n;for(const s of t)if(null==(n=e[s])?void 0:n.length)return e[s]}(e,s);if(null==i?void 0:i.length)for(const e of i){if(t(e))throw we;be(e,t,n)}}(e,t,n)}catch(e){if(e!==we)throw e}}var ve={...ge,compareField:"name"};function ye(e){if(l(e)&&h(e.clone))return e.clone()}e("DataTypes",class{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]}}).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"};var Ee={deep:!0};function _e(e){return!(!e||e&e-1)}function xe(e){if(!_e(e))throw new B("".concat(e,"不是2的幂"))}e("BitMask",{validate:_e,setPermission:function(e=0,t){return xe(t),e|t},removePermission:function(e=0,t){return xe(t),e&~t},checkPermission:function(e=0,t){return xe(t),0!=(e&t)}});var Oe=b.noConflict();v.reg(Oe),v.apply(Oe);var Re=e("IBizSys",class{constructor(){this.env=D,this.log=Oe,this.net=new se,this.commands=new N,this.mc=new te}})}}}));
@@ -0,0 +1,25 @@
1
+ /**
2
+ * 历史项
3
+ *
4
+ * @author chitanda
5
+ * @date 2023-12-28 21:12:38
6
+ * @export
7
+ * @class History
8
+ * @template E
9
+ */
10
+ export declare class HistoryItem<E> {
11
+ static readonly Undefined: HistoryItem<any>;
12
+ _prev: HistoryItem<E>;
13
+ _next: HistoryItem<E>;
14
+ data: E;
15
+ constructor(data?: unknown);
16
+ /**
17
+ * 克隆整个历史链
18
+ *
19
+ * @author chitanda
20
+ * @date 2023-12-28 23:12:56
21
+ * @return {*} {HistoryItem<E>}
22
+ */
23
+ clone(): HistoryItem<E>;
24
+ }
25
+ //# sourceMappingURL=history-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history-item.d.ts","sourceRoot":"","sources":["../../../src/utils/history-list/history-item.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,qBAAa,WAAW,CAAC,CAAC;IAExB,MAAM,CAAC,QAAQ,CAAC,SAAS,mBAAmC;IAE5D,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IAEtB,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IAEtB,IAAI,EAAE,CAAC,CAAC;gBAEI,IAAI,GAAE,OAAY;IAM9B;;;;;;OAMG;IACH,KAAK,IAAI,WAAW,CAAC,CAAC,CAAC;CAUxB"}
@@ -0,0 +1,36 @@
1
+ import { clone } from 'ramda';
2
+ /**
3
+ * 历史项
4
+ *
5
+ * @author chitanda
6
+ * @date 2023-12-28 21:12:38
7
+ * @export
8
+ * @class History
9
+ * @template E
10
+ */
11
+ export class HistoryItem {
12
+ constructor(data = {}) {
13
+ this.data = data;
14
+ this._prev = HistoryItem.Undefined;
15
+ this._next = HistoryItem.Undefined;
16
+ }
17
+ /**
18
+ * 克隆整个历史链
19
+ *
20
+ * @author chitanda
21
+ * @date 2023-12-28 23:12:56
22
+ * @return {*} {HistoryItem<E>}
23
+ */
24
+ clone() {
25
+ const history = new HistoryItem(clone(this.data));
26
+ if (history._prev && history._prev !== HistoryItem.Undefined) {
27
+ history._prev = clone(this._prev);
28
+ }
29
+ if (history._next && history._next !== HistoryItem.Undefined) {
30
+ history._next = clone(this._next);
31
+ }
32
+ return history;
33
+ }
34
+ }
35
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
+ HistoryItem.Undefined = new HistoryItem(undefined);
@@ -0,0 +1,86 @@
1
+ import { HistoryItem } from './history-item';
2
+ /**
3
+ * 数据对象历史记录,只支持纯对象形式的数据。并未支持数组
4
+ *
5
+ * @author chitanda
6
+ * @date 2023-12-28 17:12:05
7
+ * @export
8
+ * @class HistoryList
9
+ */
10
+ export declare class HistoryList<E = IData> {
11
+ /**
12
+ * 当前步骤的历史记录
13
+ *
14
+ * @author chitanda
15
+ * @date 2023-12-28 20:12:08
16
+ * @private
17
+ * @type {(HistoryItem<E>)}
18
+ */
19
+ private _cur;
20
+ /**
21
+ * 当前的数据
22
+ *
23
+ * @author chitanda
24
+ * @date 2023-12-28 18:12:27
25
+ * @type {E}
26
+ */
27
+ get data(): E;
28
+ constructor(data: E);
29
+ /**
30
+ * 先创建一次历史记录,再赋值
31
+ *
32
+ * @author chitanda
33
+ * @date 2023-12-28 17:12:05
34
+ * @param {IData} data
35
+ */
36
+ assign(data: IData): void;
37
+ /**
38
+ * 创建一次历史记录
39
+ *
40
+ * @author chitanda
41
+ * @date 2023-12-28 20:12:13
42
+ */
43
+ save(): void;
44
+ /**
45
+ * 上一步
46
+ *
47
+ * @author chitanda
48
+ * @date 2023-12-28 16:12:28
49
+ * @return {*} {boolean}
50
+ */
51
+ prev(): boolean;
52
+ /**
53
+ * 下一步
54
+ *
55
+ * @author chitanda
56
+ * @date 2023-12-28 16:12:20
57
+ * @return {*} {boolean}
58
+ */
59
+ next(): boolean;
60
+ /**
61
+ * 清空引用,避免内存泄漏
62
+ *
63
+ * @author chitanda
64
+ * @date 2023-12-28 22:12:43
65
+ * @protected
66
+ * @param {HistoryItem<E>} h
67
+ */
68
+ protected _clear(h: HistoryItem<E>): void;
69
+ /**
70
+ * 禁止克隆,直接返回当前实例
71
+ *
72
+ * @author chitanda
73
+ * @date 2023-12-28 22:12:49
74
+ * @private
75
+ * @return {*} {HistoryList<E>}
76
+ */
77
+ protected clone(): HistoryList<E>;
78
+ /**
79
+ * 销毁
80
+ *
81
+ * @author chitanda
82
+ * @date 2023-12-28 21:12:34
83
+ */
84
+ destroy(): void;
85
+ }
86
+ //# sourceMappingURL=history-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history-list.d.ts","sourceRoot":"","sources":["../../../src/utils/history-list/history-list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;;;GAOG;AACH,qBAAa,WAAW,CAAC,CAAC,GAAG,KAAK;IAChC;;;;;;;OAOG;IACH,OAAO,CAAC,IAAI,CAAiB;IAE7B;;;;;;OAMG;IACH,IAAI,IAAI,IAAI,CAAC,CAEZ;gBAEW,IAAI,EAAE,CAAC;IAInB;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI;IAOzB;;;;;OAKG;IACH,IAAI,IAAI,IAAI;IAkBZ;;;;;;OAMG;IACH,IAAI,IAAI,OAAO;IAQf;;;;;;OAMG;IACH,IAAI,IAAI,OAAO;IAQf;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI;IAYzC;;;;;;;OAOG;IACH,SAAS,CAAC,KAAK,IAAI,WAAW,CAAC,CAAC,CAAC;IAMjC;;;;;OAKG;IACH,OAAO,IAAI,IAAI;CAGhB"}
@@ -0,0 +1,130 @@
1
+ import { clone } from 'ramda';
2
+ import { HistoryItem } from './history-item';
3
+ /**
4
+ * 数据对象历史记录,只支持纯对象形式的数据。并未支持数组
5
+ *
6
+ * @author chitanda
7
+ * @date 2023-12-28 17:12:05
8
+ * @export
9
+ * @class HistoryList
10
+ */
11
+ export class HistoryList {
12
+ /**
13
+ * 当前的数据
14
+ *
15
+ * @author chitanda
16
+ * @date 2023-12-28 18:12:27
17
+ * @type {E}
18
+ */
19
+ get data() {
20
+ return this._cur.data;
21
+ }
22
+ constructor(data) {
23
+ this._cur = new HistoryItem(data);
24
+ }
25
+ /**
26
+ * 先创建一次历史记录,再赋值
27
+ *
28
+ * @author chitanda
29
+ * @date 2023-12-28 17:12:05
30
+ * @param {IData} data
31
+ */
32
+ assign(data) {
33
+ if (data) {
34
+ this.save();
35
+ Object.assign(this._cur.data, data);
36
+ }
37
+ }
38
+ /**
39
+ * 创建一次历史记录
40
+ *
41
+ * @author chitanda
42
+ * @date 2023-12-28 20:12:13
43
+ */
44
+ save() {
45
+ const oldCur = this._cur;
46
+ // 克隆当前数据对象
47
+ const data = clone(oldCur.data);
48
+ // 新的历史对象
49
+ const history = new HistoryItem(data);
50
+ // 设置新历史的上一次历史为当前历史
51
+ history._prev = oldCur;
52
+ // 将下一步的前一步置空,断开引用
53
+ oldCur._next._prev = HistoryItem.Undefined;
54
+ // 清空下一步的所有引用
55
+ this._clear(oldCur._next);
56
+ // 设置当前历史的下一次历史为新历史,如果有旧的前进步骤就干掉了
57
+ oldCur._next = history;
58
+ // 设置新历史为新历史对象
59
+ this._cur = history;
60
+ }
61
+ /**
62
+ * 上一步
63
+ *
64
+ * @author chitanda
65
+ * @date 2023-12-28 16:12:28
66
+ * @return {*} {boolean}
67
+ */
68
+ prev() {
69
+ if (this._cur._prev && this._cur._prev !== HistoryItem.Undefined) {
70
+ this._cur = this._cur._prev;
71
+ return true;
72
+ }
73
+ return false;
74
+ }
75
+ /**
76
+ * 下一步
77
+ *
78
+ * @author chitanda
79
+ * @date 2023-12-28 16:12:20
80
+ * @return {*} {boolean}
81
+ */
82
+ next() {
83
+ if (this._cur._next && this._cur._next !== HistoryItem.Undefined) {
84
+ this._cur = this._cur._next;
85
+ return true;
86
+ }
87
+ return false;
88
+ }
89
+ /**
90
+ * 清空引用,避免内存泄漏
91
+ *
92
+ * @author chitanda
93
+ * @date 2023-12-28 22:12:43
94
+ * @protected
95
+ * @param {HistoryItem<E>} h
96
+ */
97
+ _clear(h) {
98
+ if (h._prev && h._prev !== HistoryItem.Undefined) {
99
+ this._clear(h._prev);
100
+ h._prev = HistoryItem.Undefined;
101
+ }
102
+ if (h._next && h._next !== HistoryItem.Undefined) {
103
+ this._clear(h._next);
104
+ h._next = HistoryItem.Undefined;
105
+ }
106
+ h.data = {};
107
+ }
108
+ /**
109
+ * 禁止克隆,直接返回当前实例
110
+ *
111
+ * @author chitanda
112
+ * @date 2023-12-28 22:12:49
113
+ * @private
114
+ * @return {*} {HistoryList<E>}
115
+ */
116
+ clone() {
117
+ const history = new HistoryList({});
118
+ history._cur = clone(this._cur);
119
+ return this;
120
+ }
121
+ /**
122
+ * 销毁
123
+ *
124
+ * @author chitanda
125
+ * @date 2023-12-28 21:12:34
126
+ */
127
+ destroy() {
128
+ this._clear(this._cur);
129
+ }
130
+ }
@@ -9,6 +9,8 @@ export * from './util/util';
9
9
  export * from './types/types';
10
10
  export * from './url-helper/url-helper';
11
11
  export * from './event/event';
12
+ export { HistoryItem } from './history-list/history-item';
13
+ export { HistoryList } from './history-list/history-list';
12
14
  export * from './click-outside/click-outside';
13
15
  export * from './color/color';
14
16
  export * from './download-file/download-file';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC;AACrC,cAAc,kCAAkC,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC;AACrC,cAAc,kCAAkC,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC"}
@@ -8,6 +8,8 @@ export * from './util/util';
8
8
  export * from './types/types';
9
9
  export * from './url-helper/url-helper';
10
10
  export * from './event/event';
11
+ export { HistoryItem } from './history-list/history-item';
12
+ export { HistoryList } from './history-list/history-list';
11
13
  export * from './click-outside/click-outside';
12
14
  export * from './color/color';
13
15
  export * from './download-file/download-file';
@@ -138,4 +138,12 @@ export declare function plus(a: number, b: number): number;
138
138
  * @param {s(string | symbol)[]} keys 需要支持的属性名称集合
139
139
  */
140
140
  export declare function updateKeyDefine(target: IParams, keys: (string | symbol)[]): void;
141
+ /**
142
+ * 判断字符串是否为Base64图片格式
143
+ * @param {string} str
144
+ * @return {*}
145
+ * @author: zhujiamin
146
+ * @Date: 2023-12-28 10:49:23
147
+ */
148
+ export declare function isBase64Image(str: string): boolean;
141
149
  //# sourceMappingURL=util.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/utils/util/util.ts"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,wBAAgB,QAAQ,IAAI,MAAM,GAAG,IAAI,CAExC;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAG3D;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,GAAG,EAAE,EACX,IAAI,EAAE,GAAG,EAAE,EACX,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAUT;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAChE,IAAI,EAAE,CAAC,EACP,SAAS,EAAE,CACT,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,EACxB,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,KACrB,UAAU,CAAC,CAAC,CAAC,EAClB,IAAI,CAAC,EAAE,MAAM,GACZ,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,GAAG,CAiBjC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACnC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,EAE1C,IAAI,EAAE,CAAC,EACP,SAAS,EAAE,CACT,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,EACxB,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,KACrB,UAAU,CAAC,CAAC,CAAC,EAClB,IAAI,CAAC,EAAE,MAAM,GACZ,CAAC,CAoCH;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAMpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAM3D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,KAAK,EAAE,EACb,IAAI,EAAE,KAAK,EAAE,EACb,QAAQ,CAAC,EAAE,MAAM,GAChB;IACD,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,IAAI,EAAE,KAAK,EAAE,CAAC;CACf,CAuCA;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAShE;AAID;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE1C;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAejD;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GACxB,IAAI,CAWN"}
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/utils/util/util.ts"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,wBAAgB,QAAQ,IAAI,MAAM,GAAG,IAAI,CAExC;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAG3D;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,GAAG,EAAE,EACX,IAAI,EAAE,GAAG,EAAE,EACX,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAUT;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAChE,IAAI,EAAE,CAAC,EACP,SAAS,EAAE,CACT,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,EACxB,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,KACrB,UAAU,CAAC,CAAC,CAAC,EAClB,IAAI,CAAC,EAAE,MAAM,GACZ,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,GAAG,CAiBjC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACnC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,EAE1C,IAAI,EAAE,CAAC,EACP,SAAS,EAAE,CACT,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,EACxB,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,KACrB,UAAU,CAAC,CAAC,CAAC,EAClB,IAAI,CAAC,EAAE,MAAM,GACZ,CAAC,CAoCH;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAMpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAM3D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,KAAK,EAAE,EACb,IAAI,EAAE,KAAK,EAAE,EACb,QAAQ,CAAC,EAAE,MAAM,GAChB;IACD,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,IAAI,EAAE,KAAK,EAAE,CAAC;IACd,IAAI,EAAE,KAAK,EAAE,CAAC;CACf,CAuCA;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAShE;AAID;;;;;;;GAOG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE1C;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAejD;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GACxB,IAAI,CAWN;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGlD"}
@@ -297,3 +297,14 @@ export function updateKeyDefine(target, keys) {
297
297
  }
298
298
  });
299
299
  }
300
+ /**
301
+ * 判断字符串是否为Base64图片格式
302
+ * @param {string} str
303
+ * @return {*}
304
+ * @author: zhujiamin
305
+ * @Date: 2023-12-28 10:49:23
306
+ */
307
+ export function isBase64Image(str) {
308
+ // 使用正则表达式检查字符串是否以"data:image/"开头,后面紧跟着base64编码
309
+ return /^data:image\/[a-zA-Z+]+;base64,([/+=\w\s]+|[^,]+)$/.test(str);
310
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/core",
3
- "version": "0.5.0-beta.2",
3
+ "version": "0.5.0-beta.4",
4
4
  "description": "核心包",
5
5
  "type": "module",
6
6
  "main": "out/index.js",
@@ -41,7 +41,7 @@
41
41
  "ramda": "^0.29.1"
42
42
  },
43
43
  "devDependencies": {
44
- "@types/qs": "^6.9.10"
44
+ "@types/qs": "^6.9.11"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "axios": "^1.4.0",
@@ -50,5 +50,5 @@
50
50
  "qx-util": "^0.4.8",
51
51
  "ramda": "^0.29.0"
52
52
  },
53
- "gitHead": "57da8614a06455af8bf419ed2a51121871e28d88"
53
+ "gitHead": "5ae4c48f5f1ade5134d8fc90b3fd176fbe102149"
54
54
  }
@@ -0,0 +1,45 @@
1
+ import { clone } from 'ramda';
2
+
3
+ /**
4
+ * 历史项
5
+ *
6
+ * @author chitanda
7
+ * @date 2023-12-28 21:12:38
8
+ * @export
9
+ * @class History
10
+ * @template E
11
+ */
12
+ export class HistoryItem<E> {
13
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
+ static readonly Undefined = new HistoryItem<any>(undefined);
15
+
16
+ _prev: HistoryItem<E>;
17
+
18
+ _next: HistoryItem<E>;
19
+
20
+ data: E;
21
+
22
+ constructor(data: unknown = {}) {
23
+ this.data = data as E;
24
+ this._prev = HistoryItem.Undefined;
25
+ this._next = HistoryItem.Undefined;
26
+ }
27
+
28
+ /**
29
+ * 克隆整个历史链
30
+ *
31
+ * @author chitanda
32
+ * @date 2023-12-28 23:12:56
33
+ * @return {*} {HistoryItem<E>}
34
+ */
35
+ clone(): HistoryItem<E> {
36
+ const history = new HistoryItem<E>(clone(this.data));
37
+ if (history._prev && history._prev !== HistoryItem.Undefined) {
38
+ history._prev = clone(this._prev);
39
+ }
40
+ if (history._next && history._next !== HistoryItem.Undefined) {
41
+ history._next = clone(this._next);
42
+ }
43
+ return history;
44
+ }
45
+ }
@@ -0,0 +1,149 @@
1
+ import { clone } from 'ramda';
2
+ import { HistoryItem } from './history-item';
3
+
4
+ /**
5
+ * 数据对象历史记录,只支持纯对象形式的数据。并未支持数组
6
+ *
7
+ * @author chitanda
8
+ * @date 2023-12-28 17:12:05
9
+ * @export
10
+ * @class HistoryList
11
+ */
12
+ export class HistoryList<E = IData> {
13
+ /**
14
+ * 当前步骤的历史记录
15
+ *
16
+ * @author chitanda
17
+ * @date 2023-12-28 20:12:08
18
+ * @private
19
+ * @type {(HistoryItem<E>)}
20
+ */
21
+ private _cur: HistoryItem<E>;
22
+
23
+ /**
24
+ * 当前的数据
25
+ *
26
+ * @author chitanda
27
+ * @date 2023-12-28 18:12:27
28
+ * @type {E}
29
+ */
30
+ get data(): E {
31
+ return this._cur.data;
32
+ }
33
+
34
+ constructor(data: E) {
35
+ this._cur = new HistoryItem<E>(data);
36
+ }
37
+
38
+ /**
39
+ * 先创建一次历史记录,再赋值
40
+ *
41
+ * @author chitanda
42
+ * @date 2023-12-28 17:12:05
43
+ * @param {IData} data
44
+ */
45
+ assign(data: IData): void {
46
+ if (data) {
47
+ this.save();
48
+ Object.assign(this._cur.data!, data);
49
+ }
50
+ }
51
+
52
+ /**
53
+ * 创建一次历史记录
54
+ *
55
+ * @author chitanda
56
+ * @date 2023-12-28 20:12:13
57
+ */
58
+ save(): void {
59
+ const oldCur = this._cur;
60
+ // 克隆当前数据对象
61
+ const data = clone(oldCur.data);
62
+ // 新的历史对象
63
+ const history = new HistoryItem<E>(data);
64
+ // 设置新历史的上一次历史为当前历史
65
+ history._prev = oldCur;
66
+ // 将下一步的前一步置空,断开引用
67
+ oldCur._next._prev = HistoryItem.Undefined;
68
+ // 清空下一步的所有引用
69
+ this._clear(oldCur._next);
70
+ // 设置当前历史的下一次历史为新历史,如果有旧的前进步骤就干掉了
71
+ oldCur._next = history;
72
+ // 设置新历史为新历史对象
73
+ this._cur = history;
74
+ }
75
+
76
+ /**
77
+ * 上一步
78
+ *
79
+ * @author chitanda
80
+ * @date 2023-12-28 16:12:28
81
+ * @return {*} {boolean}
82
+ */
83
+ prev(): boolean {
84
+ if (this._cur._prev && this._cur._prev !== HistoryItem.Undefined) {
85
+ this._cur = this._cur._prev;
86
+ return true;
87
+ }
88
+ return false;
89
+ }
90
+
91
+ /**
92
+ * 下一步
93
+ *
94
+ * @author chitanda
95
+ * @date 2023-12-28 16:12:20
96
+ * @return {*} {boolean}
97
+ */
98
+ next(): boolean {
99
+ if (this._cur._next && this._cur._next !== HistoryItem.Undefined) {
100
+ this._cur = this._cur._next;
101
+ return true;
102
+ }
103
+ return false;
104
+ }
105
+
106
+ /**
107
+ * 清空引用,避免内存泄漏
108
+ *
109
+ * @author chitanda
110
+ * @date 2023-12-28 22:12:43
111
+ * @protected
112
+ * @param {HistoryItem<E>} h
113
+ */
114
+ protected _clear(h: HistoryItem<E>): void {
115
+ if (h._prev && h._prev !== HistoryItem.Undefined) {
116
+ this._clear(h._prev);
117
+ h._prev = HistoryItem.Undefined;
118
+ }
119
+ if (h._next && h._next !== HistoryItem.Undefined) {
120
+ this._clear(h._next);
121
+ h._next = HistoryItem.Undefined;
122
+ }
123
+ h.data = {} as E;
124
+ }
125
+
126
+ /**
127
+ * 禁止克隆,直接返回当前实例
128
+ *
129
+ * @author chitanda
130
+ * @date 2023-12-28 22:12:49
131
+ * @private
132
+ * @return {*} {HistoryList<E>}
133
+ */
134
+ protected clone(): HistoryList<E> {
135
+ const history = new HistoryList<E>({} as E);
136
+ history._cur = clone(this._cur);
137
+ return this;
138
+ }
139
+
140
+ /**
141
+ * 销毁
142
+ *
143
+ * @author chitanda
144
+ * @date 2023-12-28 21:12:34
145
+ */
146
+ destroy(): void {
147
+ this._clear(this._cur);
148
+ }
149
+ }
@@ -9,6 +9,8 @@ export * from './util/util';
9
9
  export * from './types/types';
10
10
  export * from './url-helper/url-helper';
11
11
  export * from './event/event';
12
+ export { HistoryItem } from './history-list/history-item';
13
+ export { HistoryList } from './history-list/history-list';
12
14
  export * from './click-outside/click-outside';
13
15
  export * from './color/color';
14
16
  export * from './download-file/download-file';
@@ -340,3 +340,15 @@ export function updateKeyDefine(
340
340
  }
341
341
  });
342
342
  }
343
+
344
+ /**
345
+ * 判断字符串是否为Base64图片格式
346
+ * @param {string} str
347
+ * @return {*}
348
+ * @author: zhujiamin
349
+ * @Date: 2023-12-28 10:49:23
350
+ */
351
+ export function isBase64Image(str: string): boolean {
352
+ // 使用正则表达式检查字符串是否以"data:image/"开头,后面紧跟着base64编码
353
+ return /^data:image\/[a-zA-Z+]+;base64,([/+=\w\s]+|[^,]+)$/.test(str);
354
+ }