halo-fe 1.0.18 → 1.0.19
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/main.js +975 -976
- package/esm/drivers/builders/types/ProviderTable.d.ts +6 -0
- package/esm/drivers/builders/types/index.d.ts +2 -0
- package/esm/drivers/i18ns/I18n.d.ts +41 -0
- package/esm/drivers/i18ns/I18nFactory.d.ts +13 -0
- package/esm/drivers/i18ns/II18n.d.ts +66 -0
- package/esm/drivers/i18ns/implements/DefaultI18n.d.ts +13 -0
- package/esm/drivers/i18ns/index.d.ts +3 -0
- package/esm/drivers/index.d.ts +1 -0
- package/esm/factorying/Factories.d.ts +15 -11
- package/esm/factorying/index.d.ts +16 -4
- package/esm/helpers/JsonHelper.d.ts +5 -1
- package/esm/repos/IRepo.d.ts +4 -0
- package/esm/repos/RepoFactory.d.ts +5 -0
- package/esm/repos/implements/SettingRepo.d.ts +15 -0
- package/esm/repos/index.d.ts +1 -1
- package/esm/svcs/implement/I18nSvc.d.ts +1 -1
- package/esm/svcs/implement/index.d.ts +1 -2
- package/esm/svcs/index.d.ts +1 -7
- package/esm/types/CreateFeOptions.d.ts +6 -5
- package/esm/utilities/SaveUtility.d.ts +15 -0
- package/esm/utilities/index.d.ts +2 -1
- package/package.json +2 -3
- package/dist/assets/@intlify-BISCQg1h.js +0 -2189
- package/dist/assets/@vue-aVYGocXp.js +0 -93
- package/dist/assets/vue-i18n-CLr3brPz.js +0 -1670
- package/esm/coms/Code.vue.d.ts +0 -41
- package/esm/coms/Col.vue.d.ts +0 -11
- package/esm/coms/Compare.vue.d.ts +0 -40
- package/esm/coms/Container.vue.d.ts +0 -23
- package/esm/coms/RichText.vue.d.ts +0 -24
- package/esm/coms/Row.vue.d.ts +0 -21
- package/esm/coms/types/CodeEmit.d.ts +0 -23
- package/esm/coms/types/CodeProps.d.ts +0 -18
- package/esm/coms/types/RichTextOptions.d.ts +0 -14
- package/esm/coms/types/RichTextProps.d.ts +0 -12
- package/esm/coms/types/RowProps.d.ts +0 -14
- package/esm/drivers/IDriver.d.ts +0 -10
- package/esm/drivers/cdns/implements/BootCdn.d.ts +0 -12
- package/esm/drivers/cdns/implements/JsdelivrCdn.d.ts +0 -15
- package/esm/drivers/cdns/implements/StaticFileCdn.d.ts +0 -21
- package/esm/drivers/cdns/implements/UnpkgCdn.d.ts +0 -12
- package/esm/drivers/factories/DriverFactory.d.ts +0 -64
- package/esm/drivers/factories/Factory.d.ts +0 -18
- package/esm/drivers/factories/IFactory.d.ts +0 -18
- package/esm/drivers/factories/index.d.ts +0 -42
- package/esm/drivers/providers/implements/StorageHelper.d.ts +0 -34
- package/esm/helpers/ScriptHelper.d.ts +0 -19
- package/esm/helpers/array-helper.d.ts +0 -97
- package/esm/helpers/component-helper.d.ts +0 -18
- package/esm/helpers/cookie-helper.d.ts +0 -6
- package/esm/helpers/dictionary-helper.d.ts +0 -18
- package/esm/helpers/dom-helper.d.ts +0 -86
- package/esm/helpers/event-helper.d.ts +0 -30
- package/esm/helpers/file-helper.d.ts +0 -22
- package/esm/helpers/html-helper.d.ts +0 -10
- package/esm/helpers/i18n-helper.d.ts +0 -14
- package/esm/helpers/image-helper.d.ts +0 -10
- package/esm/helpers/json-helper.d.ts +0 -39
- package/esm/helpers/math-helper.d.ts +0 -46
- package/esm/helpers/micro-helper.d.ts +0 -10
- package/esm/helpers/mount-helper.d.ts +0 -14
- package/esm/helpers/object-helper.d.ts +0 -38
- package/esm/helpers/script-helper.d.ts +0 -31
- package/esm/helpers/scroll-helper.d.ts +0 -14
- package/esm/helpers/sign-helper.d.ts +0 -14
- package/esm/helpers/storage-helper.d.ts +0 -34
- package/esm/helpers/string-helper.d.ts +0 -94
- package/esm/helpers/task-helper.d.ts +0 -26
- package/esm/helpers/time-helper.d.ts +0 -66
- package/esm/helpers/tree-helper.d.ts +0 -54
- package/esm/helpers/type-helper.d.ts +0 -26
- package/esm/helpers/url-helper.d.ts +0 -96
- package/esm/plugins/HtmlTransform.d.ts +0 -6
- package/esm/plugins/types/IMessager.d.ts +0 -34
- package/esm/plugins/types/index.d.ts +0 -7
- package/esm/services/ConfigService.d.ts +0 -66
- package/esm/services/DriverService.d.ts +0 -36
- package/esm/services/EnvService.d.ts +0 -14
- package/esm/services/LogService.d.ts +0 -19
- package/esm/services/SettingService.d.ts +0 -42
- package/esm/services/SocketService.d.ts +0 -23
- package/esm/services/UserService.d.ts +0 -47
- package/esm/services/index.d.ts +0 -15
- package/esm/services/types/IMessage.d.ts +0 -14
- package/esm/services/types/IMessager.d.ts +0 -34
- package/esm/services/types/index.d.ts +0 -2
- package/esm/servs/ConfigServ.d.ts +0 -66
- package/esm/servs/DriverServ.d.ts +0 -36
- package/esm/servs/EnvServ.d.ts +0 -14
- package/esm/servs/IServ.d.ts +0 -6
- package/esm/servs/LogServ.d.ts +0 -19
- package/esm/servs/Serv.d.ts +0 -4
- package/esm/servs/ServFactory.d.ts +0 -11
- package/esm/servs/SettingServ.d.ts +0 -42
- package/esm/servs/SocketServ.d.ts +0 -38
- package/esm/servs/UserServ.d.ts +0 -47
- package/esm/servs/implement/ConfigServ.d.ts +0 -66
- package/esm/servs/implement/DriverServ.d.ts +0 -36
- package/esm/servs/implement/EnvServ.d.ts +0 -14
- package/esm/servs/implement/LogServ.d.ts +0 -19
- package/esm/servs/implement/SettingServ.d.ts +0 -42
- package/esm/servs/implement/SocketServ.d.ts +0 -38
- package/esm/servs/implement/UserServ.d.ts +0 -47
- package/esm/servs/index.d.ts +0 -15
- package/esm/stores/config.d.ts +0 -63
- package/esm/stores/driver.d.ts +0 -37
- package/esm/stores/env.d.ts +0 -12
- package/esm/stores/index.d.ts +0 -8
- package/esm/stores/log.d.ts +0 -20
- package/esm/stores/setting.d.ts +0 -43
- package/esm/stores/socket.d.ts +0 -27
- package/esm/stores/user.d.ts +0 -40
- package/esm/types/CreateOptions.d.ts +0 -18
package/dist/main.js
CHANGED
@@ -1,14 +1,13 @@
|
|
1
|
-
var
|
2
|
-
var wt = (u, t, e) => t in u ?
|
1
|
+
var vt = Object.defineProperty;
|
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
|
-
import { _ as
|
5
|
-
import { defineAsyncComponent as
|
6
|
-
import { _ as
|
7
|
-
import { a as
|
8
|
-
import { F as
|
9
|
-
import { h as
|
10
|
-
import {
|
11
|
-
import { L as Ot } from "./assets/liquidjs-C-LVcoaY.js";
|
4
|
+
import { _ as Re } from "./assets/underscore-B0BCaBxV.js";
|
5
|
+
import { defineAsyncComponent as bt, reactive as Ge, defineComponent as Q, toRefs as se, openBlock as O, createElementBlock as _, createElementVNode as D, toDisplayString as pe, unref as y, renderSlot as fe, createCommentVNode as Ze, watch as X, ref as I, onMounted as be, onUnmounted as xe, normalizeStyle as ge, normalizeClass as Ae, createTextVNode as xt, createBlock as He, withCtx as Ne, mergeModels as Ke, useModel as et, nextTick as We, withDirectives as kt, vShow as St, createVNode as Ce, createStaticVNode as Et, isRef as _e, Fragment as Ct, renderList as Tt, computed as Te } from "vue";
|
6
|
+
import { _ as $t } from "./assets/underscore.string-oDfap0sE.js";
|
7
|
+
import { a as Lt } from "./assets/clone-DtpAsLoe.js";
|
8
|
+
import { F as At } from "./assets/file-saver-Cnua3zoa.js";
|
9
|
+
import { h as ee } from "./assets/moment-h96o7c8I.js";
|
10
|
+
import { L as Dt } from "./assets/liquidjs-C-LVcoaY.js";
|
12
11
|
class U {
|
13
12
|
}
|
14
13
|
/**
|
@@ -30,7 +29,7 @@ n(U, "isNumber", (t) => {
|
|
30
29
|
* 判断输入类型是否是isBoolean类型
|
31
30
|
*/
|
32
31
|
n(U, "isBoolean", (t) => Object.prototype.toString.call(t) == "[object Boolean]");
|
33
|
-
const
|
32
|
+
const F = class F {
|
34
33
|
/**
|
35
34
|
* 获取最大值
|
36
35
|
*/
|
@@ -70,64 +69,64 @@ const M = class M {
|
|
70
69
|
/**
|
71
70
|
* 过滤某一页数据
|
72
71
|
*/
|
73
|
-
n(
|
72
|
+
n(F, "filterPage", (t, e, s) => {
|
74
73
|
let l = (e - 1) * s, r = e * s;
|
75
74
|
return t.filter((a, o) => o >= l && o < r);
|
76
75
|
}), /**
|
77
76
|
* 总页数
|
78
77
|
*/
|
79
|
-
n(
|
78
|
+
n(F, "pageCount", (t, e) => Math.ceil(t / e)), //#endregion
|
80
79
|
//#region 求值
|
81
80
|
/**
|
82
81
|
* 四舍五入
|
83
82
|
*/
|
84
|
-
n(
|
83
|
+
n(F, "round", (t, e) => t.toFixed(e)), /**
|
85
84
|
* 天花板函数
|
86
85
|
*/
|
87
|
-
n(
|
86
|
+
n(F, "ceil", (t) => Math.ceil(t)), //#endregion
|
88
87
|
//#region 进度
|
89
88
|
/**
|
90
89
|
* 获取百分比
|
91
90
|
*/
|
92
|
-
n(
|
91
|
+
n(F, "getPercentage", (t, e) => {
|
93
92
|
if (!t || !e)
|
94
93
|
return 0;
|
95
|
-
let s = t / e * 100, l =
|
94
|
+
let s = t / e * 100, l = F.round(s, 2);
|
96
95
|
return parseFloat(l);
|
97
96
|
}), /**
|
98
97
|
* 获取进度文本
|
99
98
|
*/
|
100
|
-
n(
|
99
|
+
n(F, "getProgressText", (t, e) => `${t ?? "-"}/${e ?? "-"}`), /**
|
101
100
|
* 获取百分比,保留2位小数
|
102
101
|
*/
|
103
|
-
n(
|
102
|
+
n(F, "getPercentageText", (t, e) => F.getPercentage(t, e).toFixed(2)), //#endregion
|
104
103
|
/**
|
105
104
|
* 获取大小
|
106
105
|
*/
|
107
|
-
n(
|
106
|
+
n(F, "size", (t) => {
|
108
107
|
if (!t)
|
109
108
|
return "OKB";
|
110
109
|
let e = 1024, s = e * 1024;
|
111
110
|
if (t < s)
|
112
|
-
return
|
111
|
+
return F.round(t / e, 2) + "KB";
|
113
112
|
let l = s * 1024;
|
114
113
|
if (t < l)
|
115
|
-
return
|
114
|
+
return F.round(t / s, 2) + "MB";
|
116
115
|
let r = l * 1024;
|
117
116
|
if (t < r)
|
118
|
-
return
|
117
|
+
return F.round(t / l, 2) + "GB";
|
119
118
|
let i = r * 1024;
|
120
119
|
if (t < i)
|
121
|
-
return
|
120
|
+
return F.round(t / r, 2) + "TB";
|
122
121
|
throw new Error("暂未支持比TB更大的大小");
|
123
122
|
});
|
124
|
-
let
|
125
|
-
const
|
123
|
+
let ne = F;
|
124
|
+
const S = class S {
|
126
125
|
/**
|
127
126
|
* 获取分成指定片数量后的集合
|
128
127
|
*/
|
129
128
|
static getChunksByCount(t, e) {
|
130
|
-
let s = [], l =
|
129
|
+
let s = [], l = ne.ceil(t.length / e);
|
131
130
|
for (let r = 0; r < t.length; r += l) {
|
132
131
|
let i = this.getRange(t, r, l);
|
133
132
|
s.push(i);
|
@@ -185,7 +184,7 @@ const E = class E {
|
|
185
184
|
/**
|
186
185
|
* 获取指定数组分成每片指定长度后的集合
|
187
186
|
*/
|
188
|
-
n(
|
187
|
+
n(S, "getChunks", (t, e) => {
|
189
188
|
let s = [];
|
190
189
|
for (let l = 0; l < t.length; l += e) {
|
191
190
|
let r = t.slice(l, l + e);
|
@@ -197,10 +196,10 @@ n(E, "getChunks", (t, e) => {
|
|
197
196
|
/**
|
198
197
|
* 取两个集合的交集
|
199
198
|
*/
|
200
|
-
n(
|
199
|
+
n(S, "intersect", (t, e) => t.filter((l) => e.indexOf(l) > -1)), /**
|
201
200
|
* 排除指定元素(差集)
|
202
201
|
*/
|
203
|
-
n(
|
202
|
+
n(S, "except", (t, e, s = null) => {
|
204
203
|
let l = e instanceof Array ? e : [e], r = [];
|
205
204
|
if (s == null)
|
206
205
|
r = t.filter((i) => l.indexOf(i) == -1);
|
@@ -215,19 +214,19 @@ n(E, "except", (t, e, s = null) => {
|
|
215
214
|
/**
|
216
215
|
* 求最大值,数据类型的比较函数要自己转换为数值类型
|
217
216
|
*/
|
218
|
-
n(
|
217
|
+
n(S, "max", (t, e) => Re.max(t, e)), /**
|
219
218
|
* 求最小值,数据类型的比较函数要自己转换为数值类型
|
220
219
|
*/
|
221
|
-
n(
|
220
|
+
n(S, "min", (t, e) => Re.min(t, e)), /**
|
222
221
|
* 求平均值
|
223
222
|
*/
|
224
|
-
n(
|
225
|
-
let r =
|
223
|
+
n(S, "avg", (t, e, s = null) => {
|
224
|
+
let r = S.sum(t, e) / t.length;
|
226
225
|
return s == null ? r : parseFloat(r.toFixed(s));
|
227
226
|
}), /**
|
228
227
|
* 求和
|
229
228
|
*/
|
230
|
-
n(
|
229
|
+
n(S, "sum", (t, e, s = null) => {
|
231
230
|
let l = 0;
|
232
231
|
for (let i = 0; i < t.length; i++)
|
233
232
|
l += e(t[i]);
|
@@ -237,10 +236,10 @@ n(E, "sum", (t, e, s = null) => {
|
|
237
236
|
/**
|
238
237
|
* 是否包含
|
239
238
|
*/
|
240
|
-
n(
|
239
|
+
n(S, "contains", (t, e) => t.indexOf(e) > -1), /**
|
241
240
|
* 判断指定集合中的指定属性的值,是否包含关键词
|
242
241
|
*/
|
243
|
-
n(
|
242
|
+
n(S, "filterContains", (t, e, s) => {
|
244
243
|
let l = [];
|
245
244
|
if (!s)
|
246
245
|
return t;
|
@@ -258,7 +257,7 @@ n(E, "filterContains", (t, e, s) => {
|
|
258
257
|
/**
|
259
258
|
* 判断2个数组是否每个元素都相同
|
260
259
|
*/
|
261
|
-
n(
|
260
|
+
n(S, "same", (t, e) => {
|
262
261
|
if (t.length != e.length)
|
263
262
|
return !1;
|
264
263
|
let s = t.length >= e.length ? t : e, l = t.length < e.length ? t : e;
|
@@ -271,13 +270,13 @@ n(E, "same", (t, e) => {
|
|
271
270
|
/**
|
272
271
|
* 对数组元素根据指定函数进行去重,并返回去重后的值的新数组 n=>n.value
|
273
272
|
*/
|
274
|
-
n(
|
273
|
+
n(S, "distinct", (t, e) => {
|
275
274
|
let s = new Set(t.map((r) => e(r)));
|
276
275
|
return Array.from(s);
|
277
276
|
}), /**
|
278
277
|
* 连接值构建成新数组,重复项也会自动构建,不存在的值,会自动创建为一个新项
|
279
278
|
*/
|
280
|
-
n(
|
279
|
+
n(S, "fromValues", (t, e, s, l) => {
|
281
280
|
if (!t || t.length == 0 || !e || e.length == 0)
|
282
281
|
return [];
|
283
282
|
let r = [];
|
@@ -293,7 +292,7 @@ n(E, "fromValues", (t, e, s, l) => {
|
|
293
292
|
* @param split
|
294
293
|
* @param element 转换后添加的默认元素
|
295
294
|
*/
|
296
|
-
n(
|
295
|
+
n(S, "split", (t, e, s = null) => {
|
297
296
|
let l = [];
|
298
297
|
return t && (l = t.split(e)), s != null && l.push(s), l;
|
299
298
|
}), //#endregion
|
@@ -301,8 +300,8 @@ n(E, "split", (t, e, s = null) => {
|
|
301
300
|
/**
|
302
301
|
* 合并多个数组中的每一项到新的二维数组中,没值的元素被有值的元素代替
|
303
302
|
*/
|
304
|
-
n(
|
305
|
-
let e = [], s =
|
303
|
+
n(S, "combine", (...t) => {
|
304
|
+
let e = [], s = Re.max(t, (l) => l.length);
|
306
305
|
for (let l = 0; l < s.length; l++) {
|
307
306
|
let r = [], i;
|
308
307
|
for (let a = 0; a < t.length; a++) {
|
@@ -322,37 +321,37 @@ n(E, "combine", (...t) => {
|
|
322
321
|
/**
|
323
322
|
* 在指定元素前插入新元素,返回插入元素的索引
|
324
323
|
*/
|
325
|
-
n(
|
324
|
+
n(S, "insert", (t, e, s) => {
|
326
325
|
let l = t.indexOf(e);
|
327
326
|
return t.splice(l, 0, s), l;
|
328
327
|
}), /**
|
329
328
|
* 在指定元素后插入新元素,返回插入元素的索引
|
330
329
|
*/
|
331
|
-
n(
|
330
|
+
n(S, "append", (t, e, s) => {
|
332
331
|
let l = t.indexOf(e) + 1;
|
333
332
|
return t.splice(l, 0, s), l;
|
334
333
|
}), /**
|
335
334
|
* 不存在某元素时才添加某元素
|
336
335
|
*/
|
337
|
-
n(
|
336
|
+
n(S, "pushIfNotExist", (t, e) => {
|
338
337
|
t.indexOf(e) == -1 && t.push(e);
|
339
338
|
}), //#endregion
|
340
339
|
//#region 删除
|
341
340
|
/**
|
342
341
|
* 删除执行数组中的指定对象或者集合
|
343
342
|
*/
|
344
|
-
n(
|
343
|
+
n(S, "remove", (t, e) => {
|
345
344
|
if (U.isNumber(e))
|
346
345
|
t.splice(e, 1);
|
347
346
|
else if (U.isArray(e))
|
348
347
|
for (let s = 0; s < e.length; s++)
|
349
|
-
|
348
|
+
S.remove(t, e[s]);
|
350
349
|
else
|
351
350
|
t.splice(t.indexOf(e), 1);
|
352
351
|
}), /**
|
353
352
|
* 删除指定元素,并返回删除后的字符串
|
354
353
|
*/
|
355
|
-
n(
|
354
|
+
n(S, "removeIndex", (t, e, s) => {
|
356
355
|
let l = t.split(s);
|
357
356
|
return l.splice(e, 1), l.join(s);
|
358
357
|
}), //#endregion
|
@@ -361,7 +360,7 @@ n(E, "removeIndex", (t, e, s) => {
|
|
361
360
|
* 按照指定函数对数组排序
|
362
361
|
* order: asc desc null
|
363
362
|
*/
|
364
|
-
n(
|
363
|
+
n(S, "orderBy", (t, e, s = null) => {
|
365
364
|
if (e == null || s == null || t.length == 0 || t.length == 1)
|
366
365
|
return t;
|
367
366
|
e instanceof Function && (e = [e]);
|
@@ -369,8 +368,8 @@ n(E, "orderBy", (t, e, s = null) => {
|
|
369
368
|
let o = e[0], c = o(i) - o(a);
|
370
369
|
if (c != 0)
|
371
370
|
return c;
|
372
|
-
let
|
373
|
-
return
|
371
|
+
let h = e[1];
|
372
|
+
return h == null ? c : h(i) - h(a);
|
374
373
|
}), r;
|
375
374
|
return s == "asc" ? r = l : r = l.reverse(), r;
|
376
375
|
}), //#endregion
|
@@ -378,7 +377,7 @@ n(E, "orderBy", (t, e, s = null) => {
|
|
378
377
|
/**
|
379
378
|
* 分组,封装成字典而不是集合,大数据场景速度提升百倍
|
380
379
|
*/
|
381
|
-
n(
|
380
|
+
n(S, "groupBy", (t, e, s = null) => {
|
382
381
|
let l = {};
|
383
382
|
if (t.forEach((r) => {
|
384
383
|
let i = e(r);
|
@@ -392,14 +391,14 @@ n(E, "groupBy", (t, e, s = null) => {
|
|
392
391
|
}), /**
|
393
392
|
* 分组
|
394
393
|
*/
|
395
|
-
n(
|
394
|
+
n(S, "groupByArray", (t, e) => {
|
396
395
|
let s = [];
|
397
396
|
return t.forEach((l) => {
|
398
397
|
let r = e(l), i = s.find((a) => a.key == r);
|
399
398
|
i == null && (i = { key: r, value: [] }, s.push(i)), i.value.push(l);
|
400
399
|
}), s;
|
401
400
|
});
|
402
|
-
let
|
401
|
+
let ue = S;
|
403
402
|
const x = class x {
|
404
403
|
/**
|
405
404
|
* 根据字符串或数组,自动返回数组
|
@@ -426,7 +425,7 @@ n(x, "getUniqueId", (t = 32) => {
|
|
426
425
|
}), /**
|
427
426
|
* 填充字符串到指定长度,使用pad填充
|
428
427
|
*/
|
429
|
-
n(x, "padLeft", (t, e, s) =>
|
428
|
+
n(x, "padLeft", (t, e, s) => $t.pad(t, e, s)), /**
|
430
429
|
* 去掉头部字符串
|
431
430
|
*/
|
432
431
|
n(x, "trimStart", (t, e) => {
|
@@ -547,8 +546,8 @@ n(x, "getBetween", (t, e, s) => {
|
|
547
546
|
* 填充字符串到指定长度,使用pad填充
|
548
547
|
*/
|
549
548
|
n(x, "padStart", (t, e, s) => t.padStart(e, s));
|
550
|
-
let
|
551
|
-
const
|
549
|
+
let W = x;
|
550
|
+
const $e = class $e {
|
552
551
|
//#region 净化
|
553
552
|
/**
|
554
553
|
* 净化对象,返回不带默认属性的对象
|
@@ -603,7 +602,7 @@ const Le = class Le {
|
|
603
602
|
* 对对象进行深度克隆,同时可以移除Proxy对象
|
604
603
|
*/
|
605
604
|
static clone(t, e = null) {
|
606
|
-
let s =
|
605
|
+
let s = Lt(t, !0);
|
607
606
|
if (e == null)
|
608
607
|
return s;
|
609
608
|
if (U.isArray(t))
|
@@ -620,7 +619,7 @@ const Le = class Le {
|
|
620
619
|
static mergeTo(t, e) {
|
621
620
|
return t == null ? e : e == null ? t : U.isArray(e) ? e.slice() : (Object.keys(e).forEach((l) => {
|
622
621
|
let r = e[l];
|
623
|
-
typeof r == "object" ? t[l] =
|
622
|
+
typeof r == "object" ? t[l] = $e.mergeTo(t[l], r) : t[l] = r;
|
624
623
|
}), t);
|
625
624
|
}
|
626
625
|
//#endregion
|
@@ -646,7 +645,7 @@ const Le = class Le {
|
|
646
645
|
/**
|
647
646
|
* 手动复制,并对字段执行指定自定义处理
|
648
647
|
*/
|
649
|
-
n(
|
648
|
+
n($e, "copy", (t, e = null) => {
|
650
649
|
let s = [];
|
651
650
|
U.isObject(t) && s.push(t);
|
652
651
|
let l = [];
|
@@ -663,15 +662,15 @@ n(Le, "copy", (t, e = null) => {
|
|
663
662
|
/**
|
664
663
|
* 给对象添加多层属性,并赋值
|
665
664
|
*/
|
666
|
-
n(
|
665
|
+
n($e, "addProperties", (t, e, s) => {
|
667
666
|
let l = t;
|
668
667
|
for (let r = 0; r < e.length; r++) {
|
669
668
|
let i = e[r];
|
670
669
|
r == e.length - 1 ? l[i] = s : (l[i] || (l[i] = {}), l = l[i]);
|
671
670
|
}
|
672
671
|
});
|
673
|
-
let
|
674
|
-
class
|
672
|
+
let Y = $e;
|
673
|
+
class Pe {
|
675
674
|
//#region 取值
|
676
675
|
/**
|
677
676
|
* 从指定字典中提取忽略大小写的key的值
|
@@ -861,7 +860,7 @@ const z = class z {
|
|
861
860
|
*/
|
862
861
|
static serialize(t, e = !0) {
|
863
862
|
let s = (r) => e ? encodeURIComponent(r) : r;
|
864
|
-
return
|
863
|
+
return Pe.join(t, s, "=", "&");
|
865
864
|
}
|
866
865
|
//endregion
|
867
866
|
//region 编码和解码
|
@@ -889,13 +888,13 @@ n(z, "handleQueryValue", (t, e) => {
|
|
889
888
|
if (t instanceof Array) {
|
890
889
|
if (t.length > 0)
|
891
890
|
for (let l = 0; l < t.length; l++) {
|
892
|
-
let r =
|
891
|
+
let r = Y.clone(e);
|
893
892
|
r.push(""), s += z.handleQueryValue(t[l], r);
|
894
893
|
}
|
895
894
|
} else if (t instanceof Object) {
|
896
895
|
let l = Object.keys(t);
|
897
896
|
for (let r of l) {
|
898
|
-
let i =
|
897
|
+
let i = Y.clone(e);
|
899
898
|
i.push(r), s += z.handleQueryValue(t[r], i);
|
900
899
|
}
|
901
900
|
} else {
|
@@ -919,7 +918,7 @@ n(z, "getUrl", (t, e = null) => {
|
|
919
918
|
return null;
|
920
919
|
if (e == null)
|
921
920
|
return t;
|
922
|
-
let s = z.deserialize(t), l =
|
921
|
+
let s = z.deserialize(t), l = Y.mergeTo(s, e);
|
923
922
|
return z.getPath(t) + "?" + z.getQuery(l);
|
924
923
|
}), /**
|
925
924
|
* 获取超链接配置对象
|
@@ -929,7 +928,7 @@ n(z, "getAnchor", (t, e = null) => {
|
|
929
928
|
return z.httpOrHttps(t) ? (s.href = t, s.target = "_blank", s) : (s.href = z.getUrl(t, e), s);
|
930
929
|
});
|
931
930
|
let K = z;
|
932
|
-
class
|
931
|
+
class It {
|
933
932
|
/**
|
934
933
|
* 根据动态加载的组件对象,得到组件集合
|
935
934
|
*/
|
@@ -939,12 +938,12 @@ class jt {
|
|
939
938
|
return l;
|
940
939
|
for (let i = 0; i < r.length; i++) {
|
941
940
|
const a = r[i];
|
942
|
-
let o =
|
941
|
+
let o = W.trim(a, e, ".vue"), h = (s ? s + "-" : "") + W.getDashName(o), d = t[a];
|
943
942
|
if (d.default)
|
944
|
-
l[
|
943
|
+
l[h] = d.default;
|
945
944
|
else {
|
946
|
-
let
|
947
|
-
l[
|
945
|
+
let p = bt(d);
|
946
|
+
l[h] = p;
|
948
947
|
}
|
949
948
|
}
|
950
949
|
return l;
|
@@ -961,44 +960,44 @@ class jt {
|
|
961
960
|
/**
|
962
961
|
* 获取部分自定义组件名称
|
963
962
|
*/
|
964
|
-
n(
|
963
|
+
n(It, "getName", (t, e) => {
|
965
964
|
if (!t)
|
966
965
|
return null;
|
967
966
|
let s = K.getPath(t);
|
968
967
|
return s ? s == "/" ? e : e + s.replace(/\//g, "-").toLowerCase() : null;
|
969
968
|
});
|
970
|
-
const
|
969
|
+
const oe = class oe {
|
971
970
|
};
|
972
971
|
/**
|
973
972
|
* 保存文件
|
974
973
|
*/
|
975
|
-
n(
|
974
|
+
n(oe, "save", (t, e) => {
|
976
975
|
let s = window.atob(t), l = s.length, r = new Uint8Array(l);
|
977
976
|
for (; l--; )
|
978
977
|
r[l] = s.charCodeAt(l);
|
979
978
|
let i = new Blob([r]);
|
980
|
-
|
979
|
+
At.saveAs(i, e);
|
981
980
|
}), /**
|
982
981
|
* 获取文件扩展名
|
983
982
|
*/
|
984
|
-
n(
|
983
|
+
n(oe, "getExtension", (t) => {
|
985
984
|
let e = t.lastIndexOf(".");
|
986
985
|
return e == -1 ? "" : t.substring(e).split("?")[0];
|
987
986
|
}), /**
|
988
987
|
* 判断当前文件名是否是excel文件
|
989
988
|
*/
|
990
|
-
n(
|
991
|
-
let e =
|
989
|
+
n(oe, "isExcel", (t) => {
|
990
|
+
let e = oe.getExtension(t);
|
992
991
|
return [".xls", ".xlsx"].indexOf(e) > -1;
|
993
992
|
}), /**
|
994
993
|
* 判断当前文件是否是图片文件
|
995
994
|
*/
|
996
|
-
n(
|
997
|
-
let e =
|
995
|
+
n(oe, "isImage", (t) => {
|
996
|
+
let e = oe.getExtension(t);
|
998
997
|
return [".png", ".jpg", ".jpeg", ".bmp", ".gif"].indexOf(e) > -1;
|
999
998
|
});
|
1000
|
-
let
|
1001
|
-
const
|
999
|
+
let Ie = oe;
|
1000
|
+
const G = class G {
|
1002
1001
|
//#region 颜色
|
1003
1002
|
/**
|
1004
1003
|
* 根据字符串Ascii码得到固定颜色字典
|
@@ -1015,8 +1014,8 @@ const Y = class Y {
|
|
1015
1014
|
let r = t[l], i = 0;
|
1016
1015
|
for (let d = 0; d < r.length; d++)
|
1017
1016
|
i += r.charCodeAt(d);
|
1018
|
-
let a = i / s, o = 255 * a, c = 255 * (1 - a),
|
1019
|
-
e[r] = `rgb(${o}, ${c}, ${
|
1017
|
+
let a = i / s, o = 255 * a, c = 255 * (1 - a), h = 255 * (1 - a);
|
1018
|
+
e[r] = `rgb(${o}, ${c}, ${h})`;
|
1020
1019
|
}
|
1021
1020
|
return e;
|
1022
1021
|
}
|
@@ -1031,7 +1030,7 @@ const Y = class Y {
|
|
1031
1030
|
let e = "";
|
1032
1031
|
for (let s = 0; s < t.length; s++) {
|
1033
1032
|
let l = t[s];
|
1034
|
-
|
1033
|
+
W.isNullOrEmpty(l) || (e += l, s != t.length - 1 && (e += " "));
|
1035
1034
|
}
|
1036
1035
|
return e;
|
1037
1036
|
}
|
@@ -1151,13 +1150,13 @@ const Y = class Y {
|
|
1151
1150
|
let i = t.querySelector(s);
|
1152
1151
|
if (!i)
|
1153
1152
|
return null;
|
1154
|
-
let a = {}, o = t.getBoundingClientRect(), c = l.getBoundingClientRect(), d = t.querySelector(e).getBoundingClientRect(),
|
1153
|
+
let a = {}, o = t.getBoundingClientRect(), c = l.getBoundingClientRect(), d = t.querySelector(e).getBoundingClientRect(), p = i.getBoundingClientRect(), g = c.height - d.top;
|
1155
1154
|
if (r == "right") {
|
1156
1155
|
a.left = `${o.left + o.width}px`;
|
1157
|
-
let
|
1158
|
-
|
1156
|
+
let b;
|
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`;
|
1159
1158
|
} else if (r == "bottom")
|
1160
|
-
g -= d.height, a.left = `${o.left}px`, a.top = `${o.top + o.height}px`, g <
|
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`;
|
1161
1160
|
else
|
1162
1161
|
throw new Error(`暂未支持的position:${r}`);
|
1163
1162
|
return a;
|
@@ -1215,13 +1214,13 @@ const Y = class Y {
|
|
1215
1214
|
* 获取行内标签,如: style(非link)
|
1216
1215
|
*/
|
1217
1216
|
static getInlineTagByUrl(t) {
|
1218
|
-
return
|
1217
|
+
return Ie.getExtension(t) == ".css" ? "style" : "script";
|
1219
1218
|
}
|
1220
1219
|
/**
|
1221
1220
|
* 获取资源标签,如: link
|
1222
1221
|
*/
|
1223
1222
|
static getTagByUrl(t) {
|
1224
|
-
return
|
1223
|
+
return Ie.getExtension(t) == ".css" ? "link" : "script";
|
1225
1224
|
}
|
1226
1225
|
//#endregion
|
1227
1226
|
//#region 文本
|
@@ -1239,7 +1238,7 @@ const Y = class Y {
|
|
1239
1238
|
/**
|
1240
1239
|
* 添加类
|
1241
1240
|
*/
|
1242
|
-
n(
|
1241
|
+
n(G, "addClass", (t, e, s = null) => {
|
1243
1242
|
let l;
|
1244
1243
|
if (e == null || e == "") {
|
1245
1244
|
if (s == null || s == "")
|
@@ -1251,7 +1250,7 @@ n(Y, "addClass", (t, e, s = null) => {
|
|
1251
1250
|
}), /**
|
1252
1251
|
* 删除类
|
1253
1252
|
*/
|
1254
|
-
n(
|
1253
|
+
n(G, "removeClass", (t, e, s = null) => {
|
1255
1254
|
if (e == null || e == "")
|
1256
1255
|
return;
|
1257
1256
|
let l = [];
|
@@ -1269,7 +1268,7 @@ n(Y, "removeClass", (t, e, s = null) => {
|
|
1269
1268
|
/**
|
1270
1269
|
* 获取dom宽度或高度
|
1271
1270
|
*/
|
1272
|
-
n(
|
1271
|
+
n(G, "getWidthOrHeight", (t, e, s = null) => {
|
1273
1272
|
let l = 0, r = [];
|
1274
1273
|
t instanceof Array && r.push(...t), t instanceof HTMLCollection ? r.push(...t) : r.push(t);
|
1275
1274
|
for (let i = 0; i < r.length; i++) {
|
@@ -1283,21 +1282,21 @@ n(Y, "getWidthOrHeight", (t, e, s = null) => {
|
|
1283
1282
|
}), /**
|
1284
1283
|
* 根据路径获取标签(无src)
|
1285
1284
|
*/
|
1286
|
-
n(
|
1287
|
-
let e =
|
1285
|
+
n(G, "createEmptyByUrl", (t) => {
|
1286
|
+
let e = G.getInlineTagByUrl(t);
|
1288
1287
|
return document.createElement(e);
|
1289
1288
|
}), /**
|
1290
1289
|
* 根据路径获取待加载的元素,同时包含Url
|
1291
1290
|
*/
|
1292
|
-
n(
|
1293
|
-
let e =
|
1291
|
+
n(G, "createByUrl", (t) => {
|
1292
|
+
let e = G.getTagByUrl(t), s = document.createElement(e);
|
1294
1293
|
return s instanceof HTMLLinkElement ? (s.href = t, s.rel = "stylesheet") : s instanceof HTMLScriptElement && (s.src = t), s;
|
1295
1294
|
}), /**
|
1296
1295
|
* 根据路径获取元素
|
1297
1296
|
* VIP:已废弃,不能用改方法判断资源是否加载完毕,因为可能只是脚本创建,资源还未加载完毕
|
1298
1297
|
*/
|
1299
|
-
n(
|
1300
|
-
let e =
|
1298
|
+
n(G, "getByUrl", (t) => {
|
1299
|
+
let e = G.getTagByUrl(t), s = document.querySelectorAll(e);
|
1301
1300
|
for (let l of s) {
|
1302
1301
|
if (l instanceof HTMLLinkElement && l.href == t)
|
1303
1302
|
return l;
|
@@ -1310,57 +1309,57 @@ n(Y, "getByUrl", (t) => {
|
|
1310
1309
|
/**
|
1311
1310
|
* 判断选择器内容是否溢出
|
1312
1311
|
*/
|
1313
|
-
n(
|
1312
|
+
n(G, "isEllipsis", (t) => {
|
1314
1313
|
let e = document.querySelector(t);
|
1315
1314
|
return e.clientWidth < e.scrollWidth;
|
1316
1315
|
});
|
1317
|
-
let
|
1318
|
-
class
|
1316
|
+
let R = G;
|
1317
|
+
class ae {
|
1319
1318
|
}
|
1320
1319
|
/**
|
1321
1320
|
* 批量绑定事件,执行指定处理函数
|
1322
1321
|
*/
|
1323
|
-
n(
|
1322
|
+
n(ae, "bind", (t, e, s) => {
|
1324
1323
|
e && t.forEach((l) => {
|
1325
1324
|
e.addEventListener(l, s, !0);
|
1326
1325
|
});
|
1327
1326
|
}), /**
|
1328
1327
|
* 批量绑定事件,执行指定处理函数
|
1329
1328
|
*/
|
1330
|
-
n(
|
1329
|
+
n(ae, "unbind", (t, e, s) => {
|
1331
1330
|
e && t.forEach((l) => {
|
1332
1331
|
e.removeEventListener(l, s, !0);
|
1333
1332
|
});
|
1334
1333
|
}), /**
|
1335
1334
|
* 绑定点击处理函数
|
1336
1335
|
*/
|
1337
|
-
n(
|
1336
|
+
n(ae, "click", (t, e) => {
|
1338
1337
|
t && t.addEventListener("click", e, !0);
|
1339
1338
|
}), /**
|
1340
1339
|
* 解除点击监听
|
1341
1340
|
*/
|
1342
|
-
n(
|
1341
|
+
n(ae, "unclick", (t, e) => {
|
1343
1342
|
t && t.removeEventListener("click", e, !0);
|
1344
1343
|
}), /**
|
1345
1344
|
* 绑定滚动处理函数
|
1346
1345
|
*/
|
1347
|
-
n(
|
1346
|
+
n(ae, "scroll", (t, e) => {
|
1348
1347
|
t && t.addEventListener("scroll", e, !0);
|
1349
1348
|
}), /**
|
1350
1349
|
* 移除滚动处理函数,防止内存泄漏
|
1351
1350
|
*/
|
1352
|
-
n(
|
1351
|
+
n(ae, "unscroll", (t, e) => {
|
1353
1352
|
t && t.removeEventListener("scroll", e, !0);
|
1354
1353
|
});
|
1355
|
-
class
|
1354
|
+
class Qe {
|
1356
1355
|
}
|
1357
1356
|
/**
|
1358
1357
|
* 获取Html内容
|
1359
1358
|
*/
|
1360
|
-
n(
|
1359
|
+
n(Qe, "getHtml", (t) => U.isNumber(t) ? t : t && t.replace(/\n/g, "<br/>")), /**
|
1361
1360
|
* 获取Html中的文字
|
1362
1361
|
*/
|
1363
|
-
n(
|
1362
|
+
n(Qe, "getText", (t) => {
|
1364
1363
|
if (!t)
|
1365
1364
|
return null;
|
1366
1365
|
if (!U.isString(t))
|
@@ -1368,46 +1367,46 @@ n(Je, "getText", (t) => {
|
|
1368
1367
|
let e = new RegExp("<[^<>]+>", "g");
|
1369
1368
|
return t.replace(e, "");
|
1370
1369
|
});
|
1371
|
-
class
|
1370
|
+
class Ot {
|
1372
1371
|
}
|
1373
1372
|
/**
|
1374
1373
|
* 获取base64图片地址
|
1375
1374
|
*/
|
1376
|
-
n(
|
1377
|
-
class
|
1375
|
+
n(Ot, "base64", (t) => "data:image/png;base64," + t);
|
1376
|
+
class jt {
|
1378
1377
|
}
|
1379
1378
|
/**
|
1380
1379
|
* 加载乾坤子应用
|
1381
1380
|
*/
|
1382
|
-
n(
|
1381
|
+
n(jt, "load", function(t, e, s, l) {
|
1383
1382
|
});
|
1384
|
-
const
|
1383
|
+
const Le = class Le {
|
1385
1384
|
};
|
1386
1385
|
/**
|
1387
1386
|
* 激发主框架事件
|
1388
1387
|
*/
|
1389
|
-
n(
|
1390
|
-
|
1388
|
+
n(Le, "emit", (t, e) => {
|
1389
|
+
Le.emits({ [t]: e });
|
1391
1390
|
}), /**
|
1392
1391
|
* 批量激发主框架事件
|
1393
1392
|
*/
|
1394
|
-
n(
|
1393
|
+
n(Le, "emits", (t) => {
|
1395
1394
|
var s, l;
|
1396
1395
|
let e = (l = (s = window.parent) == null ? void 0 : s.window) == null ? void 0 : l.emit;
|
1397
1396
|
e && Object.keys(t).forEach((r) => {
|
1398
1397
|
e(r, t[r]);
|
1399
1398
|
});
|
1400
1399
|
});
|
1401
|
-
let we =
|
1402
|
-
class
|
1400
|
+
let we = Le;
|
1401
|
+
class Ee {
|
1403
1402
|
}
|
1404
1403
|
/**
|
1405
1404
|
* 延时指定ms后执行指定任务
|
1406
1405
|
*/
|
1407
|
-
n(
|
1406
|
+
n(Ee, "delay", (t, e) => setTimeout(t, e)), /**
|
1408
1407
|
* 在执行指定延时后,每隔指定ms执行指定任务
|
1409
1408
|
*/
|
1410
|
-
n(
|
1409
|
+
n(Ee, "execute", (t, e, s) => {
|
1411
1410
|
if (!s) {
|
1412
1411
|
let l = setInterval(t, e);
|
1413
1412
|
return Promise.resolve(l);
|
@@ -1421,12 +1420,12 @@ n(Ce, "execute", (t, e, s) => {
|
|
1421
1420
|
}), /**
|
1422
1421
|
* 清空定时器
|
1423
1422
|
*/
|
1424
|
-
n(
|
1423
|
+
n(Ee, "clearInterval", (t) => {
|
1425
1424
|
clearInterval(t);
|
1426
1425
|
}), /**
|
1427
1426
|
* 防抖(指定时间内只触发一次)
|
1428
1427
|
*/
|
1429
|
-
n(
|
1428
|
+
n(Ee, "debounce", (t, e) => {
|
1430
1429
|
let s = null;
|
1431
1430
|
return (l) => {
|
1432
1431
|
s && clearTimeout(s), s = setTimeout(t, e, l);
|
@@ -1434,7 +1433,7 @@ n(Ce, "debounce", (t, e) => {
|
|
1434
1433
|
}), /**
|
1435
1434
|
* 节流:https://segmentfault.com/a/1190000018428170
|
1436
1435
|
*/
|
1437
|
-
n(
|
1436
|
+
n(Ee, "throttle", (t, e) => {
|
1438
1437
|
let s = !0;
|
1439
1438
|
return (l) => {
|
1440
1439
|
if (!s)
|
@@ -1444,70 +1443,70 @@ n(Ce, "throttle", (t, e) => {
|
|
1444
1443
|
}, e, l);
|
1445
1444
|
};
|
1446
1445
|
});
|
1447
|
-
class
|
1446
|
+
class Rt {
|
1448
1447
|
constructor() {
|
1449
1448
|
n(this, "value");
|
1450
1449
|
}
|
1451
1450
|
}
|
1452
|
-
const
|
1451
|
+
const A = class A {
|
1453
1452
|
};
|
1454
1453
|
/**
|
1455
1454
|
* 获取相对于1970年1月1日的时间戳(ms),不同时区结果相同
|
1456
1455
|
*/
|
1457
|
-
n(
|
1456
|
+
n(A, "getTimestamp", (t = null) => (t ? new Date(t) : /* @__PURE__ */ new Date()).getTime()), /**
|
1458
1457
|
* 根据字符串获取可对比的时间
|
1459
1458
|
*/
|
1460
|
-
n(
|
1459
|
+
n(A, "getTime", (t = null) => t ? new Date(t) : /* @__PURE__ */ new Date()), /**
|
1461
1460
|
* 格式化时间
|
1462
1461
|
*/
|
1463
|
-
n(
|
1462
|
+
n(A, "format", (t, e) => ee(t).format(e)), /**
|
1464
1463
|
* 获取当前日期时间的字符串
|
1465
1464
|
*/
|
1466
|
-
n(
|
1465
|
+
n(A, "getDateTimeString", () => A.formatSecondTime(/* @__PURE__ */ new Date())), /**
|
1467
1466
|
* 获取当前时间的字符串
|
1468
1467
|
*/
|
1469
|
-
n(
|
1468
|
+
n(A, "getDateString", () => A.formatDate(/* @__PURE__ */ new Date())), /**
|
1470
1469
|
* 获取当前时间的字符串
|
1471
1470
|
*/
|
1472
|
-
n(
|
1471
|
+
n(A, "getTimeString", () => A.formatTime(/* @__PURE__ */ new Date())), /**
|
1473
1472
|
* 对时间值进行时间格式化
|
1474
1473
|
*/
|
1475
|
-
n(
|
1474
|
+
n(A, "formatSecondTime", (t) => ee(t).format("YYYY-MM-DD HH:mm:ss")), /**
|
1476
1475
|
* 对时间值进行时间格式化
|
1477
1476
|
*/
|
1478
|
-
n(
|
1477
|
+
n(A, "formatMillisecondTime", (t) => t ? ee(t).format("YYYY-MM-DD HH:mm:ss SSS") : null), /**
|
1479
1478
|
* 格式化成24小时时间格式
|
1480
1479
|
*/
|
1481
|
-
n(
|
1480
|
+
n(A, "formatTime", (t) => t ? ee(t).format("HH:mm:ss SSS") : null), /**
|
1482
1481
|
* 对时间值进行日期格式化
|
1483
1482
|
*/
|
1484
|
-
n(
|
1483
|
+
n(A, "formatDate", (t) => t ? ee(t).format("YYYY-MM-DD") : null), /**
|
1485
1484
|
* 添加天数
|
1486
1485
|
*/
|
1487
|
-
n(
|
1486
|
+
n(A, "addDays", (t, e) => t ? ee(t).add(e, "days").toDate() : null), /**
|
1488
1487
|
* 添加月份
|
1489
1488
|
*/
|
1490
|
-
n(
|
1489
|
+
n(A, "addMonths", (t, e) => t ? ee(t).add(e, "months").toDate() : null), /**
|
1491
1490
|
* 添加小时
|
1492
1491
|
*/
|
1493
|
-
n(
|
1492
|
+
n(A, "addHours", (t, e) => t ? ee(t).add(e, "hours").toDate() : null), /**
|
1494
1493
|
* 判断指定时间是否是周末
|
1495
1494
|
*/
|
1496
|
-
n(
|
1495
|
+
n(A, "isWeekend", (t) => {
|
1497
1496
|
if (!t)
|
1498
1497
|
return !1;
|
1499
|
-
let e =
|
1498
|
+
let e = ee(t).format("d");
|
1500
1499
|
return e == "6" || e == "0";
|
1501
1500
|
}), /**
|
1502
1501
|
* 把中国时间,转换为当地时间
|
1503
1502
|
*/
|
1504
|
-
n(
|
1503
|
+
n(A, "localeTime", (t) => {
|
1505
1504
|
if (!t)
|
1506
1505
|
return null;
|
1507
1506
|
let s = (/* @__PURE__ */ new Date()).getTimezoneOffset() + 480;
|
1508
|
-
return
|
1507
|
+
return ee(t).add(s, "minutes").toDate();
|
1509
1508
|
});
|
1510
|
-
let
|
1509
|
+
let te = A;
|
1511
1510
|
const k = class k {
|
1512
1511
|
};
|
1513
1512
|
/**
|
@@ -1531,7 +1530,7 @@ n(k, "getById", (t, e, s, l) => {
|
|
1531
1530
|
* 树节点
|
1532
1531
|
*/
|
1533
1532
|
n(k, "getByIds", (t, e, s, l) => {
|
1534
|
-
let r =
|
1533
|
+
let r = ue.distinct(t, (a) => a), i = [];
|
1535
1534
|
return r.forEach((a) => {
|
1536
1535
|
let o = k.getById(a, e, s, l);
|
1537
1536
|
i.push(o);
|
@@ -1544,8 +1543,8 @@ n(k, "getNextById", (t, e, s, l) => {
|
|
1544
1543
|
if (i.length == 0) {
|
1545
1544
|
if (s.length == 1)
|
1546
1545
|
return null;
|
1547
|
-
let
|
1548
|
-
return
|
1546
|
+
let h = s.indexOf(r);
|
1547
|
+
return h == s.length - 1 ? s[h - 1] : s[h + 1];
|
1549
1548
|
}
|
1550
1549
|
let a = i[i.length - 1], o = a[l];
|
1551
1550
|
if (o.length == 1)
|
@@ -1569,19 +1568,19 @@ n(k, "getParentById", (t, e, s, l) => {
|
|
1569
1568
|
*/
|
1570
1569
|
n(k, "getParentsById", (t, e, s, l, r = !1) => {
|
1571
1570
|
let i = [];
|
1572
|
-
return s == null ||
|
1571
|
+
return s == null || tt(t, e, s, l, i, r), i;
|
1573
1572
|
}), /**
|
1574
1573
|
* 获取当前节点的所有孩子节点的集合
|
1575
1574
|
*/
|
1576
1575
|
n(k, "getChildrenById", (t, e, s, l, r = !1) => {
|
1577
1576
|
let i = k.getById(t, e, s, l), a = [];
|
1578
|
-
return r && a.push(i),
|
1577
|
+
return r && a.push(i), Ue(i, l, a), a;
|
1579
1578
|
}), /**
|
1580
1579
|
* 获取当前节点的所有孩子节点的集合
|
1581
1580
|
*/
|
1582
1581
|
n(k, "getChildren", (t, e, s = !1) => {
|
1583
1582
|
let l = [];
|
1584
|
-
return s && l.push(t),
|
1583
|
+
return s && l.push(t), Ue(t, e, l), l;
|
1585
1584
|
}), /**
|
1586
1585
|
* 搜索指定文本的树结构
|
1587
1586
|
*/
|
@@ -1591,10 +1590,10 @@ n(k, "searchTree", (t, e, s, l) => {
|
|
1591
1590
|
return r;
|
1592
1591
|
let i = t ? t.toUpperCase() : "", a = U.isString(l) ? [l] : l;
|
1593
1592
|
for (let o of e) {
|
1594
|
-
let c = !1,
|
1595
|
-
for (let d of
|
1596
|
-
for (let
|
1597
|
-
let g = d[
|
1593
|
+
let c = !1, h = k.getChildren(o, s, !0);
|
1594
|
+
for (let d of h) {
|
1595
|
+
for (let p of a) {
|
1596
|
+
let g = d[p];
|
1598
1597
|
if ((g ? g.toUpperCase() : "").indexOf(i) > -1) {
|
1599
1598
|
c = !0;
|
1600
1599
|
break;
|
@@ -1604,8 +1603,8 @@ n(k, "searchTree", (t, e, s, l) => {
|
|
1604
1603
|
break;
|
1605
1604
|
}
|
1606
1605
|
if (c) {
|
1607
|
-
let d = k.searchTree(t, o[s], s, l),
|
1608
|
-
r.push(
|
1606
|
+
let d = k.searchTree(t, o[s], s, l), p = { ...o, [s]: d };
|
1607
|
+
r.push(p);
|
1609
1608
|
}
|
1610
1609
|
}
|
1611
1610
|
return r;
|
@@ -1615,11 +1614,11 @@ n(k, "searchTree", (t, e, s, l) => {
|
|
1615
1614
|
n(k, "removeById", (t, e, s, l) => {
|
1616
1615
|
let r = k.getById(t, e, s, l), i = k.getParentsById(t, e, s, l);
|
1617
1616
|
if (i.length == 0) {
|
1618
|
-
|
1617
|
+
ue.remove(s, r);
|
1619
1618
|
return;
|
1620
1619
|
}
|
1621
1620
|
let a = i[i.length - 1];
|
1622
|
-
|
1621
|
+
ue.remove(a[l], r);
|
1623
1622
|
}), /**
|
1624
1623
|
* 获取树结构扁平化后的节点信息
|
1625
1624
|
*/
|
@@ -1643,53 +1642,53 @@ n(k, "map", (t, e, s, l) => {
|
|
1643
1642
|
r.push(o);
|
1644
1643
|
let c = a[e];
|
1645
1644
|
if (c && c.length > 0) {
|
1646
|
-
let
|
1647
|
-
o[s] =
|
1645
|
+
let h = k.map(c, e, s, l);
|
1646
|
+
o[s] = h;
|
1648
1647
|
}
|
1649
1648
|
}
|
1650
1649
|
return r;
|
1651
1650
|
});
|
1652
|
-
let
|
1653
|
-
function
|
1651
|
+
let Oe = k;
|
1652
|
+
function tt(u, t, e, s, l, r) {
|
1654
1653
|
for (let i = 0; i < e.length; i++) {
|
1655
1654
|
let a = e[i];
|
1656
1655
|
if (a[t] == u) {
|
1657
1656
|
r && l.push(a);
|
1658
1657
|
break;
|
1659
1658
|
} else
|
1660
|
-
|
1659
|
+
Oe.getById(u, t, a[s], s) != null && (l.push(a), tt(u, t, a[s], s, l, r));
|
1661
1660
|
}
|
1662
1661
|
return l;
|
1663
1662
|
}
|
1664
|
-
function
|
1663
|
+
function Ue(u, t, e) {
|
1665
1664
|
let s = u[t];
|
1666
1665
|
if (!s || s.length == 0)
|
1667
1666
|
return e;
|
1668
1667
|
for (let l = 0; l < s.length; l++) {
|
1669
1668
|
let r = s[l];
|
1670
|
-
e.push(r),
|
1669
|
+
e.push(r), Ue(r, t, e);
|
1671
1670
|
}
|
1672
1671
|
return e;
|
1673
1672
|
}
|
1674
|
-
class
|
1673
|
+
class Je {
|
1675
1674
|
}
|
1676
1675
|
/**
|
1677
1676
|
* 判断指定元素滚动条位置,是否到了页面底部
|
1678
1677
|
*/
|
1679
|
-
n(
|
1678
|
+
n(Je, "isBottom", (t) => {
|
1680
1679
|
let e = document.querySelector(t);
|
1681
1680
|
return e ? e.scrollTop + e.clientHeight == e.scrollHeight : !1;
|
1682
1681
|
}), /**
|
1683
1682
|
* 滚动指定元素的滚动条到页面底部
|
1684
1683
|
*/
|
1685
|
-
n(
|
1684
|
+
n(Je, "scrollToBottom", (t) => {
|
1686
1685
|
let e = document.querySelector(t);
|
1687
1686
|
if (!e)
|
1688
1687
|
return;
|
1689
1688
|
let s = e.scrollHeight - e.clientHeight;
|
1690
1689
|
e.scrollTop = s;
|
1691
1690
|
});
|
1692
|
-
class
|
1691
|
+
class _t {
|
1693
1692
|
constructor() {
|
1694
1693
|
/**
|
1695
1694
|
* 是否美化
|
@@ -1697,13 +1696,13 @@ class Pt {
|
|
1697
1696
|
n(this, "beautify", !1);
|
1698
1697
|
}
|
1699
1698
|
}
|
1700
|
-
class
|
1699
|
+
class M {
|
1701
1700
|
//#region 序列化
|
1702
1701
|
/**
|
1703
1702
|
* 对非字符串进行序列化
|
1704
1703
|
*/
|
1705
1704
|
static serializeWithoutString(t) {
|
1706
|
-
return typeof t == "string" ? t :
|
1705
|
+
return typeof t == "string" ? t : M.serialize(t, !0);
|
1707
1706
|
}
|
1708
1707
|
/**
|
1709
1708
|
* 把对象格式化为Json字符串
|
@@ -1711,10 +1710,10 @@ class W {
|
|
1711
1710
|
static serialize(t, e) {
|
1712
1711
|
if (t == null)
|
1713
1712
|
return null;
|
1714
|
-
e == null && (e = new
|
1713
|
+
e == null && (e = new _t());
|
1715
1714
|
let l = (typeof e == "boolean" ? e : e.beautify) ? 2 : null, r;
|
1716
1715
|
if (typeof t == "string") {
|
1717
|
-
let a =
|
1716
|
+
let a = M.deserialize(t);
|
1718
1717
|
if (a == null)
|
1719
1718
|
return t;
|
1720
1719
|
r = a;
|
@@ -1739,21 +1738,35 @@ class W {
|
|
1739
1738
|
return e;
|
1740
1739
|
}
|
1741
1740
|
//#endregion
|
1742
|
-
//#region
|
1741
|
+
//#region 获取键值
|
1742
|
+
/**
|
1743
|
+
* 根据props中的.自动分割得到属性值
|
1744
|
+
*/
|
1745
|
+
static hasKey(t, e) {
|
1746
|
+
if (e == null || e.length == 0)
|
1747
|
+
return !1;
|
1748
|
+
let s = t;
|
1749
|
+
for (let l of e) {
|
1750
|
+
if (Object.keys(s).indexOf(l) == -1)
|
1751
|
+
return !1;
|
1752
|
+
s = s[l];
|
1753
|
+
}
|
1754
|
+
return !0;
|
1755
|
+
}
|
1743
1756
|
/**
|
1744
1757
|
* 根据props中的.自动分割得到属性值
|
1745
1758
|
*/
|
1746
1759
|
static getValue(t, e) {
|
1747
|
-
if (
|
1760
|
+
if (e == null || e.length == 0)
|
1748
1761
|
return null;
|
1749
|
-
let s =
|
1750
|
-
for (let
|
1751
|
-
let
|
1752
|
-
if (
|
1762
|
+
let s = t;
|
1763
|
+
for (let l of e) {
|
1764
|
+
let r = s[l];
|
1765
|
+
if (r == null)
|
1753
1766
|
return null;
|
1754
|
-
|
1767
|
+
s = r;
|
1755
1768
|
}
|
1756
|
-
return
|
1769
|
+
return s;
|
1757
1770
|
}
|
1758
1771
|
//#endregion
|
1759
1772
|
//#region 合并
|
@@ -1761,7 +1774,7 @@ class W {
|
|
1761
1774
|
* 把json字符串合并到目标对象上
|
1762
1775
|
*/
|
1763
1776
|
static mergeTo(t, e) {
|
1764
|
-
if (
|
1777
|
+
if (W.isNullOrEmpty(e) || t == null)
|
1765
1778
|
return;
|
1766
1779
|
let s = JSON.parse(e), l = Object.keys(s);
|
1767
1780
|
for (let r of l)
|
@@ -1787,7 +1800,7 @@ class W {
|
|
1787
1800
|
let a = t[i], o = l(a);
|
1788
1801
|
o.type == "array" ? (o.remark && (r += this.fillSpace(2 * s) + "//" + o.remark + `
|
1789
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 + `
|
1790
|
-
`), 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 += `"${te.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 += `
|
1791
1804
|
`;
|
1792
1805
|
}
|
1793
1806
|
return r += this.fillSpace(2 * (s - 1)), r += "}", r;
|
@@ -1810,7 +1823,7 @@ class W {
|
|
1810
1823
|
}
|
1811
1824
|
//#endregion
|
1812
1825
|
}
|
1813
|
-
class
|
1826
|
+
class st {
|
1814
1827
|
/**
|
1815
1828
|
* 获取浏览器默认语言
|
1816
1829
|
*/
|
@@ -1818,7 +1831,7 @@ class lt {
|
|
1818
1831
|
return navigator.language == "zh-CN" ? "zh-cn" : "en";
|
1819
1832
|
}
|
1820
1833
|
}
|
1821
|
-
class
|
1834
|
+
class Bt {
|
1822
1835
|
/**
|
1823
1836
|
* 清空对象中的空值
|
1824
1837
|
*/
|
@@ -1834,7 +1847,7 @@ class Ut {
|
|
1834
1847
|
return this.clean(t), K.serialize(t, e);
|
1835
1848
|
}
|
1836
1849
|
}
|
1837
|
-
class
|
1850
|
+
class B {
|
1838
1851
|
constructor() {
|
1839
1852
|
//#region 属性
|
1840
1853
|
/**
|
@@ -1902,7 +1915,7 @@ class F {
|
|
1902
1915
|
*/
|
1903
1916
|
async loadDriver(t) {
|
1904
1917
|
let e = { conditions: [{ name: "Id", value: t }] };
|
1905
|
-
return
|
1918
|
+
return T.post("/ctl_driver/set", e).then((s) => Promise.resolve(s.data[0]));
|
1906
1919
|
}
|
1907
1920
|
//#endregion
|
1908
1921
|
//#region 添加
|
@@ -1911,24 +1924,24 @@ class F {
|
|
1911
1924
|
}
|
1912
1925
|
//#endregion
|
1913
1926
|
}
|
1914
|
-
class
|
1927
|
+
class je {
|
1915
1928
|
constructor() {
|
1916
1929
|
n(this, "type");
|
1917
1930
|
}
|
1918
1931
|
}
|
1919
|
-
class
|
1932
|
+
class Pt extends je {
|
1920
1933
|
constructor() {
|
1921
1934
|
super(...arguments);
|
1922
1935
|
n(this, "type", "Json");
|
1923
1936
|
}
|
1924
1937
|
insert(e) {
|
1925
|
-
return
|
1938
|
+
return M.serialize(e.rows, !0);
|
1926
1939
|
}
|
1927
1940
|
update(e) {
|
1928
|
-
return
|
1941
|
+
return M.serialize(e.rows, !0);
|
1929
1942
|
}
|
1930
1943
|
}
|
1931
|
-
class
|
1944
|
+
class Ut extends je {
|
1932
1945
|
constructor() {
|
1933
1946
|
super(...arguments);
|
1934
1947
|
n(this, "type", "Mongo");
|
@@ -1936,7 +1949,7 @@ class Mt extends Re {
|
|
1936
1949
|
insert(e) {
|
1937
1950
|
let { name: s, columns: l, rows: r } = e, i = "";
|
1938
1951
|
for (let a = 0; a < r.length; a++) {
|
1939
|
-
let o = r[a], c =
|
1952
|
+
let o = r[a], c = M.serialize(o, !0);
|
1940
1953
|
i += `db.${s}.insert(${c})`, a != r.length - 1 && (i += `\r
|
1941
1954
|
`);
|
1942
1955
|
}
|
@@ -1945,19 +1958,19 @@ class Mt extends Re {
|
|
1945
1958
|
update(e) {
|
1946
1959
|
let { name: s, columns: l, rows: r } = e, i = "", a = l.filter((o) => o.key).map((o) => o.name);
|
1947
1960
|
for (let o = 0; o < r.length; o++) {
|
1948
|
-
let c = r[o],
|
1949
|
-
i += `db.${s}.update(${d},{$set:${
|
1961
|
+
let c = r[o], h = Y.extract(c, a), d = M.serialize(h, !0), p = M.serialize(c, !0);
|
1962
|
+
i += `db.${s}.update(${d},{$set:${p})`, o != r.length - 1 && (i += `\r
|
1950
1963
|
`);
|
1951
1964
|
}
|
1952
1965
|
return i;
|
1953
1966
|
}
|
1954
1967
|
}
|
1955
|
-
class
|
1968
|
+
class Ve {
|
1956
1969
|
constructor() {
|
1957
1970
|
n(this, "type");
|
1958
1971
|
}
|
1959
1972
|
}
|
1960
|
-
const he = class he extends
|
1973
|
+
const he = class he extends Ve {
|
1961
1974
|
constructor() {
|
1962
1975
|
super(...arguments);
|
1963
1976
|
//#region 属性
|
@@ -2032,8 +2045,8 @@ const he = class he extends qe {
|
|
2032
2045
|
};
|
2033
2046
|
let o = i.objectStore(this.store).get(e);
|
2034
2047
|
o.onsuccess = (c) => {
|
2035
|
-
let
|
2036
|
-
l(
|
2048
|
+
let h = c.target.result;
|
2049
|
+
l(h);
|
2037
2050
|
}, o.onerror = (c) => {
|
2038
2051
|
r(c.target);
|
2039
2052
|
};
|
@@ -2053,17 +2066,17 @@ const he = class he extends qe {
|
|
2053
2066
|
let l = await this.openDbAsync();
|
2054
2067
|
return new Promise((r, i) => {
|
2055
2068
|
let a = l.transaction(this.store, "readwrite");
|
2056
|
-
a.oncomplete = (
|
2069
|
+
a.oncomplete = (h) => {
|
2057
2070
|
l.close();
|
2058
|
-
}, a.onerror = (
|
2059
|
-
i(
|
2071
|
+
}, a.onerror = (h) => {
|
2072
|
+
i(h);
|
2060
2073
|
};
|
2061
2074
|
let c = a.objectStore(this.store).add(s, e);
|
2062
|
-
c.onsuccess = (
|
2063
|
-
let d =
|
2075
|
+
c.onsuccess = (h) => {
|
2076
|
+
let d = h.target.result;
|
2064
2077
|
r(d);
|
2065
|
-
}, c.onerror = (
|
2066
|
-
let d =
|
2078
|
+
}, c.onerror = (h) => {
|
2079
|
+
let d = h.target.error;
|
2067
2080
|
i(d.message);
|
2068
2081
|
};
|
2069
2082
|
});
|
@@ -2089,13 +2102,13 @@ const he = class he extends qe {
|
|
2089
2102
|
}, a.onerror = (d) => {
|
2090
2103
|
i(d);
|
2091
2104
|
};
|
2092
|
-
let o =
|
2093
|
-
|
2094
|
-
let
|
2095
|
-
r(
|
2096
|
-
},
|
2097
|
-
let
|
2098
|
-
i(
|
2105
|
+
let o = Y.clone(s), h = a.objectStore(this.store).put(o, e);
|
2106
|
+
h.onsuccess = (d) => {
|
2107
|
+
let p = d.target.result;
|
2108
|
+
r(p);
|
2109
|
+
}, h.onerror = (d) => {
|
2110
|
+
let p = d.target.error;
|
2111
|
+
i(p.message);
|
2099
2112
|
};
|
2100
2113
|
});
|
2101
2114
|
}
|
@@ -2120,11 +2133,11 @@ const he = class he extends qe {
|
|
2120
2133
|
};
|
2121
2134
|
let o = i.objectStore(this.store).delete(e);
|
2122
2135
|
o.onsuccess = (c) => {
|
2123
|
-
let
|
2124
|
-
l(
|
2136
|
+
let h = c.target.result;
|
2137
|
+
l(h);
|
2125
2138
|
}, o.onerror = (c) => {
|
2126
|
-
let
|
2127
|
-
r(
|
2139
|
+
let h = c.target.error.message;
|
2140
|
+
r(h);
|
2128
2141
|
};
|
2129
2142
|
});
|
2130
2143
|
}
|
@@ -2146,8 +2159,8 @@ const he = class he extends qe {
|
|
2146
2159
|
* 静态版本,保证所有数据库实例拿到最新版本信息
|
2147
2160
|
*/
|
2148
2161
|
n(he, "version", null);
|
2149
|
-
let
|
2150
|
-
class
|
2162
|
+
let Fe = he;
|
2163
|
+
class Ft extends Ve {
|
2151
2164
|
constructor() {
|
2152
2165
|
super(...arguments);
|
2153
2166
|
//#region 属性
|
@@ -2218,7 +2231,7 @@ class Nt extends qe {
|
|
2218
2231
|
}
|
2219
2232
|
//#endregion
|
2220
2233
|
}
|
2221
|
-
class
|
2234
|
+
class Mt extends Ve {
|
2222
2235
|
constructor() {
|
2223
2236
|
super(...arguments);
|
2224
2237
|
n(this, "type", "Cookie");
|
@@ -2255,13 +2268,13 @@ class Vt extends qe {
|
|
2255
2268
|
dispose() {
|
2256
2269
|
}
|
2257
2270
|
}
|
2258
|
-
class
|
2271
|
+
class Nt extends B {
|
2259
2272
|
constructor() {
|
2260
2273
|
super(...arguments);
|
2261
2274
|
n(this, "_default");
|
2262
2275
|
}
|
2263
2276
|
get instances() {
|
2264
|
-
return [new
|
2277
|
+
return [new Fe(), new Ft(), new Mt()];
|
2265
2278
|
}
|
2266
2279
|
/**
|
2267
2280
|
* 获取指定类型的提供程序
|
@@ -2283,7 +2296,7 @@ class qt extends F {
|
|
2283
2296
|
return this.create("Storage");
|
2284
2297
|
}
|
2285
2298
|
}
|
2286
|
-
class
|
2299
|
+
class Xe {
|
2287
2300
|
/**
|
2288
2301
|
* 获取实际SQL字段名称
|
2289
2302
|
*/
|
@@ -2297,29 +2310,29 @@ class Ye {
|
|
2297
2310
|
if (t == null)
|
2298
2311
|
return "null";
|
2299
2312
|
let e = typeof t;
|
2300
|
-
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" ? M.serialize(t) : t).replace(/'/g, "''")}'` : t;
|
2301
2314
|
}
|
2302
2315
|
}
|
2303
|
-
class
|
2316
|
+
class Me extends je {
|
2304
2317
|
constructor() {
|
2305
2318
|
super(...arguments);
|
2306
2319
|
n(this, "type", "Sql");
|
2307
2320
|
}
|
2308
2321
|
insert(e) {
|
2309
|
-
let { name: s, columns: l, rows: r } = e, i = e.getIdentity(), a = "",
|
2322
|
+
let { name: s, columns: l, rows: r } = e, i = e.getIdentity(), a = "", h = l.filter((d) => !d.identity).map((d) => Xe.getSqlName(d.name)).join(", ");
|
2310
2323
|
for (let d = 0; d < r.length; d++) {
|
2311
|
-
let
|
2324
|
+
let p = r[d];
|
2312
2325
|
a += `INSERT INTO ${s}\r
|
2313
|
-
`, a += `(${
|
2326
|
+
`, a += `(${h})\r
|
2314
2327
|
`, a += `VALUES\r
|
2315
2328
|
`, a += "(";
|
2316
|
-
let g = Object.keys(
|
2317
|
-
for (let
|
2318
|
-
let N = g[
|
2329
|
+
let g = Object.keys(p);
|
2330
|
+
for (let b = 0; b < g.length; b++) {
|
2331
|
+
let N = g[b];
|
2319
2332
|
if (i != null && i.name == N)
|
2320
2333
|
continue;
|
2321
|
-
let V =
|
2322
|
-
a += `${
|
2334
|
+
let V = p[N];
|
2335
|
+
a += `${Xe.getValue(V)}`, b != g.length - 1 && (a += ", ");
|
2323
2336
|
}
|
2324
2337
|
a += ")", d != r.length - 1 && (a += `\r
|
2325
2338
|
\r
|
@@ -2331,21 +2344,21 @@ class Ne extends Re {
|
|
2331
2344
|
return "";
|
2332
2345
|
}
|
2333
2346
|
}
|
2334
|
-
class
|
2347
|
+
class Vt extends je {
|
2335
2348
|
constructor() {
|
2336
2349
|
super(...arguments);
|
2337
2350
|
n(this, "type", "MySql");
|
2338
2351
|
}
|
2339
2352
|
insert(e) {
|
2340
|
-
return new
|
2353
|
+
return new Me().insert(e);
|
2341
2354
|
}
|
2342
2355
|
update(e) {
|
2343
|
-
return new
|
2356
|
+
return new Me().update(e);
|
2344
2357
|
}
|
2345
2358
|
}
|
2346
|
-
class
|
2359
|
+
class qt extends B {
|
2347
2360
|
open() {
|
2348
|
-
super.open(), super.instances = [new
|
2361
|
+
super.open(), super.instances = [new Pt(), new Ut(), new Vt(), new Me()];
|
2349
2362
|
}
|
2350
2363
|
}
|
2351
2364
|
class tr {
|
@@ -2370,7 +2383,7 @@ class tr {
|
|
2370
2383
|
return this.columns == null || this.columns.length == 0 ? null : this.columns.find((e) => e.identity);
|
2371
2384
|
}
|
2372
2385
|
}
|
2373
|
-
class
|
2386
|
+
class lt {
|
2374
2387
|
constructor() {
|
2375
2388
|
/**
|
2376
2389
|
* 任务实例,用于控制并发
|
@@ -2387,8 +2400,8 @@ class rt {
|
|
2387
2400
|
let c = new XMLHttpRequest();
|
2388
2401
|
c.open("GET", r, !1), c.onreadystatechange = () => {
|
2389
2402
|
if (c.readyState == 4 && c.status == 200) {
|
2390
|
-
let
|
2391
|
-
|
2403
|
+
let h = R.createEmptyByUrl(r);
|
2404
|
+
h.appendChild(document.createTextNode(c.responseText)), document.head.appendChild(h), a();
|
2392
2405
|
}
|
2393
2406
|
}, c.onerror = () => {
|
2394
2407
|
o();
|
@@ -2402,16 +2415,16 @@ class rt {
|
|
2402
2415
|
* 通过注入DOM标签异步加载脚本或样式表,已防重
|
2403
2416
|
*/
|
2404
2417
|
n(this, "loadResourceAsync", async (t) => {
|
2405
|
-
let e =
|
2418
|
+
let e = W.getArray(t), s = [];
|
2406
2419
|
for (let r of e) {
|
2407
2420
|
let i = new Promise((a, o) => {
|
2408
|
-
let c =
|
2409
|
-
c != null ? a(c) : (c =
|
2421
|
+
let c = R.getByUrl(r);
|
2422
|
+
c != null ? a(c) : (c = R.createByUrl(r), document.head.appendChild(c), c.onload = (h) => {
|
2410
2423
|
a(c);
|
2411
|
-
}, c.onerror = (
|
2412
|
-
o(
|
2424
|
+
}, c.onerror = (h) => {
|
2425
|
+
o(h);
|
2413
2426
|
let d;
|
2414
|
-
throw
|
2427
|
+
throw h instanceof Event ? d = `${h.type}, 耗时: ${h.timeStamp}` : d = h, new Error(`脚本: ${r} 加载出错: ${d}`);
|
2415
2428
|
});
|
2416
2429
|
});
|
2417
2430
|
s.push(i);
|
@@ -2422,7 +2435,7 @@ class rt {
|
|
2422
2435
|
//#endregion
|
2423
2436
|
//#region 开启
|
2424
2437
|
async open(t) {
|
2425
|
-
this.task = await
|
2438
|
+
this.task = await E.task.create("Memory"), this.task.taskLimit = 1;
|
2426
2439
|
}
|
2427
2440
|
async getMonaco(t = null) {
|
2428
2441
|
let e = window.monaco;
|
@@ -2462,12 +2475,12 @@ class rt {
|
|
2462
2475
|
await this.loadResourceAsync(s);
|
2463
2476
|
}
|
2464
2477
|
async loadAsync(t) {
|
2465
|
-
let e =
|
2478
|
+
let e = W.getArray(t);
|
2466
2479
|
return await this.loadResourceAsync(e);
|
2467
2480
|
}
|
2468
2481
|
//#endregion
|
2469
2482
|
}
|
2470
|
-
class
|
2483
|
+
class zt extends lt {
|
2471
2484
|
constructor() {
|
2472
2485
|
super(...arguments);
|
2473
2486
|
//#region 属性
|
@@ -2504,7 +2517,7 @@ class Wt extends rt {
|
|
2504
2517
|
return await super.loadFilesAsync("/assets/xlsx-js-style", e), window.XLSX;
|
2505
2518
|
}
|
2506
2519
|
}
|
2507
|
-
class
|
2520
|
+
class Kt extends lt {
|
2508
2521
|
constructor() {
|
2509
2522
|
super(...arguments);
|
2510
2523
|
//#region 属性
|
@@ -2552,9 +2565,9 @@ class Qt extends rt {
|
|
2552
2565
|
return await super.loadFilesAsync(`${this.jdCdn}/xlsx-js-style@1.2.0`, e), window.XLSX;
|
2553
2566
|
}
|
2554
2567
|
}
|
2555
|
-
class
|
2568
|
+
class Wt extends B {
|
2556
2569
|
open() {
|
2557
|
-
super.open(), super.instances = [new
|
2570
|
+
super.open(), super.instances = [new zt(), new Kt()];
|
2558
2571
|
}
|
2559
2572
|
/**
|
2560
2573
|
* 获取指定CDN实例
|
@@ -2564,7 +2577,7 @@ class Jt extends F {
|
|
2564
2577
|
return await s.open(e), s;
|
2565
2578
|
}
|
2566
2579
|
}
|
2567
|
-
class
|
2580
|
+
class Qt {
|
2568
2581
|
constructor() {
|
2569
2582
|
n(this, "type");
|
2570
2583
|
}
|
@@ -2577,7 +2590,7 @@ class Xt {
|
|
2577
2590
|
return JSON.parse(e);
|
2578
2591
|
}
|
2579
2592
|
}
|
2580
|
-
class
|
2593
|
+
class Jt extends Qt {
|
2581
2594
|
constructor() {
|
2582
2595
|
super(...arguments);
|
2583
2596
|
//#region 属性
|
@@ -2587,7 +2600,7 @@ class Yt extends Xt {
|
|
2587
2600
|
//#endregion
|
2588
2601
|
//#region 开启
|
2589
2602
|
async open(e) {
|
2590
|
-
this.crypto = await
|
2603
|
+
this.crypto = await me.getCrypto();
|
2591
2604
|
}
|
2592
2605
|
//#endregion
|
2593
2606
|
encodeString(e) {
|
@@ -2599,9 +2612,9 @@ class Yt extends Xt {
|
|
2599
2612
|
return this.crypto.enc.Utf8.stringify(s);
|
2600
2613
|
}
|
2601
2614
|
}
|
2602
|
-
class
|
2615
|
+
class Xt extends B {
|
2603
2616
|
get instances() {
|
2604
|
-
return [new
|
2617
|
+
return [new Jt()];
|
2605
2618
|
}
|
2606
2619
|
/**
|
2607
2620
|
* 创建执行类型的Hash实例
|
@@ -2617,12 +2630,12 @@ class Gt extends F {
|
|
2617
2630
|
return await this.createIfAbsent("Base64");
|
2618
2631
|
}
|
2619
2632
|
}
|
2620
|
-
class
|
2633
|
+
class Yt {
|
2621
2634
|
constructor() {
|
2622
2635
|
n(this, "type");
|
2623
2636
|
}
|
2624
2637
|
}
|
2625
|
-
class
|
2638
|
+
class Gt extends Yt {
|
2626
2639
|
constructor() {
|
2627
2640
|
super(...arguments);
|
2628
2641
|
//#region 属性
|
@@ -2632,7 +2645,7 @@ class Ht extends Zt {
|
|
2632
2645
|
//#endregion
|
2633
2646
|
//#region 开启
|
2634
2647
|
async open(e) {
|
2635
|
-
this.xlsx = await
|
2648
|
+
this.xlsx = await me.getXlsx();
|
2636
2649
|
}
|
2637
2650
|
//#endregion
|
2638
2651
|
export(e, s) {
|
@@ -2646,9 +2659,9 @@ class Ht extends Zt {
|
|
2646
2659
|
i.push(d);
|
2647
2660
|
}), r.push(i), e.length > 0)
|
2648
2661
|
for (let d = 0; d < e.length; d++) {
|
2649
|
-
let
|
2650
|
-
Object.keys(
|
2651
|
-
g.push(
|
2662
|
+
let p = e[d], g = [];
|
2663
|
+
Object.keys(p).forEach((b) => {
|
2664
|
+
g.push(p[b]);
|
2652
2665
|
}), r.push(g);
|
2653
2666
|
}
|
2654
2667
|
let a = this.xlsx.utils.book_new(), o = this.xlsx.utils.json_to_sheet(r, { skipHeader: !0 });
|
@@ -2662,16 +2675,16 @@ class Ht extends Zt {
|
|
2662
2675
|
fill: { fgColor: { rgb: "409eff" } }
|
2663
2676
|
};
|
2664
2677
|
}
|
2665
|
-
let
|
2678
|
+
let h = [];
|
2666
2679
|
l.forEach((d) => {
|
2667
|
-
let
|
2668
|
-
typeof
|
2669
|
-
}), o["!cols"] =
|
2680
|
+
let p = e[0][d], g = { wpx: 50 };
|
2681
|
+
typeof p == "string" && (g.wpx = 100), h.push(g);
|
2682
|
+
}), o["!cols"] = h, this.xlsx.writeFile(a, s);
|
2670
2683
|
}
|
2671
2684
|
}
|
2672
|
-
class
|
2685
|
+
class Zt extends B {
|
2673
2686
|
get instances() {
|
2674
|
-
return [new
|
2687
|
+
return [new Gt()];
|
2675
2688
|
}
|
2676
2689
|
/**
|
2677
2690
|
* 获取Excel实例
|
@@ -2681,19 +2694,19 @@ class es extends F {
|
|
2681
2694
|
return await s.open(e), s;
|
2682
2695
|
}
|
2683
2696
|
}
|
2684
|
-
class
|
2697
|
+
class Ht {
|
2685
2698
|
constructor() {
|
2686
2699
|
n(this, "type", "Json");
|
2687
2700
|
}
|
2688
2701
|
}
|
2689
|
-
class
|
2702
|
+
class es extends Ht {
|
2690
2703
|
}
|
2691
|
-
class
|
2704
|
+
class ts extends B {
|
2692
2705
|
get instances() {
|
2693
|
-
return [new
|
2706
|
+
return [new es()];
|
2694
2707
|
}
|
2695
2708
|
}
|
2696
|
-
class
|
2709
|
+
class ss {
|
2697
2710
|
constructor() {
|
2698
2711
|
n(this, "type", "Sort");
|
2699
2712
|
}
|
@@ -2718,7 +2731,7 @@ class rs {
|
|
2718
2731
|
}
|
2719
2732
|
}
|
2720
2733
|
}
|
2721
|
-
class
|
2734
|
+
class ls {
|
2722
2735
|
constructor() {
|
2723
2736
|
n(this, "type", "I18N");
|
2724
2737
|
}
|
@@ -2731,7 +2744,7 @@ class ns {
|
|
2731
2744
|
copy(t, e, s) {
|
2732
2745
|
}
|
2733
2746
|
}
|
2734
|
-
class
|
2747
|
+
class rs {
|
2735
2748
|
constructor() {
|
2736
2749
|
n(this, "type", "Expression");
|
2737
2750
|
}
|
@@ -2744,9 +2757,9 @@ class is {
|
|
2744
2757
|
copy(t, e, s) {
|
2745
2758
|
}
|
2746
2759
|
}
|
2747
|
-
class
|
2760
|
+
class ns extends B {
|
2748
2761
|
get instances() {
|
2749
|
-
return [new
|
2762
|
+
return [new ss(), new ls(), new rs()];
|
2750
2763
|
}
|
2751
2764
|
/**
|
2752
2765
|
* 获取指定特征实例
|
@@ -2756,12 +2769,12 @@ class as extends F {
|
|
2756
2769
|
return s.open(null), s;
|
2757
2770
|
}
|
2758
2771
|
}
|
2759
|
-
class
|
2772
|
+
class rt {
|
2760
2773
|
constructor() {
|
2761
2774
|
n(this, "type");
|
2762
2775
|
}
|
2763
2776
|
}
|
2764
|
-
class
|
2777
|
+
class is extends rt {
|
2765
2778
|
constructor() {
|
2766
2779
|
super(...arguments);
|
2767
2780
|
//#region 属性
|
@@ -2777,7 +2790,7 @@ class os extends nt {
|
|
2777
2790
|
return Array.from(new Uint8Array(r)).map((o) => o.toString(16).padStart(2, "0")).join("");
|
2778
2791
|
}
|
2779
2792
|
}
|
2780
|
-
class
|
2793
|
+
class as extends rt {
|
2781
2794
|
constructor() {
|
2782
2795
|
super(...arguments);
|
2783
2796
|
//#region 属性
|
@@ -2787,7 +2800,7 @@ class us extends nt {
|
|
2787
2800
|
//#endregion
|
2788
2801
|
//#region 开启
|
2789
2802
|
async open(e) {
|
2790
|
-
this.crypto = await
|
2803
|
+
this.crypto = await me.getCrypto();
|
2791
2804
|
}
|
2792
2805
|
//#endregion
|
2793
2806
|
compute(e) {
|
@@ -2795,9 +2808,9 @@ class us extends nt {
|
|
2795
2808
|
return Promise.resolve(s);
|
2796
2809
|
}
|
2797
2810
|
}
|
2798
|
-
class
|
2811
|
+
class os extends B {
|
2799
2812
|
get instances() {
|
2800
|
-
return [new
|
2813
|
+
return [new is(), new as()];
|
2801
2814
|
}
|
2802
2815
|
async create(t, e) {
|
2803
2816
|
let s = await super.create(t);
|
@@ -2810,7 +2823,7 @@ class cs extends F {
|
|
2810
2823
|
return await this.createIfAbsent("Md5");
|
2811
2824
|
}
|
2812
2825
|
}
|
2813
|
-
class
|
2826
|
+
class nt {
|
2814
2827
|
constructor() {
|
2815
2828
|
/**
|
2816
2829
|
* 请求唯一标识
|
@@ -2844,7 +2857,7 @@ class it {
|
|
2844
2857
|
getHeader(t) {
|
2845
2858
|
if (this.headers == null)
|
2846
2859
|
return null;
|
2847
|
-
let e =
|
2860
|
+
let e = Y.getKey(this.headers, t);
|
2848
2861
|
return e ? this.headers[e] : null;
|
2849
2862
|
}
|
2850
2863
|
/**
|
@@ -2868,11 +2881,11 @@ class it {
|
|
2868
2881
|
* 不能放在getRequest中处理,因为外部会直接调用当前send方法,而不走getRequest
|
2869
2882
|
*/
|
2870
2883
|
prepare() {
|
2871
|
-
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 = M.serializeWithoutString(this.data)), this.data == null && this.body != null && this.contentType == "application/json" && (this.data = M.deserialize(this.body)), this.contentType != null && this.addHeader("content-type", this.contentType);
|
2872
2885
|
}
|
2873
2886
|
//#endregion
|
2874
2887
|
}
|
2875
|
-
class
|
2888
|
+
class it extends nt {
|
2876
2889
|
constructor() {
|
2877
2890
|
super();
|
2878
2891
|
/**
|
@@ -2887,10 +2900,10 @@ class at extends it {
|
|
2887
2900
|
* 实际请求地址
|
2888
2901
|
*/
|
2889
2902
|
n(this, "url");
|
2890
|
-
this.id =
|
2903
|
+
this.id = W.getUniqueId(8);
|
2891
2904
|
}
|
2892
2905
|
}
|
2893
|
-
class
|
2906
|
+
class qe {
|
2894
2907
|
constructor() {
|
2895
2908
|
//#region 属性
|
2896
2909
|
n(this, "type");
|
@@ -2900,7 +2913,7 @@ class ze {
|
|
2900
2913
|
//#endregion
|
2901
2914
|
//#region 开启
|
2902
2915
|
async open(t) {
|
2903
|
-
|
2916
|
+
M.mergeTo(this, t);
|
2904
2917
|
}
|
2905
2918
|
//#endregion
|
2906
2919
|
async get(t, e) {
|
@@ -2928,11 +2941,11 @@ class ze {
|
|
2928
2941
|
* 获取请求消息
|
2929
2942
|
*/
|
2930
2943
|
getRequest(t, e, s, l = null) {
|
2931
|
-
let r = new
|
2932
|
-
return r.method = t, r.contentType = e, r.path = s, r.body =
|
2944
|
+
let r = new it();
|
2945
|
+
return r.method = t, r.contentType = e, r.path = s, r.body = M.serializeWithoutString(l), r;
|
2933
2946
|
}
|
2934
2947
|
}
|
2935
|
-
class
|
2948
|
+
class Ye extends nt {
|
2936
2949
|
constructor() {
|
2937
2950
|
super(...arguments);
|
2938
2951
|
/**
|
@@ -2957,14 +2970,14 @@ class Ge extends it {
|
|
2957
2970
|
n(this, "request");
|
2958
2971
|
}
|
2959
2972
|
}
|
2960
|
-
class
|
2973
|
+
class us extends qe {
|
2961
2974
|
constructor() {
|
2962
2975
|
super(...arguments);
|
2963
2976
|
n(this, "type", "Default");
|
2964
2977
|
n(this, "baseUrl");
|
2965
2978
|
}
|
2966
2979
|
async send(e) {
|
2967
|
-
|
2980
|
+
W.isNullOrEmpty(e.url) && (e.url = this.baseUrl + e.path), e.prepare();
|
2968
2981
|
let s;
|
2969
2982
|
return typeof XMLHttpRequest > "u" ? (s = await this.sendWithFetch(e), s) : (s = await this.sendWithXmlHttpRequest(e), s);
|
2970
2983
|
}
|
@@ -2972,7 +2985,7 @@ class ds extends ze {
|
|
2972
2985
|
* 使用Fetch发送请求,谷歌插件场景专用
|
2973
2986
|
*/
|
2974
2987
|
async sendWithFetch(e) {
|
2975
|
-
let s = (/* @__PURE__ */ new Date()).getTime(), l = new
|
2988
|
+
let s = (/* @__PURE__ */ new Date()).getTime(), l = new Ye();
|
2976
2989
|
l.request = e, l.id = e.id;
|
2977
2990
|
let r = {
|
2978
2991
|
method: e.method,
|
@@ -2991,7 +3004,7 @@ class ds extends ze {
|
|
2991
3004
|
* 使用XmlHttpRequest发送请求
|
2992
3005
|
*/
|
2993
3006
|
sendWithXmlHttpRequest(e) {
|
2994
|
-
let s = new
|
3007
|
+
let s = new Ye();
|
2995
3008
|
return s.request = e, s.id = e.id, new Promise(async (l, r) => {
|
2996
3009
|
var a;
|
2997
3010
|
await ((a = this.onRequest) == null ? void 0 : a.call(this, e));
|
@@ -3006,12 +3019,12 @@ class ds extends ze {
|
|
3006
3019
|
if (i.readyState == 4 && i.status == 200) {
|
3007
3020
|
s.success = !0, s.status = i.status, s.body = i.responseText;
|
3008
3021
|
let c = i.getAllResponseHeaders().split(`\r
|
3009
|
-
`),
|
3022
|
+
`), h = {};
|
3010
3023
|
for (let d = 0; d < c.length; d++) {
|
3011
|
-
let
|
3012
|
-
g == null || g == "" || (
|
3024
|
+
let p = c[d].split(": "), g = p.shift();
|
3025
|
+
g == null || g == "" || (h[g] = p.join(": "));
|
3013
3026
|
}
|
3014
|
-
s.headers =
|
3027
|
+
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);
|
3015
3028
|
}
|
3016
3029
|
}, i.onerror = async (o) => {
|
3017
3030
|
var c;
|
@@ -3020,7 +3033,7 @@ class ds extends ze {
|
|
3020
3033
|
});
|
3021
3034
|
}
|
3022
3035
|
}
|
3023
|
-
class
|
3036
|
+
class cs extends qe {
|
3024
3037
|
constructor() {
|
3025
3038
|
super(...arguments);
|
3026
3039
|
//#region 属性
|
@@ -3052,31 +3065,31 @@ class ps extends ze {
|
|
3052
3065
|
* 危险操作,会暴露敏感信息
|
3053
3066
|
*/
|
3054
3067
|
async open(e) {
|
3055
|
-
await super.open(e), this.requester = await
|
3068
|
+
await super.open(e), this.requester = await E.http.getDefault(), this.hasher = await E.hasher.create("Sha256");
|
3056
3069
|
}
|
3057
3070
|
//#endregion
|
3058
3071
|
/**
|
3059
3072
|
* 危险操作,会暴露敏感信息
|
3060
3073
|
*/
|
3061
3074
|
async send(e) {
|
3062
|
-
let s =
|
3075
|
+
let s = te.getTimestamp(), l = {
|
3063
3076
|
app_id: this.appId,
|
3064
3077
|
hash_type: "sha256",
|
3065
3078
|
timestamp: parseInt((s / 1e3).toString())
|
3066
3079
|
};
|
3067
|
-
|
3080
|
+
W.isNullOrEmpty(e.body) || (l.jsonBody = e.body);
|
3068
3081
|
let r = K.deserialize(e.path);
|
3069
|
-
for (let
|
3070
|
-
l[
|
3082
|
+
for (let p in r)
|
3083
|
+
l[p] = r[p];
|
3071
3084
|
let i = K.getPath(e.path);
|
3072
|
-
l =
|
3073
|
-
let a =
|
3074
|
-
l.sign = c.toLowerCase(), delete l.jsonBody, l =
|
3075
|
-
let
|
3076
|
-
return e.url = K.concatUrl(this.baseUrl, i + "?" +
|
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);
|
3077
3090
|
}
|
3078
3091
|
}
|
3079
|
-
class
|
3092
|
+
class ds extends qe {
|
3080
3093
|
constructor() {
|
3081
3094
|
super(...arguments);
|
3082
3095
|
//#region 属性
|
@@ -3120,7 +3133,7 @@ class hs extends ze {
|
|
3120
3133
|
* 开启
|
3121
3134
|
*/
|
3122
3135
|
async open(e) {
|
3123
|
-
await super.open(e), this.http = await
|
3136
|
+
await super.open(e), this.http = await E.http.getDefault(), this.user != null && (this.sso = await E.sso.create(this.user.type)), this.signer = await E.signer.createIfAbsent("default"), this.onRequest == null && (this.onRequest = this.beforeRequest);
|
3124
3137
|
}
|
3125
3138
|
//#endregion
|
3126
3139
|
/**
|
@@ -3137,10 +3150,10 @@ class hs extends ze {
|
|
3137
3150
|
let i = s.status ? `(${s.status})` : "";
|
3138
3151
|
r = `接口加载异常: ${e.method}${i} ${e.url}`;
|
3139
3152
|
}
|
3140
|
-
return
|
3153
|
+
return ve.warning(r), Promise.reject(r);
|
3141
3154
|
}
|
3142
3155
|
let l = s.data;
|
3143
|
-
return l.code != "Ok" ? (
|
3156
|
+
return l.code != "Ok" ? (ve.error(l.message), Promise.reject(l)) : s;
|
3144
3157
|
}
|
3145
3158
|
/**
|
3146
3159
|
* 请求预处理
|
@@ -3152,7 +3165,7 @@ class hs extends ze {
|
|
3152
3165
|
if (this.user == null)
|
3153
3166
|
s = this.platform;
|
3154
3167
|
else {
|
3155
|
-
let r =
|
3168
|
+
let r = te.getTimestamp(), i = await this.signer.getSign(this.user.userId, e.url, e.body, r, this.user.secret);
|
3156
3169
|
s = this.sso.getAuth(this.user.identity.token, r, i, this.platform, this.env);
|
3157
3170
|
}
|
3158
3171
|
let l = {};
|
@@ -3164,21 +3177,21 @@ class hs extends ze {
|
|
3164
3177
|
handleError(e) {
|
3165
3178
|
if (e instanceof Object) {
|
3166
3179
|
let s = e.message;
|
3167
|
-
e.message == "Network Error" && (K.httpOrHttps(e.config.url) ? s = "接口网络错误: " + e.config.url : s = "接口网络错误: " + e.config.baseURL + e.config.url),
|
3180
|
+
e.message == "Network Error" && (K.httpOrHttps(e.config.url) ? s = "接口网络错误: " + e.config.url : s = "接口网络错误: " + e.config.baseURL + e.config.url), ve.error(s);
|
3168
3181
|
} else
|
3169
|
-
|
3182
|
+
ve.error(e.message);
|
3170
3183
|
return Promise.reject(e);
|
3171
3184
|
}
|
3172
3185
|
}
|
3173
|
-
class
|
3186
|
+
class hs extends B {
|
3174
3187
|
get instances() {
|
3175
|
-
return [new
|
3188
|
+
return [new us(), new cs(), new ds()];
|
3176
3189
|
}
|
3177
3190
|
/**
|
3178
3191
|
* 创建并开启
|
3179
3192
|
*/
|
3180
3193
|
async createById(t, e = null) {
|
3181
|
-
e == null && (e = new
|
3194
|
+
e == null && (e = new Rt());
|
3182
3195
|
let s = await super.createById(t, e), l = e.value;
|
3183
3196
|
return await s.open(l.Conn), s;
|
3184
3197
|
}
|
@@ -3196,12 +3209,145 @@ class fs extends F {
|
|
3196
3209
|
return await this.createIfAbsent("Halo");
|
3197
3210
|
}
|
3198
3211
|
}
|
3199
|
-
class
|
3212
|
+
class ps {
|
3200
3213
|
constructor() {
|
3214
|
+
//#region 属性
|
3201
3215
|
n(this, "type");
|
3216
|
+
n(this, "lang");
|
3217
|
+
n(this, "messages", {});
|
3218
|
+
//#endregion
|
3219
|
+
n(this, "t", (t, e) => {
|
3220
|
+
if (!t)
|
3221
|
+
return null;
|
3222
|
+
if (!this.t_exists(t)) {
|
3223
|
+
let s = t.split(".");
|
3224
|
+
return ue.getLast(s, 2).join(".");
|
3225
|
+
}
|
3226
|
+
return typeof e == "string" ? this.translate(t, [e]) : this.translate(t, e);
|
3227
|
+
});
|
3228
|
+
n(this, "t_menu", (t) => {
|
3229
|
+
let s = `_business.Sys_Menu.Title.${t}`;
|
3230
|
+
return this.t(s);
|
3231
|
+
});
|
3232
|
+
n(this, "t_module", (t, e) => {
|
3233
|
+
if (!t && !e)
|
3234
|
+
return null;
|
3235
|
+
let s = t.toLowerCase(), l = "_business.Ctl_Module.Title", r = t ? this.t(`common.${s}`) : "", i = this.t(`${l}.${e}`);
|
3236
|
+
return s == "list" || s == "paging" || s == "detail" ? i + " " + r : r + " " + i;
|
3237
|
+
});
|
3238
|
+
n(this, "t_table", (t) => this.t(`_business.Ctl_Table.Title.${t}`));
|
3239
|
+
n(this, "t_field", (t, e) => {
|
3240
|
+
let l = `_business.Ctl_Table_Field.Label.${t}.${e}`;
|
3241
|
+
return this.t(l);
|
3242
|
+
});
|
3243
|
+
n(this, "t_enum", (t, e) => this.t(`_business.Ctl_Enum_Option.Text.${t}.${e}`));
|
3244
|
+
n(this, "t_field_placeholder", (t, e) => this.t("common.please_input") + this.t(`_business.Ctl_Table_Field.Label.${t}.${e}`));
|
3245
|
+
n(this, "t_field_choose_placeholder", (t, e) => this.t("common.please_choose") + this.t(`_business.Ctl_Table_Field.Label.${t}.${e}`));
|
3246
|
+
n(this, "t_sys", (t) => this.t(`sys.${t}`));
|
3247
|
+
n(this, "t_title", () => this.t("sys.title"));
|
3248
|
+
//#region 设置标题
|
3249
|
+
/**
|
3250
|
+
* 根据key设置多语言标题
|
3251
|
+
*/
|
3252
|
+
n(this, "setI18nTitle", (t) => {
|
3253
|
+
let e = this.t(t);
|
3254
|
+
this.setTitle(e);
|
3255
|
+
});
|
3256
|
+
/**
|
3257
|
+
* 设置标题
|
3258
|
+
*/
|
3259
|
+
n(this, "setTitle", (t = null, e = null) => {
|
3260
|
+
let s = this.t_title(), l;
|
3261
|
+
s ? t ? e ? l = `${t}(${e}) - ${s}` : l = `${t} - ${s}` : l = s : e ? l = `${t}(${e})` : l = t, document.title = l;
|
3262
|
+
});
|
3263
|
+
//#region 加载
|
3264
|
+
/**
|
3265
|
+
* 添加自定义多语言包
|
3266
|
+
*/
|
3267
|
+
n(this, "addMessages", (t) => {
|
3268
|
+
let e = Object.keys(t);
|
3269
|
+
for (let s of e)
|
3270
|
+
this.messages[s] = t[s];
|
3271
|
+
this.setTitle(this.t("common.loading") + "...");
|
3272
|
+
});
|
3273
|
+
/**
|
3274
|
+
* 切换语言,自动加载菜单
|
3275
|
+
*/
|
3276
|
+
n(this, "switchI18n", async (t) => {
|
3277
|
+
Object.keys(this.messages).indexOf(t) == -1 && await this.loadI18n(t), this.lang = t;
|
3278
|
+
});
|
3279
|
+
}
|
3280
|
+
//#endregion
|
3281
|
+
//#region 开启
|
3282
|
+
async open(t) {
|
3283
|
+
let s = await (await E.provider.getDefault("sys")).getAsync("app");
|
3284
|
+
this.lang = (s == null ? void 0 : s.language) ?? st.getLanguage();
|
3202
3285
|
}
|
3286
|
+
//#endregion
|
3203
3287
|
}
|
3204
|
-
class
|
3288
|
+
class fs extends ps {
|
3289
|
+
constructor() {
|
3290
|
+
super(...arguments);
|
3291
|
+
n(this, "type", "Default");
|
3292
|
+
//#endregion
|
3293
|
+
n(this, "translate", (e, s) => {
|
3294
|
+
let l = this.messages[this.lang], r = e.split(".");
|
3295
|
+
return M.getValue(l, r);
|
3296
|
+
});
|
3297
|
+
n(this, "t_exists", (e) => {
|
3298
|
+
if (!e)
|
3299
|
+
return null;
|
3300
|
+
let s = this.messages[this.lang], l = e.split(".");
|
3301
|
+
return M.hasKey(s, l);
|
3302
|
+
});
|
3303
|
+
n(this, "loadI18n", async (e) => {
|
3304
|
+
e == null && (e = this.lang);
|
3305
|
+
let s = new Promise(async (r) => {
|
3306
|
+
let i = { conditions: [{ name: "lang", value: e }] };
|
3307
|
+
return T.post("/i18n", i).then(({ data: a }) => {
|
3308
|
+
a.forEach((o) => {
|
3309
|
+
let c = `${e}.${o.Module}.${o.Key}`.split(".");
|
3310
|
+
Y.addProperties(this.messages, c, o.Value);
|
3311
|
+
}), r(a);
|
3312
|
+
});
|
3313
|
+
}), l = new Promise((r) => {
|
3314
|
+
let i = { conditions: [{ name: "lang", value: e }] };
|
3315
|
+
T.post("/i18n_business", i).then(({ data: a }) => {
|
3316
|
+
a.forEach((o) => {
|
3317
|
+
let c = `${e}._business.${o.Table}.${o.Field}.${o.Key}`.split(".");
|
3318
|
+
Y.addProperties(this.messages, c, o.Value);
|
3319
|
+
}), r(a);
|
3320
|
+
});
|
3321
|
+
});
|
3322
|
+
await Promise.all([s, l]);
|
3323
|
+
});
|
3324
|
+
}
|
3325
|
+
//#region 开启
|
3326
|
+
async open(e) {
|
3327
|
+
await super.open(e);
|
3328
|
+
}
|
3329
|
+
}
|
3330
|
+
class gs extends B {
|
3331
|
+
//#region 开启
|
3332
|
+
open() {
|
3333
|
+
super.open(), super.addType(new fs());
|
3334
|
+
}
|
3335
|
+
//#endregion
|
3336
|
+
/**
|
3337
|
+
* 获取默认多语言
|
3338
|
+
*/
|
3339
|
+
async getDefault() {
|
3340
|
+
return await super.createIfAbsent("Default", "Default", async (e) => {
|
3341
|
+
await e.open();
|
3342
|
+
});
|
3343
|
+
}
|
3344
|
+
}
|
3345
|
+
class ms {
|
3346
|
+
constructor() {
|
3347
|
+
n(this, "type");
|
3348
|
+
}
|
3349
|
+
}
|
3350
|
+
class ys extends ms {
|
3205
3351
|
constructor() {
|
3206
3352
|
super(...arguments);
|
3207
3353
|
n(this, "type", "Console");
|
@@ -3228,9 +3374,9 @@ class ms extends gs {
|
|
3228
3374
|
console.warn(e);
|
3229
3375
|
}
|
3230
3376
|
}
|
3231
|
-
class
|
3377
|
+
class vs extends B {
|
3232
3378
|
get instances() {
|
3233
|
-
return [new
|
3379
|
+
return [new ys()];
|
3234
3380
|
}
|
3235
3381
|
/**
|
3236
3382
|
* 获取控制台消息提示类型
|
@@ -3239,12 +3385,12 @@ class ys extends F {
|
|
3239
3385
|
return await super.create("Console");
|
3240
3386
|
}
|
3241
3387
|
}
|
3242
|
-
class
|
3388
|
+
class ws {
|
3243
3389
|
constructor() {
|
3244
3390
|
n(this, "type");
|
3245
3391
|
}
|
3246
3392
|
}
|
3247
|
-
class bs extends
|
3393
|
+
class bs extends ws {
|
3248
3394
|
constructor() {
|
3249
3395
|
super(...arguments);
|
3250
3396
|
n(this, "type", "Default");
|
@@ -3255,7 +3401,7 @@ class bs extends vs {
|
|
3255
3401
|
}
|
3256
3402
|
async getSign(e, s, l, r, i) {
|
3257
3403
|
let o = `${e}.${s}.${l ?? ""}.${r}.${i}`;
|
3258
|
-
return (await
|
3404
|
+
return (await pt.compute(o)).toUpperCase();
|
3259
3405
|
}
|
3260
3406
|
loginUrl(e) {
|
3261
3407
|
return "";
|
@@ -3263,7 +3409,7 @@ class bs extends vs {
|
|
3263
3409
|
dispose() {
|
3264
3410
|
}
|
3265
3411
|
}
|
3266
|
-
class
|
3412
|
+
class xs extends B {
|
3267
3413
|
get instances() {
|
3268
3414
|
return [new bs()];
|
3269
3415
|
}
|
@@ -3275,7 +3421,7 @@ class ws extends F {
|
|
3275
3421
|
return await s.open(null), s;
|
3276
3422
|
}
|
3277
3423
|
}
|
3278
|
-
class
|
3424
|
+
class ks {
|
3279
3425
|
constructor() {
|
3280
3426
|
//#region 属性
|
3281
3427
|
n(this, "type", "Bearer");
|
@@ -3287,11 +3433,11 @@ class xs {
|
|
3287
3433
|
//#endregion
|
3288
3434
|
//#region 开启
|
3289
3435
|
async open(t) {
|
3290
|
-
this.provider = await
|
3436
|
+
this.provider = await E.provider.getDefault("user");
|
3291
3437
|
}
|
3292
3438
|
//#endregion
|
3293
3439
|
async login(t) {
|
3294
|
-
return
|
3440
|
+
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 E.sso.create(e.data.type), Promise.resolve(e)));
|
3295
3441
|
}
|
3296
3442
|
loginUrl(t) {
|
3297
3443
|
return "";
|
@@ -3321,11 +3467,11 @@ class Ss {
|
|
3321
3467
|
//#endregion
|
3322
3468
|
//#region 开启
|
3323
3469
|
async open(t) {
|
3324
|
-
this.url = t.url, this.app_id = t.app_id, this.provider = await
|
3470
|
+
this.url = t.url, this.app_id = t.app_id, this.provider = await E.provider.getDefault("user");
|
3325
3471
|
}
|
3326
3472
|
//#endregion
|
3327
3473
|
async login(t) {
|
3328
|
-
await this.provider.saveAsync("sso", t),
|
3474
|
+
await this.provider.saveAsync("sso", t), T.user = t, T.sso = await E.sso.create(t.type);
|
3329
3475
|
}
|
3330
3476
|
loginUrl(t) {
|
3331
3477
|
let e = encodeURIComponent(t);
|
@@ -3341,7 +3487,7 @@ class Ss {
|
|
3341
3487
|
await this.provider.deleteAsync("user"), await this.provider.deleteAsync("sso");
|
3342
3488
|
}
|
3343
3489
|
}
|
3344
|
-
class
|
3490
|
+
class at {
|
3345
3491
|
constructor() {
|
3346
3492
|
/**
|
3347
3493
|
* 用户标识
|
@@ -3361,7 +3507,7 @@ class ot {
|
|
3361
3507
|
n(this, "identity");
|
3362
3508
|
}
|
3363
3509
|
}
|
3364
|
-
class
|
3510
|
+
class Es {
|
3365
3511
|
constructor() {
|
3366
3512
|
n(this, "type", "WeiXin");
|
3367
3513
|
}
|
@@ -3373,7 +3519,7 @@ class ks {
|
|
3373
3519
|
return "";
|
3374
3520
|
}
|
3375
3521
|
async getUser() {
|
3376
|
-
let t = new
|
3522
|
+
let t = new at();
|
3377
3523
|
return t.userId = "", t;
|
3378
3524
|
}
|
3379
3525
|
getAuth(t, e, s, l) {
|
@@ -3383,12 +3529,12 @@ class ks {
|
|
3383
3529
|
return Promise.resolve();
|
3384
3530
|
}
|
3385
3531
|
}
|
3386
|
-
class
|
3532
|
+
class Cs {
|
3387
3533
|
constructor() {
|
3388
3534
|
n(this, "type");
|
3389
3535
|
}
|
3390
3536
|
}
|
3391
|
-
class
|
3537
|
+
class Ts extends Cs {
|
3392
3538
|
constructor() {
|
3393
3539
|
super(...arguments);
|
3394
3540
|
//#region 属性
|
@@ -3400,7 +3546,7 @@ class Cs extends Es {
|
|
3400
3546
|
}
|
3401
3547
|
//#endregion
|
3402
3548
|
async open(e) {
|
3403
|
-
this.provider = await
|
3549
|
+
this.provider = await E.provider.getDefault("user");
|
3404
3550
|
}
|
3405
3551
|
async login(e) {
|
3406
3552
|
}
|
@@ -3410,10 +3556,10 @@ class Cs extends Es {
|
|
3410
3556
|
async getUser() {
|
3411
3557
|
let e = await this.provider.getAsync("anonymous");
|
3412
3558
|
if (!e) {
|
3413
|
-
let l =
|
3559
|
+
let l = W.getUniqueId();
|
3414
3560
|
await this.provider.saveAsync("anonymous", l), e = l;
|
3415
3561
|
}
|
3416
|
-
let s = new
|
3562
|
+
let s = new at();
|
3417
3563
|
return s.identity = { token: e }, s;
|
3418
3564
|
}
|
3419
3565
|
getAuth(e, s, l, r) {
|
@@ -3423,7 +3569,7 @@ class Cs extends Es {
|
|
3423
3569
|
await this.provider.deleteAsync("anonymous");
|
3424
3570
|
}
|
3425
3571
|
}
|
3426
|
-
class
|
3572
|
+
class $s {
|
3427
3573
|
constructor() {
|
3428
3574
|
//#region 属性
|
3429
3575
|
n(this, "type", "Secret");
|
@@ -3434,10 +3580,10 @@ class Ts {
|
|
3434
3580
|
}
|
3435
3581
|
//#endregion
|
3436
3582
|
async open(t) {
|
3437
|
-
this.provider = await
|
3583
|
+
this.provider = await E.provider.getDefault("user");
|
3438
3584
|
}
|
3439
3585
|
async login(t) {
|
3440
|
-
return
|
3586
|
+
return T.post(`/user/login?type=${this.type}`, t).then(async (e) => {
|
3441
3587
|
let s = e.data;
|
3442
3588
|
return await this.provider.saveAsync("sso", s), Promise.resolve(e);
|
3443
3589
|
});
|
@@ -3455,172 +3601,6 @@ class Ts {
|
|
3455
3601
|
await this.provider.deleteAsync("user");
|
3456
3602
|
}
|
3457
3603
|
}
|
3458
|
-
let S = null;
|
3459
|
-
class $s {
|
3460
|
-
/**
|
3461
|
-
* 只实例化一次
|
3462
|
-
*/
|
3463
|
-
constructor() {
|
3464
|
-
//#region 属性
|
3465
|
-
/**
|
3466
|
-
* 多语言处理实体
|
3467
|
-
*/
|
3468
|
-
n(this, "i18n");
|
3469
|
-
/**
|
3470
|
-
* 记录加载过的语言包,防止重复加载
|
3471
|
-
*/
|
3472
|
-
n(this, "loadedLocales", []);
|
3473
|
-
//#endregion
|
3474
|
-
//#region 设置标题
|
3475
|
-
/**
|
3476
|
-
* 根据key设置多语言标题
|
3477
|
-
*/
|
3478
|
-
n(this, "setI18nTitle", (t) => {
|
3479
|
-
let e = S.t(t);
|
3480
|
-
this.setTitle(e);
|
3481
|
-
});
|
3482
|
-
/**
|
3483
|
-
* 设置标题
|
3484
|
-
*/
|
3485
|
-
n(this, "setTitle", (t = null, e = null) => {
|
3486
|
-
let s = S.t_title(), l;
|
3487
|
-
s ? t ? e ? l = `${t}(${e}) - ${s}` : l = `${t} - ${s}` : l = s : e ? l = `${t}(${e})` : l = t, document.title = l;
|
3488
|
-
});
|
3489
|
-
S = this, S.i18n = Dt({
|
3490
|
-
locale: lt.getLanguage(),
|
3491
|
-
//未载入配置前的语言
|
3492
|
-
messages: {},
|
3493
|
-
silentTranslationWarn: !0,
|
3494
|
-
//忽略翻译警告
|
3495
|
-
silentFallbackWarn: !0
|
3496
|
-
//忽略回退警告
|
3497
|
-
});
|
3498
|
-
}
|
3499
|
-
//#endregion
|
3500
|
-
//#region 翻译
|
3501
|
-
/**
|
3502
|
-
* 翻译指定key,不存在使用默认值
|
3503
|
-
*/
|
3504
|
-
t(t, e = null) {
|
3505
|
-
if (!t)
|
3506
|
-
return null;
|
3507
|
-
if (!S.t_exists(t)) {
|
3508
|
-
let s = t.split(".");
|
3509
|
-
return ce.getLast(s, 2).join(".");
|
3510
|
-
}
|
3511
|
-
return typeof e == "string" ? S.i18n.global.t(t, [e]) : S.i18n.global.t(t, e);
|
3512
|
-
}
|
3513
|
-
/**
|
3514
|
-
* 判断指定key是否存在
|
3515
|
-
*/
|
3516
|
-
t_exists(t) {
|
3517
|
-
return t ? S.i18n.global.te(t) : null;
|
3518
|
-
}
|
3519
|
-
/**
|
3520
|
-
* 业务翻译:菜单多余言、多个窗口的多语言同时切换,而不用重载接口
|
3521
|
-
*/
|
3522
|
-
t_menu(t) {
|
3523
|
-
let s = `_business.Sys_Menu.Title.${t}`;
|
3524
|
-
return S.t(s);
|
3525
|
-
}
|
3526
|
-
/**
|
3527
|
-
* 模块业务翻译
|
3528
|
-
*/
|
3529
|
-
t_module(t, e) {
|
3530
|
-
if (!t && !e)
|
3531
|
-
return null;
|
3532
|
-
let s = t.toLowerCase(), l = "_business.Ctl_Module.Title", r = t ? S.t(`common.${s}`) : "", i = S.t(`${l}.${e}`);
|
3533
|
-
return s == "list" || s == "paging" || s == "detail" ? i + " " + r : r + " " + i;
|
3534
|
-
}
|
3535
|
-
/**
|
3536
|
-
* 业务翻译:菜单多余言、多个窗口的多语言同时切换,而不用重载接口
|
3537
|
-
*/
|
3538
|
-
t_table(t) {
|
3539
|
-
return S.t(`_business.Ctl_Table.Title.${t}`);
|
3540
|
-
}
|
3541
|
-
/**
|
3542
|
-
* 业务翻译:菜单多余言、多个窗口的多语言同时切换,而不用重载接口
|
3543
|
-
* 注意:如果结果返回未完毕},则vue编译异常
|
3544
|
-
*/
|
3545
|
-
t_field(t, e) {
|
3546
|
-
let l = `_business.Ctl_Table_Field.Label.${t}.${e}`;
|
3547
|
-
return S.t(l);
|
3548
|
-
}
|
3549
|
-
/**
|
3550
|
-
* 枚举翻译:菜单多余言、多个窗口的多语言同时切换,而不用重载接口
|
3551
|
-
*/
|
3552
|
-
t_enum(t, e) {
|
3553
|
-
return S.t(`_business.Ctl_Enum_Option.Text.${t}.${e}`);
|
3554
|
-
}
|
3555
|
-
/**
|
3556
|
-
* 字段占位符翻译
|
3557
|
-
*/
|
3558
|
-
t_field_placeholder(t, e) {
|
3559
|
-
return S.t("common.please_input") + S.t(`_business.Ctl_Table_Field.Label.${t}.${e}`);
|
3560
|
-
}
|
3561
|
-
/**
|
3562
|
-
* 字段占位符翻译
|
3563
|
-
*/
|
3564
|
-
t_field_choose_placeholder(t, e) {
|
3565
|
-
return S.t("common.please_choose") + S.t(`_business.Ctl_Table_Field.Label.${t}.${e}`);
|
3566
|
-
}
|
3567
|
-
/**
|
3568
|
-
* 系统翻译
|
3569
|
-
*/
|
3570
|
-
t_sys(t) {
|
3571
|
-
return S.t(`sys.${t}`);
|
3572
|
-
}
|
3573
|
-
/**
|
3574
|
-
* 系统标题
|
3575
|
-
*/
|
3576
|
-
t_title() {
|
3577
|
-
return S.t("sys.title");
|
3578
|
-
}
|
3579
|
-
//#endregion
|
3580
|
-
//#region 添加
|
3581
|
-
/**
|
3582
|
-
* 添加多语言包
|
3583
|
-
*/
|
3584
|
-
addMessages(t) {
|
3585
|
-
Object.keys(t).forEach((e) => {
|
3586
|
-
S.i18n.global.messages[e] = t[e];
|
3587
|
-
}), S.setTitle(S.t("common.loading") + "...");
|
3588
|
-
}
|
3589
|
-
//#endregion
|
3590
|
-
//#region 加载
|
3591
|
-
/**
|
3592
|
-
* 加载语言包
|
3593
|
-
*/
|
3594
|
-
async loadI18n(t) {
|
3595
|
-
let e = new Promise(async (l) => {
|
3596
|
-
let r = { conditions: [{ name: "lang", value: t }] };
|
3597
|
-
return $.post("/i18n", r).then(({ data: i }) => {
|
3598
|
-
i.forEach((a) => {
|
3599
|
-
let o = `${t}.${a.Module}.${a.Key}`.split(".");
|
3600
|
-
Z.addProperties(this, o, a.Value);
|
3601
|
-
}), l(i);
|
3602
|
-
});
|
3603
|
-
}), s = new Promise((l) => {
|
3604
|
-
let r = { conditions: [{ name: "lang", value: t }] };
|
3605
|
-
$.post("/i18n_business", r).then(({ data: i }) => {
|
3606
|
-
i.forEach((a) => {
|
3607
|
-
let o = `${t}._business.${a.Table}.${a.Field}.${a.Key}`.split(".");
|
3608
|
-
Z.addProperties(this, o, a.Value);
|
3609
|
-
}), l(i);
|
3610
|
-
});
|
3611
|
-
});
|
3612
|
-
await Promise.all([e, s]), S.i18n.global.messages[t] = this[t], S.loadedLocales.push(t);
|
3613
|
-
}
|
3614
|
-
//#endregion
|
3615
|
-
//#region 切换
|
3616
|
-
/**
|
3617
|
-
* 切换语言,自动加载菜单
|
3618
|
-
*/
|
3619
|
-
async switchI18n(t) {
|
3620
|
-
S.loadedLocales.indexOf(t) == -1 && await S.loadI18n(t), S.i18n.global.locale = t;
|
3621
|
-
}
|
3622
|
-
//#endregion
|
3623
|
-
}
|
3624
3604
|
class Ls {
|
3625
3605
|
constructor() {
|
3626
3606
|
/**
|
@@ -3657,9 +3637,9 @@ class As {
|
|
3657
3637
|
n(this, "app", new Ls());
|
3658
3638
|
}
|
3659
3639
|
}
|
3660
|
-
class
|
3640
|
+
class ot {
|
3661
3641
|
}
|
3662
|
-
class
|
3642
|
+
class ut extends ot {
|
3663
3643
|
constructor() {
|
3664
3644
|
super(...arguments);
|
3665
3645
|
//#region 属性
|
@@ -3690,7 +3670,7 @@ class ct extends ut {
|
|
3690
3670
|
//#region 开启
|
3691
3671
|
open() {
|
3692
3672
|
let e = this.sys.app;
|
3693
|
-
e.background =
|
3673
|
+
e.background = de.background, e.theme = de.theme, e.layout = de.layout, e.language = de.language, e.font = de.font;
|
3694
3674
|
}
|
3695
3675
|
/**
|
3696
3676
|
* 初始化配置值(不一定跟登录用户相关,这也是单独分离的好处)
|
@@ -3698,10 +3678,10 @@ class ct extends ut {
|
|
3698
3678
|
async bind(e) {
|
3699
3679
|
for (let l of e) {
|
3700
3680
|
let i = await this.get(l.kind, l.type) ?? l.content;
|
3701
|
-
|
3681
|
+
Y.addProperties(this, [l.kind, l.type], i);
|
3702
3682
|
}
|
3703
3683
|
let s = this.sys.app;
|
3704
|
-
|
3684
|
+
R.removeClass(document.documentElement, de.theme), R.addClass(document.documentElement, s.theme), we.emit("theme", s.theme), R.addClass(document.documentElement, s.layout), this.setBackground(s.background), R.addStyle(document.documentElement, "font-family", s.font);
|
3705
3685
|
}
|
3706
3686
|
/**
|
3707
3687
|
* 尝试添加架构
|
@@ -3725,7 +3705,7 @@ class ct extends ut {
|
|
3725
3705
|
* 获取本地配置
|
3726
3706
|
*/
|
3727
3707
|
async get(e, s) {
|
3728
|
-
return await (await
|
3708
|
+
return await (await E.provider.getDefault(e)).getAsync(s);
|
3729
3709
|
}
|
3730
3710
|
/**
|
3731
3711
|
* 设置背景
|
@@ -3742,11 +3722,11 @@ class ct extends ut {
|
|
3742
3722
|
let s = this.sys.app, l = document.documentElement, r = e.layout;
|
3743
3723
|
l.classList.remove(s.layout), l.classList.add(r), s.layout = r;
|
3744
3724
|
let i = e.theme;
|
3745
|
-
|
3725
|
+
R.removeClass(l, s.theme), R.addClass(l, i), s.theme = i, we.emit("theme", i);
|
3746
3726
|
let a = e.background;
|
3747
3727
|
this.setBackground(a), we.emit("background", a);
|
3748
3728
|
let o = e.font;
|
3749
|
-
s.font = o,
|
3729
|
+
s.font = o, R.addStyle(l, "font-family", o);
|
3750
3730
|
}
|
3751
3731
|
//#region 配置
|
3752
3732
|
/**
|
@@ -3758,7 +3738,7 @@ class ct extends ut {
|
|
3758
3738
|
if (r)
|
3759
3739
|
return Promise.resolve(r);
|
3760
3740
|
}
|
3761
|
-
return
|
3741
|
+
return T.get(`/user/config?kind=${e}&type=${s}`).then((r) => {
|
3762
3742
|
let i = r.data ? JSON.parse(r.data) : null;
|
3763
3743
|
return Promise.resolve(i);
|
3764
3744
|
});
|
@@ -3767,24 +3747,24 @@ class ct extends ut {
|
|
3767
3747
|
* 全量保存用户配置
|
3768
3748
|
*/
|
3769
3749
|
async save(e, s, l, r = !0) {
|
3770
|
-
return r && await (await
|
3750
|
+
return r && await (await E.provider.getDefault(e)).saveAsync(s, l), T.post(`/user/config?kind=${e}&type=${s}`, l).then((i) => Promise.resolve(!0));
|
3771
3751
|
}
|
3772
3752
|
/**
|
3773
3753
|
* 部分保存用户配置
|
3774
3754
|
*/
|
3775
3755
|
async patch(e, s, l) {
|
3776
|
-
return
|
3756
|
+
return T.patch(`/user/config?kind=${e}&type=${s}`, l).then((r) => Promise.resolve(!0));
|
3777
3757
|
}
|
3778
3758
|
//#endregion
|
3779
3759
|
/**
|
3780
3760
|
* 获取当前语言
|
3781
3761
|
*/
|
3782
3762
|
getLanguage() {
|
3783
|
-
let e =
|
3763
|
+
let e = st.getLanguage();
|
3784
3764
|
return this.sys.app.language || e || "zh-cn";
|
3785
3765
|
}
|
3786
3766
|
}
|
3787
|
-
class
|
3767
|
+
class Ds {
|
3788
3768
|
constructor() {
|
3789
3769
|
/**
|
3790
3770
|
* 环境变量
|
@@ -3795,10 +3775,10 @@ class Is {
|
|
3795
3775
|
* 使用环境变量
|
3796
3776
|
*/
|
3797
3777
|
useEnv(t) {
|
3798
|
-
this.env = t, this.env.base =
|
3778
|
+
this.env = t, this.env.base = W.trimEnd(t.VITE_ROOT, "/");
|
3799
3779
|
}
|
3800
3780
|
}
|
3801
|
-
class
|
3781
|
+
class Is {
|
3802
3782
|
constructor() {
|
3803
3783
|
n(this, "logs", []);
|
3804
3784
|
}
|
@@ -3806,7 +3786,7 @@ class Ds {
|
|
3806
3786
|
* 手动添加日志
|
3807
3787
|
*/
|
3808
3788
|
add(t, e, s, l = null) {
|
3809
|
-
let r =
|
3789
|
+
let r = te.getTimeString();
|
3810
3790
|
this.logs.unshift({ time: r, code: t, message: e, stack: s, elapsed: l });
|
3811
3791
|
}
|
3812
3792
|
/**
|
@@ -3824,6 +3804,10 @@ class Ds {
|
|
3824
3804
|
}
|
3825
3805
|
class Os {
|
3826
3806
|
constructor() {
|
3807
|
+
/**
|
3808
|
+
* 获取侧边栏宽度
|
3809
|
+
*/
|
3810
|
+
n(this, "getSidebarWidth", () => this.web.sidebar && this.web.sidebar.width ? this.web.sidebar.width : 210);
|
3827
3811
|
if (typeof window > "u")
|
3828
3812
|
return;
|
3829
3813
|
let t = window._setting ?? window.setting;
|
@@ -3903,10 +3887,10 @@ class js {
|
|
3903
3887
|
* 加载设置
|
3904
3888
|
*/
|
3905
3889
|
async load() {
|
3906
|
-
return
|
3890
|
+
return T.get("/app/setting").then(({ data: t }) => (Object.keys(t).forEach((e) => {
|
3907
3891
|
let s = t[e];
|
3908
3892
|
s && (this[e] = s);
|
3909
|
-
}),
|
3893
|
+
}), R.addClass(document.documentElement, this.theme, De.web.theme), we.emits({ theme: this.theme }), Promise.resolve(t))).catch((t) => Promise.reject(t));
|
3910
3894
|
}
|
3911
3895
|
}
|
3912
3896
|
class Rs {
|
@@ -3937,8 +3921,8 @@ class Rs {
|
|
3937
3921
|
if (!De.api.ws)
|
3938
3922
|
return;
|
3939
3923
|
if (this.socket == null || this.reconnect) {
|
3940
|
-
let e = De.api.ws, s = new
|
3941
|
-
s.path = e, s.method = "GET", await
|
3924
|
+
let e = De.api.ws, s = new it();
|
3925
|
+
s.path = e, s.method = "GET", await T.onRequest(s);
|
3942
3926
|
let l = s.getHeader("Authorization"), r = K.encode(l), i = `${e}?authorization=${r}`;
|
3943
3927
|
this.socket = new WebSocket(i);
|
3944
3928
|
}
|
@@ -4001,19 +3985,19 @@ class _s {
|
|
4001
3985
|
* 获取本地缓存中的用户信息;好处:即使手动更改storage数据,也可以里面获取到
|
4002
3986
|
*/
|
4003
3987
|
async getSso() {
|
4004
|
-
return await (await
|
3988
|
+
return await (await E.provider.getDefault("user")).getEntity("sso");
|
4005
3989
|
}
|
4006
3990
|
/**
|
4007
3991
|
* 登录后,获取用户信息
|
4008
3992
|
*/
|
4009
3993
|
async loadInfo() {
|
4010
|
-
return
|
3994
|
+
return T.get("/user/info").then(async ({ data: t }) => (await H.bind(t.configs), this.user = t, this.debugger = t.debugger, Promise.resolve(t)));
|
4011
3995
|
}
|
4012
3996
|
/**
|
4013
3997
|
* 未登录,获取匿名登录信息
|
4014
3998
|
*/
|
4015
3999
|
async getAnonymous() {
|
4016
|
-
await
|
4000
|
+
await H.bind([]);
|
4017
4001
|
}
|
4018
4002
|
/**
|
4019
4003
|
* 根据路径获取路由
|
@@ -4026,20 +4010,20 @@ class _s {
|
|
4026
4010
|
* 加载服务端路由
|
4027
4011
|
*/
|
4028
4012
|
async loadMenus() {
|
4029
|
-
return
|
4013
|
+
return T.get("/user/menu").then(({ data: t }) => (this.menus = t, this.menusFlat = Oe.getFlat(t, "children"), Promise.resolve(t)));
|
4030
4014
|
}
|
4031
4015
|
/**
|
4032
4016
|
* 退出登录
|
4033
4017
|
*/
|
4034
4018
|
async logout() {
|
4035
|
-
return
|
4019
|
+
return T.post("/user/logout").then(async () => {
|
4036
4020
|
this.user = null, this.menus = null;
|
4037
4021
|
let t = await this.getSso();
|
4038
|
-
return await (await
|
4022
|
+
return await (await E.sso.create(t.type)).logout(), Us.disconnect(), Promise.resolve();
|
4039
4023
|
});
|
4040
4024
|
}
|
4041
4025
|
}
|
4042
|
-
class
|
4026
|
+
class ct extends ot {
|
4043
4027
|
constructor() {
|
4044
4028
|
super(...arguments);
|
4045
4029
|
//#region 属性
|
@@ -4073,7 +4057,7 @@ class dt extends ut {
|
|
4073
4057
|
*/
|
4074
4058
|
async loadApps(e = !1) {
|
4075
4059
|
if (!this.loading.apps && !(!e && this.loaded.apps))
|
4076
|
-
return this.loading.apps = !0,
|
4060
|
+
return this.loading.apps = !0, T.post("/app/options").then((s) => {
|
4077
4061
|
this.apps = s.data, this.loaded.apps = !0;
|
4078
4062
|
}).finally(() => {
|
4079
4063
|
this.loading.apps = !1;
|
@@ -4084,18 +4068,18 @@ class dt extends ut {
|
|
4084
4068
|
*/
|
4085
4069
|
async loadEnvs(e = !1) {
|
4086
4070
|
if (!this.loading.envs && (this.loading.envs = !0, !(!e && this.loaded.envs)))
|
4087
|
-
return
|
4071
|
+
return T.post("/env/options").then((s) => {
|
4088
4072
|
this.envs = s.data, this.loaded.envs = !0;
|
4089
4073
|
}).finally(() => {
|
4090
4074
|
this.loading.envs = !1;
|
4091
4075
|
});
|
4092
4076
|
}
|
4093
4077
|
}
|
4094
|
-
class Bs extends
|
4078
|
+
class Bs extends B {
|
4095
4079
|
open() {
|
4096
4080
|
super.open(), super.instances = [
|
4097
|
-
new
|
4098
|
-
new
|
4081
|
+
new ut(),
|
4082
|
+
new ct()
|
4099
4083
|
];
|
4100
4084
|
}
|
4101
4085
|
static() {
|
@@ -4108,42 +4092,31 @@ class Bs extends F {
|
|
4108
4092
|
return await super.createIfAbsent("Config");
|
4109
4093
|
}
|
4110
4094
|
}
|
4111
|
-
let
|
4112
|
-
|
4113
|
-
}
|
4114
|
-
|
4115
|
-
t_exists: Vs,
|
4116
|
-
t_sys: qs,
|
4117
|
-
t_enum: zs,
|
4118
|
-
t_field: Ks,
|
4119
|
-
t_field_choose_placeholder: Ws,
|
4120
|
-
t_field_placeholder: Qs,
|
4121
|
-
t_table: Js,
|
4122
|
-
t_module: Xs,
|
4123
|
-
t_menu: Ys
|
4124
|
-
} = X;
|
4125
|
-
class Gs extends F {
|
4095
|
+
let H = new ut(), sr = Ge(new ct()), lr = new Ds(), Ps = new Is(), de = Ge(new js()), Us = new Rs(), Fs = new _s(), Ms = async (u) => {
|
4096
|
+
H.open();
|
4097
|
+
};
|
4098
|
+
class Ns extends B {
|
4126
4099
|
/**
|
4127
4100
|
* 获取实例
|
4128
4101
|
*/
|
4129
4102
|
get instances() {
|
4130
|
-
return [new
|
4103
|
+
return [new $s(), new Ss(), new Es(), new ks(), new Ts()];
|
4131
4104
|
}
|
4132
4105
|
/**
|
4133
4106
|
* 获取指定SSO实例
|
4134
4107
|
*/
|
4135
4108
|
async create(t, e) {
|
4136
|
-
let s =
|
4109
|
+
let s = de.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);
|
4137
4110
|
return await r.open(l), r;
|
4138
4111
|
}
|
4139
4112
|
}
|
4140
|
-
class
|
4113
|
+
class Vs {
|
4141
4114
|
constructor() {
|
4142
4115
|
n(this, "type");
|
4143
4116
|
n(this, "taskLimit");
|
4144
4117
|
}
|
4145
4118
|
}
|
4146
|
-
class
|
4119
|
+
class qs extends Vs {
|
4147
4120
|
constructor() {
|
4148
4121
|
super(...arguments);
|
4149
4122
|
//#region 属性
|
@@ -4161,7 +4134,7 @@ class Hs extends Zs {
|
|
4161
4134
|
async execute(e, s, l) {
|
4162
4135
|
if (e.length == 0)
|
4163
4136
|
return;
|
4164
|
-
let r =
|
4137
|
+
let r = ue.getChunksByCount(e, s), i = ue.create(r, (a, o) => l(a, o));
|
4165
4138
|
await Promise.all(i);
|
4166
4139
|
}
|
4167
4140
|
async executeFrequency(e, s, l, r) {
|
@@ -4197,42 +4170,42 @@ class Hs extends Zs {
|
|
4197
4170
|
clearInterval(this.intervalTimeout);
|
4198
4171
|
}
|
4199
4172
|
}
|
4200
|
-
class
|
4173
|
+
class zs extends B {
|
4201
4174
|
get instances() {
|
4202
|
-
return [new
|
4175
|
+
return [new qs()];
|
4203
4176
|
}
|
4204
4177
|
}
|
4205
|
-
class
|
4178
|
+
class Ks {
|
4206
4179
|
constructor() {
|
4207
4180
|
n(this, "type");
|
4208
4181
|
}
|
4209
4182
|
}
|
4210
|
-
class
|
4183
|
+
class Ws extends Ks {
|
4211
4184
|
constructor() {
|
4212
4185
|
super(...arguments);
|
4213
4186
|
n(this, "type", "Liquid");
|
4214
4187
|
}
|
4215
4188
|
async render(e, s) {
|
4216
|
-
let l = new
|
4189
|
+
let l = new Dt(), r = l.parse(e);
|
4217
4190
|
return await l.render(r, s);
|
4218
4191
|
}
|
4219
4192
|
}
|
4220
|
-
class
|
4193
|
+
class Qs extends B {
|
4221
4194
|
get instances() {
|
4222
|
-
return [new
|
4195
|
+
return [new Ws()];
|
4223
4196
|
}
|
4224
4197
|
}
|
4225
|
-
class rr extends
|
4198
|
+
class rr extends B {
|
4226
4199
|
get instances() {
|
4227
4200
|
return [];
|
4228
4201
|
}
|
4229
4202
|
}
|
4230
|
-
class
|
4203
|
+
class dt {
|
4231
4204
|
constructor() {
|
4232
4205
|
n(this, "type");
|
4233
4206
|
}
|
4234
4207
|
}
|
4235
|
-
class
|
4208
|
+
class Js extends dt {
|
4236
4209
|
constructor() {
|
4237
4210
|
super(...arguments);
|
4238
4211
|
n(this, "type", "Tencent");
|
@@ -4253,7 +4226,7 @@ class rl extends pt {
|
|
4253
4226
|
startRecord() {
|
4254
4227
|
}
|
4255
4228
|
}
|
4256
|
-
class
|
4229
|
+
class Xs extends dt {
|
4257
4230
|
constructor() {
|
4258
4231
|
super(...arguments);
|
4259
4232
|
n(this, "type", "Default");
|
@@ -4267,104 +4240,102 @@ class nl extends pt {
|
|
4267
4240
|
return "";
|
4268
4241
|
}
|
4269
4242
|
}
|
4270
|
-
class nr extends
|
4243
|
+
class nr extends B {
|
4271
4244
|
get instances() {
|
4272
|
-
return [new
|
4245
|
+
return [new Xs(), new Js()];
|
4273
4246
|
}
|
4274
4247
|
}
|
4275
4248
|
class ht {
|
4276
|
-
/**
|
4277
|
-
* 并缓存工厂实例
|
4278
|
-
*/
|
4279
|
-
static create(t) {
|
4280
|
-
let e = t.name, s = this.mappings[e];
|
4281
|
-
return s || (s = new t(), s.open(), this.mappings[e] = s), s;
|
4282
|
-
}
|
4283
|
-
//#endregion
|
4284
4249
|
//#region 驱动工厂
|
4285
4250
|
/**
|
4286
4251
|
* Builder工厂
|
4287
4252
|
*/
|
4288
4253
|
static get builder() {
|
4289
|
-
return this.create(
|
4254
|
+
return this.create(qt);
|
4290
4255
|
}
|
4291
4256
|
/**
|
4292
4257
|
* CDN工厂
|
4293
4258
|
*/
|
4294
4259
|
static get cdn() {
|
4295
|
-
return this.create(
|
4260
|
+
return this.create(Wt);
|
4296
4261
|
}
|
4297
4262
|
/**
|
4298
4263
|
* 编码器工厂
|
4299
4264
|
*/
|
4300
4265
|
static get encoder() {
|
4301
|
-
return this.create(
|
4266
|
+
return this.create(Xt);
|
4302
4267
|
}
|
4303
4268
|
/**
|
4304
4269
|
* Excel工厂
|
4305
4270
|
*/
|
4306
4271
|
static get excel() {
|
4307
|
-
return this.create(
|
4272
|
+
return this.create(Zt);
|
4308
4273
|
}
|
4309
4274
|
/**
|
4310
4275
|
* Explainer工厂
|
4311
4276
|
*/
|
4312
4277
|
static get explainer() {
|
4313
|
-
return this.create(
|
4278
|
+
return this.create(ts);
|
4314
4279
|
}
|
4315
4280
|
/**
|
4316
4281
|
* 特征工厂
|
4317
4282
|
*/
|
4318
4283
|
static get feature() {
|
4319
|
-
return this.create(
|
4284
|
+
return this.create(ns);
|
4320
4285
|
}
|
4321
4286
|
/**
|
4322
4287
|
* 哈希工厂
|
4323
4288
|
*/
|
4324
4289
|
static get hasher() {
|
4325
|
-
return this.create(
|
4290
|
+
return this.create(os);
|
4326
4291
|
}
|
4327
4292
|
/**
|
4328
4293
|
* Http请求工厂
|
4329
4294
|
*/
|
4330
4295
|
static get http() {
|
4331
|
-
return this.create(
|
4296
|
+
return this.create(hs);
|
4297
|
+
}
|
4298
|
+
/**
|
4299
|
+
* 多语言工厂
|
4300
|
+
*/
|
4301
|
+
static get i18n() {
|
4302
|
+
return this.create(gs);
|
4332
4303
|
}
|
4333
4304
|
/**
|
4334
4305
|
* 消息提示请求工厂
|
4335
4306
|
*/
|
4336
4307
|
static get messenger() {
|
4337
|
-
return this.create(
|
4308
|
+
return this.create(vs);
|
4338
4309
|
}
|
4339
4310
|
/**
|
4340
4311
|
* 提供程序工厂
|
4341
4312
|
*/
|
4342
4313
|
static get provider() {
|
4343
|
-
return this.create(
|
4314
|
+
return this.create(Nt);
|
4344
4315
|
}
|
4345
4316
|
/**
|
4346
4317
|
* 签名工厂
|
4347
4318
|
*/
|
4348
4319
|
static get signer() {
|
4349
|
-
return this.create(
|
4320
|
+
return this.create(xs);
|
4350
4321
|
}
|
4351
4322
|
/**
|
4352
4323
|
* SSO工厂
|
4353
4324
|
*/
|
4354
4325
|
static get sso() {
|
4355
|
-
return this.create(
|
4326
|
+
return this.create(Ns);
|
4356
4327
|
}
|
4357
4328
|
/**
|
4358
4329
|
* Task工厂
|
4359
4330
|
*/
|
4360
4331
|
static get task() {
|
4361
|
-
return this.create(
|
4332
|
+
return this.create(zs);
|
4362
4333
|
}
|
4363
4334
|
/**
|
4364
4335
|
* 模板工厂
|
4365
4336
|
*/
|
4366
4337
|
static get template() {
|
4367
|
-
return this.create(
|
4338
|
+
return this.create(Qs);
|
4368
4339
|
}
|
4369
4340
|
//#endregion
|
4370
4341
|
//#region 服务工厂
|
@@ -4374,58 +4345,68 @@ class ht {
|
|
4374
4345
|
static get svc() {
|
4375
4346
|
return this.create(Bs);
|
4376
4347
|
}
|
4348
|
+
/**
|
4349
|
+
* 并缓存工厂实例
|
4350
|
+
*/
|
4351
|
+
static create(t) {
|
4352
|
+
let e = t.name, s = this.mappings[e];
|
4353
|
+
return s || (s = new t(), s.open(), this.mappings[e] = s), s;
|
4354
|
+
}
|
4377
4355
|
//#endregion
|
4378
4356
|
}
|
4357
|
+
//#endregion
|
4379
4358
|
//#region 缓存
|
4380
4359
|
/**
|
4381
4360
|
* 工厂缓存
|
4382
4361
|
*/
|
4383
4362
|
n(ht, "mappings", {});
|
4384
|
-
const
|
4385
|
-
let
|
4386
|
-
let e = await (await
|
4387
|
-
(e == null ? void 0 : e.cdn) != null && (u.cdn = e.cdn),
|
4388
|
-
}
|
4389
|
-
|
4363
|
+
const E = ht;
|
4364
|
+
let Ys = {}, me = {}, T = {}, J = {}, pt = {}, Gs = {}, ve = {}, Zs = async (u) => {
|
4365
|
+
let e = await (await E.provider.getDefault("sys")).getAsync("app");
|
4366
|
+
(e == null ? void 0 : e.cdn) != null && (u.cdn = e.cdn), me = await E.cdn.createIfAbsent("Default", u.cdn), Ys = await E.encoder.getBase64(), T = await E.http.getHalo(), J = await E.i18n.getDefault(), J.addMessages(u.lang), pt = await E.hasher.getMd5(), Gs = await E.template.create("Liquid"), u.messenger == null ? ve = await E.messenger.getConsole() : ve = u.messenger;
|
4367
|
+
}, Hs = async () => {
|
4368
|
+
el = J.t, tl = J.t_exists, sl = J.t_sys, ll = J.t_enum, rl = J.t_field, nl = J.t_field_choose_placeholder, il = J.t_field_placeholder, al = J.t_table, ol = J.t_module, ul = J.t_menu, await J.loadI18n();
|
4369
|
+
}, el = {}, tl = {}, sl = {}, ll = {}, rl = {}, nl = {}, il = {}, al = {}, ol = {}, ul = {};
|
4370
|
+
class cl {
|
4390
4371
|
constructor() {
|
4391
4372
|
/**
|
4392
4373
|
* 消息发送对象
|
4393
4374
|
*/
|
4394
4375
|
n(this, "messenger");
|
4395
|
-
/**
|
4396
|
-
* 实际的多语言翻译服务实体
|
4397
|
-
*/
|
4398
|
-
n(this, "i18nSvc");
|
4399
4376
|
/**
|
4400
4377
|
* 基准请求地址
|
4401
4378
|
*/
|
4402
4379
|
n(this, "baseUrl");
|
4380
|
+
/**
|
4381
|
+
* 自定义语言包
|
4382
|
+
*/
|
4383
|
+
n(this, "lang");
|
4403
4384
|
/**
|
4404
4385
|
* CDN类型
|
4405
4386
|
*/
|
4406
4387
|
n(this, "cdn", "Local");
|
4407
4388
|
}
|
4408
4389
|
}
|
4409
|
-
const
|
4390
|
+
const dl = { class: "ha-empty" }, hl = { class: "empty-message" }, pl = {
|
4410
4391
|
key: 0,
|
4411
4392
|
class: "empty-content"
|
4412
|
-
}, ir = /* @__PURE__ */
|
4393
|
+
}, ir = /* @__PURE__ */ Q({
|
4413
4394
|
__name: "Empty",
|
4414
4395
|
props: {
|
4415
4396
|
message: { type: String, default: "暂无数据" },
|
4416
4397
|
hasData: Boolean
|
4417
4398
|
},
|
4418
4399
|
setup(u) {
|
4419
|
-
let t = u, { message: e, hasData: s } =
|
4420
|
-
return (l, r) => (
|
4421
|
-
D("div",
|
4422
|
-
y(s) ? (
|
4423
|
-
|
4424
|
-
])) :
|
4400
|
+
let t = u, { message: e, hasData: s } = se(t);
|
4401
|
+
return (l, r) => (O(), _("div", dl, [
|
4402
|
+
D("div", hl, pe(y(e)), 1),
|
4403
|
+
y(s) ? (O(), _("div", pl, [
|
4404
|
+
fe(l.$slots, "default")
|
4405
|
+
])) : Ze("", !0)
|
4425
4406
|
]));
|
4426
4407
|
}
|
4427
4408
|
});
|
4428
|
-
class
|
4409
|
+
class ft {
|
4429
4410
|
constructor(t, e) {
|
4430
4411
|
/**
|
4431
4412
|
* 距窗口左边的距离
|
@@ -4438,7 +4419,7 @@ class gt {
|
|
4438
4419
|
this.x = t, this.y = e;
|
4439
4420
|
}
|
4440
4421
|
}
|
4441
|
-
class
|
4422
|
+
class fl extends ft {
|
4442
4423
|
constructor() {
|
4443
4424
|
super(...arguments);
|
4444
4425
|
/**
|
@@ -4447,7 +4428,7 @@ class hl extends gt {
|
|
4447
4428
|
n(this, "affix");
|
4448
4429
|
}
|
4449
4430
|
}
|
4450
|
-
class ar extends
|
4431
|
+
class ar extends ft {
|
4451
4432
|
constructor(e, s, l, r) {
|
4452
4433
|
super(e, s);
|
4453
4434
|
n(this, "width");
|
@@ -4455,7 +4436,7 @@ class ar extends gt {
|
|
4455
4436
|
this.width = l, this.height = r;
|
4456
4437
|
}
|
4457
4438
|
}
|
4458
|
-
class
|
4439
|
+
class gt {
|
4459
4440
|
constructor() {
|
4460
4441
|
//#region 大小调整
|
4461
4442
|
n(this, "resizeObserver", null);
|
@@ -4502,8 +4483,8 @@ class mt {
|
|
4502
4483
|
* 事件防抖: time ms没重复触发才执行指定操作
|
4503
4484
|
*/
|
4504
4485
|
n(this, "debounce", (t, e, s = null) => {
|
4505
|
-
this.lastDebounceTime == null && (this.lastDebounceTime =
|
4506
|
-
let l =
|
4486
|
+
this.lastDebounceTime == null && (this.lastDebounceTime = te.getTimestamp());
|
4487
|
+
let l = te.getTimestamp();
|
4507
4488
|
this.lastDebounceTimeout != null && clearTimeout(this.lastDebounceTimeout), this.lastDebounceTimeout = setTimeout(t, e, s), this.lastDebounceTime = l;
|
4508
4489
|
});
|
4509
4490
|
//#endregion
|
@@ -4544,18 +4525,18 @@ class mt {
|
|
4544
4525
|
return;
|
4545
4526
|
this.dragElement = t;
|
4546
4527
|
let s = !1, l = (a) => (s = !0, a.preventDefault(), e.init(a)), r = (a) => {
|
4547
|
-
let o = new
|
4528
|
+
let o = new fl(), c = e.range;
|
4548
4529
|
if (c == null)
|
4549
4530
|
o.x = a.clientX, o.y = a.clientY;
|
4550
4531
|
else {
|
4551
|
-
let { x:
|
4552
|
-
a.clientX <
|
4532
|
+
let { x: h, y: d, width: p, height: g } = c;
|
4533
|
+
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;
|
4553
4534
|
}
|
4554
4535
|
if (e.affix) {
|
4555
4536
|
if (e.range == null)
|
4556
4537
|
throw new Error("设置吸附距离时,必须设置范围信息");
|
4557
|
-
let
|
4558
|
-
o.x <= e.affix ? o.affix = "left" : o.x >=
|
4538
|
+
let h = c.x + c.width, d = c.y + c.height;
|
4539
|
+
o.x <= e.affix ? o.affix = "left" : o.x >= h - e.affix ? o.affix = "right" : o.y >= c.y && o.y <= c.y + e.affix ? o.affix = "top" : o.y >= d - e.affix && o.y <= d && (o.affix = "bottom");
|
4559
4540
|
}
|
4560
4541
|
e.handler(o, this.dragStart, this.dragStartData, s, a), s = !1;
|
4561
4542
|
}, i = (a) => {
|
@@ -4753,7 +4734,7 @@ class cr {
|
|
4753
4734
|
* 根据鼠标事件,显示右键上下文弹窗
|
4754
4735
|
*/
|
4755
4736
|
n(this, "show", (t) => {
|
4756
|
-
let s =
|
4737
|
+
let s = R.parentAbsolute(this.container).getBoundingClientRect(), l = t.clientX - s.left, r = t.clientY - s.top - 2;
|
4757
4738
|
this.container.style.display = "block", this.container.style.left = l + "px", this.container.style.top = r + "px";
|
4758
4739
|
});
|
4759
4740
|
/**
|
@@ -4762,7 +4743,7 @@ class cr {
|
|
4762
4743
|
n(this, "dispose", () => {
|
4763
4744
|
for (let t = 0; t < this.closeTriggers.length; t++) {
|
4764
4745
|
let e = this.closeTriggers[t];
|
4765
|
-
|
4746
|
+
ae.unbind(["click", "scroll"], e, this.close);
|
4766
4747
|
}
|
4767
4748
|
this.container != null && this.container.removeEventListener("click", this.close), this.container = null, this.closeTriggers = [];
|
4768
4749
|
});
|
@@ -4770,153 +4751,169 @@ class cr {
|
|
4770
4751
|
this.closeTriggers.push(...e);
|
4771
4752
|
for (let s = 0; s < this.closeTriggers.length; s++) {
|
4772
4753
|
let l = this.closeTriggers[s];
|
4773
|
-
|
4754
|
+
ae.bind(["click", "scroll"], l, this.close);
|
4774
4755
|
}
|
4775
4756
|
}
|
4776
4757
|
}
|
4777
4758
|
}
|
4778
|
-
|
4759
|
+
class dr {
|
4760
|
+
/**
|
4761
|
+
* 开启表单监控
|
4762
|
+
*/
|
4763
|
+
async open(t, e, s) {
|
4764
|
+
let l = await E.provider.getDefault(e), r = await l.getAsync(s);
|
4765
|
+
r && Y.mergeTo(t, r), X(() => t, (i, a) => {
|
4766
|
+
l && l.saveAsync(s, t);
|
4767
|
+
}, { deep: !0 });
|
4768
|
+
}
|
4769
|
+
/**
|
4770
|
+
* 资源释放
|
4771
|
+
*/
|
4772
|
+
dispose() {
|
4773
|
+
}
|
4774
|
+
}
|
4775
|
+
const gl = /* @__PURE__ */ Q({
|
4779
4776
|
__name: "Fill",
|
4780
4777
|
emits: ["resize"],
|
4781
4778
|
setup(u, { emit: t }) {
|
4782
|
-
let e = t, s =
|
4783
|
-
let
|
4784
|
-
r.value =
|
4779
|
+
let e = t, s = I(), l = I(), r = I(), i = new gt(), a = () => {
|
4780
|
+
let h = R.siblings(s.value);
|
4781
|
+
r.value = R.getHeight(h);
|
4785
4782
|
}, o = () => {
|
4786
|
-
l.value =
|
4783
|
+
l.value = R.getHeight(s.value), e("resize", l.value);
|
4787
4784
|
}, c = () => {
|
4788
4785
|
o();
|
4789
4786
|
};
|
4790
|
-
return
|
4787
|
+
return be(() => {
|
4791
4788
|
a(), o(), i.resize(s.value, c);
|
4792
|
-
}),
|
4789
|
+
}), xe(() => {
|
4793
4790
|
i.dispose();
|
4794
|
-
}), (
|
4791
|
+
}), (h, d) => (O(), _("div", {
|
4795
4792
|
class: "ha-fill",
|
4796
4793
|
ref_key: "fillRef",
|
4797
4794
|
ref: s,
|
4798
|
-
style:
|
4795
|
+
style: ge({ height: `calc(100% - ${y(r)}px)` })
|
4799
4796
|
}, [
|
4800
|
-
|
4797
|
+
fe(h.$slots, "default")
|
4801
4798
|
], 4));
|
4802
4799
|
}
|
4803
|
-
}),
|
4800
|
+
}), ml = /* @__PURE__ */ Q({
|
4804
4801
|
__name: "Scroller",
|
4805
4802
|
props: {
|
4806
4803
|
options: {}
|
4807
4804
|
},
|
4808
4805
|
emits: ["scroll"],
|
4809
4806
|
setup(u, { expose: t, emit: e }) {
|
4810
|
-
let s = e, l = u, { options: r } =
|
4811
|
-
if (
|
4807
|
+
let s = e, l = u, { options: r } = se(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 }), N = (v) => {
|
4808
|
+
if (p == 0)
|
4812
4809
|
return 0;
|
4813
|
-
let
|
4814
|
-
return v /
|
4810
|
+
let w = p - d;
|
4811
|
+
return v / w;
|
4815
4812
|
}, V = (v) => {
|
4816
|
-
let
|
4817
|
-
return v /
|
4818
|
-
},
|
4819
|
-
let
|
4820
|
-
|
4821
|
-
},
|
4822
|
-
if (
|
4813
|
+
let w = d - b.value.height;
|
4814
|
+
return v / w;
|
4815
|
+
}, ce = (v) => {
|
4816
|
+
let w = v.target, j = N(w.scrollTop);
|
4817
|
+
L(j), s("scroll", w);
|
4818
|
+
}, le = () => {
|
4819
|
+
if (p == 0)
|
4823
4820
|
return 80;
|
4824
|
-
let v = d /
|
4821
|
+
let v = d / p;
|
4825
4822
|
if (v == 1)
|
4826
4823
|
return 0;
|
4827
|
-
let
|
4828
|
-
return
|
4829
|
-
}, f = (v,
|
4830
|
-
let
|
4831
|
-
return
|
4824
|
+
let w = d * v;
|
4825
|
+
return ne.between(w, 80, 500);
|
4826
|
+
}, f = (v, w) => {
|
4827
|
+
let j = N(v), q = (d - w) * j;
|
4828
|
+
return ne.between(q, 0, d - w);
|
4832
4829
|
}, C = (v) => {
|
4833
|
-
let
|
4834
|
-
return { top: f(v,
|
4830
|
+
let w = le();
|
4831
|
+
return { top: f(v, w), height: w };
|
4835
4832
|
}, m = (v) => {
|
4833
|
+
}, $ = (v) => {
|
4834
|
+
let w = N(v);
|
4835
|
+
L(w);
|
4836
4836
|
}, L = (v) => {
|
4837
|
-
let
|
4838
|
-
|
4839
|
-
|
4840
|
-
|
4841
|
-
w.value.top = R * b;
|
4842
|
-
let ve = (h - d) * b;
|
4843
|
-
r.value.scrollTop = ve, a.value.scrollTop != ve && (a.value.scrollTop = ve);
|
4837
|
+
let w = ne.between(v, 0, 1), j = d - b.value.height;
|
4838
|
+
b.value.top = j * w;
|
4839
|
+
let ye = (p - d) * w;
|
4840
|
+
r.value.scrollTop = ye, a.value.scrollTop != ye && (a.value.scrollTop = ye);
|
4844
4841
|
}, P = () => {
|
4845
4842
|
let v = r.value.scrollTop;
|
4846
|
-
|
4847
|
-
},
|
4848
|
-
d =
|
4849
|
-
let
|
4850
|
-
|
4851
|
-
},
|
4852
|
-
let
|
4853
|
-
return parseInt(
|
4854
|
-
},
|
4855
|
-
let
|
4856
|
-
|
4843
|
+
b.value = C(v), $(v);
|
4844
|
+
}, Z = (v) => {
|
4845
|
+
d = R.getHeight(a.value), p = a.value.scrollHeight;
|
4846
|
+
let w = le();
|
4847
|
+
b.value.height = w, b.value.top = f(r.value.scrollTop, w);
|
4848
|
+
}, ie = (v) => {
|
4849
|
+
let w = v.target;
|
4850
|
+
return parseInt(w.style.top);
|
4851
|
+
}, re = (v, w, j, q) => {
|
4852
|
+
let ye = v.y - w.y, mt = j + ye, yt = V(mt);
|
4853
|
+
L(yt);
|
4857
4854
|
}, ke = (v) => {
|
4858
|
-
|
4859
|
-
},
|
4860
|
-
|
4855
|
+
h.value = !0;
|
4856
|
+
}, Se = (v) => {
|
4857
|
+
h.value = !1;
|
4861
4858
|
};
|
4862
|
-
return
|
4863
|
-
P(), g.scroll(a.value,
|
4864
|
-
}),
|
4859
|
+
return be(() => {
|
4860
|
+
P(), g.scroll(a.value, ce), g.drag(c.value, { init: ie, handler: re }), g.observe(a.value, Z), g.mouseDown(c.value, ke, Se);
|
4861
|
+
}), xe(() => {
|
4865
4862
|
g.dispose();
|
4866
|
-
}),
|
4867
|
-
let
|
4868
|
-
|
4869
|
-
}), t({ scrollTo:
|
4863
|
+
}), X(() => r.value.scrollTop, (v, w) => {
|
4864
|
+
let j = N(v);
|
4865
|
+
L(j);
|
4866
|
+
}), t({ scrollTo: $, update: P }), (v, w) => (O(), _("div", {
|
4870
4867
|
ref_key: "scrollerRef",
|
4871
4868
|
ref: i,
|
4872
|
-
class:
|
4869
|
+
class: Ae(["ha-scroller", { hover: y(h) }])
|
4873
4870
|
}, [
|
4874
4871
|
D("div", {
|
4875
4872
|
ref_key: "containerRef",
|
4876
4873
|
ref: a,
|
4877
4874
|
class: "scroller-container"
|
4878
4875
|
}, [
|
4879
|
-
|
4876
|
+
fe(v.$slots, "default")
|
4880
4877
|
], 512),
|
4881
4878
|
D("div", {
|
4882
4879
|
ref_key: "trackRef",
|
4883
4880
|
ref: o,
|
4884
4881
|
class: "scroller-track",
|
4885
|
-
onClick:
|
4886
|
-
(...
|
4882
|
+
onClick: w[0] || (w[0] = //@ts-ignore
|
4883
|
+
(...j) => y(m) && y(m)(...j))
|
4887
4884
|
}, [
|
4888
4885
|
D("div", {
|
4889
4886
|
ref_key: "thumbRef",
|
4890
4887
|
ref: c,
|
4891
4888
|
class: "scroller-thumb",
|
4892
|
-
style:
|
4893
|
-
},
|
4889
|
+
style: ge({ top: `${y(b).top}px`, height: `${y(b).height}px` })
|
4890
|
+
}, pe(y(r).scrollTop), 5)
|
4894
4891
|
], 512)
|
4895
4892
|
], 2));
|
4896
4893
|
}
|
4897
|
-
}),
|
4894
|
+
}), hr = /* @__PURE__ */ Q({
|
4898
4895
|
__name: "Timer",
|
4899
4896
|
emits: ["change"],
|
4900
4897
|
setup(u, { expose: t, emit: e }) {
|
4901
|
-
let s = e, l = -8 * 60 * 60 * 1e3, r =
|
4898
|
+
let s = e, l = -8 * 60 * 60 * 1e3, r = I(l), i = null, a = 5, o = () => {
|
4902
4899
|
i == null && (i = setInterval(() => {
|
4903
4900
|
r.value += a, s("change", r.value);
|
4904
4901
|
}, a));
|
4905
4902
|
}, c = () => {
|
4906
4903
|
d(), o();
|
4907
|
-
},
|
4904
|
+
}, h = () => {
|
4908
4905
|
clearInterval(i), i = null;
|
4909
4906
|
}, d = () => {
|
4910
4907
|
clearInterval(i), r.value = l;
|
4911
4908
|
};
|
4912
|
-
return
|
4909
|
+
return xe(() => {
|
4913
4910
|
clearInterval(i);
|
4914
|
-
}), t({ restart: c, start: o, stop:
|
4915
|
-
|
4916
|
-
|
4911
|
+
}), t({ restart: c, start: o, stop: h, reset: d }), (p, g) => (O(), _("span", null, [
|
4912
|
+
fe(p.$slots, "default"),
|
4913
|
+
xt(pe(y(te).format(y(r), "HH:mm:ss SSS")), 1)
|
4917
4914
|
]));
|
4918
4915
|
}
|
4919
|
-
}), pr = /* @__PURE__ */
|
4916
|
+
}), pr = /* @__PURE__ */ Q({
|
4920
4917
|
__name: "Code",
|
4921
4918
|
props: {
|
4922
4919
|
config: { default: {} },
|
@@ -4925,57 +4922,57 @@ const fl = /* @__PURE__ */ J({
|
|
4925
4922
|
},
|
4926
4923
|
emits: ["mounted", "change", "scroll", "update:modelValue"],
|
4927
4924
|
setup(u, { expose: t, emit: e }) {
|
4928
|
-
let s = e, l = u, { config: r, border: i, modelValue: a } =
|
4929
|
-
if (
|
4925
|
+
let s = e, l = u, { config: r, border: i, modelValue: a } = se(l), o = null, c = null, h = null, d = I(), { app: p } = H.sys, g = (f) => f == "default" ? null : "vs-dark", b = (f) => {
|
4926
|
+
if (H.editor.completions[f])
|
4930
4927
|
return;
|
4931
|
-
let C = o.languages.getLanguages().find((
|
4928
|
+
let C = o.languages.getLanguages().find(($) => $.id == f);
|
4932
4929
|
if (!C)
|
4933
4930
|
return;
|
4934
4931
|
let m = C.loader;
|
4935
|
-
m && m().then((
|
4936
|
-
|
4932
|
+
m && m().then(($) => {
|
4933
|
+
H.editor.completions[f] || (N($, f), H.editor.completions[f] = !0);
|
4937
4934
|
});
|
4938
4935
|
}, N = (f, C) => o.languages.registerCompletionItemProvider(C, {
|
4939
|
-
provideCompletionItems: (L
|
4940
|
-
let P =
|
4941
|
-
startLineNumber:
|
4942
|
-
endLineNumber:
|
4936
|
+
provideCompletionItems: ($, L) => {
|
4937
|
+
let P = $.getWordUntilPosition(L), Z = {
|
4938
|
+
startLineNumber: L.lineNumber,
|
4939
|
+
endLineNumber: L.lineNumber,
|
4943
4940
|
startColumn: P.startColumn,
|
4944
4941
|
endColumn: P.endColumn
|
4945
|
-
},
|
4946
|
-
const
|
4947
|
-
for (let ke = 0; ke <
|
4948
|
-
const
|
4949
|
-
let v = f.language[
|
4950
|
-
v && v.forEach((
|
4951
|
-
let
|
4952
|
-
label:
|
4942
|
+
}, ie = [];
|
4943
|
+
const re = ["builtinFunctions", "keywords", "operators"];
|
4944
|
+
for (let ke = 0; ke < re.length; ke++) {
|
4945
|
+
const Se = re[ke];
|
4946
|
+
let v = f.language[Se];
|
4947
|
+
v && v.forEach((w) => {
|
4948
|
+
let j = w.toLowerCase(), q = {
|
4949
|
+
label: j,
|
4953
4950
|
kind: null,
|
4954
|
-
insertText:
|
4955
|
-
range:
|
4956
|
-
documentation:
|
4951
|
+
insertText: j,
|
4952
|
+
range: Z,
|
4953
|
+
documentation: w
|
4957
4954
|
};
|
4958
|
-
|
4955
|
+
Se == "keywords" ? (q.kind = o.languages.CompletionItemKind.Keyword, q.detail = "关键词") : Se == "operators" ? (q.kind = o.languages.CompletionItemKind.Operator, q.insertText += " ", q.detail = "操作符") : (q.kind = o.languages.CompletionItemKind.Function, q.insertText += "()", q.detail = "函数"), ie.push(q);
|
4959
4956
|
});
|
4960
4957
|
}
|
4961
|
-
return { suggestions:
|
4958
|
+
return { suggestions: ie };
|
4962
4959
|
}
|
4963
4960
|
}), V = () => {
|
4964
4961
|
let f = null;
|
4965
|
-
r.value.schema && (f = r.value.category + "/" +
|
4962
|
+
r.value.schema && (f = r.value.category + "/" + W.getUniqueId(), H.tryAddSchema(f, r.value.category, r.value.schema));
|
4966
4963
|
let C = {
|
4967
4964
|
validate: !0,
|
4968
4965
|
allowComments: !0,
|
4969
4966
|
//允许配置注释
|
4970
4967
|
//保证架构配置在当前控件生效,所以需要绑定匹配哪个文件时使用架构
|
4971
|
-
schemas:
|
4968
|
+
schemas: Y.clone(H.editor.schemas),
|
4972
4969
|
trailingCommas: "ignore"
|
4973
4970
|
//允许末尾逗号
|
4974
4971
|
};
|
4975
|
-
o.languages.json.jsonDefaults.setDiagnosticsOptions(C),
|
4972
|
+
o.languages.json.jsonDefaults.setDiagnosticsOptions(C), b(r.value.language);
|
4976
4973
|
let m = f ? o.Uri.parse(f) : null;
|
4977
|
-
|
4978
|
-
let
|
4974
|
+
h = o.editor.createModel(a.value, r.value.language, m);
|
4975
|
+
let $ = {
|
4979
4976
|
tabSize: 2,
|
4980
4977
|
//Tab缩进大小
|
4981
4978
|
detectIndentation: !1,
|
@@ -4986,63 +4983,63 @@ const fl = /* @__PURE__ */ J({
|
|
4986
4983
|
//默认已启用代码图
|
4987
4984
|
scrollbar: { verticalScrollbarSize: 0 },
|
4988
4985
|
//关闭最右侧垂直滚动条
|
4989
|
-
theme: g(
|
4986
|
+
theme: g(p.theme),
|
4990
4987
|
automaticLayout: !0,
|
4991
4988
|
//根据父元素自动布局
|
4992
|
-
model:
|
4989
|
+
model: h
|
4993
4990
|
};
|
4994
|
-
c = o.editor.create(d.value,
|
4995
|
-
let
|
4996
|
-
if (
|
4991
|
+
c = o.editor.create(d.value, $), r.value.scrollTop && c.setScrollTop(r.value.scrollTop);
|
4992
|
+
let L = r.value.selection;
|
4993
|
+
if (L) {
|
4997
4994
|
let P = {
|
4998
|
-
startLineNumber:
|
4999
|
-
endLineNumber:
|
5000
|
-
startColumn:
|
5001
|
-
endColumn:
|
4995
|
+
startLineNumber: L.startLine,
|
4996
|
+
endLineNumber: L.endLine,
|
4997
|
+
startColumn: L.startColumn,
|
4998
|
+
endColumn: L.endColumn
|
5002
4999
|
};
|
5003
5000
|
c.setSelection(P);
|
5004
5001
|
}
|
5005
5002
|
c.onDidScrollChange((P) => {
|
5006
5003
|
s("scroll", P.scrollTop);
|
5007
5004
|
}), c.onDidChangeModelContent((P) => {
|
5008
|
-
let
|
5009
|
-
s("update:modelValue",
|
5005
|
+
let Z = c.getValue();
|
5006
|
+
s("update:modelValue", Z), s("change", Z);
|
5010
5007
|
});
|
5011
5008
|
};
|
5012
|
-
|
5013
|
-
o = await
|
5009
|
+
be(async () => {
|
5010
|
+
o = await me.getMonaco(), d.value && (V(), s("mounted", o, c));
|
5014
5011
|
});
|
5015
|
-
let
|
5012
|
+
let ce = () => {
|
5016
5013
|
c == null || c.layout();
|
5017
|
-
},
|
5018
|
-
return
|
5019
|
-
|
5020
|
-
}),
|
5014
|
+
}, le = () => c;
|
5015
|
+
return xe(() => {
|
5016
|
+
h == null || h.dispose(), c == null || c.dispose();
|
5017
|
+
}), X(() => p.theme, (f, C) => {
|
5021
5018
|
let m = g(f);
|
5022
5019
|
o.editor.setTheme(m);
|
5023
|
-
}),
|
5024
|
-
}),
|
5020
|
+
}), X(() => p.language, (f, C) => {
|
5021
|
+
}), X(() => a.value, (f, C) => {
|
5025
5022
|
if (!c)
|
5026
5023
|
return;
|
5027
5024
|
let m = c.getValue();
|
5028
5025
|
f != m && c.setValue(f ?? "");
|
5029
|
-
}),
|
5026
|
+
}), X(() => r.value.language, (f, C) => {
|
5030
5027
|
if (!c)
|
5031
5028
|
return;
|
5032
5029
|
let m = c.getModel();
|
5033
|
-
o.editor.setModelLanguage(m, f),
|
5034
|
-
}), t({ layout:
|
5035
|
-
default:
|
5030
|
+
o.editor.setModelLanguage(m, f), b(f);
|
5031
|
+
}), t({ layout: ce, getEditor: le }), (f, C) => (O(), He(gl, null, {
|
5032
|
+
default: Ne(() => [
|
5036
5033
|
D("div", {
|
5037
5034
|
ref_key: "monacoEditorRef",
|
5038
5035
|
ref: d,
|
5039
|
-
class:
|
5036
|
+
class: Ae(["ha-code", { border: y(i) }])
|
5040
5037
|
}, null, 2)
|
5041
5038
|
]),
|
5042
5039
|
_: 1
|
5043
5040
|
}));
|
5044
5041
|
}
|
5045
|
-
}),
|
5042
|
+
}), fr = /* @__PURE__ */ Q({
|
5046
5043
|
__name: "Compare",
|
5047
5044
|
props: {
|
5048
5045
|
inline: { type: Boolean, default: !1 },
|
@@ -5052,146 +5049,146 @@ const fl = /* @__PURE__ */ J({
|
|
5052
5049
|
},
|
5053
5050
|
emits: ["update:modelValue", "update:original", "change"],
|
5054
5051
|
setup(u, { emit: t }) {
|
5055
|
-
let e = t, s = u, { inline: l, language: r, original: i, modelValue: a } =
|
5056
|
-
c = f.editor.createModel(i.value, r.value),
|
5052
|
+
let e = t, s = u, { inline: l, language: r, original: i, modelValue: a } = se(s), o = null, c = null, h = null, d = null, p = null, g = null, b = I(), N = I(), { app: V } = H.sys, ce = (f) => {
|
5053
|
+
c = f.editor.createModel(i.value, r.value), h = f.editor.createModel(a.value, r.value), o = f.editor.createDiffEditor(b.value, {
|
5057
5054
|
originalEditable: !0,
|
5058
5055
|
automaticLayout: !0,
|
5059
5056
|
renderSideBySide: !l.value,
|
5060
5057
|
//是否启用行内模式
|
5061
|
-
theme:
|
5062
|
-
}), o.setModel({ original: c, modified:
|
5058
|
+
theme: le(V.theme)
|
5059
|
+
}), o.setModel({ original: c, modified: h }), d = o.getOriginalEditor(), d.onDidChangeModelContent((C) => {
|
5063
5060
|
let m = d.getValue();
|
5064
5061
|
e("update:original", m), e("change", m);
|
5065
|
-
}),
|
5066
|
-
let m =
|
5062
|
+
}), p = o.getModifiedEditor(), p.onDidChangeModelContent((C) => {
|
5063
|
+
let m = p.getValue();
|
5067
5064
|
e("update:modelValue", m);
|
5068
5065
|
});
|
5069
|
-
},
|
5070
|
-
return
|
5071
|
-
g = await
|
5072
|
-
}),
|
5073
|
-
let m =
|
5066
|
+
}, le = (f) => f == "default" ? null : "vs-dark";
|
5067
|
+
return be(async () => {
|
5068
|
+
g = await me.getMonaco(), ce(g);
|
5069
|
+
}), X(() => V.theme, (f, C) => {
|
5070
|
+
let m = le(f);
|
5074
5071
|
g.editor.setTheme(m);
|
5075
|
-
}),
|
5076
|
-
c && g.editor.setModelLanguage(c, f),
|
5077
|
-
}),
|
5072
|
+
}), X(() => r.value, (f, C) => {
|
5073
|
+
c && g.editor.setModelLanguage(c, f), h && g.editor.setModelLanguage(h, f);
|
5074
|
+
}), X(() => i.value, (f, C) => {
|
5078
5075
|
if (!c)
|
5079
5076
|
return;
|
5080
5077
|
let m = c.getValue();
|
5081
5078
|
f != m && c.setValue(f ?? "");
|
5082
|
-
}),
|
5083
|
-
if (!
|
5079
|
+
}), X(() => a.value, (f, C) => {
|
5080
|
+
if (!h)
|
5084
5081
|
return;
|
5085
|
-
let m =
|
5086
|
-
f != m &&
|
5087
|
-
}), (f, C) => (
|
5082
|
+
let m = h.getValue();
|
5083
|
+
f != m && h.setValue(f ?? "");
|
5084
|
+
}), (f, C) => (O(), _("div", {
|
5088
5085
|
ref_key: "compareRef",
|
5089
|
-
ref:
|
5086
|
+
ref: b,
|
5090
5087
|
class: "ha-compare",
|
5091
|
-
style:
|
5088
|
+
style: ge(y(N))
|
5092
5089
|
}, null, 4));
|
5093
5090
|
}
|
5094
|
-
}),
|
5091
|
+
}), ze = (u, t) => {
|
5095
5092
|
const e = u.__vccOpts || u;
|
5096
5093
|
for (const [s, l] of t)
|
5097
5094
|
e[s] = l;
|
5098
5095
|
return e;
|
5099
|
-
},
|
5100
|
-
function
|
5101
|
-
return
|
5096
|
+
}, yl = {}, vl = { class: "ha-option" };
|
5097
|
+
function wl(u, t) {
|
5098
|
+
return O(), _("div", vl, "选项");
|
5102
5099
|
}
|
5103
|
-
const bl = /* @__PURE__ */
|
5104
|
-
|
5105
|
-
],
|
5100
|
+
const bl = /* @__PURE__ */ ze(yl, [["render", wl]]), xl = { class: "ha-rich-text" }, kl = /* @__PURE__ */ Et('<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), Sl = [
|
5101
|
+
kl
|
5102
|
+
], gr = /* @__PURE__ */ Q({
|
5106
5103
|
__name: "RichText",
|
5107
|
-
props: /* @__PURE__ */
|
5104
|
+
props: /* @__PURE__ */ Ke({
|
5108
5105
|
options: {}
|
5109
5106
|
}, {
|
5110
5107
|
modelValue: {},
|
5111
5108
|
modelModifiers: {}
|
5112
5109
|
}),
|
5113
|
-
emits: /* @__PURE__ */
|
5110
|
+
emits: /* @__PURE__ */ Ke(["change", "scroll"], ["update:modelValue"]),
|
5114
5111
|
setup(u, { expose: t, emit: e }) {
|
5115
|
-
let s = e, l = u, { options: r } =
|
5116
|
-
let
|
5117
|
-
if (
|
5118
|
-
|
5112
|
+
let s = e, l = u, { options: r } = se(l), i = et(u, "modelValue"), a, o = null, c = null, h = !1, d = !1, p = I(), g = I(), b = I(), N = I(!1), V = I({ style: null, options: { scrollTop: 0 } }), ce = (m) => {
|
5113
|
+
let $ = te.getDateString(), L = getSelection(), P = L.getRangeAt(0), Z = P.startContainer;
|
5114
|
+
if (Z.nodeName == "#text")
|
5115
|
+
Z.insertData(P.startOffset, $), P.setStart(Z, P.startOffset + $.length), L.removeAllRanges(), L.addRange(P);
|
5119
5116
|
else {
|
5120
|
-
let
|
5121
|
-
|
5122
|
-
let
|
5123
|
-
|
5117
|
+
let ie = document.createTextNode($);
|
5118
|
+
Z.appendChild(ie);
|
5119
|
+
let re = document.createRange();
|
5120
|
+
re.selectNodeContents(ie), re.setStart(ie, re.startOffset + $.length), L.removeAllRanges(), L.addRange(re);
|
5124
5121
|
}
|
5125
|
-
},
|
5126
|
-
if (o.scrollTop = m.scrollTop,
|
5127
|
-
|
5122
|
+
}, le = (m) => {
|
5123
|
+
if (o.scrollTop = m.scrollTop, h || d) {
|
5124
|
+
h = !1, d = !1;
|
5128
5125
|
return;
|
5129
5126
|
}
|
5130
5127
|
c = m, s("scroll", m);
|
5131
|
-
}, f = () => `height: calc(100% - ${
|
5132
|
-
let m = await
|
5133
|
-
a = new m(
|
5128
|
+
}, f = () => `height: calc(100% - ${R.getHeight(g.value)}px)`, C = async () => {
|
5129
|
+
let m = await me.getQuill();
|
5130
|
+
a = new m(p.value, {
|
5134
5131
|
modules: {
|
5135
5132
|
toolbar: {
|
5136
5133
|
container: g.value,
|
5137
|
-
handlers: { date:
|
5134
|
+
handlers: { date: ce }
|
5138
5135
|
}
|
5139
5136
|
},
|
5140
5137
|
theme: "snow"
|
5141
|
-
}), N.value = !0,
|
5138
|
+
}), N.value = !0, We(() => {
|
5142
5139
|
V.value.style = f();
|
5143
|
-
}), r.value.readonly && a.disable(), o =
|
5144
|
-
o.innerHTML != i.value && (
|
5145
|
-
}), o.addEventListener("paste", (
|
5140
|
+
}), r.value.readonly && a.disable(), o = p.value.querySelector(".ql-editor"), o.innerHTML = i.value, V.value.options.scrollTop = r.value.scrollTop, a.on("text-change", ($, L, P) => {
|
5141
|
+
o.innerHTML != i.value && (h = !0, i.value = o.innerHTML);
|
5142
|
+
}), o.addEventListener("paste", ($) => {
|
5146
5143
|
d = !0;
|
5147
5144
|
});
|
5148
5145
|
};
|
5149
|
-
return
|
5146
|
+
return be(() => {
|
5150
5147
|
C();
|
5151
|
-
}),
|
5148
|
+
}), xe(() => {
|
5152
5149
|
a = null;
|
5153
|
-
}),
|
5150
|
+
}), X(() => i.value, (m, $) => {
|
5154
5151
|
o && o.innerHTML != m && (o.innerHTML = m);
|
5155
|
-
}),
|
5156
|
-
m != null && (c == null ? void 0 : c.scrollTop) != m &&
|
5152
|
+
}), X(() => r.value.scrollTop, (m, $) => {
|
5153
|
+
m != null && (c == null ? void 0 : c.scrollTop) != m && We(() => {
|
5157
5154
|
V.value.options.scrollTop = m;
|
5158
5155
|
});
|
5159
|
-
}), t({}), (m,
|
5156
|
+
}), t({}), (m, $) => (O(), _("div", xl, [
|
5160
5157
|
kt(D("div", {
|
5161
5158
|
ref_key: "toolbarRef",
|
5162
5159
|
ref: g
|
5163
5160
|
}, Sl, 512), [
|
5164
|
-
[
|
5161
|
+
[St, y(N)]
|
5165
5162
|
]),
|
5166
|
-
|
5163
|
+
Ce(y(ml), {
|
5167
5164
|
ref_key: "scrollerRef",
|
5168
|
-
ref:
|
5165
|
+
ref: b,
|
5169
5166
|
class: "ql-body",
|
5170
5167
|
options: y(V).options,
|
5171
|
-
onScroll: y(
|
5172
|
-
style:
|
5168
|
+
onScroll: y(le),
|
5169
|
+
style: ge(y(V).style)
|
5173
5170
|
}, {
|
5174
|
-
default:
|
5171
|
+
default: Ne(() => [
|
5175
5172
|
D("div", {
|
5176
5173
|
ref_key: "editorRef",
|
5177
|
-
ref:
|
5174
|
+
ref: p
|
5178
5175
|
}, null, 512)
|
5179
5176
|
]),
|
5180
5177
|
_: 1
|
5181
5178
|
}, 8, ["options", "onScroll", "style"])
|
5182
5179
|
]));
|
5183
5180
|
}
|
5184
|
-
}),
|
5181
|
+
}), El = {}, Cl = { class: "ha-select" }, Tl = /* @__PURE__ */ D("div", { class: "select-title" }, "头", -1), $l = /* @__PURE__ */ D("div", { class: "select-body" }, [
|
5185
5182
|
/* @__PURE__ */ D("input", { type: "text" })
|
5186
|
-
], -1),
|
5187
|
-
|
5188
|
-
|
5183
|
+
], -1), Ll = [
|
5184
|
+
Tl,
|
5185
|
+
$l
|
5189
5186
|
];
|
5190
|
-
function
|
5191
|
-
return
|
5187
|
+
function Al(u, t) {
|
5188
|
+
return O(), _("div", Cl, Ll);
|
5192
5189
|
}
|
5193
|
-
const
|
5194
|
-
class
|
5190
|
+
const Be = /* @__PURE__ */ ze(El, [["render", Al]]);
|
5191
|
+
class mr {
|
5195
5192
|
/**
|
5196
5193
|
* 初始化
|
5197
5194
|
*/
|
@@ -5215,7 +5212,7 @@ class gr {
|
|
5215
5212
|
this.startLine = t, this.endLine = e, this.startColumn = s, this.endColumn = l;
|
5216
5213
|
}
|
5217
5214
|
}
|
5218
|
-
const
|
5215
|
+
const Dl = { class: "ha-condition" }, Il = /* @__PURE__ */ Q({
|
5219
5216
|
__name: "Condition",
|
5220
5217
|
props: {
|
5221
5218
|
name: {},
|
@@ -5223,80 +5220,80 @@ const Al = { class: "ha-condition" }, Il = /* @__PURE__ */ J({
|
|
5223
5220
|
value: {}
|
5224
5221
|
},
|
5225
5222
|
setup(u) {
|
5226
|
-
let t = u, { name: e, operator: s, value: l } =
|
5227
|
-
return (r, i) => (
|
5228
|
-
|
5223
|
+
let t = u, { name: e, operator: s, value: l } = se(t);
|
5224
|
+
return (r, i) => (O(), _("div", Dl, [
|
5225
|
+
Ce(y(Be), {
|
5229
5226
|
modelValue: y(e),
|
5230
|
-
"onUpdate:modelValue": i[0] || (i[0] = (a) =>
|
5227
|
+
"onUpdate:modelValue": i[0] || (i[0] = (a) => _e(e) ? e.value = a : e = a)
|
5231
5228
|
}, null, 8, ["modelValue"]),
|
5232
|
-
|
5229
|
+
Ce(y(Be), {
|
5233
5230
|
modelValue: y(s),
|
5234
|
-
"onUpdate:modelValue": i[1] || (i[1] = (a) =>
|
5231
|
+
"onUpdate:modelValue": i[1] || (i[1] = (a) => _e(s) ? s.value = a : s = a)
|
5235
5232
|
}, {
|
5236
|
-
default:
|
5237
|
-
|
5233
|
+
default: Ne(() => [
|
5234
|
+
Ce(y(bl))
|
5238
5235
|
]),
|
5239
5236
|
_: 1
|
5240
5237
|
}, 8, ["modelValue"]),
|
5241
|
-
|
5238
|
+
Ce(y(Be), {
|
5242
5239
|
modelValue: y(l),
|
5243
|
-
"onUpdate:modelValue": i[2] || (i[2] = (a) =>
|
5240
|
+
"onUpdate:modelValue": i[2] || (i[2] = (a) => _e(l) ? l.value = a : l = a)
|
5244
5241
|
}, null, 8, ["modelValue"])
|
5245
5242
|
]));
|
5246
5243
|
}
|
5247
|
-
}),
|
5244
|
+
}), Ol = { class: "ha-condition-group" }, yr = /* @__PURE__ */ Q({
|
5248
5245
|
__name: "Index",
|
5249
5246
|
props: {
|
5250
5247
|
conditions: {}
|
5251
5248
|
},
|
5252
5249
|
setup(u) {
|
5253
|
-
let t = u, { conditions: e } =
|
5254
|
-
return (s, l) => (
|
5255
|
-
(
|
5250
|
+
let t = u, { conditions: e } = se(t);
|
5251
|
+
return (s, l) => (O(), _("div", Ol, [
|
5252
|
+
(O(!0), _(Ct, null, Tt(y(e), (r) => (O(), He(y(Il), {
|
5256
5253
|
name: r.name,
|
5257
5254
|
operator: r.operator,
|
5258
5255
|
value: r.value
|
5259
5256
|
}, null, 8, ["name", "operator", "value"]))), 256))
|
5260
5257
|
]));
|
5261
5258
|
}
|
5262
|
-
}),
|
5263
|
-
function
|
5264
|
-
return
|
5265
|
-
|
5259
|
+
}), jl = {}, Rl = { class: "ha-col" };
|
5260
|
+
function _l(u, t) {
|
5261
|
+
return O(), _("div", Rl, [
|
5262
|
+
fe(u.$slots, "default")
|
5266
5263
|
]);
|
5267
5264
|
}
|
5268
|
-
const
|
5265
|
+
const vr = /* @__PURE__ */ ze(jl, [["render", _l]]), wr = /* @__PURE__ */ Q({
|
5269
5266
|
__name: "Container",
|
5270
5267
|
props: {
|
5271
5268
|
container: { type: Boolean, default: !0 }
|
5272
5269
|
},
|
5273
5270
|
setup(u) {
|
5274
|
-
let t = u, { container: e } =
|
5275
|
-
return (s, l) => (
|
5276
|
-
class:
|
5271
|
+
let t = u, { container: e } = se(t);
|
5272
|
+
return (s, l) => (O(), _("div", {
|
5273
|
+
class: Ae({ "ha-container": y(e) })
|
5277
5274
|
}, [
|
5278
|
-
|
5275
|
+
fe(s.$slots, "default")
|
5279
5276
|
], 2));
|
5280
5277
|
}
|
5281
|
-
}), br = /* @__PURE__ */
|
5278
|
+
}), br = /* @__PURE__ */ Q({
|
5282
5279
|
__name: "Row",
|
5283
5280
|
props: {
|
5284
5281
|
gap: {},
|
5285
5282
|
direction: {}
|
5286
5283
|
},
|
5287
5284
|
setup(u) {
|
5288
|
-
let t = u, { gap: e, direction: s } =
|
5285
|
+
let t = u, { gap: e, direction: s } = se(t), l = Te(() => {
|
5289
5286
|
let r = { gap: null };
|
5290
5287
|
return e.value && (r.gap = e.value + "px"), r;
|
5291
5288
|
});
|
5292
|
-
return (r, i) => (
|
5293
|
-
class:
|
5294
|
-
style:
|
5289
|
+
return (r, i) => (O(), _("div", {
|
5290
|
+
class: Ae(["ha-row", y(s)]),
|
5291
|
+
style: ge(y(l))
|
5295
5292
|
}, [
|
5296
|
-
|
5293
|
+
fe(r.$slots, "default")
|
5297
5294
|
], 6));
|
5298
5295
|
}
|
5299
|
-
}),
|
5296
|
+
}), xr = /* @__PURE__ */ Q({
|
5300
5297
|
__name: "Progress",
|
5301
5298
|
props: {
|
5302
5299
|
modelValue: { type: Boolean },
|
@@ -5304,7 +5301,7 @@ const yr = /* @__PURE__ */ Ke(Ol, [["render", Rl]]), vr = /* @__PURE__ */ J({
|
|
5304
5301
|
},
|
5305
5302
|
emits: ["update:modelValue"],
|
5306
5303
|
setup(u) {
|
5307
|
-
let t =
|
5304
|
+
let t = et(u, "modelValue"), e = I(!0), s = I(0), l = null, r = () => {
|
5308
5305
|
s.value = 0, e.value = !0, l = setInterval(() => {
|
5309
5306
|
if (s.value < 100) {
|
5310
5307
|
s.value++;
|
@@ -5314,177 +5311,179 @@ const yr = /* @__PURE__ */ Ke(Ol, [["render", Rl]]), vr = /* @__PURE__ */ J({
|
|
5314
5311
|
}, 50);
|
5315
5312
|
}, i = () => {
|
5316
5313
|
clearInterval(l);
|
5317
|
-
let a = 100 - s.value, o = 200, c = 20,
|
5318
|
-
s.value +=
|
5314
|
+
let a = 100 - s.value, o = 200, c = 20, h = a / (o / c), d = setInterval(() => {
|
5315
|
+
s.value += h, !(s.value < 100) && (s.value = 100, clearInterval(d), setTimeout(() => {
|
5319
5316
|
e.value = !1;
|
5320
5317
|
}, 200));
|
5321
5318
|
}, c);
|
5322
5319
|
};
|
5323
|
-
return
|
5320
|
+
return be(() => {
|
5324
5321
|
t.value && r();
|
5325
|
-
}),
|
5322
|
+
}), xe(() => {
|
5326
5323
|
clearInterval(l);
|
5327
|
-
}),
|
5324
|
+
}), X(() => t.value, (a, o) => {
|
5328
5325
|
a ? r() : i();
|
5329
|
-
}), (a, o) => y(e) ? (
|
5326
|
+
}), (a, o) => y(e) ? (O(), _("div", {
|
5330
5327
|
key: 0,
|
5331
5328
|
class: "ha-progress",
|
5332
|
-
style:
|
5333
|
-
}, null, 4)) :
|
5329
|
+
style: ge({ width: y(s) + "%" })
|
5330
|
+
}, null, 4)) : Ze("", !0);
|
5334
5331
|
}
|
5335
|
-
}),
|
5332
|
+
}), Bl = { class: "progress-tips" }, Pl = { class: "progress-tip info" }, Ul = { class: "progress-tip success" }, Fl = { class: "progress-tip error" }, Ml = { class: "progress-chart" }, Nl = { class: "progress-bar" }, Vl = { class: "progress-text" }, kr = /* @__PURE__ */ Q({
|
5336
5333
|
__name: "SocketProgress",
|
5337
5334
|
props: {
|
5338
5335
|
progress: {}
|
5339
5336
|
},
|
5340
5337
|
setup(u) {
|
5341
|
-
let t = u, { progress: e } =
|
5338
|
+
let t = u, { progress: e } = se(t), s = Te(() => {
|
5342
5339
|
let a = e.value;
|
5343
5340
|
return (a.succeed ?? 0) + (a.errored ?? 0);
|
5344
|
-
}), l =
|
5345
|
-
return (a, o) => (
|
5346
|
-
class:
|
5341
|
+
}), l = Te(() => ne.getPercentage(s.value, e.value.total)), r = Te(() => ne.getProgressText(s.value, e.value.total)), i = Te(() => ne.getPercentageText(s.value, e.value.total));
|
5342
|
+
return (a, o) => (O(), _("div", {
|
5343
|
+
class: Ae(["ha-socket-progress", { error: y(e).errored > 0 }])
|
5347
5344
|
}, [
|
5348
|
-
D("div",
|
5349
|
-
D("div",
|
5350
|
-
D("div",
|
5351
|
-
D("div",
|
5345
|
+
D("div", Bl, [
|
5346
|
+
D("div", Pl, "进度:" + pe(y(r)), 1),
|
5347
|
+
D("div", Ul, "成功:" + pe(y(e).succeed ?? "-"), 1),
|
5348
|
+
D("div", Fl, "异常:" + pe(y(e).errored ?? "-"), 1)
|
5352
5349
|
]),
|
5353
|
-
D("div",
|
5354
|
-
D("div",
|
5350
|
+
D("div", Ml, [
|
5351
|
+
D("div", Nl, [
|
5355
5352
|
D("div", {
|
5356
5353
|
class: "progress-percentage",
|
5357
|
-
style:
|
5354
|
+
style: ge({ width: y(l) + "%" })
|
5358
5355
|
}, null, 4)
|
5359
5356
|
]),
|
5360
|
-
D("div",
|
5357
|
+
D("div", Vl, pe(y(i)) + "%", 1)
|
5361
5358
|
])
|
5362
5359
|
], 2));
|
5363
5360
|
}
|
5364
|
-
}),
|
5365
|
-
|
5366
|
-
|
5367
|
-
], Sr = /* @__PURE__ */
|
5361
|
+
}), ql = { class: "ha-tab" }, zl = /* @__PURE__ */ D("div", { class: "tab-header" }, null, -1), Kl = /* @__PURE__ */ D("div", { class: "tab-body" }, null, -1), Wl = [
|
5362
|
+
zl,
|
5363
|
+
Kl
|
5364
|
+
], Sr = /* @__PURE__ */ Q({
|
5368
5365
|
__name: "Tab",
|
5369
5366
|
props: {
|
5370
5367
|
destroy: { type: Boolean }
|
5371
5368
|
},
|
5372
5369
|
setup(u) {
|
5373
|
-
return (t, e) => (
|
5370
|
+
return (t, e) => (O(), _("div", ql, Wl));
|
5374
5371
|
}
|
5375
5372
|
});
|
5376
|
-
let
|
5377
|
-
u == null && (u = new
|
5378
|
-
let t = await Fs.getSso(), e =
|
5379
|
-
await
|
5373
|
+
let Er = async (u) => {
|
5374
|
+
u == null && (u = new cl()), await Zs(u), await Ms();
|
5375
|
+
let t = await Fs.getSso(), e = H.sys.app, s = { baseUrl: u.baseUrl, language: e.language, user: t, platform: "pc" }, l = M.serialize(s);
|
5376
|
+
await T.open(l), await Hs(), T.onResponse = async (r) => {
|
5380
5377
|
let i = r.data;
|
5381
5378
|
return Ps.add(i.code, i.message, i.stack, i.elapsed), Promise.resolve();
|
5382
5379
|
};
|
5383
5380
|
};
|
5384
5381
|
export {
|
5385
|
-
|
5386
|
-
|
5387
|
-
|
5388
|
-
|
5389
|
-
|
5390
|
-
|
5391
|
-
|
5392
|
-
|
5393
|
-
|
5394
|
-
|
5395
|
-
|
5396
|
-
|
5397
|
-
|
5398
|
-
|
5399
|
-
|
5400
|
-
|
5401
|
-
|
5402
|
-
|
5382
|
+
ue as ArrayHelper,
|
5383
|
+
st as BrowserHelper,
|
5384
|
+
qt as BuilderFactory,
|
5385
|
+
lt as Cdn,
|
5386
|
+
Wt as CdnFactory,
|
5387
|
+
It as ComponentHelper,
|
5388
|
+
cl as CreateFeOptions,
|
5389
|
+
Pe as DictionaryHelper,
|
5390
|
+
R as DomHelper,
|
5391
|
+
fl as DragEvent,
|
5392
|
+
Xt as EncoderFactory,
|
5393
|
+
ae as EventHelper,
|
5394
|
+
gt as EventUtility,
|
5395
|
+
Zt as ExcelFactory,
|
5396
|
+
ts as ExplainerFactory,
|
5397
|
+
E as Factories,
|
5398
|
+
ns as FeatureFactory,
|
5399
|
+
Ie as FileHelper,
|
5403
5400
|
pr as HaCode,
|
5404
|
-
|
5405
|
-
|
5401
|
+
vr as HaCol,
|
5402
|
+
fr as HaCompare,
|
5406
5403
|
Il as HaCondition,
|
5407
|
-
|
5408
|
-
|
5404
|
+
yr as HaConditionGroup,
|
5405
|
+
wr as HaContainer,
|
5409
5406
|
ir as HaEmpty,
|
5410
|
-
|
5407
|
+
gl as HaFill,
|
5411
5408
|
bl as HaOption,
|
5412
|
-
|
5413
|
-
|
5409
|
+
xr as HaProgress,
|
5410
|
+
gr as HaRichText,
|
5414
5411
|
br as HaRow,
|
5415
|
-
|
5416
|
-
|
5417
|
-
|
5412
|
+
ml as HaScroller,
|
5413
|
+
Be as HaSelect,
|
5414
|
+
kr as HaSocketProgress,
|
5418
5415
|
Sr as HaTab,
|
5419
|
-
|
5420
|
-
|
5421
|
-
|
5422
|
-
|
5423
|
-
|
5424
|
-
|
5425
|
-
|
5426
|
-
|
5427
|
-
|
5428
|
-
|
5416
|
+
hr as HaTimer,
|
5417
|
+
ds as HaloHttp,
|
5418
|
+
os as HasherFactory,
|
5419
|
+
Qe as HtmlHelper,
|
5420
|
+
hs as HttpFactory,
|
5421
|
+
it as HttpRequest,
|
5422
|
+
Ye as HttpResponse,
|
5423
|
+
gs as I18nFactory,
|
5424
|
+
Ot as ImageHelper,
|
5425
|
+
M as JsonHelper,
|
5429
5426
|
or as KeyboardUtility,
|
5430
5427
|
ur as ListDelta,
|
5431
|
-
|
5432
|
-
|
5433
|
-
|
5434
|
-
|
5428
|
+
ne as MathHelper,
|
5429
|
+
ms as Messenger,
|
5430
|
+
vs as MessengerFactory,
|
5431
|
+
jt as MicroHelper,
|
5435
5432
|
we as MountHelper,
|
5436
5433
|
cr as MouseUtility,
|
5437
|
-
|
5438
|
-
|
5439
|
-
|
5434
|
+
Y as ObjectHelper,
|
5435
|
+
ft as Position,
|
5436
|
+
Nt as ProviderFactory,
|
5440
5437
|
tr as ProviderTable,
|
5441
|
-
|
5438
|
+
mr as Range,
|
5442
5439
|
ar as Rect,
|
5443
|
-
|
5444
|
-
|
5445
|
-
|
5446
|
-
|
5447
|
-
|
5448
|
-
|
5449
|
-
|
5450
|
-
|
5440
|
+
Rt as Ref,
|
5441
|
+
dr as SaveUtility,
|
5442
|
+
Je as ScrollHelper,
|
5443
|
+
Bt as SignHelper,
|
5444
|
+
xs as SignerFactory,
|
5445
|
+
Xe as SqlHelper,
|
5446
|
+
Ns as SsoFactory,
|
5447
|
+
at as SsoUser,
|
5448
|
+
W as StringHelper,
|
5451
5449
|
Bs as SvcFactory,
|
5452
|
-
|
5453
|
-
|
5454
|
-
|
5455
|
-
|
5456
|
-
|
5450
|
+
zs as TaskFactory,
|
5451
|
+
Ee as TaskHelper,
|
5452
|
+
Qs as TemplateFactory,
|
5453
|
+
te as TimeHelper,
|
5454
|
+
Oe as TreeHelper,
|
5457
5455
|
U as TypeHelper,
|
5458
5456
|
K as UrlHelper,
|
5459
5457
|
rr as VideoFactory,
|
5460
5458
|
nr as VoiceFactory,
|
5461
|
-
|
5462
|
-
|
5463
|
-
|
5464
|
-
|
5459
|
+
Ys as base64,
|
5460
|
+
me as cdn,
|
5461
|
+
H as configSvc,
|
5462
|
+
Er as createFe,
|
5465
5463
|
sr as driverSvc,
|
5466
5464
|
lr as envSvc,
|
5467
|
-
|
5468
|
-
|
5469
|
-
|
5465
|
+
T as http,
|
5466
|
+
J as i18n,
|
5467
|
+
Zs as initDriver,
|
5468
|
+
Hs as initI18n,
|
5470
5469
|
Ms as initSvc,
|
5471
5470
|
Ps as logSvc,
|
5472
|
-
|
5473
|
-
|
5474
|
-
|
5471
|
+
pt as md5,
|
5472
|
+
ve as messenger,
|
5473
|
+
ee as moment,
|
5475
5474
|
De as settingRepo,
|
5476
|
-
|
5475
|
+
de as settingSvc,
|
5477
5476
|
Us as socketSvc,
|
5478
|
-
|
5479
|
-
|
5480
|
-
|
5481
|
-
|
5482
|
-
|
5483
|
-
|
5484
|
-
|
5485
|
-
|
5486
|
-
|
5487
|
-
|
5488
|
-
|
5477
|
+
el as t,
|
5478
|
+
ll as t_enum,
|
5479
|
+
tl as t_exists,
|
5480
|
+
rl as t_field,
|
5481
|
+
nl as t_field_choose_placeholder,
|
5482
|
+
il as t_field_placeholder,
|
5483
|
+
ul as t_menu,
|
5484
|
+
ol as t_module,
|
5485
|
+
sl as t_sys,
|
5486
|
+
al as t_table,
|
5487
|
+
Gs as template,
|
5489
5488
|
Fs as userSvc
|
5490
5489
|
};
|