@ibiz-template/core 0.1.14 → 0.1.20

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.
Files changed (83) hide show
  1. package/dist/index.esm.js +341 -0
  2. package/dist/index.system.min.js +1 -1
  3. package/dist/index.system.min.js.map +1 -1
  4. package/out/error/index.d.ts +1 -0
  5. package/out/error/index.d.ts.map +1 -1
  6. package/out/error/index.js +1 -0
  7. package/out/error/notice-error/notice-error.d.ts +16 -0
  8. package/out/error/notice-error/notice-error.d.ts.map +1 -0
  9. package/out/error/notice-error/notice-error.js +17 -0
  10. package/out/ibizsys.d.ts +9 -1
  11. package/out/ibizsys.d.ts.map +1 -1
  12. package/out/ibizsys.js +9 -1
  13. package/out/interface/i-portal-async-action/i-portal-async-action.d.ts +83 -0
  14. package/out/interface/i-portal-async-action/i-portal-async-action.d.ts.map +1 -0
  15. package/out/interface/i-portal-async-action/i-portal-async-action.js +1 -0
  16. package/out/interface/i-portal-message/i-portal-message.d.ts +68 -0
  17. package/out/interface/i-portal-message/i-portal-message.d.ts.map +1 -0
  18. package/out/interface/i-portal-message/i-portal-message.js +1 -0
  19. package/out/interface/index.d.ts +2 -0
  20. package/out/interface/index.d.ts.map +1 -1
  21. package/out/utils/index.d.ts +1 -0
  22. package/out/utils/index.d.ts.map +1 -1
  23. package/out/utils/index.js +1 -0
  24. package/out/utils/message-center/base/message-all.d.ts +13 -0
  25. package/out/utils/message-center/base/message-all.d.ts.map +1 -0
  26. package/out/utils/message-center/base/message-all.js +12 -0
  27. package/out/utils/message-center/base/message-base.d.ts +68 -0
  28. package/out/utils/message-center/base/message-base.d.ts.map +1 -0
  29. package/out/utils/message-center/base/message-base.js +70 -0
  30. package/out/utils/message-center/command/change/command-change.d.ts +13 -0
  31. package/out/utils/message-center/command/change/command-change.d.ts.map +1 -0
  32. package/out/utils/message-center/command/change/command-change.js +12 -0
  33. package/out/utils/message-center/command/command-base/command-base.d.ts +20 -0
  34. package/out/utils/message-center/command/command-base/command-base.d.ts.map +1 -0
  35. package/out/utils/message-center/command/command-base/command-base.js +28 -0
  36. package/out/utils/message-center/command/create/command-create.d.ts +22 -0
  37. package/out/utils/message-center/command/create/command-create.d.ts.map +1 -0
  38. package/out/utils/message-center/command/create/command-create.js +22 -0
  39. package/out/utils/message-center/command/message-command.d.ts +68 -0
  40. package/out/utils/message-center/command/message-command.d.ts.map +1 -0
  41. package/out/utils/message-center/command/message-command.js +113 -0
  42. package/out/utils/message-center/command/remove/command-remove.d.ts +22 -0
  43. package/out/utils/message-center/command/remove/command-remove.d.ts.map +1 -0
  44. package/out/utils/message-center/command/remove/command-remove.js +22 -0
  45. package/out/utils/message-center/command/update/command-update.d.ts +22 -0
  46. package/out/utils/message-center/command/update/command-update.d.ts.map +1 -0
  47. package/out/utils/message-center/command/update/command-update.js +22 -0
  48. package/out/utils/message-center/console/message-console.d.ts +21 -0
  49. package/out/utils/message-center/console/message-console.d.ts.map +1 -0
  50. package/out/utils/message-center/console/message-console.js +29 -0
  51. package/out/utils/message-center/index.d.ts +2 -0
  52. package/out/utils/message-center/index.d.ts.map +1 -0
  53. package/out/utils/message-center/index.js +1 -0
  54. package/out/utils/message-center/interface/i-app-data-entity.d.ts +20 -0
  55. package/out/utils/message-center/interface/i-app-data-entity.d.ts.map +1 -0
  56. package/out/utils/message-center/interface/i-app-data-entity.js +1 -0
  57. package/out/utils/message-center/interface/index.d.ts +2 -0
  58. package/out/utils/message-center/interface/index.d.ts.map +1 -0
  59. package/out/utils/message-center/interface/index.js +1 -0
  60. package/out/utils/message-center/message-center.d.ts +63 -0
  61. package/out/utils/message-center/message-center.d.ts.map +1 -0
  62. package/out/utils/message-center/message-center.js +79 -0
  63. package/package.json +2 -2
  64. package/src/error/index.ts +1 -0
  65. package/src/error/notice-error/notice-error.ts +19 -0
  66. package/src/ibizsys.ts +10 -1
  67. package/src/interface/i-portal-async-action/i-portal-async-action.ts +90 -0
  68. package/src/interface/i-portal-message/i-portal-message.ts +79 -0
  69. package/src/interface/index.ts +2 -0
  70. package/src/utils/index.ts +1 -0
  71. package/src/utils/message-center/base/message-all.ts +12 -0
  72. package/src/utils/message-center/base/message-base.ts +86 -0
  73. package/src/utils/message-center/command/change/command-change.ts +12 -0
  74. package/src/utils/message-center/command/command-base/command-base.ts +30 -0
  75. package/src/utils/message-center/command/create/command-create.ts +24 -0
  76. package/src/utils/message-center/command/message-command.ts +118 -0
  77. package/src/utils/message-center/command/remove/command-remove.ts +24 -0
  78. package/src/utils/message-center/command/update/command-update.ts +24 -0
  79. package/src/utils/message-center/console/message-console.ts +31 -0
  80. package/src/utils/message-center/index.ts +1 -0
  81. package/src/utils/message-center/interface/i-app-data-entity.ts +19 -0
  82. package/src/utils/message-center/interface/index.ts +1 -0
  83. package/src/utils/message-center/message-center.ts +82 -0
package/dist/index.esm.js CHANGED
@@ -1022,6 +1022,16 @@ var RuntimeModelError = class extends Error {
1022
1022
  }
1023
1023
  };
1024
1024
 
