halo-fe 1.0.20 → 1.0.21
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/main.js +707 -703
- package/esm/drivers/https/Http.d.ts +15 -9
- package/esm/drivers/https/implements/DefaultHttp.d.ts +6 -0
- package/esm/drivers/https/implements/HaloHttp.d.ts +3 -8
- package/esm/drivers/https/implements/MkHttp.d.ts +1 -6
- package/esm/drivers/i18ns/I18nFactory.d.ts +0 -4
- package/esm/drivers/i18ns/II18n.d.ts +9 -1
- package/esm/drivers/signers/Signer.d.ts +3 -0
- package/esm/factorying/index.d.ts +1 -5
- package/esm/svcs/@types/index.d.ts +1 -2
- package/esm/svcs/implement/ConfigSvc.d.ts +2 -2
- package/package.json +1 -1
package/dist/main.js
CHANGED
@@ -2,34 +2,34 @@ var vt = Object.defineProperty;
|
|
2
2
|
var wt = (u, t, e) => t in u ? vt(u, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : u[t] = e;
|
3
3
|
var n = (u, t, e) => wt(u, typeof t != "symbol" ? t + "" : t, e);
|
4
4
|
import { _ as Re } from "./assets/underscore-B0BCaBxV.js";
|
5
|
-
import { defineAsyncComponent as bt, reactive as Ge, defineComponent as Q, toRefs as
|
5
|
+
import { defineAsyncComponent as bt, reactive as Ge, defineComponent as Q, toRefs as te, openBlock as O, createElementBlock as B, createElementVNode as D, toDisplayString as he, unref as y, renderSlot as pe, createCommentVNode as Ze, watch as J, ref as I, onMounted as we, onUnmounted as be, normalizeStyle as fe, normalizeClass as Le, createTextVNode as xt, createBlock as He, withCtx as qe, mergeModels as Ke, useModel as et, nextTick as We, withDirectives as kt, vShow as St, createVNode as Ce, createStaticVNode as Ct, isRef as je, Fragment as Et, renderList as Tt, computed as Ee } from "vue";
|
6
6
|
import { _ as $t } from "./assets/underscore.string-oDfap0sE.js";
|
7
7
|
import { a as Lt } from "./assets/clone-DtpAsLoe.js";
|
8
8
|
import { F as At } from "./assets/file-saver-Cnua3zoa.js";
|
9
|
-
import { h as
|
9
|
+
import { h as H } from "./assets/moment-h96o7c8I.js";
|
10
10
|
import { L as Dt } from "./assets/liquidjs-C-LVcoaY.js";
|
11
|
-
class
|
11
|
+
class F {
|
12
12
|
}
|
13
13
|
/**
|
14
14
|
* 判断输入类型是否是字符串类型 null -> false
|
15
15
|
*/
|
16
|
-
n(
|
16
|
+
n(F, "isString", (t) => Object.prototype.toString.call(t) == "[object String]"), /**
|
17
17
|
* 判断输入类型是否是Object类型
|
18
18
|
*/
|
19
|
-
n(
|
19
|
+
n(F, "isObject", (t) => Object.prototype.toString.call(t) == "[object Object]"), /**
|
20
20
|
* 判断输入类型是否是Array类型
|
21
21
|
*/
|
22
|
-
n(
|
22
|
+
n(F, "isArray", (t) => Object.prototype.toString.call(t) == "[object Array]"), /**
|
23
23
|
* 判断输入类型是否是Number类型,null -> false
|
24
24
|
*/
|
25
|
-
n(
|
25
|
+
n(F, "isNumber", (t) => {
|
26
26
|
let e = Object.prototype.toString.call(t);
|
27
27
|
return e == "[object Number]" || e == "[object BigInt]";
|
28
28
|
}), /**
|
29
29
|
* 判断输入类型是否是isBoolean类型
|
30
30
|
*/
|
31
|
-
n(
|
32
|
-
const
|
31
|
+
n(F, "isBoolean", (t) => Object.prototype.toString.call(t) == "[object Boolean]");
|
32
|
+
const M = class M {
|
33
33
|
/**
|
34
34
|
* 获取最大值
|
35
35
|
*/
|
@@ -69,64 +69,64 @@ const F = class F {
|
|
69
69
|
/**
|
70
70
|
* 过滤某一页数据
|
71
71
|
*/
|
72
|
-
n(
|
72
|
+
n(M, "filterPage", (t, e, s) => {
|
73
73
|
let l = (e - 1) * s, r = e * s;
|
74
74
|
return t.filter((a, o) => o >= l && o < r);
|
75
75
|
}), /**
|
76
76
|
* 总页数
|
77
77
|
*/
|
78
|
-
n(
|
78
|
+
n(M, "pageCount", (t, e) => Math.ceil(t / e)), //#endregion
|
79
79
|
//#region 求值
|
80
80
|
/**
|
81
81
|
* 四舍五入
|
82
82
|
*/
|
83
|
-
n(
|
83
|
+
n(M, "round", (t, e) => t.toFixed(e)), /**
|
84
84
|
* 天花板函数
|
85
85
|
*/
|
86
|
-
n(
|
86
|
+
n(M, "ceil", (t) => Math.ceil(t)), //#endregion
|
87
87
|
//#region 进度
|
88
88
|
/**
|
89
89
|
* 获取百分比
|
90
90
|
*/
|
91
|
-
n(
|
91
|
+
n(M, "getPercentage", (t, e) => {
|
92
92
|
if (!t || !e)
|
93
93
|
return 0;
|
94
|
-
let s = t / e * 100, l =
|
94
|
+
let s = t / e * 100, l = M.round(s, 2);
|
95
95
|
return parseFloat(l);
|
96
96
|
}), /**
|
97
97
|
* 获取进度文本
|
98
98
|
*/
|
99
|
-
n(
|
99
|
+
n(M, "getProgressText", (t, e) => `${t ?? "-"}/${e ?? "-"}`), /**
|
100
100
|
* 获取百分比,保留2位小数
|
101
101
|
*/
|
102
|
-
n(
|
102
|
+
n(M, "getPercentageText", (t, e) => M.getPercentage(t, e).toFixed(2)), //#endregion
|
103
103
|
/**
|
104
104
|
* 获取大小
|
105
105
|
*/
|
106
|
-
n(
|
106
|
+
n(M, "size", (t) => {
|
107
107
|
if (!t)
|
108
108
|
return "OKB";
|
109
109
|
let e = 1024, s = e * 1024;
|
110
110
|
if (t < s)
|
111
|
-
return
|
111
|
+
return M.round(t / e, 2) + "KB";
|
112
112
|
let l = s * 1024;
|
113
113
|
if (t < l)
|
114
|
-
return
|
114
|
+
return M.round(t / s, 2) + "MB";
|
115
115
|
let r = l * 1024;
|
116
116
|
if (t < r)
|
117
|
-
return
|
117
|
+
return M.round(t / l, 2) + "GB";
|
118
118
|
let i = r * 1024;
|
119
119
|
if (t < i)
|
120
|
-
return
|
120
|
+
return M.round(t / r, 2) + "TB";
|
121
121
|
throw new Error("暂未支持比TB更大的大小");
|
122
122
|
});
|
123
|
-
let
|
123
|
+
let re = M;
|
124
124
|
const S = class S {
|
125
125
|
/**
|
126
126
|
* 获取分成指定片数量后的集合
|
127
127
|
*/
|
128
128
|
static getChunksByCount(t, e) {
|
129
|
-
let s = [], l =
|
129
|
+
let s = [], l = re.ceil(t.length / e);
|
130
130
|
for (let r = 0; r < t.length; r += l) {
|
131
131
|
let i = this.getRange(t, r, l);
|
132
132
|
s.push(i);
|
@@ -341,9 +341,9 @@ n(S, "pushIfNotExist", (t, e) => {
|
|
341
341
|
* 删除执行数组中的指定对象或者集合
|
342
342
|
*/
|
343
343
|
n(S, "remove", (t, e) => {
|
344
|
-
if (
|
344
|
+
if (F.isNumber(e))
|
345
345
|
t.splice(e, 1);
|
346
|
-
else if (
|
346
|
+
else if (F.isArray(e))
|
347
347
|
for (let s = 0; s < e.length; s++)
|
348
348
|
S.remove(t, e[s]);
|
349
349
|
else
|
@@ -398,7 +398,7 @@ n(S, "groupByArray", (t, e) => {
|
|
398
398
|
i == null && (i = { key: r, value: [] }, s.push(i)), i.value.push(l);
|
399
399
|
}), s;
|
400
400
|
});
|
401
|
-
let
|
401
|
+
let oe = S;
|
402
402
|
const x = class x {
|
403
403
|
/**
|
404
404
|
* 根据字符串或数组,自动返回数组
|
@@ -488,7 +488,7 @@ n(x, "isJson", (t) => {
|
|
488
488
|
if (!t)
|
489
489
|
return !1;
|
490
490
|
let e = JSON.parse(t);
|
491
|
-
return
|
491
|
+
return F.isObject(e);
|
492
492
|
} catch {
|
493
493
|
return !1;
|
494
494
|
}
|
@@ -547,7 +547,7 @@ n(x, "getBetween", (t, e, s) => {
|
|
547
547
|
*/
|
548
548
|
n(x, "padStart", (t, e, s) => t.padStart(e, s));
|
549
549
|
let W = x;
|
550
|
-
const
|
550
|
+
const Te = class Te {
|
551
551
|
//#region 净化
|
552
552
|
/**
|
553
553
|
* 净化对象,返回不带默认属性的对象
|
@@ -556,7 +556,7 @@ const $e = class $e {
|
|
556
556
|
let e = {}, s = Object.keys(t);
|
557
557
|
for (let l = 0; l < s.length; l++) {
|
558
558
|
let r = s[l], i = t[r];
|
559
|
-
i != null && (
|
559
|
+
i != null && (F.isObject(i) ? e[r] = this.pure(i) : e[r] = t[r]);
|
560
560
|
}
|
561
561
|
return e;
|
562
562
|
}
|
@@ -605,10 +605,10 @@ const $e = class $e {
|
|
605
605
|
let s = Lt(t, !0);
|
606
606
|
if (e == null)
|
607
607
|
return s;
|
608
|
-
if (
|
608
|
+
if (F.isArray(t))
|
609
609
|
for (let l = 0; l < s.length; l++)
|
610
610
|
e(s[l]);
|
611
|
-
else
|
611
|
+
else F.isObject(t) && e(s);
|
612
612
|
return s;
|
613
613
|
}
|
614
614
|
//#endregion
|
@@ -617,9 +617,9 @@ const $e = class $e {
|
|
617
617
|
* 合并来源对象到目标对象上
|
618
618
|
*/
|
619
619
|
static mergeTo(t, e) {
|
620
|
-
return t == null ? e : e == null ? t :
|
620
|
+
return t == null ? e : e == null ? t : F.isArray(e) ? e.slice() : (Object.keys(e).forEach((l) => {
|
621
621
|
let r = e[l];
|
622
|
-
typeof r == "object" ? t[l] =
|
622
|
+
typeof r == "object" ? t[l] = Te.mergeTo(t[l], r) : t[l] = r;
|
623
623
|
}), t);
|
624
624
|
}
|
625
625
|
//#endregion
|
@@ -645,9 +645,9 @@ const $e = class $e {
|
|
645
645
|
/**
|
646
646
|
* 手动复制,并对字段执行指定自定义处理
|
647
647
|
*/
|
648
|
-
n(
|
648
|
+
n(Te, "copy", (t, e = null) => {
|
649
649
|
let s = [];
|
650
|
-
|
650
|
+
F.isObject(t) && s.push(t);
|
651
651
|
let l = [];
|
652
652
|
for (let r = 0; r < s.length; r++) {
|
653
653
|
let i = s[r], a = {};
|
@@ -656,21 +656,21 @@ n($e, "copy", (t, e = null) => {
|
|
656
656
|
e && e[o] ? a[o] = e[o]() : a[o] = c;
|
657
657
|
}), l.push(a);
|
658
658
|
}
|
659
|
-
return
|
659
|
+
return F.isObject(t) ? l[0] : l;
|
660
660
|
}), //#endregion
|
661
661
|
//#region 赋值
|
662
662
|
/**
|
663
663
|
* 给对象添加多层属性,并赋值
|
664
664
|
*/
|
665
|
-
n(
|
665
|
+
n(Te, "addProperties", (t, e, s) => {
|
666
666
|
let l = t;
|
667
667
|
for (let r = 0; r < e.length; r++) {
|
668
668
|
let i = e[r];
|
669
669
|
r == e.length - 1 ? l[i] = s : (l[i] || (l[i] = {}), l = l[i]);
|
670
670
|
}
|
671
671
|
});
|
672
|
-
let
|
673
|
-
class
|
672
|
+
let X = Te;
|
673
|
+
class Be {
|
674
674
|
//#region 取值
|
675
675
|
/**
|
676
676
|
* 从指定字典中提取忽略大小写的key的值
|
@@ -860,7 +860,7 @@ const z = class z {
|
|
860
860
|
*/
|
861
861
|
static serialize(t, e = !0) {
|
862
862
|
let s = (r) => e ? encodeURIComponent(r) : r;
|
863
|
-
return
|
863
|
+
return Be.join(t, s, "=", "&");
|
864
864
|
}
|
865
865
|
//endregion
|
866
866
|
//region 编码和解码
|
@@ -888,13 +888,13 @@ n(z, "handleQueryValue", (t, e) => {
|
|
888
888
|
if (t instanceof Array) {
|
889
889
|
if (t.length > 0)
|
890
890
|
for (let l = 0; l < t.length; l++) {
|
891
|
-
let r =
|
891
|
+
let r = X.clone(e);
|
892
892
|
r.push(""), s += z.handleQueryValue(t[l], r);
|
893
893
|
}
|
894
894
|
} else if (t instanceof Object) {
|
895
895
|
let l = Object.keys(t);
|
896
896
|
for (let r of l) {
|
897
|
-
let i =
|
897
|
+
let i = X.clone(e);
|
898
898
|
i.push(r), s += z.handleQueryValue(t[r], i);
|
899
899
|
}
|
900
900
|
} else {
|
@@ -918,7 +918,7 @@ n(z, "getUrl", (t, e = null) => {
|
|
918
918
|
return null;
|
919
919
|
if (e == null)
|
920
920
|
return t;
|
921
|
-
let s = z.deserialize(t), l =
|
921
|
+
let s = z.deserialize(t), l = X.mergeTo(s, e);
|
922
922
|
return z.getPath(t) + "?" + z.getQuery(l);
|
923
923
|
}), /**
|
924
924
|
* 获取超链接配置对象
|
@@ -966,12 +966,12 @@ n(It, "getName", (t, e) => {
|
|
966
966
|
let s = K.getPath(t);
|
967
967
|
return s ? s == "/" ? e : e + s.replace(/\//g, "-").toLowerCase() : null;
|
968
968
|
});
|
969
|
-
const
|
969
|
+
const ae = class ae {
|
970
970
|
};
|
971
971
|
/**
|
972
972
|
* 保存文件
|
973
973
|
*/
|
974
|
-
n(
|
974
|
+
n(ae, "save", (t, e) => {
|
975
975
|
let s = window.atob(t), l = s.length, r = new Uint8Array(l);
|
976
976
|
for (; l--; )
|
977
977
|
r[l] = s.charCodeAt(l);
|
@@ -980,24 +980,24 @@ n(oe, "save", (t, e) => {
|
|
980
980
|
}), /**
|
981
981
|
* 获取文件扩展名
|
982
982
|
*/
|
983
|
-
n(
|
983
|
+
n(ae, "getExtension", (t) => {
|
984
984
|
let e = t.lastIndexOf(".");
|
985
985
|
return e == -1 ? "" : t.substring(e).split("?")[0];
|
986
986
|
}), /**
|
987
987
|
* 判断当前文件名是否是excel文件
|
988
988
|
*/
|
989
|
-
n(
|
990
|
-
let e =
|
989
|
+
n(ae, "isExcel", (t) => {
|
990
|
+
let e = ae.getExtension(t);
|
991
991
|
return [".xls", ".xlsx"].indexOf(e) > -1;
|
992
992
|
}), /**
|
993
993
|
* 判断当前文件是否是图片文件
|
994
994
|
*/
|
995
|
-
n(
|
996
|
-
let e =
|
995
|
+
n(ae, "isImage", (t) => {
|
996
|
+
let e = ae.getExtension(t);
|
997
997
|
return [".png", ".jpg", ".jpeg", ".bmp", ".gif"].indexOf(e) > -1;
|
998
998
|
});
|
999
|
-
let
|
1000
|
-
const
|
999
|
+
let De = ae;
|
1000
|
+
const Y = class Y {
|
1001
1001
|
//#region 颜色
|
1002
1002
|
/**
|
1003
1003
|
* 根据字符串Ascii码得到固定颜色字典
|
@@ -1150,13 +1150,13 @@ const G = class G {
|
|
1150
1150
|
let i = t.querySelector(s);
|
1151
1151
|
if (!i)
|
1152
1152
|
return null;
|
1153
|
-
let a = {}, o = t.getBoundingClientRect(), c = l.getBoundingClientRect(), d = t.querySelector(e).getBoundingClientRect(), p = i.getBoundingClientRect(),
|
1153
|
+
let a = {}, o = t.getBoundingClientRect(), c = l.getBoundingClientRect(), d = t.querySelector(e).getBoundingClientRect(), p = i.getBoundingClientRect(), g = c.height - d.top;
|
1154
1154
|
if (r == "right") {
|
1155
1155
|
a.left = `${o.left + o.width}px`;
|
1156
1156
|
let b;
|
1157
1157
|
p.height > c.height ? b = c.height : b = p.height, a.height = `${b}px`, b + d.top > c.height ? (a.top = "initial", a.bottom = "0px") : a.top = `${o.top}px`;
|
1158
1158
|
} else if (r == "bottom")
|
1159
|
-
|
1159
|
+
g -= d.height, a.left = `${o.left}px`, a.top = `${o.top + o.height}px`, g < p.height ? a.height = `${g}px` : a.height = `${p.height}px`;
|
1160
1160
|
else
|
1161
1161
|
throw new Error(`暂未支持的position:${r}`);
|
1162
1162
|
return a;
|
@@ -1214,13 +1214,13 @@ const G = class G {
|
|
1214
1214
|
* 获取行内标签,如: style(非link)
|
1215
1215
|
*/
|
1216
1216
|
static getInlineTagByUrl(t) {
|
1217
|
-
return
|
1217
|
+
return De.getExtension(t) == ".css" ? "style" : "script";
|
1218
1218
|
}
|
1219
1219
|
/**
|
1220
1220
|
* 获取资源标签,如: link
|
1221
1221
|
*/
|
1222
1222
|
static getTagByUrl(t) {
|
1223
|
-
return
|
1223
|
+
return De.getExtension(t) == ".css" ? "link" : "script";
|
1224
1224
|
}
|
1225
1225
|
//#endregion
|
1226
1226
|
//#region 文本
|
@@ -1238,7 +1238,7 @@ const G = class G {
|
|
1238
1238
|
/**
|
1239
1239
|
* 添加类
|
1240
1240
|
*/
|
1241
|
-
n(
|
1241
|
+
n(Y, "addClass", (t, e, s = null) => {
|
1242
1242
|
let l;
|
1243
1243
|
if (e == null || e == "") {
|
1244
1244
|
if (s == null || s == "")
|
@@ -1250,7 +1250,7 @@ n(G, "addClass", (t, e, s = null) => {
|
|
1250
1250
|
}), /**
|
1251
1251
|
* 删除类
|
1252
1252
|
*/
|
1253
|
-
n(
|
1253
|
+
n(Y, "removeClass", (t, e, s = null) => {
|
1254
1254
|
if (e == null || e == "")
|
1255
1255
|
return;
|
1256
1256
|
let l = [];
|
@@ -1268,7 +1268,7 @@ n(G, "removeClass", (t, e, s = null) => {
|
|
1268
1268
|
/**
|
1269
1269
|
* 获取dom宽度或高度
|
1270
1270
|
*/
|
1271
|
-
n(
|
1271
|
+
n(Y, "getWidthOrHeight", (t, e, s = null) => {
|
1272
1272
|
let l = 0, r = [];
|
1273
1273
|
t instanceof Array && r.push(...t), t instanceof HTMLCollection ? r.push(...t) : r.push(t);
|
1274
1274
|
for (let i = 0; i < r.length; i++) {
|
@@ -1282,21 +1282,21 @@ n(G, "getWidthOrHeight", (t, e, s = null) => {
|
|
1282
1282
|
}), /**
|
1283
1283
|
* 根据路径获取标签(无src)
|
1284
1284
|
*/
|
1285
|
-
n(
|
1286
|
-
let e =
|
1285
|
+
n(Y, "createEmptyByUrl", (t) => {
|
1286
|
+
let e = Y.getInlineTagByUrl(t);
|
1287
1287
|
return document.createElement(e);
|
1288
1288
|
}), /**
|
1289
1289
|
* 根据路径获取待加载的元素,同时包含Url
|
1290
1290
|
*/
|
1291
|
-
n(
|
1292
|
-
let e =
|
1291
|
+
n(Y, "createByUrl", (t) => {
|
1292
|
+
let e = Y.getTagByUrl(t), s = document.createElement(e);
|
1293
1293
|
return s instanceof HTMLLinkElement ? (s.href = t, s.rel = "stylesheet") : s instanceof HTMLScriptElement && (s.src = t), s;
|
1294
1294
|
}), /**
|
1295
1295
|
* 根据路径获取元素
|
1296
1296
|
* VIP:已废弃,不能用改方法判断资源是否加载完毕,因为可能只是脚本创建,资源还未加载完毕
|
1297
1297
|
*/
|
1298
|
-
n(
|
1299
|
-
let e =
|
1298
|
+
n(Y, "getByUrl", (t) => {
|
1299
|
+
let e = Y.getTagByUrl(t), s = document.querySelectorAll(e);
|
1300
1300
|
for (let l of s) {
|
1301
1301
|
if (l instanceof HTMLLinkElement && l.href == t)
|
1302
1302
|
return l;
|
@@ -1309,46 +1309,46 @@ n(G, "getByUrl", (t) => {
|
|
1309
1309
|
/**
|
1310
1310
|
* 判断选择器内容是否溢出
|
1311
1311
|
*/
|
1312
|
-
n(
|
1312
|
+
n(Y, "isEllipsis", (t) => {
|
1313
1313
|
let e = document.querySelector(t);
|
1314
1314
|
return e.clientWidth < e.scrollWidth;
|
1315
1315
|
});
|
1316
|
-
let
|
1317
|
-
class
|
1316
|
+
let j = Y;
|
1317
|
+
class ie {
|
1318
1318
|
}
|
1319
1319
|
/**
|
1320
1320
|
* 批量绑定事件,执行指定处理函数
|
1321
1321
|
*/
|
1322
|
-
n(
|
1322
|
+
n(ie, "bind", (t, e, s) => {
|
1323
1323
|
e && t.forEach((l) => {
|
1324
1324
|
e.addEventListener(l, s, !0);
|
1325
1325
|
});
|
1326
1326
|
}), /**
|
1327
1327
|
* 批量绑定事件,执行指定处理函数
|
1328
1328
|
*/
|
1329
|
-
n(
|
1329
|
+
n(ie, "unbind", (t, e, s) => {
|
1330
1330
|
e && t.forEach((l) => {
|
1331
1331
|
e.removeEventListener(l, s, !0);
|
1332
1332
|
});
|
1333
1333
|
}), /**
|
1334
1334
|
* 绑定点击处理函数
|
1335
1335
|
*/
|
1336
|
-
n(
|
1336
|
+
n(ie, "click", (t, e) => {
|
1337
1337
|
t && t.addEventListener("click", e, !0);
|
1338
1338
|
}), /**
|
1339
1339
|
* 解除点击监听
|
1340
1340
|
*/
|
1341
|
-
n(
|
1341
|
+
n(ie, "unclick", (t, e) => {
|
1342
1342
|
t && t.removeEventListener("click", e, !0);
|
1343
1343
|
}), /**
|
1344
1344
|
* 绑定滚动处理函数
|
1345
1345
|
*/
|
1346
|
-
n(
|
1346
|
+
n(ie, "scroll", (t, e) => {
|
1347
1347
|
t && t.addEventListener("scroll", e, !0);
|
1348
1348
|
}), /**
|
1349
1349
|
* 移除滚动处理函数,防止内存泄漏
|
1350
1350
|
*/
|
1351
|
-
n(
|
1351
|
+
n(ie, "unscroll", (t, e) => {
|
1352
1352
|
t && t.removeEventListener("scroll", e, !0);
|
1353
1353
|
});
|
1354
1354
|
class Qe {
|
@@ -1356,13 +1356,13 @@ class Qe {
|
|
1356
1356
|
/**
|
1357
1357
|
* 获取Html内容
|
1358
1358
|
*/
|
1359
|
-
n(Qe, "getHtml", (t) =>
|
1359
|
+
n(Qe, "getHtml", (t) => F.isNumber(t) ? t : t && t.replace(/\n/g, "<br/>")), /**
|
1360
1360
|
* 获取Html中的文字
|
1361
1361
|
*/
|
1362
1362
|
n(Qe, "getText", (t) => {
|
1363
1363
|
if (!t)
|
1364
1364
|
return null;
|
1365
|
-
if (!
|
1365
|
+
if (!F.isString(t))
|
1366
1366
|
return t;
|
1367
1367
|
let e = new RegExp("<[^<>]+>", "g");
|
1368
1368
|
return t.replace(e, "");
|
@@ -1373,40 +1373,40 @@ class Ot {
|
|
1373
1373
|
* 获取base64图片地址
|
1374
1374
|
*/
|
1375
1375
|
n(Ot, "base64", (t) => "data:image/png;base64," + t);
|
1376
|
-
class
|
1376
|
+
class Rt {
|
1377
1377
|
}
|
1378
1378
|
/**
|
1379
1379
|
* 加载乾坤子应用
|
1380
1380
|
*/
|
1381
|
-
n(
|
1381
|
+
n(Rt, "load", function(t, e, s, l) {
|
1382
1382
|
});
|
1383
|
-
const
|
1383
|
+
const $e = class $e {
|
1384
1384
|
};
|
1385
1385
|
/**
|
1386
1386
|
* 激发主框架事件
|
1387
1387
|
*/
|
1388
|
-
n(
|
1389
|
-
|
1388
|
+
n($e, "emit", (t, e) => {
|
1389
|
+
$e.emits({ [t]: e });
|
1390
1390
|
}), /**
|
1391
1391
|
* 批量激发主框架事件
|
1392
1392
|
*/
|
1393
|
-
n(
|
1393
|
+
n($e, "emits", (t) => {
|
1394
1394
|
var s, l;
|
1395
1395
|
let e = (l = (s = window.parent) == null ? void 0 : s.window) == null ? void 0 : l.emit;
|
1396
1396
|
e && Object.keys(t).forEach((r) => {
|
1397
1397
|
e(r, t[r]);
|
1398
1398
|
});
|
1399
1399
|
});
|
1400
|
-
let
|
1401
|
-
class
|
1400
|
+
let ve = $e;
|
1401
|
+
class Se {
|
1402
1402
|
}
|
1403
1403
|
/**
|
1404
1404
|
* 延时指定ms后执行指定任务
|
1405
1405
|
*/
|
1406
|
-
n(
|
1406
|
+
n(Se, "delay", (t, e) => setTimeout(t, e)), /**
|
1407
1407
|
* 在执行指定延时后,每隔指定ms执行指定任务
|
1408
1408
|
*/
|
1409
|
-
n(
|
1409
|
+
n(Se, "execute", (t, e, s) => {
|
1410
1410
|
if (!s) {
|
1411
1411
|
let l = setInterval(t, e);
|
1412
1412
|
return Promise.resolve(l);
|
@@ -1420,12 +1420,12 @@ n(Ee, "execute", (t, e, s) => {
|
|
1420
1420
|
}), /**
|
1421
1421
|
* 清空定时器
|
1422
1422
|
*/
|
1423
|
-
n(
|
1423
|
+
n(Se, "clearInterval", (t) => {
|
1424
1424
|
clearInterval(t);
|
1425
1425
|
}), /**
|
1426
1426
|
* 防抖(指定时间内只触发一次)
|
1427
1427
|
*/
|
1428
|
-
n(
|
1428
|
+
n(Se, "debounce", (t, e) => {
|
1429
1429
|
let s = null;
|
1430
1430
|
return (l) => {
|
1431
1431
|
s && clearTimeout(s), s = setTimeout(t, e, l);
|
@@ -1433,7 +1433,7 @@ n(Ee, "debounce", (t, e) => {
|
|
1433
1433
|
}), /**
|
1434
1434
|
* 节流:https://segmentfault.com/a/1190000018428170
|
1435
1435
|
*/
|
1436
|
-
n(
|
1436
|
+
n(Se, "throttle", (t, e) => {
|
1437
1437
|
let s = !0;
|
1438
1438
|
return (l) => {
|
1439
1439
|
if (!s)
|
@@ -1443,7 +1443,7 @@ n(Ee, "throttle", (t, e) => {
|
|
1443
1443
|
}, e, l);
|
1444
1444
|
};
|
1445
1445
|
});
|
1446
|
-
class
|
1446
|
+
class jt {
|
1447
1447
|
constructor() {
|
1448
1448
|
n(this, "value");
|
1449
1449
|
}
|
@@ -1459,7 +1459,7 @@ n(A, "getTimestamp", (t = null) => (t ? new Date(t) : /* @__PURE__ */ new Date()
|
|
1459
1459
|
n(A, "getTime", (t = null) => t ? new Date(t) : /* @__PURE__ */ new Date()), /**
|
1460
1460
|
* 格式化时间
|
1461
1461
|
*/
|
1462
|
-
n(A, "format", (t, e) =>
|
1462
|
+
n(A, "format", (t, e) => H(t).format(e)), /**
|
1463
1463
|
* 获取当前日期时间的字符串
|
1464
1464
|
*/
|
1465
1465
|
n(A, "getDateTimeString", () => A.formatSecondTime(/* @__PURE__ */ new Date())), /**
|
@@ -1471,31 +1471,31 @@ n(A, "getDateString", () => A.formatDate(/* @__PURE__ */ new Date())), /**
|
|
1471
1471
|
n(A, "getTimeString", () => A.formatTime(/* @__PURE__ */ new Date())), /**
|
1472
1472
|
* 对时间值进行时间格式化
|
1473
1473
|
*/
|
1474
|
-
n(A, "formatSecondTime", (t) =>
|
1474
|
+
n(A, "formatSecondTime", (t) => H(t).format("YYYY-MM-DD HH:mm:ss")), /**
|
1475
1475
|
* 对时间值进行时间格式化
|
1476
1476
|
*/
|
1477
|
-
n(A, "formatMillisecondTime", (t) => t ?
|
1477
|
+
n(A, "formatMillisecondTime", (t) => t ? H(t).format("YYYY-MM-DD HH:mm:ss SSS") : null), /**
|
1478
1478
|
* 格式化成24小时时间格式
|
1479
1479
|
*/
|
1480
|
-
n(A, "formatTime", (t) => t ?
|
1480
|
+
n(A, "formatTime", (t) => t ? H(t).format("HH:mm:ss SSS") : null), /**
|
1481
1481
|
* 对时间值进行日期格式化
|
1482
1482
|
*/
|
1483
|
-
n(A, "formatDate", (t) => t ?
|
1483
|
+
n(A, "formatDate", (t) => t ? H(t).format("YYYY-MM-DD") : null), /**
|
1484
1484
|
* 添加天数
|
1485
1485
|
*/
|
1486
|
-
n(A, "addDays", (t, e) => t ?
|
1486
|
+
n(A, "addDays", (t, e) => t ? H(t).add(e, "days").toDate() : null), /**
|
1487
1487
|
* 添加月份
|
1488
1488
|
*/
|
1489
|
-
n(A, "addMonths", (t, e) => t ?
|
1489
|
+
n(A, "addMonths", (t, e) => t ? H(t).add(e, "months").toDate() : null), /**
|
1490
1490
|
* 添加小时
|
1491
1491
|
*/
|
1492
|
-
n(A, "addHours", (t, e) => t ?
|
1492
|
+
n(A, "addHours", (t, e) => t ? H(t).add(e, "hours").toDate() : null), /**
|
1493
1493
|
* 判断指定时间是否是周末
|
1494
1494
|
*/
|
1495
1495
|
n(A, "isWeekend", (t) => {
|
1496
1496
|
if (!t)
|
1497
1497
|
return !1;
|
1498
|
-
let e =
|
1498
|
+
let e = H(t).format("d");
|
1499
1499
|
return e == "6" || e == "0";
|
1500
1500
|
}), /**
|
1501
1501
|
* 把中国时间,转换为当地时间
|
@@ -1504,9 +1504,9 @@ n(A, "localeTime", (t) => {
|
|
1504
1504
|
if (!t)
|
1505
1505
|
return null;
|
1506
1506
|
let s = (/* @__PURE__ */ new Date()).getTimezoneOffset() + 480;
|
1507
|
-
return
|
1507
|
+
return H(t).add(s, "minutes").toDate();
|
1508
1508
|
});
|
1509
|
-
let
|
1509
|
+
let ee = A;
|
1510
1510
|
const k = class k {
|
1511
1511
|
};
|
1512
1512
|
/**
|
@@ -1530,7 +1530,7 @@ n(k, "getById", (t, e, s, l) => {
|
|
1530
1530
|
* 树节点
|
1531
1531
|
*/
|
1532
1532
|
n(k, "getByIds", (t, e, s, l) => {
|
1533
|
-
let r =
|
1533
|
+
let r = oe.distinct(t, (a) => a), i = [];
|
1534
1534
|
return r.forEach((a) => {
|
1535
1535
|
let o = k.getById(a, e, s, l);
|
1536
1536
|
i.push(o);
|
@@ -1574,13 +1574,13 @@ n(k, "getParentsById", (t, e, s, l, r = !1) => {
|
|
1574
1574
|
*/
|
1575
1575
|
n(k, "getChildrenById", (t, e, s, l, r = !1) => {
|
1576
1576
|
let i = k.getById(t, e, s, l), a = [];
|
1577
|
-
return r && a.push(i),
|
1577
|
+
return r && a.push(i), Pe(i, l, a), a;
|
1578
1578
|
}), /**
|
1579
1579
|
* 获取当前节点的所有孩子节点的集合
|
1580
1580
|
*/
|
1581
1581
|
n(k, "getChildren", (t, e, s = !1) => {
|
1582
1582
|
let l = [];
|
1583
|
-
return s && l.push(t),
|
1583
|
+
return s && l.push(t), Pe(t, e, l), l;
|
1584
1584
|
}), /**
|
1585
1585
|
* 搜索指定文本的树结构
|
1586
1586
|
*/
|
@@ -1588,13 +1588,13 @@ n(k, "searchTree", (t, e, s, l) => {
|
|
1588
1588
|
let r = [];
|
1589
1589
|
if (!e)
|
1590
1590
|
return r;
|
1591
|
-
let i = t ? t.toUpperCase() : "", a =
|
1591
|
+
let i = t ? t.toUpperCase() : "", a = F.isString(l) ? [l] : l;
|
1592
1592
|
for (let o of e) {
|
1593
1593
|
let c = !1, h = k.getChildren(o, s, !0);
|
1594
1594
|
for (let d of h) {
|
1595
1595
|
for (let p of a) {
|
1596
|
-
let
|
1597
|
-
if ((
|
1596
|
+
let g = d[p];
|
1597
|
+
if ((g ? g.toUpperCase() : "").indexOf(i) > -1) {
|
1598
1598
|
c = !0;
|
1599
1599
|
break;
|
1600
1600
|
}
|
@@ -1614,11 +1614,11 @@ n(k, "searchTree", (t, e, s, l) => {
|
|
1614
1614
|
n(k, "removeById", (t, e, s, l) => {
|
1615
1615
|
let r = k.getById(t, e, s, l), i = k.getParentsById(t, e, s, l);
|
1616
1616
|
if (i.length == 0) {
|
1617
|
-
|
1617
|
+
oe.remove(s, r);
|
1618
1618
|
return;
|
1619
1619
|
}
|
1620
1620
|
let a = i[i.length - 1];
|
1621
|
-
|
1621
|
+
oe.remove(a[l], r);
|
1622
1622
|
}), /**
|
1623
1623
|
* 获取树结构扁平化后的节点信息
|
1624
1624
|
*/
|
@@ -1648,7 +1648,7 @@ n(k, "map", (t, e, s, l) => {
|
|
1648
1648
|
}
|
1649
1649
|
return r;
|
1650
1650
|
});
|
1651
|
-
let
|
1651
|
+
let Ie = k;
|
1652
1652
|
function tt(u, t, e, s, l, r) {
|
1653
1653
|
for (let i = 0; i < e.length; i++) {
|
1654
1654
|
let a = e[i];
|
@@ -1656,17 +1656,17 @@ function tt(u, t, e, s, l, r) {
|
|
1656
1656
|
r && l.push(a);
|
1657
1657
|
break;
|
1658
1658
|
} else
|
1659
|
-
|
1659
|
+
Ie.getById(u, t, a[s], s) != null && (l.push(a), tt(u, t, a[s], s, l, r));
|
1660
1660
|
}
|
1661
1661
|
return l;
|
1662
1662
|
}
|
1663
|
-
function
|
1663
|
+
function Pe(u, t, e) {
|
1664
1664
|
let s = u[t];
|
1665
1665
|
if (!s || s.length == 0)
|
1666
1666
|
return e;
|
1667
1667
|
for (let l = 0; l < s.length; l++) {
|
1668
1668
|
let r = s[l];
|
1669
|
-
e.push(r),
|
1669
|
+
e.push(r), Pe(r, t, e);
|
1670
1670
|
}
|
1671
1671
|
return e;
|
1672
1672
|
}
|
@@ -1696,13 +1696,13 @@ class _t {
|
|
1696
1696
|
n(this, "beautify", !1);
|
1697
1697
|
}
|
1698
1698
|
}
|
1699
|
-
class
|
1699
|
+
class _ {
|
1700
1700
|
//#region 序列化
|
1701
1701
|
/**
|
1702
1702
|
* 对非字符串进行序列化
|
1703
1703
|
*/
|
1704
1704
|
static serializeWithoutString(t) {
|
1705
|
-
return typeof t == "string" ? t :
|
1705
|
+
return typeof t == "string" ? t : _.serialize(t, !0);
|
1706
1706
|
}
|
1707
1707
|
/**
|
1708
1708
|
* 把对象格式化为Json字符串
|
@@ -1713,7 +1713,7 @@ class M {
|
|
1713
1713
|
e == null && (e = new _t());
|
1714
1714
|
let l = (typeof e == "boolean" ? e : e.beautify) ? 2 : null, r;
|
1715
1715
|
if (typeof t == "string") {
|
1716
|
-
let a =
|
1716
|
+
let a = _.deserialize(t);
|
1717
1717
|
if (a == null)
|
1718
1718
|
return t;
|
1719
1719
|
r = a;
|
@@ -1800,7 +1800,7 @@ class M {
|
|
1800
1800
|
let a = t[i], o = l(a);
|
1801
1801
|
o.type == "array" ? (o.remark && (r += this.fillSpace(2 * s) + "//" + o.remark + `
|
1802
1802
|
`), r += this.fillKey(2 * s, o.key) + "[", r += this.buildObjectLevel(a[e], e, s + 1, l), r += "]", i != t.length - 1 && (r += ",")) : o.type == "object" ? (o.remark && (r += this.fillSpace(2 * s) + "//" + o.remark + `
|
1803
|
-
`), r += this.fillKey(2 * s, o.key), r += this.buildObjectLevel(a[e], e, s + 1, l), i != t.length - 1 && (r += ",")) : (r += this.fillKey(2 * s, o.key), o.type == "string" ? r += '""' : o.type == "date" ? r += `"${
|
1803
|
+
`), r += this.fillKey(2 * s, o.key), r += this.buildObjectLevel(a[e], e, s + 1, l), i != t.length - 1 && (r += ",")) : (r += this.fillKey(2 * s, o.key), o.type == "string" ? r += '""' : o.type == "date" ? r += `"${ee.getDateTimeString()}"` : o.type == "int" || o.type == "number" ? r += "0" : o.type == "boolean" ? r += "false" : r += null, i != t.length - 1 && (r += ","), o.remark && (r += " //" + o.remark)), r += `
|
1804
1804
|
`;
|
1805
1805
|
}
|
1806
1806
|
return r += this.fillSpace(2 * (s - 1)), r += "}", r;
|
@@ -1847,7 +1847,7 @@ class Bt {
|
|
1847
1847
|
return this.clean(t), K.serialize(t, e);
|
1848
1848
|
}
|
1849
1849
|
}
|
1850
|
-
class
|
1850
|
+
class P {
|
1851
1851
|
constructor() {
|
1852
1852
|
//#region 属性
|
1853
1853
|
/**
|
@@ -1924,24 +1924,24 @@ class B {
|
|
1924
1924
|
}
|
1925
1925
|
//#endregion
|
1926
1926
|
}
|
1927
|
-
class
|
1927
|
+
class Oe {
|
1928
1928
|
constructor() {
|
1929
1929
|
n(this, "type");
|
1930
1930
|
}
|
1931
1931
|
}
|
1932
|
-
class Pt extends
|
1932
|
+
class Pt extends Oe {
|
1933
1933
|
constructor() {
|
1934
1934
|
super(...arguments);
|
1935
1935
|
n(this, "type", "Json");
|
1936
1936
|
}
|
1937
1937
|
insert(e) {
|
1938
|
-
return
|
1938
|
+
return _.serialize(e.rows, !0);
|
1939
1939
|
}
|
1940
1940
|
update(e) {
|
1941
|
-
return
|
1941
|
+
return _.serialize(e.rows, !0);
|
1942
1942
|
}
|
1943
1943
|
}
|
1944
|
-
class Ut extends
|
1944
|
+
class Ut extends Oe {
|
1945
1945
|
constructor() {
|
1946
1946
|
super(...arguments);
|
1947
1947
|
n(this, "type", "Mongo");
|
@@ -1949,7 +1949,7 @@ class Ut extends je {
|
|
1949
1949
|
insert(e) {
|
1950
1950
|
let { name: s, columns: l, rows: r } = e, i = "";
|
1951
1951
|
for (let a = 0; a < r.length; a++) {
|
1952
|
-
let o = r[a], c =
|
1952
|
+
let o = r[a], c = _.serialize(o, !0);
|
1953
1953
|
i += `db.${s}.insert(${c})`, a != r.length - 1 && (i += `\r
|
1954
1954
|
`);
|
1955
1955
|
}
|
@@ -1958,19 +1958,19 @@ class Ut extends je {
|
|
1958
1958
|
update(e) {
|
1959
1959
|
let { name: s, columns: l, rows: r } = e, i = "", a = l.filter((o) => o.key).map((o) => o.name);
|
1960
1960
|
for (let o = 0; o < r.length; o++) {
|
1961
|
-
let c = r[o], h =
|
1961
|
+
let c = r[o], h = X.extract(c, a), d = _.serialize(h, !0), p = _.serialize(c, !0);
|
1962
1962
|
i += `db.${s}.update(${d},{$set:${p})`, o != r.length - 1 && (i += `\r
|
1963
1963
|
`);
|
1964
1964
|
}
|
1965
1965
|
return i;
|
1966
1966
|
}
|
1967
1967
|
}
|
1968
|
-
class
|
1968
|
+
class Ne {
|
1969
1969
|
constructor() {
|
1970
1970
|
n(this, "type");
|
1971
1971
|
}
|
1972
1972
|
}
|
1973
|
-
const
|
1973
|
+
const de = class de extends Ne {
|
1974
1974
|
constructor() {
|
1975
1975
|
super(...arguments);
|
1976
1976
|
//#region 属性
|
@@ -1989,7 +1989,7 @@ const he = class he extends Ve {
|
|
1989
1989
|
let r = indexedDB.open(e);
|
1990
1990
|
r.onsuccess = (i) => {
|
1991
1991
|
let a = i.target.result;
|
1992
|
-
|
1992
|
+
de.version = a.version, this.objectStoreNames = a.objectStoreNames, s(de.version);
|
1993
1993
|
}, r.onerror = (i) => {
|
1994
1994
|
l(i.target);
|
1995
1995
|
};
|
@@ -2000,7 +2000,7 @@ const he = class he extends Ve {
|
|
2000
2000
|
*/
|
2001
2001
|
async createAsync(e) {
|
2002
2002
|
return this.store = e, this.objectStoreNames.contains(e) ? Promise.resolve(!0) : new Promise((s, l) => {
|
2003
|
-
let r = indexedDB.open(this.database, ++
|
2003
|
+
let r = indexedDB.open(this.database, ++de.version);
|
2004
2004
|
r.onupgradeneeded = (i) => {
|
2005
2005
|
let a = i.target.result;
|
2006
2006
|
a.objectStoreNames.contains(this.store) || a.createObjectStore(this.store);
|
@@ -2016,7 +2016,7 @@ const he = class he extends Ve {
|
|
2016
2016
|
*/
|
2017
2017
|
async openDbAsync() {
|
2018
2018
|
return new Promise((e, s) => {
|
2019
|
-
let l = indexedDB.open(this.database,
|
2019
|
+
let l = indexedDB.open(this.database, de.version);
|
2020
2020
|
l.onsuccess = (r) => {
|
2021
2021
|
let i = r.target.result;
|
2022
2022
|
e(i);
|
@@ -2102,7 +2102,7 @@ const he = class he extends Ve {
|
|
2102
2102
|
}, a.onerror = (d) => {
|
2103
2103
|
i(d);
|
2104
2104
|
};
|
2105
|
-
let o =
|
2105
|
+
let o = X.clone(s), h = a.objectStore(this.store).put(o, e);
|
2106
2106
|
h.onsuccess = (d) => {
|
2107
2107
|
let p = d.target.result;
|
2108
2108
|
r(p);
|
@@ -2158,9 +2158,9 @@ const he = class he extends Ve {
|
|
2158
2158
|
/**
|
2159
2159
|
* 静态版本,保证所有数据库实例拿到最新版本信息
|
2160
2160
|
*/
|
2161
|
-
n(
|
2162
|
-
let
|
2163
|
-
class Ft extends
|
2161
|
+
n(de, "version", null);
|
2162
|
+
let Ue = de;
|
2163
|
+
class Ft extends Ne {
|
2164
2164
|
constructor() {
|
2165
2165
|
super(...arguments);
|
2166
2166
|
//#region 属性
|
@@ -2231,7 +2231,7 @@ class Ft extends Ve {
|
|
2231
2231
|
}
|
2232
2232
|
//#endregion
|
2233
2233
|
}
|
2234
|
-
class Mt extends
|
2234
|
+
class Mt extends Ne {
|
2235
2235
|
constructor() {
|
2236
2236
|
super(...arguments);
|
2237
2237
|
n(this, "type", "Cookie");
|
@@ -2268,13 +2268,13 @@ class Mt extends Ve {
|
|
2268
2268
|
dispose() {
|
2269
2269
|
}
|
2270
2270
|
}
|
2271
|
-
class
|
2271
|
+
class qt extends P {
|
2272
2272
|
constructor() {
|
2273
2273
|
super(...arguments);
|
2274
2274
|
n(this, "_default");
|
2275
2275
|
}
|
2276
2276
|
get instances() {
|
2277
|
-
return [new
|
2277
|
+
return [new Ue(), new Ft(), new Mt()];
|
2278
2278
|
}
|
2279
2279
|
/**
|
2280
2280
|
* 获取指定类型的提供程序
|
@@ -2310,10 +2310,10 @@ class Xe {
|
|
2310
2310
|
if (t == null)
|
2311
2311
|
return "null";
|
2312
2312
|
let e = typeof t;
|
2313
|
-
return e == "number" || e == "boolean" ? t : e == "object" || e == "string" ? `'${(e == "object" ?
|
2313
|
+
return e == "number" || e == "boolean" ? t : e == "object" || e == "string" ? `'${(e == "object" ? _.serialize(t) : t).replace(/'/g, "''")}'` : t;
|
2314
2314
|
}
|
2315
2315
|
}
|
2316
|
-
class
|
2316
|
+
class Fe extends Oe {
|
2317
2317
|
constructor() {
|
2318
2318
|
super(...arguments);
|
2319
2319
|
n(this, "type", "Sql");
|
@@ -2326,13 +2326,13 @@ class Me extends je {
|
|
2326
2326
|
`, a += `(${h})\r
|
2327
2327
|
`, a += `VALUES\r
|
2328
2328
|
`, a += "(";
|
2329
|
-
let
|
2330
|
-
for (let b = 0; b <
|
2331
|
-
let
|
2332
|
-
if (i != null && i.name ==
|
2329
|
+
let g = Object.keys(p);
|
2330
|
+
for (let b = 0; b < g.length; b++) {
|
2331
|
+
let q = g[b];
|
2332
|
+
if (i != null && i.name == q)
|
2333
2333
|
continue;
|
2334
|
-
let
|
2335
|
-
a += `${Xe.getValue(
|
2334
|
+
let N = p[q];
|
2335
|
+
a += `${Xe.getValue(N)}`, b != g.length - 1 && (a += ", ");
|
2336
2336
|
}
|
2337
2337
|
a += ")", d != r.length - 1 && (a += `\r
|
2338
2338
|
\r
|
@@ -2344,24 +2344,24 @@ class Me extends je {
|
|
2344
2344
|
return "";
|
2345
2345
|
}
|
2346
2346
|
}
|
2347
|
-
class
|
2347
|
+
class Nt extends Oe {
|
2348
2348
|
constructor() {
|
2349
2349
|
super(...arguments);
|
2350
2350
|
n(this, "type", "MySql");
|
2351
2351
|
}
|
2352
2352
|
insert(e) {
|
2353
|
-
return new
|
2353
|
+
return new Fe().insert(e);
|
2354
2354
|
}
|
2355
2355
|
update(e) {
|
2356
|
-
return new
|
2356
|
+
return new Fe().update(e);
|
2357
2357
|
}
|
2358
2358
|
}
|
2359
|
-
class
|
2359
|
+
class Vt extends P {
|
2360
2360
|
open() {
|
2361
|
-
super.open(), super.instances = [new Pt(), new Ut(), new
|
2361
|
+
super.open(), super.instances = [new Pt(), new Ut(), new Nt(), new Fe()];
|
2362
2362
|
}
|
2363
2363
|
}
|
2364
|
-
class
|
2364
|
+
class er {
|
2365
2365
|
constructor() {
|
2366
2366
|
/**
|
2367
2367
|
* 表名
|
@@ -2400,7 +2400,7 @@ class lt {
|
|
2400
2400
|
let c = new XMLHttpRequest();
|
2401
2401
|
c.open("GET", r, !1), c.onreadystatechange = () => {
|
2402
2402
|
if (c.readyState == 4 && c.status == 200) {
|
2403
|
-
let h =
|
2403
|
+
let h = j.createEmptyByUrl(r);
|
2404
2404
|
h.appendChild(document.createTextNode(c.responseText)), document.head.appendChild(h), a();
|
2405
2405
|
}
|
2406
2406
|
}, c.onerror = () => {
|
@@ -2418,8 +2418,8 @@ class lt {
|
|
2418
2418
|
let e = W.getArray(t), s = [];
|
2419
2419
|
for (let r of e) {
|
2420
2420
|
let i = new Promise((a, o) => {
|
2421
|
-
let c =
|
2422
|
-
c != null ? a(c) : (c =
|
2421
|
+
let c = j.getByUrl(r);
|
2422
|
+
c != null ? a(c) : (c = j.createByUrl(r), document.head.appendChild(c), c.onload = (h) => {
|
2423
2423
|
a(c);
|
2424
2424
|
}, c.onerror = (h) => {
|
2425
2425
|
o(h);
|
@@ -2435,7 +2435,7 @@ class lt {
|
|
2435
2435
|
//#endregion
|
2436
2436
|
//#region 开启
|
2437
2437
|
async open(t) {
|
2438
|
-
this.task = await
|
2438
|
+
this.task = await C.task.create("Memory"), this.task.taskLimit = 1;
|
2439
2439
|
}
|
2440
2440
|
async getMonaco(t = null) {
|
2441
2441
|
let e = window.monaco;
|
@@ -2489,32 +2489,32 @@ class zt extends lt {
|
|
2489
2489
|
//#endregion
|
2490
2490
|
async getCrypto() {
|
2491
2491
|
let e = ["/crypto-js.js"];
|
2492
|
-
return await super.loadFilesAsync("/assets/crypto-js", e), window.CryptoJS;
|
2492
|
+
return await super.loadFilesAsync("/assets/crypto-js@4.2.0", e), window.CryptoJS;
|
2493
2493
|
}
|
2494
2494
|
async getECharts() {
|
2495
|
-
let e = ["/echarts.min.js"];
|
2496
|
-
return await super.loadFilesAsync("/assets/echarts", e), window.echarts;
|
2495
|
+
let e = ["/dist/echarts.min.js"];
|
2496
|
+
return await super.loadFilesAsync("/assets/echarts@5.5.1", e), window.echarts;
|
2497
2497
|
}
|
2498
2498
|
async getElementPlus() {
|
2499
|
-
let e = ["/index.css", "/theme-chalk/dark/css-vars.css"];
|
2500
|
-
await super.loadFilesAsync("/assets/element-plus", e);
|
2499
|
+
let e = ["/dist/index.css", "/theme-chalk/dark/css-vars.css"];
|
2500
|
+
await super.loadFilesAsync("/assets/element-plus@2.7.8", e);
|
2501
2501
|
}
|
2502
2502
|
async getFortAwesome() {
|
2503
2503
|
let e = ["/css/all.min.css"];
|
2504
|
-
await super.loadFilesAsync("/assets/@fortawesome/fontawesome-free", e);
|
2504
|
+
await super.loadFilesAsync("/assets/@fortawesome@6.5.2/fontawesome-free", e);
|
2505
2505
|
}
|
2506
2506
|
async getMonaco() {
|
2507
|
-
return await super.getMonaco("/assets/monaco-editor/min/vs");
|
2507
|
+
return await super.getMonaco("/assets/monaco-editor@0.50.0/min/vs");
|
2508
2508
|
}
|
2509
2509
|
async getQuill() {
|
2510
|
-
return await super.getQuill("/assets/quill");
|
2510
|
+
return await super.getQuill("/assets/quill@2.0.2/dist");
|
2511
2511
|
}
|
2512
2512
|
async getWeiXin() {
|
2513
2513
|
return Promise.resolve(void 0);
|
2514
2514
|
}
|
2515
2515
|
async getXlsx() {
|
2516
|
-
let e = ["/xlsx.min.js"];
|
2517
|
-
return await super.loadFilesAsync("/assets/xlsx-js-style", e), window.XLSX;
|
2516
|
+
let e = ["/dist/xlsx.min.js"];
|
2517
|
+
return await super.loadFilesAsync("/assets/xlsx-js-style@1.2.0", e), window.XLSX;
|
2518
2518
|
}
|
2519
2519
|
}
|
2520
2520
|
class Kt extends lt {
|
@@ -2565,7 +2565,7 @@ class Kt extends lt {
|
|
2565
2565
|
return await super.loadFilesAsync(`${this.jdCdn}/xlsx-js-style@1.2.0`, e), window.XLSX;
|
2566
2566
|
}
|
2567
2567
|
}
|
2568
|
-
class Wt extends
|
2568
|
+
class Wt extends P {
|
2569
2569
|
open() {
|
2570
2570
|
super.open(), super.instances = [new zt(), new Kt()];
|
2571
2571
|
}
|
@@ -2600,7 +2600,7 @@ class Jt extends Qt {
|
|
2600
2600
|
//#endregion
|
2601
2601
|
//#region 开启
|
2602
2602
|
async open(e) {
|
2603
|
-
this.crypto = await
|
2603
|
+
this.crypto = await ge.getCrypto();
|
2604
2604
|
}
|
2605
2605
|
//#endregion
|
2606
2606
|
encodeString(e) {
|
@@ -2612,7 +2612,7 @@ class Jt extends Qt {
|
|
2612
2612
|
return this.crypto.enc.Utf8.stringify(s);
|
2613
2613
|
}
|
2614
2614
|
}
|
2615
|
-
class Xt extends
|
2615
|
+
class Xt extends P {
|
2616
2616
|
get instances() {
|
2617
2617
|
return [new Jt()];
|
2618
2618
|
}
|
@@ -2645,7 +2645,7 @@ class Gt extends Yt {
|
|
2645
2645
|
//#endregion
|
2646
2646
|
//#region 开启
|
2647
2647
|
async open(e) {
|
2648
|
-
this.xlsx = await
|
2648
|
+
this.xlsx = await ge.getXlsx();
|
2649
2649
|
}
|
2650
2650
|
//#endregion
|
2651
2651
|
export(e, s) {
|
@@ -2659,17 +2659,17 @@ class Gt extends Yt {
|
|
2659
2659
|
i.push(d);
|
2660
2660
|
}), r.push(i), e.length > 0)
|
2661
2661
|
for (let d = 0; d < e.length; d++) {
|
2662
|
-
let p = e[d],
|
2662
|
+
let p = e[d], g = [];
|
2663
2663
|
Object.keys(p).forEach((b) => {
|
2664
|
-
|
2665
|
-
}), r.push(
|
2664
|
+
g.push(p[b]);
|
2665
|
+
}), r.push(g);
|
2666
2666
|
}
|
2667
2667
|
let a = this.xlsx.utils.book_new(), o = this.xlsx.utils.json_to_sheet(r, { skipHeader: !0 });
|
2668
2668
|
this.xlsx.utils.book_append_sheet(a, o, "abc");
|
2669
2669
|
let c = 65;
|
2670
2670
|
for (let d = 0; d < l.length; d++) {
|
2671
|
-
let
|
2672
|
-
o[
|
2671
|
+
let g = `${String.fromCharCode(c + d)}1`;
|
2672
|
+
o[g].s = {
|
2673
2673
|
alignment: { horizontal: "center" },
|
2674
2674
|
font: { bold: !0, color: { rgb: "000000" } },
|
2675
2675
|
fill: { fgColor: { rgb: "409eff" } }
|
@@ -2677,12 +2677,12 @@ class Gt extends Yt {
|
|
2677
2677
|
}
|
2678
2678
|
let h = [];
|
2679
2679
|
l.forEach((d) => {
|
2680
|
-
let p = e[0][d],
|
2681
|
-
typeof p == "string" && (
|
2680
|
+
let p = e[0][d], g = { wpx: 50 };
|
2681
|
+
typeof p == "string" && (g.wpx = 100), h.push(g);
|
2682
2682
|
}), o["!cols"] = h, this.xlsx.writeFile(a, s);
|
2683
2683
|
}
|
2684
2684
|
}
|
2685
|
-
class Zt extends
|
2685
|
+
class Zt extends P {
|
2686
2686
|
get instances() {
|
2687
2687
|
return [new Gt()];
|
2688
2688
|
}
|
@@ -2701,7 +2701,7 @@ class Ht {
|
|
2701
2701
|
}
|
2702
2702
|
class es extends Ht {
|
2703
2703
|
}
|
2704
|
-
class ts extends
|
2704
|
+
class ts extends P {
|
2705
2705
|
get instances() {
|
2706
2706
|
return [new es()];
|
2707
2707
|
}
|
@@ -2757,7 +2757,7 @@ class rs {
|
|
2757
2757
|
copy(t, e, s) {
|
2758
2758
|
}
|
2759
2759
|
}
|
2760
|
-
class ns extends
|
2760
|
+
class ns extends P {
|
2761
2761
|
get instances() {
|
2762
2762
|
return [new ss(), new ls(), new rs()];
|
2763
2763
|
}
|
@@ -2800,7 +2800,7 @@ class as extends rt {
|
|
2800
2800
|
//#endregion
|
2801
2801
|
//#region 开启
|
2802
2802
|
async open(e) {
|
2803
|
-
this.crypto = await
|
2803
|
+
this.crypto = await ge.getCrypto();
|
2804
2804
|
}
|
2805
2805
|
//#endregion
|
2806
2806
|
compute(e) {
|
@@ -2808,7 +2808,7 @@ class as extends rt {
|
|
2808
2808
|
return Promise.resolve(s);
|
2809
2809
|
}
|
2810
2810
|
}
|
2811
|
-
class os extends
|
2811
|
+
class os extends P {
|
2812
2812
|
get instances() {
|
2813
2813
|
return [new is(), new as()];
|
2814
2814
|
}
|
@@ -2857,7 +2857,7 @@ class nt {
|
|
2857
2857
|
getHeader(t) {
|
2858
2858
|
if (this.headers == null)
|
2859
2859
|
return null;
|
2860
|
-
let e =
|
2860
|
+
let e = X.getKey(this.headers, t);
|
2861
2861
|
return e ? this.headers[e] : null;
|
2862
2862
|
}
|
2863
2863
|
/**
|
@@ -2881,7 +2881,7 @@ class nt {
|
|
2881
2881
|
* 不能放在getRequest中处理,因为外部会直接调用当前send方法,而不走getRequest
|
2882
2882
|
*/
|
2883
2883
|
prepare() {
|
2884
|
-
this.time = /* @__PURE__ */ new Date(), this.body == null && this.data != null && this.contentType == "application/json" && (this.body =
|
2884
|
+
this.time = /* @__PURE__ */ new Date(), this.body == null && this.data != null && this.contentType == "application/json" && (this.body = _.serializeWithoutString(this.data)), this.data == null && this.body != null && this.contentType == "application/json" && (this.data = _.deserialize(this.body)), this.contentType != null && this.addHeader("content-type", this.contentType);
|
2885
2885
|
}
|
2886
2886
|
//#endregion
|
2887
2887
|
}
|
@@ -2903,46 +2903,54 @@ class it extends nt {
|
|
2903
2903
|
this.id = W.getUniqueId(8);
|
2904
2904
|
}
|
2905
2905
|
}
|
2906
|
-
class
|
2906
|
+
class Ve {
|
2907
2907
|
constructor() {
|
2908
2908
|
//#region 属性
|
2909
2909
|
n(this, "type");
|
2910
|
-
|
2911
|
-
|
2910
|
+
/**
|
2911
|
+
* 默认请求器
|
2912
|
+
*/
|
2913
|
+
n(this, "http");
|
2914
|
+
//#endregion
|
2915
|
+
n(this, "get", async (t, e) => (await this.sendGet(t, e)).data);
|
2916
|
+
n(this, "sendGet", async (t, e) => {
|
2917
|
+
let s = K.getUrl(t, e), l = this.getRequest("GET", "application/json", s);
|
2918
|
+
return await this.send(l);
|
2919
|
+
});
|
2920
|
+
n(this, "post", async (t, e) => (await this.sendPost(t, e)).data);
|
2921
|
+
n(this, "sendPost", async (t, e) => {
|
2922
|
+
let s = this.getRequest("POST", "application/json", t, e);
|
2923
|
+
return await this.send(s);
|
2924
|
+
});
|
2925
|
+
n(this, "patch", async (t) => (await this.sendPatch(t)).data);
|
2926
|
+
n(this, "sendPatch", async (t, e) => {
|
2927
|
+
let s = this.getRequest("PATCH", "application/json", t);
|
2928
|
+
return await this.send(s);
|
2929
|
+
});
|
2930
|
+
/**
|
2931
|
+
* 获取请求消息
|
2932
|
+
*/
|
2933
|
+
n(this, "getRequest", (t, e, s, l = null) => {
|
2934
|
+
let r = new it();
|
2935
|
+
return r.method = t, r.contentType = e, r.path = s, r.body = _.serializeWithoutString(l), r;
|
2936
|
+
});
|
2912
2937
|
}
|
2913
2938
|
//#endregion
|
2914
2939
|
//#region 开启
|
2915
2940
|
async open(t) {
|
2916
|
-
|
2917
|
-
}
|
2918
|
-
//#endregion
|
2919
|
-
async get(t, e) {
|
2920
|
-
return (await this.sendGet(t, e)).data;
|
2921
|
-
}
|
2922
|
-
async sendGet(t, e) {
|
2923
|
-
let s = K.getUrl(t, e), l = this.getRequest("GET", "application/json", s);
|
2924
|
-
return await this.send(l);
|
2941
|
+
_.mergeTo(this, t);
|
2925
2942
|
}
|
2926
|
-
|
2927
|
-
return
|
2943
|
+
get onRequest() {
|
2944
|
+
return this.http == null ? null : this.http.onRequest;
|
2928
2945
|
}
|
2929
|
-
|
2930
|
-
|
2931
|
-
return await this.send(s);
|
2946
|
+
set onRequest(t) {
|
2947
|
+
this.http != null && (this.http.onRequest = t);
|
2932
2948
|
}
|
2933
|
-
|
2934
|
-
return
|
2949
|
+
get onResponse() {
|
2950
|
+
return this.http == null ? null : this.http.onResponse;
|
2935
2951
|
}
|
2936
|
-
|
2937
|
-
|
2938
|
-
return await this.send(s);
|
2939
|
-
}
|
2940
|
-
/**
|
2941
|
-
* 获取请求消息
|
2942
|
-
*/
|
2943
|
-
getRequest(t, e, s, l = null) {
|
2944
|
-
let r = new it();
|
2945
|
-
return r.method = t, r.contentType = e, r.path = s, r.body = M.serializeWithoutString(l), r;
|
2952
|
+
set onResponse(t) {
|
2953
|
+
this.http != null && (this.http.onResponse = t);
|
2946
2954
|
}
|
2947
2955
|
}
|
2948
2956
|
class Ye extends nt {
|
@@ -2970,12 +2978,30 @@ class Ye extends nt {
|
|
2970
2978
|
n(this, "request");
|
2971
2979
|
}
|
2972
2980
|
}
|
2973
|
-
class us extends
|
2981
|
+
class us extends Ve {
|
2974
2982
|
constructor() {
|
2975
2983
|
super(...arguments);
|
2984
|
+
//#region 属性
|
2976
2985
|
n(this, "type", "Default");
|
2977
2986
|
n(this, "baseUrl");
|
2987
|
+
n(this, "_onRequest");
|
2988
|
+
n(this, "_onResponse");
|
2989
|
+
}
|
2990
|
+
//#endregion
|
2991
|
+
//#region 开启
|
2992
|
+
get onRequest() {
|
2993
|
+
return this._onRequest;
|
2994
|
+
}
|
2995
|
+
set onRequest(e) {
|
2996
|
+
this._onRequest = e;
|
2997
|
+
}
|
2998
|
+
get onResponse() {
|
2999
|
+
return this._onResponse;
|
3000
|
+
}
|
3001
|
+
set onResponse(e) {
|
3002
|
+
this._onResponse = e;
|
2978
3003
|
}
|
3004
|
+
//#endregion
|
2979
3005
|
async send(e) {
|
2980
3006
|
W.isNullOrEmpty(e.url) && (e.url = this.baseUrl + e.path), e.prepare();
|
2981
3007
|
let s;
|
@@ -3021,8 +3047,8 @@ class us extends qe {
|
|
3021
3047
|
let c = i.getAllResponseHeaders().split(`\r
|
3022
3048
|
`), h = {};
|
3023
3049
|
for (let d = 0; d < c.length; d++) {
|
3024
|
-
let p = c[d].split(": "),
|
3025
|
-
|
3050
|
+
let p = c[d].split(": "), g = p.shift();
|
3051
|
+
g == null || g == "" || (h[g] = p.join(": "));
|
3026
3052
|
}
|
3027
3053
|
s.headers = h, s.contentType = s.getHeader("content-type"), s.prepare(), s.elapsed = s.time.getTime() - e.time.getTime(), await ((o = this.onResponse) == null ? void 0 : o.call(this, s)), l(s);
|
3028
3054
|
}
|
@@ -3033,7 +3059,7 @@ class us extends qe {
|
|
3033
3059
|
});
|
3034
3060
|
}
|
3035
3061
|
}
|
3036
|
-
class cs extends
|
3062
|
+
class cs extends Ve {
|
3037
3063
|
constructor() {
|
3038
3064
|
super(...arguments);
|
3039
3065
|
//#region 属性
|
@@ -3050,14 +3076,31 @@ class cs extends qe {
|
|
3050
3076
|
* AppSecret
|
3051
3077
|
*/
|
3052
3078
|
n(this, "appSecret", "");
|
3053
|
-
/**
|
3054
|
-
* 默认请求器
|
3055
|
-
*/
|
3056
|
-
n(this, "requester");
|
3057
3079
|
/**
|
3058
3080
|
* Hash计算器
|
3059
3081
|
*/
|
3060
3082
|
n(this, "hasher");
|
3083
|
+
//#endregion
|
3084
|
+
/**
|
3085
|
+
* 危险操作,会暴露敏感信息
|
3086
|
+
*/
|
3087
|
+
n(this, "send", async (e) => {
|
3088
|
+
let s = ee.getTimestamp(), l = {
|
3089
|
+
app_id: this.appId,
|
3090
|
+
hash_type: "sha256",
|
3091
|
+
timestamp: parseInt((s / 1e3).toString())
|
3092
|
+
};
|
3093
|
+
W.isNullOrEmpty(e.body) || (l.jsonBody = e.body);
|
3094
|
+
let r = K.deserialize(e.path);
|
3095
|
+
for (let p in r)
|
3096
|
+
l[p] = r[p];
|
3097
|
+
let i = K.getPath(e.path);
|
3098
|
+
l = Be.sort(l);
|
3099
|
+
let a = Bt.signDictionary(l, !1), o = `POST${i}?${a}${this.appSecret}`, c = await this.hasher.compute(o);
|
3100
|
+
l.sign = c.toLowerCase(), delete l.jsonBody, l = Be.sort(l);
|
3101
|
+
let h = K.serialize(l);
|
3102
|
+
return e.url = K.concatUrl(this.baseUrl, i + "?" + h), await this.http.send(e);
|
3103
|
+
});
|
3061
3104
|
}
|
3062
3105
|
//#endregion
|
3063
3106
|
//#region 开启
|
@@ -3065,31 +3108,10 @@ class cs extends qe {
|
|
3065
3108
|
* 危险操作,会暴露敏感信息
|
3066
3109
|
*/
|
3067
3110
|
async open(e) {
|
3068
|
-
await super.open(e), this.
|
3069
|
-
}
|
3070
|
-
//#endregion
|
3071
|
-
/**
|
3072
|
-
* 危险操作,会暴露敏感信息
|
3073
|
-
*/
|
3074
|
-
async send(e) {
|
3075
|
-
let s = te.getTimestamp(), l = {
|
3076
|
-
app_id: this.appId,
|
3077
|
-
hash_type: "sha256",
|
3078
|
-
timestamp: parseInt((s / 1e3).toString())
|
3079
|
-
};
|
3080
|
-
W.isNullOrEmpty(e.body) || (l.jsonBody = e.body);
|
3081
|
-
let r = K.deserialize(e.path);
|
3082
|
-
for (let p in r)
|
3083
|
-
l[p] = r[p];
|
3084
|
-
let i = K.getPath(e.path);
|
3085
|
-
l = Pe.sort(l);
|
3086
|
-
let a = Bt.signDictionary(l, !1), o = `POST${i}?${a}${this.appSecret}`, c = await this.hasher.compute(o);
|
3087
|
-
l.sign = c.toLowerCase(), delete l.jsonBody, l = Pe.sort(l);
|
3088
|
-
let h = K.serialize(l);
|
3089
|
-
return e.url = K.concatUrl(this.baseUrl, i + "?" + h), await this.requester.send(e);
|
3111
|
+
await super.open(e), this.http = await C.http.getDefault(), this.hasher = await C.hasher.create("Sha256");
|
3090
3112
|
}
|
3091
3113
|
}
|
3092
|
-
class ds extends
|
3114
|
+
class ds extends Ve {
|
3093
3115
|
constructor() {
|
3094
3116
|
super(...arguments);
|
3095
3117
|
//#region 属性
|
@@ -3114,10 +3136,6 @@ class ds extends qe {
|
|
3114
3136
|
* 当前终端
|
3115
3137
|
*/
|
3116
3138
|
n(this, "platform");
|
3117
|
-
/**
|
3118
|
-
* 默认请求器
|
3119
|
-
*/
|
3120
|
-
n(this, "http");
|
3121
3139
|
/**
|
3122
3140
|
* 单点登录配置
|
3123
3141
|
*/
|
@@ -3126,6 +3144,53 @@ class ds extends qe {
|
|
3126
3144
|
* 单点登录配置
|
3127
3145
|
*/
|
3128
3146
|
n(this, "signer");
|
3147
|
+
//#endregion
|
3148
|
+
/**
|
3149
|
+
* 发送请求
|
3150
|
+
*/
|
3151
|
+
n(this, "send", async (e) => {
|
3152
|
+
e.url = K.concatUrl(this.baseUrl, e.path), await this.onRequest(e);
|
3153
|
+
let s = await this.http.send(e);
|
3154
|
+
if (s.status != 200) {
|
3155
|
+
let r;
|
3156
|
+
if (s.status == 0)
|
3157
|
+
r = `网络异常,请检查接口访问是否正常: ${e.method} ${e.url}`;
|
3158
|
+
else {
|
3159
|
+
let i = s.status ? `(${s.status})` : "";
|
3160
|
+
r = `接口加载异常: ${e.method}${i} ${e.url}`;
|
3161
|
+
}
|
3162
|
+
return ye.warning(r), Promise.reject(r);
|
3163
|
+
}
|
3164
|
+
let l = s.data;
|
3165
|
+
return l.code != "Ok" ? (ye.error(l.message), Promise.reject(l)) : s;
|
3166
|
+
});
|
3167
|
+
/**
|
3168
|
+
* 请求预处理
|
3169
|
+
*/
|
3170
|
+
n(this, "beforeRequest", async (e) => {
|
3171
|
+
if (K.httpOrHttps(e.path))
|
3172
|
+
return Promise.resolve();
|
3173
|
+
let s;
|
3174
|
+
if (this.user == null)
|
3175
|
+
s = this.platform;
|
3176
|
+
else {
|
3177
|
+
let r = ee.getTimestamp(), i = await this.signer.getSign(this.user.userId, e.url, e.body, r, this.user.secret);
|
3178
|
+
s = this.sso.getAuth(this.user.identity.token, r, i, this.platform, this.env);
|
3179
|
+
}
|
3180
|
+
let l = {};
|
3181
|
+
l.Authorization = s, e.getHeader("Accept-Language") || (l["Accept-Language"] = this.language), e.addHeaders(l);
|
3182
|
+
});
|
3183
|
+
/**
|
3184
|
+
* 处理网络错误和响应错误场景
|
3185
|
+
*/
|
3186
|
+
n(this, "handleError", (e) => {
|
3187
|
+
if (e instanceof Object) {
|
3188
|
+
let s = e.message;
|
3189
|
+
e.message == "Network Error" && (K.httpOrHttps(e.config.url) ? s = "接口网络错误: " + e.config.url : s = "接口网络错误: " + e.config.baseURL + e.config.url), ye.error(s);
|
3190
|
+
} else
|
3191
|
+
ye.error(e.message);
|
3192
|
+
return Promise.reject(e);
|
3193
|
+
});
|
3129
3194
|
}
|
3130
3195
|
//#endregion
|
3131
3196
|
//#region 开启
|
@@ -3133,58 +3198,10 @@ class ds extends qe {
|
|
3133
3198
|
* 开启
|
3134
3199
|
*/
|
3135
3200
|
async open(e) {
|
3136
|
-
await super.open(e), this.http = await
|
3137
|
-
}
|
3138
|
-
//#endregion
|
3139
|
-
/**
|
3140
|
-
* 发送请求
|
3141
|
-
*/
|
3142
|
-
async send(e) {
|
3143
|
-
debugger;
|
3144
|
-
e.url = K.concatUrl(this.baseUrl, e.path), await this.onRequest(e);
|
3145
|
-
let s = await this.http.send(e);
|
3146
|
-
if (s.status != 200) {
|
3147
|
-
let r;
|
3148
|
-
if (s.status == 0)
|
3149
|
-
r = `网络异常,请检查接口访问是否正常: ${e.method} ${e.url}`;
|
3150
|
-
else {
|
3151
|
-
let i = s.status ? `(${s.status})` : "";
|
3152
|
-
r = `接口加载异常: ${e.method}${i} ${e.url}`;
|
3153
|
-
}
|
3154
|
-
return ve.warning(r), Promise.reject(r);
|
3155
|
-
}
|
3156
|
-
let l = s.data;
|
3157
|
-
return l.code != "Ok" ? (ve.error(l.message), Promise.reject(l)) : s;
|
3158
|
-
}
|
3159
|
-
/**
|
3160
|
-
* 请求预处理
|
3161
|
-
*/
|
3162
|
-
async beforeRequest(e) {
|
3163
|
-
if (K.httpOrHttps(e.path))
|
3164
|
-
return Promise.resolve();
|
3165
|
-
let s;
|
3166
|
-
if (this.user == null)
|
3167
|
-
s = this.platform;
|
3168
|
-
else {
|
3169
|
-
let r = te.getTimestamp(), i = await this.signer.getSign(this.user.userId, e.url, e.body, r, this.user.secret);
|
3170
|
-
s = this.sso.getAuth(this.user.identity.token, r, i, this.platform, this.env);
|
3171
|
-
}
|
3172
|
-
let l = {};
|
3173
|
-
l.Authorization = s, e.getHeader("Accept-Language") || (l["Accept-Language"] = this.language), e.addHeaders(l);
|
3174
|
-
}
|
3175
|
-
/**
|
3176
|
-
* 处理网络错误和响应错误场景
|
3177
|
-
*/
|
3178
|
-
handleError(e) {
|
3179
|
-
if (e instanceof Object) {
|
3180
|
-
let s = e.message;
|
3181
|
-
e.message == "Network Error" && (K.httpOrHttps(e.config.url) ? s = "接口网络错误: " + e.config.url : s = "接口网络错误: " + e.config.baseURL + e.config.url), ve.error(s);
|
3182
|
-
} else
|
3183
|
-
ve.error(e.message);
|
3184
|
-
return Promise.reject(e);
|
3201
|
+
await super.open(e), this.http = await C.http.getDefault(), this.user != null && (this.sso = await C.sso.create(this.user.type)), this.signer = await C.signer.createIfAbsent("default"), this.onRequest == null && (this.onRequest = this.beforeRequest);
|
3185
3202
|
}
|
3186
3203
|
}
|
3187
|
-
class hs extends
|
3204
|
+
class hs extends P {
|
3188
3205
|
get instances() {
|
3189
3206
|
return [new us(), new cs(), new ds()];
|
3190
3207
|
}
|
@@ -3192,7 +3209,7 @@ class hs extends B {
|
|
3192
3209
|
* 创建并开启
|
3193
3210
|
*/
|
3194
3211
|
async createById(t, e = null) {
|
3195
|
-
e == null && (e = new
|
3212
|
+
e == null && (e = new jt());
|
3196
3213
|
let s = await super.createById(t, e), l = e.value;
|
3197
3214
|
return await s.open(l.Conn), s;
|
3198
3215
|
}
|
@@ -3222,7 +3239,7 @@ class ps {
|
|
3222
3239
|
return null;
|
3223
3240
|
if (!this.t_exists(t)) {
|
3224
3241
|
let s = t.split(".");
|
3225
|
-
return
|
3242
|
+
return oe.getLast(s, 2).join(".");
|
3226
3243
|
}
|
3227
3244
|
return typeof e == "string" ? this.translate(t, [e]) : this.translate(t, e);
|
3228
3245
|
});
|
@@ -3278,25 +3295,24 @@ class ps {
|
|
3278
3295
|
//#endregion
|
3279
3296
|
//#region 开启
|
3280
3297
|
async open(t) {
|
3281
|
-
|
3282
|
-
this.lang = (s == null ? void 0 : s.language) ?? st.getLanguage();
|
3298
|
+
_.mergeTo(this, t);
|
3283
3299
|
}
|
3284
3300
|
//#endregion
|
3285
3301
|
}
|
3286
|
-
class
|
3302
|
+
class fs extends ps {
|
3287
3303
|
constructor() {
|
3288
3304
|
super(...arguments);
|
3289
3305
|
n(this, "type", "Default");
|
3290
3306
|
//#endregion
|
3291
3307
|
n(this, "translate", (e, s) => {
|
3292
3308
|
let l = this.messages[this.lang], r = e.split(".");
|
3293
|
-
return
|
3309
|
+
return _.getValue(l, r);
|
3294
3310
|
});
|
3295
3311
|
n(this, "t_exists", (e) => {
|
3296
3312
|
if (!e)
|
3297
3313
|
return null;
|
3298
3314
|
let s = this.messages[this.lang], l = e.split(".");
|
3299
|
-
return
|
3315
|
+
return _.hasKey(s, l);
|
3300
3316
|
});
|
3301
3317
|
n(this, "loadI18n", async (e) => {
|
3302
3318
|
e == null && (e = this.lang);
|
@@ -3305,7 +3321,7 @@ class gs extends ps {
|
|
3305
3321
|
return T.post("/i18n", i).then(({ data: a }) => {
|
3306
3322
|
a.forEach((o) => {
|
3307
3323
|
let c = `${e}.${o.Module}.${o.Key}`.split(".");
|
3308
|
-
|
3324
|
+
X.addProperties(this.messages, c, o.Value);
|
3309
3325
|
}), r(a);
|
3310
3326
|
});
|
3311
3327
|
}), l = new Promise((r) => {
|
@@ -3313,7 +3329,7 @@ class gs extends ps {
|
|
3313
3329
|
T.post("/i18n_business", i).then(({ data: a }) => {
|
3314
3330
|
a.forEach((o) => {
|
3315
3331
|
let c = `${e}._business.${o.Table}.${o.Field}.${o.Key}`.split(".");
|
3316
|
-
|
3332
|
+
X.addProperties(this.messages, c, o.Value);
|
3317
3333
|
}), r(a);
|
3318
3334
|
});
|
3319
3335
|
});
|
@@ -3325,20 +3341,12 @@ class gs extends ps {
|
|
3325
3341
|
await super.open(e);
|
3326
3342
|
}
|
3327
3343
|
}
|
3328
|
-
class
|
3344
|
+
class gs extends P {
|
3329
3345
|
//#region 开启
|
3330
3346
|
open() {
|
3331
|
-
super.open(), super.addType(new
|
3347
|
+
super.open(), super.addType(new fs());
|
3332
3348
|
}
|
3333
3349
|
//#endregion
|
3334
|
-
/**
|
3335
|
-
* 获取默认多语言
|
3336
|
-
*/
|
3337
|
-
async getDefault() {
|
3338
|
-
return await super.createIfAbsent("Default", "Default", async (e) => {
|
3339
|
-
await e.open();
|
3340
|
-
});
|
3341
|
-
}
|
3342
3350
|
}
|
3343
3351
|
class ms {
|
3344
3352
|
constructor() {
|
@@ -3372,7 +3380,7 @@ class ys extends ms {
|
|
3372
3380
|
console.warn(e);
|
3373
3381
|
}
|
3374
3382
|
}
|
3375
|
-
class vs extends
|
3383
|
+
class vs extends P {
|
3376
3384
|
get instances() {
|
3377
3385
|
return [new ys()];
|
3378
3386
|
}
|
@@ -3407,7 +3415,7 @@ class bs extends ws {
|
|
3407
3415
|
dispose() {
|
3408
3416
|
}
|
3409
3417
|
}
|
3410
|
-
class xs extends
|
3418
|
+
class xs extends P {
|
3411
3419
|
get instances() {
|
3412
3420
|
return [new bs()];
|
3413
3421
|
}
|
@@ -3431,11 +3439,11 @@ class ks {
|
|
3431
3439
|
//#endregion
|
3432
3440
|
//#region 开启
|
3433
3441
|
async open(t) {
|
3434
|
-
this.provider = await
|
3442
|
+
this.provider = await C.provider.getDefault("user");
|
3435
3443
|
}
|
3436
3444
|
//#endregion
|
3437
3445
|
async login(t) {
|
3438
|
-
return T.post(`/user/login?type=${this.type}`, t).then(async (e) => (await this.provider.saveAsync("sso", e.data), T.user = e.data, T.sso = await
|
3446
|
+
return T.post(`/user/login?type=${this.type}`, t).then(async (e) => (await this.provider.saveAsync("sso", e.data), T.user = e.data, T.sso = await C.sso.create(e.data.type), Promise.resolve(e)));
|
3439
3447
|
}
|
3440
3448
|
loginUrl(t) {
|
3441
3449
|
return "";
|
@@ -3465,11 +3473,11 @@ class Ss {
|
|
3465
3473
|
//#endregion
|
3466
3474
|
//#region 开启
|
3467
3475
|
async open(t) {
|
3468
|
-
this.url = t.url, this.app_id = t.app_id, this.provider = await
|
3476
|
+
this.url = t.url, this.app_id = t.app_id, this.provider = await C.provider.getDefault("user");
|
3469
3477
|
}
|
3470
3478
|
//#endregion
|
3471
3479
|
async login(t) {
|
3472
|
-
await this.provider.saveAsync("sso", t), T.user = t, T.sso = await
|
3480
|
+
await this.provider.saveAsync("sso", t), T.user = t, T.sso = await C.sso.create(t.type);
|
3473
3481
|
}
|
3474
3482
|
loginUrl(t) {
|
3475
3483
|
let e = encodeURIComponent(t);
|
@@ -3505,7 +3513,7 @@ class at {
|
|
3505
3513
|
n(this, "identity");
|
3506
3514
|
}
|
3507
3515
|
}
|
3508
|
-
class
|
3516
|
+
class Cs {
|
3509
3517
|
constructor() {
|
3510
3518
|
n(this, "type", "WeiXin");
|
3511
3519
|
}
|
@@ -3527,12 +3535,12 @@ class Es {
|
|
3527
3535
|
return Promise.resolve();
|
3528
3536
|
}
|
3529
3537
|
}
|
3530
|
-
class
|
3538
|
+
class Es {
|
3531
3539
|
constructor() {
|
3532
3540
|
n(this, "type");
|
3533
3541
|
}
|
3534
3542
|
}
|
3535
|
-
class Ts extends
|
3543
|
+
class Ts extends Es {
|
3536
3544
|
constructor() {
|
3537
3545
|
super(...arguments);
|
3538
3546
|
//#region 属性
|
@@ -3544,7 +3552,7 @@ class Ts extends Cs {
|
|
3544
3552
|
}
|
3545
3553
|
//#endregion
|
3546
3554
|
async open(e) {
|
3547
|
-
this.provider = await
|
3555
|
+
this.provider = await C.provider.getDefault("user");
|
3548
3556
|
}
|
3549
3557
|
async login(e) {
|
3550
3558
|
}
|
@@ -3578,7 +3586,7 @@ class $s {
|
|
3578
3586
|
}
|
3579
3587
|
//#endregion
|
3580
3588
|
async open(t) {
|
3581
|
-
this.provider = await
|
3589
|
+
this.provider = await C.provider.getDefault("user");
|
3582
3590
|
}
|
3583
3591
|
async login(t) {
|
3584
3592
|
return T.post(`/user/login?type=${this.type}`, t).then(async (e) => {
|
@@ -3668,18 +3676,18 @@ class ut extends ot {
|
|
3668
3676
|
//#region 开启
|
3669
3677
|
open() {
|
3670
3678
|
let e = this.sys.app;
|
3671
|
-
e.background =
|
3679
|
+
e.background = ce.background, e.theme = ce.theme, e.layout = ce.layout, e.language = ce.language, e.font = ce.font;
|
3672
3680
|
}
|
3673
3681
|
/**
|
3674
3682
|
* 初始化配置值(不一定跟登录用户相关,这也是单独分离的好处)
|
3675
3683
|
*/
|
3676
3684
|
async bind(e) {
|
3677
|
-
for (let
|
3678
|
-
let
|
3679
|
-
|
3685
|
+
for (let r of e) {
|
3686
|
+
let a = await this.get(r.kind, r.type) ?? r.content;
|
3687
|
+
X.addProperties(this, [r.kind, r.type], a);
|
3680
3688
|
}
|
3681
|
-
let s = this.sys.app;
|
3682
|
-
|
3689
|
+
let s = this.sys.app, l = document.documentElement;
|
3690
|
+
j.removeClass(l, ce.theme), j.addClass(l, s.theme), ve.emit("theme", s.theme), j.addClass(l, s.layout), this.setBackground(s.background), j.addStyle(l, "font-family", s.font);
|
3683
3691
|
}
|
3684
3692
|
/**
|
3685
3693
|
* 尝试添加架构
|
@@ -3703,7 +3711,7 @@ class ut extends ot {
|
|
3703
3711
|
* 获取本地配置
|
3704
3712
|
*/
|
3705
3713
|
async get(e, s) {
|
3706
|
-
return await (await
|
3714
|
+
return await (await C.provider.getDefault(e)).getAsync(s);
|
3707
3715
|
}
|
3708
3716
|
/**
|
3709
3717
|
* 设置背景
|
@@ -3720,11 +3728,11 @@ class ut extends ot {
|
|
3720
3728
|
let s = this.sys.app, l = document.documentElement, r = e.layout;
|
3721
3729
|
l.classList.remove(s.layout), l.classList.add(r), s.layout = r;
|
3722
3730
|
let i = e.theme;
|
3723
|
-
|
3731
|
+
j.removeClass(l, s.theme), j.addClass(l, i), s.theme = i, ve.emit("theme", i);
|
3724
3732
|
let a = e.background;
|
3725
|
-
this.setBackground(a),
|
3733
|
+
this.setBackground(a), ve.emit("background", a);
|
3726
3734
|
let o = e.font;
|
3727
|
-
s.font = o,
|
3735
|
+
s.font = o, j.addStyle(l, "font-family", o);
|
3728
3736
|
}
|
3729
3737
|
//#region 配置
|
3730
3738
|
/**
|
@@ -3745,7 +3753,7 @@ class ut extends ot {
|
|
3745
3753
|
* 全量保存用户配置
|
3746
3754
|
*/
|
3747
3755
|
async save(e, s, l, r = !0) {
|
3748
|
-
return r && await (await
|
3756
|
+
return r && await (await C.provider.getDefault(e)).saveAsync(s, l), T.post(`/user/config?kind=${e}&type=${s}`, l).then((i) => Promise.resolve(!0));
|
3749
3757
|
}
|
3750
3758
|
/**
|
3751
3759
|
* 部分保存用户配置
|
@@ -3787,7 +3795,7 @@ class Is {
|
|
3787
3795
|
* 手动添加日志
|
3788
3796
|
*/
|
3789
3797
|
add(t, e, s, l = null) {
|
3790
|
-
let r =
|
3798
|
+
let r = ee.getTimeString();
|
3791
3799
|
this.logs.unshift({ time: r, code: t, message: e, stack: s, elapsed: l });
|
3792
3800
|
}
|
3793
3801
|
/**
|
@@ -3816,8 +3824,8 @@ class Os {
|
|
3816
3824
|
this[e] = t[e];
|
3817
3825
|
}
|
3818
3826
|
}
|
3819
|
-
let
|
3820
|
-
class
|
3827
|
+
let Ae = new Os();
|
3828
|
+
class Rs {
|
3821
3829
|
constructor() {
|
3822
3830
|
//#region 属性
|
3823
3831
|
n(this, "loaded", !1);
|
@@ -3891,10 +3899,10 @@ class js {
|
|
3891
3899
|
return T.get("/app/setting").then(({ data: t }) => (Object.keys(t).forEach((e) => {
|
3892
3900
|
let s = t[e];
|
3893
3901
|
s && (this[e] = s);
|
3894
|
-
}),
|
3902
|
+
}), j.addClass(document.documentElement, this.theme, Ae.web.theme), ve.emits({ theme: this.theme }), Promise.resolve(t))).catch((t) => Promise.reject(t));
|
3895
3903
|
}
|
3896
3904
|
}
|
3897
|
-
class
|
3905
|
+
class js {
|
3898
3906
|
constructor() {
|
3899
3907
|
//#region 属性
|
3900
3908
|
/**
|
@@ -3919,10 +3927,10 @@ class Rs {
|
|
3919
3927
|
* 登录后,连接Socket
|
3920
3928
|
*/
|
3921
3929
|
async connect() {
|
3922
|
-
if (!
|
3930
|
+
if (!Ae.api.ws)
|
3923
3931
|
return;
|
3924
3932
|
if (this.socket == null || this.reconnect) {
|
3925
|
-
let e =
|
3933
|
+
let e = Ae.api.ws, s = new it();
|
3926
3934
|
s.path = e, s.method = "GET", await T.onRequest(s);
|
3927
3935
|
let l = s.getHeader("Authorization"), r = K.encode(l), i = `${e}?authorization=${r}`;
|
3928
3936
|
this.socket = new WebSocket(i);
|
@@ -3933,7 +3941,7 @@ class Rs {
|
|
3933
3941
|
}, this.socket.onmessage = (e) => {
|
3934
3942
|
this.handler && this.handler(e);
|
3935
3943
|
}, this.socket.onerror = (e) => {
|
3936
|
-
this.reconnect = !0, console.warn(`Socket连接失败:${
|
3944
|
+
this.reconnect = !0, console.warn(`Socket连接失败:${Ae.api.ws}`);
|
3937
3945
|
}, this.socket.onclose = (e) => {
|
3938
3946
|
this.connected = !1, this.reconnect && (t = setTimeout(async () => await this.connect(), 1e3));
|
3939
3947
|
};
|
@@ -3986,19 +3994,19 @@ class _s {
|
|
3986
3994
|
* 获取本地缓存中的用户信息;好处:即使手动更改storage数据,也可以里面获取到
|
3987
3995
|
*/
|
3988
3996
|
async getSso() {
|
3989
|
-
return await (await
|
3997
|
+
return await (await C.provider.getDefault("user")).getEntity("sso");
|
3990
3998
|
}
|
3991
3999
|
/**
|
3992
4000
|
* 登录后,获取用户信息
|
3993
4001
|
*/
|
3994
4002
|
async loadInfo() {
|
3995
|
-
return T.get("/user/info").then(async ({ data: t }) => (await
|
4003
|
+
return T.get("/user/info").then(async ({ data: t }) => (await Z.bind(t.configs), this.user = t, this.debugger = t.debugger, Promise.resolve(t)));
|
3996
4004
|
}
|
3997
4005
|
/**
|
3998
4006
|
* 未登录,获取匿名登录信息
|
3999
4007
|
*/
|
4000
4008
|
async getAnonymous() {
|
4001
|
-
await
|
4009
|
+
await Z.bind([]);
|
4002
4010
|
}
|
4003
4011
|
/**
|
4004
4012
|
* 根据路径获取路由
|
@@ -4011,7 +4019,7 @@ class _s {
|
|
4011
4019
|
* 加载服务端路由
|
4012
4020
|
*/
|
4013
4021
|
async loadMenus() {
|
4014
|
-
return T.get("/user/menu").then(({ data: t }) => (this.menus = t, this.menusFlat =
|
4022
|
+
return T.get("/user/menu").then(({ data: t }) => (this.menus = t, this.menusFlat = Ie.getFlat(t, "children"), Promise.resolve(t)));
|
4015
4023
|
}
|
4016
4024
|
/**
|
4017
4025
|
* 退出登录
|
@@ -4020,7 +4028,7 @@ class _s {
|
|
4020
4028
|
return T.post("/user/logout").then(async () => {
|
4021
4029
|
this.user = null, this.menus = null;
|
4022
4030
|
let t = await this.getSso();
|
4023
|
-
return await (await
|
4031
|
+
return await (await C.sso.create(t.type)).logout(), Us.disconnect(), Promise.resolve();
|
4024
4032
|
});
|
4025
4033
|
}
|
4026
4034
|
}
|
@@ -4076,7 +4084,7 @@ class ct extends ot {
|
|
4076
4084
|
});
|
4077
4085
|
}
|
4078
4086
|
}
|
4079
|
-
class Bs extends
|
4087
|
+
class Bs extends P {
|
4080
4088
|
open() {
|
4081
4089
|
super.open(), super.instances = [
|
4082
4090
|
new ut(),
|
@@ -4093,31 +4101,31 @@ class Bs extends B {
|
|
4093
4101
|
return await super.createIfAbsent("Config");
|
4094
4102
|
}
|
4095
4103
|
}
|
4096
|
-
let
|
4097
|
-
|
4104
|
+
let Z = new ut(), tr = Ge(new ct()), sr = new Ds(), Ps = new Is(), ce = Ge(new Rs()), Us = new js(), Fs = new _s(), Ms = async (u) => {
|
4105
|
+
Z.open();
|
4098
4106
|
};
|
4099
|
-
class
|
4107
|
+
class qs extends P {
|
4100
4108
|
/**
|
4101
4109
|
* 获取实例
|
4102
4110
|
*/
|
4103
4111
|
get instances() {
|
4104
|
-
return [new $s(), new Ss(), new
|
4112
|
+
return [new $s(), new Ss(), new Cs(), new ks(), new Ts()];
|
4105
4113
|
}
|
4106
4114
|
/**
|
4107
4115
|
* 获取指定SSO实例
|
4108
4116
|
*/
|
4109
4117
|
async create(t, e) {
|
4110
|
-
let s =
|
4118
|
+
let s = ce.ssos.find((i) => i.type.toUpperCase() == t.toUpperCase()), l = { url: s == null ? void 0 : s.url, app_id: s == null ? void 0 : s.appId }, r = await super.create(t);
|
4111
4119
|
return await r.open(l), r;
|
4112
4120
|
}
|
4113
4121
|
}
|
4114
|
-
class
|
4122
|
+
class Ns {
|
4115
4123
|
constructor() {
|
4116
4124
|
n(this, "type");
|
4117
4125
|
n(this, "taskLimit");
|
4118
4126
|
}
|
4119
4127
|
}
|
4120
|
-
class
|
4128
|
+
class Vs extends Ns {
|
4121
4129
|
constructor() {
|
4122
4130
|
super(...arguments);
|
4123
4131
|
//#region 属性
|
@@ -4135,7 +4143,7 @@ class qs extends Vs {
|
|
4135
4143
|
async execute(e, s, l) {
|
4136
4144
|
if (e.length == 0)
|
4137
4145
|
return;
|
4138
|
-
let r =
|
4146
|
+
let r = oe.getChunksByCount(e, s), i = oe.create(r, (a, o) => l(a, o));
|
4139
4147
|
await Promise.all(i);
|
4140
4148
|
}
|
4141
4149
|
async executeFrequency(e, s, l, r) {
|
@@ -4171,9 +4179,9 @@ class qs extends Vs {
|
|
4171
4179
|
clearInterval(this.intervalTimeout);
|
4172
4180
|
}
|
4173
4181
|
}
|
4174
|
-
class zs extends
|
4182
|
+
class zs extends P {
|
4175
4183
|
get instances() {
|
4176
|
-
return [new
|
4184
|
+
return [new Vs()];
|
4177
4185
|
}
|
4178
4186
|
}
|
4179
4187
|
class Ks {
|
@@ -4191,12 +4199,12 @@ class Ws extends Ks {
|
|
4191
4199
|
return await l.render(r, s);
|
4192
4200
|
}
|
4193
4201
|
}
|
4194
|
-
class Qs extends
|
4202
|
+
class Qs extends P {
|
4195
4203
|
get instances() {
|
4196
4204
|
return [new Ws()];
|
4197
4205
|
}
|
4198
4206
|
}
|
4199
|
-
class
|
4207
|
+
class lr extends P {
|
4200
4208
|
get instances() {
|
4201
4209
|
return [];
|
4202
4210
|
}
|
@@ -4241,7 +4249,7 @@ class Xs extends dt {
|
|
4241
4249
|
return "";
|
4242
4250
|
}
|
4243
4251
|
}
|
4244
|
-
class
|
4252
|
+
class rr extends P {
|
4245
4253
|
get instances() {
|
4246
4254
|
return [new Xs(), new Js()];
|
4247
4255
|
}
|
@@ -4252,7 +4260,7 @@ class ht {
|
|
4252
4260
|
* Builder工厂
|
4253
4261
|
*/
|
4254
4262
|
static get builder() {
|
4255
|
-
return this.create(
|
4263
|
+
return this.create(Vt);
|
4256
4264
|
}
|
4257
4265
|
/**
|
4258
4266
|
* CDN工厂
|
@@ -4300,7 +4308,7 @@ class ht {
|
|
4300
4308
|
* 多语言工厂
|
4301
4309
|
*/
|
4302
4310
|
static get i18n() {
|
4303
|
-
return this.create(
|
4311
|
+
return this.create(gs);
|
4304
4312
|
}
|
4305
4313
|
/**
|
4306
4314
|
* 消息提示请求工厂
|
@@ -4312,7 +4320,7 @@ class ht {
|
|
4312
4320
|
* 提供程序工厂
|
4313
4321
|
*/
|
4314
4322
|
static get provider() {
|
4315
|
-
return this.create(
|
4323
|
+
return this.create(qt);
|
4316
4324
|
}
|
4317
4325
|
/**
|
4318
4326
|
* 签名工厂
|
@@ -4324,7 +4332,7 @@ class ht {
|
|
4324
4332
|
* SSO工厂
|
4325
4333
|
*/
|
4326
4334
|
static get sso() {
|
4327
|
-
return this.create(
|
4335
|
+
return this.create(qs);
|
4328
4336
|
}
|
4329
4337
|
/**
|
4330
4338
|
* Task工厂
|
@@ -4361,14 +4369,15 @@ class ht {
|
|
4361
4369
|
* 工厂缓存
|
4362
4370
|
*/
|
4363
4371
|
n(ht, "mappings", {});
|
4364
|
-
const
|
4365
|
-
let Ys = {},
|
4366
|
-
let e = await (await
|
4367
|
-
(e == null ? void 0 : e.cdn) != null && (u.cdn = e.cdn),
|
4368
|
-
|
4369
|
-
|
4370
|
-
},
|
4371
|
-
|
4372
|
+
const C = ht;
|
4373
|
+
let Ys = {}, ge = {}, T = {}, Me = {}, pt = {}, Gs = {}, ye = {}, Zs = async (u) => {
|
4374
|
+
let e = await (await C.provider.getDefault("sys")).getAsync("app");
|
4375
|
+
(e == null ? void 0 : e.cdn) != null && (u.cdn = e.cdn), ge = await C.cdn.createIfAbsent("Default", u.cdn), Ys = await C.encoder.getBase64(), T = await C.http.getHalo(), Me = await C.i18n.createIfAbsent("Default", "Default", async (s) => {
|
4376
|
+
let l = (e == null ? void 0 : e.language) ?? st.getLanguage(), r = _.serialize({ lang: l });
|
4377
|
+
await s.open(r), Hs = s.t, el = s.t_exists, tl = s.t_sys, sl = s.t_enum, ll = s.t_field, rl = s.t_field_choose_placeholder, nl = s.t_field_placeholder, il = s.t_table, al = s.t_module, ol = s.t_menu;
|
4378
|
+
}), Me.addMessages(u.lang), pt = await C.hasher.getMd5(), Gs = await C.template.create("Liquid"), u.messenger == null ? ye = await C.messenger.getConsole() : ye = u.messenger;
|
4379
|
+
}, Hs = {}, el = {}, tl = {}, sl = {}, ll = {}, rl = {}, nl = {}, il = {}, al = {}, ol = {};
|
4380
|
+
class ul {
|
4372
4381
|
constructor() {
|
4373
4382
|
/**
|
4374
4383
|
* 消息发送对象
|
@@ -4388,26 +4397,26 @@ class cl {
|
|
4388
4397
|
n(this, "cdn", "Local");
|
4389
4398
|
}
|
4390
4399
|
}
|
4391
|
-
const
|
4400
|
+
const cl = { class: "ha-empty" }, dl = { class: "empty-message" }, hl = {
|
4392
4401
|
key: 0,
|
4393
4402
|
class: "empty-content"
|
4394
|
-
},
|
4403
|
+
}, nr = /* @__PURE__ */ Q({
|
4395
4404
|
__name: "Empty",
|
4396
4405
|
props: {
|
4397
4406
|
message: { type: String, default: "暂无数据" },
|
4398
4407
|
hasData: Boolean
|
4399
4408
|
},
|
4400
4409
|
setup(u) {
|
4401
|
-
let t = u, { message: e, hasData: s } =
|
4402
|
-
return (l, r) => (O(),
|
4403
|
-
D("div",
|
4404
|
-
y(s) ? (O(),
|
4405
|
-
|
4410
|
+
let t = u, { message: e, hasData: s } = te(t);
|
4411
|
+
return (l, r) => (O(), B("div", cl, [
|
4412
|
+
D("div", dl, he(y(e)), 1),
|
4413
|
+
y(s) ? (O(), B("div", hl, [
|
4414
|
+
pe(l.$slots, "default")
|
4406
4415
|
])) : Ze("", !0)
|
4407
4416
|
]));
|
4408
4417
|
}
|
4409
4418
|
});
|
4410
|
-
class
|
4419
|
+
class ft {
|
4411
4420
|
constructor(t, e) {
|
4412
4421
|
/**
|
4413
4422
|
* 距窗口左边的距离
|
@@ -4420,7 +4429,7 @@ class gt {
|
|
4420
4429
|
this.x = t, this.y = e;
|
4421
4430
|
}
|
4422
4431
|
}
|
4423
|
-
class
|
4432
|
+
class pl extends ft {
|
4424
4433
|
constructor() {
|
4425
4434
|
super(...arguments);
|
4426
4435
|
/**
|
@@ -4429,7 +4438,7 @@ class gl extends gt {
|
|
4429
4438
|
n(this, "affix");
|
4430
4439
|
}
|
4431
4440
|
}
|
4432
|
-
class
|
4441
|
+
class ir extends ft {
|
4433
4442
|
constructor(e, s, l, r) {
|
4434
4443
|
super(e, s);
|
4435
4444
|
n(this, "width");
|
@@ -4437,7 +4446,7 @@ class ar extends gt {
|
|
4437
4446
|
this.width = l, this.height = r;
|
4438
4447
|
}
|
4439
4448
|
}
|
4440
|
-
class
|
4449
|
+
class gt {
|
4441
4450
|
constructor() {
|
4442
4451
|
//#region 大小调整
|
4443
4452
|
n(this, "resizeObserver", null);
|
@@ -4484,8 +4493,8 @@ class ft {
|
|
4484
4493
|
* 事件防抖: time ms没重复触发才执行指定操作
|
4485
4494
|
*/
|
4486
4495
|
n(this, "debounce", (t, e, s = null) => {
|
4487
|
-
this.lastDebounceTime == null && (this.lastDebounceTime =
|
4488
|
-
let l =
|
4496
|
+
this.lastDebounceTime == null && (this.lastDebounceTime = ee.getTimestamp());
|
4497
|
+
let l = ee.getTimestamp();
|
4489
4498
|
this.lastDebounceTimeout != null && clearTimeout(this.lastDebounceTimeout), this.lastDebounceTimeout = setTimeout(t, e, s), this.lastDebounceTime = l;
|
4490
4499
|
});
|
4491
4500
|
//#endregion
|
@@ -4526,12 +4535,12 @@ class ft {
|
|
4526
4535
|
return;
|
4527
4536
|
this.dragElement = t;
|
4528
4537
|
let s = !1, l = (a) => (s = !0, a.preventDefault(), e.init(a)), r = (a) => {
|
4529
|
-
let o = new
|
4538
|
+
let o = new pl(), c = e.range;
|
4530
4539
|
if (c == null)
|
4531
4540
|
o.x = a.clientX, o.y = a.clientY;
|
4532
4541
|
else {
|
4533
|
-
let { x: h, y: d, width: p, height:
|
4534
|
-
a.clientX < h ? o.x = h : a.clientX > h + p ? o.x = h + p : o.x = a.clientX, a.clientY < d ? o.y = d : a.clientY > d +
|
4542
|
+
let { x: h, y: d, width: p, height: g } = c;
|
4543
|
+
a.clientX < h ? o.x = h : a.clientX > h + p ? o.x = h + p : o.x = a.clientX, a.clientY < d ? o.y = d : a.clientY > d + g ? o.y = d + g : o.y = a.clientY;
|
4535
4544
|
}
|
4536
4545
|
if (e.affix) {
|
4537
4546
|
if (e.range == null)
|
@@ -4589,7 +4598,7 @@ class ft {
|
|
4589
4598
|
}
|
4590
4599
|
//#endregion
|
4591
4600
|
}
|
4592
|
-
class
|
4601
|
+
class ar {
|
4593
4602
|
constructor() {
|
4594
4603
|
n(this, "events", {});
|
4595
4604
|
/**
|
@@ -4711,14 +4720,14 @@ class or {
|
|
4711
4720
|
clearTimeout(this.timer);
|
4712
4721
|
}
|
4713
4722
|
}
|
4714
|
-
class
|
4723
|
+
class or {
|
4715
4724
|
/**
|
4716
4725
|
* 对比数据变动
|
4717
4726
|
*/
|
4718
4727
|
delta(t, e, s, l) {
|
4719
4728
|
}
|
4720
4729
|
}
|
4721
|
-
class
|
4730
|
+
class ur {
|
4722
4731
|
/**
|
4723
4732
|
* 初始化,并绑定自动关闭上下文菜单事件
|
4724
4733
|
*/
|
@@ -4735,7 +4744,7 @@ class cr {
|
|
4735
4744
|
* 根据鼠标事件,显示右键上下文弹窗
|
4736
4745
|
*/
|
4737
4746
|
n(this, "show", (t) => {
|
4738
|
-
let s =
|
4747
|
+
let s = j.parentAbsolute(this.container).getBoundingClientRect(), l = t.clientX - s.left, r = t.clientY - s.top - 2;
|
4739
4748
|
this.container.style.display = "block", this.container.style.left = l + "px", this.container.style.top = r + "px";
|
4740
4749
|
});
|
4741
4750
|
/**
|
@@ -4744,7 +4753,7 @@ class cr {
|
|
4744
4753
|
n(this, "dispose", () => {
|
4745
4754
|
for (let t = 0; t < this.closeTriggers.length; t++) {
|
4746
4755
|
let e = this.closeTriggers[t];
|
4747
|
-
|
4756
|
+
ie.unbind(["click", "scroll"], e, this.close);
|
4748
4757
|
}
|
4749
4758
|
this.container != null && this.container.removeEventListener("click", this.close), this.container = null, this.closeTriggers = [];
|
4750
4759
|
});
|
@@ -4752,18 +4761,18 @@ class cr {
|
|
4752
4761
|
this.closeTriggers.push(...e);
|
4753
4762
|
for (let s = 0; s < this.closeTriggers.length; s++) {
|
4754
4763
|
let l = this.closeTriggers[s];
|
4755
|
-
|
4764
|
+
ie.bind(["click", "scroll"], l, this.close);
|
4756
4765
|
}
|
4757
4766
|
}
|
4758
4767
|
}
|
4759
4768
|
}
|
4760
|
-
class
|
4769
|
+
class cr {
|
4761
4770
|
/**
|
4762
4771
|
* 开启表单监控
|
4763
4772
|
*/
|
4764
4773
|
async open(t, e, s) {
|
4765
|
-
let l = await
|
4766
|
-
r &&
|
4774
|
+
let l = await C.provider.getDefault(e), r = await l.getAsync(s);
|
4775
|
+
r && X.mergeTo(t, r), J(() => t, (i, a) => {
|
4767
4776
|
l && l.saveAsync(s, t);
|
4768
4777
|
}, { deep: !0 });
|
4769
4778
|
}
|
@@ -4777,122 +4786,122 @@ const fl = /* @__PURE__ */ Q({
|
|
4777
4786
|
__name: "Fill",
|
4778
4787
|
emits: ["resize"],
|
4779
4788
|
setup(u, { emit: t }) {
|
4780
|
-
let e = t, s = I(), l = I(), r = I(), i = new
|
4781
|
-
let h =
|
4782
|
-
r.value =
|
4789
|
+
let e = t, s = I(), l = I(), r = I(), i = new gt(), a = () => {
|
4790
|
+
let h = j.siblings(s.value);
|
4791
|
+
r.value = j.getHeight(h);
|
4783
4792
|
}, o = () => {
|
4784
|
-
l.value =
|
4793
|
+
l.value = j.getHeight(s.value), e("resize", l.value);
|
4785
4794
|
}, c = () => {
|
4786
4795
|
o();
|
4787
4796
|
};
|
4788
|
-
return
|
4797
|
+
return we(() => {
|
4789
4798
|
a(), o(), i.resize(s.value, c);
|
4790
|
-
}),
|
4799
|
+
}), be(() => {
|
4791
4800
|
i.dispose();
|
4792
|
-
}), (h, d) => (O(),
|
4801
|
+
}), (h, d) => (O(), B("div", {
|
4793
4802
|
class: "ha-fill",
|
4794
4803
|
ref_key: "fillRef",
|
4795
4804
|
ref: s,
|
4796
4805
|
style: fe({ height: `calc(100% - ${y(r)}px)` })
|
4797
4806
|
}, [
|
4798
|
-
|
4807
|
+
pe(h.$slots, "default")
|
4799
4808
|
], 4));
|
4800
4809
|
}
|
4801
|
-
}),
|
4810
|
+
}), gl = /* @__PURE__ */ Q({
|
4802
4811
|
__name: "Scroller",
|
4803
4812
|
props: {
|
4804
4813
|
options: {}
|
4805
4814
|
},
|
4806
4815
|
emits: ["scroll"],
|
4807
4816
|
setup(u, { expose: t, emit: e }) {
|
4808
|
-
let s = e, l = u, { options: r } =
|
4817
|
+
let s = e, l = u, { options: r } = te(l), i = I(), a = I(), o = I(), c = I(), h = I(!1), d = null, p = null, g = new gt(), b = I({ top: null, height: null }), q = (v) => {
|
4809
4818
|
if (p == 0)
|
4810
4819
|
return 0;
|
4811
4820
|
let w = p - d;
|
4812
4821
|
return v / w;
|
4813
|
-
},
|
4822
|
+
}, N = (v) => {
|
4814
4823
|
let w = d - b.value.height;
|
4815
4824
|
return v / w;
|
4816
|
-
},
|
4817
|
-
let w = v.target,
|
4818
|
-
L(
|
4819
|
-
},
|
4825
|
+
}, ue = (v) => {
|
4826
|
+
let w = v.target, R = q(w.scrollTop);
|
4827
|
+
L(R), s("scroll", w);
|
4828
|
+
}, se = () => {
|
4820
4829
|
if (p == 0)
|
4821
4830
|
return 80;
|
4822
4831
|
let v = d / p;
|
4823
4832
|
if (v == 1)
|
4824
4833
|
return 0;
|
4825
4834
|
let w = d * v;
|
4826
|
-
return
|
4827
|
-
},
|
4828
|
-
let
|
4829
|
-
return
|
4830
|
-
},
|
4831
|
-
let w =
|
4832
|
-
return { top:
|
4835
|
+
return re.between(w, 80, 500);
|
4836
|
+
}, f = (v, w) => {
|
4837
|
+
let R = q(v), V = (d - w) * R;
|
4838
|
+
return re.between(V, 0, d - w);
|
4839
|
+
}, E = (v) => {
|
4840
|
+
let w = se();
|
4841
|
+
return { top: f(v, w), height: w };
|
4833
4842
|
}, m = (v) => {
|
4834
4843
|
}, $ = (v) => {
|
4835
|
-
let w =
|
4844
|
+
let w = q(v);
|
4836
4845
|
L(w);
|
4837
4846
|
}, L = (v) => {
|
4838
|
-
let w =
|
4839
|
-
b.value.top =
|
4840
|
-
let
|
4841
|
-
r.value.scrollTop =
|
4842
|
-
},
|
4847
|
+
let w = re.between(v, 0, 1), R = d - b.value.height;
|
4848
|
+
b.value.top = R * w;
|
4849
|
+
let me = (p - d) * w;
|
4850
|
+
r.value.scrollTop = me, a.value.scrollTop != me && (a.value.scrollTop = me);
|
4851
|
+
}, U = () => {
|
4843
4852
|
let v = r.value.scrollTop;
|
4844
|
-
b.value =
|
4845
|
-
},
|
4846
|
-
d =
|
4847
|
-
let w =
|
4848
|
-
b.value.height = w, b.value.top =
|
4849
|
-
},
|
4853
|
+
b.value = E(v), $(v);
|
4854
|
+
}, G = (v) => {
|
4855
|
+
d = j.getHeight(a.value), p = a.value.scrollHeight;
|
4856
|
+
let w = se();
|
4857
|
+
b.value.height = w, b.value.top = f(r.value.scrollTop, w);
|
4858
|
+
}, ne = (v) => {
|
4850
4859
|
let w = v.target;
|
4851
4860
|
return parseInt(w.style.top);
|
4852
|
-
},
|
4853
|
-
let
|
4861
|
+
}, le = (v, w, R, V) => {
|
4862
|
+
let me = v.y - w.y, mt = R + me, yt = N(mt);
|
4854
4863
|
L(yt);
|
4855
|
-
},
|
4864
|
+
}, xe = (v) => {
|
4856
4865
|
h.value = !0;
|
4857
|
-
},
|
4866
|
+
}, ke = (v) => {
|
4858
4867
|
h.value = !1;
|
4859
4868
|
};
|
4860
|
-
return
|
4861
|
-
|
4862
|
-
}),
|
4863
|
-
|
4864
|
-
}),
|
4865
|
-
let
|
4866
|
-
L(
|
4867
|
-
}), t({ scrollTo: $, update:
|
4869
|
+
return we(() => {
|
4870
|
+
U(), g.scroll(a.value, ue), g.drag(c.value, { init: ne, handler: le }), g.observe(a.value, G), g.mouseDown(c.value, xe, ke);
|
4871
|
+
}), be(() => {
|
4872
|
+
g.dispose();
|
4873
|
+
}), J(() => r.value.scrollTop, (v, w) => {
|
4874
|
+
let R = q(v);
|
4875
|
+
L(R);
|
4876
|
+
}), t({ scrollTo: $, update: U }), (v, w) => (O(), B("div", {
|
4868
4877
|
ref_key: "scrollerRef",
|
4869
4878
|
ref: i,
|
4870
|
-
class:
|
4879
|
+
class: Le(["ha-scroller", { hover: y(h) }])
|
4871
4880
|
}, [
|
4872
4881
|
D("div", {
|
4873
4882
|
ref_key: "containerRef",
|
4874
4883
|
ref: a,
|
4875
4884
|
class: "scroller-container"
|
4876
4885
|
}, [
|
4877
|
-
|
4886
|
+
pe(v.$slots, "default")
|
4878
4887
|
], 512),
|
4879
4888
|
D("div", {
|
4880
4889
|
ref_key: "trackRef",
|
4881
4890
|
ref: o,
|
4882
4891
|
class: "scroller-track",
|
4883
4892
|
onClick: w[0] || (w[0] = //@ts-ignore
|
4884
|
-
(...
|
4893
|
+
(...R) => y(m) && y(m)(...R))
|
4885
4894
|
}, [
|
4886
4895
|
D("div", {
|
4887
4896
|
ref_key: "thumbRef",
|
4888
4897
|
ref: c,
|
4889
4898
|
class: "scroller-thumb",
|
4890
4899
|
style: fe({ top: `${y(b).top}px`, height: `${y(b).height}px` })
|
4891
|
-
},
|
4900
|
+
}, he(y(r).scrollTop), 5)
|
4892
4901
|
], 512)
|
4893
4902
|
], 2));
|
4894
4903
|
}
|
4895
|
-
}),
|
4904
|
+
}), dr = /* @__PURE__ */ Q({
|
4896
4905
|
__name: "Timer",
|
4897
4906
|
emits: ["change"],
|
4898
4907
|
setup(u, { expose: t, emit: e }) {
|
@@ -4907,14 +4916,14 @@ const fl = /* @__PURE__ */ Q({
|
|
4907
4916
|
}, d = () => {
|
4908
4917
|
clearInterval(i), r.value = l;
|
4909
4918
|
};
|
4910
|
-
return
|
4919
|
+
return be(() => {
|
4911
4920
|
clearInterval(i);
|
4912
|
-
}), t({ restart: c, start: o, stop: h, reset: d }), (p,
|
4913
|
-
|
4914
|
-
xt(
|
4921
|
+
}), t({ restart: c, start: o, stop: h, reset: d }), (p, g) => (O(), B("span", null, [
|
4922
|
+
pe(p.$slots, "default"),
|
4923
|
+
xt(he(y(ee).format(y(r), "HH:mm:ss SSS")), 1)
|
4915
4924
|
]));
|
4916
4925
|
}
|
4917
|
-
}),
|
4926
|
+
}), hr = /* @__PURE__ */ Q({
|
4918
4927
|
__name: "Code",
|
4919
4928
|
props: {
|
4920
4929
|
config: { default: {} },
|
@@ -4923,55 +4932,55 @@ const fl = /* @__PURE__ */ Q({
|
|
4923
4932
|
},
|
4924
4933
|
emits: ["mounted", "change", "scroll", "update:modelValue"],
|
4925
4934
|
setup(u, { expose: t, emit: e }) {
|
4926
|
-
let s = e, l = u, { config: r, border: i, modelValue: a } =
|
4927
|
-
if (
|
4935
|
+
let s = e, l = u, { config: r, border: i, modelValue: a } = te(l), o = null, c = null, h = null, d = I(), { app: p } = Z.sys, g = (f) => f == "default" ? null : "vs-dark", b = (f) => {
|
4936
|
+
if (Z.editor.completions[f])
|
4928
4937
|
return;
|
4929
|
-
let
|
4930
|
-
if (!
|
4938
|
+
let E = o.languages.getLanguages().find(($) => $.id == f);
|
4939
|
+
if (!E)
|
4931
4940
|
return;
|
4932
|
-
let m =
|
4941
|
+
let m = E.loader;
|
4933
4942
|
m && m().then(($) => {
|
4934
|
-
|
4943
|
+
Z.editor.completions[f] || (q($, f), Z.editor.completions[f] = !0);
|
4935
4944
|
});
|
4936
|
-
},
|
4945
|
+
}, q = (f, E) => o.languages.registerCompletionItemProvider(E, {
|
4937
4946
|
provideCompletionItems: ($, L) => {
|
4938
|
-
let
|
4947
|
+
let U = $.getWordUntilPosition(L), G = {
|
4939
4948
|
startLineNumber: L.lineNumber,
|
4940
4949
|
endLineNumber: L.lineNumber,
|
4941
|
-
startColumn:
|
4942
|
-
endColumn:
|
4943
|
-
},
|
4944
|
-
const
|
4945
|
-
for (let
|
4946
|
-
const
|
4947
|
-
let v =
|
4950
|
+
startColumn: U.startColumn,
|
4951
|
+
endColumn: U.endColumn
|
4952
|
+
}, ne = [];
|
4953
|
+
const le = ["builtinFunctions", "keywords", "operators"];
|
4954
|
+
for (let xe = 0; xe < le.length; xe++) {
|
4955
|
+
const ke = le[xe];
|
4956
|
+
let v = f.language[ke];
|
4948
4957
|
v && v.forEach((w) => {
|
4949
|
-
let
|
4950
|
-
label:
|
4958
|
+
let R = w.toLowerCase(), V = {
|
4959
|
+
label: R,
|
4951
4960
|
kind: null,
|
4952
|
-
insertText:
|
4953
|
-
range:
|
4961
|
+
insertText: R,
|
4962
|
+
range: G,
|
4954
4963
|
documentation: w
|
4955
4964
|
};
|
4956
|
-
|
4965
|
+
ke == "keywords" ? (V.kind = o.languages.CompletionItemKind.Keyword, V.detail = "关键词") : ke == "operators" ? (V.kind = o.languages.CompletionItemKind.Operator, V.insertText += " ", V.detail = "操作符") : (V.kind = o.languages.CompletionItemKind.Function, V.insertText += "()", V.detail = "函数"), ne.push(V);
|
4957
4966
|
});
|
4958
4967
|
}
|
4959
|
-
return { suggestions:
|
4968
|
+
return { suggestions: ne };
|
4960
4969
|
}
|
4961
|
-
}),
|
4962
|
-
let
|
4963
|
-
r.value.schema && (
|
4964
|
-
let
|
4970
|
+
}), N = () => {
|
4971
|
+
let f = null;
|
4972
|
+
r.value.schema && (f = r.value.category + "/" + W.getUniqueId(), Z.tryAddSchema(f, r.value.category, r.value.schema));
|
4973
|
+
let E = {
|
4965
4974
|
validate: !0,
|
4966
4975
|
allowComments: !0,
|
4967
4976
|
//允许配置注释
|
4968
4977
|
//保证架构配置在当前控件生效,所以需要绑定匹配哪个文件时使用架构
|
4969
|
-
schemas:
|
4978
|
+
schemas: X.clone(Z.editor.schemas),
|
4970
4979
|
trailingCommas: "ignore"
|
4971
4980
|
//允许末尾逗号
|
4972
4981
|
};
|
4973
|
-
o.languages.json.jsonDefaults.setDiagnosticsOptions(
|
4974
|
-
let m =
|
4982
|
+
o.languages.json.jsonDefaults.setDiagnosticsOptions(E), b(r.value.language);
|
4983
|
+
let m = f ? o.Uri.parse(f) : null;
|
4975
4984
|
h = o.editor.createModel(a.value, r.value.language, m);
|
4976
4985
|
let $ = {
|
4977
4986
|
tabSize: 2,
|
@@ -4984,7 +4993,7 @@ const fl = /* @__PURE__ */ Q({
|
|
4984
4993
|
//默认已启用代码图
|
4985
4994
|
scrollbar: { verticalScrollbarSize: 0 },
|
4986
4995
|
//关闭最右侧垂直滚动条
|
4987
|
-
theme:
|
4996
|
+
theme: g(p.theme),
|
4988
4997
|
automaticLayout: !0,
|
4989
4998
|
//根据父元素自动布局
|
4990
4999
|
model: h
|
@@ -4992,55 +5001,55 @@ const fl = /* @__PURE__ */ Q({
|
|
4992
5001
|
c = o.editor.create(d.value, $), r.value.scrollTop && c.setScrollTop(r.value.scrollTop);
|
4993
5002
|
let L = r.value.selection;
|
4994
5003
|
if (L) {
|
4995
|
-
let
|
5004
|
+
let U = {
|
4996
5005
|
startLineNumber: L.startLine,
|
4997
5006
|
endLineNumber: L.endLine,
|
4998
5007
|
startColumn: L.startColumn,
|
4999
5008
|
endColumn: L.endColumn
|
5000
5009
|
};
|
5001
|
-
c.setSelection(
|
5010
|
+
c.setSelection(U);
|
5002
5011
|
}
|
5003
|
-
c.onDidScrollChange((
|
5004
|
-
s("scroll",
|
5005
|
-
}), c.onDidChangeModelContent((
|
5006
|
-
let
|
5007
|
-
s("update:modelValue",
|
5012
|
+
c.onDidScrollChange((U) => {
|
5013
|
+
s("scroll", U.scrollTop);
|
5014
|
+
}), c.onDidChangeModelContent((U) => {
|
5015
|
+
let G = c.getValue();
|
5016
|
+
s("update:modelValue", G), s("change", G);
|
5008
5017
|
});
|
5009
5018
|
};
|
5010
|
-
|
5011
|
-
o = await
|
5019
|
+
we(async () => {
|
5020
|
+
o = await ge.getMonaco(), d.value && (N(), s("mounted", o, c));
|
5012
5021
|
});
|
5013
|
-
let
|
5022
|
+
let ue = () => {
|
5014
5023
|
c == null || c.layout();
|
5015
|
-
},
|
5016
|
-
return
|
5024
|
+
}, se = () => c;
|
5025
|
+
return be(() => {
|
5017
5026
|
h == null || h.dispose(), c == null || c.dispose();
|
5018
|
-
}),
|
5019
|
-
let m = f
|
5027
|
+
}), J(() => p.theme, (f, E) => {
|
5028
|
+
let m = g(f);
|
5020
5029
|
o.editor.setTheme(m);
|
5021
|
-
}),
|
5022
|
-
}),
|
5030
|
+
}), J(() => p.language, (f, E) => {
|
5031
|
+
}), J(() => a.value, (f, E) => {
|
5023
5032
|
if (!c)
|
5024
5033
|
return;
|
5025
5034
|
let m = c.getValue();
|
5026
|
-
|
5027
|
-
}),
|
5035
|
+
f != m && c.setValue(f ?? "");
|
5036
|
+
}), J(() => r.value.language, (f, E) => {
|
5028
5037
|
if (!c)
|
5029
5038
|
return;
|
5030
5039
|
let m = c.getModel();
|
5031
|
-
o.editor.setModelLanguage(m,
|
5032
|
-
}), t({ layout:
|
5033
|
-
default:
|
5040
|
+
o.editor.setModelLanguage(m, f), b(f);
|
5041
|
+
}), t({ layout: ue, getEditor: se }), (f, E) => (O(), He(fl, null, {
|
5042
|
+
default: qe(() => [
|
5034
5043
|
D("div", {
|
5035
5044
|
ref_key: "monacoEditorRef",
|
5036
5045
|
ref: d,
|
5037
|
-
class:
|
5046
|
+
class: Le(["ha-code", { border: y(i) }])
|
5038
5047
|
}, null, 2)
|
5039
5048
|
]),
|
5040
5049
|
_: 1
|
5041
5050
|
}));
|
5042
5051
|
}
|
5043
|
-
}),
|
5052
|
+
}), pr = /* @__PURE__ */ Q({
|
5044
5053
|
__name: "Compare",
|
5045
5054
|
props: {
|
5046
5055
|
inline: { type: Boolean, default: !1 },
|
@@ -5050,43 +5059,43 @@ const fl = /* @__PURE__ */ Q({
|
|
5050
5059
|
},
|
5051
5060
|
emits: ["update:modelValue", "update:original", "change"],
|
5052
5061
|
setup(u, { emit: t }) {
|
5053
|
-
let e = t, s = u, { inline: l, language: r, original: i, modelValue: a } =
|
5054
|
-
c =
|
5062
|
+
let e = t, s = u, { inline: l, language: r, original: i, modelValue: a } = te(s), o = null, c = null, h = null, d = null, p = null, g = null, b = I(), q = I(), { app: N } = Z.sys, ue = (f) => {
|
5063
|
+
c = f.editor.createModel(i.value, r.value), h = f.editor.createModel(a.value, r.value), o = f.editor.createDiffEditor(b.value, {
|
5055
5064
|
originalEditable: !0,
|
5056
5065
|
automaticLayout: !0,
|
5057
5066
|
renderSideBySide: !l.value,
|
5058
5067
|
//是否启用行内模式
|
5059
|
-
theme:
|
5060
|
-
}), o.setModel({ original: c, modified: h }), d = o.getOriginalEditor(), d.onDidChangeModelContent((
|
5068
|
+
theme: se(N.theme)
|
5069
|
+
}), o.setModel({ original: c, modified: h }), d = o.getOriginalEditor(), d.onDidChangeModelContent((E) => {
|
5061
5070
|
let m = d.getValue();
|
5062
5071
|
e("update:original", m), e("change", m);
|
5063
|
-
}), p = o.getModifiedEditor(), p.onDidChangeModelContent((
|
5072
|
+
}), p = o.getModifiedEditor(), p.onDidChangeModelContent((E) => {
|
5064
5073
|
let m = p.getValue();
|
5065
5074
|
e("update:modelValue", m);
|
5066
5075
|
});
|
5067
|
-
},
|
5068
|
-
return
|
5069
|
-
|
5070
|
-
}),
|
5071
|
-
let m =
|
5072
|
-
|
5073
|
-
}),
|
5074
|
-
c &&
|
5075
|
-
}),
|
5076
|
+
}, se = (f) => f == "default" ? null : "vs-dark";
|
5077
|
+
return we(async () => {
|
5078
|
+
g = await ge.getMonaco(), ue(g);
|
5079
|
+
}), J(() => N.theme, (f, E) => {
|
5080
|
+
let m = se(f);
|
5081
|
+
g.editor.setTheme(m);
|
5082
|
+
}), J(() => r.value, (f, E) => {
|
5083
|
+
c && g.editor.setModelLanguage(c, f), h && g.editor.setModelLanguage(h, f);
|
5084
|
+
}), J(() => i.value, (f, E) => {
|
5076
5085
|
if (!c)
|
5077
5086
|
return;
|
5078
5087
|
let m = c.getValue();
|
5079
|
-
|
5080
|
-
}),
|
5088
|
+
f != m && c.setValue(f ?? "");
|
5089
|
+
}), J(() => a.value, (f, E) => {
|
5081
5090
|
if (!h)
|
5082
5091
|
return;
|
5083
5092
|
let m = h.getValue();
|
5084
|
-
|
5085
|
-
}), (
|
5093
|
+
f != m && h.setValue(f ?? "");
|
5094
|
+
}), (f, E) => (O(), B("div", {
|
5086
5095
|
ref_key: "compareRef",
|
5087
5096
|
ref: b,
|
5088
5097
|
class: "ha-compare",
|
5089
|
-
style: fe(y(
|
5098
|
+
style: fe(y(q))
|
5090
5099
|
}, null, 4));
|
5091
5100
|
}
|
5092
5101
|
}), ze = (u, t) => {
|
@@ -5094,12 +5103,12 @@ const fl = /* @__PURE__ */ Q({
|
|
5094
5103
|
for (const [s, l] of t)
|
5095
5104
|
e[s] = l;
|
5096
5105
|
return e;
|
5097
|
-
},
|
5098
|
-
function
|
5099
|
-
return O(),
|
5106
|
+
}, ml = {}, yl = { class: "ha-option" };
|
5107
|
+
function vl(u, t) {
|
5108
|
+
return O(), B("div", yl, "选项");
|
5100
5109
|
}
|
5101
|
-
const
|
5102
|
-
|
5110
|
+
const wl = /* @__PURE__ */ ze(ml, [["render", vl]]), bl = { class: "ha-rich-text" }, xl = /* @__PURE__ */ Ct('<div class="ql-formats"><button class="ql-bold" data-toggle="tooltip" data-placement="bottom" title="Bold"></button><button class="ql-italic" data-toggle="tooltip" data-placement="bottom" title="Italic <ctrl+i>"></button><button class="ql-date" data-toggle="tooltip" data-placement="bottom" title="Date"></button><button class="ql-underline" data-toggle="tooltip" data-placement="bottom" title="Underline"></button><button class="ql-strike" data-toggle="tooltip" data-placement="bottom" title="Strike"></button></div><div class="ql-formats"><button class="ql-list" data-toggle="tooltip" data-placement="bottom" value="ordered"></button><button class="ql-list" data-toggle="tooltip" data-placement="bottom" value="bullet"></button><select class="ql-color"><option selected></option><option value="#e60000"></option><option value="#ff9900"></option><option value="#ffff00"></option><option value="#008a00"></option><option value="#0066cc"></option><option value="#9933ff"></option><option value="#ffffff"></option><option value="#facccc"></option><option value="#ffebcc"></option><option value="#ffffcc"></option><option value="#cce8cc"></option><option value="#cce0f5"></option><option value="#ebd6ff"></option><option value="#bbbbbb"></option><option value="#f06666"></option><option value="#ffc266"></option><option value="#ffff66"></option><option value="#66b966"></option><option value="#66a3e0"></option><option value="#c285ff"></option><option value="#888888"></option><option value="#a10000"></option><option value="#b26b00"></option><option value="#b2b200"></option><option value="#006100"></option><option value="#0047b2"></option><option value="#6b24b2"></option><option value="#444444"></option><option value="#5c0000"></option><option value="#663d00"></option><option value="#666600"></option><option value="#003700"></option><option value="#002966"></option><option value="#3d1466"></option></select><select class="ql-background"><option selected></option><option value="#e60000"></option><option value="#ff9900"></option><option value="#ffff00"></option><option value="#008a00"></option><option value="#0066cc"></option><option value="#9933ff"></option><option value="#ffffff"></option><option value="#facccc"></option><option value="#ffebcc"></option><option value="#ffffcc"></option><option value="#cce8cc"></option><option value="#cce0f5"></option><option value="#ebd6ff"></option><option value="#bbbbbb"></option><option value="#f06666"></option><option value="#ffc266"></option><option value="#ffff66"></option><option value="#66b966"></option><option value="#66a3e0"></option><option value="#c285ff"></option><option value="#888888"></option><option value="#a10000"></option><option value="#b26b00"></option><option value="#b2b200"></option><option value="#006100"></option><option value="#0047b2"></option><option value="#6b24b2"></option><option value="#444444"></option><option value="#5c0000"></option><option value="#663d00"></option><option value="#666600"></option><option value="#003700"></option><option value="#002966"></option><option value="#3d1466"></option></select></div><div class="ql-formats"><button class="ql-code-block" data-toggle="tooltip" data-placement="bottom" title="Code"></button><button class="ql-blockquote" data-toggle="tooltip" data-placement="bottom" title="Block quote"></button><button class="ql-link" data-toggle="tooltip" data-placement="bottom" title="Link"></button></div><div class="ql-formats"><button class="ql-header" data-toggle="tooltip" data-placement="bottom" value="1"></button><button class="ql-header" data-toggle="tooltip" data-placement="bottom" value="2"></button><select class="ql-align"><option selected></option><option value="center"></option><option value="right"></option><option value="justify"></option></select></div><div class="ql-formats"><select class="ql-size"><option value="small"></option><option selected></option><option value="large"></option><option value="huge"></option></select><select class="ql-header"><option value=""></option><option value="1"></option><option value="2"></option><option value="3"></option><option value="4"></option><option value="5"></option><option value="6"></option></select></div><div class="ql-formats"><select class="ql-font"><option selected></option><option value="serif"></option><option value="monospace"></option></select></div><div class="ql-formats"><button class="ql-image" data-toggle="tooltip" data-placement="bottom" title="Image"></button><button class="ql-video" data-toggle="tooltip" data-placement="bottom" title="Video"></button><button class="ql-clean" data-toggle="tooltip" data-placement="bottom" title="Clean"></button></div>', 7), kl = [
|
5111
|
+
xl
|
5103
5112
|
], fr = /* @__PURE__ */ Q({
|
5104
5113
|
__name: "RichText",
|
5105
5114
|
props: /* @__PURE__ */ Ke({
|
@@ -5110,66 +5119,66 @@ const bl = /* @__PURE__ */ ze(yl, [["render", wl]]), xl = { class: "ha-rich-text
|
|
5110
5119
|
}),
|
5111
5120
|
emits: /* @__PURE__ */ Ke(["change", "scroll"], ["update:modelValue"]),
|
5112
5121
|
setup(u, { expose: t, emit: e }) {
|
5113
|
-
let s = e, l = u, { options: r } =
|
5114
|
-
let $ =
|
5115
|
-
if (
|
5116
|
-
|
5122
|
+
let s = e, l = u, { options: r } = te(l), i = et(u, "modelValue"), a, o = null, c = null, h = !1, d = !1, p = I(), g = I(), b = I(), q = I(!1), N = I({ style: null, options: { scrollTop: 0 } }), ue = (m) => {
|
5123
|
+
let $ = ee.getDateString(), L = getSelection(), U = L.getRangeAt(0), G = U.startContainer;
|
5124
|
+
if (G.nodeName == "#text")
|
5125
|
+
G.insertData(U.startOffset, $), U.setStart(G, U.startOffset + $.length), L.removeAllRanges(), L.addRange(U);
|
5117
5126
|
else {
|
5118
|
-
let
|
5119
|
-
|
5120
|
-
let
|
5121
|
-
|
5127
|
+
let ne = document.createTextNode($);
|
5128
|
+
G.appendChild(ne);
|
5129
|
+
let le = document.createRange();
|
5130
|
+
le.selectNodeContents(ne), le.setStart(ne, le.startOffset + $.length), L.removeAllRanges(), L.addRange(le);
|
5122
5131
|
}
|
5123
|
-
},
|
5132
|
+
}, se = (m) => {
|
5124
5133
|
if (o.scrollTop = m.scrollTop, h || d) {
|
5125
5134
|
h = !1, d = !1;
|
5126
5135
|
return;
|
5127
5136
|
}
|
5128
5137
|
c = m, s("scroll", m);
|
5129
|
-
},
|
5130
|
-
let m = await
|
5138
|
+
}, f = () => `height: calc(100% - ${j.getHeight(g.value)}px)`, E = async () => {
|
5139
|
+
let m = await ge.getQuill();
|
5131
5140
|
a = new m(p.value, {
|
5132
5141
|
modules: {
|
5133
5142
|
toolbar: {
|
5134
|
-
container:
|
5135
|
-
handlers: { date:
|
5143
|
+
container: g.value,
|
5144
|
+
handlers: { date: ue }
|
5136
5145
|
}
|
5137
5146
|
},
|
5138
5147
|
theme: "snow"
|
5139
|
-
}),
|
5140
|
-
|
5141
|
-
}), r.value.readonly && a.disable(), o = p.value.querySelector(".ql-editor"), o.innerHTML = i.value,
|
5148
|
+
}), q.value = !0, We(() => {
|
5149
|
+
N.value.style = f();
|
5150
|
+
}), r.value.readonly && a.disable(), o = p.value.querySelector(".ql-editor"), o.innerHTML = i.value, N.value.options.scrollTop = r.value.scrollTop, a.on("text-change", ($, L, U) => {
|
5142
5151
|
o.innerHTML != i.value && (h = !0, i.value = o.innerHTML);
|
5143
5152
|
}), o.addEventListener("paste", ($) => {
|
5144
5153
|
d = !0;
|
5145
5154
|
});
|
5146
5155
|
};
|
5147
|
-
return
|
5148
|
-
|
5149
|
-
}),
|
5156
|
+
return we(() => {
|
5157
|
+
E();
|
5158
|
+
}), be(() => {
|
5150
5159
|
a = null;
|
5151
|
-
}),
|
5160
|
+
}), J(() => i.value, (m, $) => {
|
5152
5161
|
o && o.innerHTML != m && (o.innerHTML = m);
|
5153
|
-
}),
|
5162
|
+
}), J(() => r.value.scrollTop, (m, $) => {
|
5154
5163
|
m != null && (c == null ? void 0 : c.scrollTop) != m && We(() => {
|
5155
|
-
|
5164
|
+
N.value.options.scrollTop = m;
|
5156
5165
|
});
|
5157
|
-
}), t({}), (m, $) => (O(),
|
5166
|
+
}), t({}), (m, $) => (O(), B("div", bl, [
|
5158
5167
|
kt(D("div", {
|
5159
5168
|
ref_key: "toolbarRef",
|
5160
|
-
ref:
|
5161
|
-
},
|
5162
|
-
[St, y(
|
5169
|
+
ref: g
|
5170
|
+
}, kl, 512), [
|
5171
|
+
[St, y(q)]
|
5163
5172
|
]),
|
5164
|
-
Ce(y(
|
5173
|
+
Ce(y(gl), {
|
5165
5174
|
ref_key: "scrollerRef",
|
5166
5175
|
ref: b,
|
5167
5176
|
class: "ql-body",
|
5168
|
-
options: y(
|
5169
|
-
onScroll: y(
|
5170
|
-
style: fe(y(
|
5177
|
+
options: y(N).options,
|
5178
|
+
onScroll: y(se),
|
5179
|
+
style: fe(y(N).style)
|
5171
5180
|
}, {
|
5172
|
-
default:
|
5181
|
+
default: qe(() => [
|
5173
5182
|
D("div", {
|
5174
5183
|
ref_key: "editorRef",
|
5175
5184
|
ref: p
|
@@ -5179,17 +5188,17 @@ const bl = /* @__PURE__ */ ze(yl, [["render", wl]]), xl = { class: "ha-rich-text
|
|
5179
5188
|
}, 8, ["options", "onScroll", "style"])
|
5180
5189
|
]));
|
5181
5190
|
}
|
5182
|
-
}),
|
5191
|
+
}), Sl = {}, Cl = { class: "ha-select" }, El = /* @__PURE__ */ D("div", { class: "select-title" }, "头", -1), Tl = /* @__PURE__ */ D("div", { class: "select-body" }, [
|
5183
5192
|
/* @__PURE__ */ D("input", { type: "text" })
|
5184
|
-
], -1),
|
5185
|
-
|
5186
|
-
|
5193
|
+
], -1), $l = [
|
5194
|
+
El,
|
5195
|
+
Tl
|
5187
5196
|
];
|
5188
|
-
function
|
5189
|
-
return O(),
|
5197
|
+
function Ll(u, t) {
|
5198
|
+
return O(), B("div", Cl, $l);
|
5190
5199
|
}
|
5191
|
-
const
|
5192
|
-
class
|
5200
|
+
const _e = /* @__PURE__ */ ze(Sl, [["render", Ll]]);
|
5201
|
+
class gr {
|
5193
5202
|
/**
|
5194
5203
|
* 初始化
|
5195
5204
|
*/
|
@@ -5213,7 +5222,7 @@ class mr {
|
|
5213
5222
|
this.startLine = t, this.endLine = e, this.startColumn = s, this.endColumn = l;
|
5214
5223
|
}
|
5215
5224
|
}
|
5216
|
-
const
|
5225
|
+
const Al = { class: "ha-condition" }, Dl = /* @__PURE__ */ Q({
|
5217
5226
|
__name: "Condition",
|
5218
5227
|
props: {
|
5219
5228
|
name: {},
|
@@ -5221,80 +5230,80 @@ const Dl = { class: "ha-condition" }, Il = /* @__PURE__ */ Q({
|
|
5221
5230
|
value: {}
|
5222
5231
|
},
|
5223
5232
|
setup(u) {
|
5224
|
-
let t = u, { name: e, operator: s, value: l } =
|
5225
|
-
return (r, i) => (O(),
|
5226
|
-
Ce(y(
|
5233
|
+
let t = u, { name: e, operator: s, value: l } = te(t);
|
5234
|
+
return (r, i) => (O(), B("div", Al, [
|
5235
|
+
Ce(y(_e), {
|
5227
5236
|
modelValue: y(e),
|
5228
|
-
"onUpdate:modelValue": i[0] || (i[0] = (a) =>
|
5237
|
+
"onUpdate:modelValue": i[0] || (i[0] = (a) => je(e) ? e.value = a : e = a)
|
5229
5238
|
}, null, 8, ["modelValue"]),
|
5230
|
-
Ce(y(
|
5239
|
+
Ce(y(_e), {
|
5231
5240
|
modelValue: y(s),
|
5232
|
-
"onUpdate:modelValue": i[1] || (i[1] = (a) =>
|
5241
|
+
"onUpdate:modelValue": i[1] || (i[1] = (a) => je(s) ? s.value = a : s = a)
|
5233
5242
|
}, {
|
5234
|
-
default:
|
5235
|
-
Ce(y(
|
5243
|
+
default: qe(() => [
|
5244
|
+
Ce(y(wl))
|
5236
5245
|
]),
|
5237
5246
|
_: 1
|
5238
5247
|
}, 8, ["modelValue"]),
|
5239
|
-
Ce(y(
|
5248
|
+
Ce(y(_e), {
|
5240
5249
|
modelValue: y(l),
|
5241
|
-
"onUpdate:modelValue": i[2] || (i[2] = (a) =>
|
5250
|
+
"onUpdate:modelValue": i[2] || (i[2] = (a) => je(l) ? l.value = a : l = a)
|
5242
5251
|
}, null, 8, ["modelValue"])
|
5243
5252
|
]));
|
5244
5253
|
}
|
5245
|
-
}),
|
5254
|
+
}), Il = { class: "ha-condition-group" }, mr = /* @__PURE__ */ Q({
|
5246
5255
|
__name: "Index",
|
5247
5256
|
props: {
|
5248
5257
|
conditions: {}
|
5249
5258
|
},
|
5250
5259
|
setup(u) {
|
5251
|
-
let t = u, { conditions: e } =
|
5252
|
-
return (s, l) => (O(),
|
5253
|
-
(O(!0),
|
5260
|
+
let t = u, { conditions: e } = te(t);
|
5261
|
+
return (s, l) => (O(), B("div", Il, [
|
5262
|
+
(O(!0), B(Et, null, Tt(y(e), (r) => (O(), He(y(Dl), {
|
5254
5263
|
name: r.name,
|
5255
5264
|
operator: r.operator,
|
5256
5265
|
value: r.value
|
5257
5266
|
}, null, 8, ["name", "operator", "value"]))), 256))
|
5258
5267
|
]));
|
5259
5268
|
}
|
5260
|
-
}),
|
5261
|
-
function
|
5262
|
-
return O(),
|
5263
|
-
|
5269
|
+
}), Ol = {}, Rl = { class: "ha-col" };
|
5270
|
+
function jl(u, t) {
|
5271
|
+
return O(), B("div", Rl, [
|
5272
|
+
pe(u.$slots, "default")
|
5264
5273
|
]);
|
5265
5274
|
}
|
5266
|
-
const
|
5275
|
+
const yr = /* @__PURE__ */ ze(Ol, [["render", jl]]), vr = /* @__PURE__ */ Q({
|
5267
5276
|
__name: "Container",
|
5268
5277
|
props: {
|
5269
5278
|
container: { type: Boolean, default: !0 }
|
5270
5279
|
},
|
5271
5280
|
setup(u) {
|
5272
|
-
let t = u, { container: e } =
|
5273
|
-
return (s, l) => (O(),
|
5274
|
-
class:
|
5281
|
+
let t = u, { container: e } = te(t);
|
5282
|
+
return (s, l) => (O(), B("div", {
|
5283
|
+
class: Le({ "ha-container": y(e) })
|
5275
5284
|
}, [
|
5276
|
-
|
5285
|
+
pe(s.$slots, "default")
|
5277
5286
|
], 2));
|
5278
5287
|
}
|
5279
|
-
}),
|
5288
|
+
}), wr = /* @__PURE__ */ Q({
|
5280
5289
|
__name: "Row",
|
5281
5290
|
props: {
|
5282
5291
|
gap: {},
|
5283
5292
|
direction: {}
|
5284
5293
|
},
|
5285
5294
|
setup(u) {
|
5286
|
-
let t = u, { gap: e, direction: s } =
|
5295
|
+
let t = u, { gap: e, direction: s } = te(t), l = Ee(() => {
|
5287
5296
|
let r = { gap: null };
|
5288
5297
|
return e.value && (r.gap = e.value + "px"), r;
|
5289
5298
|
});
|
5290
|
-
return (r, i) => (O(),
|
5291
|
-
class:
|
5299
|
+
return (r, i) => (O(), B("div", {
|
5300
|
+
class: Le(["ha-row", y(s)]),
|
5292
5301
|
style: fe(y(l))
|
5293
5302
|
}, [
|
5294
|
-
|
5303
|
+
pe(r.$slots, "default")
|
5295
5304
|
], 6));
|
5296
5305
|
}
|
5297
|
-
}),
|
5306
|
+
}), br = /* @__PURE__ */ Q({
|
5298
5307
|
__name: "Progress",
|
5299
5308
|
props: {
|
5300
5309
|
modelValue: { type: Boolean },
|
@@ -5318,177 +5327,172 @@ const vr = /* @__PURE__ */ ze(jl, [["render", _l]]), wr = /* @__PURE__ */ Q({
|
|
5318
5327
|
}, 200));
|
5319
5328
|
}, c);
|
5320
5329
|
};
|
5321
|
-
return
|
5330
|
+
return we(() => {
|
5322
5331
|
t.value && r();
|
5323
|
-
}),
|
5332
|
+
}), be(() => {
|
5324
5333
|
clearInterval(l);
|
5325
|
-
}),
|
5334
|
+
}), J(() => t.value, (a, o) => {
|
5326
5335
|
a ? r() : i();
|
5327
|
-
}), (a, o) => y(e) ? (O(),
|
5336
|
+
}), (a, o) => y(e) ? (O(), B("div", {
|
5328
5337
|
key: 0,
|
5329
5338
|
class: "ha-progress",
|
5330
5339
|
style: fe({ width: y(s) + "%" })
|
5331
5340
|
}, null, 4)) : Ze("", !0);
|
5332
5341
|
}
|
5333
|
-
}),
|
5342
|
+
}), _l = { class: "progress-tips" }, Bl = { class: "progress-tip info" }, Pl = { class: "progress-tip success" }, Ul = { class: "progress-tip error" }, Fl = { class: "progress-chart" }, Ml = { class: "progress-bar" }, ql = { class: "progress-text" }, xr = /* @__PURE__ */ Q({
|
5334
5343
|
__name: "SocketProgress",
|
5335
5344
|
props: {
|
5336
5345
|
progress: {}
|
5337
5346
|
},
|
5338
5347
|
setup(u) {
|
5339
|
-
let t = u, { progress: e } =
|
5348
|
+
let t = u, { progress: e } = te(t), s = Ee(() => {
|
5340
5349
|
let a = e.value;
|
5341
5350
|
return (a.succeed ?? 0) + (a.errored ?? 0);
|
5342
|
-
}), l =
|
5343
|
-
return (a, o) => (O(),
|
5344
|
-
class:
|
5351
|
+
}), l = Ee(() => re.getPercentage(s.value, e.value.total)), r = Ee(() => re.getProgressText(s.value, e.value.total)), i = Ee(() => re.getPercentageText(s.value, e.value.total));
|
5352
|
+
return (a, o) => (O(), B("div", {
|
5353
|
+
class: Le(["ha-socket-progress", { error: y(e).errored > 0 }])
|
5345
5354
|
}, [
|
5346
|
-
D("div",
|
5347
|
-
D("div",
|
5348
|
-
D("div",
|
5349
|
-
D("div",
|
5355
|
+
D("div", _l, [
|
5356
|
+
D("div", Bl, "进度:" + he(y(r)), 1),
|
5357
|
+
D("div", Pl, "成功:" + he(y(e).succeed ?? "-"), 1),
|
5358
|
+
D("div", Ul, "异常:" + he(y(e).errored ?? "-"), 1)
|
5350
5359
|
]),
|
5351
|
-
D("div",
|
5352
|
-
D("div",
|
5360
|
+
D("div", Fl, [
|
5361
|
+
D("div", Ml, [
|
5353
5362
|
D("div", {
|
5354
5363
|
class: "progress-percentage",
|
5355
5364
|
style: fe({ width: y(l) + "%" })
|
5356
5365
|
}, null, 4)
|
5357
5366
|
]),
|
5358
|
-
D("div",
|
5367
|
+
D("div", ql, he(y(i)) + "%", 1)
|
5359
5368
|
])
|
5360
5369
|
], 2));
|
5361
5370
|
}
|
5362
|
-
}),
|
5363
|
-
|
5364
|
-
|
5365
|
-
],
|
5371
|
+
}), Nl = { class: "ha-tab" }, Vl = /* @__PURE__ */ D("div", { class: "tab-header" }, null, -1), zl = /* @__PURE__ */ D("div", { class: "tab-body" }, null, -1), Kl = [
|
5372
|
+
Vl,
|
5373
|
+
zl
|
5374
|
+
], kr = /* @__PURE__ */ Q({
|
5366
5375
|
__name: "Tab",
|
5367
5376
|
props: {
|
5368
5377
|
destroy: { type: Boolean }
|
5369
5378
|
},
|
5370
5379
|
setup(u) {
|
5371
|
-
return (t, e) => (O(),
|
5380
|
+
return (t, e) => (O(), B("div", Nl, Kl));
|
5372
5381
|
}
|
5373
5382
|
});
|
5374
|
-
let
|
5375
|
-
u == null && (u = new
|
5376
|
-
let t = await Fs.getSso(), e =
|
5377
|
-
|
5378
|
-
await T.open(l), await Hs();
|
5379
|
-
debugger;
|
5380
|
-
T.onResponse = async (r) => {
|
5381
|
-
debugger;
|
5383
|
+
let Sr = async (u) => {
|
5384
|
+
u == null && (u = new ul()), await Zs(u), await Ms();
|
5385
|
+
let t = await Fs.getSso(), e = Z.sys.app, s = { baseUrl: u.baseUrl, language: e.language, user: t, platform: "pc" }, l = _.serialize(s);
|
5386
|
+
await T.open(l), T.onResponse = async (r) => {
|
5382
5387
|
let i = r.data;
|
5383
5388
|
return Ps.add(i.code, i.message, i.stack, i.elapsed), Promise.resolve();
|
5384
|
-
};
|
5389
|
+
}, await Me.loadI18n();
|
5385
5390
|
};
|
5386
5391
|
export {
|
5387
|
-
|
5392
|
+
oe as ArrayHelper,
|
5388
5393
|
st as BrowserHelper,
|
5389
|
-
|
5394
|
+
Vt as BuilderFactory,
|
5390
5395
|
lt as Cdn,
|
5391
5396
|
Wt as CdnFactory,
|
5392
5397
|
It as ComponentHelper,
|
5393
|
-
|
5394
|
-
|
5395
|
-
|
5396
|
-
|
5398
|
+
ul as CreateFeOptions,
|
5399
|
+
Be as DictionaryHelper,
|
5400
|
+
j as DomHelper,
|
5401
|
+
pl as DragEvent,
|
5397
5402
|
Xt as EncoderFactory,
|
5398
|
-
|
5399
|
-
|
5403
|
+
ie as EventHelper,
|
5404
|
+
gt as EventUtility,
|
5400
5405
|
Zt as ExcelFactory,
|
5401
5406
|
ts as ExplainerFactory,
|
5402
|
-
|
5407
|
+
C as Factories,
|
5403
5408
|
ns as FeatureFactory,
|
5404
|
-
|
5405
|
-
|
5406
|
-
|
5407
|
-
|
5408
|
-
|
5409
|
-
|
5410
|
-
|
5411
|
-
|
5409
|
+
De as FileHelper,
|
5410
|
+
hr as HaCode,
|
5411
|
+
yr as HaCol,
|
5412
|
+
pr as HaCompare,
|
5413
|
+
Dl as HaCondition,
|
5414
|
+
mr as HaConditionGroup,
|
5415
|
+
vr as HaContainer,
|
5416
|
+
nr as HaEmpty,
|
5412
5417
|
fl as HaFill,
|
5413
|
-
|
5414
|
-
|
5418
|
+
wl as HaOption,
|
5419
|
+
br as HaProgress,
|
5415
5420
|
fr as HaRichText,
|
5416
|
-
|
5417
|
-
|
5418
|
-
|
5419
|
-
|
5420
|
-
|
5421
|
-
|
5421
|
+
wr as HaRow,
|
5422
|
+
gl as HaScroller,
|
5423
|
+
_e as HaSelect,
|
5424
|
+
xr as HaSocketProgress,
|
5425
|
+
kr as HaTab,
|
5426
|
+
dr as HaTimer,
|
5422
5427
|
ds as HaloHttp,
|
5423
5428
|
os as HasherFactory,
|
5424
5429
|
Qe as HtmlHelper,
|
5425
5430
|
hs as HttpFactory,
|
5426
5431
|
it as HttpRequest,
|
5427
5432
|
Ye as HttpResponse,
|
5428
|
-
|
5433
|
+
gs as I18nFactory,
|
5429
5434
|
Ot as ImageHelper,
|
5430
|
-
|
5431
|
-
|
5432
|
-
|
5433
|
-
|
5435
|
+
_ as JsonHelper,
|
5436
|
+
ar as KeyboardUtility,
|
5437
|
+
or as ListDelta,
|
5438
|
+
re as MathHelper,
|
5434
5439
|
ms as Messenger,
|
5435
5440
|
vs as MessengerFactory,
|
5436
|
-
|
5437
|
-
|
5438
|
-
|
5439
|
-
|
5440
|
-
|
5441
|
-
|
5442
|
-
|
5443
|
-
|
5444
|
-
|
5445
|
-
|
5446
|
-
|
5441
|
+
Rt as MicroHelper,
|
5442
|
+
ve as MountHelper,
|
5443
|
+
ur as MouseUtility,
|
5444
|
+
X as ObjectHelper,
|
5445
|
+
ft as Position,
|
5446
|
+
qt as ProviderFactory,
|
5447
|
+
er as ProviderTable,
|
5448
|
+
gr as Range,
|
5449
|
+
ir as Rect,
|
5450
|
+
jt as Ref,
|
5451
|
+
cr as SaveUtility,
|
5447
5452
|
Je as ScrollHelper,
|
5448
5453
|
Bt as SignHelper,
|
5449
5454
|
xs as SignerFactory,
|
5450
5455
|
Xe as SqlHelper,
|
5451
|
-
|
5456
|
+
qs as SsoFactory,
|
5452
5457
|
at as SsoUser,
|
5453
5458
|
W as StringHelper,
|
5454
5459
|
Bs as SvcFactory,
|
5455
5460
|
zs as TaskFactory,
|
5456
|
-
|
5461
|
+
Se as TaskHelper,
|
5457
5462
|
Qs as TemplateFactory,
|
5458
|
-
|
5459
|
-
|
5460
|
-
|
5463
|
+
ee as TimeHelper,
|
5464
|
+
Ie as TreeHelper,
|
5465
|
+
F as TypeHelper,
|
5461
5466
|
K as UrlHelper,
|
5462
|
-
|
5463
|
-
|
5467
|
+
lr as VideoFactory,
|
5468
|
+
rr as VoiceFactory,
|
5464
5469
|
Ys as base64,
|
5465
|
-
|
5466
|
-
|
5467
|
-
|
5468
|
-
|
5469
|
-
|
5470
|
+
ge as cdn,
|
5471
|
+
Z as configSvc,
|
5472
|
+
Sr as createFe,
|
5473
|
+
tr as driverSvc,
|
5474
|
+
sr as envSvc,
|
5470
5475
|
T as http,
|
5471
|
-
|
5476
|
+
Me as i18n,
|
5472
5477
|
Zs as initDriver,
|
5473
|
-
Hs as initI18n,
|
5474
5478
|
Ms as initSvc,
|
5475
5479
|
Ps as logSvc,
|
5476
5480
|
pt as md5,
|
5477
|
-
|
5478
|
-
|
5479
|
-
|
5480
|
-
|
5481
|
+
ye as messenger,
|
5482
|
+
H as moment,
|
5483
|
+
Ae as settingRepo,
|
5484
|
+
ce as settingSvc,
|
5481
5485
|
Us as socketSvc,
|
5482
|
-
|
5483
|
-
|
5484
|
-
|
5485
|
-
|
5486
|
-
|
5487
|
-
|
5488
|
-
|
5489
|
-
|
5490
|
-
|
5491
|
-
|
5486
|
+
Hs as t,
|
5487
|
+
sl as t_enum,
|
5488
|
+
el as t_exists,
|
5489
|
+
ll as t_field,
|
5490
|
+
rl as t_field_choose_placeholder,
|
5491
|
+
nl as t_field_placeholder,
|
5492
|
+
ol as t_menu,
|
5493
|
+
al as t_module,
|
5494
|
+
tl as t_sys,
|
5495
|
+
il as t_table,
|
5492
5496
|
Gs as template,
|
5493
5497
|
Fs as userSvc
|
5494
5498
|
};
|