@ibiz-template/core 0.5.7-alpha.5 → 0.5.7-alpha.6

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
@@ -1132,6 +1132,16 @@ function updateKeyDefine(target, keys) {
1132
1132
  function isBase64Image(str) {
1133
1133
  return /^data:image\/[a-zA-Z+]+;base64,([/+=\w\s]+|[^,]+)$/.test(str);
1134
1134
  }
1135
+ function calcOpenModeStyle(value, type) {
1136
+ if (value >= 0 && value <= 100) {
1137
+ return "".concat(value, "%");
1138
+ }
1139
+ if (value > 100) {
1140
+ return type === "drawer" ? value : "".concat(value, "px");
1141
+ }
1142
+ ibiz.log.error("\u65E0\u6548\u8F93\u5165\u503C\uFF0C\u5FC5\u987B>=0");
1143
+ return "";
1144
+ }
1135
1145
 
1136
1146
  // src/utils/interceptor/interceptor.ts
1137
1147
  var Interceptor = class {
@@ -1387,6 +1397,20 @@ var CommandAsyncAction = class extends CommandBase {
1387
1397
  }
1388
1398
  };
1389
1399
 
1400
+ // src/utils/message-center/command/internal-message/command-internal-message.ts
1401
+ var CommandInternalMessage = class extends CommandBase {
1402
+ /**
1403
+ * 发送 站内信 指令消息
1404
+ *
1405
+ * @author chitanda
1406
+ * @date 2023-10-23 17:10:46
1407
+ * @param {IPortalInternalMessage} data
1408
+ */
1409
+ send(data) {
1410
+ this.sendCommand(data, "INTERNALMESSAGE");
1411
+ }
1412
+ };
1413
+
1390
1414
  // src/utils/message-center/command/message-command.ts
1391
1415
  var MessageCommand = class extends MessageBase {
1392
1416
  constructor() {
@@ -1431,6 +1455,16 @@ var MessageCommand = class extends MessageBase {
1431
1455
  * @type {CommandAsyncAction}
1432
1456
  */
1433
1457
  this.asyncAction = new CommandAsyncAction(this);
1458
+ /**
1459
+ * 站内信 指令消息
1460
+ *
1461
+ * @author chitanda
1462
+ * @date 2023-10-23 17:10:56
1463
+ * @type {CommandInternalMessage}
1464
+ */
1465
+ this.internalMessage = new CommandInternalMessage(
1466
+ this
1467
+ );
1434
1468
  }
1435
1469
  /**
1436
1470
  * 推送指令消息
@@ -1456,6 +1490,9 @@ var MessageCommand = class extends MessageBase {
1456
1490
  case "ASYNCACTION":
1457
1491
  this.asyncAction.next(msg);
1458
1492
  break;
1493
+ case "INTERNALMESSAGE":
1494
+ this.internalMessage.next(msg);
1495
+ break;
1459
1496
  default:
1460
1497
  super.next(msg);
1461
1498
  }
@@ -3178,6 +3215,7 @@ export {
3178
3215
  UrlHelper,
3179
3216
  awaitTimeout,
3180
3217
  calcMimeByFileName,
3218
+ calcOpenModeStyle,
3181
3219
  clone4 as clone,
3182
3220
  colorBlend,
3183
3221
  commands,
@@ -1 +1 @@
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,b,w,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){b=e.default},function(e){w=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 we(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:we,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:N,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 b(){document.removeEventListener("visibilitychange",m),window.clearTimeout(g),p.abort()}null==n||n.addEventListener("abort",(()=>{b(),t()}));const w=null!=l?l:window.fetch,v=null!=r?r:T;async function E(){var n;p=new AbortController;try{const n=await w(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(),b(),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){b(),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 A=C,U=e("LinkedList",class{constructor(){this._first=A.Undefined,this._last=A.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===A.Undefined}clear(){let e=this._first;for(;e!==A.Undefined;){const{next:t}=e;e.prev=A.Undefined,e.next=A.Undefined,e=t}this._first=A.Undefined,this._last=A.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const n=new A(e);if(this._first===A.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===A.Undefined)return;const e=this._first.element;return this._remove(this._first),e}pop(){if(this._last===A.Undefined)return;const e=this._last.element;return this._remove(this._last),e}_remove(e){if(e.prev!==A.Undefined&&e.next!==A.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===A.Undefined&&e.next===A.Undefined?(this._first=A.Undefined,this._last=A.Undefined):e.next===A.Undefined?(this._last=this._last.prev,this._last.next=A.Undefined):e.prev===A.Undefined&&(this._first=this._first.next,this._first.prev=A.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==A.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 N(e){return{dispose:I((()=>{e()}))}}var P=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 U,this.commands.set(s,r));const i=r.unshift(e);return N((()=>{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}}),M=e("CommandController",class{constructor(){this.commandRegister=new P}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)}}),S=(e("commands",new M),e("CoreConst",class{}));S.DEFAULT_MODEL_SERVICE_TAG="default",S.TOKEN="ibzuaa-token",S.REFRESH_TOKEN="ibzuaa-refresh-token",S.TOKEN_EXPIRES="ibzuaa-token-expires",S.TOKEN_REMEMBER="ibizuaa-token-remember",S.IS_ANONYMOUS="ibizuaa-is-anonymous";var k=e("NOOP",(()=>{})),L=(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))(L||{}))),j=e("MenuPermissionMode",(e=>(e.MIXIN="MIXIN",e.RESOURCE="RESOURCE",e.RT="RT",e))(j||{})),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:"",enableAnonymous:!1,logLevel:"ERROR",baseUrl:"/api",appId:"",pluginBaseUrl:"http://172.16.240.221",isLocalModel:!1,remoteModelUrl:"/remotemodel",assetsUrl:"./assets",dcSystem:"",downloadFileUrl:"/ibizutil/download/{cat}",uploadFileUrl:"/ibizutil/upload/{cat}",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(S.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;case"ASYNCACTION":this.asyncAction.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){return t?this.attachUrlParam(e,t):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=b.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=k};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&&(e._prev._next=le.Undefined,this._clear(e._prev),e._prev=le.Undefined),e._next&&e._next!==le.Undefined&&(e._next._prev=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"]},be=new Error("中断操作");function we(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 be;we(e,t,n)}}(e,t,n)}catch(e){if(e!==be)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=w.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 M,this.mc=new te}})}}}));
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,b,w,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){b=e.default},function(e){w=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:me,calcOpenModeStyle:function(e,t){if(e>=0&&e<=100)return"".concat(e,"%");if(e>100)return"drawer"===t?e:"".concat(e,"px");return ibiz.log.error("无效输入值,必须>=0"),""},clone:function(e,t){if(r(_e,t||{}).deep)return o(e,Ee);return c(e,Ee)},colorBlend:function(e,t,n=.5,s="hex"){e=e.trim(),t=t.trim();const r=pe(e),i=pe(t),a=[de((1-n)*r[0]+n*i[0]),de((1-n)*r[1]+n*i[1]),de((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":de(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=me(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:ae,fetchEventSource:R,fileListToArr:fe,findRecursiveChild:function(e,t,n){const{compareField:s,compareCallback:i}=r(ye,n||{}),a=i||(e=>e[s]===t);let o;return ve(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 Te},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:ce,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:oe,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=ue,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=>ce(t,e)));let c=!1;let l;const h=e=>{c||(s.clearTimeout(l),a&&o(e)&&t(e))},u=[oe(s,"click",h,{passive:!0,capture:i}),oe(s,"pointerdown",(e=>{c||(a=o(e))}),{passive:!0}),oe(s,"pointerup",(e=>{if(!c&&0===e.button){const t=ae(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:ve,selectFile:ge,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:N,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};ge({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 b(){document.removeEventListener("visibilitychange",m),window.clearTimeout(g),p.abort()}null==n||n.addEventListener("abort",(()=>{b(),t()}));const w=null!=l?l:window.fetch,v=null!=r?r:T;async function E(){var n;p=new AbortController;try{const n=await w(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(),b(),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){b(),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 A=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};A.Undefined=new A(void 0);var C=A,U=e("LinkedList",class{constructor(){this._first=C.Undefined,this._last=C.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===C.Undefined}clear(){let e=this._first;for(;e!==C.Undefined;){const{next:t}=e;e.prev=C.Undefined,e.next=C.Undefined,e=t}this._first=C.Undefined,this._last=C.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const n=new C(e);if(this._first===C.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===C.Undefined)return;const e=this._first.element;return this._remove(this._first),e}pop(){if(this._last===C.Undefined)return;const e=this._last.element;return this._remove(this._last),e}_remove(e){if(e.prev!==C.Undefined&&e.next!==C.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===C.Undefined&&e.next===C.Undefined?(this._first=C.Undefined,this._last=C.Undefined):e.next===C.Undefined?(this._last=this._last.prev,this._last.next=C.Undefined):e.prev===C.Undefined&&(this._first=this._first.next,this._first.prev=C.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==C.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 N(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 U,this.commands.set(s,r));const i=r.unshift(e);return N((()=>{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}}),P=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)}}),S=(e("commands",new P),e("CoreConst",class{}));S.DEFAULT_MODEL_SERVICE_TAG="default",S.TOKEN="ibzuaa-token",S.REFRESH_TOKEN="ibzuaa-refresh-token",S.TOKEN_EXPIRES="ibzuaa-token-expires",S.TOKEN_REMEMBER="ibizuaa-token-remember",S.IS_ANONYMOUS="ibizuaa-is-anonymous";var k=e("NOOP",(()=>{})),L=(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))(L||{}))),j=e("MenuPermissionMode",(e=>(e.MIXIN="MIXIN",e.RESOURCE="RESOURCE",e.RT="RT",e))(j||{})),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:"",enableAnonymous:!1,logLevel:"ERROR",baseUrl:"/api",appId:"",pluginBaseUrl:"http://172.16.240.221",isLocalModel:!1,remoteModelUrl:"/remotemodel",assetsUrl:"./assets",dcSystem:"",downloadFileUrl:"/ibizutil/download/{cat}",uploadFileUrl:"/ibizutil/upload/{cat}",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(S.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")}},G=class extends J{send(e){this.sendCommand(e,"OBJECTREMOVED")}},X=class extends J{},Z=class extends J{send(e){this.sendCommand(e,"ASYNCACTION")}},Q=class extends J{send(e){this.sendCommand(e,"INTERNALMESSAGE")}},ee=class extends W{constructor(){super(...arguments),this.change=new X,this.create=new $(this),this.update=new K(this),this.remove=new G(this),this.asyncAction=new Z(this),this.internalMessage=new Q(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;case"ASYNCACTION":this.asyncAction.next(e);break;case"INTERNALMESSAGE":this.internalMessage.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)}},te=class extends W{send(e){const t={messageid:m(),messagename:"console",type:"CONSOLE",data:e};this.next(t)}},ne=e("MessageCenter",class{constructor(){this.all=new Y,this.command=new ee(this.all),this.console=new te(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 se(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 se(this.namespace,this.block,e,"","")}e(e){return e?se(this.namespace,this.block,"",e,""):""}m(e){return e?se(this.namespace,this.block,"","",e):""}be(e,t){return e&&t?se(this.namespace,this.block,e,t,""):""}em(e,t){return e&&t?se(this.namespace,this.block,"",e,t):""}bm(e,t){return e&&t?se(this.namespace,this.block,e,"",t):""}bem(e,t,n){return e&&t&&n?se(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 re=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){return t?this.attachUrlParam(e,t):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=b.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}}),ie=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}});ie.contextReg=/\$\{context.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g,ie.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 ae(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 oe(e,t,n,s={}){e.addEventListener(t,n,s);let r=()=>{e.removeEventListener(t,n,s),r=k};return()=>{r()}}function ce(e,t){return t&&(e.target===t||ae(e).includes(t))}var le=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}};le.Undefined=new le(void 0);var he=e("HistoryItem",le),ue=(e("HistoryList",class e{get data(){return this._cur.data}constructor(e){this._cur=new he(e)}assign(e){e&&(this.save(),Object.assign(this._cur.data,e))}save(){const e=this._cur,n=t(e.data),s=new he(n);s._prev=e,e._next._prev=he.Undefined,this._clear(e._next),e._next=s,this._cur=s}prev(){return!(!this._cur._prev||this._cur._prev===he.Undefined)&&(this._cur=this._cur._prev,!0)}next(){return!(!this._cur._next||this._cur._next===he.Undefined)&&(this._cur=this._cur._next,!0)}_clear(e){e._prev&&e._prev!==he.Undefined&&(e._prev._next=he.Undefined,this._clear(e._prev),e._prev=he.Undefined),e._next&&e._next!==he.Undefined&&(e._next._prev=he.Undefined,this._clear(e._next),e._next=he.Undefined),e.data={}}clone(){return new e({})._cur=t(this._cur),this}destroy(){this._clear(this._cur)}}),"undefined"!=typeof window?window:void 0);var de=Math.round;function pe(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?de((s>>24&255)/255*1e4)/1e4:1}return n}function me(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 fe(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t}function ge(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?fe(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 be={childrenFields:["children"]},we=new Error("中断操作");function ve(e,t,n){try{!function(e,t,n){const{childrenFields:s}=r(be,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;ve(e,t,n)}}(e,t,n)}catch(e){if(e!==we)throw e}}var ye={...be,compareField:"name"};function Ee(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 _e={deep:!0};function xe(e){return!(!e||e&e-1)}function Oe(e){if(!xe(e))throw new B("".concat(e,"不是2的幂"))}e("BitMask",{validate:xe,setPermission:function(e=0,t){return Oe(t),e|t},removePermission:function(e=0,t){return Oe(t),e&~t},checkPermission:function(e=0,t){return Oe(t),0!=(e&t)}});var Re=w.noConflict();v.reg(Re),v.apply(Re);var Te=e("IBizSys",class{constructor(){this.env=D,this.log=Re,this.net=new re,this.commands=new P,this.mc=new ne}})}}}));
@@ -43,7 +43,7 @@ export interface IPortalMessage {
43
43
  * | 'OBJECTREMOVED'
44
44
  * | 'OBJECTCREATED')} 标注打开数据 | 异步作业 | 数据更新 | 数据删除 | 数据创建
45
45
  */
46
- subtype?: 'MARKOPENDATA' | 'ASYNCACTION' | 'OBJECTUPDATED' | 'OBJECTREMOVED' | 'OBJECTCREATED';
46
+ subtype?: 'MARKOPENDATA' | 'ASYNCACTION' | 'INTERNALMESSAGE' | 'OBJECTUPDATED' | 'OBJECTREMOVED' | 'OBJECTCREATED';
47
47
  /**
48
48
  * 内容摘要
49
49
  *
@@ -1 +1 @@
1
- {"version":3,"file":"i-portal-message.d.ts","sourceRoot":"","sources":["../../../src/interface/i-portal-message/i-portal-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAEpF;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;OAMG;IACH,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IAE5B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EACJ,cAAc,GACd,aAAa,GACb,eAAe,GACf,eAAe,GACf,eAAe,CAAC;IAEpB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,kBAAkB,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;IAErD;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd"}
1
+ {"version":3,"file":"i-portal-message.d.ts","sourceRoot":"","sources":["../../../src/interface/i-portal-message/i-portal-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAEpF;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;OAMG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;OAMG;IACH,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IAE5B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EACJ,cAAc,GACd,aAAa,GACb,iBAAiB,GACjB,eAAe,GACf,eAAe,GACf,eAAe,CAAC;IAEpB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,kBAAkB,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;IAErD;;;;;;OAMG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd"}
@@ -0,0 +1,22 @@
1
+ import { IInternalMessage } from '../../../../interface';
2
+ import { CommandBase } from '../command-base/command-base';
3
+ /**
4
+ * 站内信指令消息
5
+ *
6
+ * @author lxm
7
+ * @date 2024-01-30 11:38:38
8
+ * @export
9
+ * @class CommandInternalMessage
10
+ * @extends {CommandBase}
11
+ */
12
+ export declare class CommandInternalMessage extends CommandBase {
13
+ /**
14
+ * 发送 站内信 指令消息
15
+ *
16
+ * @author chitanda
17
+ * @date 2023-10-23 17:10:46
18
+ * @param {IPortalInternalMessage} data
19
+ */
20
+ send(data: IInternalMessage): void;
21
+ }
22
+ //# sourceMappingURL=command-internal-message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-internal-message.d.ts","sourceRoot":"","sources":["../../../../../src/utils/message-center/command/internal-message/command-internal-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D;;;;;;;;GAQG;AACH,qBAAa,sBAAuB,SAAQ,WAAW;IACrD;;;;;;OAMG;IACH,IAAI,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;CAGnC"}
@@ -0,0 +1,22 @@
1
+ import { CommandBase } from '../command-base/command-base';
2
+ /**
3
+ * 站内信指令消息
4
+ *
5
+ * @author lxm
6
+ * @date 2024-01-30 11:38:38
7
+ * @export
8
+ * @class CommandInternalMessage
9
+ * @extends {CommandBase}
10
+ */
11
+ export class CommandInternalMessage extends CommandBase {
12
+ /**
13
+ * 发送 站内信 指令消息
14
+ *
15
+ * @author chitanda
16
+ * @date 2023-10-23 17:10:46
17
+ * @param {IPortalInternalMessage} data
18
+ */
19
+ send(data) {
20
+ this.sendCommand(data, 'INTERNALMESSAGE');
21
+ }
22
+ }
@@ -5,6 +5,7 @@ import { CommandUpdate } from './update/command-update';
5
5
  import { CommandRemove } from './remove/command-remove';
6
6
  import { CommandChange } from './change/command-change';
7
7
  import { CommandAsyncAction } from './async-action/command-async-action';
8
+ import { CommandInternalMessage } from './internal-message/command-internal-message';
8
9
  /**
9
10
  * 指令消息
10
11
  *
@@ -55,6 +56,14 @@ export declare class MessageCommand extends MessageBase {
55
56
  * @type {CommandAsyncAction}
56
57
  */
57
58
  readonly asyncAction: CommandAsyncAction;
59
+ /**
60
+ * 站内信 指令消息
61
+ *
62
+ * @author chitanda
63
+ * @date 2023-10-23 17:10:56
64
+ * @type {CommandInternalMessage}
65
+ */
66
+ readonly internalMessage: CommandInternalMessage;
58
67
  /**
59
68
  * 推送指令消息
60
69
  *
@@ -1 +1 @@
1
- {"version":3,"file":"message-command.d.ts","sourceRoot":"","sources":["../../../../src/utils/message-center/command/message-command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE;;;;;;;;GAQG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAuB;IAErD;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,aAAa,CAA2B;IAEzD;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,aAAa,CAA2B;IAEzD;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,aAAa,CAA2B;IAEzD;;;;;;OAMG;IACH,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAgC;IAExE;;;;;;OAMG;IACH,IAAI,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IAyB/B,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IAgB/C;;;;;;;OAOG;IACH,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG,IAAI;CAU5D"}
1
+ {"version":3,"file":"message-command.d.ts","sourceRoot":"","sources":["../../../../src/utils/message-center/command/message-command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAErF;;;;;;;;GAQG;AACH,qBAAa,cAAe,SAAQ,WAAW;IAC7C;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAuB;IAErD;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,aAAa,CAA2B;IAEzD;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,aAAa,CAA2B;IAEzD;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,aAAa,CAA2B;IAEzD;;;;;;OAMG;IACH,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAgC;IAExE;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,EAAE,sBAAsB,CAE9C;IAEF;;;;;;OAMG;IACH,IAAI,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IA4B/B,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IAgB/C;;;;;;;OAOG;IACH,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,GAAG,IAAI;CAU5D"}
@@ -5,6 +5,7 @@ import { CommandUpdate } from './update/command-update';
5
5
  import { CommandRemove } from './remove/command-remove';
6
6
  import { CommandChange } from './change/command-change';
7
7
  import { CommandAsyncAction } from './async-action/command-async-action';
8
+ import { CommandInternalMessage } from './internal-message/command-internal-message';
8
9
  /**
9
10
  * 指令消息
10
11
  *
@@ -57,6 +58,14 @@ export class MessageCommand extends MessageBase {
57
58
  * @type {CommandAsyncAction}
58
59
  */
59
60
  this.asyncAction = new CommandAsyncAction(this);
61
+ /**
62
+ * 站内信 指令消息
63
+ *
64
+ * @author chitanda
65
+ * @date 2023-10-23 17:10:56
66
+ * @type {CommandInternalMessage}
67
+ */
68
+ this.internalMessage = new CommandInternalMessage(this);
60
69
  }
61
70
  /**
62
71
  * 推送指令消息
@@ -85,6 +94,9 @@ export class MessageCommand extends MessageBase {
85
94
  case 'ASYNCACTION':
86
95
  this.asyncAction.next(msg);
87
96
  break;
97
+ case 'INTERNALMESSAGE':
98
+ this.internalMessage.next(msg);
99
+ break;
88
100
  default:
89
101
  super.next(msg);
90
102
  }
@@ -146,4 +146,12 @@ export declare function updateKeyDefine(target: IParams, keys: (string | symbol)
146
146
  * @Date: 2023-12-28 10:49:23
147
147
  */
148
148
  export declare function isBase64Image(str: string): boolean;
149
+ /**
150
+ * 计算各种视图打开方式的样式
151
+ * @param {number} value
152
+ * @return {*}
153
+ * @author: zhujiamin
154
+ * @Date: 2024-01-30 09:39:03
155
+ */
156
+ export declare function calcOpenModeStyle(value: number, type: 'drawer' | 'modal' | 'popover'): string | number;
149
157
  //# 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;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGlD"}
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;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GACnC,MAAM,GAAG,MAAM,CAUjB"}
@@ -308,3 +308,21 @@ export function isBase64Image(str) {
308
308
  // 使用正则表达式检查字符串是否以"data:image/"开头,后面紧跟着base64编码
309
309
  return /^data:image\/[a-zA-Z+]+;base64,([/+=\w\s]+|[^,]+)$/.test(str);
310
310
  }
311
+ /**
312
+ * 计算各种视图打开方式的样式
313
+ * @param {number} value
314
+ * @return {*}
315
+ * @author: zhujiamin
316
+ * @Date: 2024-01-30 09:39:03
317
+ */
318
+ export function calcOpenModeStyle(value, type) {
319
+ if (value >= 0 && value <= 100) {
320
+ return `${value}%`;
321
+ }
322
+ if (value > 100) {
323
+ return type === 'drawer' ? value : `${value}px`;
324
+ }
325
+ // 处理其他情况,例如负值等
326
+ ibiz.log.error('无效输入值,必须>=0');
327
+ return '';
328
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibiz-template/core",
3
- "version": "0.5.7-alpha.5",
3
+ "version": "0.5.7-alpha.6",
4
4
  "description": "核心包",
5
5
  "type": "module",
6
6
  "main": "out/index.js",
@@ -50,5 +50,6 @@
50
50
  "qs": "^6.11.0",
51
51
  "qx-util": "^0.4.8",
52
52
  "ramda": "^0.29.0"
53
- }
53
+ },
54
+ "gitHead": "968a0875747b7cadc60f659121b3379ea21e9e07"
54
55
  }