1025
+ // src/error/notice-error/notice-error.ts
1026
+ var NoticeError = class extends Error {
1027
+ constructor(message, duration) {
1028
+ super(message);
1029
+ this.message = message;
1030
+ this.duration = duration;
1031
+ this.name = "notice Error";
1032
+ }
1033
+ };
1034
+
1025
1035
  // src/utils/util/util.ts
1026
1036
  import { debounce as debounce2 } from "lodash-es";
1027
1037
  import { getCookie } from "qx-util";
@@ -1254,6 +1264,327 @@ var CoreInterceptor = class extends Interceptor {
1254
1264
  }
1255
1265
  };
1256
1266
 
1267
+ // src/utils/message-center/base/message-base.ts
1268
+ import { QXEvent } from "qx-util";
1269
+ var MessageBase = class {
1270
+ constructor(parent) {
1271
+ this.parent = parent;
1272
+ /**
1273
+ * 事件
1274
+ *
1275
+ * @author chitanda
1276
+ * @date 2023-09-05 16:09:58
1277
+ * @protected
1278
+ * @type {QXEvent<MessageCenterEvent>}
1279
+ */
1280
+ this.evt = new QXEvent(1e3);
1281
+ }
1282
+ /**
1283
+ * 推送标准结构消息
1284
+ *
1285
+ * @author chitanda
1286
+ * @date 2023-09-05 16:09:40
1287
+ * @param {IPortalMessage} msg
1288
+ */
1289
+ next(msg) {
1290
+ this.evt.emit("all", msg);
1291
+ if (this.parent) {
1292
+ this.nextParent(msg);
1293
+ }
1294
+ }
1295
+ /**
1296
+ * 私有方法,专门向父级推送消息
1297
+ *
1298
+ * @author chitanda
1299
+ * @date 2023-09-05 17:09:08
1300
+ * @protected
1301
+ * @param {IPortalMessage} msg
1302
+ */
1303
+ nextParent(msg) {
1304
+ if (this.parent) {
1305
+ this.parent.evt.emit("all", msg);
1306
+ this.parent.nextParent(msg);
1307
+ }
1308
+ }
1309
+ /**
1310
+ * 订阅消息
1311
+ *
1312
+ * @author chitanda
1313
+ * @date 2023-09-05 15:09:21
1314
+ * @param {(msg: IPortalMessage) => void} evt
1315
+ */
1316
+ on(cb) {
1317
+ this.evt.on("all", cb);
1318
+ }
1319
+ /**
1320
+ * 取消订阅
1321
+ *
1322
+ * @author chitanda
1323
+ * @date 2023-09-05 15:09:50
1324
+ * @param {(msg: IPortalMessage) => void} cb
1325
+ */
1326
+ off(cb) {
1327
+ this.evt.off("all", cb);
1328
+ }
1329
+ };
1330
+
1331
+ // src/utils/message-center/base/message-all.ts
1332
+ var MessageAll = class extends MessageBase {
1333
+ };
1334
+
1335
+ // src/utils/message-center/command/message-command.ts
1336
+ import { createUUID as createUUID2 } from "qx-util";
1337
+
1338
+ // src/utils/message-center/command/command-base/command-base.ts
1339
+ import { createUUID } from "qx-util";
1340
+ var CommandBase = class extends MessageBase {
1341
+ /**
1342
+ * 发送指令消息
1343
+ * @param data 更新的数据
1344
+ * @param subtype 数据更新 | 数据删除 | 数据创建
1345
+ */
1346
+ sendCommand(data, subtype) {
1347
+ const msg = {
1348
+ messageid: createUUID(),
1349
+ messagename: "command",
1350
+ type: "COMMAND",
1351
+ subtype,
1352
+ data
1353
+ };
1354
+ this.next(msg);
1355
+ }
1356
+ };
1357
+
1358
+ // src/utils/message-center/command/create/command-create.ts
1359
+ var CommandCreate = class extends CommandBase {
1360
+ /**
1361
+ * 发送新建的数据
1362
+ *
1363
+ * @author chitanda
1364
+ * @date 2023-09-05 17:09:13
1365
+ * @param {IAppDataEntity} data
1366
+ */
1367
+ send(data) {
1368
+ this.sendCommand(data, "OBJECTCREATED");
1369
+ }
1370
+ };
1371
+
1372
+ // src/utils/message-center/command/update/command-update.ts
1373
+ var CommandUpdate = class extends CommandBase {
1374
+ /**
1375
+ * 发送更新的数据
1376
+ *
1377
+ * @author chitanda
1378
+ * @date 2023-09-05 17:09:37
1379
+ * @param {IAppDataEntity} data
1380
+ */
1381
+ send(data) {
1382
+ this.sendCommand(data, "OBJECTUPDATED");
1383
+ }
1384
+ };
1385
+
1386
+ // src/utils/message-center/command/remove/command-remove.ts
1387
+ var CommandRemove = class extends CommandBase {
1388
+ /**
1389
+ * 发送删除的数据
1390
+ *
1391
+ * @author chitanda
1392
+ * @date 2023-09-05 17:09:29
1393
+ * @param {IAppDataEntity} data
1394
+ */
1395
+ send(data) {
1396
+ this.sendCommand(data, "OBJECTREMOVED");
1397
+ }
1398
+ };
1399
+
1400
+ // src/utils/message-center/command/change/command-change.ts
1401
+ var CommandChange = class extends CommandBase {
1402
+ };
1403
+
1404
+ // src/utils/message-center/command/message-command.ts
1405
+ var MessageCommand = class extends MessageBase {
1406
+ constructor() {
1407
+ super(...arguments);
1408
+ /**
1409
+ * 数据变更指令消息
1410
+ *
1411
+ * @author chitanda
1412
+ * @date 2023-09-05 17:09:15
1413
+ * @type {CommandChange}
1414
+ */
1415
+ this.change = new CommandChange();
1416
+ /**
1417
+ * 新建消息
1418
+ *
1419
+ * @author chitanda
1420
+ * @date 2023-09-05 17:09:55
1421
+ * @type {CommandCreate}
1422
+ */
1423
+ this.create = new CommandCreate(this);
1424
+ /**
1425
+ * 更新消息
1426
+ *
1427
+ * @author chitanda
1428
+ * @date 2023-09-05 17:09:01
1429
+ * @type {CommandUpdate}
1430
+ */
1431
+ this.update = new CommandUpdate(this);
1432
+ /**
1433
+ * 删除消息
1434
+ *
1435
+ * @author chitanda
1436
+ * @date 2023-09-05 17:09:05
1437
+ * @type {CommandRemove}
1438
+ */
1439
+ this.remove = new CommandRemove(this);
1440
+ }
1441
+ /**
1442
+ * 推送指令消息
1443
+ *
1444
+ * @author chitanda
1445
+ * @date 2023-09-05 17:09:50
1446
+ * @param {IPortalMessage} msg
1447
+ */
1448
+ next(msg) {
1449
+ switch (msg.subtype) {
1450
+ case "OBJECTCREATED":
1451
+ this.create.next(msg);
1452
+ this.change.next(msg);
1453
+ break;
1454
+ case "OBJECTUPDATED":
1455
+ this.update.next(msg);
1456
+ this.change.next(msg);
1457
+ break;
1458
+ case "OBJECTREMOVED":
1459
+ this.remove.next(msg);
1460
+ this.change.next(msg);
1461
+ break;
1462
+ default:
1463
+ super.next(msg);
1464
+ }
1465
+ }
1466
+ nextParent(msg) {
1467
+ switch (msg.subtype) {
1468
+ case "OBJECTCREATED":
1469
+ this.change.next(msg);
1470
+ break;
1471
+ case "OBJECTUPDATED":
1472
+ this.change.next(msg);
1473
+ break;
1474
+ case "OBJECTREMOVED":
1475
+ this.change.next(msg);
1476
+ break;
1477
+ default:
1478
+ }
1479
+ super.nextParent(msg);
1480
+ }
1481
+ /**
1482
+ * 发送指令消息
1483
+ *
1484
+ * @author chitanda
1485
+ * @date 2023-09-05 17:09:35
1486
+ * @param {IData} data
1487
+ * @param {IPortalMessage['subtype']} subtype
1488
+ */
1489
+ send(data, subtype) {
1490
+ const msg = {
1491
+ messageid: createUUID2(),
1492
+ messagename: "command",
1493
+ type: "COMMAND",
1494
+ subtype,
1495
+ data
1496
+ };
1497
+ this.next(msg);
1498
+ }
1499
+ };
1500
+
1501
+ // src/utils/message-center/console/message-console.ts
1502
+ import { createUUID as createUUID3 } from "qx-util";
1503
+ var MessageConsole = class extends MessageBase {
1504
+ /**
1505
+ * 发送日志消息
1506
+ *
1507
+ * @author chitanda
1508
+ * @date 2023-09-05 16:09:25
1509
+ * @param {(IData | string)} data
1510
+ */
1511
+ send(data) {
1512
+ const msg = {
1513
+ messageid: createUUID3(),
1514
+ messagename: "console",
1515
+ type: "CONSOLE",
1516
+ data
1517
+ };
1518
+ this.next(msg);
1519
+ }
1520
+ };
1521
+
1522
+ // src/utils/message-center/message-center.ts
1523
+ var MessageCenter = class {
1524
+ constructor() {
1525
+ /**
1526
+ * 所有消息
1527
+ *
1528
+ * @author chitanda
1529
+ * @date 2023-09-05 16:09:12
1530
+ * @type {MessageAll}
1531
+ */
1532
+ this.all = new MessageAll();
1533
+ /**
1534
+ * 指令消息
1535
+ *
1536
+ * @author chitanda
1537
+ * @date 2023-09-05 16:09:28
1538
+ * @type {MessageCommand}
1539
+ */
1540
+ this.command = new MessageCommand(this.all);
1541
+ /**
1542
+ * 日志消息
1543
+ *
1544
+ * @author chitanda
1545
+ * @date 2023-09-05 16:09:48
1546
+ * @type {MessageConsole}
1547
+ */
1548
+ this.console = new MessageConsole(this.all);
1549
+ }
1550
+ /**
1551
+ * 发送消息
1552
+ *
1553
+ * @author chitanda
1554
+ * @date 2023-09-05 15:09:49
1555
+ * @param {IPortalMessage} msg
1556
+ */
1557
+ next(msg) {
1558
+ if (msg.type === "COMMAND") {
1559
+ this.command.next(msg);
1560
+ } else if (msg.type === "CONSOLE") {
1561
+ this.console.next(msg);
1562
+ } else {
1563
+ this.all.next(msg);
1564
+ }
1565
+ }
1566
+ /**
1567
+ * 订阅消息
1568
+ *
1569
+ * @author chitanda
1570
+ * @date 2023-09-05 17:09:32
1571
+ * @param {(msg: IPortalMessage) => void} callback
1572
+ */
1573
+ on(callback) {
1574
+ this.all.on(callback);
1575
+ }
1576
+ /**
1577
+ * 取消订阅
1578
+ *
1579
+ * @author chitanda
1580
+ * @date 2023-09-05 17:09:38
1581
+ * @param {(msg: IPortalMessage) => void} callback
1582
+ */
1583
+ off(callback) {
1584
+ this.all.off(callback);
1585
+ }
1586
+ };
1587
+
1257
1588
  // src/utils/namespace/namespace.ts
