@utogether/utils 3.0.0-beta.21 → 3.0.0-beta.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utils.es.js +259 -275
- package/dist/utils.umd.js +1 -1
- package/package.json +29 -29
package/dist/utils.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var T = Object.defineProperty;
|
|
2
2
|
var j = (a, l, h) => l in a ? T(a, l, { enumerable: !0, configurable: !0, writable: !0, value: h }) : a[l] = h;
|
|
3
|
-
var
|
|
3
|
+
var k = (a, l, h) => j(a, typeof l != "symbol" ? l + "" : l, h);
|
|
4
4
|
import { createVNode, resolveComponent, mergeProps, isVNode, ref, shallowRef, unref, getCurrentInstance, onBeforeUnmount, reactive, watchEffect, isRef } from "vue";
|
|
5
5
|
import dayjs from "dayjs";
|
|
6
6
|
import XEUtils, { isArray, findTree, isEmpty, isObject, isPlainObject, isUndefined, isFunction, isString, clone, has } from "xe-utils";
|
|
@@ -12,9 +12,9 @@ import NProgress from "nprogress";
|
|
|
12
12
|
import { default as W } from "nprogress";
|
|
13
13
|
class sessionStorageProxy {
|
|
14
14
|
constructor(l) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
k(this, "storage");
|
|
16
|
+
k(this, "prefix");
|
|
17
|
+
k(this, "addPrefix", (l) => {
|
|
18
18
|
this.prefix = l;
|
|
19
19
|
});
|
|
20
20
|
this.storage = l;
|
|
@@ -46,7 +46,7 @@ class localStorageProxy extends sessionStorageProxy {
|
|
|
46
46
|
}
|
|
47
47
|
class localforageProxy {
|
|
48
48
|
constructor() {
|
|
49
|
-
|
|
49
|
+
k(this, "storage");
|
|
50
50
|
localforage.config({
|
|
51
51
|
name: "uapp",
|
|
52
52
|
storeName: "udb"
|
|
@@ -69,22 +69,7 @@ class localforageProxy {
|
|
|
69
69
|
this.storage.clear();
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
window$1 || (window$1 = {
|
|
74
|
-
sessionStorage: {
|
|
75
|
-
// getItem: () => {},
|
|
76
|
-
// setItem: () => {},
|
|
77
|
-
// removeItem: () => {},
|
|
78
|
-
// clear: () => {},
|
|
79
|
-
},
|
|
80
|
-
localStorage: {
|
|
81
|
-
// getItem: () => {},
|
|
82
|
-
// setItem: () => {},
|
|
83
|
-
// removeItem: () => {},
|
|
84
|
-
// clear: () => {},
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
const storageSession = new sessionStorageProxy(window$1 == null ? void 0 : window$1.sessionStorage), storageLocal = new localStorageProxy(window$1 == null ? void 0 : window$1.localStorage), dbstorage = new localforageProxy();
|
|
72
|
+
const storageSession = new sessionStorageProxy(sessionStorage), storageLocal = new localStorageProxy(localStorage), dbstorage = new localforageProxy();
|
|
88
73
|
/*! typescript-cookie v1.0.6 | MIT */
|
|
89
74
|
const encodeName = (a) => encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape), encodeValue = (a) => encodeURIComponent(a).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent), decodeName = decodeURIComponent, decodeValue = (a) => (a[0] === '"' && (a = a.slice(1, -1)), a.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent));
|
|
90
75
|
function stringifyAttributes(a) {
|
|
@@ -155,8 +140,8 @@ function init(a, l) {
|
|
|
155
140
|
init({ read: DEFAULT_CODEC.decodeValue, write: DEFAULT_CODEC.encodeValue }, DEFAULT_ATTRIBUTES);
|
|
156
141
|
class Cookies {
|
|
157
142
|
constructor() {
|
|
158
|
-
|
|
159
|
-
|
|
143
|
+
k(this, "prefix", null);
|
|
144
|
+
k(this, "addPrefix", (l) => {
|
|
160
145
|
this.prefix = l;
|
|
161
146
|
});
|
|
162
147
|
}
|
|
@@ -217,51 +202,50 @@ const VxetableRender = (VXETable, {
|
|
|
217
202
|
events: e
|
|
218
203
|
} = a, {
|
|
219
204
|
label: t = "label",
|
|
220
|
-
value: d = "value"
|
|
221
|
-
extLabel: f
|
|
205
|
+
value: d = "value"
|
|
222
206
|
} = Z, {
|
|
223
|
-
loading:
|
|
224
|
-
multiple:
|
|
207
|
+
loading: f = !1,
|
|
208
|
+
multiple: m,
|
|
225
209
|
mapField: u
|
|
226
|
-
} = i,
|
|
227
|
-
|
|
228
|
-
function
|
|
229
|
-
|
|
210
|
+
} = i, V = useComponent(), p = m ? `_${r.field}` : r.field;
|
|
211
|
+
V.setDefaultValue(i, o, r.field);
|
|
212
|
+
function n(H) {
|
|
213
|
+
V.remote(H, r.field, a);
|
|
230
214
|
}
|
|
231
|
-
function
|
|
232
|
-
|
|
215
|
+
function L(H) {
|
|
216
|
+
V.selectChange(H, data, r.field, a, {
|
|
233
217
|
column: r,
|
|
234
218
|
datasource: "row"
|
|
235
219
|
});
|
|
236
220
|
}
|
|
237
|
-
function
|
|
238
|
-
e != null && e.input && e.input(l,
|
|
221
|
+
function C(H) {
|
|
222
|
+
e != null && e.input && e.input(l, H);
|
|
239
223
|
}
|
|
240
|
-
function
|
|
241
|
-
|
|
224
|
+
function A() {
|
|
225
|
+
V.clear(o, r.field, u, e, "row");
|
|
242
226
|
}
|
|
243
|
-
function
|
|
244
|
-
!c.length &&
|
|
227
|
+
function w() {
|
|
228
|
+
!c.length && n(""), e != null && e.focus && e.focus(l, r.field);
|
|
245
229
|
}
|
|
246
230
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
247
|
-
modelValue: o[
|
|
248
|
-
"onUpdate:modelValue": (
|
|
231
|
+
modelValue: o[p],
|
|
232
|
+
"onUpdate:modelValue": (H) => o[p] = H,
|
|
249
233
|
filterable: !0,
|
|
250
234
|
remote: !0,
|
|
251
235
|
clearable: !0,
|
|
252
236
|
placeholder: "请录入关键字搜索",
|
|
253
237
|
style: "width: 100%",
|
|
254
|
-
"remote-method":
|
|
255
|
-
loading:
|
|
238
|
+
"remote-method": n,
|
|
239
|
+
loading: f
|
|
256
240
|
}, i, {
|
|
257
|
-
onFocus: () =>
|
|
258
|
-
onChange: (
|
|
259
|
-
onClear: () =>
|
|
260
|
-
onInput: (
|
|
261
|
-
}), _isSlot(h = c.map((
|
|
262
|
-
key:
|
|
263
|
-
label:
|
|
264
|
-
value:
|
|
241
|
+
onFocus: () => w(),
|
|
242
|
+
onChange: (H) => L(H),
|
|
243
|
+
onClear: () => A(),
|
|
244
|
+
onInput: (H) => C(H)
|
|
245
|
+
}), _isSlot(h = c.map((H) => createVNode(resolveComponent("el-option"), {
|
|
246
|
+
key: H[d],
|
|
247
|
+
label: H[t],
|
|
248
|
+
value: H[d]
|
|
265
249
|
}, null))) ? h : {
|
|
266
250
|
default: () => [h]
|
|
267
251
|
})];
|
|
@@ -296,45 +280,45 @@ const VxetableRender = (VXETable, {
|
|
|
296
280
|
} = Z, {
|
|
297
281
|
mapField: f,
|
|
298
282
|
multiple: m,
|
|
299
|
-
loading:
|
|
300
|
-
} = i,
|
|
301
|
-
|
|
302
|
-
async function n(
|
|
303
|
-
|
|
283
|
+
loading: u = !1
|
|
284
|
+
} = i, V = useComponent(), p = m ? `_${r}` : r;
|
|
285
|
+
V.setDefaultValue(i, o, r);
|
|
286
|
+
async function n(H) {
|
|
287
|
+
V.remote(H, r, a);
|
|
304
288
|
}
|
|
305
|
-
function
|
|
306
|
-
|
|
289
|
+
function L(H) {
|
|
290
|
+
V.selectChange(H, o, r, a, {
|
|
307
291
|
datasource: "data"
|
|
308
292
|
});
|
|
309
293
|
}
|
|
310
|
-
function C(
|
|
311
|
-
e != null && e.input && e.input(l,
|
|
294
|
+
function C(H) {
|
|
295
|
+
e != null && e.input && e.input(l, H);
|
|
312
296
|
}
|
|
313
|
-
function
|
|
314
|
-
|
|
297
|
+
function A() {
|
|
298
|
+
V.clear(o, r, f, e, "data");
|
|
315
299
|
}
|
|
316
|
-
function
|
|
300
|
+
function w() {
|
|
317
301
|
!c.length && n(""), e != null && e.focus && e.focus(l);
|
|
318
302
|
}
|
|
319
303
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
320
|
-
modelValue: o[
|
|
321
|
-
"onUpdate:modelValue": (
|
|
304
|
+
modelValue: o[p],
|
|
305
|
+
"onUpdate:modelValue": (H) => o[p] = H,
|
|
322
306
|
filterable: !0,
|
|
323
307
|
remote: !0,
|
|
324
308
|
clearable: !0,
|
|
325
309
|
style: "width: 100%",
|
|
326
310
|
placeholder: "请录入关键字搜索",
|
|
327
|
-
loading:
|
|
311
|
+
loading: u,
|
|
328
312
|
"remote-method": n
|
|
329
313
|
}, i, {
|
|
330
|
-
onFocus: () =>
|
|
331
|
-
onChange: (
|
|
332
|
-
onClear: () =>
|
|
314
|
+
onFocus: () => w(),
|
|
315
|
+
onChange: (H) => L(H),
|
|
316
|
+
onClear: () => A(),
|
|
333
317
|
onInput: () => C()
|
|
334
|
-
}), _isSlot(h = c.map((
|
|
335
|
-
key:
|
|
336
|
-
label:
|
|
337
|
-
value:
|
|
318
|
+
}), _isSlot(h = c.map((H) => createVNode(resolveComponent("el-option"), {
|
|
319
|
+
key: H[d],
|
|
320
|
+
label: H[t],
|
|
321
|
+
value: H[d]
|
|
338
322
|
}, null))) ? h : {
|
|
339
323
|
default: () => [h]
|
|
340
324
|
})];
|
|
@@ -398,21 +382,21 @@ const VxetableRender = (VXETable, {
|
|
|
398
382
|
extLabel: f
|
|
399
383
|
} = Z, {
|
|
400
384
|
mapField: m
|
|
401
|
-
} = i,
|
|
385
|
+
} = i, u = useComponent();
|
|
402
386
|
i.multiple && o[r.field] && !isArray(o[r.field]) && o[r.field].split(",").forEach((n) => {
|
|
403
387
|
!c.some((C) => C[t] === n) && c.push({
|
|
404
388
|
[d]: n,
|
|
405
389
|
[t]: n
|
|
406
390
|
});
|
|
407
391
|
});
|
|
408
|
-
function
|
|
409
|
-
|
|
392
|
+
function V(n) {
|
|
393
|
+
u.selectChange(n, o, r.field, a, {
|
|
410
394
|
column: r,
|
|
411
395
|
datasource: "row"
|
|
412
396
|
});
|
|
413
397
|
}
|
|
414
|
-
function
|
|
415
|
-
|
|
398
|
+
function p() {
|
|
399
|
+
u.clear(o, r.field, m, e, "row");
|
|
416
400
|
}
|
|
417
401
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
418
402
|
modelValue: o[r.field],
|
|
@@ -421,8 +405,8 @@ const VxetableRender = (VXETable, {
|
|
|
421
405
|
clearable: !0
|
|
422
406
|
}, i, {
|
|
423
407
|
style: "width: 100%",
|
|
424
|
-
onChange: (n) =>
|
|
425
|
-
onClear: () =>
|
|
408
|
+
onChange: (n) => V(n),
|
|
409
|
+
onClear: () => p()
|
|
426
410
|
}), _isSlot(h = c.map((n) => createVNode(resolveComponent("el-option"), {
|
|
427
411
|
key: n[d],
|
|
428
412
|
label: f && n[f] ? n[d] : n[t],
|
|
@@ -447,21 +431,21 @@ const VxetableRender = (VXETable, {
|
|
|
447
431
|
extLabel: f
|
|
448
432
|
} = Z, {
|
|
449
433
|
mapField: m
|
|
450
|
-
} = i,
|
|
434
|
+
} = i, u = useComponent();
|
|
451
435
|
i.multiple && o[r.field] && !isArray(o[r.field]) && o[r.field].split(",").forEach((n) => {
|
|
452
436
|
!c.some((C) => C[t] === n) && c.push({
|
|
453
437
|
[d]: n,
|
|
454
438
|
[t]: n
|
|
455
439
|
});
|
|
456
440
|
});
|
|
457
|
-
function
|
|
458
|
-
|
|
441
|
+
function V(n) {
|
|
442
|
+
u.selectChange(n, o, r.field, a, {
|
|
459
443
|
column: r,
|
|
460
444
|
datasource: "row"
|
|
461
445
|
});
|
|
462
446
|
}
|
|
463
|
-
function
|
|
464
|
-
|
|
447
|
+
function p() {
|
|
448
|
+
u.clear(o, r.field, m, e, "row");
|
|
465
449
|
}
|
|
466
450
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
467
451
|
modelValue: o[r.field],
|
|
@@ -470,8 +454,8 @@ const VxetableRender = (VXETable, {
|
|
|
470
454
|
clearable: !0
|
|
471
455
|
}, i, {
|
|
472
456
|
style: "width: 100%",
|
|
473
|
-
onChange: (n) =>
|
|
474
|
-
onClear: () =>
|
|
457
|
+
onChange: (n) => V(n),
|
|
458
|
+
onClear: () => p()
|
|
475
459
|
}), _isSlot(h = c.map((n) => createVNode(resolveComponent("el-option"), {
|
|
476
460
|
key: n[d],
|
|
477
461
|
label: f && n[f] ? n[d] : n[t],
|
|
@@ -515,16 +499,16 @@ const VxetableRender = (VXETable, {
|
|
|
515
499
|
value: d = "value"
|
|
516
500
|
} = Z, f = useComponent(), {
|
|
517
501
|
defaultValues: m,
|
|
518
|
-
mapField:
|
|
502
|
+
mapField: u
|
|
519
503
|
} = i;
|
|
520
504
|
m && (o[r] = m);
|
|
521
|
-
function
|
|
505
|
+
function V(n) {
|
|
522
506
|
f.selectChange(n, o, r, a, {
|
|
523
507
|
datasource: "data"
|
|
524
508
|
});
|
|
525
509
|
}
|
|
526
|
-
function
|
|
527
|
-
f.clear(o, r,
|
|
510
|
+
function p() {
|
|
511
|
+
f.clear(o, r, u, e, "data");
|
|
528
512
|
}
|
|
529
513
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
530
514
|
modelValue: o[r],
|
|
@@ -533,8 +517,8 @@ const VxetableRender = (VXETable, {
|
|
|
533
517
|
clearable: !0,
|
|
534
518
|
style: "width: 100%"
|
|
535
519
|
}, i, {
|
|
536
|
-
onChange: (n) =>
|
|
537
|
-
onClear: () =>
|
|
520
|
+
onChange: (n) => V(n),
|
|
521
|
+
onClear: () => p()
|
|
538
522
|
}), _isSlot(h = c.map((n) => createVNode(resolveComponent("el-option"), {
|
|
539
523
|
key: n[d],
|
|
540
524
|
label: n[t],
|
|
@@ -558,35 +542,35 @@ const VxetableRender = (VXETable, {
|
|
|
558
542
|
Z && (h[o] = Z);
|
|
559
543
|
function t(f, m) {
|
|
560
544
|
const {
|
|
561
|
-
mapField:
|
|
562
|
-
field:
|
|
563
|
-
displayName:
|
|
545
|
+
mapField: u,
|
|
546
|
+
field: V,
|
|
547
|
+
displayName: p,
|
|
564
548
|
multiple: n
|
|
565
549
|
} = r;
|
|
566
550
|
if (n) {
|
|
567
551
|
if (n) {
|
|
568
552
|
const C = {};
|
|
569
|
-
h[
|
|
570
|
-
for (const
|
|
571
|
-
C[
|
|
572
|
-
return
|
|
553
|
+
h[p || V] = f.reduce((A, w) => {
|
|
554
|
+
for (const H in u)
|
|
555
|
+
C[H] = A ? C[H] + "," + w[u[H]] : w[u[H]];
|
|
556
|
+
return A = A ? A + "," + w[p || V] : w[p || V], A;
|
|
573
557
|
}, ""), Object.assign(h, C);
|
|
574
558
|
}
|
|
575
559
|
} else {
|
|
576
560
|
const C = {
|
|
577
|
-
[
|
|
561
|
+
[p || V]: f[m || p || V]
|
|
578
562
|
};
|
|
579
|
-
for (const
|
|
580
|
-
C[
|
|
563
|
+
for (const A in u)
|
|
564
|
+
C[A] = f[u[A]];
|
|
581
565
|
Object.assign(h, C);
|
|
582
566
|
}
|
|
583
|
-
const
|
|
567
|
+
const L = {
|
|
584
568
|
row: h,
|
|
585
|
-
property:
|
|
569
|
+
property: V,
|
|
586
570
|
item: f,
|
|
587
|
-
field:
|
|
571
|
+
field: V
|
|
588
572
|
};
|
|
589
|
-
c != null && c.change && c.change(
|
|
573
|
+
c != null && c.change && c.change(L);
|
|
590
574
|
}
|
|
591
575
|
function d() {
|
|
592
576
|
i.clear(h, o, e, c, "data");
|
|
@@ -612,16 +596,16 @@ const VxetableRender = (VXETable, {
|
|
|
612
596
|
const {
|
|
613
597
|
mapField: f,
|
|
614
598
|
field: m,
|
|
615
|
-
displayName:
|
|
616
|
-
multiple:
|
|
599
|
+
displayName: u,
|
|
600
|
+
multiple: V
|
|
617
601
|
} = r;
|
|
618
|
-
if (!
|
|
619
|
-
const
|
|
620
|
-
[
|
|
602
|
+
if (!V) {
|
|
603
|
+
const p = {
|
|
604
|
+
[u || m]: t[d || u || m]
|
|
621
605
|
};
|
|
622
606
|
for (const n in f)
|
|
623
|
-
|
|
624
|
-
Object.assign(h,
|
|
607
|
+
p[n] = t[f[n]];
|
|
608
|
+
Object.assign(h, p);
|
|
625
609
|
}
|
|
626
610
|
c != null && c.change && c.change(l, t, h[o.field]);
|
|
627
611
|
}
|
|
@@ -649,16 +633,16 @@ const VxetableRender = (VXETable, {
|
|
|
649
633
|
const {
|
|
650
634
|
mapField: f,
|
|
651
635
|
field: m,
|
|
652
|
-
displayName:
|
|
653
|
-
multiple:
|
|
636
|
+
displayName: u,
|
|
637
|
+
multiple: V
|
|
654
638
|
} = r;
|
|
655
|
-
if (!
|
|
656
|
-
const
|
|
657
|
-
[
|
|
639
|
+
if (!V) {
|
|
640
|
+
const p = {
|
|
641
|
+
[u || m]: t[d || u || m]
|
|
658
642
|
};
|
|
659
643
|
for (const n in f)
|
|
660
|
-
|
|
661
|
-
Object.assign(h,
|
|
644
|
+
p[n] = t[f[n]];
|
|
645
|
+
Object.assign(h, p);
|
|
662
646
|
}
|
|
663
647
|
c != null && c.change && c.change(l, t, h[o.field]);
|
|
664
648
|
}
|
|
@@ -867,11 +851,11 @@ const VxetableRender = (VXETable, {
|
|
|
867
851
|
fetchField: d,
|
|
868
852
|
url: f,
|
|
869
853
|
defaultParams: m = {},
|
|
870
|
-
method:
|
|
871
|
-
} = e,
|
|
854
|
+
method: u = "get"
|
|
855
|
+
} = e, V = getCookieParam(), p = Object.assign({
|
|
872
856
|
pageSize: 20,
|
|
873
857
|
pageNum: 1,
|
|
874
|
-
...
|
|
858
|
+
...V,
|
|
875
859
|
...m
|
|
876
860
|
}, {
|
|
877
861
|
[d || c]: r
|
|
@@ -879,7 +863,7 @@ const VxetableRender = (VXETable, {
|
|
|
879
863
|
if (e.loading) return;
|
|
880
864
|
let n;
|
|
881
865
|
try {
|
|
882
|
-
Z.length = 0, e.loading = !0, n = await serviceApi[
|
|
866
|
+
Z.length = 0, e.loading = !0, n = await serviceApi[u](f, p), t != null && t.filterMethod ? Z.push(...t.filterMethod(n.list || n)) : n && (n.list ? Z.push(...n.list) : Z.push(...n));
|
|
883
867
|
} finally {
|
|
884
868
|
e.loading = !1;
|
|
885
869
|
}
|
|
@@ -891,27 +875,27 @@ const VxetableRender = (VXETable, {
|
|
|
891
875
|
} = e, {
|
|
892
876
|
options: f,
|
|
893
877
|
props: m,
|
|
894
|
-
optionProps:
|
|
895
|
-
events:
|
|
896
|
-
} = Z,
|
|
878
|
+
optionProps: u = {},
|
|
879
|
+
events: V
|
|
880
|
+
} = Z, p = {
|
|
897
881
|
[d]: c,
|
|
898
882
|
field: i
|
|
899
883
|
};
|
|
900
884
|
c[i] = null, !isEmpty(r) && (m != null && m.multiple) ? (c[i] = r.join(","), t = [], r.forEach((n) => {
|
|
901
|
-
const
|
|
902
|
-
|
|
903
|
-
const
|
|
904
|
-
c[C] =
|
|
905
|
-
}),
|
|
906
|
-
}), Object.assign(
|
|
885
|
+
const L = f.find((C) => n === C[u == null ? void 0 : u.value]);
|
|
886
|
+
L && !isEmpty(m.mapField) && isObject(m.mapField) && Object.keys(m.mapField).forEach((C) => {
|
|
887
|
+
const A = L[m.mapField[C]], w = c[C] ? c[C].toString() : "";
|
|
888
|
+
c[C] = w && !w.includes(A) ? `${w},${A}` : A;
|
|
889
|
+
}), L && t.push(L);
|
|
890
|
+
}), Object.assign(p, {
|
|
907
891
|
options: t
|
|
908
|
-
})) : (c[i] = m != null && m.multiple ? null : r, t = f.find((n) => r === n[
|
|
892
|
+
})) : (c[i] = m != null && m.multiple ? null : r, t = f.find((n) => r === n[u == null ? void 0 : u.value]), !isEmpty(m.mapField) && isObject(m.mapField) && Object.keys(m.mapField).forEach((n) => {
|
|
909
893
|
c[n] = t ? t[m.mapField[n]] : null;
|
|
910
|
-
}), Object.assign(
|
|
894
|
+
}), Object.assign(p, {
|
|
911
895
|
option: t
|
|
912
|
-
})), d === "row" && Object.assign(
|
|
896
|
+
})), d === "row" && Object.assign(p, {
|
|
913
897
|
column: e.column
|
|
914
|
-
}),
|
|
898
|
+
}), V != null && V.change && V.change(p);
|
|
915
899
|
},
|
|
916
900
|
setDefaultValue: (r, c, i) => {
|
|
917
901
|
var d;
|
|
@@ -997,10 +981,10 @@ function useWatermark(a = ref(document.body)) {
|
|
|
997
981
|
d && (t && d.removeChild(t), removeResizeListener(d, l));
|
|
998
982
|
};
|
|
999
983
|
function c(t, d) {
|
|
1000
|
-
const f = document.createElement("canvas"), m = 260,
|
|
1001
|
-
Object.assign(f, { width: m, height:
|
|
1002
|
-
const
|
|
1003
|
-
return
|
|
984
|
+
const f = document.createElement("canvas"), m = 260, u = 180;
|
|
985
|
+
Object.assign(f, { width: m, height: u });
|
|
986
|
+
const V = f.getContext("2d");
|
|
987
|
+
return V && (V.rotate(-20 * Math.PI / 120), V.font = (d == null ? void 0 : d.font) ?? "15px Reggae One", V.fillStyle = (d == null ? void 0 : d.fillStyle) ?? "rgba(180, 180, 180, 0.75)", V.textAlign = "left", V.textBaseline = "middle", V.fillText(t, m / 20, u)), f.toDataURL("image/png");
|
|
1004
988
|
}
|
|
1005
989
|
function i(t = {}) {
|
|
1006
990
|
const d = unref(o);
|
|
@@ -1016,8 +1000,8 @@ function useWatermark(a = ref(document.body)) {
|
|
|
1016
1000
|
o.value = f, f.id = h, f.style.pointerEvents = "none", f.style.top = "0px", f.style.left = "0px", f.style.position = "absolute", f.style.zIndex = "100000";
|
|
1017
1001
|
const m = unref(a);
|
|
1018
1002
|
if (!m) return h;
|
|
1019
|
-
const { clientHeight:
|
|
1020
|
-
return i({ str: t, width:
|
|
1003
|
+
const { clientHeight: u, clientWidth: V } = m;
|
|
1004
|
+
return i({ str: t, width: V, height: u, attr: d }), m.appendChild(f), h;
|
|
1021
1005
|
};
|
|
1022
1006
|
function e(t, d) {
|
|
1023
1007
|
Z(t, d), addResizeListener(document.documentElement, l), getCurrentInstance() && onBeforeUnmount(() => {
|
|
@@ -1040,36 +1024,36 @@ function useAttrs(a = {}) {
|
|
|
1040
1024
|
}), r;
|
|
1041
1025
|
}
|
|
1042
1026
|
const useRender = () => {
|
|
1043
|
-
const a = { value: "dictCode", label: "dictName" }, l = (v,
|
|
1027
|
+
const a = { value: "dictCode", label: "dictName" }, l = (v, M) => {
|
|
1044
1028
|
var E;
|
|
1045
|
-
const
|
|
1029
|
+
const b = H(M);
|
|
1046
1030
|
let s = {
|
|
1047
1031
|
clearable: !0,
|
|
1048
1032
|
disabled: !1,
|
|
1049
1033
|
showValue: !1,
|
|
1050
1034
|
placeholder: null
|
|
1051
|
-
},
|
|
1052
|
-
isObject(v) ? (s = Object.assign(s, v),
|
|
1053
|
-
const
|
|
1035
|
+
}, y, S;
|
|
1036
|
+
isObject(v) ? (s = Object.assign(s, v), y = v.defaultValue, S = v == null ? void 0 : v.code) : S = v;
|
|
1037
|
+
const x = (E = storageLocal.getItem("kLov")[S]) == null ? void 0 : E.children, D = x ? x.filter((N) => N.enabled === "1") : [];
|
|
1054
1038
|
return {
|
|
1055
1039
|
name: "#select",
|
|
1056
1040
|
optionProps: a,
|
|
1057
1041
|
options: D,
|
|
1058
1042
|
props: s,
|
|
1059
|
-
defaultValue:
|
|
1060
|
-
events:
|
|
1043
|
+
defaultValue: y,
|
|
1044
|
+
events: b
|
|
1061
1045
|
};
|
|
1062
|
-
}, h = (v,
|
|
1063
|
-
const
|
|
1046
|
+
}, h = (v, M) => {
|
|
1047
|
+
const b = H(M);
|
|
1064
1048
|
return {
|
|
1065
1049
|
name: "#SuSelect",
|
|
1066
1050
|
optionProps: (v == null ? void 0 : v.optionProps) || { label: "label", value: "value" },
|
|
1067
1051
|
props: v == null ? void 0 : v.props,
|
|
1068
1052
|
options: (v == null ? void 0 : v.options) || [],
|
|
1069
|
-
events:
|
|
1053
|
+
events: b
|
|
1070
1054
|
};
|
|
1071
|
-
}, o = (v,
|
|
1072
|
-
const
|
|
1055
|
+
}, o = (v, M) => {
|
|
1056
|
+
const b = {
|
|
1073
1057
|
optionProps: { extLabel: "userName", value: "employeeName" },
|
|
1074
1058
|
props: {
|
|
1075
1059
|
attrs: { disabled: v == null ? void 0 : v.disabled },
|
|
@@ -1081,9 +1065,9 @@ const useRender = () => {
|
|
|
1081
1065
|
fetchField: "employeeName"
|
|
1082
1066
|
}
|
|
1083
1067
|
};
|
|
1084
|
-
return h(
|
|
1068
|
+
return h(b, M);
|
|
1085
1069
|
}, r = (v) => {
|
|
1086
|
-
const
|
|
1070
|
+
const M = {
|
|
1087
1071
|
optionProps: { extLabel: "userName", value: "name" },
|
|
1088
1072
|
props: {
|
|
1089
1073
|
code: "sys/listUsers",
|
|
@@ -1092,9 +1076,9 @@ const useRender = () => {
|
|
|
1092
1076
|
mapField: v == null ? void 0 : v.mapField
|
|
1093
1077
|
}
|
|
1094
1078
|
};
|
|
1095
|
-
return h(
|
|
1096
|
-
}, c = (v,
|
|
1097
|
-
const
|
|
1079
|
+
return h(M);
|
|
1080
|
+
}, c = (v, M) => {
|
|
1081
|
+
const b = {
|
|
1098
1082
|
label: "organizationName",
|
|
1099
1083
|
value: (v == null ? void 0 : v.field) || "organizationName"
|
|
1100
1084
|
}, s = {
|
|
@@ -1102,13 +1086,13 @@ const useRender = () => {
|
|
|
1102
1086
|
defaultParams: v == null ? void 0 : v.defaultParams,
|
|
1103
1087
|
url: "/uums/cusOrganization",
|
|
1104
1088
|
fetchField: "organizationName"
|
|
1105
|
-
},
|
|
1089
|
+
}, y = {
|
|
1106
1090
|
organizationId: "id",
|
|
1107
1091
|
organizationCode: "organizationCode"
|
|
1108
1092
|
};
|
|
1109
|
-
return Object.assign(s.mapField,
|
|
1110
|
-
}, i = (v,
|
|
1111
|
-
const
|
|
1093
|
+
return Object.assign(s.mapField, y, (v == null ? void 0 : v.mapField) || {}), { name: "#SuSelect", props: s, optionProps: b, options: [], methods: M };
|
|
1094
|
+
}, i = (v, M) => {
|
|
1095
|
+
const b = {
|
|
1112
1096
|
label: "orgName",
|
|
1113
1097
|
value: (v == null ? void 0 : v.field) || "orgName"
|
|
1114
1098
|
}, s = {
|
|
@@ -1116,40 +1100,40 @@ const useRender = () => {
|
|
|
1116
1100
|
defaultParams: v == null ? void 0 : v.defaultParams,
|
|
1117
1101
|
url: "/uums/org",
|
|
1118
1102
|
fetchField: "orgName"
|
|
1119
|
-
},
|
|
1120
|
-
return Object.assign(s.mapField,
|
|
1121
|
-
}, Z = (v,
|
|
1122
|
-
const
|
|
1103
|
+
}, y = { orgId: "id", orgCode: "orgCode" };
|
|
1104
|
+
return Object.assign(s.mapField, y, (v == null ? void 0 : v.mapField) || {}), { name: "#SuSelect", props: s, optionProps: b, options: [], methods: M };
|
|
1105
|
+
}, Z = (v, M) => {
|
|
1106
|
+
const b = Object.assign({ disabled: !1 }, v), s = b == null ? void 0 : b.defaultValue;
|
|
1123
1107
|
return {
|
|
1124
1108
|
name: "VxeInput",
|
|
1125
|
-
props:
|
|
1109
|
+
props: b,
|
|
1126
1110
|
defaultValue: s,
|
|
1127
|
-
events:
|
|
1111
|
+
events: H(M)
|
|
1128
1112
|
};
|
|
1129
|
-
}, e = (v,
|
|
1130
|
-
const
|
|
1113
|
+
}, e = (v, M) => {
|
|
1114
|
+
const b = Object.assign({ disabled: !1, rows: 3 }, v), s = b == null ? void 0 : b.defaultValue;
|
|
1131
1115
|
return {
|
|
1132
1116
|
name: "VxeTextarea",
|
|
1133
|
-
props:
|
|
1117
|
+
props: b,
|
|
1134
1118
|
defaultValue: s,
|
|
1135
|
-
events:
|
|
1119
|
+
events: H(M)
|
|
1136
1120
|
};
|
|
1137
|
-
}, t = (v,
|
|
1138
|
-
const
|
|
1139
|
-
return { name:
|
|
1140
|
-
}, d = (v,
|
|
1141
|
-
const
|
|
1142
|
-
return { name:
|
|
1121
|
+
}, t = (v, M) => {
|
|
1122
|
+
const b = "VxeCheckbox", { defaultValue: s, options: y, props: S } = f(v);
|
|
1123
|
+
return { name: b, defaultValue: s, options: y, props: S, events: H(M) };
|
|
1124
|
+
}, d = (v, M) => {
|
|
1125
|
+
const b = "VxeRadio", { defaultValue: s, options: y, props: S } = f(v);
|
|
1126
|
+
return { name: b, defaultValue: s, options: y, props: S, events: H(M) };
|
|
1143
1127
|
}, f = (v) => {
|
|
1144
|
-
var
|
|
1145
|
-
let
|
|
1128
|
+
var x;
|
|
1129
|
+
let M = { disabled: !1 }, b;
|
|
1146
1130
|
const s = storageLocal.getItem("kLov");
|
|
1147
|
-
let
|
|
1148
|
-
isObject(v) ? (
|
|
1149
|
-
const
|
|
1150
|
-
return { props:
|
|
1151
|
-
}, m = (v,
|
|
1152
|
-
const
|
|
1131
|
+
let y = "";
|
|
1132
|
+
isObject(v) ? (b = v.defaultValue, y = v.code, M = Object.assign(M, v || {})) : isString(v) && (y = v);
|
|
1133
|
+
const S = y ? (x = s[y]) == null ? void 0 : x.children.map((D) => ({ label: D.dictName, value: D.dictCode })) : [];
|
|
1134
|
+
return { props: M, defaultValue: b, options: S };
|
|
1135
|
+
}, m = (v, M) => {
|
|
1136
|
+
const b = H(M);
|
|
1153
1137
|
return {
|
|
1154
1138
|
name: "VxeInput",
|
|
1155
1139
|
props: Object.assign(
|
|
@@ -1157,19 +1141,19 @@ const useRender = () => {
|
|
|
1157
1141
|
v || {}
|
|
1158
1142
|
),
|
|
1159
1143
|
defaultValue: v == null ? void 0 : v.defaultValue,
|
|
1160
|
-
events:
|
|
1144
|
+
events: b
|
|
1161
1145
|
};
|
|
1162
|
-
},
|
|
1163
|
-
const
|
|
1164
|
-
return { name: "VxeInput", props: Object.assign({ type: "date", valueFormat: s, clearable: !0 }, v || {}), defaultValue:
|
|
1165
|
-
},
|
|
1166
|
-
const
|
|
1167
|
-
return { name: "#lov", props: Object.assign({}, v || {}), events:
|
|
1168
|
-
},
|
|
1169
|
-
const
|
|
1146
|
+
}, u = (v, M) => {
|
|
1147
|
+
const b = H(M), s = "yyyy-MM-dd HH:mm:ss", y = v == null ? void 0 : v.defaultValue;
|
|
1148
|
+
return { name: "VxeInput", props: Object.assign({ type: "date", valueFormat: s, clearable: !0 }, v || {}), defaultValue: y, events: b };
|
|
1149
|
+
}, V = (v, M) => {
|
|
1150
|
+
const b = H(M);
|
|
1151
|
+
return { name: "#lov", props: Object.assign({}, v || {}), events: b };
|
|
1152
|
+
}, p = (v, M) => {
|
|
1153
|
+
const b = H(M), s = (v == null ? void 0 : v.optionProps) || {
|
|
1170
1154
|
label: "label",
|
|
1171
1155
|
value: "value"
|
|
1172
|
-
},
|
|
1156
|
+
}, y = Object.assign(
|
|
1173
1157
|
{ clearable: !0, disabled: !1, showValue: !1 },
|
|
1174
1158
|
v || {}
|
|
1175
1159
|
);
|
|
@@ -1177,42 +1161,42 @@ const useRender = () => {
|
|
|
1177
1161
|
name: "#select",
|
|
1178
1162
|
optionProps: s,
|
|
1179
1163
|
options: (v == null ? void 0 : v.options) || [],
|
|
1180
|
-
props:
|
|
1181
|
-
events:
|
|
1164
|
+
props: y,
|
|
1165
|
+
events: b
|
|
1182
1166
|
};
|
|
1183
|
-
}, n = (v,
|
|
1184
|
-
let
|
|
1167
|
+
}, n = (v, M) => {
|
|
1168
|
+
let b = {
|
|
1185
1169
|
openLabel: "是",
|
|
1186
1170
|
closeLabel: "否",
|
|
1187
1171
|
openValue: "Y",
|
|
1188
1172
|
closeValue: "N"
|
|
1189
1173
|
}, s = "Y";
|
|
1190
|
-
isObject(v) && !isFunction(v) ? (
|
|
1191
|
-
const
|
|
1192
|
-
return { name: "VxeSwitch", props:
|
|
1193
|
-
},
|
|
1194
|
-
const
|
|
1174
|
+
isObject(v) && !isFunction(v) ? (b = Object.assign(b, v || {}), s = v.defaultValue || s) : !isEmpty(v) && isString(v) && (s = v, b = Object.assign(b, { defaultValue: s }));
|
|
1175
|
+
const y = isFunction(v) ? H(v) : H(M);
|
|
1176
|
+
return { name: "VxeSwitch", props: b, defaultValue: s, events: y };
|
|
1177
|
+
}, L = (v, M) => ({ name: "#tag", props: { code: v, tagMap: M } }), C = (v, M) => {
|
|
1178
|
+
const b = {
|
|
1195
1179
|
openLabel: "启用",
|
|
1196
1180
|
closeLabel: "禁用",
|
|
1197
1181
|
openValue: "1",
|
|
1198
1182
|
closeValue: "0",
|
|
1199
1183
|
defaultValue: "1"
|
|
1200
1184
|
};
|
|
1201
|
-
!isFunction(v) && isObject(v) && Object.assign(
|
|
1202
|
-
const s = isFunction(v) ? v :
|
|
1203
|
-
return n(
|
|
1204
|
-
},
|
|
1205
|
-
let
|
|
1206
|
-
return isObject(v) && !isFunction(v) ?
|
|
1207
|
-
change: (v == null ? void 0 : v.change) ||
|
|
1208
|
-
blur: (v == null ? void 0 : v.blur) ||
|
|
1209
|
-
focus: (v == null ? void 0 : v.focus) ||
|
|
1210
|
-
input: (v == null ? void 0 : v.input) ||
|
|
1211
|
-
clear: (v == null ? void 0 : v.clear) ||
|
|
1185
|
+
!isFunction(v) && isObject(v) && Object.assign(b, v);
|
|
1186
|
+
const s = isFunction(v) ? v : M;
|
|
1187
|
+
return n(b, s);
|
|
1188
|
+
}, A = () => ({ name: "#iconSelect" }), w = (v = [], M = {}, b) => ({ name: "#treeSelect", sourceData: v, props: M, events: b }), H = (v) => {
|
|
1189
|
+
let M = {};
|
|
1190
|
+
return isObject(v) && !isFunction(v) ? M = {
|
|
1191
|
+
change: (v == null ? void 0 : v.change) || I,
|
|
1192
|
+
blur: (v == null ? void 0 : v.blur) || I,
|
|
1193
|
+
focus: (v == null ? void 0 : v.focus) || I,
|
|
1194
|
+
input: (v == null ? void 0 : v.input) || I,
|
|
1195
|
+
clear: (v == null ? void 0 : v.clear) || I,
|
|
1212
1196
|
filterMethod: v == null ? void 0 : v.filterMethod
|
|
1213
|
-
} : v && (
|
|
1197
|
+
} : v && (M = { change: v }), M;
|
|
1214
1198
|
};
|
|
1215
|
-
function
|
|
1199
|
+
function I() {
|
|
1216
1200
|
}
|
|
1217
1201
|
return {
|
|
1218
1202
|
renderDict: l,
|
|
@@ -1226,14 +1210,14 @@ const useRender = () => {
|
|
|
1226
1210
|
renderInvOrg: c,
|
|
1227
1211
|
renderBU: i,
|
|
1228
1212
|
renderNumber: m,
|
|
1229
|
-
renderLov:
|
|
1230
|
-
renderSelectLocal:
|
|
1231
|
-
renderDate:
|
|
1213
|
+
renderLov: V,
|
|
1214
|
+
renderSelectLocal: p,
|
|
1215
|
+
renderDate: u,
|
|
1232
1216
|
renderSwitch: n,
|
|
1233
|
-
renderCellTag:
|
|
1217
|
+
renderCellTag: L,
|
|
1234
1218
|
renderEnabled: C,
|
|
1235
|
-
renderIconSelect:
|
|
1236
|
-
renderTreeSelect:
|
|
1219
|
+
renderIconSelect: A,
|
|
1220
|
+
renderTreeSelect: w
|
|
1237
1221
|
};
|
|
1238
1222
|
}, useGlobal = () => {
|
|
1239
1223
|
const a = getCurrentInstance();
|
|
@@ -1301,7 +1285,7 @@ const deviceDetection = () => {
|
|
|
1301
1285
|
var i, Z;
|
|
1302
1286
|
o.title = o.title || `message.${o.field}`, o.span = o.span || h;
|
|
1303
1287
|
let r = !1;
|
|
1304
|
-
l === "detail" ? r = !0 : r = o.disabled || ((Z = (i = o.itemRender) == null ? void 0 : i.props) == null ? void 0 : Z.disabled);
|
|
1288
|
+
l === "detail" ? (r = !0, o.placeholder = null) : r = o.disabled === !1 ? o.disabled : o.disabled || ((Z = (i = o.itemRender) == null ? void 0 : i.props) == null ? void 0 : Z.disabled);
|
|
1305
1289
|
let c = {
|
|
1306
1290
|
name: "VxeInput",
|
|
1307
1291
|
props: { disabled: r, placeholder: r ? "" : o.placeholder }
|
|
@@ -1339,10 +1323,10 @@ const deviceDetection = () => {
|
|
|
1339
1323
|
collapseTagsTooltip: !0,
|
|
1340
1324
|
multiple: !0
|
|
1341
1325
|
}, Z = h.map((t, d) => {
|
|
1342
|
-
var f, m,
|
|
1326
|
+
var f, m, u;
|
|
1343
1327
|
return t.folding = r ? c && d > 1 : c && d > 2, t.span = getDateRange(t) ? 12 : t.span || 6, t.code && !t.itemRender && (t.itemRender = renderHook.renderDict(t.code)), t.itemRender = t.itemRender || { name: "VxeInput" }, t.resetValue = t.itemRender.defaultValue, t.title = t.title || `message.${t.field}`, (t.multiple || (m = (f = t.itemRender) == null ? void 0 : f.props) != null && m.multiple) && (t.itemRender.props = Object.assign(
|
|
1344
1328
|
i,
|
|
1345
|
-
((
|
|
1329
|
+
((u = t.itemRender) == null ? void 0 : u.props) || {}
|
|
1346
1330
|
)), t;
|
|
1347
1331
|
}), e = clone(formSearchButtons, !0);
|
|
1348
1332
|
if (e.collapseNode = c, l && e.itemRender.options.length < 3 && (e.itemRender.options.push(l), e.itemRender.events = l.events), c) {
|
|
@@ -1443,11 +1427,11 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1443
1427
|
"Content-Type": "application/json",
|
|
1444
1428
|
"X-Requested-With": "XMLHttpRequest"
|
|
1445
1429
|
}
|
|
1446
|
-
},
|
|
1430
|
+
}, g = class g {
|
|
1447
1431
|
constructor() {
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1432
|
+
k(this, "router");
|
|
1433
|
+
k(this, "baseUrl", null);
|
|
1434
|
+
k(this, "getNetworkError", (l) => l ? {
|
|
1451
1435
|
400: "错误的请求",
|
|
1452
1436
|
401: "服务未授权,请重新登录",
|
|
1453
1437
|
403: "拒绝访问",
|
|
@@ -1470,25 +1454,25 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1470
1454
|
/** 重连原始请求 */
|
|
1471
1455
|
static retryOriginalRequest(l) {
|
|
1472
1456
|
return new Promise((h) => {
|
|
1473
|
-
|
|
1457
|
+
g.requests.push((o) => {
|
|
1474
1458
|
l.headers.Authorization = "Bearer " + o, h(l);
|
|
1475
1459
|
});
|
|
1476
1460
|
});
|
|
1477
1461
|
}
|
|
1478
1462
|
// 请求拦截
|
|
1479
1463
|
httpInterceptorsRequest() {
|
|
1480
|
-
|
|
1481
|
-
(l) => (has(l, "loading") && isRef(l.loading) && (l.loading.value = !0), NProgress.start(), typeof l.beforeRequestCallback == "function" ? (l.beforeRequestCallback(l), l) :
|
|
1464
|
+
g.axiosInstance.interceptors.request.use(
|
|
1465
|
+
(l) => (has(l, "loading") && isRef(l.loading) && (l.loading.value = !0), NProgress.start(), typeof l.beforeRequestCallback == "function" ? (l.beforeRequestCallback(l), l) : g.initConfig.beforeRequestCallback ? (g.initConfig.beforeRequestCallback(l), l) : ["/refreshToken", "/login"].some((o) => l.url.indexOf(o) > -1) ? l : new Promise((o) => {
|
|
1482
1466
|
const r = cookies.get(kTOKENKEY);
|
|
1483
1467
|
if (r) {
|
|
1484
1468
|
const c = JSON.parse(r), i = (/* @__PURE__ */ new Date()).getTime();
|
|
1485
|
-
c.expires - i <= 0 ? (
|
|
1469
|
+
c.expires - i <= 0 ? (g.isRefreshing || (g.isRefreshing = !0, this.get(this.baseUrl + "/uath/refreshToken", {
|
|
1486
1470
|
refreshToken: c.refreshToken
|
|
1487
1471
|
}).then((e) => {
|
|
1488
|
-
this.setToken(e), l.headers.Authorization = "Bearer " + e.access_token,
|
|
1472
|
+
this.setToken(e), l.headers.Authorization = "Bearer " + e.access_token, g.requests.forEach((t) => t(e.access_token)), g.requests = [];
|
|
1489
1473
|
}).finally(() => {
|
|
1490
|
-
|
|
1491
|
-
})), o(
|
|
1474
|
+
g.isRefreshing = !1;
|
|
1475
|
+
})), o(g.retryOriginalRequest(l))) : (l.headers.Authorization = "Bearer " + c.accessToken, o(l));
|
|
1492
1476
|
} else {
|
|
1493
1477
|
const c = cookies.get("kCookies_token");
|
|
1494
1478
|
c && (l.headers["X-Token"] = c), o(l);
|
|
@@ -1507,10 +1491,10 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1507
1491
|
}
|
|
1508
1492
|
// 响应拦截
|
|
1509
1493
|
httpInterceptorsResponse() {
|
|
1510
|
-
|
|
1494
|
+
g.axiosInstance.interceptors.response.use(
|
|
1511
1495
|
(h) => {
|
|
1512
1496
|
const o = h.config;
|
|
1513
|
-
return has(o, "loading") && isRef(o.loading) && (o.loading.value = !1), NProgress.done(), typeof o.beforeResponseCallback == "function" ? (o.beforeResponseCallback(h), h.data) : (
|
|
1497
|
+
return has(o, "loading") && isRef(o.loading) && (o.loading.value = !1), NProgress.done(), typeof o.beforeResponseCallback == "function" ? (o.beforeResponseCallback(h), h.data) : (g.initConfig.beforeResponseCallback && g.initConfig.beforeResponseCallback(h), h.data);
|
|
1514
1498
|
},
|
|
1515
1499
|
(h) => {
|
|
1516
1500
|
var r;
|
|
@@ -1534,7 +1518,7 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1534
1518
|
...r
|
|
1535
1519
|
});
|
|
1536
1520
|
return new Promise((i, Z) => {
|
|
1537
|
-
|
|
1521
|
+
g.axiosInstance.request(c).then((e) => {
|
|
1538
1522
|
if (e && (e == null ? void 0 : e.code) === "0")
|
|
1539
1523
|
i(e.data);
|
|
1540
1524
|
else if (e.code === "500")
|
|
@@ -1582,11 +1566,11 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1582
1566
|
}
|
|
1583
1567
|
};
|
|
1584
1568
|
/** token过期后,暂存待执行的请求 */
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
let SuHttp =
|
|
1569
|
+
k(g, "requests", []), /** 防止重复刷新token */
|
|
1570
|
+
k(g, "isRefreshing", !1), // 初始化配置对象
|
|
1571
|
+
k(g, "initConfig", {}), // 保存当前Axios实例对象
|
|
1572
|
+
k(g, "axiosInstance", Axios.create(defaultConfig));
|
|
1573
|
+
let SuHttp = g;
|
|
1590
1574
|
const http = new SuHttp(), lunarCalendar = {
|
|
1591
1575
|
/**
|
|
1592
1576
|
* 农历1900-2100的润大小信息表
|
|
@@ -2397,46 +2381,46 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2397
2381
|
const f = /* @__PURE__ */ new Date();
|
|
2398
2382
|
let m = !1;
|
|
2399
2383
|
f.getFullYear() === o && f.getMonth() + 1 === r && f.getDate() === c && (m = !0);
|
|
2400
|
-
let
|
|
2401
|
-
const
|
|
2402
|
-
|
|
2403
|
-
const
|
|
2384
|
+
let u = i.getDay();
|
|
2385
|
+
const V = this.nStr1[u];
|
|
2386
|
+
u === 0 && (u = 7);
|
|
2387
|
+
const p = Z;
|
|
2404
2388
|
e = this.leapMonth(Z);
|
|
2405
2389
|
let n = !1;
|
|
2406
2390
|
for (Z = 1; Z < 13 && d > 0; Z++)
|
|
2407
|
-
e > 0 && Z === e + 1 && n === !1 ? (--Z, n = !0, t = this.leapDays(
|
|
2391
|
+
e > 0 && Z === e + 1 && n === !1 ? (--Z, n = !0, t = this.leapDays(p)) : t = this.monthDays(p, Z), n === !0 && Z === e + 1 && (n = !1), d -= t;
|
|
2408
2392
|
d === 0 && e > 0 && Z === e + 1 && (n ? n = !1 : (n = !0, --Z)), d < 0 && (d += t, --Z);
|
|
2409
|
-
const
|
|
2393
|
+
const L = Z, C = d + 1, A = r - 1, w = this.toGanZhiYear(p), H = this.getTerm(o, r * 2 - 1), I = this.getTerm(o, r * 2);
|
|
2410
2394
|
let v = this.toGanZhi((o - 1900) * 12 + r + 11);
|
|
2411
|
-
c >=
|
|
2412
|
-
let
|
|
2413
|
-
|
|
2414
|
-
const s = Date.UTC(o,
|
|
2415
|
-
let F =
|
|
2416
|
-
return
|
|
2417
|
-
date:
|
|
2395
|
+
c >= H && (v = this.toGanZhi((o - 1900) * 12 + r + 12));
|
|
2396
|
+
let M = !1, b;
|
|
2397
|
+
H === c && (M = !0, b = this.solarTerm[r * 2 - 2]), I === c && (M = !0, b = this.solarTerm[r * 2 - 1]);
|
|
2398
|
+
const s = Date.UTC(o, A, 1, 0, 0, 0, 0) / 864e5 + 25567 + 10, y = this.toGanZhi(s + c - 1), S = this.toAstro(r, c), x = o + "-" + r + "-" + c, D = p + "-" + L + "-" + C, E = this.festival, N = this.lFestival, R = r + "-" + c;
|
|
2399
|
+
let F = L + "-" + C;
|
|
2400
|
+
return L === 12 && C === 29 && this.monthDays(p, L) === 29 && (F = "12-30"), {
|
|
2401
|
+
date: x,
|
|
2418
2402
|
lunarDate: D,
|
|
2419
2403
|
festival: E[R] ? E[R].title : null,
|
|
2420
2404
|
lunarFestival: N[F] ? N[F].title : null,
|
|
2421
|
-
lYear:
|
|
2422
|
-
lMonth:
|
|
2405
|
+
lYear: p,
|
|
2406
|
+
lMonth: L,
|
|
2423
2407
|
lDay: C,
|
|
2424
|
-
Animal: this.getAnimal(
|
|
2425
|
-
IMonthCn: (n ? "闰" : "") + this.toChinaMonth(
|
|
2408
|
+
Animal: this.getAnimal(p),
|
|
2409
|
+
IMonthCn: (n ? "闰" : "") + this.toChinaMonth(L),
|
|
2426
2410
|
IDayCn: this.toChinaDay(C),
|
|
2427
2411
|
cYear: o,
|
|
2428
2412
|
cMonth: r,
|
|
2429
2413
|
cDay: c,
|
|
2430
|
-
gzYear:
|
|
2414
|
+
gzYear: w,
|
|
2431
2415
|
gzMonth: v,
|
|
2432
|
-
gzDay:
|
|
2416
|
+
gzDay: y,
|
|
2433
2417
|
isToday: m,
|
|
2434
2418
|
isLeap: n,
|
|
2435
|
-
nWeek:
|
|
2436
|
-
ncWeek: "星期" +
|
|
2437
|
-
isTerm:
|
|
2438
|
-
Term:
|
|
2439
|
-
astro:
|
|
2419
|
+
nWeek: u,
|
|
2420
|
+
ncWeek: "星期" + V,
|
|
2421
|
+
isTerm: M,
|
|
2422
|
+
Term: b,
|
|
2423
|
+
astro: S
|
|
2440
2424
|
};
|
|
2441
2425
|
},
|
|
2442
2426
|
/**
|
|
@@ -2465,8 +2449,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2465
2449
|
for (e = 1; e < l; e++)
|
|
2466
2450
|
t = this.leapMonth(a), d || t <= e && t > 0 && (Z += this.leapDays(a), d = !0), Z += this.monthDays(a, e);
|
|
2467
2451
|
o && (Z += c);
|
|
2468
|
-
const f = Date.UTC(1900, 1, 30, 0, 0, 0), m = new Date((Z + h - 31) * 864e5 + f),
|
|
2469
|
-
return this.solar2lunar(
|
|
2452
|
+
const f = Date.UTC(1900, 1, 30, 0, 0, 0), m = new Date((Z + h - 31) * 864e5 + f), u = m.getUTCFullYear(), V = m.getUTCMonth() + 1, p = m.getUTCDate();
|
|
2453
|
+
return this.solar2lunar(u, V, p);
|
|
2470
2454
|
}
|
|
2471
2455
|
}, dict = storageLocal.getItem("kLov"), formats = {
|
|
2472
2456
|
formatDate: {
|