@@ -50,6 +50,7 @@ export interface IPortalMessage {
50
50
  subtype?:
51
51
  | 'MARKOPENDATA'
52
52
  | 'ASYNCACTION'
53
+ | 'INTERNALMESSAGE'
53
54
  | 'OBJECTUPDATED'
54
55
  | 'OBJECTREMOVED'
55
56
  | 'OBJECTCREATED';
@@ -0,0 +1,24 @@
1
+ import { IInternalMessage } from '../../../../interface';
2
+ import { CommandBase } from '../command-base/command-base';
3
+
4
+ /**
5
+ * 站内信指令消息
6
+ *
7
+ * @author lxm
8
+ * @date 2024-01-30 11:38:38
9
+ * @export
10
+ * @class CommandInternalMessage
11
+ * @extends {CommandBase}
12
+ */
13
+ export class CommandInternalMessage extends CommandBase {
14
+ /**
15
+ * 发送 站内信 指令消息
16
+ *
17
+ * @author chitanda
18
+ * @date 2023-10-23 17:10:46
19
+ * @param {IPortalInternalMessage} data
20
+ */
21
+ send(data: IInternalMessage): void {
22
+ this.sendCommand(data, 'INTERNALMESSAGE');
23
+ }
24
+ }
@@ -6,6 +6,7 @@ import { CommandUpdate } from './update/command-update';
6
6
  import { CommandRemove } from './remove/command-remove';
7
7
  import { CommandChange } from './change/command-change';
8
8
  import { CommandAsyncAction } from './async-action/command-async-action';
9
+ import { CommandInternalMessage } from './internal-message/command-internal-message';
9
10
 
10
11
  /**
11
12
  * 指令消息
@@ -62,6 +63,17 @@ export class MessageCommand extends MessageBase {
62
63
  */
63
64
  readonly asyncAction: CommandAsyncAction = new CommandAsyncAction(this);
64
65
 
66
+ /**
67
+ * 站内信 指令消息
68
+ *
69
+ * @author chitanda
70
+ * @date 2023-10-23 17:10:56
71
+ * @type {CommandInternalMessage}
72
+ */
73
+ readonly internalMessage: CommandInternalMessage = new CommandInternalMessage(
74
+ this,
75
+ );
76
+
65
77
  /**
66
78
  * 推送指令消息
67
79
  *
@@ -89,6 +101,9 @@ export class MessageCommand extends MessageBase {
89
101
  case 'ASYNCACTION':
90
102
  this.asyncAction.next(msg);
91
103
  break;
104
+ case 'INTERNALMESSAGE':
105
+ this.internalMessage.next(msg);
106
+ break;
92
107
  default:
93
108
  super.next(msg);
94
109
  }
@@ -352,3 +352,25 @@ export function isBase64Image(str: string): boolean {
352
352
  // 使用正则表达式检查字符串是否以"data:image/"开头,后面紧跟着base64编码
353
353
  return /^data:image\/[a-zA-Z+]+;base64,([/+=\w\s]+|[^,]+)$/.test(str);
354
354
  }
355
+
356
+ /**
357
+ * 计算各种视图打开方式的样式
358
+ * @param {number} value
359
+ * @return {*}
360
+ * @author: zhujiamin
361
+ * @Date: 2024-01-30 09:39:03
362
+ */
363
+ export function calcOpenModeStyle(
364
+ value: number,
365
+ type: 'drawer' | 'modal' | 'popover',
366
+ ): string | number {
367
+ if (value >= 0 && value <= 100) {
368
+ return `${value}%`;
369
+ }
370
+ if (value > 100) {
371
+ return type === 'drawer' ? value : `${value}px`;
372
+ }
373
+ // 处理其他情况,例如负值等
374
+ ibiz.log.error('无效输入值,必须>=0');
375
+ return '';
376
+ }