halo-fe 1.0.29 → 1.0.31
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/{liquidjs-C2HVw1Ra.js → liquidjs-BfOWWjtJ.js} +119 -113
- package/dist/main.js +1472 -1261
- package/dist/style.css +1 -1
- package/esm/apps/AppConstant.d.ts +3 -0
- package/esm/apps/index.d.ts +2 -0
- package/esm/coms/@types/SocketProgressProps.d.ts +4 -0
- package/esm/coms/index.d.ts +1 -0
- package/esm/coms/tags/@types/TagProps.d.ts +7 -0
- package/esm/coms/tags/@types/index.d.ts +2 -0
- package/esm/coms/tags/Index.vue.d.ts +17 -0
- package/esm/coms/tags/index.d.ts +2 -0
- package/esm/drivers/cdns/Cdn.d.ts +6 -2
- package/esm/drivers/cdns/implements/LocalCdn.d.ts +0 -1
- package/esm/drivers/encryptors/Encryptor.d.ts +11 -0
- package/esm/drivers/encryptors/EncryptorFactory.d.ts +13 -0
- package/esm/drivers/encryptors/IEncryptor.d.ts +15 -0
- package/esm/drivers/encryptors/implements/AesEncryptor.d.ts +10 -0
- package/esm/drivers/encryptors/index.d.ts +3 -0
- package/esm/drivers/hashers/Hasher.d.ts +1 -1
- package/esm/drivers/hashers/HasherFactory.d.ts +5 -1
- package/esm/drivers/hashers/IHasher.d.ts +1 -1
- package/esm/drivers/hashers/implement/Md5Hasher.d.ts +1 -1
- package/esm/drivers/hashers/implement/Sha256Hasher.d.ts +1 -1
- package/esm/drivers/https/Http.d.ts +5 -1
- package/esm/drivers/https/HttpFactory.d.ts +2 -2
- package/esm/drivers/https/IHttp.d.ts +2 -2
- package/esm/drivers/https/entities/HttpProgress.d.ts +9 -0
- package/esm/drivers/https/entities/HttpRequest.d.ts +4 -0
- package/esm/drivers/https/entities/index.d.ts +4 -0
- package/esm/drivers/https/implements/DefaultHttp.d.ts +0 -1
- package/esm/drivers/https/implements/EiHttp.d.ts +32 -0
- package/esm/drivers/https/implements/HaloHttp.d.ts +1 -5
- package/esm/drivers/https/implements/MkHttp.d.ts +1 -5
- package/esm/drivers/https/index.d.ts +2 -3
- package/esm/drivers/index.d.ts +1 -0
- package/esm/drivers/sockets/entities/SocketProgress.d.ts +5 -1
- package/esm/drivers/util/implements/ArrayUtil.d.ts +1 -1
- package/esm/drivers/util/implements/JsonUtil.d.ts +1 -1
- package/esm/drivers/util/implements/ObjectUtil.d.ts +8 -0
- package/esm/drivers/util/implements/StringUtil.d.ts +4 -0
- package/esm/drivers/util/implements/TimeUtil.d.ts +2 -2
- package/esm/drivers/util/implements/UrlUtil.d.ts +16 -6
- package/esm/drivers/utilities/implement/EventUtility.d.ts +1 -1
- package/esm/factory/Factories.d.ts +5 -1
- package/esm/factory/Utils.d.ts +1 -2
- package/esm/repos/implements/ModuleRepo.d.ts +18 -1
- package/package.json +4 -4
package/dist/main.js
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
var
|
2
|
-
var
|
3
|
-
var n = (
|
4
|
-
import { reactive as
|
5
|
-
import { L as
|
6
|
-
import { _ as
|
7
|
-
import { F as
|
8
|
-
import { a as
|
9
|
-
import { _ as
|
10
|
-
import { h as
|
1
|
+
var ut = Object.defineProperty;
|
2
|
+
var ct = (u, i, e) => i in u ? ut(u, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : u[i] = e;
|
3
|
+
var n = (u, i, e) => ct(u, typeof i != "symbol" ? i + "" : i, e);
|
4
|
+
import { reactive as Te, defineAsyncComponent as dt, watch as q, defineComponent as P, toRefs as W, openBlock as S, createElementBlock as C, createElementVNode as T, toDisplayString as N, unref as f, renderSlot as X, createCommentVNode as de, ref as O, onMounted as oe, onUnmounted as ue, normalizeStyle as te, normalizeClass as ce, createTextVNode as me, createBlock as Ne, withCtx as se, mergeModels as Ue, useModel as Ve, nextTick as Le, withDirectives as pt, createStaticVNode as ht, vShow as gt, createVNode as G, isRef as we, Fragment as We, renderList as ze, computed as ye } from "vue";
|
5
|
+
import { L as ft } from "./assets/liquidjs-BfOWWjtJ.js";
|
6
|
+
import { _ as ke } from "./assets/underscore-B0BCaBxV.js";
|
7
|
+
import { F as yt } from "./assets/file-saver-Cnua3zoa.js";
|
8
|
+
import { a as mt } from "./assets/clone-DtpAsLoe.js";
|
9
|
+
import { _ as vt } from "./assets/underscore.string-oDfap0sE.js";
|
10
|
+
import { h as Y } from "./assets/moment-h96o7c8I.js";
|
11
11
|
class D {
|
12
12
|
constructor() {
|
13
13
|
//#region 属性
|
@@ -91,7 +91,7 @@ class D {
|
|
91
91
|
}
|
92
92
|
//#endregion
|
93
93
|
}
|
94
|
-
class
|
94
|
+
class qe {
|
95
95
|
constructor() {
|
96
96
|
n(this, "type");
|
97
97
|
}
|
@@ -148,9 +148,6 @@ class d {
|
|
148
148
|
static get task() {
|
149
149
|
return y.util.task;
|
150
150
|
}
|
151
|
-
static get type() {
|
152
|
-
return y.util.type;
|
153
|
-
}
|
154
151
|
static get time() {
|
155
152
|
return y.util.time;
|
156
153
|
}
|
@@ -164,7 +161,7 @@ class d {
|
|
164
161
|
return y.util.sign;
|
165
162
|
}
|
166
163
|
}
|
167
|
-
class
|
164
|
+
class bt extends qe {
|
168
165
|
constructor() {
|
169
166
|
super(...arguments);
|
170
167
|
//#region 属性
|
@@ -200,14 +197,44 @@ class vt extends We {
|
|
200
197
|
});
|
201
198
|
//#endregion
|
202
199
|
//#region 触发事件
|
200
|
+
/**
|
201
|
+
* 触发刷新
|
202
|
+
*/
|
203
|
+
n(this, "triggerRefresh", (e) => {
|
204
|
+
if (e == null || e.onRefresh == null)
|
205
|
+
return le.notify(pe("common.tips"), "要实现自定义刷新功能,请在组件内部定义并暴露onRefresh方法即可", "warning"), !1;
|
206
|
+
e.onRefresh();
|
207
|
+
});
|
208
|
+
/**
|
209
|
+
* 页面关闭时触发
|
210
|
+
*/
|
211
|
+
n(this, "triggerClose", (e, t) => {
|
212
|
+
if (e == null || e.onClose == null)
|
213
|
+
return !1;
|
214
|
+
e.onClose(t);
|
215
|
+
});
|
203
216
|
/**
|
204
217
|
* 触发键盘事件
|
205
218
|
* 统一封装,方便重构
|
206
219
|
*/
|
207
|
-
n(this, "
|
208
|
-
if (e == null || e.
|
220
|
+
n(this, "triggerKeyboard", (e, t, r) => {
|
221
|
+
if (e == null || e.onKeyboard == null)
|
209
222
|
return !1;
|
210
|
-
e.
|
223
|
+
e.onKeyboard(t, r);
|
224
|
+
});
|
225
|
+
/**
|
226
|
+
* 触发Socket通信事件
|
227
|
+
*/
|
228
|
+
n(this, "triggerSocket", (e, t) => {
|
229
|
+
e == null || e.onSocket == null || e.onSocket(t);
|
230
|
+
});
|
231
|
+
/**
|
232
|
+
* 触发页面大小调整事件
|
233
|
+
*/
|
234
|
+
n(this, "triggerResize", (e, t) => {
|
235
|
+
if (e == null || e.onResize == null)
|
236
|
+
return !1;
|
237
|
+
e.onResize(t);
|
211
238
|
});
|
212
239
|
}
|
213
240
|
//#endregion
|
@@ -221,8 +248,8 @@ class vt extends We {
|
|
221
248
|
let l = s.control.tooltip, a = `${e}.${s.name}.tooltip`;
|
222
249
|
for (let p of l.fields)
|
223
250
|
a += `.${t[p]}`;
|
224
|
-
let o =
|
225
|
-
|
251
|
+
let o = pe(a), c = d.json.deserialize(o);
|
252
|
+
c == null ? (l.title = null, l.content = null) : (l.title = c.title, l.content = d.json.serializeWithoutString(c.content, !0));
|
226
253
|
}
|
227
254
|
}
|
228
255
|
/**
|
@@ -236,15 +263,15 @@ class vt extends We {
|
|
236
263
|
for (let a of s.fields) {
|
237
264
|
let o = (r = a.control.tooltip) == null ? void 0 : r.fields;
|
238
265
|
if (o != null && o.length > 0) {
|
239
|
-
let
|
240
|
-
for (let p of
|
266
|
+
let c = t[s.name];
|
267
|
+
for (let p of c)
|
241
268
|
this.updateTooltipByFields(s.name, p, [a]);
|
242
269
|
}
|
243
270
|
}
|
244
271
|
if (s.show != null) {
|
245
272
|
let a = [];
|
246
273
|
for (let o of s.show) {
|
247
|
-
let
|
274
|
+
let c = o.name ?? o, p = s.fields.find((h) => h.name == c);
|
248
275
|
a.push(p);
|
249
276
|
}
|
250
277
|
s.show = a;
|
@@ -270,7 +297,7 @@ class vt extends We {
|
|
270
297
|
}
|
271
298
|
//#endregion
|
272
299
|
}
|
273
|
-
class
|
300
|
+
class wt extends qe {
|
274
301
|
constructor() {
|
275
302
|
super(...arguments);
|
276
303
|
//#region 属性
|
@@ -366,7 +393,7 @@ class bt extends We {
|
|
366
393
|
}
|
367
394
|
//#endregion
|
368
395
|
}
|
369
|
-
class
|
396
|
+
class kt {
|
370
397
|
constructor() {
|
371
398
|
n(this, "type", "Setting");
|
372
399
|
//#endregion
|
@@ -381,12 +408,12 @@ class wt {
|
|
381
408
|
this[e] = i[e];
|
382
409
|
}
|
383
410
|
}
|
384
|
-
class
|
411
|
+
class xt extends D {
|
385
412
|
open() {
|
386
413
|
super.open(), super.register({
|
387
|
-
Module:
|
388
|
-
Query:
|
389
|
-
Setting:
|
414
|
+
Module: bt,
|
415
|
+
Query: wt,
|
416
|
+
Setting: kt
|
390
417
|
});
|
391
418
|
}
|
392
419
|
/**
|
@@ -410,11 +437,11 @@ class kt extends D {
|
|
410
437
|
return this.createWithCache("Setting");
|
411
438
|
}
|
412
439
|
}
|
413
|
-
var
|
414
|
-
let
|
415
|
-
|
440
|
+
var At = /* @__PURE__ */ ((u) => (u[u.ctrlS = 0] = "ctrlS", u[u.ctrlEnter = 1] = "ctrlEnter", u))(At || {});
|
441
|
+
let St = {}, _t = {}, Ke = {}, Ct = async () => {
|
442
|
+
St = y.repo.module, _t = Te(y.repo.query), Ke = y.repo.setting;
|
416
443
|
};
|
417
|
-
class
|
444
|
+
class Tt {
|
418
445
|
constructor() {
|
419
446
|
/**
|
420
447
|
* 默认背景
|
@@ -442,17 +469,17 @@ class Ct {
|
|
442
469
|
n(this, "cdn", "Local");
|
443
470
|
}
|
444
471
|
}
|
445
|
-
class
|
472
|
+
class Et {
|
446
473
|
constructor() {
|
447
474
|
/**
|
448
475
|
* 用户应用配置
|
449
476
|
*/
|
450
|
-
n(this, "app", new
|
477
|
+
n(this, "app", new Tt());
|
451
478
|
}
|
452
479
|
}
|
453
|
-
class
|
480
|
+
class Je {
|
454
481
|
}
|
455
|
-
class
|
482
|
+
class Ye extends Je {
|
456
483
|
constructor() {
|
457
484
|
super(...arguments);
|
458
485
|
//#region 属性
|
@@ -460,7 +487,7 @@ class Je extends Ke {
|
|
460
487
|
/**
|
461
488
|
* 用户系统配置
|
462
489
|
*/
|
463
|
-
n(this, "sys", new
|
490
|
+
n(this, "sys", new Et());
|
464
491
|
/**
|
465
492
|
* 文件布局方式
|
466
493
|
*/
|
@@ -496,7 +523,7 @@ class Je extends Ke {
|
|
496
523
|
d.object.addProperties(this, [s.kind, s.type], a);
|
497
524
|
}
|
498
525
|
let t = this.sys.app, r = document.documentElement;
|
499
|
-
d.dom.removeClass(r,
|
526
|
+
d.dom.removeClass(r, Xe.theme), d.dom.addClass(r, t.theme), d.mount.emit("theme", t.theme), d.dom.addClass(r, t.layout), this.setBackground(t.background), d.dom.addStyle(r, "font-family", t.font);
|
500
527
|
});
|
501
528
|
}
|
502
529
|
/**
|
@@ -577,7 +604,7 @@ class Je extends Ke {
|
|
577
604
|
return this.sys.app.language || e || "zh-cn";
|
578
605
|
}
|
579
606
|
}
|
580
|
-
class
|
607
|
+
class jt {
|
581
608
|
constructor() {
|
582
609
|
/**
|
583
610
|
* 环境变量
|
@@ -618,7 +645,7 @@ class $t {
|
|
618
645
|
this.logs = [];
|
619
646
|
}
|
620
647
|
}
|
621
|
-
class
|
648
|
+
class Dt {
|
622
649
|
constructor() {
|
623
650
|
//#region 属性
|
624
651
|
n(this, "loaded", !1);
|
@@ -686,7 +713,7 @@ class jt {
|
|
686
713
|
let r = i[t];
|
687
714
|
r && (this[t] = r);
|
688
715
|
}
|
689
|
-
return d.dom.addClass(document.documentElement, this.theme,
|
716
|
+
return d.dom.addClass(document.documentElement, this.theme, Ke.web.theme), d.mount.emits({ theme: this.theme }), Promise.resolve(i);
|
690
717
|
}).catch((i) => Promise.reject(i)));
|
691
718
|
}
|
692
719
|
//#endregion
|
@@ -697,7 +724,7 @@ class jt {
|
|
697
724
|
this.loaded || (await this.load(), this.loaded = !0);
|
698
725
|
}
|
699
726
|
}
|
700
|
-
class
|
727
|
+
class Ht {
|
701
728
|
constructor() {
|
702
729
|
//#region 属性
|
703
730
|
/**
|
@@ -733,13 +760,13 @@ class Dt {
|
|
733
760
|
* 未登录,获取匿名登录信息
|
734
761
|
*/
|
735
762
|
async getAnonymous() {
|
736
|
-
await
|
763
|
+
await ee.bindAsync([]);
|
737
764
|
}
|
738
765
|
/**
|
739
766
|
* 登录后,获取用户信息
|
740
767
|
*/
|
741
768
|
async loadInfo() {
|
742
|
-
return _.get("/user/info").then(async ({ data: i }) => (await
|
769
|
+
return _.get("/user/info").then(async ({ data: i }) => (await ee.bindAsync(i.configs), this.user = i, this.debugger = i.debugger, Promise.resolve(i)));
|
743
770
|
}
|
744
771
|
//#endregion
|
745
772
|
//#region 菜单
|
@@ -773,12 +800,12 @@ class Dt {
|
|
773
800
|
return _.post("/user/logout").then(async () => {
|
774
801
|
this.user = null, this.menus = null;
|
775
802
|
let i = await this.getSso();
|
776
|
-
return await (await y.sso.createAsync(i.type)).logout(),
|
803
|
+
return await (await y.sso.createAsync(i.type)).logout(), De.dispose(), Promise.resolve();
|
777
804
|
});
|
778
805
|
}
|
779
806
|
//#endregion
|
780
807
|
}
|
781
|
-
class
|
808
|
+
class Qe extends Je {
|
782
809
|
constructor() {
|
783
810
|
super(...arguments);
|
784
811
|
//#region 属性
|
@@ -797,11 +824,11 @@ class Xe extends Ke {
|
|
797
824
|
}
|
798
825
|
//#endregion
|
799
826
|
}
|
800
|
-
class
|
827
|
+
class Ot extends D {
|
801
828
|
open() {
|
802
829
|
super.open(), super.register({
|
803
|
-
Config:
|
804
|
-
Driver:
|
830
|
+
Config: Ye,
|
831
|
+
Driver: Qe
|
805
832
|
});
|
806
833
|
}
|
807
834
|
static() {
|
@@ -814,8 +841,8 @@ class Ht extends D {
|
|
814
841
|
return super.createWithCache("Config");
|
815
842
|
}
|
816
843
|
}
|
817
|
-
let
|
818
|
-
},
|
844
|
+
let Cl = () => {
|
845
|
+
}, Xe = Te(new Dt()), ee = new Ye(), Tl = Te(new Qe()), El = new jt(), Re = new $t(), Ut = new Ht();
|
819
846
|
class y {
|
820
847
|
//#endregion
|
821
848
|
//#region 驱动工厂
|
@@ -823,109 +850,115 @@ class y {
|
|
823
850
|
* Builder工厂
|
824
851
|
*/
|
825
852
|
static get builder() {
|
826
|
-
return this.create(
|
853
|
+
return this.create(Ft);
|
827
854
|
}
|
828
855
|
/**
|
829
856
|
* CDN工厂
|
830
857
|
*/
|
831
858
|
static get cdn() {
|
832
|
-
return this.create(
|
859
|
+
return this.create(Wt);
|
833
860
|
}
|
834
861
|
/**
|
835
862
|
* 编码器工厂
|
836
863
|
*/
|
837
864
|
static get encoder() {
|
838
|
-
return this.create(
|
865
|
+
return this.create(Kt);
|
866
|
+
}
|
867
|
+
/**
|
868
|
+
* 加解密工厂
|
869
|
+
*/
|
870
|
+
static get encryptor() {
|
871
|
+
return this.create(Qt);
|
839
872
|
}
|
840
873
|
/**
|
841
874
|
* Excel工厂
|
842
875
|
*/
|
843
876
|
static get excel() {
|
844
|
-
return this.create(
|
877
|
+
return this.create(Zt);
|
845
878
|
}
|
846
879
|
/**
|
847
880
|
* Explainer工厂
|
848
881
|
*/
|
849
882
|
static get explainer() {
|
850
|
-
return this.create(
|
883
|
+
return this.create(rr);
|
851
884
|
}
|
852
885
|
/**
|
853
886
|
* 特征工厂
|
854
887
|
*/
|
855
888
|
static get feature() {
|
856
|
-
return this.create(
|
889
|
+
return this.create(ir);
|
857
890
|
}
|
858
891
|
/**
|
859
892
|
* 哈希工厂
|
860
893
|
*/
|
861
894
|
static get hasher() {
|
862
|
-
return this.create(
|
895
|
+
return this.create(ur);
|
863
896
|
}
|
864
897
|
/**
|
865
898
|
* Http请求工厂
|
866
899
|
*/
|
867
900
|
static get http() {
|
868
|
-
return this.create(
|
901
|
+
return this.create(fr);
|
869
902
|
}
|
870
903
|
/**
|
871
904
|
* 多语言工厂
|
872
905
|
*/
|
873
906
|
static get i18n() {
|
874
|
-
return this.create(
|
907
|
+
return this.create(xr);
|
875
908
|
}
|
876
909
|
/**
|
877
910
|
* 消息提示请求工厂
|
878
911
|
*/
|
879
912
|
static get messenger() {
|
880
|
-
return this.create(
|
913
|
+
return this.create(_r);
|
881
914
|
}
|
882
915
|
/**
|
883
916
|
* 提供程序工厂
|
884
917
|
*/
|
885
918
|
static get provider() {
|
886
|
-
return this.create(
|
919
|
+
return this.create(Bt);
|
887
920
|
}
|
888
921
|
/**
|
889
922
|
* 签名工厂
|
890
923
|
*/
|
891
924
|
static get signer() {
|
892
|
-
return this.create(
|
925
|
+
return this.create(Er);
|
893
926
|
}
|
894
927
|
/**
|
895
928
|
* 通信工厂
|
896
929
|
*/
|
897
930
|
static get socket() {
|
898
|
-
return this.create(
|
931
|
+
return this.create(vr);
|
899
932
|
}
|
900
933
|
/**
|
901
934
|
* SSO工厂
|
902
935
|
*/
|
903
936
|
static get sso() {
|
904
|
-
return this.create(
|
937
|
+
return this.create(Lr);
|
905
938
|
}
|
906
939
|
/**
|
907
940
|
* Task工厂
|
908
941
|
*/
|
909
942
|
static get task() {
|
910
|
-
return this.create(
|
943
|
+
return this.create(Mr);
|
911
944
|
}
|
912
945
|
/**
|
913
946
|
* 模板工厂
|
914
947
|
*/
|
915
948
|
static get template() {
|
916
|
-
return this.create(
|
949
|
+
return this.create(Fr);
|
917
950
|
}
|
918
951
|
/**
|
919
952
|
* 工具工厂
|
920
953
|
*/
|
921
954
|
static get util() {
|
922
|
-
return this.create(
|
955
|
+
return this.create(Nr);
|
923
956
|
}
|
924
957
|
/**
|
925
958
|
* 工具类工厂
|
926
959
|
*/
|
927
960
|
static get utility() {
|
928
|
-
return this.create(
|
961
|
+
return this.create(ms);
|
929
962
|
}
|
930
963
|
//#endregion
|
931
964
|
//#region 仓储工厂
|
@@ -933,7 +966,7 @@ class y {
|
|
933
966
|
* 仓储工厂
|
934
967
|
*/
|
935
968
|
static get repo() {
|
936
|
-
return this.create(
|
969
|
+
return this.create(xt);
|
937
970
|
}
|
938
971
|
//#endregion
|
939
972
|
//#region 服务工厂
|
@@ -941,7 +974,7 @@ class y {
|
|
941
974
|
* 服务工厂
|
942
975
|
*/
|
943
976
|
static get svc() {
|
944
|
-
return this.create(
|
977
|
+
return this.create(Ot);
|
945
978
|
}
|
946
979
|
//#endregion
|
947
980
|
//#region 创建
|
@@ -959,12 +992,12 @@ class y {
|
|
959
992
|
* 工厂缓存
|
960
993
|
*/
|
961
994
|
n(y, "created", {});
|
962
|
-
class
|
995
|
+
class ve {
|
963
996
|
constructor() {
|
964
997
|
n(this, "type");
|
965
998
|
}
|
966
999
|
}
|
967
|
-
class
|
1000
|
+
class Lt extends ve {
|
968
1001
|
constructor() {
|
969
1002
|
super(...arguments);
|
970
1003
|
n(this, "type", "Json");
|
@@ -976,7 +1009,7 @@ class Ut extends me {
|
|
976
1009
|
return d.json.serialize(e.rows, !0);
|
977
1010
|
}
|
978
1011
|
}
|
979
|
-
class
|
1012
|
+
class Rt extends ve {
|
980
1013
|
constructor() {
|
981
1014
|
super(...arguments);
|
982
1015
|
n(this, "type", "Mongo");
|
@@ -984,8 +1017,8 @@ class Lt extends me {
|
|
984
1017
|
insert(e) {
|
985
1018
|
let { name: t, columns: r, rows: s } = e, l = "";
|
986
1019
|
for (let a = 0; a < s.length; a++) {
|
987
|
-
let o = s[a],
|
988
|
-
l += `db.${t}.insert(${
|
1020
|
+
let o = s[a], c = d.json.serialize(o, !0);
|
1021
|
+
l += `db.${t}.insert(${c})`, a != s.length - 1 && (l += `\r
|
989
1022
|
`);
|
990
1023
|
}
|
991
1024
|
return l;
|
@@ -993,14 +1026,14 @@ class Lt extends me {
|
|
993
1026
|
update(e) {
|
994
1027
|
let { name: t, columns: r, rows: s } = e, l = "", a = r.filter((o) => o.key).map((o) => o.name);
|
995
1028
|
for (let o = 0; o < s.length; o++) {
|
996
|
-
let
|
1029
|
+
let c = s[o], p = d.object.extract(c, a), h = d.json.serialize(p, !0), g = d.json.serialize(c, !0);
|
997
1030
|
l += `db.${t}.update(${h},{$set:${g})`, o != s.length - 1 && (l += `\r
|
998
1031
|
`);
|
999
1032
|
}
|
1000
1033
|
return l;
|
1001
1034
|
}
|
1002
1035
|
}
|
1003
|
-
class
|
1036
|
+
class Ee {
|
1004
1037
|
constructor() {
|
1005
1038
|
//#region 属性
|
1006
1039
|
n(this, "type");
|
@@ -1016,7 +1049,7 @@ class Ce {
|
|
1016
1049
|
}
|
1017
1050
|
//#endregion
|
1018
1051
|
}
|
1019
|
-
const
|
1052
|
+
const ie = class ie extends Ee {
|
1020
1053
|
constructor() {
|
1021
1054
|
super(...arguments);
|
1022
1055
|
//#region 属性
|
@@ -1037,11 +1070,11 @@ const le = class le extends Ce {
|
|
1037
1070
|
n(this, "deleteAsync", async (e, t) => {
|
1038
1071
|
if (!(t == null || Object.is(t, NaN)))
|
1039
1072
|
return new Promise(async (r, s) => {
|
1040
|
-
let l = await this.openDbAsync(),
|
1041
|
-
|
1073
|
+
let l = await this.openDbAsync(), c = (await this.openTransAsync(e, "readwrite", l)).objectStore(e).delete(t);
|
1074
|
+
c.onsuccess = (p) => {
|
1042
1075
|
let h = p.target.result;
|
1043
1076
|
r(h);
|
1044
|
-
},
|
1077
|
+
}, c.onerror = (p) => {
|
1045
1078
|
let h = p.target.error.message;
|
1046
1079
|
s(h);
|
1047
1080
|
};
|
@@ -1058,7 +1091,7 @@ const le = class le extends Ce {
|
|
1058
1091
|
let s = indexedDB.open(this.database);
|
1059
1092
|
s.onsuccess = (l) => {
|
1060
1093
|
let a = l.target.result;
|
1061
|
-
|
1094
|
+
ie.version = a.version, this.objectStoreNames = a.objectStoreNames, t();
|
1062
1095
|
}, s.onerror = (l) => {
|
1063
1096
|
r(l.target);
|
1064
1097
|
};
|
@@ -1069,7 +1102,7 @@ const le = class le extends Ce {
|
|
1069
1102
|
*/
|
1070
1103
|
async createAsync(e) {
|
1071
1104
|
return e == null ? Promise.resolve() : this.objectStoreNames.contains(e) ? Promise.resolve(!0) : new Promise((t, r) => {
|
1072
|
-
let s = indexedDB.open(this.database, ++
|
1105
|
+
let s = indexedDB.open(this.database, ++ie.version);
|
1073
1106
|
s.onupgradeneeded = (l) => {
|
1074
1107
|
let a = l.target.result;
|
1075
1108
|
a.objectStoreNames.contains(e) || a.createObjectStore(e);
|
@@ -1085,7 +1118,7 @@ const le = class le extends Ce {
|
|
1085
1118
|
*/
|
1086
1119
|
async openDbAsync() {
|
1087
1120
|
return new Promise((e, t) => {
|
1088
|
-
let r = indexedDB.open(this.database,
|
1121
|
+
let r = indexedDB.open(this.database, ie.version);
|
1089
1122
|
r.onsuccess = (s) => {
|
1090
1123
|
let l = s.target.result;
|
1091
1124
|
e(l);
|
@@ -1117,11 +1150,11 @@ const le = class le extends Ce {
|
|
1117
1150
|
*/
|
1118
1151
|
async getAsync(e, t) {
|
1119
1152
|
return t == null ? Promise.resolve(null) : new Promise(async (r, s) => {
|
1120
|
-
let l = await this.openDbAsync(),
|
1121
|
-
|
1153
|
+
let l = await this.openDbAsync(), c = (await this.openTransAsync(e, "readonly", l)).objectStore(e).get(t);
|
1154
|
+
c.onsuccess = (p) => {
|
1122
1155
|
let h = p.target.result;
|
1123
1156
|
r(h);
|
1124
|
-
},
|
1157
|
+
}, c.onerror = (p) => {
|
1125
1158
|
s(p.target);
|
1126
1159
|
};
|
1127
1160
|
});
|
@@ -1129,11 +1162,11 @@ const le = class le extends Ce {
|
|
1129
1162
|
async getKeysAsync(e) {
|
1130
1163
|
return e == null ? Promise.resolve([]) : new Promise(async (t, r) => {
|
1131
1164
|
let s = await this.openDbAsync(), o = (await this.openTransAsync(e, "readonly", s)).objectStore(e).getAllKeys();
|
1132
|
-
o.onsuccess = (
|
1133
|
-
let p =
|
1165
|
+
o.onsuccess = (c) => {
|
1166
|
+
let p = c.target.result;
|
1134
1167
|
t(p);
|
1135
|
-
}, o.onerror = (
|
1136
|
-
r(
|
1168
|
+
}, o.onerror = (c) => {
|
1169
|
+
r(c.target);
|
1137
1170
|
};
|
1138
1171
|
});
|
1139
1172
|
}
|
@@ -1175,7 +1208,7 @@ const le = class le extends Ce {
|
|
1175
1208
|
return;
|
1176
1209
|
let s = await this.openDbAsync();
|
1177
1210
|
return new Promise(async (l, a) => {
|
1178
|
-
let o = await this.openTransAsync(e, "readwrite", s),
|
1211
|
+
let o = await this.openTransAsync(e, "readwrite", s), c = d.object.clone(r), h = o.objectStore(e).put(c, t);
|
1179
1212
|
h.onsuccess = (g) => {
|
1180
1213
|
let m = g.target.result;
|
1181
1214
|
l(m);
|
@@ -1202,9 +1235,9 @@ const le = class le extends Ce {
|
|
1202
1235
|
/**
|
1203
1236
|
* 静态版本,保证所有数据库实例拿到最新版本信息
|
1204
1237
|
*/
|
1205
|
-
n(
|
1206
|
-
let
|
1207
|
-
class
|
1238
|
+
n(ie, "version", null);
|
1239
|
+
let Ae = ie;
|
1240
|
+
class It extends Ee {
|
1208
1241
|
constructor() {
|
1209
1242
|
super(...arguments);
|
1210
1243
|
//#region 属性
|
@@ -1278,7 +1311,7 @@ class Rt extends Ce {
|
|
1278
1311
|
}
|
1279
1312
|
//#endregion
|
1280
1313
|
}
|
1281
|
-
class
|
1314
|
+
class Mt extends Ee {
|
1282
1315
|
constructor() {
|
1283
1316
|
super(...arguments);
|
1284
1317
|
//#region 属性
|
@@ -1324,7 +1357,7 @@ class It extends Ce {
|
|
1324
1357
|
}
|
1325
1358
|
//#endregion
|
1326
1359
|
}
|
1327
|
-
class
|
1360
|
+
class Bt extends D {
|
1328
1361
|
constructor() {
|
1329
1362
|
super(...arguments);
|
1330
1363
|
n(this, "type", "Provider");
|
@@ -1332,9 +1365,9 @@ class Mt extends D {
|
|
1332
1365
|
}
|
1333
1366
|
open() {
|
1334
1367
|
super.open(), super.register({
|
1335
|
-
IndexedDb:
|
1336
|
-
Storage:
|
1337
|
-
Cookie:
|
1368
|
+
IndexedDb: Ae,
|
1369
|
+
Storage: It,
|
1370
|
+
Cookie: Mt
|
1338
1371
|
});
|
1339
1372
|
}
|
1340
1373
|
/**
|
@@ -1354,7 +1387,7 @@ class Mt extends D {
|
|
1354
1387
|
return super.create("Storage");
|
1355
1388
|
}
|
1356
1389
|
}
|
1357
|
-
class
|
1390
|
+
class Ie {
|
1358
1391
|
/**
|
1359
1392
|
* 获取实际SQL字段名称
|
1360
1393
|
*/
|
@@ -1371,13 +1404,13 @@ class Re {
|
|
1371
1404
|
return e == "number" || e == "boolean" ? i : e == "object" || e == "string" ? `'${(e == "object" ? d.json.serialize(i) : i).replace(/'/g, "''")}'` : i;
|
1372
1405
|
}
|
1373
1406
|
}
|
1374
|
-
class
|
1407
|
+
class Se extends ve {
|
1375
1408
|
constructor() {
|
1376
1409
|
super(...arguments);
|
1377
1410
|
n(this, "type", "Sql");
|
1378
1411
|
}
|
1379
1412
|
insert(e) {
|
1380
|
-
let { name: t, columns: r, rows: s } = e, l = e.getIdentity(), a = "", p = r.filter((h) => !h.identity).map((h) =>
|
1413
|
+
let { name: t, columns: r, rows: s } = e, l = e.getIdentity(), a = "", p = r.filter((h) => !h.identity).map((h) => Ie.getSqlName(h.name)).join(", ");
|
1381
1414
|
for (let h = 0; h < s.length; h++) {
|
1382
1415
|
let g = s[h];
|
1383
1416
|
a += `INSERT INTO ${t}\r
|
@@ -1386,11 +1419,11 @@ class xe extends me {
|
|
1386
1419
|
`, a += "(";
|
1387
1420
|
let m = Object.keys(g);
|
1388
1421
|
for (let k = 0; k < m.length; k++) {
|
1389
|
-
let
|
1390
|
-
if (l != null && l.name ==
|
1422
|
+
let H = m[k];
|
1423
|
+
if (l != null && l.name == H)
|
1391
1424
|
continue;
|
1392
|
-
let
|
1393
|
-
a += `${
|
1425
|
+
let M = g[H];
|
1426
|
+
a += `${Ie.getValue(M)}`, k != m.length - 1 && (a += ", ");
|
1394
1427
|
}
|
1395
1428
|
a += ")", h != s.length - 1 && (a += `\r
|
1396
1429
|
\r
|
@@ -1402,33 +1435,33 @@ class xe extends me {
|
|
1402
1435
|
return "";
|
1403
1436
|
}
|
1404
1437
|
}
|
1405
|
-
class Pt extends
|
1438
|
+
class Pt extends ve {
|
1406
1439
|
constructor() {
|
1407
1440
|
super(...arguments);
|
1408
1441
|
n(this, "type", "MySql");
|
1409
1442
|
}
|
1410
1443
|
insert(e) {
|
1411
|
-
return new
|
1444
|
+
return new Se().insert(e);
|
1412
1445
|
}
|
1413
1446
|
update(e) {
|
1414
|
-
return new
|
1447
|
+
return new Se().update(e);
|
1415
1448
|
}
|
1416
1449
|
}
|
1417
|
-
class
|
1450
|
+
class Ft extends D {
|
1418
1451
|
constructor() {
|
1419
1452
|
super(...arguments);
|
1420
1453
|
n(this, "type", "Builder");
|
1421
1454
|
}
|
1422
1455
|
open() {
|
1423
1456
|
super.open(), super.register({
|
1424
|
-
Json:
|
1425
|
-
Mongo:
|
1457
|
+
Json: Lt,
|
1458
|
+
Mongo: Rt,
|
1426
1459
|
MySql: Pt,
|
1427
|
-
Sql:
|
1460
|
+
Sql: Se
|
1428
1461
|
});
|
1429
1462
|
}
|
1430
1463
|
}
|
1431
|
-
class
|
1464
|
+
class jl {
|
1432
1465
|
constructor() {
|
1433
1466
|
/**
|
1434
1467
|
* 表名
|
@@ -1450,8 +1483,10 @@ class Sl {
|
|
1450
1483
|
return this.columns == null || this.columns.length == 0 ? null : this.columns.find((e) => e.identity);
|
1451
1484
|
}
|
1452
1485
|
}
|
1453
|
-
class
|
1486
|
+
class Ge {
|
1454
1487
|
constructor() {
|
1488
|
+
//#region 属性
|
1489
|
+
n(this, "type");
|
1455
1490
|
/**
|
1456
1491
|
* 任务实例,用于控制并发
|
1457
1492
|
*/
|
@@ -1463,10 +1498,10 @@ class Ye {
|
|
1463
1498
|
let e = d.string.getArray(i), t = [];
|
1464
1499
|
for (let s of e) {
|
1465
1500
|
let l = new Promise((a, o) => {
|
1466
|
-
let
|
1467
|
-
|
1468
|
-
a(
|
1469
|
-
},
|
1501
|
+
let c = d.dom.getByUrl(s);
|
1502
|
+
c != null ? a(c) : (c = d.dom.createByUrl(s), document.head.appendChild(c), c.onload = (p) => {
|
1503
|
+
a(c);
|
1504
|
+
}, c.onerror = (p) => {
|
1470
1505
|
o(p);
|
1471
1506
|
let h;
|
1472
1507
|
throw p instanceof Event ? h = `${p.type}, 耗时: ${p.timeStamp}` : h = p, new Error(`脚本: ${s} 加载出错: ${h}`);
|
@@ -1492,22 +1527,16 @@ class Ye {
|
|
1492
1527
|
async getFortAwesome() {
|
1493
1528
|
}
|
1494
1529
|
async getMonaco(i = null) {
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
let a = ["/loader.js"];
|
1503
|
-
await this.loadFilesAsync(i, a);
|
1504
|
-
let o = window.require;
|
1505
|
-
o.config({ paths: { vs: i } }), o(["vs/editor/editor.main"], (u) => {
|
1506
|
-
s(u);
|
1530
|
+
return await this.loadByOrder("monaco", async () => {
|
1531
|
+
await new Promise(async (r, s) => {
|
1532
|
+
let l = ["/loader.js"];
|
1533
|
+
await this.loadFilesAsync(i, l);
|
1534
|
+
let a = window.require;
|
1535
|
+
a.config({ paths: { vs: i } }), a(["vs/editor/editor.main"], (o) => {
|
1536
|
+
r(o);
|
1507
1537
|
});
|
1508
1538
|
});
|
1509
|
-
};
|
1510
|
-
return await this.task.concurrent(t), e = window.monaco, e;
|
1539
|
+
});
|
1511
1540
|
}
|
1512
1541
|
async getQuill() {
|
1513
1542
|
}
|
@@ -1516,20 +1545,28 @@ class Ye {
|
|
1516
1545
|
async getXlsx() {
|
1517
1546
|
}
|
1518
1547
|
//#region 加载
|
1548
|
+
/**
|
1549
|
+
* 使用define函数加载类库,并防止define与monaco-editor的define全局函数冲突
|
1550
|
+
*/
|
1551
|
+
async loadByDefine(i, e, t) {
|
1552
|
+
return await this.loadByOrder(i, async () => {
|
1553
|
+
let s = window.define;
|
1554
|
+
typeof s == "function" && (window.define = null), await this.loadFilesAsync(e, t), typeof s == "function" && (window.define = s);
|
1555
|
+
});
|
1556
|
+
}
|
1519
1557
|
/**
|
1520
1558
|
* 使用并发限制顺序加载资源,并防止monaco-editor的define函数冲突
|
1521
1559
|
*/
|
1522
|
-
async loadByOrder(i, e
|
1523
|
-
let
|
1524
|
-
if (
|
1525
|
-
return
|
1526
|
-
let
|
1527
|
-
if (window[
|
1560
|
+
async loadByOrder(i, e) {
|
1561
|
+
let t = window[i];
|
1562
|
+
if (t)
|
1563
|
+
return t;
|
1564
|
+
let r = async () => {
|
1565
|
+
if (window[i])
|
1528
1566
|
return Promise.resolve();
|
1529
|
-
|
1530
|
-
typeof l == "function" && (window.define = null), await this.loadFilesAsync(i, e), typeof l == "function" && (window.define = l);
|
1567
|
+
await e();
|
1531
1568
|
};
|
1532
|
-
return await this.task.concurrent(
|
1569
|
+
return await this.task.concurrent(r), t = window[i], t;
|
1533
1570
|
}
|
1534
1571
|
async loadFilesAsync(i, e) {
|
1535
1572
|
let t = [];
|
@@ -1539,7 +1576,7 @@ class Ye {
|
|
1539
1576
|
}
|
1540
1577
|
//#endregion
|
1541
1578
|
}
|
1542
|
-
class
|
1579
|
+
class Nt extends Ge {
|
1543
1580
|
constructor() {
|
1544
1581
|
super(...arguments);
|
1545
1582
|
//#region 属性
|
@@ -1548,11 +1585,11 @@ class Ft extends Ye {
|
|
1548
1585
|
//#endregion
|
1549
1586
|
async getCrypto() {
|
1550
1587
|
let e = ["/crypto-js.js"];
|
1551
|
-
return await super.
|
1588
|
+
return await super.loadByDefine("CryptoJS", "/assets/crypto-js@4.2.0", e);
|
1552
1589
|
}
|
1553
1590
|
async getECharts() {
|
1554
1591
|
let e = ["/dist/echarts.min.js"];
|
1555
|
-
return await super.
|
1592
|
+
return await super.loadByDefine("echarts", "/assets/echarts@5.5.1", e);
|
1556
1593
|
}
|
1557
1594
|
async getElementPlus() {
|
1558
1595
|
let e = ["/dist/index.css", "/theme-chalk/dark/css-vars.css"];
|
@@ -1567,17 +1604,14 @@ class Ft extends Ye {
|
|
1567
1604
|
}
|
1568
1605
|
async getQuill() {
|
1569
1606
|
let e = ["/quill.snow.css", "/quill.js"];
|
1570
|
-
return await this.
|
1571
|
-
}
|
1572
|
-
async getWeiXin() {
|
1573
|
-
return Promise.resolve(void 0);
|
1607
|
+
return await this.loadByDefine("Quill", "/assets/quill@2.0.2/dist", e);
|
1574
1608
|
}
|
1575
1609
|
async getXlsx() {
|
1576
1610
|
let e = ["/dist/xlsx.min.js"];
|
1577
1611
|
return await super.loadFilesAsync("/assets/xlsx-js-style@1.2.0", e), window.XLSX;
|
1578
1612
|
}
|
1579
1613
|
}
|
1580
|
-
class
|
1614
|
+
class Vt extends Ge {
|
1581
1615
|
constructor() {
|
1582
1616
|
super(...arguments);
|
1583
1617
|
//#region 属性
|
@@ -1588,11 +1622,11 @@ class Nt extends Ye {
|
|
1588
1622
|
//#endregion
|
1589
1623
|
async getCrypto() {
|
1590
1624
|
let e = ["/crypto-js.js"];
|
1591
|
-
return await super.
|
1625
|
+
return await super.loadByDefine("CryptoJS", `${this.jdCdn}/crypto-js@4.2.0`, e);
|
1592
1626
|
}
|
1593
1627
|
async getECharts() {
|
1594
1628
|
let e = ["/dist/echarts.min.js"];
|
1595
|
-
return await super.
|
1629
|
+
return await super.loadByDefine("echarts", `${this.jdCdn}/echarts@5.5.1`, e);
|
1596
1630
|
}
|
1597
1631
|
async getElementPlus() {
|
1598
1632
|
let e = [
|
@@ -1603,9 +1637,7 @@ class Nt extends Ye {
|
|
1603
1637
|
await super.loadFilesAsync(`${this.staticFileCdn}/element-plus/2.7.8`, e);
|
1604
1638
|
}
|
1605
1639
|
async getFortAwesome() {
|
1606
|
-
let e = [
|
1607
|
-
"/css/all.min.css"
|
1608
|
-
];
|
1640
|
+
let e = ["/css/all.min.css"];
|
1609
1641
|
await super.loadFilesAsync(`${this.jdCdn}/@fortawesome/fontawesome-free@6.5.2`, e);
|
1610
1642
|
}
|
1611
1643
|
async getMonaco() {
|
@@ -1613,7 +1645,7 @@ class Nt extends Ye {
|
|
1613
1645
|
}
|
1614
1646
|
async getQuill() {
|
1615
1647
|
let e = ["/quill.snow.css", "/quill.js"];
|
1616
|
-
return await this.
|
1648
|
+
return await this.loadByDefine("Quill", `${this.staticFileCdn}/quill/2.0.2`, e);
|
1617
1649
|
}
|
1618
1650
|
async getWeiXin() {
|
1619
1651
|
let e = ["/open/js/jweixin-1.6.0.js"];
|
@@ -1626,15 +1658,15 @@ class Nt extends Ye {
|
|
1626
1658
|
return await super.loadFilesAsync(`${this.jdCdn}/xlsx-js-style@1.2.0`, e), window.XLSX;
|
1627
1659
|
}
|
1628
1660
|
}
|
1629
|
-
class
|
1661
|
+
class Wt extends D {
|
1630
1662
|
constructor() {
|
1631
1663
|
super(...arguments);
|
1632
1664
|
n(this, "type", "Cdn");
|
1633
1665
|
}
|
1634
1666
|
open() {
|
1635
1667
|
super.open(), super.register({
|
1636
|
-
Local:
|
1637
|
-
Third:
|
1668
|
+
Local: Nt,
|
1669
|
+
Third: Vt
|
1638
1670
|
});
|
1639
1671
|
}
|
1640
1672
|
/**
|
@@ -1645,7 +1677,7 @@ class qt extends D {
|
|
1645
1677
|
return await r.openAsync(t), r;
|
1646
1678
|
}
|
1647
1679
|
}
|
1648
|
-
class
|
1680
|
+
class Ze {
|
1649
1681
|
constructor() {
|
1650
1682
|
n(this, "type");
|
1651
1683
|
}
|
@@ -1660,7 +1692,7 @@ class Ge {
|
|
1660
1692
|
return JSON.parse(e);
|
1661
1693
|
}
|
1662
1694
|
}
|
1663
|
-
class
|
1695
|
+
class zt extends Ze {
|
1664
1696
|
constructor() {
|
1665
1697
|
super(...arguments);
|
1666
1698
|
//#region 属性
|
@@ -1670,7 +1702,7 @@ class Vt extends Ge {
|
|
1670
1702
|
//#endregion
|
1671
1703
|
//#region 开启
|
1672
1704
|
async openAsync(e) {
|
1673
|
-
this.crypto = await
|
1705
|
+
this.crypto = await re.getCrypto();
|
1674
1706
|
}
|
1675
1707
|
//#endregion
|
1676
1708
|
encodeString(e) {
|
@@ -1682,7 +1714,7 @@ class Vt extends Ge {
|
|
1682
1714
|
return this.crypto.enc.Utf8.stringify(t);
|
1683
1715
|
}
|
1684
1716
|
}
|
1685
|
-
class
|
1717
|
+
class qt extends Ze {
|
1686
1718
|
constructor() {
|
1687
1719
|
super(...arguments);
|
1688
1720
|
n(this, "type", "Url");
|
@@ -1694,15 +1726,15 @@ class Wt extends Ge {
|
|
1694
1726
|
return decodeURIComponent(e);
|
1695
1727
|
}
|
1696
1728
|
}
|
1697
|
-
class
|
1729
|
+
class Kt extends D {
|
1698
1730
|
constructor() {
|
1699
1731
|
super(...arguments);
|
1700
1732
|
n(this, "type", "Encoder");
|
1701
1733
|
}
|
1702
1734
|
open() {
|
1703
1735
|
super.open(), super.register({
|
1704
|
-
Base64:
|
1705
|
-
Url:
|
1736
|
+
Base64: zt,
|
1737
|
+
Url: qt
|
1706
1738
|
});
|
1707
1739
|
}
|
1708
1740
|
/**
|
@@ -1722,12 +1754,54 @@ class zt extends D {
|
|
1722
1754
|
return this.createWithCache("Url");
|
1723
1755
|
}
|
1724
1756
|
}
|
1725
|
-
class
|
1757
|
+
class Jt {
|
1758
|
+
constructor() {
|
1759
|
+
n(this, "type");
|
1760
|
+
}
|
1761
|
+
async openAsync(i) {
|
1762
|
+
d.json.mergeTo(this, i);
|
1763
|
+
}
|
1764
|
+
encrypt(i, e) {
|
1765
|
+
let t = d.json.serializeWithoutString(i);
|
1766
|
+
return this.encryptString(t, e);
|
1767
|
+
}
|
1768
|
+
}
|
1769
|
+
class Yt extends Jt {
|
1770
|
+
constructor() {
|
1771
|
+
super(...arguments);
|
1772
|
+
//#region 属性
|
1773
|
+
n(this, "crypto");
|
1774
|
+
}
|
1775
|
+
//#endregion
|
1776
|
+
//#region 开启
|
1777
|
+
async openAsync(e) {
|
1778
|
+
await super.openAsync(e), this.crypto = await re.getCrypto();
|
1779
|
+
}
|
1780
|
+
//#endregion
|
1781
|
+
encryptString(e, t) {
|
1782
|
+
return this.crypto.AES.encrypt(e, t).toString();
|
1783
|
+
}
|
1784
|
+
}
|
1785
|
+
class Qt extends D {
|
1786
|
+
open() {
|
1787
|
+
super.open(), super.register({
|
1788
|
+
Aes: Yt
|
1789
|
+
});
|
1790
|
+
}
|
1791
|
+
/**
|
1792
|
+
* 获取AES加解密器
|
1793
|
+
*/
|
1794
|
+
async getAesAsync() {
|
1795
|
+
let i = this.createWithCache("Aes");
|
1796
|
+
return await i.openAsync(), i;
|
1797
|
+
}
|
1798
|
+
}
|
1799
|
+
class Xt {
|
1726
1800
|
constructor() {
|
1727
1801
|
n(this, "type");
|
1728
1802
|
}
|
1729
1803
|
}
|
1730
|
-
class
|
1804
|
+
class Gt extends Xt {
|
1731
1805
|
constructor() {
|
1732
1806
|
super(...arguments);
|
1733
1807
|
//#region 属性
|
@@ -1737,7 +1811,7 @@ class Jt extends Kt {
|
|
1737
1811
|
//#endregion
|
1738
1812
|
//#region 开启
|
1739
1813
|
async openAsync(e) {
|
1740
|
-
this.xlsx = await
|
1814
|
+
this.xlsx = await re.getXlsx();
|
1741
1815
|
}
|
1742
1816
|
//#endregion
|
1743
1817
|
export(e, t) {
|
@@ -1758,9 +1832,9 @@ class Jt extends Kt {
|
|
1758
1832
|
}
|
1759
1833
|
let a = this.xlsx.utils.book_new(), o = this.xlsx.utils.json_to_sheet(s, { skipHeader: !0 });
|
1760
1834
|
this.xlsx.utils.book_append_sheet(a, o, "abc");
|
1761
|
-
let
|
1835
|
+
let c = 65;
|
1762
1836
|
for (let h = 0; h < r.length; h++) {
|
1763
|
-
let m = `${String.fromCharCode(
|
1837
|
+
let m = `${String.fromCharCode(c + h)}1`;
|
1764
1838
|
o[m].s = {
|
1765
1839
|
alignment: { horizontal: "center" },
|
1766
1840
|
font: { bold: !0, color: { rgb: "000000" } },
|
@@ -1774,14 +1848,14 @@ class Jt extends Kt {
|
|
1774
1848
|
}), o["!cols"] = p, this.xlsx.writeFile(a, t);
|
1775
1849
|
}
|
1776
1850
|
}
|
1777
|
-
class
|
1851
|
+
class Zt extends D {
|
1778
1852
|
constructor() {
|
1779
1853
|
super(...arguments);
|
1780
1854
|
n(this, "type", "Excel");
|
1781
1855
|
}
|
1782
1856
|
open() {
|
1783
1857
|
super.open(), super.register({
|
1784
|
-
Xlsx:
|
1858
|
+
Xlsx: Gt
|
1785
1859
|
});
|
1786
1860
|
}
|
1787
1861
|
/**
|
@@ -1792,25 +1866,25 @@ class Xt extends D {
|
|
1792
1866
|
return await r.openAsync(t), r;
|
1793
1867
|
}
|
1794
1868
|
}
|
1795
|
-
class
|
1869
|
+
class er {
|
1796
1870
|
constructor() {
|
1797
1871
|
n(this, "type", "Json");
|
1798
1872
|
}
|
1799
1873
|
}
|
1800
|
-
class
|
1874
|
+
class tr extends er {
|
1801
1875
|
}
|
1802
|
-
class
|
1876
|
+
class rr extends D {
|
1803
1877
|
constructor() {
|
1804
1878
|
super(...arguments);
|
1805
1879
|
n(this, "type", "Explainer");
|
1806
1880
|
}
|
1807
1881
|
open() {
|
1808
1882
|
super.open(), super.register({
|
1809
|
-
Json:
|
1883
|
+
Json: tr
|
1810
1884
|
});
|
1811
1885
|
}
|
1812
1886
|
}
|
1813
|
-
class
|
1887
|
+
class je {
|
1814
1888
|
constructor() {
|
1815
1889
|
n(this, "type");
|
1816
1890
|
}
|
@@ -1818,7 +1892,7 @@ class Te {
|
|
1818
1892
|
return d.json.mergeTo(this, i), Promise.resolve();
|
1819
1893
|
}
|
1820
1894
|
}
|
1821
|
-
class
|
1895
|
+
class sr extends je {
|
1822
1896
|
constructor() {
|
1823
1897
|
super(...arguments);
|
1824
1898
|
n(this, "type", "Sort");
|
@@ -1842,7 +1916,7 @@ class Zt extends Te {
|
|
1842
1916
|
}
|
1843
1917
|
}
|
1844
1918
|
}
|
1845
|
-
class
|
1919
|
+
class lr extends je {
|
1846
1920
|
constructor() {
|
1847
1921
|
super(...arguments);
|
1848
1922
|
n(this, "type", "I18N");
|
@@ -1854,7 +1928,7 @@ class er extends Te {
|
|
1854
1928
|
copy(e, t, r) {
|
1855
1929
|
}
|
1856
1930
|
}
|
1857
|
-
class
|
1931
|
+
class nr extends je {
|
1858
1932
|
constructor() {
|
1859
1933
|
super(...arguments);
|
1860
1934
|
n(this, "type", "Expression");
|
@@ -1866,16 +1940,16 @@ class tr extends Te {
|
|
1866
1940
|
copy(e, t, r) {
|
1867
1941
|
}
|
1868
1942
|
}
|
1869
|
-
class
|
1943
|
+
class ir extends D {
|
1870
1944
|
constructor() {
|
1871
1945
|
super(...arguments);
|
1872
1946
|
n(this, "type", "Feature");
|
1873
1947
|
}
|
1874
1948
|
open() {
|
1875
1949
|
super.open(), super.register({
|
1876
|
-
Sort:
|
1877
|
-
I18N:
|
1878
|
-
Expression:
|
1950
|
+
Sort: sr,
|
1951
|
+
I18N: lr,
|
1952
|
+
Expression: nr
|
1879
1953
|
});
|
1880
1954
|
}
|
1881
1955
|
/**
|
@@ -1886,18 +1960,18 @@ class rr extends D {
|
|
1886
1960
|
return await r.openAsync(null), r;
|
1887
1961
|
}
|
1888
1962
|
}
|
1889
|
-
class
|
1963
|
+
class et {
|
1890
1964
|
constructor() {
|
1891
1965
|
n(this, "type");
|
1892
1966
|
}
|
1893
1967
|
}
|
1894
|
-
class
|
1968
|
+
class ar extends et {
|
1895
1969
|
constructor() {
|
1896
1970
|
super(...arguments);
|
1897
1971
|
//#region 属性
|
1898
1972
|
n(this, "type", "Sha256");
|
1899
1973
|
//#endregion
|
1900
|
-
n(this, "
|
1974
|
+
n(this, "computeAsync", async (e) => {
|
1901
1975
|
let r = new TextEncoder().encode(e), s = await crypto.subtle.digest("SHA-256", r);
|
1902
1976
|
return Array.from(new Uint8Array(s)).map((o) => o.toString(16).padStart(2, "0")).join("");
|
1903
1977
|
});
|
@@ -1907,14 +1981,14 @@ class sr extends Ze {
|
|
1907
1981
|
async openAsync(e) {
|
1908
1982
|
}
|
1909
1983
|
}
|
1910
|
-
class
|
1984
|
+
class or extends et {
|
1911
1985
|
constructor() {
|
1912
1986
|
super(...arguments);
|
1913
1987
|
//#region 属性
|
1914
1988
|
n(this, "type", "Md5");
|
1915
1989
|
n(this, "crypto");
|
1916
1990
|
//#endregion
|
1917
|
-
n(this, "
|
1991
|
+
n(this, "computeAsync", async (e) => {
|
1918
1992
|
let t = this.crypto.MD5(e).toString();
|
1919
1993
|
return Promise.resolve(t);
|
1920
1994
|
});
|
@@ -1922,18 +1996,18 @@ class lr extends Ze {
|
|
1922
1996
|
//#endregion
|
1923
1997
|
//#region 开启
|
1924
1998
|
async openAsync(e) {
|
1925
|
-
this.crypto = await
|
1999
|
+
this.crypto = await re.getCrypto();
|
1926
2000
|
}
|
1927
2001
|
}
|
1928
|
-
class
|
2002
|
+
class ur extends D {
|
1929
2003
|
constructor() {
|
1930
2004
|
super(...arguments);
|
1931
2005
|
n(this, "type", "Hasher");
|
1932
2006
|
}
|
1933
2007
|
open() {
|
1934
2008
|
super.open(), super.register({
|
1935
|
-
Sha256:
|
1936
|
-
Md5:
|
2009
|
+
Sha256: ar,
|
2010
|
+
Md5: or
|
1937
2011
|
});
|
1938
2012
|
}
|
1939
2013
|
async createAsync(e, t) {
|
@@ -1943,11 +2017,17 @@ class nr extends D {
|
|
1943
2017
|
/**
|
1944
2018
|
* 获取MD5 Hash对象
|
1945
2019
|
*/
|
1946
|
-
async
|
2020
|
+
async getMd5Async() {
|
1947
2021
|
return this.createWithCacheAsync("Md5");
|
1948
2022
|
}
|
2023
|
+
/**
|
2024
|
+
* 获取Sha256 Hash对象
|
2025
|
+
*/
|
2026
|
+
async getSha256Async() {
|
2027
|
+
return this.createWithCacheAsync("Sha256");
|
2028
|
+
}
|
1949
2029
|
}
|
1950
|
-
class
|
2030
|
+
class tt {
|
1951
2031
|
constructor() {
|
1952
2032
|
/**
|
1953
2033
|
* 请求唯一标识
|
@@ -2005,11 +2085,11 @@ class et {
|
|
2005
2085
|
* 不能放在getRequest中处理,因为外部会直接调用当前send方法,而不走getRequest
|
2006
2086
|
*/
|
2007
2087
|
prepare() {
|
2008
|
-
this.body == null && this.data != null && d.string.startWith(this.contentType, "application/json") && (this.body = d.json.serializeWithoutString(this.data)), this.data == null && this.body != null && d.string.startWith(this.contentType, "application/json") && (this.data = d.json.deserialize(this.body)), this.contentType != null && this.addHeader("content-type", this.contentType);
|
2088
|
+
this.body == null && this.data != null && d.string.startWith(this.contentType, "application/json") && (this.body = d.json.serializeWithoutString(this.data, !0)), this.data == null && this.body != null && d.string.startWith(this.contentType, "application/json") && (this.data = d.json.deserialize(this.body)), this.contentType != null && this.addHeader("content-type", this.contentType);
|
2009
2089
|
}
|
2010
2090
|
//#endregion
|
2011
2091
|
}
|
2012
|
-
class
|
2092
|
+
class rt extends tt {
|
2013
2093
|
constructor() {
|
2014
2094
|
super();
|
2015
2095
|
/**
|
@@ -2024,10 +2104,14 @@ class tt extends et {
|
|
2024
2104
|
* 实际请求地址
|
2025
2105
|
*/
|
2026
2106
|
n(this, "url");
|
2107
|
+
/**
|
2108
|
+
* 请求变量,用于后续任意选择时机,进行请求变量替换工作
|
2109
|
+
*/
|
2110
|
+
n(this, "variables");
|
2027
2111
|
this.id = d.string.getUniqueId(8);
|
2028
2112
|
}
|
2029
2113
|
}
|
2030
|
-
class
|
2114
|
+
class cr {
|
2031
2115
|
constructor() {
|
2032
2116
|
n(this, "request");
|
2033
2117
|
n(this, "model");
|
@@ -2036,10 +2120,14 @@ class ir {
|
|
2036
2120
|
n(this, "time");
|
2037
2121
|
}
|
2038
2122
|
}
|
2039
|
-
class
|
2123
|
+
class be {
|
2040
2124
|
constructor() {
|
2041
2125
|
//#region 属性
|
2042
2126
|
n(this, "type");
|
2127
|
+
/**
|
2128
|
+
* 基准请求地址
|
2129
|
+
*/
|
2130
|
+
n(this, "baseUrl");
|
2043
2131
|
/**
|
2044
2132
|
* 默认请求器
|
2045
2133
|
*/
|
@@ -2073,8 +2161,8 @@ class Ee {
|
|
2073
2161
|
* 获取请求消息
|
2074
2162
|
*/
|
2075
2163
|
n(this, "getRequest", async (i, e, t, r = null) => {
|
2076
|
-
let s = new
|
2077
|
-
return s.method = i, s.contentType = e, s.path = t, s.body = d.json.serializeWithoutString(r), s;
|
2164
|
+
let s = new rt();
|
2165
|
+
return s.method = i, s.contentType = e, s.path = t, s.body = d.json.serializeWithoutString(r, !0), s;
|
2078
2166
|
});
|
2079
2167
|
}
|
2080
2168
|
//#endregion
|
@@ -2100,14 +2188,16 @@ class Ee {
|
|
2100
2188
|
}
|
2101
2189
|
//#endregion
|
2102
2190
|
//#region 准备
|
2103
|
-
async prepareAsync(i
|
2104
|
-
|
2191
|
+
async prepareAsync(i) {
|
2192
|
+
i.url = d.url.concatUrl(this.baseUrl, i.path), i.prepare();
|
2193
|
+
let e = i.variables;
|
2194
|
+
if (e == null || e.length == 0)
|
2105
2195
|
return;
|
2106
|
-
let t = this.encoder.encode(e), r = d.time.getTimestamp(), s = d.time.formatDateTime(/* @__PURE__ */ new Date()), l = new
|
2196
|
+
let t = this.encoder.encode(e), r = d.time.getTimestamp(), s = d.time.formatDateTime(/* @__PURE__ */ new Date()), l = new cr();
|
2107
2197
|
l.request = i, l.model = e, l.encoded = t, l.timestamp = r, l.time = s, i.path = await this.template.renderAsync(i.path, l), i.body = await this.template.renderAsync(i.body, l);
|
2108
2198
|
}
|
2109
2199
|
}
|
2110
|
-
class
|
2200
|
+
class Me extends tt {
|
2111
2201
|
constructor() {
|
2112
2202
|
super(...arguments);
|
2113
2203
|
//#region 附加信息
|
@@ -2138,18 +2228,17 @@ class Ie extends et {
|
|
2138
2228
|
n(this, "request");
|
2139
2229
|
}
|
2140
2230
|
}
|
2141
|
-
class
|
2231
|
+
class dr extends be {
|
2142
2232
|
constructor() {
|
2143
2233
|
super(...arguments);
|
2144
2234
|
//#region 属性
|
2145
2235
|
n(this, "type", "Default");
|
2146
|
-
n(this, "baseUrl");
|
2147
2236
|
n(this, "_onRequest");
|
2148
2237
|
n(this, "_onResponse");
|
2149
2238
|
//#endregion
|
2150
2239
|
n(this, "sendAsync", async (e) => {
|
2151
2240
|
var r, s;
|
2152
|
-
d.string.isNullOrEmpty(e.url) && (e.url = this.baseUrl + e.path), e.time = /* @__PURE__ */ new Date(), await ((r = this.onRequest) == null ? void 0 : r.call(this, e));
|
2241
|
+
d.string.isNullOrEmpty(e.url) == !0 && (e.url = this.baseUrl + e.path), e.time = /* @__PURE__ */ new Date(), await ((r = this.onRequest) == null ? void 0 : r.call(this, e));
|
2153
2242
|
let t;
|
2154
2243
|
if (typeof XMLHttpRequest > "u" ? t = await this.sendWithFetch(e) : t = await this.sendWithXmlHttpRequest(e), t.time = /* @__PURE__ */ new Date(), t.elapsed = t.time.getTime() - e.time.getTime(), t.length = t.body.length, t.prepare(), t.status != 200) {
|
2155
2244
|
let l = t.message ?? "";
|
@@ -2181,7 +2270,7 @@ class ar extends Ee {
|
|
2181
2270
|
* 使用Fetch发送请求,谷歌插件场景专用
|
2182
2271
|
*/
|
2183
2272
|
async sendWithFetch(e) {
|
2184
|
-
let t = new
|
2273
|
+
let t = new Me();
|
2185
2274
|
t.request = e, t.id = e.id;
|
2186
2275
|
let r = {
|
2187
2276
|
method: e.method,
|
@@ -2200,7 +2289,7 @@ class ar extends Ee {
|
|
2200
2289
|
* 使用XmlHttpRequest发送请求
|
2201
2290
|
*/
|
2202
2291
|
sendWithXmlHttpRequest(e) {
|
2203
|
-
let t = new
|
2292
|
+
let t = new Me();
|
2204
2293
|
return t.request = e, t.id = e.id, new Promise(async (r, s) => {
|
2205
2294
|
let l = new XMLHttpRequest();
|
2206
2295
|
if (l.open(e.method, e.url), e.headers != null)
|
@@ -2213,8 +2302,8 @@ class ar extends Ee {
|
|
2213
2302
|
t.status = l.status, t.body = l.responseText;
|
2214
2303
|
let a = l.getAllResponseHeaders().split(`\r
|
2215
2304
|
`), o = {};
|
2216
|
-
for (let
|
2217
|
-
let p = a[
|
2305
|
+
for (let c = 0; c < a.length; c++) {
|
2306
|
+
let p = a[c].split(": "), h = p.shift();
|
2218
2307
|
h == null || h == "" || (o[h] = p.join(": "));
|
2219
2308
|
}
|
2220
2309
|
t.headers = o, t.contentType = t.getHeader("content-type"), t.ok = l.status == 200, r(t);
|
@@ -2225,15 +2314,11 @@ class ar extends Ee {
|
|
2225
2314
|
});
|
2226
2315
|
}
|
2227
2316
|
}
|
2228
|
-
class
|
2317
|
+
class pr extends be {
|
2229
2318
|
constructor() {
|
2230
2319
|
super(...arguments);
|
2231
2320
|
//#region 属性
|
2232
2321
|
n(this, "type", "Mk");
|
2233
|
-
/**
|
2234
|
-
* 基准地址
|
2235
|
-
*/
|
2236
|
-
n(this, "baseUrl");
|
2237
2322
|
/**
|
2238
2323
|
* AppId
|
2239
2324
|
*/
|
@@ -2252,41 +2337,37 @@ class or extends Ee {
|
|
2252
2337
|
* 危险操作,会暴露敏感信息
|
2253
2338
|
*/
|
2254
2339
|
n(this, "openAsync", async (e) => {
|
2255
|
-
await super.openAsync(e), this.http = await y.http.
|
2340
|
+
await super.openAsync(e), this.http = await y.http.createDefault(), this.hasher = await y.hasher.getSha256Async();
|
2256
2341
|
});
|
2257
2342
|
//#endregion
|
2258
2343
|
/**
|
2259
2344
|
* 危险操作,会暴露敏感信息
|
2260
2345
|
*/
|
2261
|
-
n(this, "prepareAsync", async (e
|
2262
|
-
await super.prepareAsync(e
|
2263
|
-
let
|
2346
|
+
n(this, "prepareAsync", async (e) => {
|
2347
|
+
await super.prepareAsync(e);
|
2348
|
+
let t = d.time.getTimestamp(), r = {
|
2264
2349
|
app_id: this.appId,
|
2265
2350
|
hash_type: "sha256",
|
2266
|
-
timestamp: parseInt((
|
2351
|
+
timestamp: parseInt((t / 1e3).toString())
|
2267
2352
|
};
|
2268
|
-
d.string.isNullOrEmpty(e.body) || (
|
2269
|
-
let
|
2270
|
-
for (let
|
2271
|
-
|
2272
|
-
let
|
2273
|
-
|
2274
|
-
let
|
2275
|
-
|
2276
|
-
let
|
2277
|
-
e.url = d.url.concatUrl(this.baseUrl,
|
2353
|
+
d.string.isNullOrEmpty(e.body) || (r.jsonBody = e.body);
|
2354
|
+
let s = d.url.deserialize(e.path);
|
2355
|
+
for (let h in s)
|
2356
|
+
r[h] = s[h];
|
2357
|
+
let l = d.url.getPath(e.path);
|
2358
|
+
r = d.dictionary.sort(r);
|
2359
|
+
let a = d.sign.signDictionary(r, !1), o = `POST${l}?${a}${this.appSecret}`, c = await this.hasher.computeAsync(o);
|
2360
|
+
r.sign = c.toLowerCase(), delete r.jsonBody, r = d.dictionary.sort(r);
|
2361
|
+
let p = d.url.serialize(r);
|
2362
|
+
e.url = d.url.concatUrl(this.baseUrl, l + "?" + p);
|
2278
2363
|
});
|
2279
2364
|
}
|
2280
2365
|
}
|
2281
|
-
class
|
2366
|
+
class hr extends be {
|
2282
2367
|
constructor() {
|
2283
2368
|
super(...arguments);
|
2284
2369
|
//#region 属性
|
2285
2370
|
n(this, "type", "Halo");
|
2286
|
-
/**
|
2287
|
-
* 基准地址
|
2288
|
-
*/
|
2289
|
-
n(this, "baseUrl", null);
|
2290
2371
|
/**
|
2291
2372
|
* 当前用户信息
|
2292
2373
|
*/
|
@@ -2314,22 +2395,22 @@ class ur extends Ee {
|
|
2314
2395
|
//#endregion
|
2315
2396
|
//#region 开启
|
2316
2397
|
n(this, "openAsync", async (e) => {
|
2317
|
-
await super.openAsync(e), this.http = await y.http.
|
2398
|
+
await super.openAsync(e), this.http = await y.http.createDefault(), this.user != null && (this.sso = y.sso.create(this.user.type)), this.signer = await y.signer.createWithCacheAsync("default");
|
2318
2399
|
});
|
2319
2400
|
//#endregion
|
2320
|
-
n(this, "prepareAsync", async (e
|
2401
|
+
n(this, "prepareAsync", async (e) => {
|
2321
2402
|
if (d.url.httpOrHttps(e.path))
|
2322
2403
|
return;
|
2323
|
-
await super.prepareAsync(e
|
2324
|
-
let
|
2404
|
+
await super.prepareAsync(e), e.url = d.url.concatUrl(this.baseUrl, e.path);
|
2405
|
+
let t;
|
2325
2406
|
if (this.user == null)
|
2326
|
-
|
2407
|
+
t = this.platform;
|
2327
2408
|
else {
|
2328
|
-
let
|
2329
|
-
|
2409
|
+
let s = d.time.getTimestamp(), l = await this.signer.getSign(this.user.userId, e.url, e.body, s, this.user.secret);
|
2410
|
+
t = this.sso.getAuth(this.user.identity.token, s, l, this.platform, this.env);
|
2330
2411
|
}
|
2331
|
-
let
|
2332
|
-
|
2412
|
+
let r = {};
|
2413
|
+
r.Authorization = t, e.getHeader("Accept-Language") || (r["Accept-Language"] = this.language), e.addHeaders(r);
|
2333
2414
|
});
|
2334
2415
|
/**
|
2335
2416
|
* 处理网络错误和响应错误场景
|
@@ -2337,30 +2418,92 @@ class ur extends Ee {
|
|
2337
2418
|
n(this, "handleError", (e) => {
|
2338
2419
|
if (e instanceof Object) {
|
2339
2420
|
let t = e.message;
|
2340
|
-
e.message == "Network Error" && (d.url.httpOrHttps(e.config.url) ? t = "接口网络错误: " + e.config.url : t = "接口网络错误: " + e.config.baseURL + e.config.url),
|
2421
|
+
e.message == "Network Error" && (d.url.httpOrHttps(e.config.url) ? t = "接口网络错误: " + e.config.url : t = "接口网络错误: " + e.config.baseURL + e.config.url), le.error(t);
|
2341
2422
|
} else
|
2342
|
-
|
2423
|
+
le.error(e.message);
|
2343
2424
|
return Promise.reject(e);
|
2344
2425
|
});
|
2345
2426
|
}
|
2346
2427
|
}
|
2347
|
-
class
|
2428
|
+
class gr extends be {
|
2429
|
+
constructor() {
|
2430
|
+
super(...arguments);
|
2431
|
+
//#region 属性
|
2432
|
+
/**
|
2433
|
+
* Token密钥
|
2434
|
+
*/
|
2435
|
+
n(this, "aesKey");
|
2436
|
+
/**
|
2437
|
+
* 盐
|
2438
|
+
*/
|
2439
|
+
n(this, "salt");
|
2440
|
+
/**
|
2441
|
+
* 加解密器
|
2442
|
+
*/
|
2443
|
+
n(this, "encryptor");
|
2444
|
+
/**
|
2445
|
+
* Hash计算器
|
2446
|
+
*/
|
2447
|
+
n(this, "hasher");
|
2448
|
+
}
|
2449
|
+
//#endregion
|
2450
|
+
async openAsync(e) {
|
2451
|
+
await super.openAsync(e), this.http = await y.http.createDefault(), this.hasher = await y.hasher.getSha256Async(), this.encryptor = await y.encryptor.getAesAsync();
|
2452
|
+
}
|
2453
|
+
async prepareAsync(e) {
|
2454
|
+
await super.prepareAsync(e);
|
2455
|
+
let t = e.variables, r;
|
2456
|
+
t != null && t.length != 0 && (r = t[0]);
|
2457
|
+
let s = await this.getHeader(e.url, e.body, r);
|
2458
|
+
e.addHeaders(s);
|
2459
|
+
}
|
2460
|
+
/**
|
2461
|
+
* 获取请求头
|
2462
|
+
*/
|
2463
|
+
async getHeader(e, t, r) {
|
2464
|
+
let s = d.url.deserializeSorted(e), l = [];
|
2465
|
+
if (s != null) {
|
2466
|
+
let M = Object.keys(s);
|
2467
|
+
for (let K of M) {
|
2468
|
+
let J = s[K];
|
2469
|
+
d.string.isNullOrEmpty(J) || l.push(`${K}=${J}`);
|
2470
|
+
}
|
2471
|
+
}
|
2472
|
+
d.string.isNullOrEmpty(t) == !1 && l.push(`bodyJsonString=${t}`);
|
2473
|
+
let a = d.time.getTimestamp().toString(), o = l.join("&") + a + this.salt, p = (await this.hasher.computeAsync(o)).toLowerCase(), h = d.time.getTime(), g = d.time.format(h, "YYYY-MM-DD HH:mm:ss.SSS"), m = {
|
2474
|
+
Id: r,
|
2475
|
+
WorkerUserId: r,
|
2476
|
+
Timestamp: g
|
2477
|
+
//'2024-10-21 19:07:23.234'
|
2478
|
+
}, k = this.encryptor.encrypt(m, this.aesKey);
|
2479
|
+
return {
|
2480
|
+
//VI用
|
2481
|
+
"nio-data-sign": p,
|
2482
|
+
//EI用:时间戳验签
|
2483
|
+
"nio-data-timespan": a,
|
2484
|
+
//EI用:赋值请求令牌和客户端,以支持在请求日志中记录请求的实际地址和Token
|
2485
|
+
Token: k
|
2486
|
+
};
|
2487
|
+
}
|
2488
|
+
}
|
2489
|
+
class fr extends D {
|
2348
2490
|
constructor() {
|
2349
2491
|
super(...arguments);
|
2350
2492
|
n(this, "type", "Http");
|
2351
2493
|
}
|
2352
2494
|
open() {
|
2353
2495
|
super.open(), super.register({
|
2354
|
-
Default:
|
2355
|
-
|
2356
|
-
Halo:
|
2496
|
+
Default: dr,
|
2497
|
+
Ei: gr,
|
2498
|
+
Halo: hr,
|
2499
|
+
Mk: pr
|
2357
2500
|
});
|
2358
2501
|
}
|
2359
2502
|
/**
|
2360
|
-
*
|
2503
|
+
* 创建默认请求器
|
2361
2504
|
*/
|
2362
|
-
async
|
2363
|
-
return this.
|
2505
|
+
async createDefault() {
|
2506
|
+
return this.create("Default");
|
2364
2507
|
}
|
2365
2508
|
/**
|
2366
2509
|
* 获取本地请求实例
|
@@ -2370,293 +2513,63 @@ class cr extends D {
|
|
2370
2513
|
return this.createWithCache("Halo");
|
2371
2514
|
}
|
2372
2515
|
}
|
2373
|
-
class
|
2516
|
+
class yr {
|
2374
2517
|
constructor() {
|
2375
2518
|
//#region 属性
|
2519
|
+
/**
|
2520
|
+
* 类型
|
2521
|
+
*/
|
2376
2522
|
n(this, "type");
|
2377
|
-
n(this, "lang");
|
2378
|
-
n(this, "messages", {});
|
2379
2523
|
/**
|
2380
|
-
*
|
2524
|
+
* 是否已连接(空表示不需连接)
|
2381
2525
|
*/
|
2382
|
-
n(this, "
|
2383
|
-
//#endregion
|
2384
|
-
//#region 翻译
|
2385
|
-
n(this, "t", (i, e) => {
|
2386
|
-
if (!i)
|
2387
|
-
return null;
|
2388
|
-
if (!this.t_exists(i)) {
|
2389
|
-
let t = i.split(".");
|
2390
|
-
return d.array.getLast(t, 2).join(".");
|
2391
|
-
}
|
2392
|
-
return typeof e == "string" ? this.translate(i, [e]) : this.translate(i, e);
|
2393
|
-
});
|
2394
|
-
n(this, "t_menu", (i) => {
|
2395
|
-
let t = `_business.Sys_Menu.Title.${i}`;
|
2396
|
-
return this.t(t);
|
2397
|
-
});
|
2398
|
-
n(this, "t_module", (i, e) => {
|
2399
|
-
if (!i && !e)
|
2400
|
-
return null;
|
2401
|
-
let t = i.toLowerCase(), r = "_business.Ctl_Module.Title", s = i ? this.t(`common.${t}`) : "", l = this.t(`${r}.${e}`);
|
2402
|
-
return t == "list" || t == "paging" || t == "detail" ? l + " " + s : s + " " + l;
|
2403
|
-
});
|
2404
|
-
n(this, "t_table", (i) => this.t(`_business.Ctl_Table.Title.${i}`));
|
2405
|
-
n(this, "t_field", (i, e) => {
|
2406
|
-
let r = `_business.Ctl_Field.Label.${i}.${e}`;
|
2407
|
-
return this.t(r);
|
2408
|
-
});
|
2409
|
-
n(this, "t_enum", (i, e) => this.t(`_business.Ctl_Option.Text.${i}.${e}`));
|
2410
|
-
n(this, "t_field_placeholder", (i, e) => this.t("common.please_input") + this.t(`_business.Ctl_Field.Label.${i}.${e}`));
|
2411
|
-
n(this, "t_field_choose_placeholder", (i, e) => this.t("common.please_choose") + this.t(`_business.Ctl_Field.Label.${i}.${e}`));
|
2412
|
-
n(this, "t_sys", (i) => this.t(`sys.${i}`));
|
2413
|
-
n(this, "t_title", () => this.t("sys.title"));
|
2414
|
-
//#endregion
|
2415
|
-
//#region 设置标题
|
2526
|
+
n(this, "connected");
|
2416
2527
|
/**
|
2417
|
-
*
|
2528
|
+
* Socket消息处理程序
|
2418
2529
|
*/
|
2419
|
-
n(this, "
|
2420
|
-
let e = this.t(i);
|
2421
|
-
this.setTitle(e);
|
2422
|
-
});
|
2530
|
+
n(this, "handler");
|
2423
2531
|
/**
|
2424
|
-
*
|
2532
|
+
* 已订阅的消息类型列表
|
2425
2533
|
*/
|
2426
|
-
n(this, "
|
2427
|
-
let t = this.t_title(), r;
|
2428
|
-
t ? i ? e ? r = `${i}(${e}) - ${t}` : r = `${i} - ${t}` : r = t : e ? r = `${i}(${e})` : r = i, document.title = r;
|
2429
|
-
});
|
2430
|
-
//#endregion
|
2431
|
-
//#region 加载
|
2432
|
-
n(this, "addMessages", (i) => {
|
2433
|
-
if (i == null)
|
2434
|
-
return;
|
2435
|
-
let e = Object.keys(i);
|
2436
|
-
for (let t of e)
|
2437
|
-
this.messages[t] = i[t];
|
2438
|
-
this.setTitle(this.t("common.loading") + "...");
|
2439
|
-
});
|
2440
|
-
n(this, "switch", async (i) => {
|
2441
|
-
if (this.loaded.includes(i)) {
|
2442
|
-
this.lang = i;
|
2443
|
-
return;
|
2444
|
-
}
|
2445
|
-
await this.loadAsync(i), this.lang = i, this.loaded.push(i);
|
2446
|
-
});
|
2534
|
+
n(this, "subscribed", {});
|
2447
2535
|
}
|
2448
2536
|
//#endregion
|
2449
2537
|
//#region 开启
|
2450
|
-
|
2451
|
-
d.json.mergeTo(this, i);
|
2538
|
+
openAsync(i) {
|
2539
|
+
return d.json.mergeTo(this, i), Promise.resolve();
|
2452
2540
|
}
|
2453
2541
|
//#endregion
|
2542
|
+
//#region 订阅
|
2543
|
+
async subscribe(i, e, t) {
|
2544
|
+
let r = d.string.getArray(t), s = { kind: "socket", type: "subscribe", data: { win: i, kind: e, types: r } };
|
2545
|
+
await this.send(s);
|
2546
|
+
let l = this.subscribed[i];
|
2547
|
+
l == null && (l = {}, this.subscribed[i] = l);
|
2548
|
+
let a = l[e];
|
2549
|
+
a == null && (a = [], l[e] = a), a.push(...r);
|
2550
|
+
}
|
2551
|
+
async resubscribe() {
|
2552
|
+
let i = Object.keys(this.subscribed);
|
2553
|
+
if (i.length != 0)
|
2554
|
+
for (let e of i) {
|
2555
|
+
let t = this.subscribed[e], r = Object.keys(t);
|
2556
|
+
for (let s of r) {
|
2557
|
+
let l = t[s], a = { kind: "socket", type: "subscribe", data: { win: e, kind: s, types: l } };
|
2558
|
+
await this.send(a);
|
2559
|
+
}
|
2560
|
+
}
|
2561
|
+
}
|
2562
|
+
async unsubscribe(i) {
|
2563
|
+
let e = { kind: "socket", type: "unsubscribe", data: { win: i } };
|
2564
|
+
await this.send(e), delete this.subscribed[i];
|
2565
|
+
}
|
2566
|
+
dispose() {
|
2567
|
+
}
|
2454
2568
|
}
|
2455
|
-
class
|
2569
|
+
class mr extends yr {
|
2456
2570
|
constructor() {
|
2457
2571
|
super(...arguments);
|
2458
|
-
|
2459
|
-
//#endregion
|
2460
|
-
n(this, "translate", (e, t) => {
|
2461
|
-
let r = this.messages[this.lang], s = e.split("."), l = d.json.getValue(r, s);
|
2462
|
-
return t == null ? l : d.string.format(l, t);
|
2463
|
-
});
|
2464
|
-
n(this, "t_exists", (e) => {
|
2465
|
-
if (!e)
|
2466
|
-
return null;
|
2467
|
-
let t = this.messages[this.lang], r = e.split(".");
|
2468
|
-
return d.json.hasKey(t, r);
|
2469
|
-
});
|
2470
|
-
n(this, "loadAsync", async (e) => {
|
2471
|
-
e == null && (e = this.lang);
|
2472
|
-
let t = new Promise(async (s) => {
|
2473
|
-
let l = { conditions: [{ name: "lang", value: e }] };
|
2474
|
-
return _.post("/i18n/set", l).then(({ data: a }) => {
|
2475
|
-
for (let o of a) {
|
2476
|
-
let u = `${e}.${o.Kind}.${o.Key}`.split(".");
|
2477
|
-
d.object.addProperties(this.messages, u, o.Value);
|
2478
|
-
}
|
2479
|
-
s(a);
|
2480
|
-
});
|
2481
|
-
}), r = new Promise((s) => {
|
2482
|
-
let l = { conditions: [{ name: "lang", value: e }] };
|
2483
|
-
_.post("/i18n_business/set", l).then(({ data: a }) => {
|
2484
|
-
for (let o of a) {
|
2485
|
-
let u = `${e}._business.${o.Table}.${o.Field}.${o.Key}`.split(".");
|
2486
|
-
d.object.addProperties(this.messages, u, o.Value);
|
2487
|
-
}
|
2488
|
-
s(a);
|
2489
|
-
});
|
2490
|
-
});
|
2491
|
-
await Promise.all([t, r]);
|
2492
|
-
});
|
2493
|
-
}
|
2494
|
-
//#region 开启
|
2495
|
-
async openAsync(e) {
|
2496
|
-
await super.openAsync(e);
|
2497
|
-
}
|
2498
|
-
}
|
2499
|
-
class hr extends D {
|
2500
|
-
constructor() {
|
2501
|
-
super(...arguments);
|
2502
|
-
n(this, "type", "I18n");
|
2503
|
-
}
|
2504
|
-
//#region 开启
|
2505
|
-
open() {
|
2506
|
-
super.open(), super.register({
|
2507
|
-
Default: pr
|
2508
|
-
});
|
2509
|
-
}
|
2510
|
-
//#endregion
|
2511
|
-
}
|
2512
|
-
class gr {
|
2513
|
-
constructor() {
|
2514
|
-
n(this, "type");
|
2515
|
-
}
|
2516
|
-
}
|
2517
|
-
class fr extends gr {
|
2518
|
-
constructor() {
|
2519
|
-
super(...arguments);
|
2520
|
-
n(this, "type", "Console");
|
2521
|
-
}
|
2522
|
-
alert(e, t, r) {
|
2523
|
-
alert(e);
|
2524
|
-
}
|
2525
|
-
async confirm(e, t, r) {
|
2526
|
-
confirm(t);
|
2527
|
-
}
|
2528
|
-
error(e) {
|
2529
|
-
console.error(e);
|
2530
|
-
}
|
2531
|
-
info(e) {
|
2532
|
-
console.info(e);
|
2533
|
-
}
|
2534
|
-
notify(e, t, r) {
|
2535
|
-
console.dir(t);
|
2536
|
-
}
|
2537
|
-
success(e) {
|
2538
|
-
console.log(e);
|
2539
|
-
}
|
2540
|
-
warning(e) {
|
2541
|
-
console.warn(e);
|
2542
|
-
}
|
2543
|
-
}
|
2544
|
-
class yr extends D {
|
2545
|
-
constructor() {
|
2546
|
-
super(...arguments);
|
2547
|
-
n(this, "type", "Messenger");
|
2548
|
-
}
|
2549
|
-
open() {
|
2550
|
-
super.open(), super.register({
|
2551
|
-
Console: fr
|
2552
|
-
});
|
2553
|
-
}
|
2554
|
-
/**
|
2555
|
-
* 获取控制台消息提示类型
|
2556
|
-
*/
|
2557
|
-
async getConsole() {
|
2558
|
-
return await super.create("Console");
|
2559
|
-
}
|
2560
|
-
}
|
2561
|
-
class mr {
|
2562
|
-
constructor() {
|
2563
|
-
n(this, "type");
|
2564
|
-
}
|
2565
|
-
}
|
2566
|
-
class vr extends mr {
|
2567
|
-
constructor() {
|
2568
|
-
super(...arguments);
|
2569
|
-
n(this, "type", "Default");
|
2570
|
-
n(this, "getSign", async (e, t, r, s, l) => {
|
2571
|
-
let o = `${e}.${t}.${r ?? ""}.${s}.${l}`;
|
2572
|
-
return (await it.compute(o)).toUpperCase();
|
2573
|
-
});
|
2574
|
-
}
|
2575
|
-
async openAsync(e) {
|
2576
|
-
}
|
2577
|
-
callback(e) {
|
2578
|
-
}
|
2579
|
-
loginUrl(e) {
|
2580
|
-
return "";
|
2581
|
-
}
|
2582
|
-
dispose() {
|
2583
|
-
}
|
2584
|
-
}
|
2585
|
-
class br extends D {
|
2586
|
-
constructor() {
|
2587
|
-
super(...arguments);
|
2588
|
-
n(this, "type", "Signer");
|
2589
|
-
}
|
2590
|
-
open() {
|
2591
|
-
super.open(), super.register({
|
2592
|
-
Default: vr
|
2593
|
-
});
|
2594
|
-
}
|
2595
|
-
/**
|
2596
|
-
* 获取指定签名实例
|
2597
|
-
*/
|
2598
|
-
async createAsync(e, t) {
|
2599
|
-
let r = await super.createAsync(e);
|
2600
|
-
return await r.openAsync(null), r;
|
2601
|
-
}
|
2602
|
-
}
|
2603
|
-
class wr {
|
2604
|
-
constructor() {
|
2605
|
-
//#region 属性
|
2606
|
-
/**
|
2607
|
-
* 类型
|
2608
|
-
*/
|
2609
|
-
n(this, "type");
|
2610
|
-
/**
|
2611
|
-
* 是否已连接(空表示不需连接)
|
2612
|
-
*/
|
2613
|
-
n(this, "connected");
|
2614
|
-
/**
|
2615
|
-
* Socket消息处理程序
|
2616
|
-
*/
|
2617
|
-
n(this, "handler");
|
2618
|
-
/**
|
2619
|
-
* 已订阅的消息类型列表
|
2620
|
-
*/
|
2621
|
-
n(this, "subscribed", {});
|
2622
|
-
}
|
2623
|
-
//#endregion
|
2624
|
-
//#region 开启
|
2625
|
-
openAsync(i) {
|
2626
|
-
return d.json.mergeTo(this, i), Promise.resolve();
|
2627
|
-
}
|
2628
|
-
//#endregion
|
2629
|
-
//#region 订阅
|
2630
|
-
async subscribe(i, e, t) {
|
2631
|
-
let r = d.string.getArray(t), s = { kind: "socket", type: "subscribe", data: { win: i, kind: e, types: r } };
|
2632
|
-
await this.send(s);
|
2633
|
-
let l = this.subscribed[i];
|
2634
|
-
l == null && (l = {}, this.subscribed[i] = l);
|
2635
|
-
let a = l[e];
|
2636
|
-
a == null && (a = [], l[e] = a), a.push(...r);
|
2637
|
-
}
|
2638
|
-
async resubscribe() {
|
2639
|
-
let i = Object.keys(this.subscribed);
|
2640
|
-
if (i.length != 0)
|
2641
|
-
for (let e of i) {
|
2642
|
-
let t = this.subscribed[e], r = Object.keys(t);
|
2643
|
-
for (let s of r) {
|
2644
|
-
let l = t[s], a = { kind: "socket", type: "subscribe", data: { win: e, kind: s, types: l } };
|
2645
|
-
await this.send(a);
|
2646
|
-
}
|
2647
|
-
}
|
2648
|
-
}
|
2649
|
-
async unsubscribe(i) {
|
2650
|
-
let e = { kind: "socket", type: "unsubscribe", data: { win: i } };
|
2651
|
-
await this.send(e), delete this.subscribed[i];
|
2652
|
-
}
|
2653
|
-
dispose() {
|
2654
|
-
}
|
2655
|
-
}
|
2656
|
-
class kr extends wr {
|
2657
|
-
constructor() {
|
2658
|
-
super(...arguments);
|
2659
|
-
//#region 属性
|
2572
|
+
//#region 属性
|
2660
2573
|
n(this, "type", "Default");
|
2661
2574
|
/**
|
2662
2575
|
* 通信地址
|
@@ -2682,7 +2595,7 @@ class kr extends wr {
|
|
2682
2595
|
//#endregion
|
2683
2596
|
async connect() {
|
2684
2597
|
if (this.reconnect = !0, this.socket == null || this.reconnect) {
|
2685
|
-
let t = new
|
2598
|
+
let t = new rt();
|
2686
2599
|
t.path = this.url, t.method = "GET", await _.prepareAsync(t);
|
2687
2600
|
let r = t.getHeader("Authorization"), s = d.url.encode(r), l = `${this.url}?authorization=${s}`;
|
2688
2601
|
this.socket = new WebSocket(l);
|
@@ -2712,106 +2625,345 @@ class kr extends wr {
|
|
2712
2625
|
this.socket.close(), this.reconnect = !1, this.connected = null, this.handler = null;
|
2713
2626
|
}
|
2714
2627
|
}
|
2628
|
+
class vr extends D {
|
2629
|
+
constructor() {
|
2630
|
+
super(...arguments);
|
2631
|
+
n(this, "type", "Socket");
|
2632
|
+
}
|
2633
|
+
open() {
|
2634
|
+
super.open(), super.register({
|
2635
|
+
Default: mr
|
2636
|
+
});
|
2637
|
+
}
|
2638
|
+
/**
|
2639
|
+
* 默认通信对象
|
2640
|
+
*/
|
2641
|
+
get default() {
|
2642
|
+
return super.createWithCache("Default");
|
2643
|
+
}
|
2644
|
+
}
|
2645
|
+
class br {
|
2646
|
+
/**
|
2647
|
+
* 初始化
|
2648
|
+
*/
|
2649
|
+
constructor(i) {
|
2650
|
+
//#region 进度
|
2651
|
+
/**
|
2652
|
+
* 成功数量
|
2653
|
+
*/
|
2654
|
+
n(this, "succeed", 0);
|
2655
|
+
/**
|
2656
|
+
* 异常数量
|
2657
|
+
*/
|
2658
|
+
n(this, "errored", 0);
|
2659
|
+
/**
|
2660
|
+
* 已处理数量
|
2661
|
+
*/
|
2662
|
+
n(this, "handled", 0);
|
2663
|
+
/**
|
2664
|
+
* 总数量
|
2665
|
+
*/
|
2666
|
+
n(this, "total", 0);
|
2667
|
+
//#endregion
|
2668
|
+
/**
|
2669
|
+
* 当前消息体
|
2670
|
+
*/
|
2671
|
+
n(this, "current");
|
2672
|
+
this.total = i;
|
2673
|
+
}
|
2674
|
+
/**
|
2675
|
+
* 增加成功进度
|
2676
|
+
*/
|
2677
|
+
success(i) {
|
2678
|
+
this.succeed++, this.handled++, this.current = i;
|
2679
|
+
}
|
2680
|
+
/**
|
2681
|
+
* 增加异常进度
|
2682
|
+
*/
|
2683
|
+
error(i) {
|
2684
|
+
this.errored++, this.handled++, this.current = i;
|
2685
|
+
}
|
2686
|
+
}
|
2687
|
+
class $l {
|
2688
|
+
/**
|
2689
|
+
* 初始化并设置数据
|
2690
|
+
*/
|
2691
|
+
constructor(i, e, t) {
|
2692
|
+
/**
|
2693
|
+
* 是否执行成功
|
2694
|
+
*/
|
2695
|
+
n(this, "ok");
|
2696
|
+
/**
|
2697
|
+
* 异常消息
|
2698
|
+
*/
|
2699
|
+
n(this, "message");
|
2700
|
+
/**
|
2701
|
+
* 耗时
|
2702
|
+
*/
|
2703
|
+
n(this, "elapsed");
|
2704
|
+
/**
|
2705
|
+
* 消息类别
|
2706
|
+
*/
|
2707
|
+
n(this, "kind");
|
2708
|
+
/**
|
2709
|
+
* 消息类型
|
2710
|
+
*/
|
2711
|
+
n(this, "type");
|
2712
|
+
/**
|
2713
|
+
* 数据体
|
2714
|
+
*/
|
2715
|
+
n(this, "data");
|
2716
|
+
this.kind = i, this.type = e, this.data = t;
|
2717
|
+
}
|
2718
|
+
/**
|
2719
|
+
* 成功输出
|
2720
|
+
*/
|
2721
|
+
onOk(i) {
|
2722
|
+
this.ok = !0, this.message = i;
|
2723
|
+
}
|
2724
|
+
/**
|
2725
|
+
* 异常输出
|
2726
|
+
*/
|
2727
|
+
onError(i) {
|
2728
|
+
this.ok = !1, this.message = i;
|
2729
|
+
}
|
2730
|
+
}
|
2731
|
+
class Dl extends br {
|
2732
|
+
constructor(i) {
|
2733
|
+
super(i);
|
2734
|
+
}
|
2735
|
+
}
|
2736
|
+
class wr {
|
2737
|
+
constructor() {
|
2738
|
+
//#region 属性
|
2739
|
+
n(this, "type");
|
2740
|
+
n(this, "lang");
|
2741
|
+
n(this, "messages", {});
|
2742
|
+
/**
|
2743
|
+
* 已加载的语言集合
|
2744
|
+
*/
|
2745
|
+
n(this, "loaded", []);
|
2746
|
+
//#endregion
|
2747
|
+
//#region 翻译
|
2748
|
+
n(this, "t", (i, e) => {
|
2749
|
+
if (!i)
|
2750
|
+
return null;
|
2751
|
+
if (!this.t_exists(i)) {
|
2752
|
+
let t = i.split(".");
|
2753
|
+
return d.array.getLast(t, 2).join(".");
|
2754
|
+
}
|
2755
|
+
return typeof e == "string" ? this.translate(i, [e]) : this.translate(i, e);
|
2756
|
+
});
|
2757
|
+
n(this, "t_menu", (i) => {
|
2758
|
+
let t = `_business.Sys_Menu.Title.${i}`;
|
2759
|
+
return this.t(t);
|
2760
|
+
});
|
2761
|
+
n(this, "t_module", (i, e) => {
|
2762
|
+
if (!i && !e)
|
2763
|
+
return null;
|
2764
|
+
let t = i.toLowerCase(), r = "_business.Ctl_Module.Title", s = i ? this.t(`common.${t}`) : "", l = this.t(`${r}.${e}`);
|
2765
|
+
return t == "list" || t == "paging" || t == "detail" ? l + " " + s : s + " " + l;
|
2766
|
+
});
|
2767
|
+
n(this, "t_table", (i) => this.t(`_business.Ctl_Table.Title.${i}`));
|
2768
|
+
n(this, "t_field", (i, e) => {
|
2769
|
+
let r = `_business.Ctl_Table_Field.Label.${i}.${e}`;
|
2770
|
+
return this.t(r);
|
2771
|
+
});
|
2772
|
+
n(this, "t_enum", (i, e) => this.t(`_business.Ctl_Enum_Option.Text.${i}.${e}`));
|
2773
|
+
n(this, "t_field_placeholder", (i, e) => this.t("common.please_input") + this.t(`_business.Ctl_Table_Field.Label.${i}.${e}`));
|
2774
|
+
n(this, "t_field_choose_placeholder", (i, e) => this.t("common.please_choose") + this.t(`_business.Ctl_Table_Field.Label.${i}.${e}`));
|
2775
|
+
n(this, "t_sys", (i) => this.t(`sys.${i}`));
|
2776
|
+
n(this, "t_title", () => this.t("sys.title"));
|
2777
|
+
//#endregion
|
2778
|
+
//#region 设置标题
|
2779
|
+
/**
|
2780
|
+
* 根据key设置多语言标题
|
2781
|
+
*/
|
2782
|
+
n(this, "setI18nTitle", (i) => {
|
2783
|
+
let e = this.t(i);
|
2784
|
+
this.setTitle(e);
|
2785
|
+
});
|
2786
|
+
/**
|
2787
|
+
* 设置标题
|
2788
|
+
*/
|
2789
|
+
n(this, "setTitle", (i = null, e = null) => {
|
2790
|
+
let t = this.t_title(), r;
|
2791
|
+
t ? i ? e ? r = `${i}(${e}) - ${t}` : r = `${i} - ${t}` : r = t : e ? r = `${i}(${e})` : r = i, document.title = r;
|
2792
|
+
});
|
2793
|
+
//#endregion
|
2794
|
+
//#region 加载
|
2795
|
+
n(this, "addMessages", (i) => {
|
2796
|
+
if (i == null)
|
2797
|
+
return;
|
2798
|
+
let e = Object.keys(i);
|
2799
|
+
for (let t of e)
|
2800
|
+
this.messages[t] = i[t];
|
2801
|
+
this.setTitle(this.t("common.loading") + "...");
|
2802
|
+
});
|
2803
|
+
n(this, "switch", async (i) => {
|
2804
|
+
if (this.loaded.includes(i)) {
|
2805
|
+
this.lang = i;
|
2806
|
+
return;
|
2807
|
+
}
|
2808
|
+
await this.loadAsync(i), this.lang = i, this.loaded.push(i);
|
2809
|
+
});
|
2810
|
+
}
|
2811
|
+
//#endregion
|
2812
|
+
//#region 开启
|
2813
|
+
async openAsync(i) {
|
2814
|
+
d.json.mergeTo(this, i);
|
2815
|
+
}
|
2816
|
+
//#endregion
|
2817
|
+
}
|
2818
|
+
class kr extends wr {
|
2819
|
+
constructor() {
|
2820
|
+
super(...arguments);
|
2821
|
+
n(this, "type", "Default");
|
2822
|
+
//#endregion
|
2823
|
+
n(this, "translate", (e, t) => {
|
2824
|
+
let r = this.messages[this.lang], s = e.split("."), l = d.json.getValue(r, s);
|
2825
|
+
return t == null ? l : d.string.format(l, t);
|
2826
|
+
});
|
2827
|
+
n(this, "t_exists", (e) => {
|
2828
|
+
if (!e)
|
2829
|
+
return null;
|
2830
|
+
let t = this.messages[this.lang], r = e.split(".");
|
2831
|
+
return d.json.hasKey(t, r);
|
2832
|
+
});
|
2833
|
+
n(this, "loadAsync", async (e) => {
|
2834
|
+
e == null && (e = this.lang);
|
2835
|
+
let t = new Promise(async (s) => {
|
2836
|
+
let l = { conditions: [{ name: "lang", value: e }] };
|
2837
|
+
return _.post("/i18n/set", l).then(({ data: a }) => {
|
2838
|
+
for (let o of a) {
|
2839
|
+
let c = `${e}.${o.Kind}.${o.Key}`.split(".");
|
2840
|
+
d.object.addProperties(this.messages, c, o.Value);
|
2841
|
+
}
|
2842
|
+
s(a);
|
2843
|
+
});
|
2844
|
+
}), r = new Promise((s) => {
|
2845
|
+
let l = { conditions: [{ name: "lang", value: e }] };
|
2846
|
+
_.post("/i18n_business/set", l).then(({ data: a }) => {
|
2847
|
+
for (let o of a) {
|
2848
|
+
let c = `${e}._business.${o.Table}.${o.Field}.${o.Key}`.split(".");
|
2849
|
+
d.object.addProperties(this.messages, c, o.Value);
|
2850
|
+
}
|
2851
|
+
s(a);
|
2852
|
+
});
|
2853
|
+
});
|
2854
|
+
await Promise.all([t, r]);
|
2855
|
+
});
|
2856
|
+
}
|
2857
|
+
//#region 开启
|
2858
|
+
async openAsync(e) {
|
2859
|
+
await super.openAsync(e);
|
2860
|
+
}
|
2861
|
+
}
|
2715
2862
|
class xr extends D {
|
2716
2863
|
constructor() {
|
2717
2864
|
super(...arguments);
|
2718
|
-
n(this, "type", "
|
2865
|
+
n(this, "type", "I18n");
|
2719
2866
|
}
|
2867
|
+
//#region 开启
|
2720
2868
|
open() {
|
2721
2869
|
super.open(), super.register({
|
2722
2870
|
Default: kr
|
2723
2871
|
});
|
2724
2872
|
}
|
2725
|
-
|
2726
|
-
|
2727
|
-
|
2728
|
-
|
2729
|
-
|
2873
|
+
//#endregion
|
2874
|
+
}
|
2875
|
+
class Ar {
|
2876
|
+
constructor() {
|
2877
|
+
n(this, "type");
|
2730
2878
|
}
|
2731
2879
|
}
|
2732
|
-
class
|
2880
|
+
class Sr extends Ar {
|
2733
2881
|
constructor() {
|
2734
|
-
|
2735
|
-
|
2736
|
-
* 成功数量
|
2737
|
-
*/
|
2738
|
-
n(this, "succeed", 0);
|
2739
|
-
/**
|
2740
|
-
* 异常数量
|
2741
|
-
*/
|
2742
|
-
n(this, "errored", 0);
|
2743
|
-
/**
|
2744
|
-
* 已处理数量
|
2745
|
-
*/
|
2746
|
-
n(this, "handled", 0);
|
2747
|
-
/**
|
2748
|
-
* 总数量
|
2749
|
-
*/
|
2750
|
-
n(this, "total", 0);
|
2751
|
-
//#endregion
|
2752
|
-
/**
|
2753
|
-
* 当前消息体
|
2754
|
-
*/
|
2755
|
-
n(this, "current");
|
2882
|
+
super(...arguments);
|
2883
|
+
n(this, "type", "Console");
|
2756
2884
|
}
|
2757
|
-
|
2758
|
-
|
2759
|
-
*/
|
2760
|
-
success(i) {
|
2761
|
-
this.succeed++, this.handled++, this.current = i;
|
2885
|
+
alert(e, t, r) {
|
2886
|
+
alert(e);
|
2762
2887
|
}
|
2763
|
-
|
2764
|
-
|
2765
|
-
|
2766
|
-
error(
|
2767
|
-
|
2888
|
+
async confirm(e, t, r) {
|
2889
|
+
confirm(t);
|
2890
|
+
}
|
2891
|
+
error(e) {
|
2892
|
+
console.error(e);
|
2893
|
+
}
|
2894
|
+
info(e) {
|
2895
|
+
console.info(e);
|
2896
|
+
}
|
2897
|
+
notify(e, t, r) {
|
2898
|
+
console.dir(t);
|
2899
|
+
}
|
2900
|
+
success(e) {
|
2901
|
+
console.log(e);
|
2902
|
+
}
|
2903
|
+
warning(e) {
|
2904
|
+
console.warn(e);
|
2768
2905
|
}
|
2769
2906
|
}
|
2770
|
-
class
|
2907
|
+
class _r extends D {
|
2908
|
+
constructor() {
|
2909
|
+
super(...arguments);
|
2910
|
+
n(this, "type", "Messenger");
|
2911
|
+
}
|
2912
|
+
open() {
|
2913
|
+
super.open(), super.register({
|
2914
|
+
Console: Sr
|
2915
|
+
});
|
2916
|
+
}
|
2771
2917
|
/**
|
2772
|
-
*
|
2918
|
+
* 获取控制台消息提示类型
|
2773
2919
|
*/
|
2774
|
-
|
2775
|
-
|
2776
|
-
|
2777
|
-
|
2778
|
-
|
2779
|
-
|
2780
|
-
* 异常消息
|
2781
|
-
*/
|
2782
|
-
n(this, "message");
|
2783
|
-
/**
|
2784
|
-
* 耗时
|
2785
|
-
*/
|
2786
|
-
n(this, "elapsed");
|
2787
|
-
/**
|
2788
|
-
* 消息类别
|
2789
|
-
*/
|
2790
|
-
n(this, "kind");
|
2791
|
-
/**
|
2792
|
-
* 消息类型
|
2793
|
-
*/
|
2920
|
+
async getConsole() {
|
2921
|
+
return await super.create("Console");
|
2922
|
+
}
|
2923
|
+
}
|
2924
|
+
class Cr {
|
2925
|
+
constructor() {
|
2794
2926
|
n(this, "type");
|
2795
|
-
/**
|
2796
|
-
* 数据体
|
2797
|
-
*/
|
2798
|
-
n(this, "data");
|
2799
|
-
this.kind = i, this.type = e, this.data = t;
|
2800
2927
|
}
|
2801
|
-
|
2802
|
-
|
2803
|
-
|
2804
|
-
|
2805
|
-
this
|
2928
|
+
}
|
2929
|
+
class Tr extends Cr {
|
2930
|
+
constructor() {
|
2931
|
+
super(...arguments);
|
2932
|
+
n(this, "type", "Default");
|
2933
|
+
n(this, "getSign", async (e, t, r, s, l) => {
|
2934
|
+
let o = `${e}.${t}.${r ?? ""}.${s}.${l}`;
|
2935
|
+
return (await at.computeAsync(o)).toUpperCase();
|
2936
|
+
});
|
2937
|
+
}
|
2938
|
+
async openAsync(e) {
|
2939
|
+
}
|
2940
|
+
callback(e) {
|
2941
|
+
}
|
2942
|
+
loginUrl(e) {
|
2943
|
+
return "";
|
2944
|
+
}
|
2945
|
+
dispose() {
|
2946
|
+
}
|
2947
|
+
}
|
2948
|
+
class Er extends D {
|
2949
|
+
constructor() {
|
2950
|
+
super(...arguments);
|
2951
|
+
n(this, "type", "Signer");
|
2952
|
+
}
|
2953
|
+
open() {
|
2954
|
+
super.open(), super.register({
|
2955
|
+
Default: Tr
|
2956
|
+
});
|
2806
2957
|
}
|
2807
2958
|
/**
|
2808
|
-
*
|
2959
|
+
* 获取指定签名实例
|
2809
2960
|
*/
|
2810
|
-
|
2811
|
-
|
2961
|
+
async createAsync(e, t) {
|
2962
|
+
let r = await super.createAsync(e);
|
2963
|
+
return await r.openAsync(null), r;
|
2812
2964
|
}
|
2813
2965
|
}
|
2814
|
-
class
|
2966
|
+
class jr {
|
2815
2967
|
constructor() {
|
2816
2968
|
//#region 属性
|
2817
2969
|
n(this, "type", "Bearer");
|
@@ -2843,7 +2995,7 @@ class Ar {
|
|
2843
2995
|
await this.provider.deleteAsync("user", "user"), await this.provider.deleteAsync("user", "sso");
|
2844
2996
|
}
|
2845
2997
|
}
|
2846
|
-
class
|
2998
|
+
class $r {
|
2847
2999
|
constructor() {
|
2848
3000
|
//#region 属性
|
2849
3001
|
n(this, "type", "Nio");
|
@@ -2877,7 +3029,7 @@ class Sr {
|
|
2877
3029
|
await this.provider.deleteAsync("user", "user"), await this.provider.deleteAsync("user", "sso");
|
2878
3030
|
}
|
2879
3031
|
}
|
2880
|
-
class
|
3032
|
+
class st {
|
2881
3033
|
constructor() {
|
2882
3034
|
/**
|
2883
3035
|
* 用户标识
|
@@ -2897,7 +3049,7 @@ class rt {
|
|
2897
3049
|
n(this, "identity");
|
2898
3050
|
}
|
2899
3051
|
}
|
2900
|
-
class
|
3052
|
+
class Dr {
|
2901
3053
|
constructor() {
|
2902
3054
|
n(this, "type", "WeiXin");
|
2903
3055
|
}
|
@@ -2909,7 +3061,7 @@ class _r {
|
|
2909
3061
|
return "";
|
2910
3062
|
}
|
2911
3063
|
async getUser() {
|
2912
|
-
let i = new
|
3064
|
+
let i = new st();
|
2913
3065
|
return i.userId = "", i;
|
2914
3066
|
}
|
2915
3067
|
getAuth(i, e, t, r) {
|
@@ -2919,12 +3071,12 @@ class _r {
|
|
2919
3071
|
return Promise.resolve();
|
2920
3072
|
}
|
2921
3073
|
}
|
2922
|
-
class
|
3074
|
+
class Hr {
|
2923
3075
|
constructor() {
|
2924
3076
|
n(this, "type");
|
2925
3077
|
}
|
2926
3078
|
}
|
2927
|
-
class
|
3079
|
+
class Or extends Hr {
|
2928
3080
|
constructor() {
|
2929
3081
|
super(...arguments);
|
2930
3082
|
//#region 属性
|
@@ -2949,7 +3101,7 @@ class Tr extends Cr {
|
|
2949
3101
|
let r = d.string.getUniqueId();
|
2950
3102
|
await this.provider.saveAsync("anonymous", "anonymous", r), e = r;
|
2951
3103
|
}
|
2952
|
-
let t = new
|
3104
|
+
let t = new st();
|
2953
3105
|
return t.identity = { token: e }, t;
|
2954
3106
|
}
|
2955
3107
|
getAuth(e, t, r, s) {
|
@@ -2959,7 +3111,7 @@ class Tr extends Cr {
|
|
2959
3111
|
await this.provider.deleteAsync("anonymous", "anonymous");
|
2960
3112
|
}
|
2961
3113
|
}
|
2962
|
-
class
|
3114
|
+
class Ur {
|
2963
3115
|
constructor() {
|
2964
3116
|
//#region 属性
|
2965
3117
|
n(this, "type", "Secret");
|
@@ -2991,7 +3143,7 @@ class Er {
|
|
2991
3143
|
await this.provider.deleteAsync("user");
|
2992
3144
|
}
|
2993
3145
|
}
|
2994
|
-
class
|
3146
|
+
class Lr extends D {
|
2995
3147
|
constructor() {
|
2996
3148
|
super(...arguments);
|
2997
3149
|
n(this, "type", "Sso");
|
@@ -3001,22 +3153,22 @@ class $r extends D {
|
|
3001
3153
|
*/
|
3002
3154
|
open() {
|
3003
3155
|
super.open(), super.register({
|
3004
|
-
Secret:
|
3005
|
-
Nio:
|
3006
|
-
WeiXin:
|
3007
|
-
Bearer:
|
3008
|
-
Anonymous:
|
3156
|
+
Secret: Ur,
|
3157
|
+
Nio: $r,
|
3158
|
+
WeiXin: Dr,
|
3159
|
+
Bearer: jr,
|
3160
|
+
Anonymous: Or
|
3009
3161
|
});
|
3010
3162
|
}
|
3011
3163
|
/**
|
3012
3164
|
* 获取指定SSO实例
|
3013
3165
|
*/
|
3014
3166
|
async createAsync(e, t) {
|
3015
|
-
let r =
|
3167
|
+
let r = Xe.ssos.find((a) => a.type.toUpperCase() == e.toUpperCase()), s = { url: r == null ? void 0 : r.url, app_id: r == null ? void 0 : r.appId }, l = await super.createAsync(e);
|
3016
3168
|
return await l.openAsync(s), l;
|
3017
3169
|
}
|
3018
3170
|
}
|
3019
|
-
class
|
3171
|
+
class Rr {
|
3020
3172
|
constructor() {
|
3021
3173
|
//#region 属性
|
3022
3174
|
n(this, "type");
|
@@ -3024,7 +3176,7 @@ class jr {
|
|
3024
3176
|
}
|
3025
3177
|
//#endregion
|
3026
3178
|
}
|
3027
|
-
class
|
3179
|
+
class Ir extends Rr {
|
3028
3180
|
constructor() {
|
3029
3181
|
super(...arguments);
|
3030
3182
|
//#region 属性
|
@@ -3088,71 +3240,71 @@ class Dr extends jr {
|
|
3088
3240
|
clearInterval(this.intervalTimeout), clearTimeout(this.lastDebounceTimeout);
|
3089
3241
|
}
|
3090
3242
|
}
|
3091
|
-
class
|
3243
|
+
class Mr extends D {
|
3092
3244
|
constructor() {
|
3093
3245
|
super(...arguments);
|
3094
3246
|
n(this, "type", "Task");
|
3095
3247
|
}
|
3096
3248
|
open() {
|
3097
3249
|
super.open(), super.register({
|
3098
|
-
Memory:
|
3250
|
+
Memory: Ir
|
3099
3251
|
});
|
3100
3252
|
}
|
3101
3253
|
}
|
3102
|
-
class
|
3254
|
+
class Br {
|
3103
3255
|
constructor() {
|
3104
3256
|
n(this, "type");
|
3105
3257
|
}
|
3106
3258
|
}
|
3107
|
-
class
|
3259
|
+
class Pr extends Br {
|
3108
3260
|
constructor() {
|
3109
3261
|
super(...arguments);
|
3110
3262
|
n(this, "type", "Liquid");
|
3111
3263
|
}
|
3112
3264
|
async renderAsync(e, t) {
|
3113
|
-
let r = new
|
3265
|
+
let r = new ft(), s = r.parse(e);
|
3114
3266
|
return await r.render(s, t);
|
3115
3267
|
}
|
3116
3268
|
}
|
3117
|
-
class
|
3269
|
+
class Fr extends D {
|
3118
3270
|
constructor() {
|
3119
3271
|
super(...arguments);
|
3120
3272
|
n(this, "type", "Template");
|
3121
3273
|
}
|
3122
3274
|
open() {
|
3123
3275
|
super.open(), super.register({
|
3124
|
-
Liquid:
|
3276
|
+
Liquid: Pr
|
3125
3277
|
});
|
3126
3278
|
}
|
3127
3279
|
}
|
3128
|
-
class
|
3280
|
+
class Nr extends D {
|
3129
3281
|
constructor() {
|
3130
3282
|
super(...arguments);
|
3131
3283
|
n(this, "type", "Util");
|
3132
3284
|
}
|
3133
3285
|
open() {
|
3134
3286
|
super.open(), super.register({
|
3135
|
-
Array:
|
3136
|
-
Browser:
|
3137
|
-
Component:
|
3138
|
-
Dictionary:
|
3139
|
-
Dom:
|
3140
|
-
Event:
|
3141
|
-
File:
|
3142
|
-
Html:
|
3143
|
-
Image:
|
3144
|
-
Json:
|
3145
|
-
Math:
|
3146
|
-
Micro:
|
3147
|
-
Mount:
|
3148
|
-
Object:
|
3149
|
-
Scroll:
|
3150
|
-
Sign:
|
3151
|
-
String:
|
3152
|
-
Task:
|
3153
|
-
Time:
|
3154
|
-
Tree:
|
3155
|
-
Url:
|
3287
|
+
Array: Vr,
|
3288
|
+
Browser: os,
|
3289
|
+
Component: Wr,
|
3290
|
+
Dictionary: qr,
|
3291
|
+
Dom: zr,
|
3292
|
+
Event: Kr,
|
3293
|
+
File: Jr,
|
3294
|
+
Html: Yr,
|
3295
|
+
Image: Qr,
|
3296
|
+
Json: as,
|
3297
|
+
Math: Xr,
|
3298
|
+
Micro: Gr,
|
3299
|
+
Mount: Zr,
|
3300
|
+
Object: es,
|
3301
|
+
Scroll: ns,
|
3302
|
+
Sign: cs,
|
3303
|
+
String: ts,
|
3304
|
+
Task: rs,
|
3305
|
+
Time: ss,
|
3306
|
+
Tree: ls,
|
3307
|
+
Url: us
|
3156
3308
|
});
|
3157
3309
|
}
|
3158
3310
|
get array() {
|
@@ -3219,12 +3371,12 @@ class Rr extends D {
|
|
3219
3371
|
return super.createWithCache("sign");
|
3220
3372
|
}
|
3221
3373
|
}
|
3222
|
-
class
|
3374
|
+
class U {
|
3223
3375
|
constructor() {
|
3224
3376
|
n(this, "type");
|
3225
3377
|
}
|
3226
3378
|
}
|
3227
|
-
class
|
3379
|
+
class Vr extends U {
|
3228
3380
|
constructor() {
|
3229
3381
|
super(...arguments);
|
3230
3382
|
n(this, "type", "array");
|
@@ -3265,11 +3417,11 @@ class Ir extends O {
|
|
3265
3417
|
/**
|
3266
3418
|
* 求最大值,数据类型的比较函数要自己转换为数值类型
|
3267
3419
|
*/
|
3268
|
-
n(this, "max", (e, t) =>
|
3420
|
+
n(this, "max", (e, t) => ke.max(e, t));
|
3269
3421
|
/**
|
3270
3422
|
* 求最小值,数据类型的比较函数要自己转换为数值类型
|
3271
3423
|
*/
|
3272
|
-
n(this, "min", (e, t) =>
|
3424
|
+
n(this, "min", (e, t) => ke.min(e, t));
|
3273
3425
|
/**
|
3274
3426
|
* 求平均值
|
3275
3427
|
*/
|
@@ -3303,8 +3455,8 @@ class Ir extends O {
|
|
3303
3455
|
let a = e[l];
|
3304
3456
|
if (a)
|
3305
3457
|
for (let o = 0; o < t.length; o++) {
|
3306
|
-
let
|
3307
|
-
a[
|
3458
|
+
let c = t[o];
|
3459
|
+
a[c].toString().toUpperCase().includes(r.toUpperCase()) && s.push(a);
|
3308
3460
|
}
|
3309
3461
|
}
|
3310
3462
|
return s;
|
@@ -3340,7 +3492,7 @@ class Ir extends O {
|
|
3340
3492
|
return [];
|
3341
3493
|
let l = [];
|
3342
3494
|
return e.forEach((a) => {
|
3343
|
-
let o = t.find((
|
3495
|
+
let o = t.find((c) => c[r] == a);
|
3344
3496
|
o || (o = { [r]: a, [s]: a }), l.push(o);
|
3345
3497
|
}), l;
|
3346
3498
|
});
|
@@ -3362,17 +3514,17 @@ class Ir extends O {
|
|
3362
3514
|
* 合并多个数组中的每一项到新的二维数组中,没值的元素被有值的元素代替
|
3363
3515
|
*/
|
3364
3516
|
n(this, "combine", (...e) => {
|
3365
|
-
let t = [], r =
|
3517
|
+
let t = [], r = ke.max(e, (s) => s.length);
|
3366
3518
|
for (let s = 0; s < r.length; s++) {
|
3367
3519
|
let l = [], a;
|
3368
3520
|
for (let o = 0; o < e.length; o++) {
|
3369
|
-
let
|
3370
|
-
|
3521
|
+
let c = e[o][s];
|
3522
|
+
c != null && (a = c);
|
3371
3523
|
break;
|
3372
3524
|
}
|
3373
3525
|
for (let o = 0; o < e.length; o++) {
|
3374
|
-
let
|
3375
|
-
|
3526
|
+
let c = e[o][s];
|
3527
|
+
c != null ? l.push(c) : l.push(a);
|
3376
3528
|
}
|
3377
3529
|
t.push(l);
|
3378
3530
|
}
|
@@ -3431,13 +3583,13 @@ class Ir extends O {
|
|
3431
3583
|
return e;
|
3432
3584
|
t instanceof Function && (t = [t]);
|
3433
3585
|
let s = e.sort((a, o) => {
|
3434
|
-
let
|
3586
|
+
let c = t[0], p = c(a) - c(o);
|
3435
3587
|
if (p != 0)
|
3436
3588
|
return p;
|
3437
3589
|
let h = t[1];
|
3438
3590
|
return h == null ? p : h(a) - h(o);
|
3439
3591
|
}), l;
|
3440
|
-
return r ==
|
3592
|
+
return r == !0 ? l = s : l = s.reverse(), l;
|
3441
3593
|
});
|
3442
3594
|
//#endregion
|
3443
3595
|
//#region 分组
|
@@ -3531,7 +3683,7 @@ class Ir extends O {
|
|
3531
3683
|
}
|
3532
3684
|
//#endregion
|
3533
3685
|
}
|
3534
|
-
class
|
3686
|
+
class Wr extends U {
|
3535
3687
|
constructor() {
|
3536
3688
|
super(...arguments);
|
3537
3689
|
n(this, "type", "component");
|
@@ -3554,11 +3706,11 @@ class Mr extends O {
|
|
3554
3706
|
return s;
|
3555
3707
|
for (let a = 0; a < l.length; a++) {
|
3556
3708
|
const o = l[a];
|
3557
|
-
let
|
3709
|
+
let c = d.string.trim(o, t, ".vue"), h = (r ? r + "-" : "") + d.string.getDashName(c), g = e[o];
|
3558
3710
|
if (g.default)
|
3559
3711
|
s[h] = g.default;
|
3560
3712
|
else {
|
3561
|
-
let m =
|
3713
|
+
let m = dt(g);
|
3562
3714
|
s[h] = m;
|
3563
3715
|
}
|
3564
3716
|
}
|
@@ -3573,7 +3725,7 @@ class Mr extends O {
|
|
3573
3725
|
}, 100);
|
3574
3726
|
}
|
3575
3727
|
}
|
3576
|
-
class
|
3728
|
+
class zr extends U {
|
3577
3729
|
constructor() {
|
3578
3730
|
super(...arguments);
|
3579
3731
|
n(this, "type", "dom");
|
@@ -3619,8 +3771,8 @@ class Pr extends O {
|
|
3619
3771
|
let o = l[a];
|
3620
3772
|
if (!o || !o.getBoundingClientRect)
|
3621
3773
|
continue;
|
3622
|
-
let
|
3623
|
-
s +=
|
3774
|
+
let c = o.getBoundingClientRect();
|
3775
|
+
s += c[t], r && (s += r(o));
|
3624
3776
|
}
|
3625
3777
|
return s;
|
3626
3778
|
});
|
@@ -3678,8 +3830,8 @@ class Pr extends O {
|
|
3678
3830
|
let l = e[s], a = 0;
|
3679
3831
|
for (let g = 0; g < l.length; g++)
|
3680
3832
|
a += l.charCodeAt(g);
|
3681
|
-
let o = a / r,
|
3682
|
-
t[l] = `rgb(${
|
3833
|
+
let o = a / r, c = 255 * o, p = 255 * (1 - o), h = 255 * (1 - o);
|
3834
|
+
t[l] = `rgb(${c}, ${p}, ${h})`;
|
3683
3835
|
}
|
3684
3836
|
return t;
|
3685
3837
|
}
|
@@ -3814,13 +3966,13 @@ class Pr extends O {
|
|
3814
3966
|
let a = e.querySelector(r);
|
3815
3967
|
if (!a)
|
3816
3968
|
return null;
|
3817
|
-
let o = {},
|
3969
|
+
let o = {}, c = e.getBoundingClientRect(), p = s.getBoundingClientRect(), g = e.querySelector(t).getBoundingClientRect(), m = a.getBoundingClientRect(), k = p.height - g.top;
|
3818
3970
|
if (l == "right") {
|
3819
|
-
o.left = `${
|
3820
|
-
let
|
3821
|
-
m.height > p.height ?
|
3971
|
+
o.left = `${c.left + c.width}px`;
|
3972
|
+
let H;
|
3973
|
+
m.height > p.height ? H = p.height : H = m.height, o.height = `${H}px`, H + g.top > p.height ? (o.top = "initial", o.bottom = "0px") : o.top = `${c.top}px`;
|
3822
3974
|
} else if (l == "bottom")
|
3823
|
-
k -= g.height, o.left = `${
|
3975
|
+
k -= g.height, o.left = `${c.left}px`, o.top = `${c.top + c.height}px`, k < m.height ? o.height = `${k}px` : o.height = `${m.height}px`;
|
3824
3976
|
else
|
3825
3977
|
throw new Error(`暂未支持的position:${l}`);
|
3826
3978
|
return o;
|
@@ -3835,8 +3987,8 @@ class Pr extends O {
|
|
3835
3987
|
return 0;
|
3836
3988
|
let r = [];
|
3837
3989
|
for (let l = 0; l < t.length; l++) {
|
3838
|
-
let a = t[l], o = getComputedStyle(a),
|
3839
|
-
r.push(
|
3990
|
+
let a = t[l], o = getComputedStyle(a), c = o.zIndex == "auto" ? 0 : o.zIndex;
|
3991
|
+
r.push(c);
|
3840
3992
|
}
|
3841
3993
|
return Math.max(...r);
|
3842
3994
|
}
|
@@ -3899,7 +4051,7 @@ class Pr extends O {
|
|
3899
4051
|
}
|
3900
4052
|
//#endregion
|
3901
4053
|
}
|
3902
|
-
class
|
4054
|
+
class qr extends U {
|
3903
4055
|
constructor() {
|
3904
4056
|
super(...arguments);
|
3905
4057
|
n(this, "type", "dictionary");
|
@@ -3939,8 +4091,8 @@ class Br extends O {
|
|
3939
4091
|
return l;
|
3940
4092
|
let a = Object.keys(e);
|
3941
4093
|
for (let o = 0; o < a.length; o++) {
|
3942
|
-
let
|
3943
|
-
l = l.concat(
|
4094
|
+
let c = a[o], p = t == null ? e[c] : t(e[c]);
|
4095
|
+
l = l.concat(c).concat(r).concat(p), o != a.length - 1 && (l += s);
|
3944
4096
|
}
|
3945
4097
|
return l;
|
3946
4098
|
}
|
@@ -3976,7 +4128,7 @@ class Br extends O {
|
|
3976
4128
|
}
|
3977
4129
|
//#endregion
|
3978
4130
|
}
|
3979
|
-
class
|
4131
|
+
class Kr extends U {
|
3980
4132
|
constructor() {
|
3981
4133
|
super(...arguments);
|
3982
4134
|
n(this, "type", "event");
|
@@ -4022,7 +4174,7 @@ class Fr extends O {
|
|
4022
4174
|
});
|
4023
4175
|
}
|
4024
4176
|
}
|
4025
|
-
class
|
4177
|
+
class Jr extends U {
|
4026
4178
|
constructor() {
|
4027
4179
|
super(...arguments);
|
4028
4180
|
n(this, "type", "file");
|
@@ -4034,7 +4186,7 @@ class Nr extends O {
|
|
4034
4186
|
for (; s--; )
|
4035
4187
|
l[s] = r.charCodeAt(s);
|
4036
4188
|
let a = new Blob([l]);
|
4037
|
-
|
4189
|
+
yt.saveAs(a, t);
|
4038
4190
|
});
|
4039
4191
|
/**
|
4040
4192
|
* 获取文件扩展名
|
@@ -4059,7 +4211,7 @@ class Nr extends O {
|
|
4059
4211
|
});
|
4060
4212
|
}
|
4061
4213
|
}
|
4062
|
-
class
|
4214
|
+
class Yr extends U {
|
4063
4215
|
constructor() {
|
4064
4216
|
super(...arguments);
|
4065
4217
|
n(this, "type", "html");
|
@@ -4080,7 +4232,7 @@ class qr extends O {
|
|
4080
4232
|
});
|
4081
4233
|
}
|
4082
4234
|
}
|
4083
|
-
class
|
4235
|
+
class Qr extends U {
|
4084
4236
|
constructor() {
|
4085
4237
|
super(...arguments);
|
4086
4238
|
n(this, "type", "image");
|
@@ -4090,7 +4242,7 @@ class Vr extends O {
|
|
4090
4242
|
n(this, "base64", (e) => "data:image/png;base64," + e);
|
4091
4243
|
}
|
4092
4244
|
}
|
4093
|
-
class
|
4245
|
+
class Xr extends U {
|
4094
4246
|
constructor() {
|
4095
4247
|
super(...arguments);
|
4096
4248
|
n(this, "type", "math");
|
@@ -4100,7 +4252,7 @@ class Wr extends O {
|
|
4100
4252
|
*/
|
4101
4253
|
n(this, "filterPage", (e, t, r) => {
|
4102
4254
|
let s = (t - 1) * r, l = t * r;
|
4103
|
-
return e.filter((o,
|
4255
|
+
return e.filter((o, c) => c >= s && c < l);
|
4104
4256
|
});
|
4105
4257
|
/**
|
4106
4258
|
* 总页数
|
@@ -4188,7 +4340,7 @@ class Wr extends O {
|
|
4188
4340
|
return e;
|
4189
4341
|
}
|
4190
4342
|
}
|
4191
|
-
class
|
4343
|
+
class Gr extends U {
|
4192
4344
|
constructor() {
|
4193
4345
|
super(...arguments);
|
4194
4346
|
n(this, "type", "micro");
|
@@ -4199,7 +4351,7 @@ class zr extends O {
|
|
4199
4351
|
});
|
4200
4352
|
}
|
4201
4353
|
}
|
4202
|
-
class
|
4354
|
+
class Zr extends U {
|
4203
4355
|
constructor() {
|
4204
4356
|
super(...arguments);
|
4205
4357
|
n(this, "type", "mount");
|
@@ -4221,7 +4373,7 @@ class Kr extends O {
|
|
4221
4373
|
});
|
4222
4374
|
}
|
4223
4375
|
}
|
4224
|
-
class
|
4376
|
+
class es extends U {
|
4225
4377
|
constructor() {
|
4226
4378
|
super(...arguments);
|
4227
4379
|
n(this, "type", "object");
|
@@ -4260,9 +4412,9 @@ class Jr extends O {
|
|
4260
4412
|
let s = [];
|
4261
4413
|
for (let l = 0; l < r.length; l++) {
|
4262
4414
|
let a = r[l], o = {};
|
4263
|
-
Object.keys(a).forEach((
|
4264
|
-
let p = a[
|
4265
|
-
t && t[
|
4415
|
+
Object.keys(a).forEach((c) => {
|
4416
|
+
let p = a[c];
|
4417
|
+
t && t[c] ? o[c] = t[c]() : o[c] = p;
|
4266
4418
|
}), s.push(o);
|
4267
4419
|
}
|
4268
4420
|
return d.object.isObject(e) ? s[0] : s;
|
@@ -4335,7 +4487,7 @@ class Jr extends O {
|
|
4335
4487
|
* 对对象进行深度克隆,同时可以移除Proxy对象
|
4336
4488
|
*/
|
4337
4489
|
clone(e, t = null) {
|
4338
|
-
let r =
|
4490
|
+
let r = mt(e, !0);
|
4339
4491
|
if (t == null)
|
4340
4492
|
return r;
|
4341
4493
|
if (d.object.isArray(e))
|
@@ -4356,6 +4508,17 @@ class Jr extends O {
|
|
4356
4508
|
}), e);
|
4357
4509
|
}
|
4358
4510
|
//#endregion
|
4511
|
+
/**
|
4512
|
+
* 排序并生成新对象
|
4513
|
+
*/
|
4514
|
+
sort(e) {
|
4515
|
+
if (e == null)
|
4516
|
+
return null;
|
4517
|
+
let t = {}, s = Object.keys(e).sort();
|
4518
|
+
for (let l of s)
|
4519
|
+
t[l] = e[l];
|
4520
|
+
return t;
|
4521
|
+
}
|
4359
4522
|
//#region 获取值
|
4360
4523
|
/**
|
4361
4524
|
* 获取对象不区分大小写的key
|
@@ -4373,7 +4536,7 @@ class Jr extends O {
|
|
4373
4536
|
}
|
4374
4537
|
//#endregion
|
4375
4538
|
}
|
4376
|
-
class
|
4539
|
+
class ts extends U {
|
4377
4540
|
constructor() {
|
4378
4541
|
super(...arguments);
|
4379
4542
|
n(this, "type", "string");
|
@@ -4390,7 +4553,7 @@ class Xr extends O {
|
|
4390
4553
|
/**
|
4391
4554
|
* 填充字符串到指定长度,使用pad填充
|
4392
4555
|
*/
|
4393
|
-
n(this, "padLeft", (e, t, r) =>
|
4556
|
+
n(this, "padLeft", (e, t, r) => vt.pad(e, t, r));
|
4394
4557
|
/**
|
4395
4558
|
* 填充字符串到指定长度,使用pad填充
|
4396
4559
|
*/
|
@@ -4556,6 +4719,17 @@ class Xr extends O {
|
|
4556
4719
|
let r = parseFloat(e), s;
|
4557
4720
|
return t ? s = r.toFixed(t).replace(/(\d)(?=(\d{3})+\.)/g, "$1,") : s = r.toLocaleString(), s;
|
4558
4721
|
});
|
4722
|
+
//#endregion
|
4723
|
+
//#region 分割
|
4724
|
+
/**
|
4725
|
+
* 把字符串分割成多行
|
4726
|
+
*/
|
4727
|
+
n(this, "splitLines", (e, t = "\\r?\\n") => {
|
4728
|
+
if (e == null)
|
4729
|
+
return [];
|
4730
|
+
let r = new RegExp(`${t}`);
|
4731
|
+
return e.split(r);
|
4732
|
+
});
|
4559
4733
|
}
|
4560
4734
|
/**
|
4561
4735
|
* 忽略大小写比较
|
@@ -4572,7 +4746,7 @@ class Xr extends O {
|
|
4572
4746
|
}
|
4573
4747
|
//#endregion
|
4574
4748
|
}
|
4575
|
-
class
|
4749
|
+
class rs extends U {
|
4576
4750
|
constructor() {
|
4577
4751
|
super(...arguments);
|
4578
4752
|
n(this, "type", "task");
|
@@ -4625,12 +4799,12 @@ class Qr extends O {
|
|
4625
4799
|
});
|
4626
4800
|
}
|
4627
4801
|
}
|
4628
|
-
class
|
4802
|
+
class Hl {
|
4629
4803
|
constructor() {
|
4630
4804
|
n(this, "value");
|
4631
4805
|
}
|
4632
4806
|
}
|
4633
|
-
class
|
4807
|
+
class ss extends U {
|
4634
4808
|
constructor() {
|
4635
4809
|
super(...arguments);
|
4636
4810
|
n(this, "type", "time");
|
@@ -4641,32 +4815,32 @@ class Yr extends O {
|
|
4641
4815
|
/**
|
4642
4816
|
* 根据字符串获取可对比的时间
|
4643
4817
|
*/
|
4644
|
-
n(this, "getTime", (e = null) => e
|
4818
|
+
n(this, "getTime", (e = null) => e == null ? /* @__PURE__ */ new Date() : new Date(e));
|
4645
4819
|
//#region 格式化
|
4646
4820
|
/**
|
4647
4821
|
* 格式化时间
|
4648
4822
|
*/
|
4649
|
-
n(this, "format", (e, t) =>
|
4823
|
+
n(this, "format", (e, t) => Y(e).format(t));
|
4650
4824
|
/**
|
4651
4825
|
* 对时间值进行时间格式化
|
4652
4826
|
*/
|
4653
|
-
n(this, "formatSecondTime", (e) =>
|
4827
|
+
n(this, "formatSecondTime", (e) => Y(e).format("YYYY-MM-DD HH:mm:ss"));
|
4654
4828
|
/**
|
4655
4829
|
* 对时间值进行时间格式化
|
4656
4830
|
*/
|
4657
|
-
n(this, "formatMillisecondTime", (e) => e ?
|
4831
|
+
n(this, "formatMillisecondTime", (e) => e ? Y(e).format("YYYY-MM-DD HH:mm:ss SSS") : null);
|
4658
4832
|
/**
|
4659
4833
|
* 格式化成24小时时间格式
|
4660
4834
|
*/
|
4661
|
-
n(this, "formatTime", (e) => e ?
|
4835
|
+
n(this, "formatTime", (e) => e ? Y(e).format("HH:mm:ss SSS") : null);
|
4662
4836
|
/**
|
4663
4837
|
* 对时间值进行日期格式化
|
4664
4838
|
*/
|
4665
|
-
n(this, "formatDate", (e) => e ?
|
4839
|
+
n(this, "formatDate", (e) => e ? Y(e).format("YYYY-MM-DD") : null);
|
4666
4840
|
/**
|
4667
|
-
* 格式化时间
|
4841
|
+
* 格式化时间 YYYY-MM-DD HH:mm:ss
|
4668
4842
|
*/
|
4669
|
-
n(this, "formatDateTime", (e) =>
|
4843
|
+
n(this, "formatDateTime", (e) => Y(e).format("YYYY-MM-DD HH:mm:ss"));
|
4670
4844
|
//#endregion
|
4671
4845
|
/**
|
4672
4846
|
* 获取当前日期时间的字符串
|
@@ -4683,22 +4857,22 @@ class Yr extends O {
|
|
4683
4857
|
/**
|
4684
4858
|
* 添加天数
|
4685
4859
|
*/
|
4686
|
-
n(this, "addDays", (e, t) => e ?
|
4860
|
+
n(this, "addDays", (e, t) => e ? Y(e).add(t, "days").toDate() : null);
|
4687
4861
|
/**
|
4688
4862
|
* 添加月份
|
4689
4863
|
*/
|
4690
|
-
n(this, "addMonths", (e, t) => e ?
|
4864
|
+
n(this, "addMonths", (e, t) => e ? Y(e).add(t, "months").toDate() : null);
|
4691
4865
|
/**
|
4692
4866
|
* 添加小时
|
4693
4867
|
*/
|
4694
|
-
n(this, "addHours", (e, t) => e ?
|
4868
|
+
n(this, "addHours", (e, t) => e ? Y(e).add(t, "hours").toDate() : null);
|
4695
4869
|
/**
|
4696
4870
|
* 判断指定时间是否是周末
|
4697
4871
|
*/
|
4698
4872
|
n(this, "isWeekend", (e) => {
|
4699
4873
|
if (!e)
|
4700
4874
|
return !1;
|
4701
|
-
let t =
|
4875
|
+
let t = Y(e).format("d");
|
4702
4876
|
return t == "6" || t == "0";
|
4703
4877
|
});
|
4704
4878
|
/**
|
@@ -4708,11 +4882,11 @@ class Yr extends O {
|
|
4708
4882
|
if (!e)
|
4709
4883
|
return null;
|
4710
4884
|
let r = (/* @__PURE__ */ new Date()).getTimezoneOffset() + 480;
|
4711
|
-
return
|
4885
|
+
return Y(e).add(r, "minutes").toDate();
|
4712
4886
|
});
|
4713
4887
|
}
|
4714
4888
|
}
|
4715
|
-
class
|
4889
|
+
class ls extends U {
|
4716
4890
|
constructor() {
|
4717
4891
|
super(...arguments);
|
4718
4892
|
n(this, "type", "tree");
|
@@ -4740,8 +4914,8 @@ class Gr extends O {
|
|
4740
4914
|
n(this, "getByIds", (e, t, r, s) => {
|
4741
4915
|
let l = d.array.distinct(e, (o) => o), a = [];
|
4742
4916
|
return l.forEach((o) => {
|
4743
|
-
let
|
4744
|
-
a.push(
|
4917
|
+
let c = this.getById(o, t, r, s);
|
4918
|
+
a.push(c);
|
4745
4919
|
}), a;
|
4746
4920
|
});
|
4747
4921
|
/**
|
@@ -4755,11 +4929,11 @@ class Gr extends O {
|
|
4755
4929
|
let h = r.indexOf(l);
|
4756
4930
|
return h == r.length - 1 ? r[h - 1] : r[h + 1];
|
4757
4931
|
}
|
4758
|
-
let o = a[a.length - 1],
|
4759
|
-
if (
|
4932
|
+
let o = a[a.length - 1], c = o[s];
|
4933
|
+
if (c.length == 1)
|
4760
4934
|
return o;
|
4761
|
-
let p =
|
4762
|
-
return p ==
|
4935
|
+
let p = c.indexOf(l);
|
4936
|
+
return p == c.length - 1 ? c[p - 1] : c[p + 1];
|
4763
4937
|
});
|
4764
4938
|
/**
|
4765
4939
|
* 获取兄弟节点
|
@@ -4780,21 +4954,21 @@ class Gr extends O {
|
|
4780
4954
|
*/
|
4781
4955
|
n(this, "getParentsById", (e, t, r, s, l = !1) => {
|
4782
4956
|
let a = [];
|
4783
|
-
return r == null ||
|
4957
|
+
return r == null || lt(e, t, r, s, a, l), a;
|
4784
4958
|
});
|
4785
4959
|
/**
|
4786
4960
|
* 获取当前节点的所有孩子节点的集合
|
4787
4961
|
*/
|
4788
4962
|
n(this, "getChildrenById", (e, t, r, s, l = !1) => {
|
4789
4963
|
let a = this.getById(e, t, r, s), o = [];
|
4790
|
-
return l && o.push(a),
|
4964
|
+
return l && o.push(a), _e(a, s, o), o;
|
4791
4965
|
});
|
4792
4966
|
/**
|
4793
4967
|
* 获取当前节点的所有孩子节点的集合
|
4794
4968
|
*/
|
4795
4969
|
n(this, "getChildren", (e, t, r = !1) => {
|
4796
4970
|
let s = [];
|
4797
|
-
return r && s.push(e),
|
4971
|
+
return r && s.push(e), _e(e, t, s), s;
|
4798
4972
|
});
|
4799
4973
|
/**
|
4800
4974
|
* 搜索指定文本的树结构
|
@@ -4804,8 +4978,8 @@ class Gr extends O {
|
|
4804
4978
|
if (!t)
|
4805
4979
|
return l;
|
4806
4980
|
let a = e ? e.toUpperCase() : "", o = d.object.isString(s) ? [s] : s;
|
4807
|
-
for (let
|
4808
|
-
let p = !1, h = this.getChildren(
|
4981
|
+
for (let c of t) {
|
4982
|
+
let p = !1, h = this.getChildren(c, r, !0);
|
4809
4983
|
for (let g of h) {
|
4810
4984
|
for (let m of o) {
|
4811
4985
|
let k = g[m];
|
@@ -4818,7 +4992,7 @@ class Gr extends O {
|
|
4818
4992
|
break;
|
4819
4993
|
}
|
4820
4994
|
if (p) {
|
4821
|
-
let g = this.searchTree(e,
|
4995
|
+
let g = this.searchTree(e, c[r], r, s), m = { ...c, [r]: g };
|
4822
4996
|
l.push(m);
|
4823
4997
|
}
|
4824
4998
|
}
|
@@ -4856,40 +5030,40 @@ class Gr extends O {
|
|
4856
5030
|
n(this, "map", (e, t, r, s) => {
|
4857
5031
|
let l = [];
|
4858
5032
|
for (let a = 0; a < e.length; a++) {
|
4859
|
-
let o = e[a],
|
4860
|
-
l.push(
|
5033
|
+
let o = e[a], c = s(o);
|
5034
|
+
l.push(c);
|
4861
5035
|
let p = o[t];
|
4862
5036
|
if (p && p.length > 0) {
|
4863
5037
|
let h = this.map(p, t, r, s);
|
4864
|
-
|
5038
|
+
c[r] = h;
|
4865
5039
|
}
|
4866
5040
|
}
|
4867
5041
|
return l;
|
4868
5042
|
});
|
4869
5043
|
}
|
4870
5044
|
}
|
4871
|
-
function
|
5045
|
+
function lt(u, i, e, t, r, s) {
|
4872
5046
|
for (let l = 0; l < e.length; l++) {
|
4873
5047
|
let a = e[l];
|
4874
|
-
if (a[i] ==
|
5048
|
+
if (a[i] == u) {
|
4875
5049
|
s && r.push(a);
|
4876
5050
|
break;
|
4877
5051
|
} else
|
4878
|
-
d.tree.getById(
|
5052
|
+
d.tree.getById(u, i, a[t], t) != null && (r.push(a), lt(u, i, a[t], t, r, s));
|
4879
5053
|
}
|
4880
5054
|
return r;
|
4881
5055
|
}
|
4882
|
-
function
|
4883
|
-
let t =
|
5056
|
+
function _e(u, i, e) {
|
5057
|
+
let t = u[i];
|
4884
5058
|
if (!t || t.length == 0)
|
4885
5059
|
return e;
|
4886
5060
|
for (let r = 0; r < t.length; r++) {
|
4887
5061
|
let s = t[r];
|
4888
|
-
e.push(s),
|
5062
|
+
e.push(s), _e(s, i, e);
|
4889
5063
|
}
|
4890
5064
|
return e;
|
4891
5065
|
}
|
4892
|
-
class
|
5066
|
+
class ns extends U {
|
4893
5067
|
constructor() {
|
4894
5068
|
super(...arguments);
|
4895
5069
|
n(this, "type", "scroll");
|
@@ -4912,7 +5086,7 @@ class Zr extends O {
|
|
4912
5086
|
});
|
4913
5087
|
}
|
4914
5088
|
}
|
4915
|
-
class
|
5089
|
+
class is {
|
4916
5090
|
constructor() {
|
4917
5091
|
/**
|
4918
5092
|
* 是否美化
|
@@ -4920,7 +5094,7 @@ class es {
|
|
4920
5094
|
n(this, "beautify", !1);
|
4921
5095
|
}
|
4922
5096
|
}
|
4923
|
-
class
|
5097
|
+
class as extends U {
|
4924
5098
|
constructor() {
|
4925
5099
|
super(...arguments);
|
4926
5100
|
n(this, "type", "json");
|
@@ -4938,8 +5112,8 @@ class ts extends O {
|
|
4938
5112
|
/**
|
4939
5113
|
* 对非字符串进行序列化
|
4940
5114
|
*/
|
4941
|
-
serializeWithoutString(e) {
|
4942
|
-
return typeof e == "string" ? e : this.serialize(e,
|
5115
|
+
serializeWithoutString(e, t = !1) {
|
5116
|
+
return typeof e == "string" ? e : this.serialize(e, t);
|
4943
5117
|
}
|
4944
5118
|
/**
|
4945
5119
|
* 把对象格式化为Json字符串
|
@@ -4947,7 +5121,7 @@ class ts extends O {
|
|
4947
5121
|
serialize(e, t) {
|
4948
5122
|
if (e == null)
|
4949
5123
|
return null;
|
4950
|
-
t == null && (t = new
|
5124
|
+
t == null && (t = new is());
|
4951
5125
|
let s = (typeof t == "boolean" ? t : t.beautify) ? 2 : null, l;
|
4952
5126
|
if (typeof e == "string") {
|
4953
5127
|
let o = {};
|
@@ -5055,10 +5229,10 @@ class ts extends O {
|
|
5055
5229
|
let l = `{
|
5056
5230
|
`;
|
5057
5231
|
for (let a = 0; a < e.length; a++) {
|
5058
|
-
let o = e[a],
|
5059
|
-
|
5060
|
-
`), l += this.fillKey(2 * r,
|
5061
|
-
`), l += this.fillKey(2 * r,
|
5232
|
+
let o = e[a], c = s(o);
|
5233
|
+
c.type == "array" ? (c.remark && (l += this.fillSpace(2 * r) + "//" + c.remark + `
|
5234
|
+
`), l += this.fillKey(2 * r, c.key) + "[", l += this.buildObjectLevel(o[t], t, r + 1, s), l += "]", a != e.length - 1 && (l += ",")) : c.type == "object" ? (c.remark && (l += this.fillSpace(2 * r) + "//" + c.remark + `
|
5235
|
+
`), l += this.fillKey(2 * r, c.key), l += this.buildObjectLevel(o[t], t, r + 1, s), a != e.length - 1 && (l += ",")) : (l += this.fillKey(2 * r, c.key), c.type == "string" ? l += '""' : c.type == "date" ? l += `"${d.time.getDateTimeString()}"` : c.type == "int" || c.type == "number" ? l += "0" : c.type == "boolean" ? l += "false" : l += null, a != e.length - 1 && (l += ","), c.remark && (l += " //" + c.remark)), l += `
|
5062
5236
|
`;
|
5063
5237
|
}
|
5064
5238
|
return l += this.fillSpace(2 * (r - 1)), l += "}", l;
|
@@ -5081,7 +5255,7 @@ class ts extends O {
|
|
5081
5255
|
}
|
5082
5256
|
//#endregion
|
5083
5257
|
}
|
5084
|
-
class
|
5258
|
+
class os extends U {
|
5085
5259
|
constructor() {
|
5086
5260
|
super(...arguments);
|
5087
5261
|
n(this, "type", "browser");
|
@@ -5093,10 +5267,36 @@ class rs extends O {
|
|
5093
5267
|
return navigator.language == "zh-CN" ? "zh-cn" : "en";
|
5094
5268
|
}
|
5095
5269
|
}
|
5096
|
-
class
|
5270
|
+
class us extends U {
|
5097
5271
|
constructor() {
|
5098
5272
|
super(...arguments);
|
5099
5273
|
n(this, "type", "url");
|
5274
|
+
/**
|
5275
|
+
* 自动根据后面路径,决定是否要合并Url
|
5276
|
+
*/
|
5277
|
+
n(this, "concatUrl", (e, t) => this.httpOrHttps(t) ? t : e + t);
|
5278
|
+
/**
|
5279
|
+
* 合并路径和查询对象(自动编码,并支持覆盖现有参数),得到完整URL地址,并会省略默认值
|
5280
|
+
* ? 对url参数不编码,只对 queryObj 参数编码,防止用户的参数被改成编码形式
|
5281
|
+
* ? 目前,对Url参数对象和目标对象都编码,因为源对象属性是经过解码的
|
5282
|
+
*/
|
5283
|
+
n(this, "getUrl", (e, t = null) => {
|
5284
|
+
if (e == null)
|
5285
|
+
return null;
|
5286
|
+
if (t == null)
|
5287
|
+
return e;
|
5288
|
+
let r = this.deserialize(e), s = d.object.mergeTo(r, t);
|
5289
|
+
return this.getPath(e) + "?" + this.getQuery(s);
|
5290
|
+
});
|
5291
|
+
/**
|
5292
|
+
* 获取超链接配置对象
|
5293
|
+
*/
|
5294
|
+
n(this, "getAnchor", (e, t = null) => {
|
5295
|
+
let r = { href: null, target: null };
|
5296
|
+
return d.url.httpOrHttps(e) ? (r.href = e, r.target = "_blank", r) : (r.href = d.url.getUrl(e, t), r);
|
5297
|
+
});
|
5298
|
+
//#endregion
|
5299
|
+
//#region 辅助
|
5100
5300
|
/**
|
5101
5301
|
* 处理键值对的值
|
5102
5302
|
*/
|
@@ -5125,30 +5325,6 @@ class ss extends O {
|
|
5125
5325
|
}
|
5126
5326
|
return r;
|
5127
5327
|
});
|
5128
|
-
/**
|
5129
|
-
* 自动根据后面路径,决定是否要合并Url
|
5130
|
-
*/
|
5131
|
-
n(this, "concatUrl", (e, t) => this.httpOrHttps(t) ? t : e + t);
|
5132
|
-
/**
|
5133
|
-
* 合并路径和查询对象(自动编码,并支持覆盖现有参数),得到完整URL地址,并会省略默认值
|
5134
|
-
* ? 对url参数不编码,只对 queryObj 参数编码,防止用户的参数被改成编码形式
|
5135
|
-
* ? 目前,对Url参数对象和目标对象都编码,因为源对象属性是经过解码的
|
5136
|
-
*/
|
5137
|
-
n(this, "getUrl", (e, t = null) => {
|
5138
|
-
if (e == null)
|
5139
|
-
return null;
|
5140
|
-
if (t == null)
|
5141
|
-
return e;
|
5142
|
-
let r = this.deserialize(e), s = d.object.mergeTo(r, t);
|
5143
|
-
return this.getPath(e) + "?" + this.getQuery(s);
|
5144
|
-
});
|
5145
|
-
/**
|
5146
|
-
* 获取超链接配置对象
|
5147
|
-
*/
|
5148
|
-
n(this, "getAnchor", (e, t = null) => {
|
5149
|
-
let r = { href: null, target: null };
|
5150
|
-
return d.url.httpOrHttps(e) ? (r.href = e, r.target = "_blank", r) : (r.href = d.url.getUrl(e, t), r);
|
5151
|
-
});
|
5152
5328
|
}
|
5153
5329
|
/**
|
5154
5330
|
* 获取指定地址路由对象
|
@@ -5232,13 +5408,13 @@ class ss extends O {
|
|
5232
5408
|
* 从Url中提取路径
|
5233
5409
|
*/
|
5234
5410
|
getPath(e) {
|
5235
|
-
return e ? e.split("?")[0]
|
5411
|
+
return e == null ? null : e.split("?")[0];
|
5236
5412
|
}
|
5237
5413
|
/**
|
5238
5414
|
* 获取path中最后一个片段信息
|
5239
5415
|
*/
|
5240
5416
|
getLastSegment(e) {
|
5241
|
-
if (
|
5417
|
+
if (e == null)
|
5242
5418
|
return null;
|
5243
5419
|
let r = this.getPath(e).split("/").filter((l) => l);
|
5244
5420
|
return r[r.length - 1];
|
@@ -5253,11 +5429,18 @@ class ss extends O {
|
|
5253
5429
|
return new URLSearchParams(r).get(t);
|
5254
5430
|
}
|
5255
5431
|
//region 序列化和反序列化
|
5432
|
+
/**
|
5433
|
+
* 反序列化成排序对象
|
5434
|
+
*/
|
5435
|
+
deserializeSorted(e) {
|
5436
|
+
let t = this.deserialize(e);
|
5437
|
+
return d.object.sort(t);
|
5438
|
+
}
|
5256
5439
|
/**
|
5257
5440
|
* 从Url中提取查询对象
|
5258
5441
|
*/
|
5259
5442
|
deserialize(e) {
|
5260
|
-
if (
|
5443
|
+
if (e == null)
|
5261
5444
|
return null;
|
5262
5445
|
let t = e.split("?");
|
5263
5446
|
return t.length == 1 ? null : this.deserializeQs(t[1]);
|
@@ -5268,8 +5451,8 @@ class ss extends O {
|
|
5268
5451
|
deserializeQs(e, t = !0) {
|
5269
5452
|
let r = {}, s = e.split("&");
|
5270
5453
|
for (let l = 0; l < s.length; l++) {
|
5271
|
-
let a = s[l], o = a.indexOf("="),
|
5272
|
-
r[
|
5454
|
+
let a = s[l], o = a.indexOf("="), c = a.substring(0, o), p = a.substring(o + 1);
|
5455
|
+
r[c] = t ? decodeURIComponent(p) : p;
|
5273
5456
|
}
|
5274
5457
|
return r;
|
5275
5458
|
}
|
@@ -5289,14 +5472,16 @@ class ss extends O {
|
|
5289
5472
|
return e == null ? null : encodeURIComponent(e);
|
5290
5473
|
}
|
5291
5474
|
//endregion
|
5475
|
+
//#region 判断
|
5292
5476
|
/**
|
5293
5477
|
* 是否是http或https开头的地址
|
5294
5478
|
*/
|
5295
5479
|
httpOrHttps(e) {
|
5296
5480
|
return e ? e.indexOf("http://") > -1 || e.indexOf("https://") > -1 : !1;
|
5297
5481
|
}
|
5482
|
+
//#endregion
|
5298
5483
|
}
|
5299
|
-
class
|
5484
|
+
class cs extends U {
|
5300
5485
|
constructor() {
|
5301
5486
|
super(...arguments);
|
5302
5487
|
n(this, "type", "sign");
|
@@ -5316,7 +5501,7 @@ class ls extends O {
|
|
5316
5501
|
return this.clean(e), d.url.serialize(e, t);
|
5317
5502
|
}
|
5318
5503
|
}
|
5319
|
-
class
|
5504
|
+
class nt {
|
5320
5505
|
constructor(i, e) {
|
5321
5506
|
/**
|
5322
5507
|
* 距窗口左边的距离
|
@@ -5329,7 +5514,7 @@ class lt {
|
|
5329
5514
|
this.x = i, this.y = e;
|
5330
5515
|
}
|
5331
5516
|
}
|
5332
|
-
class
|
5517
|
+
class ds extends nt {
|
5333
5518
|
constructor() {
|
5334
5519
|
super(...arguments);
|
5335
5520
|
/**
|
@@ -5338,7 +5523,7 @@ class ns extends lt {
|
|
5338
5523
|
n(this, "affix");
|
5339
5524
|
}
|
5340
5525
|
}
|
5341
|
-
class
|
5526
|
+
class Ol extends nt {
|
5342
5527
|
constructor(e, t, r, s) {
|
5343
5528
|
super(e, t);
|
5344
5529
|
n(this, "width");
|
@@ -5346,12 +5531,12 @@ class El extends lt {
|
|
5346
5531
|
this.width = r, this.height = s;
|
5347
5532
|
}
|
5348
5533
|
}
|
5349
|
-
class
|
5534
|
+
class ne {
|
5350
5535
|
constructor() {
|
5351
5536
|
n(this, "type");
|
5352
5537
|
}
|
5353
5538
|
}
|
5354
|
-
class $e extends
|
5539
|
+
class $e extends ne {
|
5355
5540
|
constructor() {
|
5356
5541
|
super();
|
5357
5542
|
//#region 大小调整
|
@@ -5431,20 +5616,20 @@ class $e extends re {
|
|
5431
5616
|
return;
|
5432
5617
|
this.dragElement = e;
|
5433
5618
|
let r = !1, s = (o) => (r = !0, o.preventDefault(), t.init(o)), l = (o) => {
|
5434
|
-
let
|
5619
|
+
let c = new ds(), p = t.range;
|
5435
5620
|
if (p == null)
|
5436
|
-
|
5621
|
+
c.x = o.clientX, c.y = o.clientY;
|
5437
5622
|
else {
|
5438
5623
|
let { x: h, y: g, width: m, height: k } = p;
|
5439
|
-
o.clientX < h ?
|
5624
|
+
o.clientX < h ? c.x = h : o.clientX > h + m ? c.x = h + m : c.x = o.clientX, o.clientY < g ? c.y = g : o.clientY > g + k ? c.y = g + k : c.y = o.clientY;
|
5440
5625
|
}
|
5441
5626
|
if (t.affix) {
|
5442
5627
|
if (t.range == null)
|
5443
5628
|
throw new Error("设置吸附距离时,必须设置范围信息");
|
5444
5629
|
let h = p.x + p.width, g = p.y + p.height;
|
5445
|
-
|
5630
|
+
c.x <= t.affix ? c.affix = "left" : c.x >= h - t.affix ? c.affix = "right" : c.y >= p.y && c.y <= p.y + t.affix ? c.affix = "top" : c.y >= g - t.affix && c.y <= g && (c.affix = "bottom");
|
5446
5631
|
}
|
5447
|
-
t.handler(
|
5632
|
+
t.handler(c, this.dragStart, this.dragStartData, r, o), r = !1;
|
5448
5633
|
}, a = (o) => {
|
5449
5634
|
window.removeEventListener("mousemove", l), window.removeEventListener("mouseup", a), t.end != null && t.end(o);
|
5450
5635
|
};
|
@@ -5494,7 +5679,7 @@ class $e extends re {
|
|
5494
5679
|
}
|
5495
5680
|
//#endregion
|
5496
5681
|
}
|
5497
|
-
class
|
5682
|
+
class ps extends ne {
|
5498
5683
|
constructor() {
|
5499
5684
|
super(...arguments);
|
5500
5685
|
n(this, "events", {});
|
@@ -5503,8 +5688,8 @@ class is extends re {
|
|
5503
5688
|
*/
|
5504
5689
|
n(this, "add", (e, t, r, s, l, a) => {
|
5505
5690
|
let o = this.events[s];
|
5506
|
-
o || (o = function(
|
5507
|
-
r(
|
5691
|
+
o || (o = function(c) {
|
5692
|
+
r(c) && (t && t(c), l && c.preventDefault());
|
5508
5693
|
}, this.events[s] = o), e.addEventListener(a, o);
|
5509
5694
|
});
|
5510
5695
|
/**
|
@@ -5617,14 +5802,14 @@ class is extends re {
|
|
5617
5802
|
clearTimeout(this.timer);
|
5618
5803
|
}
|
5619
5804
|
}
|
5620
|
-
class
|
5805
|
+
class hs extends ne {
|
5621
5806
|
/**
|
5622
5807
|
* 对比数据变动
|
5623
5808
|
*/
|
5624
5809
|
delta(i, e, t, r) {
|
5625
5810
|
}
|
5626
5811
|
}
|
5627
|
-
class
|
5812
|
+
class gs extends ne {
|
5628
5813
|
/**
|
5629
5814
|
* 初始化,并绑定自动关闭上下文菜单事件
|
5630
5815
|
*/
|
@@ -5664,7 +5849,7 @@ class os extends re {
|
|
5664
5849
|
}
|
5665
5850
|
}
|
5666
5851
|
}
|
5667
|
-
class
|
5852
|
+
class fs extends ne {
|
5668
5853
|
constructor() {
|
5669
5854
|
super(...arguments);
|
5670
5855
|
//#region 属性
|
@@ -5722,7 +5907,7 @@ class us extends re {
|
|
5722
5907
|
return this.current != null && this.history.push(e), this.current = this.history.length, e;
|
5723
5908
|
}
|
5724
5909
|
}
|
5725
|
-
const
|
5910
|
+
const ae = class ae extends ne {
|
5726
5911
|
constructor() {
|
5727
5912
|
super(...arguments);
|
5728
5913
|
/**
|
@@ -5761,18 +5946,18 @@ const ne = class ne extends re {
|
|
5761
5946
|
*/
|
5762
5947
|
async openAsync(e, t, r) {
|
5763
5948
|
this.kind = e, this.task = y.task.create("Memory");
|
5764
|
-
let s =
|
5765
|
-
s == null && (s = [],
|
5949
|
+
let s = ae.opened[e];
|
5950
|
+
s == null && (s = [], ae.opened[e] = s);
|
5766
5951
|
let l = await y.provider.getDefaultAsync(e);
|
5767
5952
|
this.key = t;
|
5768
5953
|
let a = await l.getAsync(e, this.key);
|
5769
5954
|
if (a == null) {
|
5770
|
-
let
|
5771
|
-
|
5955
|
+
let c = (await l.getKeysAsync(e)).filter((p) => isNaN(p) && !s.includes(p));
|
5956
|
+
c.length > 0 && (this.oldKey = c[0], a = await l.replaceEntityAsync(e, this.oldKey, this.key));
|
5772
5957
|
}
|
5773
|
-
return s.includes(this.key) || s.push(this.key), a != null && d.object.mergeTo(r, a),
|
5958
|
+
return s.includes(this.key) || s.push(this.key), a != null && d.object.mergeTo(r, a), q(() => JSON.stringify(r), (o, c) => {
|
5774
5959
|
l != null && this.task.debounce(async () => {
|
5775
|
-
let p = JSON.parse(o), h = JSON.parse(
|
5960
|
+
let p = JSON.parse(o), h = JSON.parse(c);
|
5776
5961
|
this.form = p, await this.saveAsync(p), this.handler != null && await this.handler(p, h);
|
5777
5962
|
}, 500);
|
5778
5963
|
}, { deep: !0 }), this.provider = l, l;
|
@@ -5798,7 +5983,7 @@ const ne = class ne extends re {
|
|
5798
5983
|
*/
|
5799
5984
|
async dispose(e = !1) {
|
5800
5985
|
this.task = null;
|
5801
|
-
let t =
|
5986
|
+
let t = ae.opened[this.kind], r = t.indexOf(this.key);
|
5802
5987
|
if (t.splice(r, 1), this.oldKey != null) {
|
5803
5988
|
let s = `/config/delete?kind=${this.kind}&type=${this.oldKey}`;
|
5804
5989
|
await _.post(s);
|
@@ -5819,9 +6004,9 @@ const ne = class ne extends re {
|
|
5819
6004
|
* 已开启窗口
|
5820
6005
|
* 使用静态对象记录各自工具类开启的窗口,保证同一个kind工具类,被窗口多开时,能够杜绝异步方法导致的变量不一致问题
|
5821
6006
|
*/
|
5822
|
-
n(
|
5823
|
-
let
|
5824
|
-
class
|
6007
|
+
n(ae, "opened", {});
|
6008
|
+
let Ce = ae;
|
6009
|
+
class ys extends ne {
|
5825
6010
|
/**
|
5826
6011
|
* 初始化
|
5827
6012
|
*/
|
@@ -5829,7 +6014,7 @@ class cs extends re {
|
|
5829
6014
|
super();
|
5830
6015
|
}
|
5831
6016
|
}
|
5832
|
-
class
|
6017
|
+
class ms extends D {
|
5833
6018
|
constructor() {
|
5834
6019
|
super(...arguments);
|
5835
6020
|
n(this, "type", "Utility");
|
@@ -5838,13 +6023,13 @@ class ds extends D {
|
|
5838
6023
|
* 创建固定工具
|
5839
6024
|
*/
|
5840
6025
|
affix(e, t) {
|
5841
|
-
return new
|
6026
|
+
return new ys(e, t);
|
5842
6027
|
}
|
5843
6028
|
/**
|
5844
6029
|
* 创建对比工具
|
5845
6030
|
*/
|
5846
6031
|
delta() {
|
5847
|
-
return new
|
6032
|
+
return new hs();
|
5848
6033
|
}
|
5849
6034
|
/**
|
5850
6035
|
* 创建事件工具
|
@@ -5856,28 +6041,28 @@ class ds extends D {
|
|
5856
6041
|
* 创建键盘工具
|
5857
6042
|
*/
|
5858
6043
|
keyboard() {
|
5859
|
-
return new
|
6044
|
+
return new ps();
|
5860
6045
|
}
|
5861
6046
|
/**
|
5862
6047
|
* 创建鼠标工具
|
5863
6048
|
*/
|
5864
6049
|
mouse(e, t = null) {
|
5865
|
-
return new
|
6050
|
+
return new gs(e, t);
|
5866
6051
|
}
|
5867
6052
|
/**
|
5868
6053
|
* 创建随机工具
|
5869
6054
|
*/
|
5870
6055
|
random() {
|
5871
|
-
return new
|
6056
|
+
return new fs();
|
5872
6057
|
}
|
5873
6058
|
/**
|
5874
6059
|
* 创建保存工具
|
5875
6060
|
*/
|
5876
6061
|
save() {
|
5877
|
-
return new
|
6062
|
+
return new Ce();
|
5878
6063
|
}
|
5879
6064
|
}
|
5880
|
-
class
|
6065
|
+
class Ul extends D {
|
5881
6066
|
constructor() {
|
5882
6067
|
super(...arguments);
|
5883
6068
|
n(this, "type", "Video");
|
@@ -5886,12 +6071,12 @@ class $l extends D {
|
|
5886
6071
|
super.open();
|
5887
6072
|
}
|
5888
6073
|
}
|
5889
|
-
class
|
6074
|
+
class it {
|
5890
6075
|
constructor() {
|
5891
6076
|
n(this, "type");
|
5892
6077
|
}
|
5893
6078
|
}
|
5894
|
-
class
|
6079
|
+
class vs extends it {
|
5895
6080
|
constructor() {
|
5896
6081
|
super(...arguments);
|
5897
6082
|
n(this, "type", "Tencent");
|
@@ -5912,7 +6097,7 @@ class ps extends nt {
|
|
5912
6097
|
startRecord() {
|
5913
6098
|
}
|
5914
6099
|
}
|
5915
|
-
class
|
6100
|
+
class bs extends it {
|
5916
6101
|
constructor() {
|
5917
6102
|
super(...arguments);
|
5918
6103
|
n(this, "type", "Default");
|
@@ -5926,26 +6111,26 @@ class hs extends nt {
|
|
5926
6111
|
return "";
|
5927
6112
|
}
|
5928
6113
|
}
|
5929
|
-
class
|
6114
|
+
class Ll extends D {
|
5930
6115
|
constructor() {
|
5931
6116
|
super(...arguments);
|
5932
6117
|
n(this, "type", "Voice");
|
5933
6118
|
}
|
5934
6119
|
open() {
|
5935
6120
|
super.open(), super.register({
|
5936
|
-
Default:
|
5937
|
-
Tencent:
|
6121
|
+
Default: bs,
|
6122
|
+
Tencent: vs
|
5938
6123
|
});
|
5939
6124
|
}
|
5940
6125
|
}
|
5941
|
-
let
|
6126
|
+
let ws = {}, re = {}, _ = {}, Be = {}, at = {}, De = {}, ks = {}, le = {}, xs = async (u) => {
|
5942
6127
|
let e = await (await y.provider.getDefaultAsync("sys")).getAsync("sys", "app");
|
5943
|
-
(e == null ? void 0 : e.cdn) != null && (
|
6128
|
+
(e == null ? void 0 : e.cdn) != null && (u.cdn = e.cdn), re = await y.cdn.createWithCacheAsync(u.cdn), ws = await y.encoder.getBase64(), _ = y.http.halo, De = y.socket.default, Be = await y.i18n.createWithCacheAsync("Default", async (t) => {
|
5944
6129
|
let r = (e == null ? void 0 : e.language) ?? d.browser.getLanguage(), s = d.json.serialize({ lang: r });
|
5945
|
-
await t.openAsync(s),
|
5946
|
-
}),
|
5947
|
-
},
|
5948
|
-
class
|
6130
|
+
await t.openAsync(s), pe = t.t, As = t.t_exists, Ss = t.t_sys, _s = t.t_enum, Cs = t.t_field, Ts = t.t_field_choose_placeholder, Es = t.t_field_placeholder, js = t.t_table, $s = t.t_module, Ds = t.t_menu;
|
6131
|
+
}), Be.addMessages(u.lang), at = await y.hasher.getMd5Async(), ks = y.template.create("Liquid"), u.messenger == null ? le = await y.messenger.getConsole() : le = u.messenger;
|
6132
|
+
}, pe = {}, As = {}, Ss = {}, _s = {}, Cs = {}, Ts = {}, Es = {}, js = {}, $s = {}, Ds = {};
|
6133
|
+
class Hs {
|
5949
6134
|
constructor() {
|
5950
6135
|
/**
|
5951
6136
|
* 消息发送对象
|
@@ -5969,65 +6154,65 @@ class Cs {
|
|
5969
6154
|
n(this, "cdn", "Local");
|
5970
6155
|
}
|
5971
6156
|
}
|
5972
|
-
const
|
6157
|
+
const Os = { class: "ha-empty" }, Us = { class: "empty-message" }, Ls = {
|
5973
6158
|
key: 0,
|
5974
6159
|
class: "empty-content"
|
5975
|
-
},
|
6160
|
+
}, Rl = /* @__PURE__ */ P({
|
5976
6161
|
__name: "Empty",
|
5977
6162
|
props: {
|
5978
6163
|
message: { type: String, default: "暂无数据" },
|
5979
6164
|
hasData: Boolean
|
5980
6165
|
},
|
5981
|
-
setup(
|
5982
|
-
let i =
|
5983
|
-
return (r, s) => (
|
5984
|
-
|
5985
|
-
f(t) ? (
|
5986
|
-
|
5987
|
-
])) :
|
6166
|
+
setup(u) {
|
6167
|
+
let i = u, { message: e, hasData: t } = W(i);
|
6168
|
+
return (r, s) => (S(), C("div", Os, [
|
6169
|
+
T("div", Us, N(f(e)), 1),
|
6170
|
+
f(t) ? (S(), C("div", Ls, [
|
6171
|
+
X(r.$slots, "default")
|
6172
|
+
])) : de("", !0)
|
5988
6173
|
]));
|
5989
6174
|
}
|
5990
|
-
}),
|
6175
|
+
}), Rs = /* @__PURE__ */ P({
|
5991
6176
|
__name: "Fill",
|
5992
6177
|
emits: ["resize"],
|
5993
|
-
setup(
|
5994
|
-
let e = i, t =
|
6178
|
+
setup(u, { emit: i }) {
|
6179
|
+
let e = i, t = O(), r = O(), s = O(), l = new $e(), a = () => {
|
5995
6180
|
let p = d.dom.siblings(t.value);
|
5996
6181
|
s.value = d.dom.getHeight(p);
|
5997
6182
|
}, o = () => {
|
5998
6183
|
r.value = d.dom.getHeight(t.value), e("resize", r.value);
|
5999
|
-
},
|
6184
|
+
}, c = () => {
|
6000
6185
|
o();
|
6001
6186
|
};
|
6002
|
-
return
|
6003
|
-
a(), o(), l.resize(t.value,
|
6004
|
-
}),
|
6187
|
+
return oe(() => {
|
6188
|
+
a(), o(), l.resize(t.value, c);
|
6189
|
+
}), ue(() => {
|
6005
6190
|
l.dispose();
|
6006
|
-
}), (p, h) => (
|
6191
|
+
}), (p, h) => (S(), C("div", {
|
6007
6192
|
class: "ha-fill",
|
6008
6193
|
ref_key: "fillRef",
|
6009
6194
|
ref: t,
|
6010
|
-
style:
|
6195
|
+
style: te({ height: `calc(100% - ${f(s)}px)` })
|
6011
6196
|
}, [
|
6012
|
-
|
6197
|
+
X(p.$slots, "default")
|
6013
6198
|
], 4));
|
6014
6199
|
}
|
6015
|
-
}),
|
6200
|
+
}), Is = /* @__PURE__ */ P({
|
6016
6201
|
__name: "Scroller",
|
6017
6202
|
props: {
|
6018
6203
|
options: {}
|
6019
6204
|
},
|
6020
6205
|
emits: ["scroll"],
|
6021
|
-
setup(
|
6022
|
-
let t = e, r =
|
6206
|
+
setup(u, { expose: i, emit: e }) {
|
6207
|
+
let t = e, r = u, { options: s } = W(r), l = O(), a = O(), o = O(), c = O(), p = O(!1), h = null, g = null, m = new $e(), k = O({ top: null, height: null }), H = (b) => {
|
6023
6208
|
if (g == 0)
|
6024
6209
|
return 0;
|
6025
6210
|
let w = g - h;
|
6026
6211
|
return b / w;
|
6027
|
-
},
|
6212
|
+
}, M = (b) => {
|
6028
6213
|
let w = h - k.value.height;
|
6029
6214
|
return b / w;
|
6030
|
-
},
|
6215
|
+
}, K = () => {
|
6031
6216
|
if (g == 0)
|
6032
6217
|
return 80;
|
6033
6218
|
let b = h / g;
|
@@ -6035,111 +6220,111 @@ const Ts = { class: "ha-empty" }, Es = { class: "empty-message" }, $s = {
|
|
6035
6220
|
return 0;
|
6036
6221
|
let w = h * b;
|
6037
6222
|
return d.math.between(w, 80, 500);
|
6038
|
-
},
|
6039
|
-
let E =
|
6040
|
-
return d.math.between(
|
6041
|
-
},
|
6042
|
-
let w =
|
6043
|
-
return { top:
|
6223
|
+
}, J = (b, w) => {
|
6224
|
+
let E = H(b), V = (h - w) * E;
|
6225
|
+
return d.math.between(V, 0, h - w);
|
6226
|
+
}, j = (b) => {
|
6227
|
+
let w = K();
|
6228
|
+
return { top: J(b, w), height: w };
|
6044
6229
|
}, F = (b) => {
|
6045
6230
|
}, A = (b) => {
|
6046
|
-
let w =
|
6231
|
+
let w = H(b);
|
6047
6232
|
R(w);
|
6048
6233
|
}, R = (b) => {
|
6049
6234
|
let w = d.math.between(b, 0, 1), E = h - k.value.height;
|
6050
6235
|
k.value.top = E * w;
|
6051
|
-
let
|
6052
|
-
s.value.scrollTop =
|
6053
|
-
},
|
6054
|
-
let w = b.target, E =
|
6236
|
+
let z = (g - h) * w;
|
6237
|
+
s.value.scrollTop = z, a.value.scrollTop != z && (a.value.scrollTop = z);
|
6238
|
+
}, Q = (b) => {
|
6239
|
+
let w = b.target, E = H(w.scrollTop);
|
6055
6240
|
R(E), t("scroll", w);
|
6056
6241
|
}, v = () => {
|
6057
6242
|
let b = s.value.scrollTop;
|
6058
|
-
k.value =
|
6243
|
+
k.value = j(b), A(b);
|
6059
6244
|
}, x = (b) => {
|
6060
6245
|
h = d.dom.getHeight(a.value), g = a.value.scrollHeight;
|
6061
|
-
let w =
|
6062
|
-
k.value.height = w, k.value.top =
|
6063
|
-
},
|
6246
|
+
let w = K();
|
6247
|
+
k.value.height = w, k.value.top = J(s.value.scrollTop, w);
|
6248
|
+
}, $ = (b) => {
|
6064
6249
|
let w = b.target;
|
6065
6250
|
return parseInt(w.style.top);
|
6066
|
-
},
|
6067
|
-
let
|
6068
|
-
R(
|
6251
|
+
}, B = (b, w, E, V) => {
|
6252
|
+
let z = b.y - w.y, ge = E + z, Z = M(ge);
|
6253
|
+
R(Z);
|
6069
6254
|
}, I = (b) => {
|
6070
6255
|
p.value = !0;
|
6071
6256
|
}, L = (b) => {
|
6072
6257
|
p.value = !1;
|
6073
6258
|
};
|
6074
|
-
return
|
6075
|
-
v(), m.scroll(a.value,
|
6076
|
-
}),
|
6259
|
+
return oe(() => {
|
6260
|
+
v(), m.scroll(a.value, Q), m.drag(c.value, { init: $, handler: B }), m.observe(a.value, x), m.mouseDown(c.value, I, L);
|
6261
|
+
}), ue(() => {
|
6077
6262
|
m.dispose();
|
6078
|
-
}),
|
6079
|
-
let E =
|
6263
|
+
}), q(() => s.value.scrollTop, (b, w) => {
|
6264
|
+
let E = H(b);
|
6080
6265
|
R(E);
|
6081
|
-
}), i({ scrollTo: A, update: v }), (b, w) => (
|
6266
|
+
}), i({ scrollTo: A, update: v }), (b, w) => (S(), C("div", {
|
6082
6267
|
ref_key: "scrollerRef",
|
6083
6268
|
ref: l,
|
6084
6269
|
class: ce(["ha-scroller", { hover: f(p) }])
|
6085
6270
|
}, [
|
6086
|
-
|
6271
|
+
T("div", {
|
6087
6272
|
ref_key: "containerRef",
|
6088
6273
|
ref: a,
|
6089
6274
|
class: "scroller-container"
|
6090
6275
|
}, [
|
6091
|
-
|
6276
|
+
X(b.$slots, "default")
|
6092
6277
|
], 512),
|
6093
|
-
|
6278
|
+
T("div", {
|
6094
6279
|
ref_key: "trackRef",
|
6095
6280
|
ref: o,
|
6096
6281
|
class: "scroller-track",
|
6097
6282
|
onClick: w[0] || (w[0] = //@ts-ignore
|
6098
6283
|
(...E) => f(F) && f(F)(...E))
|
6099
6284
|
}, [
|
6100
|
-
|
6285
|
+
T("div", {
|
6101
6286
|
ref_key: "thumbRef",
|
6102
|
-
ref:
|
6287
|
+
ref: c,
|
6103
6288
|
class: "scroller-thumb",
|
6104
|
-
style:
|
6289
|
+
style: te({ top: `${f(k).top}px`, height: `${f(k).height}px` })
|
6105
6290
|
}, N(f(s).scrollTop), 5)
|
6106
6291
|
], 512)
|
6107
6292
|
], 2));
|
6108
6293
|
}
|
6109
|
-
}),
|
6294
|
+
}), Il = /* @__PURE__ */ P({
|
6110
6295
|
__name: "Timer",
|
6111
6296
|
emits: ["change"],
|
6112
|
-
setup(
|
6113
|
-
let t = e, r = -8 * 60 * 60 * 1e3, s =
|
6297
|
+
setup(u, { expose: i, emit: e }) {
|
6298
|
+
let t = e, r = -8 * 60 * 60 * 1e3, s = O(r), l = null, a = 5, o = () => {
|
6114
6299
|
l == null && (l = setInterval(() => {
|
6115
6300
|
s.value += a, t("change", s.value);
|
6116
6301
|
}, a));
|
6117
|
-
},
|
6302
|
+
}, c = () => {
|
6118
6303
|
h(), o();
|
6119
6304
|
}, p = () => {
|
6120
6305
|
clearInterval(l), l = null;
|
6121
6306
|
}, h = () => {
|
6122
6307
|
clearInterval(l), s.value = r;
|
6123
6308
|
};
|
6124
|
-
return
|
6309
|
+
return ue(() => {
|
6125
6310
|
clearInterval(l);
|
6126
|
-
}), i({ restart:
|
6127
|
-
|
6128
|
-
|
6311
|
+
}), i({ restart: c, start: o, stop: p, reset: h }), (g, m) => (S(), C("span", null, [
|
6312
|
+
X(g.$slots, "default"),
|
6313
|
+
me(N(f(d).time.format(f(s), "HH:mm:ss SSS")), 1)
|
6129
6314
|
]));
|
6130
6315
|
}
|
6131
|
-
}),
|
6132
|
-
const e =
|
6316
|
+
}), he = (u, i) => {
|
6317
|
+
const e = u.__vccOpts || u;
|
6133
6318
|
for (const [t, r] of i)
|
6134
6319
|
e[t] = r;
|
6135
6320
|
return e;
|
6136
|
-
},
|
6137
|
-
function
|
6138
|
-
return
|
6139
|
-
|
6321
|
+
}, Ms = {}, Bs = { class: "ha-card" };
|
6322
|
+
function Ps(u, i) {
|
6323
|
+
return S(), C("div", Bs, [
|
6324
|
+
X(u.$slots, "default")
|
6140
6325
|
]);
|
6141
6326
|
}
|
6142
|
-
const Pe = /* @__PURE__ */
|
6327
|
+
const Pe = /* @__PURE__ */ he(Ms, [["render", Ps]]), Ml = /* @__PURE__ */ P({
|
6143
6328
|
__name: "Code",
|
6144
6329
|
props: {
|
6145
6330
|
options: { default: {} },
|
@@ -6147,108 +6332,108 @@ const Pe = /* @__PURE__ */ de(Hs, [["render", Us]]), Ol = /* @__PURE__ */ P({
|
|
6147
6332
|
modelValue: {}
|
6148
6333
|
},
|
6149
6334
|
emits: ["mounted", "change", "scroll", "update:modelValue"],
|
6150
|
-
setup(
|
6151
|
-
let t = e, r =
|
6335
|
+
setup(u, { expose: i, emit: e }) {
|
6336
|
+
let t = e, r = u, { options: s, border: l, modelValue: a } = W(r), o = null, c = null, p = null, h = { completion: null, hover: null }, g = O(), { app: m } = ee.sys, k = (v, x) => {
|
6152
6337
|
h.completion != null && h.completion.dispose();
|
6153
|
-
let
|
6154
|
-
h.completion =
|
6155
|
-
},
|
6156
|
-
provideCompletionItems: (
|
6157
|
-
let L =
|
6338
|
+
let $ = d.array.distinct(x, (B) => B);
|
6339
|
+
h.completion = H(v, $);
|
6340
|
+
}, H = (v, x) => v == null || o == null ? null : o.languages.registerCompletionItemProvider(v, {
|
6341
|
+
provideCompletionItems: (B, I) => {
|
6342
|
+
let L = B.getWordUntilPosition(I), b = new o.Range(I.lineNumber, L.startColumn, I.lineNumber, L.endColumn), w = [];
|
6158
6343
|
for (let E = 0; E < x.length; E++) {
|
6159
|
-
let
|
6160
|
-
label:
|
6344
|
+
let V = x[E], z = {
|
6345
|
+
label: V,
|
6161
6346
|
kind: o.languages.CompletionItemKind.Keyword,
|
6162
|
-
insertText:
|
6163
|
-
detail:
|
6347
|
+
insertText: V,
|
6348
|
+
detail: V,
|
6164
6349
|
range: b
|
6165
6350
|
};
|
6166
|
-
w.push(
|
6351
|
+
w.push(z);
|
6167
6352
|
}
|
6168
6353
|
return { suggestions: w };
|
6169
6354
|
}
|
6170
|
-
}),
|
6171
|
-
let x =
|
6355
|
+
}), M = async (v) => {
|
6356
|
+
let x = ee.editor.intelli;
|
6172
6357
|
if (x[v] != null)
|
6173
6358
|
return;
|
6174
|
-
let
|
6175
|
-
if (
|
6359
|
+
let $ = o.languages.getLanguages().find((L) => L.id == v);
|
6360
|
+
if ($ == null)
|
6176
6361
|
return;
|
6177
|
-
let
|
6178
|
-
if (
|
6362
|
+
let B = $.loader;
|
6363
|
+
if (B == null)
|
6179
6364
|
return;
|
6180
|
-
let I = await
|
6181
|
-
x[v] || (
|
6182
|
-
},
|
6183
|
-
const
|
6365
|
+
let I = await B();
|
6366
|
+
x[v] || (K(v, I), J(v, I), x[v] = !0);
|
6367
|
+
}, K = (v, x) => {
|
6368
|
+
const $ = ["builtinFunctions", "keywords", "operators"];
|
6184
6369
|
return o.languages.registerCompletionItemProvider(v, {
|
6185
6370
|
provideCompletionItems: (I, L) => {
|
6186
6371
|
let b = I.getWordUntilPosition(L), w = new o.Range(L.lineNumber, b.startColumn, L.lineNumber, b.endColumn), E = [];
|
6187
|
-
for (let
|
6188
|
-
let
|
6189
|
-
if (
|
6372
|
+
for (let V of $) {
|
6373
|
+
let z = x.language[V];
|
6374
|
+
if (z == null)
|
6190
6375
|
continue;
|
6191
|
-
let
|
6192
|
-
|
6193
|
-
for (let
|
6194
|
-
let
|
6195
|
-
label:
|
6196
|
-
documentation:
|
6376
|
+
let ge = j(V), Z, fe;
|
6377
|
+
V == "keywords" ? (Z = o.languages.CompletionItemKind.Keyword, fe = " ") : V == "operators" ? (Z = o.languages.CompletionItemKind.Operator, fe = " ") : (Z = o.languages.CompletionItemKind.Function, fe = "()");
|
6378
|
+
for (let He of z) {
|
6379
|
+
let Oe = He.toLowerCase(), ot = {
|
6380
|
+
label: Oe,
|
6381
|
+
documentation: He,
|
6197
6382
|
range: w,
|
6198
|
-
kind:
|
6199
|
-
insertText:
|
6200
|
-
detail:
|
6383
|
+
kind: Z,
|
6384
|
+
insertText: Oe + fe,
|
6385
|
+
detail: ge
|
6201
6386
|
};
|
6202
|
-
E.push(
|
6387
|
+
E.push(ot);
|
6203
6388
|
}
|
6204
6389
|
}
|
6205
6390
|
return { suggestions: E };
|
6206
6391
|
}
|
6207
6392
|
});
|
6208
|
-
},
|
6209
|
-
const
|
6393
|
+
}, J = (v, x) => {
|
6394
|
+
const $ = ["builtinFunctions", "keywords", "operators"];
|
6210
6395
|
return o.languages.registerHoverProvider(v, {
|
6211
6396
|
provideHover: (I, L) => {
|
6212
6397
|
let b = I.getWordAtPosition(L);
|
6213
6398
|
if (!b)
|
6214
6399
|
return null;
|
6215
|
-
for (let w of
|
6400
|
+
for (let w of $) {
|
6216
6401
|
let E = x.language[w];
|
6217
|
-
if (E == null || E.find((
|
6402
|
+
if (E == null || E.find((Z) => Z == b.word.toUpperCase()) == null)
|
6218
6403
|
continue;
|
6219
|
-
let
|
6404
|
+
let z = j(w);
|
6220
6405
|
return {
|
6221
6406
|
range: new o.Range(L.lineNumber, L.lineNumber, b.startColumn, b.endColumn),
|
6222
6407
|
contents: [
|
6223
6408
|
{ value: "**" + b.word + "**" },
|
6224
|
-
{ value:
|
6409
|
+
{ value: z }
|
6225
6410
|
]
|
6226
6411
|
};
|
6227
6412
|
}
|
6228
6413
|
return null;
|
6229
6414
|
}
|
6230
6415
|
});
|
6231
|
-
},
|
6416
|
+
}, j = (v) => {
|
6232
6417
|
let x;
|
6233
6418
|
return v == "keywords" ? x = "关键词" : v == "operators" ? x = "操作符" : x = "函数", x;
|
6234
6419
|
}, F = (v) => v == "default" ? null : "vs-dark", A = async () => {
|
6235
6420
|
if (g.value == null)
|
6236
6421
|
return;
|
6237
6422
|
let v = null;
|
6238
|
-
s.value.schema && (v = s.value.category + "/" + d.string.getUniqueId(),
|
6423
|
+
s.value.schema && (v = s.value.category + "/" + d.string.getUniqueId(), ee.tryAddSchema(v, s.value.category, s.value.schema));
|
6239
6424
|
let x = {
|
6240
6425
|
validate: !0,
|
6241
6426
|
allowComments: !0,
|
6242
6427
|
//允许配置注释
|
6243
6428
|
//保证架构配置在当前控件生效,所以需要绑定匹配哪个文件时使用架构
|
6244
|
-
schemas: d.object.clone(
|
6429
|
+
schemas: d.object.clone(ee.editor.schemas),
|
6245
6430
|
trailingCommas: "ignore"
|
6246
6431
|
//允许末尾逗号
|
6247
6432
|
};
|
6248
|
-
o.languages.json.jsonDefaults.setDiagnosticsOptions(x), await
|
6249
|
-
let
|
6250
|
-
p = o.editor.createModel(a.value, s.value.language,
|
6251
|
-
let
|
6433
|
+
o.languages.json.jsonDefaults.setDiagnosticsOptions(x), await M(s.value.language);
|
6434
|
+
let $ = v ? o.Uri.parse(v) : null;
|
6435
|
+
p = o.editor.createModel(a.value, s.value.language, $);
|
6436
|
+
let B = {
|
6252
6437
|
tabSize: 2,
|
6253
6438
|
//Tab缩进大小
|
6254
6439
|
detectIndentation: !1,
|
@@ -6264,7 +6449,7 @@ const Pe = /* @__PURE__ */ de(Hs, [["render", Us]]), Ol = /* @__PURE__ */ P({
|
|
6264
6449
|
//根据父元素自动布局
|
6265
6450
|
model: p
|
6266
6451
|
};
|
6267
|
-
|
6452
|
+
c = o.editor.create(g.value, B), s.value.scrollTop && c.setScrollTop(s.value.scrollTop);
|
6268
6453
|
let I = s.value.selection;
|
6269
6454
|
if (I) {
|
6270
6455
|
let L = {
|
@@ -6273,41 +6458,41 @@ const Pe = /* @__PURE__ */ de(Hs, [["render", Us]]), Ol = /* @__PURE__ */ P({
|
|
6273
6458
|
startColumn: I.startColumn,
|
6274
6459
|
endColumn: I.endColumn
|
6275
6460
|
};
|
6276
|
-
|
6461
|
+
c.setSelection(L);
|
6277
6462
|
}
|
6278
|
-
|
6463
|
+
c.onDidScrollChange((L) => {
|
6279
6464
|
s.value.scrollTop = L.scrollTop, t("scroll", L.scrollTop);
|
6280
|
-
}),
|
6281
|
-
let b =
|
6465
|
+
}), c.onDidChangeModelContent((L) => {
|
6466
|
+
let b = c.getValue();
|
6282
6467
|
t("update:modelValue", b), t("change", b);
|
6283
6468
|
});
|
6284
6469
|
};
|
6285
|
-
|
6286
|
-
o = await
|
6287
|
-
}),
|
6470
|
+
oe(async () => {
|
6471
|
+
o = await re.getMonaco(), await A(), t("mounted", o, c);
|
6472
|
+
}), ue(() => {
|
6288
6473
|
var v;
|
6289
|
-
p == null || p.dispose(),
|
6474
|
+
p == null || p.dispose(), c == null || c.dispose(), (v = h.completion) == null || v.dispose();
|
6290
6475
|
});
|
6291
6476
|
let R = () => {
|
6292
|
-
|
6293
|
-
},
|
6294
|
-
return
|
6295
|
-
let
|
6296
|
-
o.editor.setTheme(
|
6297
|
-
}),
|
6298
|
-
}),
|
6299
|
-
if (!
|
6477
|
+
c == null || c.layout();
|
6478
|
+
}, Q = () => c;
|
6479
|
+
return q(() => m.theme, (v, x) => {
|
6480
|
+
let $ = F(v);
|
6481
|
+
o.editor.setTheme($);
|
6482
|
+
}), q(() => m.language, (v, x) => {
|
6483
|
+
}), q(() => a.value, (v, x) => {
|
6484
|
+
if (!c)
|
6300
6485
|
return;
|
6301
|
-
let
|
6302
|
-
v !=
|
6303
|
-
}),
|
6304
|
-
if (!
|
6486
|
+
let $ = c.getValue();
|
6487
|
+
v != $ && c.setValue(v ?? "");
|
6488
|
+
}), q(() => s.value.language, async (v, x) => {
|
6489
|
+
if (!c)
|
6305
6490
|
return;
|
6306
|
-
let
|
6307
|
-
o.editor.setModelLanguage(
|
6308
|
-
}), i({ layout: R, getEditor:
|
6309
|
-
default:
|
6310
|
-
|
6491
|
+
let $ = c.getModel();
|
6492
|
+
o.editor.setModelLanguage($, v), await M(v);
|
6493
|
+
}), i({ layout: R, getEditor: Q, registerIntelli: k }), (v, x) => (S(), Ne(Rs, null, {
|
6494
|
+
default: se(() => [
|
6495
|
+
T("div", {
|
6311
6496
|
ref_key: "editorRef",
|
6312
6497
|
ref: g,
|
6313
6498
|
class: ce(["ha-code", { border: f(l) }])
|
@@ -6316,7 +6501,7 @@ const Pe = /* @__PURE__ */ de(Hs, [["render", Us]]), Ol = /* @__PURE__ */ P({
|
|
6316
6501
|
_: 1
|
6317
6502
|
}));
|
6318
6503
|
}
|
6319
|
-
}),
|
6504
|
+
}), Bl = /* @__PURE__ */ P({
|
6320
6505
|
__name: "Compare",
|
6321
6506
|
props: {
|
6322
6507
|
inline: { type: Boolean, default: !1 },
|
@@ -6325,15 +6510,15 @@ const Pe = /* @__PURE__ */ de(Hs, [["render", Us]]), Ol = /* @__PURE__ */ P({
|
|
6325
6510
|
modelValue: { type: String }
|
6326
6511
|
},
|
6327
6512
|
emits: ["update:modelValue", "update:original", "change"],
|
6328
|
-
setup(
|
6329
|
-
let e = i, t =
|
6330
|
-
|
6513
|
+
setup(u, { emit: i }) {
|
6514
|
+
let e = i, t = u, { inline: r, language: s, original: l, modelValue: a } = W(t), o = null, c = null, p = null, h = null, g = null, m = null, k = O(), H = O(), { app: M } = ee.sys, K = (j) => j == "default" ? null : "vs-dark", J = (j) => {
|
6515
|
+
c = j.editor.createModel(l.value, s.value), p = j.editor.createModel(a.value, s.value), o = j.editor.createDiffEditor(k.value, {
|
6331
6516
|
originalEditable: !0,
|
6332
6517
|
automaticLayout: !0,
|
6333
6518
|
renderSideBySide: !r.value,
|
6334
6519
|
//是否启用行内模式
|
6335
|
-
theme:
|
6336
|
-
}), o.setModel({ original:
|
6520
|
+
theme: K(M.theme)
|
6521
|
+
}), o.setModel({ original: c, modified: p }), h = o.getOriginalEditor(), h.onDidChangeModelContent((F) => {
|
6337
6522
|
let A = h.getValue();
|
6338
6523
|
e("update:original", A), e("change", A);
|
6339
6524
|
}), g = o.getModifiedEditor(), g.onDidChangeModelContent((F) => {
|
@@ -6341,113 +6526,113 @@ const Pe = /* @__PURE__ */ de(Hs, [["render", Us]]), Ol = /* @__PURE__ */ P({
|
|
6341
6526
|
e("update:modelValue", A);
|
6342
6527
|
});
|
6343
6528
|
};
|
6344
|
-
return
|
6345
|
-
m = await
|
6346
|
-
}),
|
6347
|
-
let A =
|
6529
|
+
return oe(async () => {
|
6530
|
+
m = await re.getMonaco(), J(m);
|
6531
|
+
}), q(() => M.theme, (j, F) => {
|
6532
|
+
let A = K(j);
|
6348
6533
|
m.editor.setTheme(A);
|
6349
|
-
}),
|
6350
|
-
|
6351
|
-
}),
|
6352
|
-
if (!
|
6534
|
+
}), q(() => s.value, (j, F) => {
|
6535
|
+
c && m.editor.setModelLanguage(c, j), p && m.editor.setModelLanguage(p, j);
|
6536
|
+
}), q(() => l.value, (j, F) => {
|
6537
|
+
if (!c)
|
6353
6538
|
return;
|
6354
|
-
let A =
|
6355
|
-
|
6356
|
-
}),
|
6539
|
+
let A = c.getValue();
|
6540
|
+
j != A && c.setValue(j ?? "");
|
6541
|
+
}), q(() => a.value, (j, F) => {
|
6357
6542
|
if (!p)
|
6358
6543
|
return;
|
6359
6544
|
let A = p.getValue();
|
6360
|
-
|
6361
|
-
}), (
|
6545
|
+
j != A && p.setValue(j ?? "");
|
6546
|
+
}), (j, F) => (S(), C("div", {
|
6362
6547
|
ref_key: "compareRef",
|
6363
6548
|
ref: k,
|
6364
6549
|
class: "ha-compare",
|
6365
|
-
style:
|
6550
|
+
style: te(f(H))
|
6366
6551
|
}, null, 4));
|
6367
6552
|
}
|
6368
|
-
}),
|
6369
|
-
function
|
6370
|
-
return
|
6371
|
-
|
6553
|
+
}), Fs = {}, Ns = { class: "ha-input" };
|
6554
|
+
function Vs(u, i) {
|
6555
|
+
return S(), C("div", Ns, i[0] || (i[0] = [
|
6556
|
+
T("input", { type: "text" }, null, -1)
|
6372
6557
|
]));
|
6373
6558
|
}
|
6374
|
-
const
|
6375
|
-
function
|
6376
|
-
return
|
6559
|
+
const Pl = /* @__PURE__ */ he(Fs, [["render", Vs]]), Ws = {}, zs = { class: "ha-option" };
|
6560
|
+
function qs(u, i) {
|
6561
|
+
return S(), C("div", zs, "选项");
|
6377
6562
|
}
|
6378
|
-
const
|
6563
|
+
const Ks = /* @__PURE__ */ he(Ws, [["render", qs]]), Js = { class: "ha-rich-text" }, Fl = /* @__PURE__ */ P({
|
6379
6564
|
__name: "RichText",
|
6380
|
-
props: /* @__PURE__ */
|
6565
|
+
props: /* @__PURE__ */ Ue({
|
6381
6566
|
options: {}
|
6382
6567
|
}, {
|
6383
6568
|
modelValue: {},
|
6384
6569
|
modelModifiers: {}
|
6385
6570
|
}),
|
6386
|
-
emits: /* @__PURE__ */
|
6387
|
-
setup(
|
6388
|
-
let t = e, r =
|
6389
|
-
let R = d.time.getDateString(),
|
6571
|
+
emits: /* @__PURE__ */ Ue(["change", "scroll"], ["update:modelValue"]),
|
6572
|
+
setup(u, { expose: i, emit: e }) {
|
6573
|
+
let t = e, r = u, { options: s } = W(r), l = Ve(u, "modelValue"), a, o = null, c = null, p = !1, h = !1, g = O(), m = O(), k = O(), H = O(!1), M = O({ style: null, options: { scrollTop: 0 } }), K = (A) => {
|
6574
|
+
let R = d.time.getDateString(), Q = getSelection(), v = Q.getRangeAt(0), x = v.startContainer;
|
6390
6575
|
if (x.nodeName == "#text")
|
6391
|
-
x.insertData(v.startOffset, R), v.setStart(x, v.startOffset + R.length),
|
6576
|
+
x.insertData(v.startOffset, R), v.setStart(x, v.startOffset + R.length), Q.removeAllRanges(), Q.addRange(v);
|
6392
6577
|
else {
|
6393
|
-
let
|
6394
|
-
x.appendChild(
|
6395
|
-
let
|
6396
|
-
|
6578
|
+
let $ = document.createTextNode(R);
|
6579
|
+
x.appendChild($);
|
6580
|
+
let B = document.createRange();
|
6581
|
+
B.selectNodeContents($), B.setStart($, B.startOffset + R.length), Q.removeAllRanges(), Q.addRange(B);
|
6397
6582
|
}
|
6398
|
-
},
|
6583
|
+
}, J = (A) => {
|
6399
6584
|
if (o.scrollTop = A.scrollTop, p || h) {
|
6400
6585
|
p = !1, h = !1;
|
6401
6586
|
return;
|
6402
6587
|
}
|
6403
|
-
|
6404
|
-
},
|
6405
|
-
let A = await
|
6588
|
+
c = A, t("scroll", A);
|
6589
|
+
}, j = () => `height: calc(100% - ${d.dom.getHeight(m.value)}px)`, F = async () => {
|
6590
|
+
let A = await re.getQuill();
|
6406
6591
|
a = new A(g.value, {
|
6407
6592
|
modules: {
|
6408
6593
|
toolbar: {
|
6409
6594
|
container: m.value,
|
6410
|
-
handlers: { date:
|
6595
|
+
handlers: { date: K }
|
6411
6596
|
}
|
6412
6597
|
},
|
6413
6598
|
theme: "snow"
|
6414
|
-
}),
|
6415
|
-
|
6416
|
-
}), s.value.readonly && a.disable(), o = g.value.querySelector(".ql-editor"), o.innerHTML = l.value,
|
6599
|
+
}), H.value = !0, Le(() => {
|
6600
|
+
M.value.style = j();
|
6601
|
+
}), s.value.readonly && a.disable(), o = g.value.querySelector(".ql-editor"), o.innerHTML = l.value, M.value.options.scrollTop = s.value.scrollTop, a.on("text-change", (R, Q, v) => {
|
6417
6602
|
o.innerHTML != l.value && (p = !0, l.value = o.innerHTML);
|
6418
6603
|
}), o.addEventListener("paste", (R) => {
|
6419
6604
|
h = !0;
|
6420
6605
|
});
|
6421
6606
|
};
|
6422
|
-
return
|
6607
|
+
return oe(() => {
|
6423
6608
|
F();
|
6424
|
-
}),
|
6609
|
+
}), ue(() => {
|
6425
6610
|
a = null;
|
6426
|
-
}),
|
6611
|
+
}), q(() => l.value, (A, R) => {
|
6427
6612
|
o && o.innerHTML != A && (o.innerHTML = A);
|
6428
|
-
}),
|
6429
|
-
A != null && (
|
6430
|
-
|
6613
|
+
}), q(() => s.value.scrollTop, (A, R) => {
|
6614
|
+
A != null && (c == null ? void 0 : c.scrollTop) != A && Le(() => {
|
6615
|
+
M.value.options.scrollTop = A;
|
6431
6616
|
});
|
6432
|
-
}), i({}), (A, R) => (
|
6433
|
-
|
6617
|
+
}), i({}), (A, R) => (S(), C("div", Js, [
|
6618
|
+
pt(T("div", {
|
6434
6619
|
ref_key: "toolbarRef",
|
6435
6620
|
ref: m
|
6436
6621
|
}, R[0] || (R[0] = [
|
6437
|
-
|
6622
|
+
ht('<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)
|
6438
6623
|
]), 512), [
|
6439
|
-
[
|
6624
|
+
[gt, f(H)]
|
6440
6625
|
]),
|
6441
|
-
|
6626
|
+
G(f(Is), {
|
6442
6627
|
ref_key: "scrollerRef",
|
6443
6628
|
ref: k,
|
6444
6629
|
class: "ql-body",
|
6445
|
-
options: f(
|
6446
|
-
onScroll: f(
|
6447
|
-
style:
|
6630
|
+
options: f(M).options,
|
6631
|
+
onScroll: f(J),
|
6632
|
+
style: te(f(M).style)
|
6448
6633
|
}, {
|
6449
|
-
default:
|
6450
|
-
|
6634
|
+
default: se(() => [
|
6635
|
+
T("div", {
|
6451
6636
|
ref_key: "editorRef",
|
6452
6637
|
ref: g
|
6453
6638
|
}, null, 512)
|
@@ -6456,17 +6641,17 @@ const Fs = /* @__PURE__ */ de(Ms, [["render", Bs]]), Ns = { class: "ha-rich-text
|
|
6456
6641
|
}, 8, ["options", "onScroll", "style"])
|
6457
6642
|
]));
|
6458
6643
|
}
|
6459
|
-
}),
|
6460
|
-
function
|
6461
|
-
return
|
6462
|
-
|
6463
|
-
|
6464
|
-
|
6644
|
+
}), Ys = {}, Qs = { class: "ha-select" };
|
6645
|
+
function Xs(u, i) {
|
6646
|
+
return S(), C("div", Qs, i[0] || (i[0] = [
|
6647
|
+
T("div", { class: "select-title" }, "头", -1),
|
6648
|
+
T("div", { class: "select-body" }, [
|
6649
|
+
T("input", { type: "text" })
|
6465
6650
|
], -1)
|
6466
6651
|
]));
|
6467
6652
|
}
|
6468
|
-
const
|
6469
|
-
class
|
6653
|
+
const xe = /* @__PURE__ */ he(Ys, [["render", Xs]]);
|
6654
|
+
class Nl {
|
6470
6655
|
/**
|
6471
6656
|
* 初始化
|
6472
6657
|
*/
|
@@ -6490,98 +6675,98 @@ class Il {
|
|
6490
6675
|
this.startLine = i, this.endLine = e, this.startColumn = t, this.endColumn = r;
|
6491
6676
|
}
|
6492
6677
|
}
|
6493
|
-
const
|
6678
|
+
const Gs = { class: "ha-condition" }, Zs = /* @__PURE__ */ P({
|
6494
6679
|
__name: "Condition",
|
6495
6680
|
props: {
|
6496
6681
|
name: {},
|
6497
6682
|
operator: {},
|
6498
6683
|
value: {}
|
6499
6684
|
},
|
6500
|
-
setup(
|
6501
|
-
let i =
|
6502
|
-
return (s, l) => (
|
6503
|
-
|
6685
|
+
setup(u) {
|
6686
|
+
let i = u, { name: e, operator: t, value: r } = W(i);
|
6687
|
+
return (s, l) => (S(), C("div", Gs, [
|
6688
|
+
G(f(xe), {
|
6504
6689
|
modelValue: f(e),
|
6505
|
-
"onUpdate:modelValue": l[0] || (l[0] = (a) =>
|
6690
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => we(e) ? e.value = a : e = a)
|
6506
6691
|
}, null, 8, ["modelValue"]),
|
6507
|
-
|
6692
|
+
G(f(xe), {
|
6508
6693
|
modelValue: f(t),
|
6509
|
-
"onUpdate:modelValue": l[1] || (l[1] = (a) =>
|
6694
|
+
"onUpdate:modelValue": l[1] || (l[1] = (a) => we(t) ? t.value = a : t = a)
|
6510
6695
|
}, {
|
6511
|
-
default:
|
6512
|
-
|
6696
|
+
default: se(() => [
|
6697
|
+
G(f(Ks))
|
6513
6698
|
]),
|
6514
6699
|
_: 1
|
6515
6700
|
}, 8, ["modelValue"]),
|
6516
|
-
|
6701
|
+
G(f(xe), {
|
6517
6702
|
modelValue: f(r),
|
6518
|
-
"onUpdate:modelValue": l[2] || (l[2] = (a) =>
|
6703
|
+
"onUpdate:modelValue": l[2] || (l[2] = (a) => we(r) ? r.value = a : r = a)
|
6519
6704
|
}, null, 8, ["modelValue"])
|
6520
6705
|
]));
|
6521
6706
|
}
|
6522
|
-
}),
|
6707
|
+
}), el = { class: "ha-condition-group" }, Vl = /* @__PURE__ */ P({
|
6523
6708
|
__name: "Index",
|
6524
6709
|
props: {
|
6525
6710
|
conditions: {}
|
6526
6711
|
},
|
6527
|
-
setup(
|
6528
|
-
let i =
|
6529
|
-
return (t, r) => (
|
6530
|
-
(
|
6712
|
+
setup(u) {
|
6713
|
+
let i = u, { conditions: e } = W(i);
|
6714
|
+
return (t, r) => (S(), C("div", el, [
|
6715
|
+
(S(!0), C(We, null, ze(f(e), (s) => (S(), Ne(f(Zs), {
|
6531
6716
|
name: s.name,
|
6532
6717
|
operator: s.operator,
|
6533
6718
|
value: s.value
|
6534
6719
|
}, null, 8, ["name", "operator", "value"]))), 256))
|
6535
6720
|
]));
|
6536
6721
|
}
|
6537
|
-
}),
|
6538
|
-
function
|
6539
|
-
return
|
6540
|
-
|
6722
|
+
}), tl = {}, rl = { class: "ha-col" };
|
6723
|
+
function sl(u, i) {
|
6724
|
+
return S(), C("div", rl, [
|
6725
|
+
X(u.$slots, "default")
|
6541
6726
|
]);
|
6542
6727
|
}
|
6543
|
-
const
|
6728
|
+
const Wl = /* @__PURE__ */ he(tl, [["render", sl]]), zl = /* @__PURE__ */ P({
|
6544
6729
|
__name: "Container",
|
6545
6730
|
props: {
|
6546
6731
|
container: { type: Boolean, default: !0 }
|
6547
6732
|
},
|
6548
|
-
setup(
|
6549
|
-
let i =
|
6550
|
-
return (t, r) => (
|
6733
|
+
setup(u) {
|
6734
|
+
let i = u, { container: e } = W(i);
|
6735
|
+
return (t, r) => (S(), C("div", {
|
6551
6736
|
class: ce({ "ha-container": f(e) })
|
6552
6737
|
}, [
|
6553
|
-
|
6738
|
+
X(t.$slots, "default")
|
6554
6739
|
], 2));
|
6555
6740
|
}
|
6556
|
-
}),
|
6741
|
+
}), ql = /* @__PURE__ */ P({
|
6557
6742
|
__name: "Row",
|
6558
6743
|
props: {
|
6559
6744
|
gap: {},
|
6560
6745
|
direction: {}
|
6561
6746
|
},
|
6562
|
-
setup(
|
6563
|
-
let e =
|
6747
|
+
setup(u, { expose: i }) {
|
6748
|
+
let e = u, { gap: t, direction: r } = W(e), s = O(), l = ye(() => {
|
6564
6749
|
let a = { gap: null };
|
6565
6750
|
return t.value && (a.gap = t.value + "px"), a;
|
6566
6751
|
});
|
6567
|
-
return i({ ref: s }), (a, o) => (
|
6752
|
+
return i({ ref: s }), (a, o) => (S(), C("div", {
|
6568
6753
|
ref_key: "rowRef",
|
6569
6754
|
ref: s,
|
6570
6755
|
class: ce(["ha-row", f(r)]),
|
6571
|
-
style:
|
6756
|
+
style: te(f(l))
|
6572
6757
|
}, [
|
6573
|
-
|
6758
|
+
X(a.$slots, "default")
|
6574
6759
|
], 6));
|
6575
6760
|
}
|
6576
|
-
}),
|
6761
|
+
}), Kl = /* @__PURE__ */ P({
|
6577
6762
|
__name: "Index",
|
6578
6763
|
props: {
|
6579
6764
|
modelValue: { type: Boolean },
|
6580
6765
|
modelModifiers: {}
|
6581
6766
|
},
|
6582
6767
|
emits: ["update:modelValue"],
|
6583
|
-
setup(
|
6584
|
-
let i =
|
6768
|
+
setup(u) {
|
6769
|
+
let i = Ve(u, "modelValue"), e = O(!0), t = O(0), r = null, s = () => {
|
6585
6770
|
t.value = 0, e.value = !0, r = setInterval(() => {
|
6586
6771
|
if (t.value < 100) {
|
6587
6772
|
t.value++;
|
@@ -6591,79 +6776,102 @@ const Pl = /* @__PURE__ */ de(Xs, [["render", Ys]]), Bl = /* @__PURE__ */ P({
|
|
6591
6776
|
}, 50);
|
6592
6777
|
}, l = () => {
|
6593
6778
|
clearInterval(r);
|
6594
|
-
let a = 100 - t.value, o = 200,
|
6779
|
+
let a = 100 - t.value, o = 200, c = 20, p = a / (o / c), h = setInterval(() => {
|
6595
6780
|
t.value += p, !(t.value < 100) && (t.value = 100, clearInterval(h), setTimeout(() => {
|
6596
6781
|
e.value = !1;
|
6597
6782
|
}, 200));
|
6598
|
-
},
|
6783
|
+
}, c);
|
6599
6784
|
};
|
6600
|
-
return
|
6785
|
+
return oe(() => {
|
6601
6786
|
i.value && s();
|
6602
|
-
}),
|
6787
|
+
}), ue(() => {
|
6603
6788
|
clearInterval(r);
|
6604
|
-
}),
|
6789
|
+
}), q(() => i.value, (a, o) => {
|
6605
6790
|
a ? s() : l();
|
6606
|
-
}), (a, o) => f(e) ? (
|
6791
|
+
}), (a, o) => f(e) ? (S(), C("div", {
|
6607
6792
|
key: 0,
|
6608
6793
|
class: "ha-progress",
|
6609
|
-
style:
|
6610
|
-
}, null, 4)) :
|
6794
|
+
style: te({ width: f(t) + "%" })
|
6795
|
+
}, null, 4)) : de("", !0);
|
6796
|
+
}
|
6797
|
+
}), Fe = /* @__PURE__ */ P({
|
6798
|
+
__name: "Index",
|
6799
|
+
props: {
|
6800
|
+
type: {}
|
6801
|
+
},
|
6802
|
+
setup(u) {
|
6803
|
+
let i = u, { type: e } = W(i);
|
6804
|
+
return (t, r) => (S(), C("div", {
|
6805
|
+
class: ce(["progress-tip", f(e)])
|
6806
|
+
}, [
|
6807
|
+
X(t.$slots, "default")
|
6808
|
+
], 2));
|
6611
6809
|
}
|
6612
|
-
}),
|
6810
|
+
}), ll = { class: "progress-bar" }, nl = { class: "progress-info" }, il = { key: 0 }, al = { key: 1 }, ol = { class: "progress-text" }, Jl = /* @__PURE__ */ P({
|
6613
6811
|
__name: "SocketProgress",
|
6614
6812
|
props: {
|
6615
6813
|
title: {},
|
6616
6814
|
current: {},
|
6617
6815
|
progress: {}
|
6618
6816
|
},
|
6619
|
-
setup(
|
6620
|
-
let i =
|
6621
|
-
return (o,
|
6817
|
+
setup(u) {
|
6818
|
+
let i = u, { title: e, current: t, progress: r } = W(i), s = ye(() => d.math.getPercentage(r.value.handled, r.value.total)), l = ye(() => `${r.value.handled ?? "-"}/${r.value.total ?? "-"}`), a = ye(() => d.math.getPercentageText(r.value.handled, r.value.total));
|
6819
|
+
return (o, c) => (S(), C("div", {
|
6622
6820
|
class: ce(["ha-socket-progress", {
|
6623
6821
|
error: f(r).errored > 0 && f(r).errored == f(r).handled,
|
6624
6822
|
warning: f(r).errored > 0 && f(r).errored < f(r).handled
|
6625
6823
|
}])
|
6626
6824
|
}, [
|
6627
|
-
|
6628
|
-
default:
|
6629
|
-
S("div", Gs, "成功:" + N(f(r).succeed ?? "-"), 1),
|
6630
|
-
S("div", Zs, "异常:" + N(f(r).errored ?? "-"), 1),
|
6631
|
-
Q(o.$slots, "default")
|
6632
|
-
]),
|
6633
|
-
_: 3
|
6634
|
-
}),
|
6635
|
-
te(f(Pe), { class: "progress-chart" }, {
|
6636
|
-
default: ue(() => {
|
6825
|
+
G(f(Pe), { class: "progress-chart" }, {
|
6826
|
+
default: se(() => {
|
6637
6827
|
var p;
|
6638
6828
|
return [
|
6639
|
-
|
6640
|
-
|
6829
|
+
T("div", ll, [
|
6830
|
+
T("div", {
|
6641
6831
|
class: "progress-percentage",
|
6642
|
-
style:
|
6832
|
+
style: te({ width: f(s) + "%" })
|
6643
6833
|
}, null, 4),
|
6644
|
-
|
6645
|
-
S("div",
|
6646
|
-
f(r).elapsed ? (
|
6647
|
-
|
6834
|
+
T("div", nl, [
|
6835
|
+
f(e) ? (S(), C("div", il, N(f(e)) + ":" + N(((p = f(r).current) == null ? void 0 : p[f(t)]) ?? "-"), 1)) : de("", !0),
|
6836
|
+
f(r).elapsed ? (S(), C("div", al, "耗时:" + N(f(d).math.round(f(r).elapsed / 1e3, 2)) + "s", 1)) : de("", !0),
|
6837
|
+
T("div", null, "进度:" + N(f(l)), 1)
|
6648
6838
|
])
|
6649
6839
|
]),
|
6650
|
-
|
6840
|
+
T("div", ol, N(f(a)) + "%", 1)
|
6651
6841
|
];
|
6652
6842
|
}),
|
6653
6843
|
_: 1
|
6844
|
+
}),
|
6845
|
+
G(f(Pe), { class: "progress-tips" }, {
|
6846
|
+
default: se(() => [
|
6847
|
+
G(f(Fe), { type: "success" }, {
|
6848
|
+
default: se(() => [
|
6849
|
+
me("成功 " + N(f(r).succeed ?? "-"), 1)
|
6850
|
+
]),
|
6851
|
+
_: 1
|
6852
|
+
}),
|
6853
|
+
G(f(Fe), { type: "error" }, {
|
6854
|
+
default: se(() => [
|
6855
|
+
me("异常 " + N(f(r).errored ?? "-"), 1)
|
6856
|
+
]),
|
6857
|
+
_: 1
|
6858
|
+
}),
|
6859
|
+
X(o.$slots, "default")
|
6860
|
+
]),
|
6861
|
+
_: 3
|
6654
6862
|
})
|
6655
6863
|
], 2));
|
6656
6864
|
}
|
6657
|
-
}),
|
6865
|
+
}), ul = {
|
6658
6866
|
key: 0,
|
6659
6867
|
class: "ha-spinner is-error"
|
6660
|
-
},
|
6868
|
+
}, cl = { class: "spinner-title" }, dl = {
|
6661
6869
|
key: 0,
|
6662
6870
|
class: "spinner-content"
|
6663
|
-
},
|
6871
|
+
}, pl = { class: "stack" }, hl = {
|
6664
6872
|
key: 1,
|
6665
6873
|
class: "ha-spinner is-loading"
|
6666
|
-
},
|
6874
|
+
}, gl = { class: "spinner-loading" }, fl = { class: "spinner-text" }, Yl = /* @__PURE__ */ P({
|
6667
6875
|
__name: "Spinner",
|
6668
6876
|
props: {
|
6669
6877
|
title: { type: String },
|
@@ -6672,193 +6880,196 @@ const Pl = /* @__PURE__ */ de(Xs, [["render", Ys]]), Bl = /* @__PURE__ */ P({
|
|
6672
6880
|
//错误消息
|
6673
6881
|
},
|
6674
6882
|
emits: ["retry"],
|
6675
|
-
setup(
|
6676
|
-
let e = i, t =
|
6883
|
+
setup(u, { emit: i }) {
|
6884
|
+
let e = i, t = u, { title: r, content: s } = W(t), l = () => {
|
6677
6885
|
e("retry");
|
6678
6886
|
};
|
6679
|
-
return (a, o) => f(r) || f(s) ? (
|
6680
|
-
|
6681
|
-
|
6682
|
-
|
6887
|
+
return (a, o) => f(r) || f(s) ? (S(), C("div", ul, [
|
6888
|
+
T("div", cl, [
|
6889
|
+
me(N(f(r)), 1),
|
6890
|
+
T("a", {
|
6683
6891
|
class: "retry",
|
6684
6892
|
onClick: o[0] || (o[0] = //@ts-ignore
|
6685
|
-
(...
|
6686
|
-
}, N(f(
|
6893
|
+
(...c) => f(l) && f(l)(...c))
|
6894
|
+
}, N(f(pe)("common.retry")), 1)
|
6687
6895
|
]),
|
6688
|
-
f(s) ? (
|
6689
|
-
|
6690
|
-
])) :
|
6691
|
-
])) : (
|
6692
|
-
|
6693
|
-
o[1] || (o[1] =
|
6694
|
-
|
6695
|
-
|
6696
|
-
|
6697
|
-
|
6896
|
+
f(s) ? (S(), C("div", dl, [
|
6897
|
+
T("div", pl, N(f(s)), 1)
|
6898
|
+
])) : de("", !0)
|
6899
|
+
])) : (S(), C("div", hl, [
|
6900
|
+
T("div", gl, [
|
6901
|
+
o[1] || (o[1] = T("div", { class: "spinner-dots" }, [
|
6902
|
+
T("i"),
|
6903
|
+
T("i"),
|
6904
|
+
T("i"),
|
6905
|
+
T("i")
|
6698
6906
|
], -1)),
|
6699
|
-
|
6907
|
+
T("div", fl, N(f(pe)("common.loading")) + "...", 1)
|
6700
6908
|
])
|
6701
6909
|
]));
|
6702
6910
|
}
|
6703
|
-
}),
|
6911
|
+
}), yl = { class: "ha-tab" }, Ql = /* @__PURE__ */ P({
|
6704
6912
|
__name: "Tab",
|
6705
6913
|
props: {
|
6706
6914
|
mode: {},
|
6707
6915
|
destroy: { type: Boolean }
|
6708
6916
|
},
|
6709
|
-
setup(
|
6710
|
-
return
|
6711
|
-
|
6712
|
-
|
6917
|
+
setup(u) {
|
6918
|
+
return W(u), (e, t) => (S(), C("div", yl, t[0] || (t[0] = [
|
6919
|
+
T("div", { class: "tab-header" }, null, -1),
|
6920
|
+
T("div", { class: "tab-body" }, null, -1)
|
6713
6921
|
])));
|
6714
6922
|
}
|
6715
|
-
}),
|
6923
|
+
}), ml = { class: "ha-dance" }, Xl = /* @__PURE__ */ P({
|
6716
6924
|
__name: "Dance",
|
6717
6925
|
props: {
|
6718
6926
|
text: {},
|
6719
6927
|
delay: { default: 0 }
|
6720
6928
|
},
|
6721
|
-
setup(
|
6722
|
-
let i =
|
6723
|
-
return (r, s) => (
|
6724
|
-
(
|
6929
|
+
setup(u) {
|
6930
|
+
let i = u, { text: e, delay: t } = W(i);
|
6931
|
+
return (r, s) => (S(), C("div", ml, [
|
6932
|
+
(S(!0), C(We, null, ze(f(e), (l, a) => (S(), C("div", {
|
6725
6933
|
class: "char",
|
6726
|
-
style:
|
6934
|
+
style: te({ animationDelay: `${f(t) + a * 0.1}s` })
|
6727
6935
|
}, N(l), 5))), 256))
|
6728
6936
|
]));
|
6729
6937
|
}
|
6730
6938
|
});
|
6731
|
-
let
|
6732
|
-
|
6733
|
-
let i = await
|
6939
|
+
let Gl = async (u) => {
|
6940
|
+
u == null && (u = new Hs()), await xs(u), await Ct();
|
6941
|
+
let i = await Ut.getSso(), e = ee.sys.app, t = { baseUrl: u.baseUrl, language: e.language, user: i, platform: "pc" }, r = d.json.serialize(t);
|
6734
6942
|
await _.openAsync(r);
|
6735
|
-
let s = { url:
|
6736
|
-
await
|
6737
|
-
let { ok: o, status:
|
6738
|
-
return o == !1 ? (
|
6943
|
+
let s = { url: u.socketUrl }, l = d.json.serialize(s);
|
6944
|
+
await De.openAsync(l), _.onResponse = async (a) => {
|
6945
|
+
let { ok: o, status: c, data: p } = a;
|
6946
|
+
return o == !1 ? (Re.add(c.toString(), a.message, "网络错误", a.elapsed), le.error(a.message), Promise.reject(a)) : p.code == null || (Re.add(p.code, p.message, p.stack, p.elapsed), p.code == "Ok") ? Promise.resolve() : (le.error(p.message), Promise.reject(p));
|
6739
6947
|
};
|
6740
6948
|
};
|
6741
6949
|
export {
|
6742
|
-
|
6743
|
-
|
6744
|
-
|
6745
|
-
|
6746
|
-
|
6747
|
-
|
6748
|
-
|
6749
|
-
|
6750
|
-
|
6751
|
-
|
6752
|
-
|
6753
|
-
|
6754
|
-
|
6950
|
+
Vr as ArrayUtil,
|
6951
|
+
os as BrowserUtil,
|
6952
|
+
Ft as BuilderFactory,
|
6953
|
+
Ge as Cdn,
|
6954
|
+
Wt as CdnFactory,
|
6955
|
+
Wr as ComponentUtil,
|
6956
|
+
Hs as CreateFeOptions,
|
6957
|
+
hs as DeltaUtility,
|
6958
|
+
qr as DictionaryUtil,
|
6959
|
+
zr as DomUtil,
|
6960
|
+
ds as DragEvent,
|
6961
|
+
Kt as EncoderFactory,
|
6962
|
+
Qt as EncryptorFactory,
|
6963
|
+
Kr as EventUtil,
|
6755
6964
|
$e as EventUtility,
|
6756
|
-
|
6757
|
-
|
6965
|
+
Zt as ExcelFactory,
|
6966
|
+
rr as ExplainerFactory,
|
6758
6967
|
y as Factories,
|
6759
6968
|
D as Factory,
|
6760
|
-
|
6761
|
-
|
6969
|
+
ir as FeatureFactory,
|
6970
|
+
Jr as FileUtil,
|
6762
6971
|
Pe as HaCard,
|
6763
|
-
|
6764
|
-
|
6765
|
-
|
6766
|
-
|
6767
|
-
|
6768
|
-
|
6769
|
-
|
6770
|
-
|
6771
|
-
|
6772
|
-
|
6773
|
-
|
6774
|
-
|
6775
|
-
|
6776
|
-
|
6777
|
-
|
6778
|
-
|
6779
|
-
|
6780
|
-
|
6781
|
-
|
6782
|
-
|
6783
|
-
|
6784
|
-
|
6785
|
-
|
6786
|
-
|
6787
|
-
|
6788
|
-
|
6789
|
-
|
6790
|
-
|
6791
|
-
|
6792
|
-
|
6793
|
-
|
6794
|
-
|
6795
|
-
|
6796
|
-
|
6797
|
-
|
6798
|
-
|
6799
|
-
|
6800
|
-
|
6801
|
-
|
6802
|
-
|
6803
|
-
|
6804
|
-
|
6805
|
-
|
6806
|
-
|
6807
|
-
|
6808
|
-
|
6809
|
-
|
6810
|
-
|
6811
|
-
|
6812
|
-
|
6813
|
-
|
6814
|
-
|
6815
|
-
|
6816
|
-
|
6817
|
-
$
|
6818
|
-
|
6819
|
-
|
6820
|
-
|
6821
|
-
|
6822
|
-
|
6823
|
-
|
6824
|
-
|
6825
|
-
|
6826
|
-
ss as
|
6827
|
-
|
6828
|
-
|
6972
|
+
Ml as HaCode,
|
6973
|
+
Wl as HaCol,
|
6974
|
+
Bl as HaCompare,
|
6975
|
+
Zs as HaCondition,
|
6976
|
+
Vl as HaConditionGroup,
|
6977
|
+
zl as HaContainer,
|
6978
|
+
Xl as HaDance,
|
6979
|
+
Rl as HaEmpty,
|
6980
|
+
Rs as HaFill,
|
6981
|
+
Pl as HaInput,
|
6982
|
+
Ks as HaOption,
|
6983
|
+
Kl as HaProgress,
|
6984
|
+
Fl as HaRichText,
|
6985
|
+
ql as HaRow,
|
6986
|
+
Is as HaScroller,
|
6987
|
+
xe as HaSelect,
|
6988
|
+
Jl as HaSocketProgress,
|
6989
|
+
Yl as HaSpinner,
|
6990
|
+
Ql as HaTab,
|
6991
|
+
Fe as HaTag,
|
6992
|
+
Il as HaTimer,
|
6993
|
+
hr as HaloHttp,
|
6994
|
+
ur as HasherFactory,
|
6995
|
+
Yr as HtmlUtil,
|
6996
|
+
fr as HttpFactory,
|
6997
|
+
Dl as HttpProgress,
|
6998
|
+
rt as HttpRequest,
|
6999
|
+
Me as HttpResponse,
|
7000
|
+
xr as I18nFactory,
|
7001
|
+
Qr as ImageUtil,
|
7002
|
+
as as JsonUtil,
|
7003
|
+
At as KeyboardType,
|
7004
|
+
ps as KeyboardUtility,
|
7005
|
+
Xr as MathUtil,
|
7006
|
+
Ar as Messenger,
|
7007
|
+
_r as MessengerFactory,
|
7008
|
+
Gr as MicroUtil,
|
7009
|
+
Zr as MountUtil,
|
7010
|
+
gs as MouseUtility,
|
7011
|
+
es as ObjectUtil,
|
7012
|
+
nt as Position,
|
7013
|
+
Bt as ProviderFactory,
|
7014
|
+
jl as ProviderTable,
|
7015
|
+
fs as RandomUtility,
|
7016
|
+
Nl as Range,
|
7017
|
+
Ol as Rect,
|
7018
|
+
Hl as Ref,
|
7019
|
+
xt as RepoFactory,
|
7020
|
+
Ce as SaveUtility,
|
7021
|
+
ns as ScrollUtil,
|
7022
|
+
cs as SignUtil,
|
7023
|
+
Er as SignerFactory,
|
7024
|
+
vr as SocketFactory,
|
7025
|
+
br as SocketProgress,
|
7026
|
+
$l as SocketResponse,
|
7027
|
+
Ie as SqlHelper,
|
7028
|
+
Lr as SsoFactory,
|
7029
|
+
st as SsoUser,
|
7030
|
+
ts as StringUtil,
|
7031
|
+
Ot as SvcFactory,
|
7032
|
+
Mr as TaskFactory,
|
7033
|
+
rs as TaskUtil,
|
7034
|
+
Fr as TemplateFactory,
|
7035
|
+
ss as TimeUtil,
|
7036
|
+
ls as TreeUtil,
|
7037
|
+
us as UrlUtil,
|
7038
|
+
Nr as UtilFactory,
|
7039
|
+
ms as UtilityFactory,
|
6829
7040
|
d as Utils,
|
6830
|
-
|
6831
|
-
|
6832
|
-
|
6833
|
-
|
6834
|
-
|
6835
|
-
|
6836
|
-
|
6837
|
-
|
7041
|
+
Ul as VideoFactory,
|
7042
|
+
Ll as VoiceFactory,
|
7043
|
+
ws as base64,
|
7044
|
+
re as cdn,
|
7045
|
+
ee as configSvc,
|
7046
|
+
Gl as createFe,
|
7047
|
+
Tl as driverSvc,
|
7048
|
+
El as envSvc,
|
6838
7049
|
_ as http,
|
6839
|
-
|
6840
|
-
|
6841
|
-
|
6842
|
-
|
6843
|
-
|
6844
|
-
|
6845
|
-
|
6846
|
-
|
6847
|
-
|
6848
|
-
|
6849
|
-
|
6850
|
-
|
6851
|
-
|
6852
|
-
|
6853
|
-
|
6854
|
-
|
6855
|
-
|
6856
|
-
|
6857
|
-
|
6858
|
-
|
6859
|
-
|
6860
|
-
|
6861
|
-
|
6862
|
-
|
6863
|
-
|
7050
|
+
Be as i18n,
|
7051
|
+
xs as initDriverAsync,
|
7052
|
+
Ct as initRepoAsync,
|
7053
|
+
Cl as initSvcAsync,
|
7054
|
+
Re as logSvc,
|
7055
|
+
at as md5,
|
7056
|
+
le as messenger,
|
7057
|
+
St as moduleRepo,
|
7058
|
+
Y as moment,
|
7059
|
+
_t as queryRepo,
|
7060
|
+
Ke as settingRepo,
|
7061
|
+
Xe as settingSvc,
|
7062
|
+
De as socket,
|
7063
|
+
pe as t,
|
7064
|
+
_s as t_enum,
|
7065
|
+
As as t_exists,
|
7066
|
+
Cs as t_field,
|
7067
|
+
Ts as t_field_choose_placeholder,
|
7068
|
+
Es as t_field_placeholder,
|
7069
|
+
Ds as t_menu,
|
7070
|
+
$s as t_module,
|
7071
|
+
Ss as t_sys,
|
7072
|
+
js as t_table,
|
7073
|
+
ks as template,
|
7074
|
+
Ut as userSvc
|
6864
7075
|
};
|