1258
1589
  var defaultNamespace = "ibiz";
1259
1590
  var statePrefix = "is-";
@@ -2559,6 +2890,14 @@ var IBizSys = class {
2559
2890
  * @type {AuthService}
2560
2891
  */
2561
2892
  this.commands = new CommandController();
2893
+ /**
2894
+ * 界面消息中心
2895
+ *
2896
+ * @author chitanda
2897
+ * @date 2023-09-05 17:09:38
2898
+ * @type {MessageCenter}
2899
+ */
2900
+ this.mc = new MessageCenter();
2562
2901
  }
2563
2902
  };
2564
2903
 
@@ -2586,10 +2925,12 @@ export {
2586
2925
  LinkedList,
2587
2926
  LoginMode,
2588
2927
  MenuPermissionMode,
2928
+ MessageCenter,
2589
2929
  ModelError,
2590
2930
  NOOP,
2591
2931
  Namespace,
2592
2932
  Net,
2933
+ NoticeError,
2593
2934
  RuntimeError,
2594
2935
  RuntimeModelError,
2595
2936
  StringUtil,
@@ -1,2 +1,2 @@
1
- System.register(["ramda","lodash-es","qx-util","axios","qs"],(function(e){"use strict";var t,n,s,r,o,i,a,c,l,u,h,p,d;return{setters:[function(e){t=e.clone,n=e.isNotNil,s=e.isNil,r=e.mergeDeepRight},function(e){o=e.debounce,i=e.merge,a=e.uniqueId,e.round,e.cloneDeep,c=e.isFunction},function(e){l=e.getCookie,u=e.notNilEmpty},function(e){h=e.AxiosHeaders,p=e.default},function(e){d=e.stringify}],execute:function(){e({awaitTimeout:async function(e,t,n){if(await new Promise((t=>{setTimeout((()=>{t(!0)}),e)})),t)return t(...n||[])},calcMimeByFileName:K,colorBlend:function(e,t,n=.5,s="hex"){e=e.trim(),t=t.trim();const r=X(e),o=X(t),i=[G((1-n)*r[0]+n*o[0]),G((1-n)*r[1]+n*o[1]),G((1-n)*r[2]+n*o[2]),(1-n)*r[3]+n*o[3]];if("hex"===s){const e=[i[0].toString(16),i[1].toString(16),i[2].toString(16),0===i[3]?"00":G(255*i[3]).toString(16)];return"#".concat(e[0]).concat(e[1]).concat(e[2]).concat(e[3])}return"rgb(".concat(i[0]," ").concat(i[1]," ").concat(i[2]," / ").concat(i[3],")")},compareArr:function(e,t,n){const s=new Set([...e,...t]),r=[],o=[],i=[];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])?i.push(e):r.push(e):o.push(e)}))}else s.forEach((n=>{e.includes(n)?t.includes(n)?i.push(n):r.push(n):o.push(n)}));return{more:r,less:o,same:i}},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 i=o((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,i(...n),new Promise(((e,t)=>{r.push({resolve:e,reject:t})}))}},debounceAndMerge:function(e,t,n){let s;const r=o(((...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=K(t),s=new Blob([e],{type:n}),r=URL.createObjectURL(s),o=document.createElement("a");o.href=r,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r)},eventPath:V,fileListToArr:Z,findRecursiveChild:function(e,t,n){const{compareField:s,compareCallback:o}=r(ne,n||{}),i=o||(e=>e[s]===t);let a;return te(e,(e=>{if(i(e,t,s))return a=e,!0}),n),a},getToken:F,install:function(){if(window.ibiz)throw new Error("ibiz 已经存在, 无需重复安装");window.ibiz=new ie},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:W,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},listenJSEvent:Y,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=$,ignore:r=[],capture:o=!0}=n;if(!e)throw new j("target元素不存在");if(!s)throw new j("找不到window");let i=!0;const a=t=>![e,...r].some((e=>W(t,e)));let c=!1;let l;const u=e=>{c||(s.clearTimeout(l),i&&a(e)&&t(e))},h=[Y(s,"click",u,{passive:!0,capture:o}),Y(s,"pointerdown",(e=>{c||(i=a(e))}),{passive:!0}),Y(s,"pointerup",(e=>{if(!c&&0===e.button){const t=V(e);e.composedPath=()=>t,l=s.setTimeout((()=>u(e)),50)}}),{passive:!0})].filter(Boolean);return{stop:()=>h.forEach((e=>e())),pause:()=>{c=!0},proceed:()=>{c=!1}}},recursiveIterate:te,selectFile:J,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:C,toNumberOrNil:function(e){if(s(e))return;const t=Number(e);if(Number.isNaN(t))return;return t},uploadFile:function(e){const t=i({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:a(),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&&c(t.request))return t.request(e);const s=new FormData;throw e.forEach((e=>{s.append("file",e)})),new j("多应用模式等待重新实现请求")})(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};J({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)))),o=[];r.forEach((e=>{"fulfilled"===e.status&&o.push(...e.value)})),t.finish(o)})(e)}})}});var f=Object.create,m=Object.defineProperty,g=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,v=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty,b=(e,t)=>function(){return t||(0,e[w(e)[0]])((t={exports:{}}).exports,t),t.exports},E=(e,t,n)=>(n=null!=e?f(v(e)):{},((e,t,n,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of w(t))y.call(e,r)||r===n||m(e,r,{get:()=>t[r],enumerable:!(s=g(t,r))||s.enumerable});return e})(!t&&e&&e.__esModule?n:m(n,"default",{value:e,enumerable:!0}),e)),R=b({"../../node_modules/.pnpm/loglevel@1.8.1/node_modules/loglevel/lib/loglevel.js"(e,t){var n,s;n=e,s=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"];function r(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function o(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function i(t,n){for(var r=0;r<s.length;r++){var o=s[r];this[o]=r<t?e:this.methodFactory(o,t,n)}this.log=this.debug}function a(e,n,s){return function(){typeof console!==t&&(i.call(this,n,s),this[e].apply(this,arguments))}}function c(s,i,c){return function(s){return"debug"===s&&(s="log"),typeof console!==t&&("trace"===s&&n?o:void 0!==console[s]?r(console,s):void 0!==console.log?r(console,"log"):e)}(s)||a.apply(this,arguments)}function l(e,n,r){var o,a=this;n=null==n?"WARN":n;var l="loglevel";function u(){var e;if(typeof window!==t&&l){try{e=window.localStorage[l]}catch(e){}if(typeof e===t)try{var n=window.document.cookie,s=n.indexOf(encodeURIComponent(l)+"=");-1!==s&&(e=/^([^;]+)/.exec(n.slice(s))[1])}catch(e){}return void 0===a.levels[e]&&(e=void 0),e}}"string"==typeof e?l+=":"+e:"symbol"==typeof e&&(l=void 0),a.name=e,a.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},a.methodFactory=r||c,a.getLevel=function(){return o},a.setLevel=function(n,r){if("string"==typeof n&&void 0!==a.levels[n.toUpperCase()]&&(n=a.levels[n.toUpperCase()]),!("number"==typeof n&&n>=0&&n<=a.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(o=n,!1!==r&&function(e){var n=(s[e]||"silent").toUpperCase();if(typeof window!==t&&l){try{return void(window.localStorage[l]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(l)+"="+n+";"}catch(e){}}}(n),i.call(a,n,e),typeof console===t&&n<a.levels.SILENT)return"No console available for logging"},a.setDefaultLevel=function(e){n=e,u()||a.setLevel(e,!1)},a.resetLevel=function(){a.setLevel(n,!1),function(){if(typeof window!==t&&l){try{return void window.localStorage.removeItem(l)}catch(e){}try{window.document.cookie=encodeURIComponent(l)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}()},a.enableAll=function(e){a.setLevel(a.levels.TRACE,e)},a.disableAll=function(e){a.setLevel(a.levels.SILENT,e)};var h=u();null==h&&(h=n),a.setLevel(h,!1)}var u=new l,h={};u.getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=h[e];return t||(t=h[e]=new l(e,u.getLevel(),u.methodFactory)),t};var p=typeof window!==t?window.log:void 0;return u.noConflict=function(){return typeof window!==t&&window.log===u&&(window.log=p),u},u.getLoggers=function(){return h},u.default=u,u},"function"==typeof define&&define.amd?define(s):"object"==typeof t&&t.exports?t.exports=s():n.log=s()}}),x=b({"../../node_modules/.pnpm/loglevel-plugin-prefix@0.8.4/node_modules/loglevel-plugin-prefix/lib/loglevel-plugin-prefix.js"(e,t){var n,s;n=e,s=function(e){var t,n,s={template:"[%t] %l:",levelFormatter:function(e){return e.toUpperCase()},nameFormatter:function(e){return e||"root"},timestampFormatter:function(e){return e.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/,"$1")},format:void 0},r={},o={reg:function(e){if(!e||!e.getLogger)throw new TypeError("Argument is not a root logger");t=e},apply:function(e,n){if(!e||!e.setLevel)throw new TypeError("Argument is not a logger");var o=e.methodFactory,i=e.name||"",a=r[i]||r[""]||s;return r[i]||(e.methodFactory=function(e,t,n){var s=o(e,t,n),a=r[n]||r[""],c=-1!==a.template.indexOf("%t"),l=-1!==a.template.indexOf("%l"),u=-1!==a.template.indexOf("%n");return function(){for(var t="",o=arguments.length,h=Array(o),p=0;p<o;p++)h[p]=arguments[p];if(i||!r[n]){var d=a.timestampFormatter(new Date),f=a.levelFormatter(e),m=a.nameFormatter(n);a.format?t+=a.format(f,m,d):(t+=a.template,c&&(t=t.replace(/%t/,d)),l&&(t=t.replace(/%l/,f)),u&&(t=t.replace(/%n/,m))),h.length&&"string"==typeof h[0]?h[0]=t+" "+h[0]:h.unshift(t)}s.apply(void 0,h)}}),(n=n||{}).template&&(n.format=void 0),r[i]=function(e){for(var t,n=1,s=arguments.length;n<s;n++)for(t in arguments[n])Object.prototype.hasOwnProperty.call(arguments[n],t)&&(e[t]=arguments[n][t]);return e}({},a,n),e.setLevel(e.getLevel()),t||e.warn("It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md"),e}};return e&&(n=e.prefix,o.noConflict=function(){return e.prefix===o&&(e.prefix=n),o}),o},"function"==typeof define&&define.amd?define(s):"object"==typeof t&&t.exports?t.exports=s():n.prefix=s(n)}}),T=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};T.Undefined=new T(void 0);var A=T,I=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 _(e){const t=this;let n,s=!1;return function(){return s||(s=!0,n=e.apply(t,arguments)),n}}function C(e){return{dispose:_((()=>{e()}))}}var U=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 I,this.commands.set(s,r));const o=r.unshift(e);return C((()=>{o();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}}),O=e("CommandController",class{constructor(){this.commandRegister=new U}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)}}),L=(e("commands",new O),e("CoreConst",class{}));L.DEFAULT_MODEL_SERVICE_TAG="default",L.TOKEN="ibzuaa-token",L.TOKEN_EXPIRES="ibzuaa-token-expires";var N=e("NOOP",(()=>{})),S=(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))(S||{}))),M=e("MenuPermissionMode",(e=>(e.MIXIN="MIXIN",e.RESOURCE="RESOURCE",e.RT="RT",e))(M||{})),k=(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("Environment",{dev:!1,hub:!0,isEnableMultiLan:!1,logLevel:"ERROR",baseUrl:"/api",appId:"",pluginBaseUrl:"./plugins",isLocalModel:!1,remoteModelUrl:"/remotemodel",assetsUrl:"./assets",dcSystem:"",downloadFileUrl:"/ibizutil/download",uploadFileUrl:"/ibizutil/upload",casLoginUrl:"",loginMode:"DEFAULT",menuPermissionMode:"MIXIN",enablePermission:!0,routePlaceholder:"-",enableWfAllHistory:!1,isMob:!1,isSaaSMode:!0,AppTitle:"应用",favicon:"./favicon.ico"})),P=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)}}),j=(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="模型配置缺失"}});function F(){return l(L.TOKEN)}var z=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)}}),q=e("CoreInterceptor",class extends z{async onBeforeRequest(e){e=await super.onBeforeRequest(e);const{headers:t}=e;t.set("Authorization","Bearer ".concat(F()));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}});function D(e,t,n,s,r){let o="".concat(e,"-").concat(t);return n&&(o+="-".concat(n)),s&&(o+="__".concat(s)),r&&(o+="--".concat(r)),o}e("Namespace",class{constructor(e,t){this.block=e,this.namespace=t||"ibiz"}b(e=""){return D(this.namespace,this.block,e,"","")}e(e){return e?D(this.namespace,this.block,"",e,""):""}m(e){return e?D(this.namespace,this.block,"","",e):""}be(e,t){return e&&t?D(this.namespace,this.block,e,t,""):""}em(e,t){return e&&t?D(this.namespace,this.block,"",e,t):""}bm(e,t){return e&&t?D(this.namespace,this.block,e,"",t):""}bem(e,t,n){return e&&t&&n?D(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 h},this.data=e,this.status=t||200,this.statusText=n||"",this.status>=200&&this.status<300&&(this.ok=!0)}});var B=e("Net",class{constructor(e){this.urlReg=/^http[s]?:\/\/[^\s]*/,this.waitRequest=new Map,this.interceptors=new Map,this.instance=p.create(e),this.addInterceptor("Default",new q)}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.instance.defaults.baseURL||"".concat(ibiz.env.baseUrl,"/").concat(ibiz.env.appId),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,i(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 P(e)}}async get(e,t={},n={},s={}){e=this.attachUrlParam(e,t);try{const t=await this.request(e,i({method:"get",headers:n},s));return this.doResponseResult(t)}catch(e){throw new P(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 P(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 P(e)}}async getModel(e,t={}){try{const n=await this.instance.get(e,{headers:t});return this.doResponseResult(n)}catch(e){throw new P(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 P(e)}}axios(e){return p(e)}doResponseResult(e){const t=e;return t.status>=200&&t.status<=299&&(t.ok=!0),t}handleAppPresetParam(e,t){if(t){return Object.keys(t).forEach((e=>{e.startsWith("srf")&&u(t[e])&&t[e]})),this.attachUrlParam(e,t)}return e}attachUrlParam(e,t){const n=d(t);return u(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}}),H=e("StringUtil",class{static fill(e,t,n){if(u(e)){if(u(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(u(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}});H.contextReg=/\$\{context.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g,H.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 V(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 Y(e,t,n,s={}){e.addEventListener(t,n,s);let r=()=>{e.removeEventListener(t,n,s),r=N};return()=>{r()}}function W(e,t){return t&&(e.target===t||V(e).includes(t))}var $="undefined"!=typeof window?window:void 0;var G=Math.round;function X(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?G((s>>24&255)/255*1e4)/1e4:1}return n}function K(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 Z(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t}function J(e){const t=i({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?Z(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 j("lock和unlock次数不匹配!");this.count-=1,0===this.count&&this.endPromise()}async await(){this.promise&&await this.promise}});var Q={childrenFields:["children"]},ee=new Error("中断操作");function te(e,t,n){try{!function(e,t,n){const{childrenFields:s}=r(Q,n||{}),o=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==o?void 0:o.length)for(const e of o){if(t(e))throw ee;te(e,t,n)}}(e,t,n)}catch(e){if(e!==ee)throw e}}var ne={...Q,compareField:"name"};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 se=E(R(),1),re=E(x(),1),oe=se.noConflict();re.reg(oe),re.apply(oe);var ie=e("IBizSys",class{constructor(){this.env=k,this.log=oe,this.net=new B,this.commands=new O}})}}}));
1
+ System.register(["ramda","lodash-es","qx-util","axios","qs"],(function(e){"use strict";var t,n,s,r,o,i,a,c,l,u,h,p,d,f,m;return{setters:[function(e){t=e.clone,n=e.isNotNil,s=e.isNil,r=e.mergeDeepRight},function(e){o=e.debounce,i=e.merge,a=e.uniqueId,e.round,e.cloneDeep,c=e.isFunction},function(e){l=e.getCookie,u=e.notNilEmpty,h=e.createUUID,p=e.QXEvent},function(e){d=e.AxiosHeaders,f=e.default},function(e){m=e.stringify}],execute:function(){e({awaitTimeout:async function(e,t,n){if(await new Promise((t=>{setTimeout((()=>{t(!0)}),e)})),t)return t(...n||[])},calcMimeByFileName:ce,colorBlend:function(e,t,n=.5,s="hex"){e=e.trim(),t=t.trim();const r=ae(e),o=ae(t),i=[ie((1-n)*r[0]+n*o[0]),ie((1-n)*r[1]+n*o[1]),ie((1-n)*r[2]+n*o[2]),(1-n)*r[3]+n*o[3]];if("hex"===s){const e=[i[0].toString(16),i[1].toString(16),i[2].toString(16),0===i[3]?"00":ie(255*i[3]).toString(16)];return"#".concat(e[0]).concat(e[1]).concat(e[2]).concat(e[3])}return"rgb(".concat(i[0]," ").concat(i[1]," ").concat(i[2]," / ").concat(i[3],")")},compareArr:function(e,t,n){const s=new Set([...e,...t]),r=[],o=[],i=[];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])?i.push(e):r.push(e):o.push(e)}))}else s.forEach((n=>{e.includes(n)?t.includes(n)?i.push(n):r.push(n):o.push(n)}));return{more:r,less:o,same:i}},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 i=o((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,i(...n),new Promise(((e,t)=>{r.push({resolve:e,reject:t})}))}},debounceAndMerge:function(e,t,n){let s;const r=o(((...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=ce(t),s=new Blob([e],{type:n}),r=URL.createObjectURL(s),o=document.createElement("a");o.href=r,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(r)},eventPath:ne,fileListToArr:le,findRecursiveChild:function(e,t,n){const{compareField:s,compareCallback:o}=r(fe,n||{}),i=o||(e=>e[s]===t);let a;return de(e,(e=>{if(i(e,t,s))return a=e,!0}),n),a},getToken:B,install:function(){if(window.ibiz)throw new Error("ibiz 已经存在, 无需重复安装");window.ibiz=new ye},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:re,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},listenJSEvent:se,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=oe,ignore:r=[],capture:o=!0}=n;if(!e)throw new F("target元素不存在");if(!s)throw new F("找不到window");let i=!0;const a=t=>![e,...r].some((e=>re(t,e)));let c=!1;let l;const u=e=>{c||(s.clearTimeout(l),i&&a(e)&&t(e))},h=[se(s,"click",u,{passive:!0,capture:o}),se(s,"pointerdown",(e=>{c||(i=a(e))}),{passive:!0}),se(s,"pointerup",(e=>{if(!c&&0===e.button){const t=ne(e);e.composedPath=()=>t,l=s.setTimeout((()=>u(e)),50)}}),{passive:!0})].filter(Boolean);return{stop:()=>h.forEach((e=>e())),pause:()=>{c=!0},proceed:()=>{c=!1}}},recursiveIterate:de,selectFile:ue,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:U,toNumberOrNil:function(e){if(s(e))return;const t=Number(e);if(Number.isNaN(t))return;return t},uploadFile:function(e){const t=i({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:a(),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&&c(t.request))return t.request(e);const s=new FormData;throw e.forEach((e=>{s.append("file",e)})),new F("多应用模式等待重新实现请求")})(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};ue({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)))),o=[];r.forEach((e=>{"fulfilled"===e.status&&o.push(...e.value)})),t.finish(o)})(e)}})}});var g=Object.create,w=Object.defineProperty,y=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,E=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty,x=(e,t)=>function(){return t||(0,e[v(e)[0]])((t={exports:{}}).exports,t),t.exports},R=(e,t,n)=>(n=null!=e?g(E(e)):{},((e,t,n,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of v(t))b.call(e,r)||r===n||w(e,r,{get:()=>t[r],enumerable:!(s=y(t,r))||s.enumerable});return e})(!t&&e&&e.__esModule?n:w(n,"default",{value:e,enumerable:!0}),e)),T=x({"../../node_modules/.pnpm/loglevel@1.8.1/node_modules/loglevel/lib/loglevel.js"(e,t){var n,s;n=e,s=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),s=["trace","debug","info","warn","error"];function r(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function o(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function i(t,n){for(var r=0;r<s.length;r++){var o=s[r];this[o]=r<t?e:this.methodFactory(o,t,n)}this.log=this.debug}function a(e,n,s){return function(){typeof console!==t&&(i.call(this,n,s),this[e].apply(this,arguments))}}function c(s,i,c){return function(s){return"debug"===s&&(s="log"),typeof console!==t&&("trace"===s&&n?o:void 0!==console[s]?r(console,s):void 0!==console.log?r(console,"log"):e)}(s)||a.apply(this,arguments)}function l(e,n,r){var o,a=this;n=null==n?"WARN":n;var l="loglevel";function u(){var e;if(typeof window!==t&&l){try{e=window.localStorage[l]}catch(e){}if(typeof e===t)try{var n=window.document.cookie,s=n.indexOf(encodeURIComponent(l)+"=");-1!==s&&(e=/^([^;]+)/.exec(n.slice(s))[1])}catch(e){}return void 0===a.levels[e]&&(e=void 0),e}}"string"==typeof e?l+=":"+e:"symbol"==typeof e&&(l=void 0),a.name=e,a.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},a.methodFactory=r||c,a.getLevel=function(){return o},a.setLevel=function(n,r){if("string"==typeof n&&void 0!==a.levels[n.toUpperCase()]&&(n=a.levels[n.toUpperCase()]),!("number"==typeof n&&n>=0&&n<=a.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(o=n,!1!==r&&function(e){var n=(s[e]||"silent").toUpperCase();if(typeof window!==t&&l){try{return void(window.localStorage[l]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(l)+"="+n+";"}catch(e){}}}(n),i.call(a,n,e),typeof console===t&&n<a.levels.SILENT)return"No console available for logging"},a.setDefaultLevel=function(e){n=e,u()||a.setLevel(e,!1)},a.resetLevel=function(){a.setLevel(n,!1),function(){if(typeof window!==t&&l){try{return void window.localStorage.removeItem(l)}catch(e){}try{window.document.cookie=encodeURIComponent(l)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}()},a.enableAll=function(e){a.setLevel(a.levels.TRACE,e)},a.disableAll=function(e){a.setLevel(a.levels.SILENT,e)};var h=u();null==h&&(h=n),a.setLevel(h,!1)}var u=new l,h={};u.getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=h[e];return t||(t=h[e]=new l(e,u.getLevel(),u.methodFactory)),t};var p=typeof window!==t?window.log:void 0;return u.noConflict=function(){return typeof window!==t&&window.log===u&&(window.log=p),u},u.getLoggers=function(){return h},u.default=u,u},"function"==typeof define&&define.amd?define(s):"object"==typeof t&&t.exports?t.exports=s():n.log=s()}}),C=x({"../../node_modules/.pnpm/loglevel-plugin-prefix@0.8.4/node_modules/loglevel-plugin-prefix/lib/loglevel-plugin-prefix.js"(e,t){var n,s;n=e,s=function(e){var t,n,s={template:"[%t] %l:",levelFormatter:function(e){return e.toUpperCase()},nameFormatter:function(e){return e||"root"},timestampFormatter:function(e){return e.toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/,"$1")},format:void 0},r={},o={reg:function(e){if(!e||!e.getLogger)throw new TypeError("Argument is not a root logger");t=e},apply:function(e,n){if(!e||!e.setLevel)throw new TypeError("Argument is not a logger");var o=e.methodFactory,i=e.name||"",a=r[i]||r[""]||s;return r[i]||(e.methodFactory=function(e,t,n){var s=o(e,t,n),a=r[n]||r[""],c=-1!==a.template.indexOf("%t"),l=-1!==a.template.indexOf("%l"),u=-1!==a.template.indexOf("%n");return function(){for(var t="",o=arguments.length,h=Array(o),p=0;p<o;p++)h[p]=arguments[p];if(i||!r[n]){var d=a.timestampFormatter(new Date),f=a.levelFormatter(e),m=a.nameFormatter(n);a.format?t+=a.format(f,m,d):(t+=a.template,c&&(t=t.replace(/%t/,d)),l&&(t=t.replace(/%l/,f)),u&&(t=t.replace(/%n/,m))),h.length&&"string"==typeof h[0]?h[0]=t+" "+h[0]:h.unshift(t)}s.apply(void 0,h)}}),(n=n||{}).template&&(n.format=void 0),r[i]=function(e){for(var t,n=1,s=arguments.length;n<s;n++)for(t in arguments[n])Object.prototype.hasOwnProperty.call(arguments[n],t)&&(e[t]=arguments[n][t]);return e}({},a,n),e.setLevel(e.getLevel()),t||e.warn("It is necessary to call the function reg() of loglevel-plugin-prefix before calling apply. From the next release, it will throw an error. See more: https://github.com/kutuluk/loglevel-plugin-prefix/blob/master/README.md"),e}};return e&&(n=e.prefix,o.noConflict=function(){return e.prefix===o&&(e.prefix=n),o}),o},"function"==typeof define&&define.amd?define(s):"object"==typeof t&&t.exports?t.exports=s():n.prefix=s(n)}}),O=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};O.Undefined=new O(void 0);var A=O,I=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 _(e){const t=this;let n,s=!1;return function(){return s||(s=!0,n=e.apply(t,arguments)),n}}function U(e){return{dispose:_((()=>{e()}))}}var N=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 I,this.commands.set(s,r));const o=r.unshift(e);return U((()=>{o();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}}),L=e("CommandController",class{constructor(){this.commandRegister=new N}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)}}),M=(e("commands",new L),e("CoreConst",class{}));M.DEFAULT_MODEL_SERVICE_TAG="default",M.TOKEN="ibzuaa-token",M.TOKEN_EXPIRES="ibzuaa-token-expires";var S=e("NOOP",(()=>{})),k=(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))(k||{}))),P=e("MenuPermissionMode",(e=>(e.MIXIN="MIXIN",e.RESOURCE="RESOURCE",e.RT="RT",e))(P||{})),j=(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("Environment",{dev:!1,hub:!0,isEnableMultiLan:!1,logLevel:"ERROR",baseUrl:"/api",appId:"",pluginBaseUrl:"./plugins",isLocalModel:!1,remoteModelUrl:"/remotemodel",assetsUrl:"./assets",dcSystem:"",downloadFileUrl:"/ibizutil/download",uploadFileUrl:"/ibizutil/upload",casLoginUrl:"",loginMode:"DEFAULT",menuPermissionMode:"MIXIN",enablePermission:!0,routePlaceholder:"-",enableWfAllHistory:!1,isMob:!1,isSaaSMode:!0,AppTitle:"应用",favicon:"./favicon.ico"})),D=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)}}),F=(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 B(){return l(M.TOKEN)}var z=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)}}),q=e("CoreInterceptor",class extends z{async onBeforeRequest(e){e=await super.onBeforeRequest(e);const{headers:t}=e;t.set("Authorization","Bearer ".concat(B()));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}}),V=class{constructor(e){this.parent=e,this.evt=new p(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)}},H=class extends V{},J=class extends V{sendCommand(e,t){const n={messageid:h(),messagename:"command",type:"COMMAND",subtype:t,data:e};this.next(n)}},Y=class extends J{send(e){this.sendCommand(e,"OBJECTCREATED")}},W=class extends J{send(e){this.sendCommand(e,"OBJECTUPDATED")}},$=class extends J{send(e){this.sendCommand(e,"OBJECTREMOVED")}},X=class extends J{},G=class extends V{constructor(){super(...arguments),this.change=new X,this.create=new Y(this),this.update=new W(this),this.remove=new $(this)}next(e){switch(e.subtype){case"OBJECTCREATED":this.create.next(e),this.change.next(e);break;case"OBJECTUPDATED":this.update.next(e),this.change.next(e);break;case"OBJECTREMOVED":this.remove.next(e),this.change.next(e);break;default:super.next(e)}}nextParent(e){switch(e.subtype){case"OBJECTCREATED":case"OBJECTUPDATED":case"OBJECTREMOVED":this.change.next(e)}super.nextParent(e)}send(e,t){const n={messageid:h(),messagename:"command",type:"COMMAND",subtype:t,data:e};this.next(n)}},K=class extends V{send(e){const t={messageid:h(),messagename:"console",type:"CONSOLE",data:e};this.next(t)}},Z=e("MessageCenter",class{constructor(){this.all=new H,this.command=new G(this.all),this.console=new K(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 Q(e,t,n,s,r){let o="".concat(e,"-").concat(t);return n&&(o+="-".concat(n)),s&&(o+="__".concat(s)),r&&(o+="--".concat(r)),o}e("Namespace",class{constructor(e,t){this.block=e,this.namespace=t||"ibiz"}b(e=""){return Q(this.namespace,this.block,e,"","")}e(e){return e?Q(this.namespace,this.block,"",e,""):""}m(e){return e?Q(this.namespace,this.block,"","",e):""}be(e,t){return e&&t?Q(this.namespace,this.block,e,t,""):""}em(e,t){return e&&t?Q(this.namespace,this.block,"",e,t):""}bm(e,t){return e&&t?Q(this.namespace,this.block,e,"",t):""}bem(e,t,n){return e&&t&&n?Q(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 d},this.data=e,this.status=t||200,this.statusText=n||"",this.status>=200&&this.status<300&&(this.ok=!0)}});var ee=e("Net",class{constructor(e){this.urlReg=/^http[s]?:\/\/[^\s]*/,this.waitRequest=new Map,this.interceptors=new Map,this.instance=f.create(e),this.addInterceptor("Default",new q)}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.instance.defaults.baseURL||"".concat(ibiz.env.baseUrl,"/").concat(ibiz.env.appId),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,i(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 D(e)}}async get(e,t={},n={},s={}){e=this.attachUrlParam(e,t);try{const t=await this.request(e,i({method:"get",headers:n},s));return this.doResponseResult(t)}catch(e){throw new D(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 D(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 D(e)}}async getModel(e,t={}){try{const n=await this.instance.get(e,{headers:t});return this.doResponseResult(n)}catch(e){throw new D(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 D(e)}}axios(e){return f(e)}doResponseResult(e){const t=e;return t.status>=200&&t.status<=299&&(t.ok=!0),t}handleAppPresetParam(e,t){if(t){return Object.keys(t).forEach((e=>{e.startsWith("srf")&&u(t[e])&&t[e]})),this.attachUrlParam(e,t)}return e}attachUrlParam(e,t){const n=m(t);return u(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}}),te=e("StringUtil",class{static fill(e,t,n){if(u(e)){if(u(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(u(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}});te.contextReg=/\$\{context.[a-zA-Z_$][a-zA-Z0-9_$]{1,}\}/g,te.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 ne(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 se(e,t,n,s={}){e.addEventListener(t,n,s);let r=()=>{e.removeEventListener(t,n,s),r=S};return()=>{r()}}function re(e,t){return t&&(e.target===t||ne(e).includes(t))}var oe="undefined"!=typeof window?window:void 0;var ie=Math.round;function ae(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?ie((s>>24&255)/255*1e4)/1e4:1}return n}function ce(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 le(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n]);return t}function ue(e){const t=i({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?le(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 F("lock和unlock次数不匹配!");this.count-=1,0===this.count&&this.endPromise()}async await(){this.promise&&await this.promise}});var he={childrenFields:["children"]},pe=new Error("中断操作");function de(e,t,n){try{!function(e,t,n){const{childrenFields:s}=r(he,n||{}),o=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==o?void 0:o.length)for(const e of o){if(t(e))throw pe;de(e,t,n)}}(e,t,n)}catch(e){if(e!==pe)throw e}}var fe={...he,compareField:"name"};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 me=R(T(),1),ge=R(C(),1),we=me.noConflict();ge.reg(we),ge.apply(we);var ye=e("IBizSys",class{constructor(){this.env=j,this.log=we,this.net=new ee,this.commands=new L,this.mc=new Z}})}}}));
2
2
  //# sourceMappingURL=index.system.min.js.map