@ibiz-template/core 0.7.16 → 0.7.17-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +89 -17
- package/dist/index.system.min.js +1 -1
- package/out/command/command.js +1 -1
- package/out/error/http-error/http-error.js +1 -1
- package/out/error/model-error/model-error.d.ts.map +1 -1
- package/out/error/model-error/model-error.js +5 -2
- package/out/error/runtime-model-error/runtime-model-error.d.ts.map +1 -1
- package/out/error/runtime-model-error/runtime-model-error.js +5 -2
- package/out/index.d.ts +1 -0
- package/out/index.d.ts.map +1 -1
- package/out/index.js +1 -0
- package/out/install.js +1 -1
- package/out/locale/en/index.d.ts +26 -0
- package/out/locale/en/index.d.ts.map +1 -0
- package/out/locale/en/index.js +25 -0
- package/out/locale/index.d.ts +3 -0
- package/out/locale/index.d.ts.map +1 -0
- package/out/locale/index.js +2 -0
- package/out/locale/zh-CN/index.d.ts +26 -0
- package/out/locale/zh-CN/index.d.ts.map +1 -0
- package/out/locale/zh-CN/index.js +25 -0
- package/out/utils/bit-mask/bit-mask.d.ts.map +1 -1
- package/out/utils/bit-mask/bit-mask.js +1 -1
- package/out/utils/click-outside/click-outside.d.ts.map +1 -1
- package/out/utils/click-outside/click-outside.js +2 -2
- package/out/utils/history-list/history-item.js +1 -1
- package/out/utils/style/remote-style.js +1 -1
- package/out/utils/sync/count-latch.js +1 -1
- package/out/utils/upload/upload-file.d.ts.map +1 -1
- package/out/utils/upload/upload-file.js +4 -2
- package/out/utils/util/util.js +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -492,7 +492,7 @@ var CommandController = class {
|
|
|
492
492
|
if (command) {
|
|
493
493
|
return command.handler(...args);
|
|
494
494
|
}
|
|
495
|
-
throw new Error("
|
|
495
|
+
throw new Error(ibiz.i18n.t("core.command.unregisteredCommand", { id }));
|
|
496
496
|
}
|
|
497
497
|
/**
|
|
498
498
|
* 判断指令是否存在,可直接抛出异常
|
|
@@ -909,7 +909,7 @@ var HttpError = class extends Error {
|
|
|
909
909
|
this.message = res.statusText;
|
|
910
910
|
}
|
|
911
911
|
if (!this.message) {
|
|
912
|
-
this.message = "
|
|
912
|
+
this.message = ibiz.i18n.t("core.error.networkAbnormality");
|
|
913
913
|
}
|
|
914
914
|
this.status = res.status;
|
|
915
915
|
} else {
|
|
@@ -930,9 +930,14 @@ var ModelError = class extends Error {
|
|
|
930
930
|
* @param {string} [msg]
|
|
931
931
|
*/
|
|
932
932
|
constructor(model, msg) {
|
|
933
|
-
super(
|
|
933
|
+
super(
|
|
934
|
+
ibiz.i18n.t("core.error.modelMsg", {
|
|
935
|
+
id: model.id,
|
|
936
|
+
msg: msg ? "\uFF1A ".concat(msg) : ""
|
|
937
|
+
})
|
|
938
|
+
);
|
|
934
939
|
this.model = model;
|
|
935
|
-
this.name = "
|
|
940
|
+
this.name = ibiz.i18n.t("core.error.unsupportedModels");
|
|
936
941
|
}
|
|
937
942
|
};
|
|
938
943
|
|
|
@@ -956,9 +961,14 @@ var RuntimeModelError = class extends Error {
|
|
|
956
961
|
* @param {string} [msg] 缺失配置描述
|
|
957
962
|
*/
|
|
958
963
|
constructor(model, msg) {
|
|
959
|
-
super(
|
|
964
|
+
super(
|
|
965
|
+
ibiz.i18n.t("core.error.modelMsg", {
|
|
966
|
+
id: model.id,
|
|
967
|
+
msg: msg ? "\uFF1A ".concat(msg) : ""
|
|
968
|
+
})
|
|
969
|
+
);
|
|
960
970
|
this.model = model;
|
|
961
|
-
this.name = "
|
|
971
|
+
this.name = ibiz.i18n.t("core.error.modelConfigurationMissing");
|
|
962
972
|
}
|
|
963
973
|
};
|
|
964
974
|
|
|
@@ -1179,7 +1189,7 @@ function calcOpenModeStyle(value, type) {
|
|
|
1179
1189
|
if (value > 100) {
|
|
1180
1190
|
return type === "drawer" ? value : "".concat(value, "px");
|
|
1181
1191
|
}
|
|
1182
|
-
ibiz.log.error("
|
|
1192
|
+
ibiz.log.error(ibiz.i18n.t("core.utils.invalidInputValue"));
|
|
1183
1193
|
return "";
|
|
1184
1194
|
}
|
|
1185
1195
|
|
|
@@ -2467,7 +2477,7 @@ var _HistoryItem = class _HistoryItem {
|
|
|
2467
2477
|
* @return {*} {HistoryItem<E>}
|
|
2468
2478
|
*/
|
|
2469
2479
|
clone() {
|
|
2470
|
-
throw new RuntimeError("
|
|
2480
|
+
throw new RuntimeError(ibiz.i18n.t("core.utils.unrealized"));
|
|
2471
2481
|
}
|
|
2472
2482
|
};
|
|
2473
2483
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -2597,9 +2607,9 @@ var defaultWindow = typeof window !== "undefined" ? window : void 0;
|
|
|
2597
2607
|
function onClickOutside(target, handler, options = {}) {
|
|
2598
2608
|
const { window: window2 = defaultWindow, ignore = [], capture = true } = options;
|
|
2599
2609
|
if (!target)
|
|
2600
|
-
throw new RuntimeError("
|
|
2610
|
+
throw new RuntimeError(ibiz.i18n.t("core.utils.targetElement"));
|
|
2601
2611
|
if (!window2)
|
|
2602
|
-
throw new RuntimeError("
|
|
2612
|
+
throw new RuntimeError(ibiz.i18n.t("core.utils.cannotFindWindow"));
|
|
2603
2613
|
let shouldListen = true;
|
|
2604
2614
|
const isOutside = (event) => {
|
|
2605
2615
|
return ![target, ...ignore].some((el) => {
|
|
@@ -2858,7 +2868,7 @@ function uploadFile(_opts) {
|
|
|
2858
2868
|
files.forEach((file) => {
|
|
2859
2869
|
data.append("file", file);
|
|
2860
2870
|
});
|
|
2861
|
-
throw new RuntimeError("
|
|
2871
|
+
throw new RuntimeError(ibiz.i18n.t("core.utils.multiApplicationMode"));
|
|
2862
2872
|
};
|
|
2863
2873
|
const executeSingleUpload = async (files) => {
|
|
2864
2874
|
const resultFiles = files.map((file) => {
|
|
@@ -2897,7 +2907,11 @@ function uploadFile(_opts) {
|
|
|
2897
2907
|
file.error = error;
|
|
2898
2908
|
});
|
|
2899
2909
|
ibiz.log.error(error);
|
|
2900
|
-
ibiz.log.error(
|
|
2910
|
+
ibiz.log.error(
|
|
2911
|
+
ibiz.i18n.t("core.utils.uploadFailed", {
|
|
2912
|
+
file: files.map((file) => file.name).join(",")
|
|
2913
|
+
})
|
|
2914
|
+
);
|
|
2901
2915
|
}
|
|
2902
2916
|
return resultFiles;
|
|
2903
2917
|
};
|
|
@@ -3002,7 +3016,7 @@ var CountLatch = class {
|
|
|
3002
3016
|
*/
|
|
3003
3017
|
unlock() {
|
|
3004
3018
|
if (this.count < 1) {
|
|
3005
|
-
throw new RuntimeError("
|
|
3019
|
+
throw new RuntimeError(ibiz.i18n.t("core.utils.notMatchLockUnlock"));
|
|
3006
3020
|
}
|
|
3007
3021
|
this.count -= 1;
|
|
3008
3022
|
if (this.count === 0) {
|
|
@@ -3031,7 +3045,7 @@ async function setRemoteStyle(url) {
|
|
|
3031
3045
|
styleDom.innerText = res.data;
|
|
3032
3046
|
document.head.appendChild(styleDom);
|
|
3033
3047
|
} catch (error) {
|
|
3034
|
-
ibiz.log.debug("
|
|
3048
|
+
ibiz.log.debug(ibiz.i18n.t("core.utils.remoteStylesheet"), url);
|
|
3035
3049
|
}
|
|
3036
3050
|
}
|
|
3037
3051
|
|
|
@@ -3219,7 +3233,9 @@ function validate(permission) {
|
|
|
3219
3233
|
function validateAndThrow(permission) {
|
|
3220
3234
|
const isPowerOf2 = validate(permission);
|
|
3221
3235
|
if (!isPowerOf2) {
|
|
3222
|
-
throw new RuntimeError(
|
|
3236
|
+
throw new RuntimeError(
|
|
3237
|
+
ibiz.i18n.t("core.utils.powerOfTwo", { permission })
|
|
3238
|
+
);
|
|
3223
3239
|
}
|
|
3224
3240
|
}
|
|
3225
3241
|
function setPermission(allPermissions = 0, permission) {
|
|
@@ -3241,6 +3257,60 @@ var BitMask = {
|
|
|
3241
3257
|
checkPermission
|
|
3242
3258
|
};
|
|
3243
3259
|
|
|
3260
|
+
// src/locale/en/index.ts
|
|
3261
|
+
var en = {
|
|
3262
|
+
core: {
|
|
3263
|
+
command: {
|
|
3264
|
+
unregisteredCommand: "Unregistered command: {id}, please register the command first"
|
|
3265
|
+
},
|
|
3266
|
+
error: {
|
|
3267
|
+
networkAbnormality: "Network abnormality, please try again later",
|
|
3268
|
+
modelMsg: "\u300C{id}\u300D model {msg}",
|
|
3269
|
+
unsupportedModels: "Unsupported models",
|
|
3270
|
+
modelConfigurationMissing: "Model Configuration Missing"
|
|
3271
|
+
},
|
|
3272
|
+
utils: {
|
|
3273
|
+
powerOfTwo: "{permission} is not a power of two.",
|
|
3274
|
+
targetElement: "The target element does not exist",
|
|
3275
|
+
cannotFindWindow: "Cannot find window",
|
|
3276
|
+
unrealized: "unrealized",
|
|
3277
|
+
remoteStylesheet: "Failed to load remote stylesheet",
|
|
3278
|
+
notMatchLockUnlock: "The lock and unlock counts do not match!",
|
|
3279
|
+
multiApplicationMode: "Multi-application mode waiting for reimplementation requests",
|
|
3280
|
+
uploadFailed: "{file}Upload failed",
|
|
3281
|
+
invalidInputValue: "Invalid input value, must be >= 0"
|
|
3282
|
+
},
|
|
3283
|
+
noReInstall: "ibiz already exists, no need to re-install it"
|
|
3284
|
+
}
|
|
3285
|
+
};
|
|
3286
|
+
|
|
3287
|
+
// src/locale/zh-CN/index.ts
|
|
3288
|
+
var zhCn = {
|
|
3289
|
+
core: {
|
|
3290
|
+
command: {
|
|
3291
|
+
unregisteredCommand: "\u672A\u6CE8\u518C\u6307\u4EE4: {id}\uFF0C\u8BF7\u5148\u6CE8\u518C\u6307\u4EE4"
|
|
3292
|
+
},
|
|
3293
|
+
error: {
|
|
3294
|
+
networkAbnormality: "\u7F51\u7EDC\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5",
|
|
3295
|
+
modelMsg: "\u300C{id}\u300D\u6A21\u578B {msg}",
|
|
3296
|
+
unsupportedModels: "\u672A\u652F\u6301\u7684\u6A21\u578B",
|
|
3297
|
+
modelConfigurationMissing: "\u6A21\u578B\u914D\u7F6E\u7F3A\u5931"
|
|
3298
|
+
},
|
|
3299
|
+
utils: {
|
|
3300
|
+
powerOfTwo: "{permission}\u4E0D\u662F2\u7684\u5E42",
|
|
3301
|
+
targetElement: "target\u5143\u7D20\u4E0D\u5B58\u5728",
|
|
3302
|
+
cannotFindWindow: "\u627E\u4E0D\u5230window",
|
|
3303
|
+
unrealized: "\u672A\u5B9E\u73B0",
|
|
3304
|
+
remoteStylesheet: "\u672A\u5B9E\u73B0\u52A0\u8F7D\u8FDC\u7A0B\u6837\u5F0F\u8868\u5931\u8D25",
|
|
3305
|
+
notMatchLockUnlock: "lock\u548Cunlock\u6B21\u6570\u4E0D\u5339\u914D\uFF01",
|
|
3306
|
+
multiApplicationMode: "\u591A\u5E94\u7528\u6A21\u5F0F\u7B49\u5F85\u91CD\u65B0\u5B9E\u73B0\u8BF7\u6C42",
|
|
3307
|
+
uploadFailed: "{file}Upload failed",
|
|
3308
|
+
invalidInputValue: "\u65E0\u6548\u8F93\u5165\u503C\uFF0C\u5FC5\u987B>=0"
|
|
3309
|
+
},
|
|
3310
|
+
noReInstall: "ibiz \u5DF2\u7ECF\u5B58\u5728, \u65E0\u9700\u91CD\u590D\u5B89\u88C5"
|
|
3311
|
+
}
|
|
3312
|
+
};
|
|
3313
|
+
|
|
3244
3314
|
// src/utils/logger/logger.ts
|
|
3245
3315
|
import Logger from "loglevel";
|
|
3246
3316
|
import prefix from "loglevel-plugin-prefix";
|
|
@@ -3296,7 +3366,7 @@ var IBizSys = class {
|
|
|
3296
3366
|
// src/install.ts
|
|
3297
3367
|
function install() {
|
|
3298
3368
|
if (window.ibiz) {
|
|
3299
|
-
throw new Error(
|
|
3369
|
+
throw new Error(ibiz.i18n.t("core.noReInstall"));
|
|
3300
3370
|
}
|
|
3301
3371
|
window.ibiz = new IBizSys();
|
|
3302
3372
|
}
|
|
@@ -3345,6 +3415,7 @@ export {
|
|
|
3345
3415
|
debounceAndAsyncMerge,
|
|
3346
3416
|
debounceAndMerge,
|
|
3347
3417
|
downloadFileFromBlob,
|
|
3418
|
+
en,
|
|
3348
3419
|
eventPath,
|
|
3349
3420
|
fetchEventSource,
|
|
3350
3421
|
fileListToArr,
|
|
@@ -3369,5 +3440,6 @@ export {
|
|
|
3369
3440
|
toDisposable,
|
|
3370
3441
|
toNumberOrNil,
|
|
3371
3442
|
updateKeyDefine,
|
|
3372
|
-
uploadFile
|
|
3443
|
+
uploadFile,
|
|
3444
|
+
zhCn
|
|
3373
3445
|
};
|
package/dist/index.system.min.js
CHANGED
|
@@ -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,y;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){y=e.default}],execute:function(){function E(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:we,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(Ae,t||{}).deep)return o(e,Re);return c(e,Re)},colorBlend:function(e,t,n=.5,s="hex"){e=e.trim(),t=t.trim();const r=be(e),i=be(t),a=[ge((1-n)*r[0]+n*i[0]),ge((1-n)*r[1]+n*i[1]),ge((1-n)*r[2]+n*i[2]),(1-n)*r[3]+n*i[3]];if("hex"===s){const e=[a[0].toString(16).padStart(2,"0"),a[1].toString(16).padStart(2,"0"),a[2].toString(16).padStart(2,"0"),0===a[3]?"00":ge(255*a[3]).toString(16).padStart(2,"0")];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=we(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:he,fetchEventSource:R,fileListToArr:ye,findRecursiveChild:function(e,t,n){const{compareField:s,compareCallback:i}=r(Oe,n||{}),a=i||(e=>e[s]===t);let o;return xe(e,(e=>{if(a(e,t,s))return o=e,!0}),n),o},getToken:H,install:function(){if(window.ibiz)throw new Error("ibiz 已经存在, 无需重复安装");window.ibiz=new Ie},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:de,isImage:function(e){const t=e.includes(".")?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 K.test(e)},listenJSEvent:ue,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=fe,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=>de(t,e)));let c=!1;let l;const h=e=>{c||(s.clearTimeout(l),a&&o(e)&&t(e))},u=[ue(s,"click",h,{passive:!0,capture:i}),ue(s,"pointerdown",(e=>{c||(a=o(e))}),{passive:!0}),ue(s,"pointerup",(e=>{if(!c&&0===e.button){const t=he(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:xe,selectFile:Ee,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};Ee({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 v=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=v(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||v()}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,y=null!=r?r:A;async function v(){var n;p=new AbortController;try{const n=await w(e,Object.assign(Object.assign({},h),{headers:d,signal:p.signal}));await y(n),await async function(e,t){const n=e.getReader();let s;for(;!(s=await n.read()).done;)t(s.value)}(n.body,E(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(v,t)}catch(e){b(),u(e)}}}v()}))}function A(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 T=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};T.Undefined=new T(void 0);var C=T,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}}),S=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)}}),P=(e("commands",new S),e("CoreConst",class{}));P.DEFAULT_MODEL_SERVICE_TAG="default",P.TOKEN="ibzuaa-token",P.REFRESH_TOKEN="ibzuaa-refresh-token",P.TOKEN_EXPIRES="ibzuaa-token-expires",P.TOKEN_REMEMBER="ibizuaa-token-remember",P.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,configurable:!0,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,configurable:!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,this.tag="",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"}})),q=(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"}}),e("EntityError",class extends z{constructor(e){if(super(e),this.name="EntityError",this.details=[],this.response){const{details:e=[]}=this.response.data;this.details=e.map((e=>({name:e.fieldname.toLowerCase(),logicName:e.fieldlogicname,errorType:e.fielderrortype,errorInfo:e.fielderrorinfo})))}}})),F=e("HttpErrorFactory",class{static getInstance(e){const{response:t}=e;if(!t||!t.data)return new z(e);const{type:n}=t.data;return"EntityException"===n?new q(e):new z(e)}});function H(){return d(P.TOKEN)}var K=/<svg\b[^>]*>[\s\S]*?<\/svg>/;var V=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)}}),W=e("CoreInterceptor",class extends V{async onBeforeRequest(e){e=await super.onBeforeRequest(e);const{headers:t}=e;t.set("Authorization","Bearer ".concat(H()));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}}),Y=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)}},J=class extends Y{},$=class extends Y{sendCommand(e,t,n){const s={messageid:m(),messagename:"command",type:"COMMAND",subtype:t,triggerKey:n,data:e};this.next(s)}},G=class extends ${send(e,t){this.sendCommand(e,"OBJECTCREATED",null==t?void 0:t.triggerKey)}},X=class extends ${send(e,t){this.sendCommand(e,"OBJECTUPDATED",null==t?void 0:t.triggerKey)}},Z=class extends ${send(e,t){this.sendCommand(e,"OBJECTREMOVED",null==t?void 0:t.triggerKey)}},Q=class extends ${},ee=class extends ${send(e){this.sendCommand(e,"ASYNCACTION")}},te=class extends ${send(e){this.sendCommand(e,"INTERNALMESSAGE")}},ne=class extends ${send(e){this.sendCommand(e,"MARKOPENDATA")}},se=class extends Y{constructor(){super(...arguments),this.change=new Q,this.create=new G(this),this.update=new X(this),this.remove=new Z(this),this.asyncAction=new ee(this),this.internalMessage=new te(this),this.markOpenData=new ne(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;case"MARKOPENDATA":this.markOpenData.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,n){const s={messageid:m(),messagename:"command",type:"COMMAND",subtype:t,triggerKey:n,data:e};this.next(s)}},re=class extends Y{send(e){const t={messageid:m(),messagename:"console",type:"CONSOLE",data:e};this.next(t)}},ie=class extends Y{send(e){const t={messageid:m(),messagename:"error",type:"ERROR",data:e};this.next(t)}},ae=e("MessageCenter",class{constructor(){this.all=new J,this.command=new se(this.all),this.console=new re(this.all),this.error=new ie(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 oe(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 oe(this.namespace,this.block,e,"","")}e(e){return e?oe(this.namespace,this.block,"",e,""):""}m(e){return e?oe(this.namespace,this.block,"","",e):""}be(e,t){return e&&t?oe(this.namespace,this.block,e,t,""):""}em(e,t){return e&&t?oe(this.namespace,this.block,"",e,t):""}bm(e,t){return e&&t?oe(this.namespace,this.block,e,"",t):""}bem(e,t,n){return e&&t&&n?oe(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 ce=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 W)}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,t);try{const n=await this.request(e,{method:"post",data:t,headers:s});return this.doResponseResult(n)}catch(e){throw F.getInstance(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 F.getInstance(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 F.getInstance(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 F.getInstance(e)}}async getModel(e,t={}){try{const n=await this.instance.get(e,{headers:t});return this.doResponseResult(n)}catch(e){throw F.getInstance(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),F.getInstance(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(H());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,n={}){return n&&Object.prototype.hasOwnProperty.call(n,"srfversionid")&&(t.srfversionid=n.srfversionid),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}}),le=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}});le.contextReg=/\$\{context.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g,le.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 he(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 ue(e,t,n,s={}){e.addEventListener(t,n,s);let r=()=>{e.removeEventListener(t,n,s),r=k};return()=>{r()}}function de(e,t){return t&&(e.target===t||he(e).includes(t))}var pe=class e{constructor(t={}){this.data=t,this._prev=e.Undefined,this._next=e.Undefined}clone(){throw new B("未实现")}};pe.Undefined=new pe(void 0);var me=e("HistoryItem",pe),fe=(e("HistoryList",class e{get data(){return this._cur.data}constructor(e){this._cur=new me(e)}assign(e){e&&(this.save(),Object.assign(this._cur.data,e))}save(){const e=this._cur,n=t(e.data),s=new me(n);s._prev=e,e._next._prev=me.Undefined,this._clear(e._next),e._next=s,this._cur=s}prev(){return!(!this._cur._prev||this._cur._prev===me.Undefined)&&(this._cur=this._cur._prev,!0)}next(){return!(!this._cur._next||this._cur._next===me.Undefined)&&(this._cur=this._cur._next,!0)}_clear(e){e._prev&&e._prev!==me.Undefined&&(e._prev._next=me.Undefined,this._clear(e._prev),e._prev=me.Undefined),e._next&&e._next!==me.Undefined&&(e._next._prev=me.Undefined,this._clear(e._next),e._next=me.Undefined),e.data={}}clone(){return new e({})._cur=t(this._cur),this}destroy(){this._clear(this._cur)}}),"undefined"!=typeof window?window:void 0);var ge=Math.round;function be(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?ge((s>>24&255)/255*1e4)/1e4:1}return n}function we(e){let t="";switch(e.includes(".")?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 ye(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t}function Ee(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);let s=!0;n.onchange=e=>{const n=e.target,r=n.files?ye(n.files):[];0!==r.length&&(s=!1,t.onSelected(r),n.value="")},document.body.appendChild(n),n.click(),window.addEventListener("focus",(()=>{setTimeout((()=>{s&&t.onCancel&&t.onCancel()}),300)}),{once:!0}),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 ve={childrenFields:["children"]},_e=new Error("中断操作");function xe(e,t,n){try{!function(e,t,n){const{childrenFields:s}=r(ve,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 s of i){if(t(s,e))throw _e;xe(s,t,n)}}(e,t,n)}catch(e){if(e!==_e)throw e}}var Oe={...ve,compareField:"name"};function Re(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 Ae={deep:!0};function Te(e){return!(!e||e&e-1)}function Ce(e){if(!Te(e))throw new B("".concat(e,"不是2的幂"))}e("BitMask",{validate:Te,setPermission:function(e=0,t){return Ce(t),e|t},removePermission:function(e=0,t){return Ce(t),e&~t},checkPermission:function(e=0,t){return Ce(t),0!=(e&t)}});var Ue=w.noConflict();y.reg(Ue),y.apply(Ue);var Ie=e("IBizSys",class{constructor(){this.env=D,this.log=Ue,this.net=new ce,this.commands=new S,this.mc=new ae}})}}}));
|
|
1
|
+
System.register(["ramda","lodash-es","qx-util","axios","qs","loglevel","loglevel-plugin-prefix"],(function(e){"use strict";var t,n,s,r,i,o,a,c,l,d,u,h,p,m,f,g,b,w,y;return{setters:[function(e){t=e.clone,n=e.isNotNil,s=e.isNil,r=e.mergeDeepRight},function(e){i=e.debounce,o=e.merge,a=e.cloneDeepWith,c=e.cloneWith,l=e.isObject,d=e.isFunction,u=e.uniqueId,e.round,e.cloneDeep},function(e){h=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){y=e.default}],execute:function(){function v(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 o=t.length;let a=0;for(;n<o;){r&&(10===t[n]&&(a=++n),r=!1);let i=-1;for(;n<o&&-1===i;++n)switch(t[n]){case 58:-1===s&&(s=n-a);break;case 13:r=!0;case 10:i=n}if(-1===i)break;e(t.subarray(a,i),s),a=n,s=-1}a===o?t=void 0:0!==a&&(t=t.subarray(a),n-=a)}}e({awaitTimeout:async function(e,t,n){if(await new Promise((t=>{setTimeout((()=>{t(!0)}),e)})),t)return t(...n||[])},calcMimeByFileName:we,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(ibiz.i18n.t("core.utils.invalidInputValue")),""},clone:function(e,t){if(r(Ae,t||{}).deep)return a(e,Re);return c(e,Re)},colorBlend:function(e,t,n=.5,s="hex"){e=e.trim(),t=t.trim();const r=be(e),i=be(t),o=[ge((1-n)*r[0]+n*i[0]),ge((1-n)*r[1]+n*i[1]),ge((1-n)*r[2]+n*i[2]),(1-n)*r[3]+n*i[3]];if("hex"===s){const e=[o[0].toString(16).padStart(2,"0"),o[1].toString(16).padStart(2,"0"),o[2].toString(16).padStart(2,"0"),0===o[3]?"00":ge(255*o[3]).toString(16).padStart(2,"0")];return"#".concat(e[0]).concat(e[1]).concat(e[2]).concat(e[3])}return"rgb(".concat(o[0]," ").concat(o[1]," ").concat(o[2]," / ").concat(o[3],")")},compareArr:function(e,t,n){const s=new Set([...e,...t]),r=[],i=[],o=[];if(n){const a=e.map((e=>e[n])),c=t.map((e=>e[n]));s.forEach((e=>{a.includes(e[n])?c.includes(e[n])?o.push(e):r.push(e):i.push(e)}))}else s.forEach((n=>{e.includes(n)?t.includes(n)?o.push(n):r.push(n):i.push(n)}));return{more:r,less:i,same:o}},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 o=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,o(...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=we(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:de,fetchEventSource:R,fileListToArr:ye,findRecursiveChild:function(e,t,n){const{compareField:s,compareCallback:i}=r(Oe,n||{}),o=i||(e=>e[s]===t);let a;return xe(e,(e=>{if(o(e,t,s))return a=e,!0}),n),a},getToken:H,install:function(){if(window.ibiz)throw new Error(ibiz.i18n.t("core.noReInstall"));window.ibiz=new Ue},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:he,isImage:function(e){const t=e.includes(".")?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 V.test(e)},listenJSEvent:ue,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=fe,ignore:r=[],capture:i=!0}=n;if(!e)throw new B(ibiz.i18n.t("core.utils.targetElement"));if(!s)throw new B(ibiz.i18n.t("core.utils.cannotFindWindow"));let o=!0;const a=t=>![e,...r].some((e=>he(t,e)));let c=!1;let l;const d=e=>{c||(s.clearTimeout(l),o&&a(e)&&t(e))},u=[ue(s,"click",d,{passive:!0,capture:i}),ue(s,"pointerdown",(e=>{c||(o=a(e))}),{passive:!0}),ue(s,"pointerup",(e=>{if(!c&&0===e.button){const t=de(e);e.composedPath=()=>t,l=s.setTimeout((()=>d(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:xe,selectFile:ve,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(ibiz.i18n.t("core.utils.remoteStylesheet"),e)}},throttle:function(e,t){let n=null;return function(...s){n||(n=setTimeout((()=>{e.apply(this,s),n=null}),t))}},toDisposable:I,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=o({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&&d(t.request))return t.request(e);const s=new FormData;throw e.forEach((e=>{s.append("file",e)})),new B(ibiz.i18n.t("core.utils.multiApplicationMode"))})(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(ibiz.i18n.t("core.utils.uploadFailed",{file:e.map((e=>e.name)).join(",")}))}return n};ve({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:o,onerror:a,openWhenHidden:c,fetch:l}=t,d=E(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise(((t,u)=>{const h=Object.assign({},s);let p;function m(){p.abort(),document.hidden||E()}h.accept||(h.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,y=null!=r?r:A;async function E(){var n;p=new AbortController;try{const n=await w(e,Object.assign(Object.assign({},d),{headers:h,signal:p.signal}));await y(n),await async function(e,t){const n=e.getReader();let s;for(;!(s=await n.read()).done;)t(s.value)}(n.body,v(function(e,t,n){let s={data:"",event:"",id:"",retry:void 0};const r=new TextDecoder;return function(i,o){if(0===i.length)null==n||n(s),s={data:"",event:"",id:"",retry:void 0};else if(o>0){const n=r.decode(i.subarray(0,o)),a=o+(32===i[o+1]?2:1),c=r.decode(i.subarray(a));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?h[O]=e:delete h[O]}),(e=>{f=e}),i))),null==o||o(),b(),t()}catch(e){if(!p.signal.aborted)try{const t=null!==(n=null==a?void 0:a(e))&&void 0!==n?n:f;window.clearTimeout(g),g=window.setTimeout(E,t)}catch(e){b(),u(e)}}}E()}))}function A(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 T=C,M=e("LinkedList",class{constructor(){this._first=T.Undefined,this._last=T.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===T.Undefined}clear(){let e=this._first;for(;e!==T.Undefined;){const{next:t}=e;e.prev=T.Undefined,e.next=T.Undefined,e=t}this._first=T.Undefined,this._last=T.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const n=new T(e);if(this._first===T.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===T.Undefined)return;const e=this._first.element;return this._remove(this._first),e}pop(){if(this._last===T.Undefined)return;const e=this._last.element;return this._remove(this._last),e}_remove(e){if(e.prev!==T.Undefined&&e.next!==T.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===T.Undefined&&e.next===T.Undefined?(this._first=T.Undefined,this._last=T.Undefined):e.next===T.Undefined?(this._last=this._last.prev,this._last.next=T.Undefined):e.prev===T.Undefined&&(this._first=this._first.next,this._first.prev=T.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==T.Undefined;)yield e.element,e=e.next}});function U(e){const t=this;let n,s=!1;return function(){return s||(s=!0,n=e.apply(t,arguments)),n}}function I(e){return{dispose:U((()=>{e()}))}}var k=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 M,this.commands.set(s,r));const i=r.unshift(e);return I((()=>{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 k}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(ibiz.i18n.t("core.command.unregisteredCommand",{id: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 N),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 P=e("NOOP",(()=>{})),z=(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))(z||{}))),L=e("MenuPermissionMode",(e=>(e.MIXIN="MIXIN",e.RESOURCE="RESOURCE",e.RT="RT",e))(L||{})),j=(e("IBizContext",class e{constructor(e={},t){Object.defineProperty(this,"_associationContext",{enumerable:!1,configurable:!0,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,configurable:!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"})),D=e("HttpError",class extends Error{constructor(e){super("HttpError"),this.name="HttpError";const t=e.response;this.response=e.response,this.tag="",t?(t.data?this.message=t.data.message:this.message=t.statusText,this.message||(this.message=ibiz.i18n.t("core.error.networkAbnormality")),this.status=t.status):(this.message=e.message||"",this.status=500)}}),B=(e("ModelError",class extends Error{constructor(e,t){super(ibiz.i18n.t("core.error.modelMsg",{id:e.id,msg:t?": ".concat(t):""})),this.model=e,this.name=ibiz.i18n.t("core.error.unsupportedModels")}}),e("RuntimeError",class extends Error{constructor(e){super(e),this.message=e,this.name="Runtime Error"}})),q=(e("RuntimeModelError",class extends Error{constructor(e,t){super(ibiz.i18n.t("core.error.modelMsg",{id:e.id,msg:t?": ".concat(t):""})),this.model=e,this.name=ibiz.i18n.t("core.error.modelConfigurationMissing")}}),e("NoticeError",class extends Error{constructor(e,t){super(e),this.message=e,this.duration=t,this.name="notice Error"}}),e("EntityError",class extends D{constructor(e){if(super(e),this.name="EntityError",this.details=[],this.response){const{details:e=[]}=this.response.data;this.details=e.map((e=>({name:e.fieldname.toLowerCase(),logicName:e.fieldlogicname,errorType:e.fielderrortype,errorInfo:e.fielderrorinfo})))}}})),F=e("HttpErrorFactory",class{static getInstance(e){const{response:t}=e;if(!t||!t.data)return new D(e);const{type:n}=t.data;return"EntityException"===n?new q(e):new D(e)}});function H(){return h(S.TOKEN)}var V=/<svg\b[^>]*>[\s\S]*?<\/svg>/;var W=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)}}),K=e("CoreInterceptor",class extends W{async onBeforeRequest(e){e=await super.onBeforeRequest(e);const{headers:t}=e;t.set("Authorization","Bearer ".concat(H()));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}}),Y=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)}},J=class extends Y{},$=class extends Y{sendCommand(e,t,n){const s={messageid:m(),messagename:"command",type:"COMMAND",subtype:t,triggerKey:n,data:e};this.next(s)}},G=class extends ${send(e,t){this.sendCommand(e,"OBJECTCREATED",null==t?void 0:t.triggerKey)}},X=class extends ${send(e,t){this.sendCommand(e,"OBJECTUPDATED",null==t?void 0:t.triggerKey)}},Z=class extends ${send(e,t){this.sendCommand(e,"OBJECTREMOVED",null==t?void 0:t.triggerKey)}},Q=class extends ${},ee=class extends ${send(e){this.sendCommand(e,"ASYNCACTION")}},te=class extends ${send(e){this.sendCommand(e,"INTERNALMESSAGE")}},ne=class extends ${send(e){this.sendCommand(e,"MARKOPENDATA")}},se=class extends Y{constructor(){super(...arguments),this.change=new Q,this.create=new G(this),this.update=new X(this),this.remove=new Z(this),this.asyncAction=new ee(this),this.internalMessage=new te(this),this.markOpenData=new ne(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;case"MARKOPENDATA":this.markOpenData.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,n){const s={messageid:m(),messagename:"command",type:"COMMAND",subtype:t,triggerKey:n,data:e};this.next(s)}},re=class extends Y{send(e){const t={messageid:m(),messagename:"console",type:"CONSOLE",data:e};this.next(t)}},ie=class extends Y{send(e){const t={messageid:m(),messagename:"error",type:"ERROR",data:e};this.next(t)}},oe=e("MessageCenter",class{constructor(){this.all=new J,this.command=new se(this.all),this.console=new re(this.all),this.error=new ie(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 ae(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 ae(this.namespace,this.block,e,"","")}e(e){return e?ae(this.namespace,this.block,"",e,""):""}m(e){return e?ae(this.namespace,this.block,"","",e):""}be(e,t){return e&&t?ae(this.namespace,this.block,e,t,""):""}em(e,t){return e&&t?ae(this.namespace,this.block,"",e,t):""}bm(e,t){return e&&t?ae(this.namespace,this.block,e,"",t):""}bem(e,t,n){return e&&t&&n?ae(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 ce=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 K)}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,o(t,...e)}async post(e,t,n={},s={}){e=this.handleAppPresetParam(e,n,t);try{const n=await this.request(e,{method:"post",data:t,headers:s});return this.doResponseResult(n)}catch(e){throw F.getInstance(e)}}async get(e,t={},n={},s={}){e=this.attachUrlParam(e,t);try{const t=await this.request(e,o({method:"get",headers:n},s));return this.doResponseResult(t)}catch(e){throw F.getInstance(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 F.getInstance(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 F.getInstance(e)}}async getModel(e,t={}){try{const n=await this.instance.get(e,{headers:t});return this.doResponseResult(n)}catch(e){throw F.getInstance(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),F.getInstance(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(H());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,n={}){return n&&Object.prototype.hasOwnProperty.call(n,"srfversionid")&&(t.srfversionid=n.srfversionid),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}}),le=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}});le.contextReg=/\$\{context.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g,le.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 de(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 ue(e,t,n,s={}){e.addEventListener(t,n,s);let r=()=>{e.removeEventListener(t,n,s),r=P};return()=>{r()}}function he(e,t){return t&&(e.target===t||de(e).includes(t))}var pe=class e{constructor(t={}){this.data=t,this._prev=e.Undefined,this._next=e.Undefined}clone(){throw new B(ibiz.i18n.t("core.utils.unrealized"))}};pe.Undefined=new pe(void 0);var me=e("HistoryItem",pe),fe=(e("HistoryList",class e{get data(){return this._cur.data}constructor(e){this._cur=new me(e)}assign(e){e&&(this.save(),Object.assign(this._cur.data,e))}save(){const e=this._cur,n=t(e.data),s=new me(n);s._prev=e,e._next._prev=me.Undefined,this._clear(e._next),e._next=s,this._cur=s}prev(){return!(!this._cur._prev||this._cur._prev===me.Undefined)&&(this._cur=this._cur._prev,!0)}next(){return!(!this._cur._next||this._cur._next===me.Undefined)&&(this._cur=this._cur._next,!0)}_clear(e){e._prev&&e._prev!==me.Undefined&&(e._prev._next=me.Undefined,this._clear(e._prev),e._prev=me.Undefined),e._next&&e._next!==me.Undefined&&(e._next._prev=me.Undefined,this._clear(e._next),e._next=me.Undefined),e.data={}}clone(){return new e({})._cur=t(this._cur),this}destroy(){this._clear(this._cur)}}),"undefined"!=typeof window?window:void 0);var ge=Math.round;function be(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?ge((s>>24&255)/255*1e4)/1e4:1}return n}function we(e){let t="";switch(e.includes(".")?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 ye(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t}function ve(e){const t=o({multiple:!0,accept:""},e),n=document.createElement("input");n.setAttribute("type","file"),n.setAttribute("multiple","".concat(t.multiple)),n.setAttribute("accept",t.accept);let s=!0;n.onchange=e=>{const n=e.target,r=n.files?ye(n.files):[];0!==r.length&&(s=!1,t.onSelected(r),n.value="")},document.body.appendChild(n),n.click(),window.addEventListener("focus",(()=>{setTimeout((()=>{s&&t.onCancel&&t.onCancel()}),300)}),{once:!0}),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(ibiz.i18n.t("core.utils.notMatchLockUnlock"));this.count-=1,0===this.count&&this.endPromise()}async await(){this.promise&&await this.promise}});var Ee={childrenFields:["children"]},_e=new Error("中断操作");function xe(e,t,n){try{!function(e,t,n){const{childrenFields:s}=r(Ee,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 s of i){if(t(s,e))throw _e;xe(s,t,n)}}(e,t,n)}catch(e){if(e!==_e)throw e}}var Oe={...Ee,compareField:"name"};function Re(e){if(l(e)&&d(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 Ae={deep:!0};function Ce(e){return!(!e||e&e-1)}function Te(e){if(!Ce(e))throw new B(ibiz.i18n.t("core.utils.powerOfTwo",{permission:e}))}e("BitMask",{validate:Ce,setPermission:function(e=0,t){return Te(t),e|t},removePermission:function(e=0,t){return Te(t),e&~t},checkPermission:function(e=0,t){return Te(t),0!=(e&t)}}),e("en",{core:{command:{unregisteredCommand:"Unregistered command: {id}, please register the command first"},error:{networkAbnormality:"Network abnormality, please try again later",modelMsg:"「{id}」 model {msg}",unsupportedModels:"Unsupported models",modelConfigurationMissing:"Model Configuration Missing"},utils:{powerOfTwo:"{permission} is not a power of two.",targetElement:"The target element does not exist",cannotFindWindow:"Cannot find window",unrealized:"unrealized",remoteStylesheet:"Failed to load remote stylesheet",notMatchLockUnlock:"The lock and unlock counts do not match!",multiApplicationMode:"Multi-application mode waiting for reimplementation requests",uploadFailed:"{file}Upload failed",invalidInputValue:"Invalid input value, must be >= 0"},noReInstall:"ibiz already exists, no need to re-install it"}}),e("zhCn",{core:{command:{unregisteredCommand:"未注册指令: {id},请先注册指令"},error:{networkAbnormality:"网络异常,请稍后重试",modelMsg:"「{id}」模型 {msg}",unsupportedModels:"未支持的模型",modelConfigurationMissing:"模型配置缺失"},utils:{powerOfTwo:"{permission}不是2的幂",targetElement:"target元素不存在",cannotFindWindow:"找不到window",unrealized:"未实现",remoteStylesheet:"未实现加载远程样式表失败",notMatchLockUnlock:"lock和unlock次数不匹配!",multiApplicationMode:"多应用模式等待重新实现请求",uploadFailed:"{file}Upload failed",invalidInputValue:"无效输入值,必须>=0"},noReInstall:"ibiz 已经存在, 无需重复安装"}});var Me=w.noConflict();y.reg(Me),y.apply(Me);var Ue=e("IBizSys",class{constructor(){this.env=j,this.log=Me,this.net=new ce,this.commands=new N,this.mc=new oe}})}}}));
|
package/out/command/command.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-error.d.ts","sourceRoot":"","sources":["../../../src/error/model-error/model-error.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,UAAW,SAAQ,KAAK;IAY1B,KAAK,EAAE,KAAK;IAXrB,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"model-error.d.ts","sourceRoot":"","sources":["../../../src/error/model-error/model-error.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,UAAW,SAAQ,KAAK;IAY1B,KAAK,EAAE,KAAK;IAXrB,IAAI,EAAE,MAAM,CAA+C;IAE3D;;;;;;;OAOG;gBAEM,KAAK,EAAE,KAAK,EACnB,GAAG,CAAC,EAAE,MAAM;CASf"}
|
|
@@ -16,8 +16,11 @@ export class ModelError extends Error {
|
|
|
16
16
|
* @param {string} [msg]
|
|
17
17
|
*/
|
|
18
18
|
constructor(model, msg) {
|
|
19
|
-
super(
|
|
19
|
+
super(ibiz.i18n.t('core.error.modelMsg', {
|
|
20
|
+
id: model.id,
|
|
21
|
+
msg: msg ? `: ${msg}` : '',
|
|
22
|
+
}));
|
|
20
23
|
this.model = model;
|
|
21
|
-
this.name = '
|
|
24
|
+
this.name = ibiz.i18n.t('core.error.unsupportedModels');
|
|
22
25
|
}
|
|
23
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-model-error.d.ts","sourceRoot":"","sources":["../../../src/error/runtime-model-error/runtime-model-error.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAYjC,KAAK,EAAE,KAAK;IAXrB,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"runtime-model-error.d.ts","sourceRoot":"","sources":["../../../src/error/runtime-model-error/runtime-model-error.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAYjC,KAAK,EAAE,KAAK;IAXrB,IAAI,EAAE,MAAM,CAAuD;IAEnE;;;;;;;OAOG;gBAEM,KAAK,EAAE,KAAK,EACnB,GAAG,CAAC,EAAE,MAAM;CASf"}
|
|
@@ -17,8 +17,11 @@ export class RuntimeModelError extends Error {
|
|
|
17
17
|
* @param {string} [msg] 缺失配置描述
|
|
18
18
|
*/
|
|
19
19
|
constructor(model, msg) {
|
|
20
|
-
super(
|
|
20
|
+
super(ibiz.i18n.t('core.error.modelMsg', {
|
|
21
|
+
id: model.id,
|
|
22
|
+
msg: msg ? `: ${msg}` : '',
|
|
23
|
+
}));
|
|
21
24
|
this.model = model;
|
|
22
|
-
this.name = '
|
|
25
|
+
this.name = ibiz.i18n.t('core.error.modelConfigurationMissing');
|
|
23
26
|
}
|
|
24
27
|
}
|
package/out/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { Environment } from './environment/environment';
|
|
|
8
8
|
export * from './error';
|
|
9
9
|
export * from './interface';
|
|
10
10
|
export * from './utils';
|
|
11
|
+
export * from './locale';
|
|
11
12
|
export { IBizSys } from './ibizsys';
|
|
12
13
|
export { install } from './install';
|
|
13
14
|
//# sourceMappingURL=index.d.ts.map
|
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAC;AAEjB,cAAc,+BAA+B,CAAC;AAE9C,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,CAAC;AAEjB,cAAc,+BAA+B,CAAC;AAE9C,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
package/out/index.js
CHANGED
package/out/install.js
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const en: {
|
|
2
|
+
core: {
|
|
3
|
+
command: {
|
|
4
|
+
unregisteredCommand: string;
|
|
5
|
+
};
|
|
6
|
+
error: {
|
|
7
|
+
networkAbnormality: string;
|
|
8
|
+
modelMsg: string;
|
|
9
|
+
unsupportedModels: string;
|
|
10
|
+
modelConfigurationMissing: string;
|
|
11
|
+
};
|
|
12
|
+
utils: {
|
|
13
|
+
powerOfTwo: string;
|
|
14
|
+
targetElement: string;
|
|
15
|
+
cannotFindWindow: string;
|
|
16
|
+
unrealized: string;
|
|
17
|
+
remoteStylesheet: string;
|
|
18
|
+
notMatchLockUnlock: string;
|
|
19
|
+
multiApplicationMode: string;
|
|
20
|
+
uploadFailed: string;
|
|
21
|
+
invalidInputValue: string;
|
|
22
|
+
};
|
|
23
|
+
noReInstall: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/locale/en/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;CA0Bd,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export const en = {
|
|
2
|
+
core: {
|
|
3
|
+
command: {
|
|
4
|
+
unregisteredCommand: 'Unregistered command: {id}, please register the command first',
|
|
5
|
+
},
|
|
6
|
+
error: {
|
|
7
|
+
networkAbnormality: 'Network abnormality, please try again later',
|
|
8
|
+
modelMsg: '「{id}」 model {msg}',
|
|
9
|
+
unsupportedModels: 'Unsupported models',
|
|
10
|
+
modelConfigurationMissing: 'Model Configuration Missing',
|
|
11
|
+
},
|
|
12
|
+
utils: {
|
|
13
|
+
powerOfTwo: '{permission} is not a power of two.',
|
|
14
|
+
targetElement: 'The target element does not exist',
|
|
15
|
+
cannotFindWindow: 'Cannot find window',
|
|
16
|
+
unrealized: 'unrealized',
|
|
17
|
+
remoteStylesheet: 'Failed to load remote stylesheet',
|
|
18
|
+
notMatchLockUnlock: 'The lock and unlock counts do not match!',
|
|
19
|
+
multiApplicationMode: 'Multi-application mode waiting for reimplementation requests',
|
|
20
|
+
uploadFailed: '{file}Upload failed',
|
|
21
|
+
invalidInputValue: 'Invalid input value, must be >= 0',
|
|
22
|
+
},
|
|
23
|
+
noReInstall: 'ibiz already exists, no need to re-install it',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/locale/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const zhCn: {
|
|
2
|
+
core: {
|
|
3
|
+
command: {
|
|
4
|
+
unregisteredCommand: string;
|
|
5
|
+
};
|
|
6
|
+
error: {
|
|
7
|
+
networkAbnormality: string;
|
|
8
|
+
modelMsg: string;
|
|
9
|
+
unsupportedModels: string;
|
|
10
|
+
modelConfigurationMissing: string;
|
|
11
|
+
};
|
|
12
|
+
utils: {
|
|
13
|
+
powerOfTwo: string;
|
|
14
|
+
targetElement: string;
|
|
15
|
+
cannotFindWindow: string;
|
|
16
|
+
unrealized: string;
|
|
17
|
+
remoteStylesheet: string;
|
|
18
|
+
notMatchLockUnlock: string;
|
|
19
|
+
multiApplicationMode: string;
|
|
20
|
+
uploadFailed: string;
|
|
21
|
+
invalidInputValue: string;
|
|
22
|
+
};
|
|
23
|
+
noReInstall: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/locale/zh-CN/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;CAwBhB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export const zhCn = {
|
|
2
|
+
core: {
|
|
3
|
+
command: {
|
|
4
|
+
unregisteredCommand: '未注册指令: {id},请先注册指令',
|
|
5
|
+
},
|
|
6
|
+
error: {
|
|
7
|
+
networkAbnormality: '网络异常,请稍后重试',
|
|
8
|
+
modelMsg: '「{id}」模型 {msg}',
|
|
9
|
+
unsupportedModels: '未支持的模型',
|
|
10
|
+
modelConfigurationMissing: '模型配置缺失',
|
|
11
|
+
},
|
|
12
|
+
utils: {
|
|
13
|
+
powerOfTwo: '{permission}不是2的幂',
|
|
14
|
+
targetElement: 'target元素不存在',
|
|
15
|
+
cannotFindWindow: '找不到window',
|
|
16
|
+
unrealized: '未实现',
|
|
17
|
+
remoteStylesheet: '未实现加载远程样式表失败',
|
|
18
|
+
notMatchLockUnlock: 'lock和unlock次数不匹配!',
|
|
19
|
+
multiApplicationMode: '多应用模式等待重新实现请求',
|
|
20
|
+
uploadFailed: '{file}Upload failed',
|
|
21
|
+
invalidInputValue: '无效输入值,必须>=0',
|
|
22
|
+
},
|
|
23
|
+
noReInstall: 'ibiz 已经存在, 无需重复安装',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bit-mask.d.ts","sourceRoot":"","sources":["../../../src/utils/bit-mask/bit-mask.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;GAaG;AACH,iBAAS,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAE7C;
|
|
1
|
+
{"version":3,"file":"bit-mask.d.ts","sourceRoot":"","sources":["../../../src/utils/bit-mask/bit-mask.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;GAaG;AACH,iBAAS,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAE7C;AAmBD;;;;;;;;;;;;;;;GAeG;AACH,iBAAS,aAAa,CAAC,cAAc,oBAAY,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAG7E;AAED;;;;;;;;;;;;;;GAcG;AACH,iBAAS,gBAAgB,CACvB,cAAc,oBAAY,EAC1B,UAAU,EAAE,MAAM,GACjB,MAAM,CAGR;AAED;;;;;;;;;;;;;;;GAeG;AACH,iBAAS,eAAe,CACtB,cAAc,oBAAY,EAC1B,UAAU,EAAE,MAAM,GACjB,OAAO,CAGT;AAED,eAAO,MAAM,OAAO;;;;;CAKnB,CAAC"}
|
|
@@ -29,7 +29,7 @@ function validate(permission) {
|
|
|
29
29
|
function validateAndThrow(permission) {
|
|
30
30
|
const isPowerOf2 = validate(permission);
|
|
31
31
|
if (!isPowerOf2) {
|
|
32
|
-
throw new RuntimeError(
|
|
32
|
+
throw new RuntimeError(ibiz.i18n.t('core.utils.powerOfTwo', { permission }));
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"click-outside.d.ts","sourceRoot":"","sources":["../../../src/utils/click-outside/click-outside.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AAKzB;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,qBAAqB,EAC9B,OAAO,GAAE,qBAA0B,GAClC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"click-outside.d.ts","sourceRoot":"","sources":["../../../src/utils/click-outside/click-outside.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AAKzB;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,qBAAqB,EAC9B,OAAO,GAAE,qBAA0B,GAClC,oBAAoB,CAqFtB"}
|
|
@@ -15,9 +15,9 @@ const defaultWindow = typeof window !== 'undefined' ? window : undefined;
|
|
|
15
15
|
export function onClickOutside(target, handler, options = {}) {
|
|
16
16
|
const { window = defaultWindow, ignore = [], capture = true } = options;
|
|
17
17
|
if (!target)
|
|
18
|
-
throw new RuntimeError('
|
|
18
|
+
throw new RuntimeError(ibiz.i18n.t('core.utils.targetElement'));
|
|
19
19
|
if (!window)
|
|
20
|
-
throw new RuntimeError('
|
|
20
|
+
throw new RuntimeError(ibiz.i18n.t('core.utils.cannotFindWindow'));
|
|
21
21
|
/** 是否需要监听,为false时handler不会执行 */
|
|
22
22
|
let shouldListen = true;
|
|
23
23
|
/**
|
|
@@ -30,7 +30,7 @@ export class HistoryItem {
|
|
|
30
30
|
// history._next = clone(this._next);
|
|
31
31
|
// }
|
|
32
32
|
// return history;
|
|
33
|
-
throw new RuntimeError('
|
|
33
|
+
throw new RuntimeError(ibiz.i18n.t('core.utils.unrealized'));
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-file.d.ts","sourceRoot":"","sources":["../../../src/utils/upload/upload-file.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAC;IACrD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IACpD,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,OAAO,CAAC;IACrE,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;IAC/C,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACpE,KAAK,CAAC,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/D,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;CAC5C;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"upload-file.d.ts","sourceRoot":"","sources":["../../../src/utils/upload/upload-file.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAC;IACrD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IACpD,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,OAAO,CAAC;IACrE,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;IAC/C,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IACpE,KAAK,CAAC,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/D,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;CAC5C;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CA+JvD"}
|
|
@@ -63,7 +63,7 @@ export function uploadFile(_opts) {
|
|
|
63
63
|
// onUploadProgress: onProgress,
|
|
64
64
|
// });
|
|
65
65
|
// return res;
|
|
66
|
-
throw new RuntimeError(
|
|
66
|
+
throw new RuntimeError(ibiz.i18n.t('core.utils.multiApplicationMode'));
|
|
67
67
|
};
|
|
68
68
|
/**
|
|
69
69
|
* 执行一次上传,可能是一个文件也可能是多个文件
|
|
@@ -114,7 +114,9 @@ export function uploadFile(_opts) {
|
|
|
114
114
|
file.error = error;
|
|
115
115
|
});
|
|
116
116
|
ibiz.log.error(error);
|
|
117
|
-
ibiz.log.error(
|
|
117
|
+
ibiz.log.error(ibiz.i18n.t('core.utils.uploadFailed', {
|
|
118
|
+
file: files.map(file => file.name).join(','),
|
|
119
|
+
}));
|
|
118
120
|
}
|
|
119
121
|
return resultFiles;
|
|
120
122
|
};
|
package/out/utils/util/util.js
CHANGED