halo-fe 1.0.18 → 1.0.20
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/main.js +984 -980
- package/esm/@types/CreateFeOptions.d.ts +25 -0
- package/esm/@types/index.d.ts +2 -0
- package/esm/coms/@types/ScrollerProps.d.ts +15 -0
- package/esm/coms/@types/index.d.ts +2 -0
- package/esm/coms/Scroller.vue.d.ts +1 -1
- package/esm/coms/conditions/@types/ConditionGroupProps.d.ts +11 -0
- package/esm/coms/conditions/@types/ConditionProps.d.ts +18 -0
- package/esm/coms/conditions/@types/index.d.ts +3 -0
- package/esm/coms/conditions/Condition.vue.d.ts +1 -1
- package/esm/coms/conditions/Index.vue.d.ts +1 -1
- package/esm/coms/{types → controls/@types}/CodeEmit.d.ts +1 -1
- package/esm/coms/controls/@types/CodeProps.d.ts +28 -0
- package/esm/coms/controls/@types/Range.d.ts +26 -0
- package/esm/coms/controls/@types/index.d.ts +6 -0
- package/esm/coms/controls/Code.vue.d.ts +1 -1
- package/esm/coms/controls/RichText.vue.d.ts +1 -1
- package/esm/coms/controls/index.d.ts +1 -1
- package/esm/coms/index.d.ts +1 -1
- package/esm/coms/layouts/@types/index.d.ts +2 -0
- package/esm/coms/layouts/Row.vue.d.ts +1 -1
- package/esm/coms/layouts/index.d.ts +1 -1
- package/esm/coms/progresses/@types/SocketProgressProps.d.ts +23 -0
- package/esm/coms/progresses/@types/index.d.ts +2 -0
- package/esm/coms/progresses/SocketProgress.vue.d.ts +1 -1
- package/esm/coms/tabs/@types/TabProps.d.ts +7 -0
- package/esm/coms/tabs/@types/index.d.ts +2 -0
- package/esm/coms/tabs/Tab.vue.d.ts +1 -1
- package/esm/drivers/@types/IDispose.d.ts +10 -0
- package/esm/drivers/@types/IOpen.d.ts +10 -0
- package/esm/drivers/@types/index.d.ts +4 -0
- package/esm/drivers/bridges/IBridge.d.ts +1 -1
- package/esm/drivers/builders/IBuilder.d.ts +1 -1
- package/esm/drivers/builders/types/ProviderTable.d.ts +6 -0
- package/esm/drivers/builders/types/index.d.ts +2 -0
- package/esm/drivers/cdns/ICdn.d.ts +1 -1
- package/esm/drivers/excels/IExcel.d.ts +1 -1
- package/esm/drivers/explainers/IExplainer.d.ts +1 -1
- package/esm/drivers/features/IFeature.d.ts +1 -1
- package/esm/drivers/https/IHttp.d.ts +1 -1
- package/esm/drivers/i18ns/I18n.d.ts +38 -0
- package/esm/drivers/i18ns/I18nFactory.d.ts +13 -0
- package/esm/drivers/i18ns/II18n.d.ts +72 -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 +2 -1
- package/esm/drivers/messengers/IMessenger.d.ts +1 -1
- package/esm/drivers/providers/IProvider.d.ts +1 -1
- package/esm/drivers/ssos/ISso.d.ts +1 -1
- package/esm/drivers/tasks/ITask.d.ts +1 -1
- package/esm/drivers/templates/ITemplate.d.ts +1 -1
- package/esm/drivers/videos/IVideo.d.ts +1 -1
- package/esm/drivers/voices/IVoice.d.ts +1 -1
- package/esm/factorying/Factories.d.ts +15 -11
- package/esm/factorying/Factory.d.ts +1 -1
- package/esm/factorying/index.d.ts +17 -5
- package/esm/helpers/@types/JsonConfig.d.ts +10 -0
- package/esm/helpers/@types/TreeNodeProp.d.ts +9 -0
- package/esm/helpers/@types/index.d.ts +3 -0
- package/esm/helpers/JsonHelper.d.ts +6 -2
- package/esm/main.d.ts +2 -2
- 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/@types/Dictionary.d.ts +4 -0
- package/esm/svcs/@types/index.d.ts +2 -0
- package/esm/svcs/implement/ConfigSvc.d.ts +1 -1
- package/esm/svcs/implement/I18nSvc.d.ts +1 -1
- package/esm/svcs/implement/LogSvc.d.ts +3 -0
- package/esm/svcs/implement/index.d.ts +1 -2
- package/esm/svcs/index.d.ts +2 -8
- package/esm/types/CreateFeOptions.d.ts +6 -5
- package/esm/utilities/@types/DragEvent.d.ts +11 -0
- package/esm/utilities/@types/DragOptions.d.ts +28 -0
- package/esm/utilities/@types/Position.d.ts +15 -0
- package/esm/utilities/@types/Rect.d.ts +10 -0
- package/esm/utilities/@types/index.d.ts +5 -0
- package/esm/utilities/EventUtility.d.ts +1 -1
- package/esm/utilities/SaveUtility.d.ts +15 -0
- package/esm/utilities/index.d.ts +3 -2
- 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/CodeProps.d.ts +0 -18
- 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/esm/coms/{types → controls/@types}/RichTextOptions.d.ts +0 -0
- /package/esm/coms/{types → controls/@types}/RichTextProps.d.ts +0 -0
- /package/esm/coms/{types → layouts/@types}/RowProps.d.ts +0 -0
- /package/esm/drivers/{IDriver.d.ts → @types/IDriver.d.ts} +0 -0
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 ge, createCommentVNode as Ze, watch as X, ref as I, onMounted as be, onUnmounted as xe, normalizeStyle as fe, 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(), f = 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
|
-
|
1159
|
+
f -= d.height, a.left = `${o.left}px`, a.top = `${o.top + o.height}px`, f < p.height ? a.height = `${f}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,11 +1590,11 @@ 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
|
1598
|
-
if ((
|
1593
|
+
let c = !1, h = k.getChildren(o, s, !0);
|
1594
|
+
for (let d of h) {
|
1595
|
+
for (let p of a) {
|
1596
|
+
let f = d[p];
|
1597
|
+
if ((f ? f.toUpperCase() : "").indexOf(i) > -1) {
|
1599
1598
|
c = !0;
|
1600
1599
|
break;
|
1601
1600
|
}
|
@@ -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
|
2317
|
-
for (let
|
2318
|
-
let N =
|
2329
|
+
let f = Object.keys(p);
|
2330
|
+
for (let b = 0; b < f.length; b++) {
|
2331
|
+
let N = f[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 != f.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,32 +2659,32 @@ 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
|
-
|
2652
|
-
}), r.push(
|
2662
|
+
let p = e[d], f = [];
|
2663
|
+
Object.keys(p).forEach((b) => {
|
2664
|
+
f.push(p[b]);
|
2665
|
+
}), r.push(f);
|
2653
2666
|
}
|
2654
2667
|
let a = this.xlsx.utils.book_new(), o = this.xlsx.utils.json_to_sheet(r, { skipHeader: !0 });
|
2655
2668
|
this.xlsx.utils.book_append_sheet(a, o, "abc");
|
2656
2669
|
let c = 65;
|
2657
2670
|
for (let d = 0; d < l.length; d++) {
|
2658
|
-
let
|
2659
|
-
o[
|
2671
|
+
let f = `${String.fromCharCode(c + d)}1`;
|
2672
|
+
o[f].s = {
|
2660
2673
|
alignment: { horizontal: "center" },
|
2661
2674
|
font: { bold: !0, color: { rgb: "000000" } },
|
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], f = { wpx: 50 };
|
2681
|
+
typeof p == "string" && (f.wpx = 100), h.push(f);
|
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
|
-
|
3024
|
+
let p = c[d].split(": "), f = p.shift();
|
3025
|
+
f == null || f == "" || (h[f] = 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,13 +3133,14 @@ 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
|
/**
|
3127
3140
|
* 发送请求
|
3128
3141
|
*/
|
3129
3142
|
async send(e) {
|
3143
|
+
debugger;
|
3130
3144
|
e.url = K.concatUrl(this.baseUrl, e.path), await this.onRequest(e);
|
3131
3145
|
let s = await this.http.send(e);
|
3132
3146
|
if (s.status != 200) {
|
@@ -3137,10 +3151,10 @@ class hs extends ze {
|
|
3137
3151
|
let i = s.status ? `(${s.status})` : "";
|
3138
3152
|
r = `接口加载异常: ${e.method}${i} ${e.url}`;
|
3139
3153
|
}
|
3140
|
-
return
|
3154
|
+
return ve.warning(r), Promise.reject(r);
|
3141
3155
|
}
|
3142
3156
|
let l = s.data;
|
3143
|
-
return l.code != "Ok" ? (
|
3157
|
+
return l.code != "Ok" ? (ve.error(l.message), Promise.reject(l)) : s;
|
3144
3158
|
}
|
3145
3159
|
/**
|
3146
3160
|
* 请求预处理
|
@@ -3152,7 +3166,7 @@ class hs extends ze {
|
|
3152
3166
|
if (this.user == null)
|
3153
3167
|
s = this.platform;
|
3154
3168
|
else {
|
3155
|
-
let r =
|
3169
|
+
let r = te.getTimestamp(), i = await this.signer.getSign(this.user.userId, e.url, e.body, r, this.user.secret);
|
3156
3170
|
s = this.sso.getAuth(this.user.identity.token, r, i, this.platform, this.env);
|
3157
3171
|
}
|
3158
3172
|
let l = {};
|
@@ -3164,21 +3178,21 @@ class hs extends ze {
|
|
3164
3178
|
handleError(e) {
|
3165
3179
|
if (e instanceof Object) {
|
3166
3180
|
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),
|
3181
|
+
e.message == "Network Error" && (K.httpOrHttps(e.config.url) ? s = "接口网络错误: " + e.config.url : s = "接口网络错误: " + e.config.baseURL + e.config.url), ve.error(s);
|
3168
3182
|
} else
|
3169
|
-
|
3183
|
+
ve.error(e.message);
|
3170
3184
|
return Promise.reject(e);
|
3171
3185
|
}
|
3172
3186
|
}
|
3173
|
-
class
|
3187
|
+
class hs extends B {
|
3174
3188
|
get instances() {
|
3175
|
-
return [new
|
3189
|
+
return [new us(), new cs(), new ds()];
|
3176
3190
|
}
|
3177
3191
|
/**
|
3178
3192
|
* 创建并开启
|
3179
3193
|
*/
|
3180
3194
|
async createById(t, e = null) {
|
3181
|
-
e == null && (e = new
|
3195
|
+
e == null && (e = new Rt());
|
3182
3196
|
let s = await super.createById(t, e), l = e.value;
|
3183
3197
|
return await s.open(l.Conn), s;
|
3184
3198
|
}
|
@@ -3196,12 +3210,142 @@ class fs extends F {
|
|
3196
3210
|
return await this.createIfAbsent("Halo");
|
3197
3211
|
}
|
3198
3212
|
}
|
3199
|
-
class
|
3213
|
+
class ps {
|
3200
3214
|
constructor() {
|
3215
|
+
//#region 属性
|
3201
3216
|
n(this, "type");
|
3217
|
+
n(this, "lang");
|
3218
|
+
n(this, "messages", {});
|
3219
|
+
//#endregion
|
3220
|
+
n(this, "t", (t, e) => {
|
3221
|
+
if (!t)
|
3222
|
+
return null;
|
3223
|
+
if (!this.t_exists(t)) {
|
3224
|
+
let s = t.split(".");
|
3225
|
+
return ue.getLast(s, 2).join(".");
|
3226
|
+
}
|
3227
|
+
return typeof e == "string" ? this.translate(t, [e]) : this.translate(t, e);
|
3228
|
+
});
|
3229
|
+
n(this, "t_menu", (t) => {
|
3230
|
+
let s = `_business.Sys_Menu.Title.${t}`;
|
3231
|
+
return this.t(s);
|
3232
|
+
});
|
3233
|
+
n(this, "t_module", (t, e) => {
|
3234
|
+
if (!t && !e)
|
3235
|
+
return null;
|
3236
|
+
let s = t.toLowerCase(), l = "_business.Ctl_Module.Title", r = t ? this.t(`common.${s}`) : "", i = this.t(`${l}.${e}`);
|
3237
|
+
return s == "list" || s == "paging" || s == "detail" ? i + " " + r : r + " " + i;
|
3238
|
+
});
|
3239
|
+
n(this, "t_table", (t) => this.t(`_business.Ctl_Table.Title.${t}`));
|
3240
|
+
n(this, "t_field", (t, e) => {
|
3241
|
+
let l = `_business.Ctl_Table_Field.Label.${t}.${e}`;
|
3242
|
+
return this.t(l);
|
3243
|
+
});
|
3244
|
+
n(this, "t_enum", (t, e) => this.t(`_business.Ctl_Enum_Option.Text.${t}.${e}`));
|
3245
|
+
n(this, "t_field_placeholder", (t, e) => this.t("common.please_input") + this.t(`_business.Ctl_Table_Field.Label.${t}.${e}`));
|
3246
|
+
n(this, "t_field_choose_placeholder", (t, e) => this.t("common.please_choose") + this.t(`_business.Ctl_Table_Field.Label.${t}.${e}`));
|
3247
|
+
n(this, "t_sys", (t) => this.t(`sys.${t}`));
|
3248
|
+
n(this, "t_title", () => this.t("sys.title"));
|
3249
|
+
//#region 设置标题
|
3250
|
+
/**
|
3251
|
+
* 根据key设置多语言标题
|
3252
|
+
*/
|
3253
|
+
n(this, "setI18nTitle", (t) => {
|
3254
|
+
let e = this.t(t);
|
3255
|
+
this.setTitle(e);
|
3256
|
+
});
|
3257
|
+
/**
|
3258
|
+
* 设置标题
|
3259
|
+
*/
|
3260
|
+
n(this, "setTitle", (t = null, e = null) => {
|
3261
|
+
let s = this.t_title(), l;
|
3262
|
+
s ? t ? e ? l = `${t}(${e}) - ${s}` : l = `${t} - ${s}` : l = s : e ? l = `${t}(${e})` : l = t, document.title = l;
|
3263
|
+
});
|
3264
|
+
//#region 加载
|
3265
|
+
n(this, "addMessages", (t) => {
|
3266
|
+
let e = Object.keys(t);
|
3267
|
+
for (let s of e)
|
3268
|
+
this.messages[s] = t[s];
|
3269
|
+
this.setTitle(this.t("common.loading") + "...");
|
3270
|
+
});
|
3271
|
+
/**
|
3272
|
+
* 切换语言,自动加载菜单
|
3273
|
+
*/
|
3274
|
+
n(this, "switchI18n", async (t) => {
|
3275
|
+
Object.keys(this.messages).indexOf(t) == -1 && await this.loadI18n(t), this.lang = t;
|
3276
|
+
});
|
3277
|
+
}
|
3278
|
+
//#endregion
|
3279
|
+
//#region 开启
|
3280
|
+
async open(t) {
|
3281
|
+
let s = await (await E.provider.getDefault("sys")).getAsync("app");
|
3282
|
+
this.lang = (s == null ? void 0 : s.language) ?? st.getLanguage();
|
3202
3283
|
}
|
3284
|
+
//#endregion
|
3203
3285
|
}
|
3204
|
-
class
|
3286
|
+
class gs extends ps {
|
3287
|
+
constructor() {
|
3288
|
+
super(...arguments);
|
3289
|
+
n(this, "type", "Default");
|
3290
|
+
//#endregion
|
3291
|
+
n(this, "translate", (e, s) => {
|
3292
|
+
let l = this.messages[this.lang], r = e.split(".");
|
3293
|
+
return M.getValue(l, r);
|
3294
|
+
});
|
3295
|
+
n(this, "t_exists", (e) => {
|
3296
|
+
if (!e)
|
3297
|
+
return null;
|
3298
|
+
let s = this.messages[this.lang], l = e.split(".");
|
3299
|
+
return M.hasKey(s, l);
|
3300
|
+
});
|
3301
|
+
n(this, "loadI18n", async (e) => {
|
3302
|
+
e == null && (e = this.lang);
|
3303
|
+
let s = new Promise(async (r) => {
|
3304
|
+
let i = { conditions: [{ name: "lang", value: e }] };
|
3305
|
+
return T.post("/i18n", i).then(({ data: a }) => {
|
3306
|
+
a.forEach((o) => {
|
3307
|
+
let c = `${e}.${o.Module}.${o.Key}`.split(".");
|
3308
|
+
Y.addProperties(this.messages, c, o.Value);
|
3309
|
+
}), r(a);
|
3310
|
+
});
|
3311
|
+
}), l = new Promise((r) => {
|
3312
|
+
let i = { conditions: [{ name: "lang", value: e }] };
|
3313
|
+
T.post("/i18n_business", i).then(({ data: a }) => {
|
3314
|
+
a.forEach((o) => {
|
3315
|
+
let c = `${e}._business.${o.Table}.${o.Field}.${o.Key}`.split(".");
|
3316
|
+
Y.addProperties(this.messages, c, o.Value);
|
3317
|
+
}), r(a);
|
3318
|
+
});
|
3319
|
+
});
|
3320
|
+
await Promise.all([s, l]);
|
3321
|
+
});
|
3322
|
+
}
|
3323
|
+
//#region 开启
|
3324
|
+
async open(e) {
|
3325
|
+
await super.open(e);
|
3326
|
+
}
|
3327
|
+
}
|
3328
|
+
class fs extends B {
|
3329
|
+
//#region 开启
|
3330
|
+
open() {
|
3331
|
+
super.open(), super.addType(new gs());
|
3332
|
+
}
|
3333
|
+
//#endregion
|
3334
|
+
/**
|
3335
|
+
* 获取默认多语言
|
3336
|
+
*/
|
3337
|
+
async getDefault() {
|
3338
|
+
return await super.createIfAbsent("Default", "Default", async (e) => {
|
3339
|
+
await e.open();
|
3340
|
+
});
|
3341
|
+
}
|
3342
|
+
}
|
3343
|
+
class ms {
|
3344
|
+
constructor() {
|
3345
|
+
n(this, "type");
|
3346
|
+
}
|
3347
|
+
}
|
3348
|
+
class ys extends ms {
|
3205
3349
|
constructor() {
|
3206
3350
|
super(...arguments);
|
3207
3351
|
n(this, "type", "Console");
|
@@ -3228,9 +3372,9 @@ class ms extends gs {
|
|
3228
3372
|
console.warn(e);
|
3229
3373
|
}
|
3230
3374
|
}
|
3231
|
-
class
|
3375
|
+
class vs extends B {
|
3232
3376
|
get instances() {
|
3233
|
-
return [new
|
3377
|
+
return [new ys()];
|
3234
3378
|
}
|
3235
3379
|
/**
|
3236
3380
|
* 获取控制台消息提示类型
|
@@ -3239,12 +3383,12 @@ class ys extends F {
|
|
3239
3383
|
return await super.create("Console");
|
3240
3384
|
}
|
3241
3385
|
}
|
3242
|
-
class
|
3386
|
+
class ws {
|
3243
3387
|
constructor() {
|
3244
3388
|
n(this, "type");
|
3245
3389
|
}
|
3246
3390
|
}
|
3247
|
-
class bs extends
|
3391
|
+
class bs extends ws {
|
3248
3392
|
constructor() {
|
3249
3393
|
super(...arguments);
|
3250
3394
|
n(this, "type", "Default");
|
@@ -3255,7 +3399,7 @@ class bs extends vs {
|
|
3255
3399
|
}
|
3256
3400
|
async getSign(e, s, l, r, i) {
|
3257
3401
|
let o = `${e}.${s}.${l ?? ""}.${r}.${i}`;
|
3258
|
-
return (await
|
3402
|
+
return (await pt.compute(o)).toUpperCase();
|
3259
3403
|
}
|
3260
3404
|
loginUrl(e) {
|
3261
3405
|
return "";
|
@@ -3263,7 +3407,7 @@ class bs extends vs {
|
|
3263
3407
|
dispose() {
|
3264
3408
|
}
|
3265
3409
|
}
|
3266
|
-
class
|
3410
|
+
class xs extends B {
|
3267
3411
|
get instances() {
|
3268
3412
|
return [new bs()];
|
3269
3413
|
}
|
@@ -3275,7 +3419,7 @@ class ws extends F {
|
|
3275
3419
|
return await s.open(null), s;
|
3276
3420
|
}
|
3277
3421
|
}
|
3278
|
-
class
|
3422
|
+
class ks {
|
3279
3423
|
constructor() {
|
3280
3424
|
//#region 属性
|
3281
3425
|
n(this, "type", "Bearer");
|
@@ -3287,11 +3431,11 @@ class xs {
|
|
3287
3431
|
//#endregion
|
3288
3432
|
//#region 开启
|
3289
3433
|
async open(t) {
|
3290
|
-
this.provider = await
|
3434
|
+
this.provider = await E.provider.getDefault("user");
|
3291
3435
|
}
|
3292
3436
|
//#endregion
|
3293
3437
|
async login(t) {
|
3294
|
-
return
|
3438
|
+
return T.post(`/user/login?type=${this.type}`, t).then(async (e) => (await this.provider.saveAsync("sso", e.data), T.user = e.data, T.sso = await E.sso.create(e.data.type), Promise.resolve(e)));
|
3295
3439
|
}
|
3296
3440
|
loginUrl(t) {
|
3297
3441
|
return "";
|
@@ -3321,11 +3465,11 @@ class Ss {
|
|
3321
3465
|
//#endregion
|
3322
3466
|
//#region 开启
|
3323
3467
|
async open(t) {
|
3324
|
-
this.url = t.url, this.app_id = t.app_id, this.provider = await
|
3468
|
+
this.url = t.url, this.app_id = t.app_id, this.provider = await E.provider.getDefault("user");
|
3325
3469
|
}
|
3326
3470
|
//#endregion
|
3327
3471
|
async login(t) {
|
3328
|
-
await this.provider.saveAsync("sso", t),
|
3472
|
+
await this.provider.saveAsync("sso", t), T.user = t, T.sso = await E.sso.create(t.type);
|
3329
3473
|
}
|
3330
3474
|
loginUrl(t) {
|
3331
3475
|
let e = encodeURIComponent(t);
|
@@ -3341,7 +3485,7 @@ class Ss {
|
|
3341
3485
|
await this.provider.deleteAsync("user"), await this.provider.deleteAsync("sso");
|
3342
3486
|
}
|
3343
3487
|
}
|
3344
|
-
class
|
3488
|
+
class at {
|
3345
3489
|
constructor() {
|
3346
3490
|
/**
|
3347
3491
|
* 用户标识
|
@@ -3361,7 +3505,7 @@ class ot {
|
|
3361
3505
|
n(this, "identity");
|
3362
3506
|
}
|
3363
3507
|
}
|
3364
|
-
class
|
3508
|
+
class Es {
|
3365
3509
|
constructor() {
|
3366
3510
|
n(this, "type", "WeiXin");
|
3367
3511
|
}
|
@@ -3373,7 +3517,7 @@ class ks {
|
|
3373
3517
|
return "";
|
3374
3518
|
}
|
3375
3519
|
async getUser() {
|
3376
|
-
let t = new
|
3520
|
+
let t = new at();
|
3377
3521
|
return t.userId = "", t;
|
3378
3522
|
}
|
3379
3523
|
getAuth(t, e, s, l) {
|
@@ -3383,12 +3527,12 @@ class ks {
|
|
3383
3527
|
return Promise.resolve();
|
3384
3528
|
}
|
3385
3529
|
}
|
3386
|
-
class
|
3530
|
+
class Cs {
|
3387
3531
|
constructor() {
|
3388
3532
|
n(this, "type");
|
3389
3533
|
}
|
3390
3534
|
}
|
3391
|
-
class
|
3535
|
+
class Ts extends Cs {
|
3392
3536
|
constructor() {
|
3393
3537
|
super(...arguments);
|
3394
3538
|
//#region 属性
|
@@ -3400,7 +3544,7 @@ class Cs extends Es {
|
|
3400
3544
|
}
|
3401
3545
|
//#endregion
|
3402
3546
|
async open(e) {
|
3403
|
-
this.provider = await
|
3547
|
+
this.provider = await E.provider.getDefault("user");
|
3404
3548
|
}
|
3405
3549
|
async login(e) {
|
3406
3550
|
}
|
@@ -3410,10 +3554,10 @@ class Cs extends Es {
|
|
3410
3554
|
async getUser() {
|
3411
3555
|
let e = await this.provider.getAsync("anonymous");
|
3412
3556
|
if (!e) {
|
3413
|
-
let l =
|
3557
|
+
let l = W.getUniqueId();
|
3414
3558
|
await this.provider.saveAsync("anonymous", l), e = l;
|
3415
3559
|
}
|
3416
|
-
let s = new
|
3560
|
+
let s = new at();
|
3417
3561
|
return s.identity = { token: e }, s;
|
3418
3562
|
}
|
3419
3563
|
getAuth(e, s, l, r) {
|
@@ -3423,7 +3567,7 @@ class Cs extends Es {
|
|
3423
3567
|
await this.provider.deleteAsync("anonymous");
|
3424
3568
|
}
|
3425
3569
|
}
|
3426
|
-
class
|
3570
|
+
class $s {
|
3427
3571
|
constructor() {
|
3428
3572
|
//#region 属性
|
3429
3573
|
n(this, "type", "Secret");
|
@@ -3434,10 +3578,10 @@ class Ts {
|
|
3434
3578
|
}
|
3435
3579
|
//#endregion
|
3436
3580
|
async open(t) {
|
3437
|
-
this.provider = await
|
3581
|
+
this.provider = await E.provider.getDefault("user");
|
3438
3582
|
}
|
3439
3583
|
async login(t) {
|
3440
|
-
return
|
3584
|
+
return T.post(`/user/login?type=${this.type}`, t).then(async (e) => {
|
3441
3585
|
let s = e.data;
|
3442
3586
|
return await this.provider.saveAsync("sso", s), Promise.resolve(e);
|
3443
3587
|
});
|
@@ -3455,172 +3599,6 @@ class Ts {
|
|
3455
3599
|
await this.provider.deleteAsync("user");
|
3456
3600
|
}
|
3457
3601
|
}
|
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
3602
|
class Ls {
|
3625
3603
|
constructor() {
|
3626
3604
|
/**
|
@@ -3657,9 +3635,9 @@ class As {
|
|
3657
3635
|
n(this, "app", new Ls());
|
3658
3636
|
}
|
3659
3637
|
}
|
3660
|
-
class
|
3638
|
+
class ot {
|
3661
3639
|
}
|
3662
|
-
class
|
3640
|
+
class ut extends ot {
|
3663
3641
|
constructor() {
|
3664
3642
|
super(...arguments);
|
3665
3643
|
//#region 属性
|
@@ -3690,7 +3668,7 @@ class ct extends ut {
|
|
3690
3668
|
//#region 开启
|
3691
3669
|
open() {
|
3692
3670
|
let e = this.sys.app;
|
3693
|
-
e.background =
|
3671
|
+
e.background = de.background, e.theme = de.theme, e.layout = de.layout, e.language = de.language, e.font = de.font;
|
3694
3672
|
}
|
3695
3673
|
/**
|
3696
3674
|
* 初始化配置值(不一定跟登录用户相关,这也是单独分离的好处)
|
@@ -3698,10 +3676,10 @@ class ct extends ut {
|
|
3698
3676
|
async bind(e) {
|
3699
3677
|
for (let l of e) {
|
3700
3678
|
let i = await this.get(l.kind, l.type) ?? l.content;
|
3701
|
-
|
3679
|
+
Y.addProperties(this, [l.kind, l.type], i);
|
3702
3680
|
}
|
3703
3681
|
let s = this.sys.app;
|
3704
|
-
|
3682
|
+
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
3683
|
}
|
3706
3684
|
/**
|
3707
3685
|
* 尝试添加架构
|
@@ -3725,7 +3703,7 @@ class ct extends ut {
|
|
3725
3703
|
* 获取本地配置
|
3726
3704
|
*/
|
3727
3705
|
async get(e, s) {
|
3728
|
-
return await (await
|
3706
|
+
return await (await E.provider.getDefault(e)).getAsync(s);
|
3729
3707
|
}
|
3730
3708
|
/**
|
3731
3709
|
* 设置背景
|
@@ -3742,11 +3720,11 @@ class ct extends ut {
|
|
3742
3720
|
let s = this.sys.app, l = document.documentElement, r = e.layout;
|
3743
3721
|
l.classList.remove(s.layout), l.classList.add(r), s.layout = r;
|
3744
3722
|
let i = e.theme;
|
3745
|
-
|
3723
|
+
R.removeClass(l, s.theme), R.addClass(l, i), s.theme = i, we.emit("theme", i);
|
3746
3724
|
let a = e.background;
|
3747
3725
|
this.setBackground(a), we.emit("background", a);
|
3748
3726
|
let o = e.font;
|
3749
|
-
s.font = o,
|
3727
|
+
s.font = o, R.addStyle(l, "font-family", o);
|
3750
3728
|
}
|
3751
3729
|
//#region 配置
|
3752
3730
|
/**
|
@@ -3758,7 +3736,7 @@ class ct extends ut {
|
|
3758
3736
|
if (r)
|
3759
3737
|
return Promise.resolve(r);
|
3760
3738
|
}
|
3761
|
-
return
|
3739
|
+
return T.get(`/user/config?kind=${e}&type=${s}`).then((r) => {
|
3762
3740
|
let i = r.data ? JSON.parse(r.data) : null;
|
3763
3741
|
return Promise.resolve(i);
|
3764
3742
|
});
|
@@ -3767,24 +3745,24 @@ class ct extends ut {
|
|
3767
3745
|
* 全量保存用户配置
|
3768
3746
|
*/
|
3769
3747
|
async save(e, s, l, r = !0) {
|
3770
|
-
return r && await (await
|
3748
|
+
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
3749
|
}
|
3772
3750
|
/**
|
3773
3751
|
* 部分保存用户配置
|
3774
3752
|
*/
|
3775
3753
|
async patch(e, s, l) {
|
3776
|
-
return
|
3754
|
+
return T.patch(`/user/config?kind=${e}&type=${s}`, l).then((r) => Promise.resolve(!0));
|
3777
3755
|
}
|
3778
3756
|
//#endregion
|
3779
3757
|
/**
|
3780
3758
|
* 获取当前语言
|
3781
3759
|
*/
|
3782
3760
|
getLanguage() {
|
3783
|
-
let e =
|
3761
|
+
let e = st.getLanguage();
|
3784
3762
|
return this.sys.app.language || e || "zh-cn";
|
3785
3763
|
}
|
3786
3764
|
}
|
3787
|
-
class
|
3765
|
+
class Ds {
|
3788
3766
|
constructor() {
|
3789
3767
|
/**
|
3790
3768
|
* 环境变量
|
@@ -3795,18 +3773,21 @@ class Is {
|
|
3795
3773
|
* 使用环境变量
|
3796
3774
|
*/
|
3797
3775
|
useEnv(t) {
|
3798
|
-
this.env = t, this.env.base =
|
3776
|
+
this.env = t, this.env.base = W.trimEnd(t.VITE_ROOT, "/");
|
3799
3777
|
}
|
3800
3778
|
}
|
3801
|
-
class
|
3779
|
+
class Is {
|
3802
3780
|
constructor() {
|
3781
|
+
/**
|
3782
|
+
* 日志集合
|
3783
|
+
*/
|
3803
3784
|
n(this, "logs", []);
|
3804
3785
|
}
|
3805
3786
|
/**
|
3806
3787
|
* 手动添加日志
|
3807
3788
|
*/
|
3808
3789
|
add(t, e, s, l = null) {
|
3809
|
-
let r =
|
3790
|
+
let r = te.getTimeString();
|
3810
3791
|
this.logs.unshift({ time: r, code: t, message: e, stack: s, elapsed: l });
|
3811
3792
|
}
|
3812
3793
|
/**
|
@@ -3824,6 +3805,10 @@ class Ds {
|
|
3824
3805
|
}
|
3825
3806
|
class Os {
|
3826
3807
|
constructor() {
|
3808
|
+
/**
|
3809
|
+
* 获取侧边栏宽度
|
3810
|
+
*/
|
3811
|
+
n(this, "getSidebarWidth", () => this.web.sidebar && this.web.sidebar.width ? this.web.sidebar.width : 210);
|
3827
3812
|
if (typeof window > "u")
|
3828
3813
|
return;
|
3829
3814
|
let t = window._setting ?? window.setting;
|
@@ -3903,10 +3888,10 @@ class js {
|
|
3903
3888
|
* 加载设置
|
3904
3889
|
*/
|
3905
3890
|
async load() {
|
3906
|
-
return
|
3891
|
+
return T.get("/app/setting").then(({ data: t }) => (Object.keys(t).forEach((e) => {
|
3907
3892
|
let s = t[e];
|
3908
3893
|
s && (this[e] = s);
|
3909
|
-
}),
|
3894
|
+
}), R.addClass(document.documentElement, this.theme, De.web.theme), we.emits({ theme: this.theme }), Promise.resolve(t))).catch((t) => Promise.reject(t));
|
3910
3895
|
}
|
3911
3896
|
}
|
3912
3897
|
class Rs {
|
@@ -3937,8 +3922,8 @@ class Rs {
|
|
3937
3922
|
if (!De.api.ws)
|
3938
3923
|
return;
|
3939
3924
|
if (this.socket == null || this.reconnect) {
|
3940
|
-
let e = De.api.ws, s = new
|
3941
|
-
s.path = e, s.method = "GET", await
|
3925
|
+
let e = De.api.ws, s = new it();
|
3926
|
+
s.path = e, s.method = "GET", await T.onRequest(s);
|
3942
3927
|
let l = s.getHeader("Authorization"), r = K.encode(l), i = `${e}?authorization=${r}`;
|
3943
3928
|
this.socket = new WebSocket(i);
|
3944
3929
|
}
|
@@ -4001,19 +3986,19 @@ class _s {
|
|
4001
3986
|
* 获取本地缓存中的用户信息;好处:即使手动更改storage数据,也可以里面获取到
|
4002
3987
|
*/
|
4003
3988
|
async getSso() {
|
4004
|
-
return await (await
|
3989
|
+
return await (await E.provider.getDefault("user")).getEntity("sso");
|
4005
3990
|
}
|
4006
3991
|
/**
|
4007
3992
|
* 登录后,获取用户信息
|
4008
3993
|
*/
|
4009
3994
|
async loadInfo() {
|
4010
|
-
return
|
3995
|
+
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
3996
|
}
|
4012
3997
|
/**
|
4013
3998
|
* 未登录,获取匿名登录信息
|
4014
3999
|
*/
|
4015
4000
|
async getAnonymous() {
|
4016
|
-
await
|
4001
|
+
await H.bind([]);
|
4017
4002
|
}
|
4018
4003
|
/**
|
4019
4004
|
* 根据路径获取路由
|
@@ -4026,20 +4011,20 @@ class _s {
|
|
4026
4011
|
* 加载服务端路由
|
4027
4012
|
*/
|
4028
4013
|
async loadMenus() {
|
4029
|
-
return
|
4014
|
+
return T.get("/user/menu").then(({ data: t }) => (this.menus = t, this.menusFlat = Oe.getFlat(t, "children"), Promise.resolve(t)));
|
4030
4015
|
}
|
4031
4016
|
/**
|
4032
4017
|
* 退出登录
|
4033
4018
|
*/
|
4034
4019
|
async logout() {
|
4035
|
-
return
|
4020
|
+
return T.post("/user/logout").then(async () => {
|
4036
4021
|
this.user = null, this.menus = null;
|
4037
4022
|
let t = await this.getSso();
|
4038
|
-
return await (await
|
4023
|
+
return await (await E.sso.create(t.type)).logout(), Us.disconnect(), Promise.resolve();
|
4039
4024
|
});
|
4040
4025
|
}
|
4041
4026
|
}
|
4042
|
-
class
|
4027
|
+
class ct extends ot {
|
4043
4028
|
constructor() {
|
4044
4029
|
super(...arguments);
|
4045
4030
|
//#region 属性
|
@@ -4073,7 +4058,7 @@ class dt extends ut {
|
|
4073
4058
|
*/
|
4074
4059
|
async loadApps(e = !1) {
|
4075
4060
|
if (!this.loading.apps && !(!e && this.loaded.apps))
|
4076
|
-
return this.loading.apps = !0,
|
4061
|
+
return this.loading.apps = !0, T.post("/app/options").then((s) => {
|
4077
4062
|
this.apps = s.data, this.loaded.apps = !0;
|
4078
4063
|
}).finally(() => {
|
4079
4064
|
this.loading.apps = !1;
|
@@ -4084,18 +4069,18 @@ class dt extends ut {
|
|
4084
4069
|
*/
|
4085
4070
|
async loadEnvs(e = !1) {
|
4086
4071
|
if (!this.loading.envs && (this.loading.envs = !0, !(!e && this.loaded.envs)))
|
4087
|
-
return
|
4072
|
+
return T.post("/env/options").then((s) => {
|
4088
4073
|
this.envs = s.data, this.loaded.envs = !0;
|
4089
4074
|
}).finally(() => {
|
4090
4075
|
this.loading.envs = !1;
|
4091
4076
|
});
|
4092
4077
|
}
|
4093
4078
|
}
|
4094
|
-
class Bs extends
|
4079
|
+
class Bs extends B {
|
4095
4080
|
open() {
|
4096
4081
|
super.open(), super.instances = [
|
4097
|
-
new
|
4098
|
-
new
|
4082
|
+
new ut(),
|
4083
|
+
new ct()
|
4099
4084
|
];
|
4100
4085
|
}
|
4101
4086
|
static() {
|
@@ -4108,42 +4093,31 @@ class Bs extends F {
|
|
4108
4093
|
return await super.createIfAbsent("Config");
|
4109
4094
|
}
|
4110
4095
|
}
|
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 {
|
4096
|
+
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) => {
|
4097
|
+
H.open();
|
4098
|
+
};
|
4099
|
+
class Ns extends B {
|
4126
4100
|
/**
|
4127
4101
|
* 获取实例
|
4128
4102
|
*/
|
4129
4103
|
get instances() {
|
4130
|
-
return [new
|
4104
|
+
return [new $s(), new Ss(), new Es(), new ks(), new Ts()];
|
4131
4105
|
}
|
4132
4106
|
/**
|
4133
4107
|
* 获取指定SSO实例
|
4134
4108
|
*/
|
4135
4109
|
async create(t, e) {
|
4136
|
-
let s =
|
4110
|
+
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
4111
|
return await r.open(l), r;
|
4138
4112
|
}
|
4139
4113
|
}
|
4140
|
-
class
|
4114
|
+
class Vs {
|
4141
4115
|
constructor() {
|
4142
4116
|
n(this, "type");
|
4143
4117
|
n(this, "taskLimit");
|
4144
4118
|
}
|
4145
4119
|
}
|
4146
|
-
class
|
4120
|
+
class qs extends Vs {
|
4147
4121
|
constructor() {
|
4148
4122
|
super(...arguments);
|
4149
4123
|
//#region 属性
|
@@ -4161,7 +4135,7 @@ class Hs extends Zs {
|
|
4161
4135
|
async execute(e, s, l) {
|
4162
4136
|
if (e.length == 0)
|
4163
4137
|
return;
|
4164
|
-
let r =
|
4138
|
+
let r = ue.getChunksByCount(e, s), i = ue.create(r, (a, o) => l(a, o));
|
4165
4139
|
await Promise.all(i);
|
4166
4140
|
}
|
4167
4141
|
async executeFrequency(e, s, l, r) {
|
@@ -4197,42 +4171,42 @@ class Hs extends Zs {
|
|
4197
4171
|
clearInterval(this.intervalTimeout);
|
4198
4172
|
}
|
4199
4173
|
}
|
4200
|
-
class
|
4174
|
+
class zs extends B {
|
4201
4175
|
get instances() {
|
4202
|
-
return [new
|
4176
|
+
return [new qs()];
|
4203
4177
|
}
|
4204
4178
|
}
|
4205
|
-
class
|
4179
|
+
class Ks {
|
4206
4180
|
constructor() {
|
4207
4181
|
n(this, "type");
|
4208
4182
|
}
|
4209
4183
|
}
|
4210
|
-
class
|
4184
|
+
class Ws extends Ks {
|
4211
4185
|
constructor() {
|
4212
4186
|
super(...arguments);
|
4213
4187
|
n(this, "type", "Liquid");
|
4214
4188
|
}
|
4215
4189
|
async render(e, s) {
|
4216
|
-
let l = new
|
4190
|
+
let l = new Dt(), r = l.parse(e);
|
4217
4191
|
return await l.render(r, s);
|
4218
4192
|
}
|
4219
4193
|
}
|
4220
|
-
class
|
4194
|
+
class Qs extends B {
|
4221
4195
|
get instances() {
|
4222
|
-
return [new
|
4196
|
+
return [new Ws()];
|
4223
4197
|
}
|
4224
4198
|
}
|
4225
|
-
class rr extends
|
4199
|
+
class rr extends B {
|
4226
4200
|
get instances() {
|
4227
4201
|
return [];
|
4228
4202
|
}
|
4229
4203
|
}
|
4230
|
-
class
|
4204
|
+
class dt {
|
4231
4205
|
constructor() {
|
4232
4206
|
n(this, "type");
|
4233
4207
|
}
|
4234
4208
|
}
|
4235
|
-
class
|
4209
|
+
class Js extends dt {
|
4236
4210
|
constructor() {
|
4237
4211
|
super(...arguments);
|
4238
4212
|
n(this, "type", "Tencent");
|
@@ -4253,7 +4227,7 @@ class rl extends pt {
|
|
4253
4227
|
startRecord() {
|
4254
4228
|
}
|
4255
4229
|
}
|
4256
|
-
class
|
4230
|
+
class Xs extends dt {
|
4257
4231
|
constructor() {
|
4258
4232
|
super(...arguments);
|
4259
4233
|
n(this, "type", "Default");
|
@@ -4267,104 +4241,102 @@ class nl extends pt {
|
|
4267
4241
|
return "";
|
4268
4242
|
}
|
4269
4243
|
}
|
4270
|
-
class nr extends
|
4244
|
+
class nr extends B {
|
4271
4245
|
get instances() {
|
4272
|
-
return [new
|
4246
|
+
return [new Xs(), new Js()];
|
4273
4247
|
}
|
4274
4248
|
}
|
4275
4249
|
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
4250
|
//#region 驱动工厂
|
4285
4251
|
/**
|
4286
4252
|
* Builder工厂
|
4287
4253
|
*/
|
4288
4254
|
static get builder() {
|
4289
|
-
return this.create(
|
4255
|
+
return this.create(qt);
|
4290
4256
|
}
|
4291
4257
|
/**
|
4292
4258
|
* CDN工厂
|
4293
4259
|
*/
|
4294
4260
|
static get cdn() {
|
4295
|
-
return this.create(
|
4261
|
+
return this.create(Wt);
|
4296
4262
|
}
|
4297
4263
|
/**
|
4298
4264
|
* 编码器工厂
|
4299
4265
|
*/
|
4300
4266
|
static get encoder() {
|
4301
|
-
return this.create(
|
4267
|
+
return this.create(Xt);
|
4302
4268
|
}
|
4303
4269
|
/**
|
4304
4270
|
* Excel工厂
|
4305
4271
|
*/
|
4306
4272
|
static get excel() {
|
4307
|
-
return this.create(
|
4273
|
+
return this.create(Zt);
|
4308
4274
|
}
|
4309
4275
|
/**
|
4310
4276
|
* Explainer工厂
|
4311
4277
|
*/
|
4312
4278
|
static get explainer() {
|
4313
|
-
return this.create(
|
4279
|
+
return this.create(ts);
|
4314
4280
|
}
|
4315
4281
|
/**
|
4316
4282
|
* 特征工厂
|
4317
4283
|
*/
|
4318
4284
|
static get feature() {
|
4319
|
-
return this.create(
|
4285
|
+
return this.create(ns);
|
4320
4286
|
}
|
4321
4287
|
/**
|
4322
4288
|
* 哈希工厂
|
4323
4289
|
*/
|
4324
4290
|
static get hasher() {
|
4325
|
-
return this.create(
|
4291
|
+
return this.create(os);
|
4326
4292
|
}
|
4327
4293
|
/**
|
4328
4294
|
* Http请求工厂
|
4329
4295
|
*/
|
4330
4296
|
static get http() {
|
4297
|
+
return this.create(hs);
|
4298
|
+
}
|
4299
|
+
/**
|
4300
|
+
* 多语言工厂
|
4301
|
+
*/
|
4302
|
+
static get i18n() {
|
4331
4303
|
return this.create(fs);
|
4332
4304
|
}
|
4333
4305
|
/**
|
4334
4306
|
* 消息提示请求工厂
|
4335
4307
|
*/
|
4336
4308
|
static get messenger() {
|
4337
|
-
return this.create(
|
4309
|
+
return this.create(vs);
|
4338
4310
|
}
|
4339
4311
|
/**
|
4340
4312
|
* 提供程序工厂
|
4341
4313
|
*/
|
4342
4314
|
static get provider() {
|
4343
|
-
return this.create(
|
4315
|
+
return this.create(Nt);
|
4344
4316
|
}
|
4345
4317
|
/**
|
4346
4318
|
* 签名工厂
|
4347
4319
|
*/
|
4348
4320
|
static get signer() {
|
4349
|
-
return this.create(
|
4321
|
+
return this.create(xs);
|
4350
4322
|
}
|
4351
4323
|
/**
|
4352
4324
|
* SSO工厂
|
4353
4325
|
*/
|
4354
4326
|
static get sso() {
|
4355
|
-
return this.create(
|
4327
|
+
return this.create(Ns);
|
4356
4328
|
}
|
4357
4329
|
/**
|
4358
4330
|
* Task工厂
|
4359
4331
|
*/
|
4360
4332
|
static get task() {
|
4361
|
-
return this.create(
|
4333
|
+
return this.create(zs);
|
4362
4334
|
}
|
4363
4335
|
/**
|
4364
4336
|
* 模板工厂
|
4365
4337
|
*/
|
4366
4338
|
static get template() {
|
4367
|
-
return this.create(
|
4339
|
+
return this.create(Qs);
|
4368
4340
|
}
|
4369
4341
|
//#endregion
|
4370
4342
|
//#region 服务工厂
|
@@ -4374,54 +4346,64 @@ class ht {
|
|
4374
4346
|
static get svc() {
|
4375
4347
|
return this.create(Bs);
|
4376
4348
|
}
|
4349
|
+
/**
|
4350
|
+
* 并缓存工厂实例
|
4351
|
+
*/
|
4352
|
+
static create(t) {
|
4353
|
+
let e = t.name, s = this.mappings[e];
|
4354
|
+
return s || (s = new t(), s.open(), this.mappings[e] = s), s;
|
4355
|
+
}
|
4377
4356
|
//#endregion
|
4378
4357
|
}
|
4358
|
+
//#endregion
|
4379
4359
|
//#region 缓存
|
4380
4360
|
/**
|
4381
4361
|
* 工厂缓存
|
4382
4362
|
*/
|
4383
4363
|
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
|
-
|
4364
|
+
const E = ht;
|
4365
|
+
let Ys = {}, me = {}, T = {}, J = {}, pt = {}, Gs = {}, ve = {}, Zs = async (u) => {
|
4366
|
+
let e = await (await E.provider.getDefault("sys")).getAsync("app");
|
4367
|
+
(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;
|
4368
|
+
}, Hs = async () => {
|
4369
|
+
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();
|
4370
|
+
}, el = {}, tl = {}, sl = {}, ll = {}, rl = {}, nl = {}, il = {}, al = {}, ol = {}, ul = {};
|
4371
|
+
class cl {
|
4390
4372
|
constructor() {
|
4391
4373
|
/**
|
4392
4374
|
* 消息发送对象
|
4393
4375
|
*/
|
4394
4376
|
n(this, "messenger");
|
4395
|
-
/**
|
4396
|
-
* 实际的多语言翻译服务实体
|
4397
|
-
*/
|
4398
|
-
n(this, "i18nSvc");
|
4399
4377
|
/**
|
4400
4378
|
* 基准请求地址
|
4401
4379
|
*/
|
4402
4380
|
n(this, "baseUrl");
|
4381
|
+
/**
|
4382
|
+
* 自定义语言包
|
4383
|
+
*/
|
4384
|
+
n(this, "lang");
|
4403
4385
|
/**
|
4404
4386
|
* CDN类型
|
4405
4387
|
*/
|
4406
4388
|
n(this, "cdn", "Local");
|
4407
4389
|
}
|
4408
4390
|
}
|
4409
|
-
const
|
4391
|
+
const dl = { class: "ha-empty" }, hl = { class: "empty-message" }, pl = {
|
4410
4392
|
key: 0,
|
4411
4393
|
class: "empty-content"
|
4412
|
-
}, ir = /* @__PURE__ */
|
4394
|
+
}, ir = /* @__PURE__ */ Q({
|
4413
4395
|
__name: "Empty",
|
4414
4396
|
props: {
|
4415
4397
|
message: { type: String, default: "暂无数据" },
|
4416
4398
|
hasData: Boolean
|
4417
4399
|
},
|
4418
4400
|
setup(u) {
|
4419
|
-
let t = u, { message: e, hasData: s } =
|
4420
|
-
return (l, r) => (
|
4421
|
-
D("div",
|
4422
|
-
y(s) ? (
|
4401
|
+
let t = u, { message: e, hasData: s } = se(t);
|
4402
|
+
return (l, r) => (O(), _("div", dl, [
|
4403
|
+
D("div", hl, pe(y(e)), 1),
|
4404
|
+
y(s) ? (O(), _("div", pl, [
|
4423
4405
|
ge(l.$slots, "default")
|
4424
|
-
])) :
|
4406
|
+
])) : Ze("", !0)
|
4425
4407
|
]));
|
4426
4408
|
}
|
4427
4409
|
});
|
@@ -4438,7 +4420,7 @@ class gt {
|
|
4438
4420
|
this.x = t, this.y = e;
|
4439
4421
|
}
|
4440
4422
|
}
|
4441
|
-
class
|
4423
|
+
class gl extends gt {
|
4442
4424
|
constructor() {
|
4443
4425
|
super(...arguments);
|
4444
4426
|
/**
|
@@ -4455,7 +4437,7 @@ class ar extends gt {
|
|
4455
4437
|
this.width = l, this.height = r;
|
4456
4438
|
}
|
4457
4439
|
}
|
4458
|
-
class
|
4440
|
+
class ft {
|
4459
4441
|
constructor() {
|
4460
4442
|
//#region 大小调整
|
4461
4443
|
n(this, "resizeObserver", null);
|
@@ -4502,8 +4484,8 @@ class mt {
|
|
4502
4484
|
* 事件防抖: time ms没重复触发才执行指定操作
|
4503
4485
|
*/
|
4504
4486
|
n(this, "debounce", (t, e, s = null) => {
|
4505
|
-
this.lastDebounceTime == null && (this.lastDebounceTime =
|
4506
|
-
let l =
|
4487
|
+
this.lastDebounceTime == null && (this.lastDebounceTime = te.getTimestamp());
|
4488
|
+
let l = te.getTimestamp();
|
4507
4489
|
this.lastDebounceTimeout != null && clearTimeout(this.lastDebounceTimeout), this.lastDebounceTimeout = setTimeout(t, e, s), this.lastDebounceTime = l;
|
4508
4490
|
});
|
4509
4491
|
//#endregion
|
@@ -4544,18 +4526,18 @@ class mt {
|
|
4544
4526
|
return;
|
4545
4527
|
this.dragElement = t;
|
4546
4528
|
let s = !1, l = (a) => (s = !0, a.preventDefault(), e.init(a)), r = (a) => {
|
4547
|
-
let o = new
|
4529
|
+
let o = new gl(), c = e.range;
|
4548
4530
|
if (c == null)
|
4549
4531
|
o.x = a.clientX, o.y = a.clientY;
|
4550
4532
|
else {
|
4551
|
-
let { x:
|
4552
|
-
a.clientX <
|
4533
|
+
let { x: h, y: d, width: p, height: f } = c;
|
4534
|
+
a.clientX < h ? o.x = h : a.clientX > h + p ? o.x = h + p : o.x = a.clientX, a.clientY < d ? o.y = d : a.clientY > d + f ? o.y = d + f : o.y = a.clientY;
|
4553
4535
|
}
|
4554
4536
|
if (e.affix) {
|
4555
4537
|
if (e.range == null)
|
4556
4538
|
throw new Error("设置吸附距离时,必须设置范围信息");
|
4557
|
-
let
|
4558
|
-
o.x <= e.affix ? o.affix = "left" : o.x >=
|
4539
|
+
let h = c.x + c.width, d = c.y + c.height;
|
4540
|
+
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
4541
|
}
|
4560
4542
|
e.handler(o, this.dragStart, this.dragStartData, s, a), s = !1;
|
4561
4543
|
}, i = (a) => {
|
@@ -4753,7 +4735,7 @@ class cr {
|
|
4753
4735
|
* 根据鼠标事件,显示右键上下文弹窗
|
4754
4736
|
*/
|
4755
4737
|
n(this, "show", (t) => {
|
4756
|
-
let s =
|
4738
|
+
let s = R.parentAbsolute(this.container).getBoundingClientRect(), l = t.clientX - s.left, r = t.clientY - s.top - 2;
|
4757
4739
|
this.container.style.display = "block", this.container.style.left = l + "px", this.container.style.top = r + "px";
|
4758
4740
|
});
|
4759
4741
|
/**
|
@@ -4762,7 +4744,7 @@ class cr {
|
|
4762
4744
|
n(this, "dispose", () => {
|
4763
4745
|
for (let t = 0; t < this.closeTriggers.length; t++) {
|
4764
4746
|
let e = this.closeTriggers[t];
|
4765
|
-
|
4747
|
+
ae.unbind(["click", "scroll"], e, this.close);
|
4766
4748
|
}
|
4767
4749
|
this.container != null && this.container.removeEventListener("click", this.close), this.container = null, this.closeTriggers = [];
|
4768
4750
|
});
|
@@ -4770,106 +4752,122 @@ class cr {
|
|
4770
4752
|
this.closeTriggers.push(...e);
|
4771
4753
|
for (let s = 0; s < this.closeTriggers.length; s++) {
|
4772
4754
|
let l = this.closeTriggers[s];
|
4773
|
-
|
4755
|
+
ae.bind(["click", "scroll"], l, this.close);
|
4774
4756
|
}
|
4775
4757
|
}
|
4776
4758
|
}
|
4777
4759
|
}
|
4778
|
-
|
4760
|
+
class dr {
|
4761
|
+
/**
|
4762
|
+
* 开启表单监控
|
4763
|
+
*/
|
4764
|
+
async open(t, e, s) {
|
4765
|
+
let l = await E.provider.getDefault(e), r = await l.getAsync(s);
|
4766
|
+
r && Y.mergeTo(t, r), X(() => t, (i, a) => {
|
4767
|
+
l && l.saveAsync(s, t);
|
4768
|
+
}, { deep: !0 });
|
4769
|
+
}
|
4770
|
+
/**
|
4771
|
+
* 资源释放
|
4772
|
+
*/
|
4773
|
+
dispose() {
|
4774
|
+
}
|
4775
|
+
}
|
4776
|
+
const fl = /* @__PURE__ */ Q({
|
4779
4777
|
__name: "Fill",
|
4780
4778
|
emits: ["resize"],
|
4781
4779
|
setup(u, { emit: t }) {
|
4782
|
-
let e = t, s =
|
4783
|
-
let
|
4784
|
-
r.value =
|
4780
|
+
let e = t, s = I(), l = I(), r = I(), i = new ft(), a = () => {
|
4781
|
+
let h = R.siblings(s.value);
|
4782
|
+
r.value = R.getHeight(h);
|
4785
4783
|
}, o = () => {
|
4786
|
-
l.value =
|
4784
|
+
l.value = R.getHeight(s.value), e("resize", l.value);
|
4787
4785
|
}, c = () => {
|
4788
4786
|
o();
|
4789
4787
|
};
|
4790
|
-
return
|
4788
|
+
return be(() => {
|
4791
4789
|
a(), o(), i.resize(s.value, c);
|
4792
|
-
}),
|
4790
|
+
}), xe(() => {
|
4793
4791
|
i.dispose();
|
4794
|
-
}), (
|
4792
|
+
}), (h, d) => (O(), _("div", {
|
4795
4793
|
class: "ha-fill",
|
4796
4794
|
ref_key: "fillRef",
|
4797
4795
|
ref: s,
|
4798
|
-
style:
|
4796
|
+
style: fe({ height: `calc(100% - ${y(r)}px)` })
|
4799
4797
|
}, [
|
4800
|
-
ge(
|
4798
|
+
ge(h.$slots, "default")
|
4801
4799
|
], 4));
|
4802
4800
|
}
|
4803
|
-
}),
|
4801
|
+
}), ml = /* @__PURE__ */ Q({
|
4804
4802
|
__name: "Scroller",
|
4805
4803
|
props: {
|
4806
4804
|
options: {}
|
4807
4805
|
},
|
4808
4806
|
emits: ["scroll"],
|
4809
4807
|
setup(u, { expose: t, emit: e }) {
|
4810
|
-
let s = e, l = u, { options: r } =
|
4811
|
-
if (
|
4808
|
+
let s = e, l = u, { options: r } = se(l), i = I(), a = I(), o = I(), c = I(), h = I(!1), d = null, p = null, f = new ft(), b = I({ top: null, height: null }), N = (v) => {
|
4809
|
+
if (p == 0)
|
4812
4810
|
return 0;
|
4813
|
-
let
|
4814
|
-
return v /
|
4811
|
+
let w = p - d;
|
4812
|
+
return v / w;
|
4815
4813
|
}, V = (v) => {
|
4816
|
-
let
|
4817
|
-
return v /
|
4818
|
-
},
|
4819
|
-
let
|
4820
|
-
|
4821
|
-
},
|
4822
|
-
if (
|
4814
|
+
let w = d - b.value.height;
|
4815
|
+
return v / w;
|
4816
|
+
}, ce = (v) => {
|
4817
|
+
let w = v.target, j = N(w.scrollTop);
|
4818
|
+
L(j), s("scroll", w);
|
4819
|
+
}, le = () => {
|
4820
|
+
if (p == 0)
|
4823
4821
|
return 80;
|
4824
|
-
let v = d /
|
4822
|
+
let v = d / p;
|
4825
4823
|
if (v == 1)
|
4826
4824
|
return 0;
|
4827
|
-
let
|
4828
|
-
return
|
4829
|
-
},
|
4830
|
-
let
|
4831
|
-
return
|
4825
|
+
let w = d * v;
|
4826
|
+
return ne.between(w, 80, 500);
|
4827
|
+
}, g = (v, w) => {
|
4828
|
+
let j = N(v), q = (d - w) * j;
|
4829
|
+
return ne.between(q, 0, d - w);
|
4832
4830
|
}, C = (v) => {
|
4833
|
-
let
|
4834
|
-
return { top:
|
4831
|
+
let w = le();
|
4832
|
+
return { top: g(v, w), height: w };
|
4835
4833
|
}, m = (v) => {
|
4834
|
+
}, $ = (v) => {
|
4835
|
+
let w = N(v);
|
4836
|
+
L(w);
|
4836
4837
|
}, 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);
|
4838
|
+
let w = ne.between(v, 0, 1), j = d - b.value.height;
|
4839
|
+
b.value.top = j * w;
|
4840
|
+
let ye = (p - d) * w;
|
4841
|
+
r.value.scrollTop = ye, a.value.scrollTop != ye && (a.value.scrollTop = ye);
|
4844
4842
|
}, P = () => {
|
4845
4843
|
let v = r.value.scrollTop;
|
4846
|
-
|
4847
|
-
},
|
4848
|
-
d =
|
4849
|
-
let
|
4850
|
-
|
4851
|
-
},
|
4852
|
-
let
|
4853
|
-
return parseInt(
|
4854
|
-
},
|
4855
|
-
let
|
4856
|
-
|
4844
|
+
b.value = C(v), $(v);
|
4845
|
+
}, Z = (v) => {
|
4846
|
+
d = R.getHeight(a.value), p = a.value.scrollHeight;
|
4847
|
+
let w = le();
|
4848
|
+
b.value.height = w, b.value.top = g(r.value.scrollTop, w);
|
4849
|
+
}, ie = (v) => {
|
4850
|
+
let w = v.target;
|
4851
|
+
return parseInt(w.style.top);
|
4852
|
+
}, re = (v, w, j, q) => {
|
4853
|
+
let ye = v.y - w.y, mt = j + ye, yt = V(mt);
|
4854
|
+
L(yt);
|
4857
4855
|
}, ke = (v) => {
|
4858
|
-
|
4859
|
-
},
|
4860
|
-
|
4856
|
+
h.value = !0;
|
4857
|
+
}, Se = (v) => {
|
4858
|
+
h.value = !1;
|
4861
4859
|
};
|
4862
|
-
return
|
4863
|
-
P(),
|
4864
|
-
}),
|
4865
|
-
|
4866
|
-
}),
|
4867
|
-
let
|
4868
|
-
|
4869
|
-
}), t({ scrollTo:
|
4860
|
+
return be(() => {
|
4861
|
+
P(), f.scroll(a.value, ce), f.drag(c.value, { init: ie, handler: re }), f.observe(a.value, Z), f.mouseDown(c.value, ke, Se);
|
4862
|
+
}), xe(() => {
|
4863
|
+
f.dispose();
|
4864
|
+
}), X(() => r.value.scrollTop, (v, w) => {
|
4865
|
+
let j = N(v);
|
4866
|
+
L(j);
|
4867
|
+
}), t({ scrollTo: $, update: P }), (v, w) => (O(), _("div", {
|
4870
4868
|
ref_key: "scrollerRef",
|
4871
4869
|
ref: i,
|
4872
|
-
class:
|
4870
|
+
class: Ae(["ha-scroller", { hover: y(h) }])
|
4873
4871
|
}, [
|
4874
4872
|
D("div", {
|
4875
4873
|
ref_key: "containerRef",
|
@@ -4882,41 +4880,41 @@ const fl = /* @__PURE__ */ J({
|
|
4882
4880
|
ref_key: "trackRef",
|
4883
4881
|
ref: o,
|
4884
4882
|
class: "scroller-track",
|
4885
|
-
onClick:
|
4886
|
-
(...
|
4883
|
+
onClick: w[0] || (w[0] = //@ts-ignore
|
4884
|
+
(...j) => y(m) && y(m)(...j))
|
4887
4885
|
}, [
|
4888
4886
|
D("div", {
|
4889
4887
|
ref_key: "thumbRef",
|
4890
4888
|
ref: c,
|
4891
4889
|
class: "scroller-thumb",
|
4892
|
-
style:
|
4893
|
-
},
|
4890
|
+
style: fe({ top: `${y(b).top}px`, height: `${y(b).height}px` })
|
4891
|
+
}, pe(y(r).scrollTop), 5)
|
4894
4892
|
], 512)
|
4895
4893
|
], 2));
|
4896
4894
|
}
|
4897
|
-
}),
|
4895
|
+
}), hr = /* @__PURE__ */ Q({
|
4898
4896
|
__name: "Timer",
|
4899
4897
|
emits: ["change"],
|
4900
4898
|
setup(u, { expose: t, emit: e }) {
|
4901
|
-
let s = e, l = -8 * 60 * 60 * 1e3, r =
|
4899
|
+
let s = e, l = -8 * 60 * 60 * 1e3, r = I(l), i = null, a = 5, o = () => {
|
4902
4900
|
i == null && (i = setInterval(() => {
|
4903
4901
|
r.value += a, s("change", r.value);
|
4904
4902
|
}, a));
|
4905
4903
|
}, c = () => {
|
4906
4904
|
d(), o();
|
4907
|
-
},
|
4905
|
+
}, h = () => {
|
4908
4906
|
clearInterval(i), i = null;
|
4909
4907
|
}, d = () => {
|
4910
4908
|
clearInterval(i), r.value = l;
|
4911
4909
|
};
|
4912
|
-
return
|
4910
|
+
return xe(() => {
|
4913
4911
|
clearInterval(i);
|
4914
|
-
}), t({ restart: c, start: o, stop:
|
4915
|
-
ge(
|
4916
|
-
|
4912
|
+
}), t({ restart: c, start: o, stop: h, reset: d }), (p, f) => (O(), _("span", null, [
|
4913
|
+
ge(p.$slots, "default"),
|
4914
|
+
xt(pe(y(te).format(y(r), "HH:mm:ss SSS")), 1)
|
4917
4915
|
]));
|
4918
4916
|
}
|
4919
|
-
}), pr = /* @__PURE__ */
|
4917
|
+
}), pr = /* @__PURE__ */ Q({
|
4920
4918
|
__name: "Code",
|
4921
4919
|
props: {
|
4922
4920
|
config: { default: {} },
|
@@ -4925,57 +4923,57 @@ const fl = /* @__PURE__ */ J({
|
|
4925
4923
|
},
|
4926
4924
|
emits: ["mounted", "change", "scroll", "update:modelValue"],
|
4927
4925
|
setup(u, { expose: t, emit: e }) {
|
4928
|
-
let s = e, l = u, { config: r, border: i, modelValue: a } =
|
4929
|
-
if (
|
4926
|
+
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, f = (g) => g == "default" ? null : "vs-dark", b = (g) => {
|
4927
|
+
if (H.editor.completions[g])
|
4930
4928
|
return;
|
4931
|
-
let C = o.languages.getLanguages().find((
|
4929
|
+
let C = o.languages.getLanguages().find(($) => $.id == g);
|
4932
4930
|
if (!C)
|
4933
4931
|
return;
|
4934
4932
|
let m = C.loader;
|
4935
|
-
m && m().then((
|
4936
|
-
|
4933
|
+
m && m().then(($) => {
|
4934
|
+
H.editor.completions[g] || (N($, g), H.editor.completions[g] = !0);
|
4937
4935
|
});
|
4938
|
-
}, N = (
|
4939
|
-
provideCompletionItems: (L
|
4940
|
-
let P =
|
4941
|
-
startLineNumber:
|
4942
|
-
endLineNumber:
|
4936
|
+
}, N = (g, C) => o.languages.registerCompletionItemProvider(C, {
|
4937
|
+
provideCompletionItems: ($, L) => {
|
4938
|
+
let P = $.getWordUntilPosition(L), Z = {
|
4939
|
+
startLineNumber: L.lineNumber,
|
4940
|
+
endLineNumber: L.lineNumber,
|
4943
4941
|
startColumn: P.startColumn,
|
4944
4942
|
endColumn: P.endColumn
|
4945
|
-
},
|
4946
|
-
const
|
4947
|
-
for (let ke = 0; ke <
|
4948
|
-
const
|
4949
|
-
let v =
|
4950
|
-
v && v.forEach((
|
4951
|
-
let
|
4952
|
-
label:
|
4943
|
+
}, ie = [];
|
4944
|
+
const re = ["builtinFunctions", "keywords", "operators"];
|
4945
|
+
for (let ke = 0; ke < re.length; ke++) {
|
4946
|
+
const Se = re[ke];
|
4947
|
+
let v = g.language[Se];
|
4948
|
+
v && v.forEach((w) => {
|
4949
|
+
let j = w.toLowerCase(), q = {
|
4950
|
+
label: j,
|
4953
4951
|
kind: null,
|
4954
|
-
insertText:
|
4955
|
-
range:
|
4956
|
-
documentation:
|
4952
|
+
insertText: j,
|
4953
|
+
range: Z,
|
4954
|
+
documentation: w
|
4957
4955
|
};
|
4958
|
-
|
4956
|
+
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
4957
|
});
|
4960
4958
|
}
|
4961
|
-
return { suggestions:
|
4959
|
+
return { suggestions: ie };
|
4962
4960
|
}
|
4963
4961
|
}), V = () => {
|
4964
|
-
let
|
4965
|
-
r.value.schema && (
|
4962
|
+
let g = null;
|
4963
|
+
r.value.schema && (g = r.value.category + "/" + W.getUniqueId(), H.tryAddSchema(g, r.value.category, r.value.schema));
|
4966
4964
|
let C = {
|
4967
4965
|
validate: !0,
|
4968
4966
|
allowComments: !0,
|
4969
4967
|
//允许配置注释
|
4970
4968
|
//保证架构配置在当前控件生效,所以需要绑定匹配哪个文件时使用架构
|
4971
|
-
schemas:
|
4969
|
+
schemas: Y.clone(H.editor.schemas),
|
4972
4970
|
trailingCommas: "ignore"
|
4973
4971
|
//允许末尾逗号
|
4974
4972
|
};
|
4975
|
-
o.languages.json.jsonDefaults.setDiagnosticsOptions(C),
|
4976
|
-
let m =
|
4977
|
-
|
4978
|
-
let
|
4973
|
+
o.languages.json.jsonDefaults.setDiagnosticsOptions(C), b(r.value.language);
|
4974
|
+
let m = g ? o.Uri.parse(g) : null;
|
4975
|
+
h = o.editor.createModel(a.value, r.value.language, m);
|
4976
|
+
let $ = {
|
4979
4977
|
tabSize: 2,
|
4980
4978
|
//Tab缩进大小
|
4981
4979
|
detectIndentation: !1,
|
@@ -4986,63 +4984,63 @@ const fl = /* @__PURE__ */ J({
|
|
4986
4984
|
//默认已启用代码图
|
4987
4985
|
scrollbar: { verticalScrollbarSize: 0 },
|
4988
4986
|
//关闭最右侧垂直滚动条
|
4989
|
-
theme:
|
4987
|
+
theme: f(p.theme),
|
4990
4988
|
automaticLayout: !0,
|
4991
4989
|
//根据父元素自动布局
|
4992
|
-
model:
|
4990
|
+
model: h
|
4993
4991
|
};
|
4994
|
-
c = o.editor.create(d.value,
|
4995
|
-
let
|
4996
|
-
if (
|
4992
|
+
c = o.editor.create(d.value, $), r.value.scrollTop && c.setScrollTop(r.value.scrollTop);
|
4993
|
+
let L = r.value.selection;
|
4994
|
+
if (L) {
|
4997
4995
|
let P = {
|
4998
|
-
startLineNumber:
|
4999
|
-
endLineNumber:
|
5000
|
-
startColumn:
|
5001
|
-
endColumn:
|
4996
|
+
startLineNumber: L.startLine,
|
4997
|
+
endLineNumber: L.endLine,
|
4998
|
+
startColumn: L.startColumn,
|
4999
|
+
endColumn: L.endColumn
|
5002
5000
|
};
|
5003
5001
|
c.setSelection(P);
|
5004
5002
|
}
|
5005
5003
|
c.onDidScrollChange((P) => {
|
5006
5004
|
s("scroll", P.scrollTop);
|
5007
5005
|
}), c.onDidChangeModelContent((P) => {
|
5008
|
-
let
|
5009
|
-
s("update:modelValue",
|
5006
|
+
let Z = c.getValue();
|
5007
|
+
s("update:modelValue", Z), s("change", Z);
|
5010
5008
|
});
|
5011
5009
|
};
|
5012
|
-
|
5013
|
-
o = await
|
5010
|
+
be(async () => {
|
5011
|
+
o = await me.getMonaco(), d.value && (V(), s("mounted", o, c));
|
5014
5012
|
});
|
5015
|
-
let
|
5013
|
+
let ce = () => {
|
5016
5014
|
c == null || c.layout();
|
5017
|
-
},
|
5018
|
-
return
|
5019
|
-
|
5020
|
-
}),
|
5021
|
-
let m = g
|
5015
|
+
}, le = () => c;
|
5016
|
+
return xe(() => {
|
5017
|
+
h == null || h.dispose(), c == null || c.dispose();
|
5018
|
+
}), X(() => p.theme, (g, C) => {
|
5019
|
+
let m = f(g);
|
5022
5020
|
o.editor.setTheme(m);
|
5023
|
-
}),
|
5024
|
-
}),
|
5021
|
+
}), X(() => p.language, (g, C) => {
|
5022
|
+
}), X(() => a.value, (g, C) => {
|
5025
5023
|
if (!c)
|
5026
5024
|
return;
|
5027
5025
|
let m = c.getValue();
|
5028
|
-
|
5029
|
-
}),
|
5026
|
+
g != m && c.setValue(g ?? "");
|
5027
|
+
}), X(() => r.value.language, (g, C) => {
|
5030
5028
|
if (!c)
|
5031
5029
|
return;
|
5032
5030
|
let m = c.getModel();
|
5033
|
-
o.editor.setModelLanguage(m,
|
5034
|
-
}), t({ layout:
|
5035
|
-
default:
|
5031
|
+
o.editor.setModelLanguage(m, g), b(g);
|
5032
|
+
}), t({ layout: ce, getEditor: le }), (g, C) => (O(), He(fl, null, {
|
5033
|
+
default: Ne(() => [
|
5036
5034
|
D("div", {
|
5037
5035
|
ref_key: "monacoEditorRef",
|
5038
5036
|
ref: d,
|
5039
|
-
class:
|
5037
|
+
class: Ae(["ha-code", { border: y(i) }])
|
5040
5038
|
}, null, 2)
|
5041
5039
|
]),
|
5042
5040
|
_: 1
|
5043
5041
|
}));
|
5044
5042
|
}
|
5045
|
-
}),
|
5043
|
+
}), gr = /* @__PURE__ */ Q({
|
5046
5044
|
__name: "Compare",
|
5047
5045
|
props: {
|
5048
5046
|
inline: { type: Boolean, default: !1 },
|
@@ -5052,146 +5050,146 @@ const fl = /* @__PURE__ */ J({
|
|
5052
5050
|
},
|
5053
5051
|
emits: ["update:modelValue", "update:original", "change"],
|
5054
5052
|
setup(u, { emit: t }) {
|
5055
|
-
let e = t, s = u, { inline: l, language: r, original: i, modelValue: a } =
|
5056
|
-
c =
|
5053
|
+
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, f = null, b = I(), N = I(), { app: V } = H.sys, ce = (g) => {
|
5054
|
+
c = g.editor.createModel(i.value, r.value), h = g.editor.createModel(a.value, r.value), o = g.editor.createDiffEditor(b.value, {
|
5057
5055
|
originalEditable: !0,
|
5058
5056
|
automaticLayout: !0,
|
5059
5057
|
renderSideBySide: !l.value,
|
5060
5058
|
//是否启用行内模式
|
5061
|
-
theme:
|
5062
|
-
}), o.setModel({ original: c, modified:
|
5059
|
+
theme: le(V.theme)
|
5060
|
+
}), o.setModel({ original: c, modified: h }), d = o.getOriginalEditor(), d.onDidChangeModelContent((C) => {
|
5063
5061
|
let m = d.getValue();
|
5064
5062
|
e("update:original", m), e("change", m);
|
5065
|
-
}),
|
5066
|
-
let m =
|
5063
|
+
}), p = o.getModifiedEditor(), p.onDidChangeModelContent((C) => {
|
5064
|
+
let m = p.getValue();
|
5067
5065
|
e("update:modelValue", m);
|
5068
5066
|
});
|
5069
|
-
},
|
5070
|
-
return
|
5071
|
-
|
5072
|
-
}),
|
5073
|
-
let m =
|
5074
|
-
|
5075
|
-
}),
|
5076
|
-
c &&
|
5077
|
-
}),
|
5067
|
+
}, le = (g) => g == "default" ? null : "vs-dark";
|
5068
|
+
return be(async () => {
|
5069
|
+
f = await me.getMonaco(), ce(f);
|
5070
|
+
}), X(() => V.theme, (g, C) => {
|
5071
|
+
let m = le(g);
|
5072
|
+
f.editor.setTheme(m);
|
5073
|
+
}), X(() => r.value, (g, C) => {
|
5074
|
+
c && f.editor.setModelLanguage(c, g), h && f.editor.setModelLanguage(h, g);
|
5075
|
+
}), X(() => i.value, (g, C) => {
|
5078
5076
|
if (!c)
|
5079
5077
|
return;
|
5080
5078
|
let m = c.getValue();
|
5081
|
-
|
5082
|
-
}),
|
5083
|
-
if (!
|
5079
|
+
g != m && c.setValue(g ?? "");
|
5080
|
+
}), X(() => a.value, (g, C) => {
|
5081
|
+
if (!h)
|
5084
5082
|
return;
|
5085
|
-
let m =
|
5086
|
-
|
5087
|
-
}), (
|
5083
|
+
let m = h.getValue();
|
5084
|
+
g != m && h.setValue(g ?? "");
|
5085
|
+
}), (g, C) => (O(), _("div", {
|
5088
5086
|
ref_key: "compareRef",
|
5089
|
-
ref:
|
5087
|
+
ref: b,
|
5090
5088
|
class: "ha-compare",
|
5091
|
-
style:
|
5089
|
+
style: fe(y(N))
|
5092
5090
|
}, null, 4));
|
5093
5091
|
}
|
5094
|
-
}),
|
5092
|
+
}), ze = (u, t) => {
|
5095
5093
|
const e = u.__vccOpts || u;
|
5096
5094
|
for (const [s, l] of t)
|
5097
5095
|
e[s] = l;
|
5098
5096
|
return e;
|
5099
|
-
},
|
5100
|
-
function
|
5101
|
-
return
|
5097
|
+
}, yl = {}, vl = { class: "ha-option" };
|
5098
|
+
function wl(u, t) {
|
5099
|
+
return O(), _("div", vl, "选项");
|
5102
5100
|
}
|
5103
|
-
const bl = /* @__PURE__ */
|
5104
|
-
|
5105
|
-
], fr = /* @__PURE__ */
|
5101
|
+
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 = [
|
5102
|
+
kl
|
5103
|
+
], fr = /* @__PURE__ */ Q({
|
5106
5104
|
__name: "RichText",
|
5107
|
-
props: /* @__PURE__ */
|
5105
|
+
props: /* @__PURE__ */ Ke({
|
5108
5106
|
options: {}
|
5109
5107
|
}, {
|
5110
5108
|
modelValue: {},
|
5111
5109
|
modelModifiers: {}
|
5112
5110
|
}),
|
5113
|
-
emits: /* @__PURE__ */
|
5111
|
+
emits: /* @__PURE__ */ Ke(["change", "scroll"], ["update:modelValue"]),
|
5114
5112
|
setup(u, { expose: t, emit: e }) {
|
5115
|
-
let s = e, l = u, { options: r } =
|
5116
|
-
let
|
5117
|
-
if (
|
5118
|
-
|
5113
|
+
let s = e, l = u, { options: r } = se(l), i = et(u, "modelValue"), a, o = null, c = null, h = !1, d = !1, p = I(), f = I(), b = I(), N = I(!1), V = I({ style: null, options: { scrollTop: 0 } }), ce = (m) => {
|
5114
|
+
let $ = te.getDateString(), L = getSelection(), P = L.getRangeAt(0), Z = P.startContainer;
|
5115
|
+
if (Z.nodeName == "#text")
|
5116
|
+
Z.insertData(P.startOffset, $), P.setStart(Z, P.startOffset + $.length), L.removeAllRanges(), L.addRange(P);
|
5119
5117
|
else {
|
5120
|
-
let
|
5121
|
-
|
5122
|
-
let
|
5123
|
-
|
5118
|
+
let ie = document.createTextNode($);
|
5119
|
+
Z.appendChild(ie);
|
5120
|
+
let re = document.createRange();
|
5121
|
+
re.selectNodeContents(ie), re.setStart(ie, re.startOffset + $.length), L.removeAllRanges(), L.addRange(re);
|
5124
5122
|
}
|
5125
|
-
},
|
5126
|
-
if (o.scrollTop = m.scrollTop,
|
5127
|
-
|
5123
|
+
}, le = (m) => {
|
5124
|
+
if (o.scrollTop = m.scrollTop, h || d) {
|
5125
|
+
h = !1, d = !1;
|
5128
5126
|
return;
|
5129
5127
|
}
|
5130
5128
|
c = m, s("scroll", m);
|
5131
|
-
},
|
5132
|
-
let m = await
|
5133
|
-
a = new m(
|
5129
|
+
}, g = () => `height: calc(100% - ${R.getHeight(f.value)}px)`, C = async () => {
|
5130
|
+
let m = await me.getQuill();
|
5131
|
+
a = new m(p.value, {
|
5134
5132
|
modules: {
|
5135
5133
|
toolbar: {
|
5136
|
-
container:
|
5137
|
-
handlers: { date:
|
5134
|
+
container: f.value,
|
5135
|
+
handlers: { date: ce }
|
5138
5136
|
}
|
5139
5137
|
},
|
5140
5138
|
theme: "snow"
|
5141
|
-
}), N.value = !0,
|
5142
|
-
V.value.style =
|
5143
|
-
}), r.value.readonly && a.disable(), o =
|
5144
|
-
o.innerHTML != i.value && (
|
5145
|
-
}), o.addEventListener("paste", (
|
5139
|
+
}), N.value = !0, We(() => {
|
5140
|
+
V.value.style = g();
|
5141
|
+
}), 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) => {
|
5142
|
+
o.innerHTML != i.value && (h = !0, i.value = o.innerHTML);
|
5143
|
+
}), o.addEventListener("paste", ($) => {
|
5146
5144
|
d = !0;
|
5147
5145
|
});
|
5148
5146
|
};
|
5149
|
-
return
|
5147
|
+
return be(() => {
|
5150
5148
|
C();
|
5151
|
-
}),
|
5149
|
+
}), xe(() => {
|
5152
5150
|
a = null;
|
5153
|
-
}),
|
5151
|
+
}), X(() => i.value, (m, $) => {
|
5154
5152
|
o && o.innerHTML != m && (o.innerHTML = m);
|
5155
|
-
}),
|
5156
|
-
m != null && (c == null ? void 0 : c.scrollTop) != m &&
|
5153
|
+
}), X(() => r.value.scrollTop, (m, $) => {
|
5154
|
+
m != null && (c == null ? void 0 : c.scrollTop) != m && We(() => {
|
5157
5155
|
V.value.options.scrollTop = m;
|
5158
5156
|
});
|
5159
|
-
}), t({}), (m,
|
5157
|
+
}), t({}), (m, $) => (O(), _("div", xl, [
|
5160
5158
|
kt(D("div", {
|
5161
5159
|
ref_key: "toolbarRef",
|
5162
|
-
ref:
|
5160
|
+
ref: f
|
5163
5161
|
}, Sl, 512), [
|
5164
|
-
[
|
5162
|
+
[St, y(N)]
|
5165
5163
|
]),
|
5166
|
-
|
5164
|
+
Ce(y(ml), {
|
5167
5165
|
ref_key: "scrollerRef",
|
5168
|
-
ref:
|
5166
|
+
ref: b,
|
5169
5167
|
class: "ql-body",
|
5170
5168
|
options: y(V).options,
|
5171
|
-
onScroll: y(
|
5172
|
-
style:
|
5169
|
+
onScroll: y(le),
|
5170
|
+
style: fe(y(V).style)
|
5173
5171
|
}, {
|
5174
|
-
default:
|
5172
|
+
default: Ne(() => [
|
5175
5173
|
D("div", {
|
5176
5174
|
ref_key: "editorRef",
|
5177
|
-
ref:
|
5175
|
+
ref: p
|
5178
5176
|
}, null, 512)
|
5179
5177
|
]),
|
5180
5178
|
_: 1
|
5181
5179
|
}, 8, ["options", "onScroll", "style"])
|
5182
5180
|
]));
|
5183
5181
|
}
|
5184
|
-
}),
|
5182
|
+
}), El = {}, Cl = { class: "ha-select" }, Tl = /* @__PURE__ */ D("div", { class: "select-title" }, "头", -1), $l = /* @__PURE__ */ D("div", { class: "select-body" }, [
|
5185
5183
|
/* @__PURE__ */ D("input", { type: "text" })
|
5186
|
-
], -1),
|
5187
|
-
|
5188
|
-
|
5184
|
+
], -1), Ll = [
|
5185
|
+
Tl,
|
5186
|
+
$l
|
5189
5187
|
];
|
5190
|
-
function
|
5191
|
-
return
|
5188
|
+
function Al(u, t) {
|
5189
|
+
return O(), _("div", Cl, Ll);
|
5192
5190
|
}
|
5193
|
-
const
|
5194
|
-
class
|
5191
|
+
const Be = /* @__PURE__ */ ze(El, [["render", Al]]);
|
5192
|
+
class mr {
|
5195
5193
|
/**
|
5196
5194
|
* 初始化
|
5197
5195
|
*/
|
@@ -5215,7 +5213,7 @@ class gr {
|
|
5215
5213
|
this.startLine = t, this.endLine = e, this.startColumn = s, this.endColumn = l;
|
5216
5214
|
}
|
5217
5215
|
}
|
5218
|
-
const
|
5216
|
+
const Dl = { class: "ha-condition" }, Il = /* @__PURE__ */ Q({
|
5219
5217
|
__name: "Condition",
|
5220
5218
|
props: {
|
5221
5219
|
name: {},
|
@@ -5223,80 +5221,80 @@ const Al = { class: "ha-condition" }, Il = /* @__PURE__ */ J({
|
|
5223
5221
|
value: {}
|
5224
5222
|
},
|
5225
5223
|
setup(u) {
|
5226
|
-
let t = u, { name: e, operator: s, value: l } =
|
5227
|
-
return (r, i) => (
|
5228
|
-
|
5224
|
+
let t = u, { name: e, operator: s, value: l } = se(t);
|
5225
|
+
return (r, i) => (O(), _("div", Dl, [
|
5226
|
+
Ce(y(Be), {
|
5229
5227
|
modelValue: y(e),
|
5230
|
-
"onUpdate:modelValue": i[0] || (i[0] = (a) =>
|
5228
|
+
"onUpdate:modelValue": i[0] || (i[0] = (a) => _e(e) ? e.value = a : e = a)
|
5231
5229
|
}, null, 8, ["modelValue"]),
|
5232
|
-
|
5230
|
+
Ce(y(Be), {
|
5233
5231
|
modelValue: y(s),
|
5234
|
-
"onUpdate:modelValue": i[1] || (i[1] = (a) =>
|
5232
|
+
"onUpdate:modelValue": i[1] || (i[1] = (a) => _e(s) ? s.value = a : s = a)
|
5235
5233
|
}, {
|
5236
|
-
default:
|
5237
|
-
|
5234
|
+
default: Ne(() => [
|
5235
|
+
Ce(y(bl))
|
5238
5236
|
]),
|
5239
5237
|
_: 1
|
5240
5238
|
}, 8, ["modelValue"]),
|
5241
|
-
|
5239
|
+
Ce(y(Be), {
|
5242
5240
|
modelValue: y(l),
|
5243
|
-
"onUpdate:modelValue": i[2] || (i[2] = (a) =>
|
5241
|
+
"onUpdate:modelValue": i[2] || (i[2] = (a) => _e(l) ? l.value = a : l = a)
|
5244
5242
|
}, null, 8, ["modelValue"])
|
5245
5243
|
]));
|
5246
5244
|
}
|
5247
|
-
}),
|
5245
|
+
}), Ol = { class: "ha-condition-group" }, yr = /* @__PURE__ */ Q({
|
5248
5246
|
__name: "Index",
|
5249
5247
|
props: {
|
5250
5248
|
conditions: {}
|
5251
5249
|
},
|
5252
5250
|
setup(u) {
|
5253
|
-
let t = u, { conditions: e } =
|
5254
|
-
return (s, l) => (
|
5255
|
-
(
|
5251
|
+
let t = u, { conditions: e } = se(t);
|
5252
|
+
return (s, l) => (O(), _("div", Ol, [
|
5253
|
+
(O(!0), _(Ct, null, Tt(y(e), (r) => (O(), He(y(Il), {
|
5256
5254
|
name: r.name,
|
5257
5255
|
operator: r.operator,
|
5258
5256
|
value: r.value
|
5259
5257
|
}, null, 8, ["name", "operator", "value"]))), 256))
|
5260
5258
|
]));
|
5261
5259
|
}
|
5262
|
-
}),
|
5263
|
-
function
|
5264
|
-
return
|
5260
|
+
}), jl = {}, Rl = { class: "ha-col" };
|
5261
|
+
function _l(u, t) {
|
5262
|
+
return O(), _("div", Rl, [
|
5265
5263
|
ge(u.$slots, "default")
|
5266
5264
|
]);
|
5267
5265
|
}
|
5268
|
-
const
|
5266
|
+
const vr = /* @__PURE__ */ ze(jl, [["render", _l]]), wr = /* @__PURE__ */ Q({
|
5269
5267
|
__name: "Container",
|
5270
5268
|
props: {
|
5271
5269
|
container: { type: Boolean, default: !0 }
|
5272
5270
|
},
|
5273
5271
|
setup(u) {
|
5274
|
-
let t = u, { container: e } =
|
5275
|
-
return (s, l) => (
|
5276
|
-
class:
|
5272
|
+
let t = u, { container: e } = se(t);
|
5273
|
+
return (s, l) => (O(), _("div", {
|
5274
|
+
class: Ae({ "ha-container": y(e) })
|
5277
5275
|
}, [
|
5278
5276
|
ge(s.$slots, "default")
|
5279
5277
|
], 2));
|
5280
5278
|
}
|
5281
|
-
}), br = /* @__PURE__ */
|
5279
|
+
}), br = /* @__PURE__ */ Q({
|
5282
5280
|
__name: "Row",
|
5283
5281
|
props: {
|
5284
5282
|
gap: {},
|
5285
5283
|
direction: {}
|
5286
5284
|
},
|
5287
5285
|
setup(u) {
|
5288
|
-
let t = u, { gap: e, direction: s } =
|
5286
|
+
let t = u, { gap: e, direction: s } = se(t), l = Te(() => {
|
5289
5287
|
let r = { gap: null };
|
5290
5288
|
return e.value && (r.gap = e.value + "px"), r;
|
5291
5289
|
});
|
5292
|
-
return (r, i) => (
|
5293
|
-
class:
|
5294
|
-
style:
|
5290
|
+
return (r, i) => (O(), _("div", {
|
5291
|
+
class: Ae(["ha-row", y(s)]),
|
5292
|
+
style: fe(y(l))
|
5295
5293
|
}, [
|
5296
5294
|
ge(r.$slots, "default")
|
5297
5295
|
], 6));
|
5298
5296
|
}
|
5299
|
-
}),
|
5297
|
+
}), xr = /* @__PURE__ */ Q({
|
5300
5298
|
__name: "Progress",
|
5301
5299
|
props: {
|
5302
5300
|
modelValue: { type: Boolean },
|
@@ -5304,7 +5302,7 @@ const yr = /* @__PURE__ */ Ke(Ol, [["render", Rl]]), vr = /* @__PURE__ */ J({
|
|
5304
5302
|
},
|
5305
5303
|
emits: ["update:modelValue"],
|
5306
5304
|
setup(u) {
|
5307
|
-
let t =
|
5305
|
+
let t = et(u, "modelValue"), e = I(!0), s = I(0), l = null, r = () => {
|
5308
5306
|
s.value = 0, e.value = !0, l = setInterval(() => {
|
5309
5307
|
if (s.value < 100) {
|
5310
5308
|
s.value++;
|
@@ -5314,177 +5312,183 @@ const yr = /* @__PURE__ */ Ke(Ol, [["render", Rl]]), vr = /* @__PURE__ */ J({
|
|
5314
5312
|
}, 50);
|
5315
5313
|
}, i = () => {
|
5316
5314
|
clearInterval(l);
|
5317
|
-
let a = 100 - s.value, o = 200, c = 20,
|
5318
|
-
s.value +=
|
5315
|
+
let a = 100 - s.value, o = 200, c = 20, h = a / (o / c), d = setInterval(() => {
|
5316
|
+
s.value += h, !(s.value < 100) && (s.value = 100, clearInterval(d), setTimeout(() => {
|
5319
5317
|
e.value = !1;
|
5320
5318
|
}, 200));
|
5321
5319
|
}, c);
|
5322
5320
|
};
|
5323
|
-
return
|
5321
|
+
return be(() => {
|
5324
5322
|
t.value && r();
|
5325
|
-
}),
|
5323
|
+
}), xe(() => {
|
5326
5324
|
clearInterval(l);
|
5327
|
-
}),
|
5325
|
+
}), X(() => t.value, (a, o) => {
|
5328
5326
|
a ? r() : i();
|
5329
|
-
}), (a, o) => y(e) ? (
|
5327
|
+
}), (a, o) => y(e) ? (O(), _("div", {
|
5330
5328
|
key: 0,
|
5331
5329
|
class: "ha-progress",
|
5332
|
-
style:
|
5333
|
-
}, null, 4)) :
|
5330
|
+
style: fe({ width: y(s) + "%" })
|
5331
|
+
}, null, 4)) : Ze("", !0);
|
5334
5332
|
}
|
5335
|
-
}),
|
5333
|
+
}), 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
5334
|
__name: "SocketProgress",
|
5337
5335
|
props: {
|
5338
5336
|
progress: {}
|
5339
5337
|
},
|
5340
5338
|
setup(u) {
|
5341
|
-
let t = u, { progress: e } =
|
5339
|
+
let t = u, { progress: e } = se(t), s = Te(() => {
|
5342
5340
|
let a = e.value;
|
5343
5341
|
return (a.succeed ?? 0) + (a.errored ?? 0);
|
5344
|
-
}), l =
|
5345
|
-
return (a, o) => (
|
5346
|
-
class:
|
5342
|
+
}), 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));
|
5343
|
+
return (a, o) => (O(), _("div", {
|
5344
|
+
class: Ae(["ha-socket-progress", { error: y(e).errored > 0 }])
|
5347
5345
|
}, [
|
5348
|
-
D("div",
|
5349
|
-
D("div",
|
5350
|
-
D("div",
|
5351
|
-
D("div",
|
5346
|
+
D("div", Bl, [
|
5347
|
+
D("div", Pl, "进度:" + pe(y(r)), 1),
|
5348
|
+
D("div", Ul, "成功:" + pe(y(e).succeed ?? "-"), 1),
|
5349
|
+
D("div", Fl, "异常:" + pe(y(e).errored ?? "-"), 1)
|
5352
5350
|
]),
|
5353
|
-
D("div",
|
5354
|
-
D("div",
|
5351
|
+
D("div", Ml, [
|
5352
|
+
D("div", Nl, [
|
5355
5353
|
D("div", {
|
5356
5354
|
class: "progress-percentage",
|
5357
|
-
style:
|
5355
|
+
style: fe({ width: y(l) + "%" })
|
5358
5356
|
}, null, 4)
|
5359
5357
|
]),
|
5360
|
-
D("div",
|
5358
|
+
D("div", Vl, pe(y(i)) + "%", 1)
|
5361
5359
|
])
|
5362
5360
|
], 2));
|
5363
5361
|
}
|
5364
|
-
}),
|
5365
|
-
|
5366
|
-
|
5367
|
-
], Sr = /* @__PURE__ */
|
5362
|
+
}), ql = { class: "ha-tab" }, zl = /* @__PURE__ */ D("div", { class: "tab-header" }, null, -1), Kl = /* @__PURE__ */ D("div", { class: "tab-body" }, null, -1), Wl = [
|
5363
|
+
zl,
|
5364
|
+
Kl
|
5365
|
+
], Sr = /* @__PURE__ */ Q({
|
5368
5366
|
__name: "Tab",
|
5369
5367
|
props: {
|
5370
5368
|
destroy: { type: Boolean }
|
5371
5369
|
},
|
5372
5370
|
setup(u) {
|
5373
|
-
return (t, e) => (
|
5371
|
+
return (t, e) => (O(), _("div", ql, Wl));
|
5374
5372
|
}
|
5375
5373
|
});
|
5376
|
-
let
|
5377
|
-
u == null && (u = new
|
5378
|
-
let t = await Fs.getSso(), e =
|
5379
|
-
|
5374
|
+
let Er = async (u) => {
|
5375
|
+
u == null && (u = new cl()), await Zs(u), await Ms();
|
5376
|
+
let t = await Fs.getSso(), e = H.sys.app, s = { baseUrl: u.baseUrl, language: e.language, user: t, platform: "pc" }, l = M.serialize(s);
|
5377
|
+
debugger;
|
5378
|
+
await T.open(l), await Hs();
|
5379
|
+
debugger;
|
5380
|
+
T.onResponse = async (r) => {
|
5381
|
+
debugger;
|
5380
5382
|
let i = r.data;
|
5381
5383
|
return Ps.add(i.code, i.message, i.stack, i.elapsed), Promise.resolve();
|
5382
5384
|
};
|
5383
5385
|
};
|
5384
5386
|
export {
|
5385
|
-
|
5386
|
-
|
5387
|
-
|
5388
|
-
|
5389
|
-
|
5390
|
-
|
5391
|
-
|
5392
|
-
|
5393
|
-
|
5394
|
-
|
5395
|
-
|
5396
|
-
|
5397
|
-
|
5398
|
-
|
5399
|
-
|
5400
|
-
|
5401
|
-
|
5402
|
-
|
5387
|
+
ue as ArrayHelper,
|
5388
|
+
st as BrowserHelper,
|
5389
|
+
qt as BuilderFactory,
|
5390
|
+
lt as Cdn,
|
5391
|
+
Wt as CdnFactory,
|
5392
|
+
It as ComponentHelper,
|
5393
|
+
cl as CreateFeOptions,
|
5394
|
+
Pe as DictionaryHelper,
|
5395
|
+
R as DomHelper,
|
5396
|
+
gl as DragEvent,
|
5397
|
+
Xt as EncoderFactory,
|
5398
|
+
ae as EventHelper,
|
5399
|
+
ft as EventUtility,
|
5400
|
+
Zt as ExcelFactory,
|
5401
|
+
ts as ExplainerFactory,
|
5402
|
+
E as Factories,
|
5403
|
+
ns as FeatureFactory,
|
5404
|
+
Ie as FileHelper,
|
5403
5405
|
pr as HaCode,
|
5404
|
-
|
5405
|
-
|
5406
|
+
vr as HaCol,
|
5407
|
+
gr as HaCompare,
|
5406
5408
|
Il as HaCondition,
|
5407
|
-
|
5408
|
-
|
5409
|
+
yr as HaConditionGroup,
|
5410
|
+
wr as HaContainer,
|
5409
5411
|
ir as HaEmpty,
|
5410
5412
|
fl as HaFill,
|
5411
5413
|
bl as HaOption,
|
5412
|
-
|
5414
|
+
xr as HaProgress,
|
5413
5415
|
fr as HaRichText,
|
5414
5416
|
br as HaRow,
|
5415
|
-
|
5416
|
-
|
5417
|
-
|
5417
|
+
ml as HaScroller,
|
5418
|
+
Be as HaSelect,
|
5419
|
+
kr as HaSocketProgress,
|
5418
5420
|
Sr as HaTab,
|
5419
|
-
|
5420
|
-
|
5421
|
-
|
5422
|
-
|
5423
|
-
|
5424
|
-
|
5425
|
-
|
5426
|
-
|
5427
|
-
|
5428
|
-
|
5421
|
+
hr as HaTimer,
|
5422
|
+
ds as HaloHttp,
|
5423
|
+
os as HasherFactory,
|
5424
|
+
Qe as HtmlHelper,
|
5425
|
+
hs as HttpFactory,
|
5426
|
+
it as HttpRequest,
|
5427
|
+
Ye as HttpResponse,
|
5428
|
+
fs as I18nFactory,
|
5429
|
+
Ot as ImageHelper,
|
5430
|
+
M as JsonHelper,
|
5429
5431
|
or as KeyboardUtility,
|
5430
5432
|
ur as ListDelta,
|
5431
|
-
|
5432
|
-
|
5433
|
-
|
5434
|
-
|
5433
|
+
ne as MathHelper,
|
5434
|
+
ms as Messenger,
|
5435
|
+
vs as MessengerFactory,
|
5436
|
+
jt as MicroHelper,
|
5435
5437
|
we as MountHelper,
|
5436
5438
|
cr as MouseUtility,
|
5437
|
-
|
5439
|
+
Y as ObjectHelper,
|
5438
5440
|
gt as Position,
|
5439
|
-
|
5441
|
+
Nt as ProviderFactory,
|
5440
5442
|
tr as ProviderTable,
|
5441
|
-
|
5443
|
+
mr as Range,
|
5442
5444
|
ar as Rect,
|
5443
|
-
|
5444
|
-
|
5445
|
-
|
5446
|
-
|
5447
|
-
|
5448
|
-
|
5449
|
-
|
5450
|
-
|
5445
|
+
Rt as Ref,
|
5446
|
+
dr as SaveUtility,
|
5447
|
+
Je as ScrollHelper,
|
5448
|
+
Bt as SignHelper,
|
5449
|
+
xs as SignerFactory,
|
5450
|
+
Xe as SqlHelper,
|
5451
|
+
Ns as SsoFactory,
|
5452
|
+
at as SsoUser,
|
5453
|
+
W as StringHelper,
|
5451
5454
|
Bs as SvcFactory,
|
5452
|
-
|
5453
|
-
|
5454
|
-
|
5455
|
-
|
5456
|
-
|
5455
|
+
zs as TaskFactory,
|
5456
|
+
Ee as TaskHelper,
|
5457
|
+
Qs as TemplateFactory,
|
5458
|
+
te as TimeHelper,
|
5459
|
+
Oe as TreeHelper,
|
5457
5460
|
U as TypeHelper,
|
5458
5461
|
K as UrlHelper,
|
5459
5462
|
rr as VideoFactory,
|
5460
5463
|
nr as VoiceFactory,
|
5461
|
-
|
5462
|
-
|
5463
|
-
|
5464
|
-
|
5464
|
+
Ys as base64,
|
5465
|
+
me as cdn,
|
5466
|
+
H as configSvc,
|
5467
|
+
Er as createFe,
|
5465
5468
|
sr as driverSvc,
|
5466
5469
|
lr as envSvc,
|
5467
|
-
|
5468
|
-
|
5469
|
-
|
5470
|
+
T as http,
|
5471
|
+
J as i18n,
|
5472
|
+
Zs as initDriver,
|
5473
|
+
Hs as initI18n,
|
5470
5474
|
Ms as initSvc,
|
5471
5475
|
Ps as logSvc,
|
5472
|
-
|
5473
|
-
|
5474
|
-
|
5476
|
+
pt as md5,
|
5477
|
+
ve as messenger,
|
5478
|
+
ee as moment,
|
5475
5479
|
De as settingRepo,
|
5476
|
-
|
5480
|
+
de as settingSvc,
|
5477
5481
|
Us as socketSvc,
|
5478
|
-
|
5479
|
-
|
5480
|
-
|
5481
|
-
|
5482
|
-
|
5483
|
-
|
5484
|
-
|
5485
|
-
|
5486
|
-
|
5487
|
-
|
5488
|
-
|
5482
|
+
el as t,
|
5483
|
+
ll as t_enum,
|
5484
|
+
tl as t_exists,
|
5485
|
+
rl as t_field,
|
5486
|
+
nl as t_field_choose_placeholder,
|
5487
|
+
il as t_field_placeholder,
|
5488
|
+
ul as t_menu,
|
5489
|
+
ol as t_module,
|
5490
|
+
sl as t_sys,
|
5491
|
+
al as t_table,
|
5492
|
+
Gs as template,
|
5489
5493
|
Fs as userSvc
|
5490
5494
|
};
|