@utogether/utils 3.0.0-beta.44 → 3.0.0-beta.46
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 +333 -337
- package/dist/utils.umd.js +1 -1
- package/package.json +1 -1
package/dist/utils.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var j = Object.defineProperty;
|
|
2
2
|
var U = (l, a, o) => a in l ? j(l, a, { enumerable: !0, configurable: !0, writable: !0, value: o }) : l[a] = o;
|
|
3
|
-
var
|
|
3
|
+
var S = (l, a, o) => U(l, typeof a != "symbol" ? a + "" : a, o);
|
|
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, merge, has } from "xe-utils";
|
|
@@ -12,9 +12,9 @@ import NProgress from "nprogress";
|
|
|
12
12
|
import { default as G } from "nprogress";
|
|
13
13
|
class sessionStorageProxy {
|
|
14
14
|
constructor(a) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
S(this, "storage");
|
|
16
|
+
S(this, "prefix");
|
|
17
|
+
S(this, "addPrefix", (a) => {
|
|
18
18
|
this.prefix = a;
|
|
19
19
|
});
|
|
20
20
|
this.storage = a;
|
|
@@ -46,7 +46,7 @@ class localStorageProxy extends sessionStorageProxy {
|
|
|
46
46
|
}
|
|
47
47
|
class localforageProxy {
|
|
48
48
|
constructor() {
|
|
49
|
-
|
|
49
|
+
S(this, "storage");
|
|
50
50
|
localforage.config({
|
|
51
51
|
name: "uapp",
|
|
52
52
|
storeName: "udb"
|
|
@@ -140,8 +140,8 @@ function init(l, a) {
|
|
|
140
140
|
init({ read: DEFAULT_CODEC.decodeValue, write: DEFAULT_CODEC.encodeValue }, DEFAULT_ATTRIBUTES);
|
|
141
141
|
class Cookies {
|
|
142
142
|
constructor() {
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
S(this, "prefix", null);
|
|
144
|
+
S(this, "addPrefix", (a) => {
|
|
145
145
|
this.prefix = a;
|
|
146
146
|
});
|
|
147
147
|
}
|
|
@@ -206,45 +206,45 @@ const VxetableRender = (VXETable, {
|
|
|
206
206
|
} = Z, {
|
|
207
207
|
loading: f = !1,
|
|
208
208
|
multiple: n
|
|
209
|
-
} = i, m = useComponent(),
|
|
209
|
+
} = i, m = useComponent(), p = n ? `_${r.field}` : r.field;
|
|
210
210
|
m.setDefaultValue(i, h, r.field);
|
|
211
|
-
function
|
|
212
|
-
m.remote(
|
|
211
|
+
function u(V) {
|
|
212
|
+
m.remote(V, r.field, l);
|
|
213
213
|
}
|
|
214
|
-
function V
|
|
215
|
-
m.selectChange(
|
|
214
|
+
function M(V) {
|
|
215
|
+
m.selectChange(V, h, r.field, l, {
|
|
216
216
|
column: r,
|
|
217
217
|
datasource: "row"
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
c != null && c.input && c.input(a,
|
|
220
|
+
function C(V) {
|
|
221
|
+
c != null && c.input && c.input(a, V);
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function y() {
|
|
224
224
|
m.clear(h, r.field, l, "row");
|
|
225
225
|
}
|
|
226
|
-
function
|
|
227
|
-
!e.length &&
|
|
226
|
+
function w() {
|
|
227
|
+
!e.length && u(""), c != null && c.focus && c.focus(a, r.field);
|
|
228
228
|
}
|
|
229
229
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
230
|
-
modelValue: h[
|
|
231
|
-
"onUpdate:modelValue": (
|
|
230
|
+
modelValue: h[p],
|
|
231
|
+
"onUpdate:modelValue": (V) => h[p] = V,
|
|
232
232
|
filterable: !0,
|
|
233
233
|
remote: !0,
|
|
234
234
|
clearable: !0,
|
|
235
235
|
placeholder: "请录入关键字搜索",
|
|
236
236
|
style: "width: 100%",
|
|
237
|
-
"remote-method":
|
|
237
|
+
"remote-method": u,
|
|
238
238
|
loading: f
|
|
239
239
|
}, i, {
|
|
240
|
-
onFocus: () =>
|
|
241
|
-
onChange: (
|
|
242
|
-
onClear: () =>
|
|
243
|
-
onInput: (
|
|
244
|
-
}), _isSlot(o = e.map((
|
|
245
|
-
key:
|
|
246
|
-
label:
|
|
247
|
-
value:
|
|
240
|
+
onFocus: () => w(),
|
|
241
|
+
onChange: (V) => M(V),
|
|
242
|
+
onClear: () => y(),
|
|
243
|
+
onInput: (V) => C(V)
|
|
244
|
+
}), _isSlot(o = e.map((V) => createVNode(resolveComponent("el-option"), {
|
|
245
|
+
key: V[d],
|
|
246
|
+
label: V[t],
|
|
247
|
+
value: V[d]
|
|
248
248
|
}, null))) ? o : {
|
|
249
249
|
default: () => [o]
|
|
250
250
|
})];
|
|
@@ -264,47 +264,46 @@ const VxetableRender = (VXETable, {
|
|
|
264
264
|
value: d = "value"
|
|
265
265
|
} = Z, {
|
|
266
266
|
loading: f = !1,
|
|
267
|
-
multiple: n
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
b.remote(C, r.field, l);
|
|
267
|
+
multiple: n
|
|
268
|
+
} = i, m = useComponent(), p = n ? `_${r.field}` : r.field;
|
|
269
|
+
m.setDefaultValue(i, h, r.field);
|
|
270
|
+
function u(V) {
|
|
271
|
+
m.remote(V, r.field, l);
|
|
273
272
|
}
|
|
274
|
-
function
|
|
275
|
-
|
|
273
|
+
function M(V) {
|
|
274
|
+
m.selectChange(V, h, r.field, l, {
|
|
276
275
|
column: r,
|
|
277
276
|
datasource: "row"
|
|
278
277
|
});
|
|
279
278
|
}
|
|
280
|
-
function
|
|
281
|
-
c != null && c.input && c.input(a,
|
|
282
|
-
}
|
|
283
|
-
function k() {
|
|
284
|
-
b.clear(h, r.field, m, c, "row");
|
|
279
|
+
function C(V) {
|
|
280
|
+
c != null && c.input && c.input(a, V);
|
|
285
281
|
}
|
|
286
282
|
function y() {
|
|
287
|
-
|
|
283
|
+
m.clear(h, r.field, l, "row");
|
|
284
|
+
}
|
|
285
|
+
function w() {
|
|
286
|
+
!e.length && u(""), c != null && c.focus && c.focus(a, r.field);
|
|
288
287
|
}
|
|
289
288
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
290
|
-
modelValue: h[
|
|
291
|
-
"onUpdate:modelValue": (
|
|
289
|
+
modelValue: h[p],
|
|
290
|
+
"onUpdate:modelValue": (V) => h[p] = V,
|
|
292
291
|
filterable: !0,
|
|
293
292
|
remote: !0,
|
|
294
293
|
clearable: !0,
|
|
295
294
|
placeholder: "请录入关键字搜索",
|
|
296
295
|
style: "width: 100%",
|
|
297
|
-
"remote-method":
|
|
296
|
+
"remote-method": u,
|
|
298
297
|
loading: f
|
|
299
298
|
}, i, {
|
|
300
|
-
onFocus: () =>
|
|
301
|
-
onChange: (
|
|
302
|
-
onClear: () =>
|
|
303
|
-
onInput: (
|
|
304
|
-
}), _isSlot(o = e.map((
|
|
305
|
-
key:
|
|
306
|
-
label:
|
|
307
|
-
value:
|
|
299
|
+
onFocus: () => w(),
|
|
300
|
+
onChange: (V) => M(V),
|
|
301
|
+
onClear: () => y(),
|
|
302
|
+
onInput: (V) => C(V)
|
|
303
|
+
}), _isSlot(o = e.map((V) => createVNode(resolveComponent("el-option"), {
|
|
304
|
+
key: V[d],
|
|
305
|
+
label: V[t],
|
|
306
|
+
value: V[d]
|
|
308
307
|
}, null))) ? o : {
|
|
309
308
|
default: () => [o]
|
|
310
309
|
})];
|
|
@@ -337,47 +336,46 @@ const VxetableRender = (VXETable, {
|
|
|
337
336
|
label: t = "label",
|
|
338
337
|
value: d = "value"
|
|
339
338
|
} = Z, {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
b.remote(C, r, l);
|
|
339
|
+
multiple: f,
|
|
340
|
+
loading: n = !1
|
|
341
|
+
} = i, m = useComponent(), p = f ? `_${r}` : r;
|
|
342
|
+
m.setDefaultValue(i, h, r);
|
|
343
|
+
async function u(V) {
|
|
344
|
+
m.remote(V, r, l);
|
|
347
345
|
}
|
|
348
|
-
function
|
|
349
|
-
|
|
346
|
+
function M(V) {
|
|
347
|
+
m.selectChange(V, h, r, l, {
|
|
350
348
|
datasource: "data"
|
|
351
349
|
});
|
|
352
350
|
}
|
|
353
|
-
function
|
|
354
|
-
c != null && c.input && c.input(a,
|
|
355
|
-
}
|
|
356
|
-
function k() {
|
|
357
|
-
b.clear(h, r, f, c, "data");
|
|
351
|
+
function C(V) {
|
|
352
|
+
c != null && c.input && c.input(a, V);
|
|
358
353
|
}
|
|
359
354
|
function y() {
|
|
360
|
-
|
|
355
|
+
m.clear(h, r, l, "data");
|
|
356
|
+
}
|
|
357
|
+
function w() {
|
|
358
|
+
!e.length && u(""), c != null && c.focus && c.focus(a);
|
|
361
359
|
}
|
|
362
360
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
363
|
-
modelValue: h[
|
|
364
|
-
"onUpdate:modelValue": (
|
|
361
|
+
modelValue: h[p],
|
|
362
|
+
"onUpdate:modelValue": (V) => h[p] = V,
|
|
365
363
|
filterable: !0,
|
|
366
364
|
remote: !0,
|
|
367
365
|
clearable: !0,
|
|
368
366
|
style: "width: 100%",
|
|
369
367
|
placeholder: "请录入关键字搜索",
|
|
370
|
-
loading:
|
|
371
|
-
"remote-method":
|
|
368
|
+
loading: n,
|
|
369
|
+
"remote-method": u
|
|
372
370
|
}, i, {
|
|
373
|
-
onFocus: () =>
|
|
374
|
-
onChange: (
|
|
375
|
-
onClear: () =>
|
|
376
|
-
onInput: () =>
|
|
377
|
-
}), _isSlot(o = e.map((
|
|
378
|
-
key:
|
|
379
|
-
label:
|
|
380
|
-
value:
|
|
371
|
+
onFocus: () => w(),
|
|
372
|
+
onChange: (V) => M(V),
|
|
373
|
+
onClear: () => y(),
|
|
374
|
+
onInput: () => C()
|
|
375
|
+
}), _isSlot(o = e.map((V) => createVNode(resolveComponent("el-option"), {
|
|
376
|
+
key: V[d],
|
|
377
|
+
label: V[t],
|
|
378
|
+
value: V[d]
|
|
381
379
|
}, null))) ? o : {
|
|
382
380
|
default: () => [o]
|
|
383
381
|
})];
|
|
@@ -433,39 +431,37 @@ const VxetableRender = (VXETable, {
|
|
|
433
431
|
} = a, {
|
|
434
432
|
options: e,
|
|
435
433
|
props: i,
|
|
436
|
-
optionProps: Z = {}
|
|
437
|
-
events: c
|
|
434
|
+
optionProps: Z = {}
|
|
438
435
|
} = l, {
|
|
439
|
-
label:
|
|
440
|
-
value:
|
|
436
|
+
label: c = "label",
|
|
437
|
+
value: t = "value"
|
|
441
438
|
} = Z, {
|
|
442
|
-
multiple:
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
m
|
|
446
|
-
|
|
447
|
-
m.selectChange(p, h, r.field, l, {
|
|
439
|
+
multiple: d
|
|
440
|
+
} = i, f = useComponent(), n = d ? `_${r.field}` : r.field;
|
|
441
|
+
f.setDefaultValue(i, h, r.field);
|
|
442
|
+
function m(u) {
|
|
443
|
+
f.selectChange(u, h, r.field, l, {
|
|
448
444
|
column: r,
|
|
449
445
|
datasource: "row"
|
|
450
446
|
});
|
|
451
447
|
}
|
|
452
|
-
function
|
|
453
|
-
|
|
448
|
+
function p() {
|
|
449
|
+
f.clear(h, r.field, l, "row");
|
|
454
450
|
}
|
|
455
451
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
456
|
-
modelValue: h[
|
|
457
|
-
"onUpdate:modelValue": (
|
|
452
|
+
modelValue: h[n],
|
|
453
|
+
"onUpdate:modelValue": (u) => h[n] = u,
|
|
458
454
|
filterable: !0,
|
|
459
455
|
clearable: !0
|
|
460
456
|
}, i, {
|
|
461
457
|
style: "width: 100%",
|
|
462
458
|
class: "udp-select-wrapper",
|
|
463
|
-
onChange: (
|
|
464
|
-
onClear: () =>
|
|
465
|
-
}), _isSlot(o = e.map((
|
|
466
|
-
key:
|
|
467
|
-
label:
|
|
468
|
-
value:
|
|
459
|
+
onChange: (u) => m(u),
|
|
460
|
+
onClear: () => p()
|
|
461
|
+
}), _isSlot(o = e.map((u) => createVNode(resolveComponent("el-option"), {
|
|
462
|
+
key: u[t],
|
|
463
|
+
label: u[c],
|
|
464
|
+
value: u[t]
|
|
469
465
|
}, null))) ? o : {
|
|
470
466
|
default: () => [o]
|
|
471
467
|
})];
|
|
@@ -487,28 +483,28 @@ const VxetableRender = (VXETable, {
|
|
|
487
483
|
multiple: f
|
|
488
484
|
} = i, n = useComponent(), m = f ? `_${r.field}` : r.field;
|
|
489
485
|
n.setDefaultValue(i, h, r.field);
|
|
490
|
-
function
|
|
491
|
-
n.selectChange(
|
|
486
|
+
function p(M) {
|
|
487
|
+
n.selectChange(M, h, r.field, l, {
|
|
492
488
|
column: r,
|
|
493
489
|
datasource: "row"
|
|
494
490
|
});
|
|
495
491
|
}
|
|
496
|
-
function
|
|
492
|
+
function u() {
|
|
497
493
|
n.clear(h, r.field, l, "row");
|
|
498
494
|
}
|
|
499
495
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
500
496
|
modelValue: h[m],
|
|
501
|
-
"onUpdate:modelValue": (
|
|
497
|
+
"onUpdate:modelValue": (M) => h[m] = M,
|
|
502
498
|
filterable: !0,
|
|
503
499
|
clearable: !0
|
|
504
500
|
}, i, {
|
|
505
501
|
style: "width: 100%",
|
|
506
|
-
onChange: (
|
|
507
|
-
onClear: () =>
|
|
508
|
-
}), _isSlot(o = e.map((
|
|
509
|
-
key:
|
|
510
|
-
label: d &&
|
|
511
|
-
value:
|
|
502
|
+
onChange: (M) => p(M),
|
|
503
|
+
onClear: () => u()
|
|
504
|
+
}), _isSlot(o = e.map((M) => createVNode(resolveComponent("el-option"), {
|
|
505
|
+
key: M[t],
|
|
506
|
+
label: d && M[d] ? M[t] : M[c],
|
|
507
|
+
value: M[t]
|
|
512
508
|
}, null))) ? o : {
|
|
513
509
|
default: () => [o]
|
|
514
510
|
})];
|
|
@@ -549,27 +545,27 @@ const VxetableRender = (VXETable, {
|
|
|
549
545
|
multiple: f
|
|
550
546
|
} = i, n = f ? `_${r}` : r;
|
|
551
547
|
f && d.setDefaultValue(i, h, r);
|
|
552
|
-
function m(
|
|
553
|
-
d.selectChange(
|
|
548
|
+
function m(u) {
|
|
549
|
+
d.selectChange(u, h, r, l, {
|
|
554
550
|
datasource: "data"
|
|
555
551
|
});
|
|
556
552
|
}
|
|
557
|
-
function
|
|
553
|
+
function p() {
|
|
558
554
|
d.clear(h, r, l, "data");
|
|
559
555
|
}
|
|
560
556
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
561
557
|
modelValue: h[n],
|
|
562
|
-
"onUpdate:modelValue": (
|
|
558
|
+
"onUpdate:modelValue": (u) => h[n] = u,
|
|
563
559
|
filterable: !0,
|
|
564
560
|
clearable: !0,
|
|
565
561
|
style: "width: 100%"
|
|
566
562
|
}, i, {
|
|
567
|
-
onChange: (
|
|
568
|
-
onClear: () =>
|
|
569
|
-
}), _isSlot(o = e.map((
|
|
570
|
-
key:
|
|
571
|
-
label:
|
|
572
|
-
value:
|
|
563
|
+
onChange: (u) => m(u),
|
|
564
|
+
onClear: () => p()
|
|
565
|
+
}), _isSlot(o = e.map((u) => createVNode(resolveComponent("el-option"), {
|
|
566
|
+
key: u[t],
|
|
567
|
+
label: u[c],
|
|
568
|
+
value: u[t]
|
|
573
569
|
}, null))) ? o : {
|
|
574
570
|
default: () => [o]
|
|
575
571
|
})];
|
|
@@ -590,32 +586,32 @@ const VxetableRender = (VXETable, {
|
|
|
590
586
|
const {
|
|
591
587
|
mapField: n,
|
|
592
588
|
field: m,
|
|
593
|
-
displayName:
|
|
594
|
-
multiple:
|
|
589
|
+
displayName: p,
|
|
590
|
+
multiple: u
|
|
595
591
|
} = r;
|
|
596
|
-
if (
|
|
597
|
-
if (
|
|
598
|
-
const
|
|
599
|
-
o[
|
|
600
|
-
for (const
|
|
601
|
-
|
|
602
|
-
return
|
|
603
|
-
}, ""), Object.assign(o,
|
|
592
|
+
if (u) {
|
|
593
|
+
if (u) {
|
|
594
|
+
const C = {};
|
|
595
|
+
o[p || m] = d.reduce((y, w) => {
|
|
596
|
+
for (const V in n)
|
|
597
|
+
C[V] = y ? C[V] + "," + w[n[V]] : w[n[V]];
|
|
598
|
+
return y = y ? y + "," + w[p || m] : w[p || m], y;
|
|
599
|
+
}, ""), Object.assign(o, C);
|
|
604
600
|
}
|
|
605
601
|
} else {
|
|
606
|
-
const
|
|
607
|
-
[
|
|
602
|
+
const C = {
|
|
603
|
+
[p || m]: d[f || p || m]
|
|
608
604
|
};
|
|
609
|
-
for (const
|
|
610
|
-
|
|
611
|
-
Object.assign(o,
|
|
605
|
+
for (const y in n)
|
|
606
|
+
C[y] = d[n[y]];
|
|
607
|
+
Object.assign(o, C);
|
|
612
608
|
}
|
|
613
|
-
const
|
|
609
|
+
const M = {
|
|
614
610
|
data: o,
|
|
615
611
|
options: d,
|
|
616
612
|
field: m
|
|
617
613
|
};
|
|
618
|
-
e != null && e.change && e.change(
|
|
614
|
+
e != null && e.change && e.change(M);
|
|
619
615
|
}
|
|
620
616
|
function t() {
|
|
621
617
|
i.clear(o, h, l, "data");
|
|
@@ -642,23 +638,23 @@ const VxetableRender = (VXETable, {
|
|
|
642
638
|
mapField: f,
|
|
643
639
|
field: n,
|
|
644
640
|
displayName: m,
|
|
645
|
-
multiple:
|
|
641
|
+
multiple: p
|
|
646
642
|
} = r;
|
|
647
|
-
if (!
|
|
648
|
-
const
|
|
643
|
+
if (!p) {
|
|
644
|
+
const M = {
|
|
649
645
|
[m || n]: t[d || m || n]
|
|
650
646
|
};
|
|
651
|
-
for (const
|
|
652
|
-
|
|
653
|
-
Object.assign(o,
|
|
647
|
+
for (const C in f)
|
|
648
|
+
M[C] = t[f[C]];
|
|
649
|
+
Object.assign(o, M);
|
|
654
650
|
}
|
|
655
|
-
const
|
|
651
|
+
const u = {
|
|
656
652
|
row: o,
|
|
657
653
|
options: t,
|
|
658
654
|
field: h.field,
|
|
659
655
|
column: h
|
|
660
656
|
};
|
|
661
|
-
e != null && e.change && e.change(
|
|
657
|
+
e != null && e.change && e.change(u);
|
|
662
658
|
}
|
|
663
659
|
function c() {
|
|
664
660
|
i.clear(o, h.field, l, "row");
|
|
@@ -686,23 +682,23 @@ const VxetableRender = (VXETable, {
|
|
|
686
682
|
mapField: f,
|
|
687
683
|
field: n,
|
|
688
684
|
displayName: m,
|
|
689
|
-
multiple:
|
|
685
|
+
multiple: p
|
|
690
686
|
} = r;
|
|
691
|
-
if (!
|
|
692
|
-
const
|
|
687
|
+
if (!p) {
|
|
688
|
+
const M = {
|
|
693
689
|
[m || n]: t[d || m || n]
|
|
694
690
|
};
|
|
695
|
-
for (const
|
|
696
|
-
|
|
697
|
-
Object.assign(o,
|
|
691
|
+
for (const C in f)
|
|
692
|
+
M[C] = t[f[C]];
|
|
693
|
+
Object.assign(o, M);
|
|
698
694
|
}
|
|
699
|
-
const
|
|
695
|
+
const u = {
|
|
700
696
|
row: o,
|
|
701
697
|
options: t,
|
|
702
698
|
field: h.field,
|
|
703
699
|
column: h
|
|
704
700
|
};
|
|
705
|
-
e != null && e.change && e.change(
|
|
701
|
+
e != null && e.change && e.change(u);
|
|
706
702
|
}
|
|
707
703
|
function c() {
|
|
708
704
|
i.clear(o, h.field, l, "row");
|
|
@@ -1058,18 +1054,18 @@ const VxetableRender = (VXETable, {
|
|
|
1058
1054
|
url: f,
|
|
1059
1055
|
defaultParams: n = {},
|
|
1060
1056
|
method: m = "get"
|
|
1061
|
-
} = c,
|
|
1057
|
+
} = c, p = getCookieParam(), u = Object.assign({
|
|
1062
1058
|
pageSize: 20,
|
|
1063
1059
|
pageNum: 1,
|
|
1064
|
-
...
|
|
1060
|
+
...p,
|
|
1065
1061
|
...n
|
|
1066
1062
|
}, {
|
|
1067
1063
|
[d || e]: r
|
|
1068
1064
|
});
|
|
1069
1065
|
if (c.loading) return;
|
|
1070
|
-
let
|
|
1066
|
+
let M;
|
|
1071
1067
|
try {
|
|
1072
|
-
Z.length = 0, c.loading = !0,
|
|
1068
|
+
Z.length = 0, c.loading = !0, M = await serviceApi[m](f, u), t != null && t.filterMethod ? Z.push(...t.filterMethod(M.list || M)) : M && (M.list ? Z.push(...M.list) : Z.push(...M));
|
|
1073
1069
|
} finally {
|
|
1074
1070
|
c.loading = !1;
|
|
1075
1071
|
}
|
|
@@ -1082,26 +1078,26 @@ const VxetableRender = (VXETable, {
|
|
|
1082
1078
|
options: f,
|
|
1083
1079
|
props: n,
|
|
1084
1080
|
optionProps: m = {},
|
|
1085
|
-
events:
|
|
1086
|
-
} = Z,
|
|
1081
|
+
events: p
|
|
1082
|
+
} = Z, u = {
|
|
1087
1083
|
[d]: e,
|
|
1088
1084
|
field: i
|
|
1089
1085
|
};
|
|
1090
|
-
e[i] = null, !isEmpty(r) && (n != null && n.multiple) ? (e[i] = r.join(","), t = [], r.forEach((
|
|
1091
|
-
const
|
|
1092
|
-
|
|
1093
|
-
const
|
|
1094
|
-
e[
|
|
1095
|
-
}),
|
|
1096
|
-
}), Object.assign(
|
|
1086
|
+
e[i] = null, !isEmpty(r) && (n != null && n.multiple) ? (e[i] = r.join(","), t = [], r.forEach((M) => {
|
|
1087
|
+
const C = f.find((y) => M === y[m == null ? void 0 : m.value]);
|
|
1088
|
+
C && !isEmpty(n.mapField) && isObject(n.mapField) && Object.keys(n.mapField).forEach((y) => {
|
|
1089
|
+
const w = C[n.mapField[y]], V = e[y] ? e[y].toString() : "";
|
|
1090
|
+
e[y] = V && !V.includes(w) ? `${V},${w}` : w;
|
|
1091
|
+
}), C && t.push(C);
|
|
1092
|
+
}), Object.assign(u, {
|
|
1097
1093
|
options: t
|
|
1098
|
-
})) : (e[i] = n != null && n.multiple ? null : r, t = f.find((
|
|
1099
|
-
e[
|
|
1100
|
-
}), Object.assign(
|
|
1094
|
+
})) : (e[i] = n != null && n.multiple ? null : r, t = f.find((M) => r === M[m == null ? void 0 : m.value]), !isEmpty(n.mapField) && isObject(n.mapField) && Object.keys(n.mapField).forEach((M) => {
|
|
1095
|
+
e[M] = t ? t[n.mapField[M]] : null;
|
|
1096
|
+
}), Object.assign(u, {
|
|
1101
1097
|
option: t
|
|
1102
|
-
})), d === "row" && Object.assign(
|
|
1098
|
+
})), d === "row" && Object.assign(u, {
|
|
1103
1099
|
column: c.column
|
|
1104
|
-
}),
|
|
1100
|
+
}), p != null && p.change && p.change(u);
|
|
1105
1101
|
},
|
|
1106
1102
|
setDefaultValue: (r, e, i) => {
|
|
1107
1103
|
var d;
|
|
@@ -1189,8 +1185,8 @@ function useWatermark(l = ref(document.body)) {
|
|
|
1189
1185
|
function e(t, d) {
|
|
1190
1186
|
const f = document.createElement("canvas"), n = 260, m = 180;
|
|
1191
1187
|
Object.assign(f, { width: n, height: m });
|
|
1192
|
-
const
|
|
1193
|
-
return
|
|
1188
|
+
const p = f.getContext("2d");
|
|
1189
|
+
return p && (p.rotate(-20 * Math.PI / 120), p.font = (d == null ? void 0 : d.font) ?? "15px Reggae One", p.fillStyle = (d == null ? void 0 : d.fillStyle) ?? "rgba(180, 180, 180, 0.75)", p.textAlign = "left", p.textBaseline = "middle", p.fillText(t, n / 20, m)), f.toDataURL("image/png");
|
|
1194
1190
|
}
|
|
1195
1191
|
function i(t = {}) {
|
|
1196
1192
|
const d = unref(h);
|
|
@@ -1206,8 +1202,8 @@ function useWatermark(l = ref(document.body)) {
|
|
|
1206
1202
|
h.value = f, f.id = o, f.style.pointerEvents = "none", f.style.top = "0px", f.style.left = "0px", f.style.position = "absolute", f.style.zIndex = "100000";
|
|
1207
1203
|
const n = unref(l);
|
|
1208
1204
|
if (!n) return o;
|
|
1209
|
-
const { clientHeight: m, clientWidth:
|
|
1210
|
-
return i({ str: t, width:
|
|
1205
|
+
const { clientHeight: m, clientWidth: p } = n;
|
|
1206
|
+
return i({ str: t, width: p, height: m, attr: d }), n.appendChild(f), o;
|
|
1211
1207
|
};
|
|
1212
1208
|
function c(t, d) {
|
|
1213
1209
|
Z(t, d), addResizeListener(document.documentElement, a), getCurrentInstance() && onBeforeUnmount(() => {
|
|
@@ -1230,36 +1226,36 @@ function useAttrs(l = {}) {
|
|
|
1230
1226
|
}), r;
|
|
1231
1227
|
}
|
|
1232
1228
|
const i18n = window.$i18n, useRender = () => {
|
|
1233
|
-
const l = { value: "dictCode", label: "dictName" }, a = (v,
|
|
1234
|
-
var
|
|
1235
|
-
const
|
|
1229
|
+
const l = { value: "dictCode", label: "dictName" }, a = (v, H) => {
|
|
1230
|
+
var N;
|
|
1231
|
+
const b = g(H);
|
|
1236
1232
|
let s = {
|
|
1237
1233
|
clearable: !0,
|
|
1238
1234
|
disabled: !1,
|
|
1239
1235
|
showValue: !1,
|
|
1240
1236
|
placeholder: null
|
|
1241
|
-
},
|
|
1242
|
-
isObject(v) ? (s = Object.assign(s, v),
|
|
1243
|
-
const
|
|
1237
|
+
}, L, k;
|
|
1238
|
+
isObject(v) ? (s = Object.assign(s, v), L = v.defaultValue, k = v == null ? void 0 : v.code) : k = v;
|
|
1239
|
+
const x = (N = storageLocal.getItem("kLov")[k]) == null ? void 0 : N.children, D = x ? x.filter((E) => E.enabled === "1") : [];
|
|
1244
1240
|
return {
|
|
1245
1241
|
name: "#select",
|
|
1246
1242
|
optionProps: l,
|
|
1247
|
-
options:
|
|
1243
|
+
options: D,
|
|
1248
1244
|
props: s,
|
|
1249
|
-
defaultValue:
|
|
1250
|
-
events:
|
|
1245
|
+
defaultValue: L,
|
|
1246
|
+
events: b
|
|
1251
1247
|
};
|
|
1252
|
-
}, o = (v,
|
|
1253
|
-
const
|
|
1248
|
+
}, o = (v, H) => {
|
|
1249
|
+
const b = g(H);
|
|
1254
1250
|
return {
|
|
1255
1251
|
name: "#SuSelect",
|
|
1256
1252
|
optionProps: (v == null ? void 0 : v.optionProps) || { label: "label", value: "value" },
|
|
1257
1253
|
props: v == null ? void 0 : v.props,
|
|
1258
1254
|
options: (v == null ? void 0 : v.options) || [],
|
|
1259
|
-
events:
|
|
1255
|
+
events: b
|
|
1260
1256
|
};
|
|
1261
|
-
}, h = (v,
|
|
1262
|
-
const
|
|
1257
|
+
}, h = (v, H) => {
|
|
1258
|
+
const b = {
|
|
1263
1259
|
optionProps: { extLabel: "userName", value: "employeeName" },
|
|
1264
1260
|
props: {
|
|
1265
1261
|
attrs: { disabled: v == null ? void 0 : v.disabled },
|
|
@@ -1270,20 +1266,20 @@ const i18n = window.$i18n, useRender = () => {
|
|
|
1270
1266
|
fetchField: "employeeName"
|
|
1271
1267
|
}
|
|
1272
1268
|
};
|
|
1273
|
-
return o(
|
|
1269
|
+
return o(b, H);
|
|
1274
1270
|
}, r = (v) => {
|
|
1275
|
-
const
|
|
1271
|
+
const H = {
|
|
1276
1272
|
optionProps: { label: "userName", value: "userName" },
|
|
1277
1273
|
props: {
|
|
1278
1274
|
code: "sys/listUsers",
|
|
1279
1275
|
url: "/uums/user",
|
|
1280
|
-
fetchField: "
|
|
1276
|
+
fetchField: "userName",
|
|
1281
1277
|
mapField: v == null ? void 0 : v.mapField
|
|
1282
1278
|
}
|
|
1283
1279
|
};
|
|
1284
|
-
return o(
|
|
1285
|
-
}, e = (v,
|
|
1286
|
-
const
|
|
1280
|
+
return o(H);
|
|
1281
|
+
}, e = (v, H) => {
|
|
1282
|
+
const b = {
|
|
1287
1283
|
label: "organizationName",
|
|
1288
1284
|
value: (v == null ? void 0 : v.field) || "organizationName"
|
|
1289
1285
|
}, s = {
|
|
@@ -1292,19 +1288,19 @@ const i18n = window.$i18n, useRender = () => {
|
|
|
1292
1288
|
disabled: v == null ? void 0 : v.disabled,
|
|
1293
1289
|
url: "/uums/cusOrganization",
|
|
1294
1290
|
fetchField: "organizationName"
|
|
1295
|
-
},
|
|
1291
|
+
}, L = {
|
|
1296
1292
|
organizationId: "id",
|
|
1297
1293
|
organizationCode: "organizationCode"
|
|
1298
1294
|
};
|
|
1299
|
-
return Object.assign(s.mapField,
|
|
1295
|
+
return Object.assign(s.mapField, L, (v == null ? void 0 : v.mapField) || {}), {
|
|
1300
1296
|
name: "#SuSelect",
|
|
1301
1297
|
props: s,
|
|
1302
|
-
optionProps:
|
|
1298
|
+
optionProps: b,
|
|
1303
1299
|
options: [],
|
|
1304
|
-
events:
|
|
1300
|
+
events: g(H)
|
|
1305
1301
|
};
|
|
1306
|
-
}, i = (v,
|
|
1307
|
-
const
|
|
1302
|
+
}, i = (v, H) => {
|
|
1303
|
+
const b = {
|
|
1308
1304
|
label: "orgName",
|
|
1309
1305
|
value: (v == null ? void 0 : v.field) || "orgName"
|
|
1310
1306
|
}, s = {
|
|
@@ -1313,50 +1309,50 @@ const i18n = window.$i18n, useRender = () => {
|
|
|
1313
1309
|
defaultParams: v == null ? void 0 : v.defaultParams,
|
|
1314
1310
|
url: "/uums/org",
|
|
1315
1311
|
fetchField: "orgName"
|
|
1316
|
-
},
|
|
1317
|
-
return Object.assign(s.mapField,
|
|
1312
|
+
}, L = { orgId: "id", orgCode: "orgCode" };
|
|
1313
|
+
return Object.assign(s.mapField, L, (v == null ? void 0 : v.mapField) || {}), {
|
|
1318
1314
|
name: "#SuSelect",
|
|
1319
1315
|
props: s,
|
|
1320
|
-
optionProps:
|
|
1316
|
+
optionProps: b,
|
|
1321
1317
|
options: [],
|
|
1322
|
-
events:
|
|
1318
|
+
events: g(H)
|
|
1323
1319
|
};
|
|
1324
|
-
}, Z = (v,
|
|
1325
|
-
const
|
|
1320
|
+
}, Z = (v, H) => {
|
|
1321
|
+
const b = Object.assign({ disabled: !1 }, v), s = b == null ? void 0 : b.defaultValue;
|
|
1326
1322
|
return {
|
|
1327
1323
|
name: "VxeInput",
|
|
1328
|
-
props:
|
|
1324
|
+
props: b,
|
|
1329
1325
|
defaultValue: s,
|
|
1330
|
-
events:
|
|
1326
|
+
events: g(H)
|
|
1331
1327
|
};
|
|
1332
|
-
}, c = (v,
|
|
1333
|
-
const
|
|
1328
|
+
}, c = (v, H) => {
|
|
1329
|
+
const b = Object.assign({ disabled: !1, rows: 3 }, v), s = b == null ? void 0 : b.defaultValue;
|
|
1334
1330
|
return {
|
|
1335
1331
|
name: "VxeTextarea",
|
|
1336
|
-
props:
|
|
1332
|
+
props: b,
|
|
1337
1333
|
defaultValue: s,
|
|
1338
|
-
events:
|
|
1334
|
+
events: g(H)
|
|
1339
1335
|
};
|
|
1340
|
-
}, t = (v,
|
|
1341
|
-
const
|
|
1342
|
-
return { name:
|
|
1343
|
-
}, d = (v,
|
|
1344
|
-
const
|
|
1345
|
-
return { name:
|
|
1336
|
+
}, t = (v, H) => {
|
|
1337
|
+
const b = "VxeCheckboxGroup", { defaultValue: s, options: L, props: k } = f(v);
|
|
1338
|
+
return { name: b, defaultValue: s, options: L, props: k, events: g(H) };
|
|
1339
|
+
}, d = (v, H) => {
|
|
1340
|
+
const b = "VxeRadioGroup", { defaultValue: s, options: L, props: k } = f(v);
|
|
1341
|
+
return { name: b, defaultValue: s, options: L, props: k, events: g(H) };
|
|
1346
1342
|
}, f = (v) => {
|
|
1347
|
-
var
|
|
1348
|
-
let
|
|
1343
|
+
var x;
|
|
1344
|
+
let H = { disabled: !1 }, b;
|
|
1349
1345
|
const s = storageLocal.getItem("kLov");
|
|
1350
|
-
let
|
|
1351
|
-
isObject(v) ? (
|
|
1352
|
-
const
|
|
1346
|
+
let L = "";
|
|
1347
|
+
isObject(v) ? (b = v.defaultValue, L = v.code, v.options ? H = Object.assign(H, v.props || {}) : H = Object.assign(H, v || {})) : isString(v) && (L = v);
|
|
1348
|
+
const k = L ? (x = s[L]) == null ? void 0 : x.children.map((D) => ({ label: D.dictName, value: D.dictCode })) : [];
|
|
1353
1349
|
return {
|
|
1354
|
-
props:
|
|
1355
|
-
defaultValue:
|
|
1356
|
-
options: isObject(v) && v.options ? v.options :
|
|
1350
|
+
props: H,
|
|
1351
|
+
defaultValue: b,
|
|
1352
|
+
options: isObject(v) && v.options ? v.options : k
|
|
1357
1353
|
};
|
|
1358
|
-
}, n = (v,
|
|
1359
|
-
const
|
|
1354
|
+
}, n = (v, H) => {
|
|
1355
|
+
const b = g(H);
|
|
1360
1356
|
return {
|
|
1361
1357
|
name: "VxeNumberInput",
|
|
1362
1358
|
props: Object.assign(
|
|
@@ -1364,13 +1360,13 @@ const i18n = window.$i18n, useRender = () => {
|
|
|
1364
1360
|
v || {}
|
|
1365
1361
|
),
|
|
1366
1362
|
defaultValue: v == null ? void 0 : v.defaultValue,
|
|
1367
|
-
events:
|
|
1363
|
+
events: b
|
|
1368
1364
|
};
|
|
1369
|
-
}, m = (v,
|
|
1370
|
-
const
|
|
1371
|
-
return { name: "VxeDatePicker", props: Object.assign({ type: "date", valueFormat: s, clearable: !0 }, v || {}), defaultValue:
|
|
1372
|
-
},
|
|
1373
|
-
const
|
|
1365
|
+
}, m = (v, H) => {
|
|
1366
|
+
const b = g(H), s = "yyyy-MM-dd HH:mm:ss", L = v == null ? void 0 : v.defaultValue;
|
|
1367
|
+
return { name: "VxeDatePicker", props: Object.assign({ type: "date", valueFormat: s, clearable: !0 }, v || {}), defaultValue: L, events: b };
|
|
1368
|
+
}, p = (v, H) => {
|
|
1369
|
+
const b = g(H), s = "yyyy-MM-dd HH:mm:ss", L = v == null ? void 0 : v.startValue, k = v == null ? void 0 : v.endValue, x = v == null ? void 0 : v.startField, D = v == null ? void 0 : v.endField, N = {
|
|
1374
1370
|
type: "date",
|
|
1375
1371
|
valueFormat: s,
|
|
1376
1372
|
clearable: !0,
|
|
@@ -1407,24 +1403,24 @@ const i18n = window.$i18n, useRender = () => {
|
|
|
1407
1403
|
}
|
|
1408
1404
|
]
|
|
1409
1405
|
}
|
|
1410
|
-
}, E = Object.assign(
|
|
1406
|
+
}, E = Object.assign(N, v || {});
|
|
1411
1407
|
return {
|
|
1412
1408
|
name: "VxeDateRangePicker",
|
|
1413
|
-
startField:
|
|
1414
|
-
endField:
|
|
1415
|
-
startValue:
|
|
1416
|
-
endValue:
|
|
1409
|
+
startField: x,
|
|
1410
|
+
endField: D,
|
|
1411
|
+
startValue: L,
|
|
1412
|
+
endValue: k,
|
|
1417
1413
|
props: E,
|
|
1418
|
-
events:
|
|
1414
|
+
events: b
|
|
1419
1415
|
};
|
|
1420
|
-
},
|
|
1421
|
-
const
|
|
1422
|
-
return { name: "#lov", props: Object.assign({}, v || {}), events:
|
|
1423
|
-
},
|
|
1424
|
-
const
|
|
1416
|
+
}, u = (v, H) => {
|
|
1417
|
+
const b = g(H);
|
|
1418
|
+
return { name: "#lov", props: Object.assign({}, v || {}), events: b };
|
|
1419
|
+
}, M = (v, H) => {
|
|
1420
|
+
const b = g(H), s = (v == null ? void 0 : v.optionProps) || {
|
|
1425
1421
|
label: "label",
|
|
1426
1422
|
value: "value"
|
|
1427
|
-
},
|
|
1423
|
+
}, L = Object.assign(
|
|
1428
1424
|
{ clearable: !0, disabled: !1, showValue: !1 },
|
|
1429
1425
|
v || {}
|
|
1430
1426
|
);
|
|
@@ -1432,60 +1428,60 @@ const i18n = window.$i18n, useRender = () => {
|
|
|
1432
1428
|
name: "#select",
|
|
1433
1429
|
optionProps: s,
|
|
1434
1430
|
options: (v == null ? void 0 : v.options) || [],
|
|
1435
|
-
props:
|
|
1436
|
-
events:
|
|
1431
|
+
props: L,
|
|
1432
|
+
events: b
|
|
1437
1433
|
};
|
|
1438
|
-
},
|
|
1439
|
-
let
|
|
1434
|
+
}, C = (v, H) => {
|
|
1435
|
+
let b = {
|
|
1440
1436
|
openLabel: "是",
|
|
1441
1437
|
closeLabel: "否",
|
|
1442
1438
|
openValue: "Y",
|
|
1443
1439
|
closeValue: "N"
|
|
1444
1440
|
}, s = "Y";
|
|
1445
|
-
isObject(v) && !isFunction(v) ? (
|
|
1446
|
-
const
|
|
1447
|
-
return { name: "VxeSwitch", props:
|
|
1448
|
-
},
|
|
1449
|
-
const
|
|
1441
|
+
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 }));
|
|
1442
|
+
const L = isFunction(v) ? g(v) : g(H);
|
|
1443
|
+
return { name: "VxeSwitch", props: b, defaultValue: s, events: L };
|
|
1444
|
+
}, y = (v, H) => ({ name: "#tag", props: { code: v, tagMap: H } }), w = (v, H) => {
|
|
1445
|
+
const b = {
|
|
1450
1446
|
openLabel: "启用",
|
|
1451
1447
|
closeLabel: "禁用",
|
|
1452
1448
|
openValue: "1",
|
|
1453
1449
|
closeValue: "0",
|
|
1454
1450
|
defaultValue: "1"
|
|
1455
1451
|
};
|
|
1456
|
-
!isFunction(v) && isObject(v) && Object.assign(
|
|
1457
|
-
const s = isFunction(v) ? v :
|
|
1458
|
-
return
|
|
1459
|
-
},
|
|
1460
|
-
const
|
|
1452
|
+
!isFunction(v) && isObject(v) && Object.assign(b, v);
|
|
1453
|
+
const s = isFunction(v) ? v : H;
|
|
1454
|
+
return C(b, s);
|
|
1455
|
+
}, V = () => ({ name: "#iconSelect" }), R = (v = [], H = {}, b) => ({ name: "#treeSelect", sourceData: v, props: H, events: b }), T = (v, H) => {
|
|
1456
|
+
const b = g(H);
|
|
1461
1457
|
return {
|
|
1462
1458
|
name: "#area",
|
|
1463
1459
|
props: { mapField: (v == null ? void 0 : v.mapField) || ["province", "city", "region"] },
|
|
1464
|
-
events:
|
|
1460
|
+
events: b
|
|
1465
1461
|
};
|
|
1466
|
-
},
|
|
1467
|
-
let
|
|
1468
|
-
return isObject(v) && !isFunction(v) ?
|
|
1469
|
-
change: (v == null ? void 0 : v.change) ||
|
|
1470
|
-
blur: (v == null ? void 0 : v.blur) ||
|
|
1471
|
-
focus: (v == null ? void 0 : v.focus) ||
|
|
1472
|
-
input: (v == null ? void 0 : v.input) ||
|
|
1473
|
-
clear: (v == null ? void 0 : v.clear) ||
|
|
1462
|
+
}, g = (v) => {
|
|
1463
|
+
let H = {};
|
|
1464
|
+
return isObject(v) && !isFunction(v) ? H = {
|
|
1465
|
+
change: (v == null ? void 0 : v.change) || I,
|
|
1466
|
+
blur: (v == null ? void 0 : v.blur) || I,
|
|
1467
|
+
focus: (v == null ? void 0 : v.focus) || I,
|
|
1468
|
+
input: (v == null ? void 0 : v.input) || I,
|
|
1469
|
+
clear: (v == null ? void 0 : v.clear) || I,
|
|
1474
1470
|
searchClick: v == null ? void 0 : v.searchClick,
|
|
1475
1471
|
suffixClick: v == null ? void 0 : v.suffixClick,
|
|
1476
1472
|
prefixClick: v == null ? void 0 : v.prefixClick,
|
|
1477
1473
|
filterMethod: v == null ? void 0 : v.filterMethod
|
|
1478
|
-
} : v && (
|
|
1479
|
-
},
|
|
1474
|
+
} : v && (H = { change: v }), H;
|
|
1475
|
+
}, F = (v, H) => {
|
|
1480
1476
|
v = v || { fieldType: "string", mode: "image" };
|
|
1481
|
-
const { singleMode:
|
|
1482
|
-
return
|
|
1477
|
+
const { singleMode: b, mode: s } = v;
|
|
1478
|
+
return b && Object.assign(v, {
|
|
1483
1479
|
multiple: !1,
|
|
1484
1480
|
limitCount: 1,
|
|
1485
1481
|
autoHiddenButton: !0
|
|
1486
|
-
}), s === "image" && (v.imageTypes = ["jpg", "jpeg", "png", "gif", "apk"]), { name: "#upload", props: v, events:
|
|
1482
|
+
}), s === "image" && (v.imageTypes = ["jpg", "jpeg", "png", "gif", "apk"]), { name: "#upload", props: v, events: H };
|
|
1487
1483
|
};
|
|
1488
|
-
function
|
|
1484
|
+
function I() {
|
|
1489
1485
|
}
|
|
1490
1486
|
return {
|
|
1491
1487
|
renderDict: a,
|
|
@@ -1499,17 +1495,17 @@ const i18n = window.$i18n, useRender = () => {
|
|
|
1499
1495
|
renderInvOrg: e,
|
|
1500
1496
|
renderBU: i,
|
|
1501
1497
|
renderNumber: n,
|
|
1502
|
-
renderLov:
|
|
1503
|
-
renderSelectLocal:
|
|
1498
|
+
renderLov: u,
|
|
1499
|
+
renderSelectLocal: M,
|
|
1504
1500
|
renderDate: m,
|
|
1505
|
-
renderRangeDate:
|
|
1506
|
-
renderSwitch:
|
|
1507
|
-
renderCellTag:
|
|
1508
|
-
renderEnabled:
|
|
1509
|
-
renderIconSelect:
|
|
1510
|
-
renderTreeSelect:
|
|
1501
|
+
renderRangeDate: p,
|
|
1502
|
+
renderSwitch: C,
|
|
1503
|
+
renderCellTag: y,
|
|
1504
|
+
renderEnabled: w,
|
|
1505
|
+
renderIconSelect: V,
|
|
1506
|
+
renderTreeSelect: R,
|
|
1511
1507
|
renderArea: T,
|
|
1512
|
-
renderUpload:
|
|
1508
|
+
renderUpload: F
|
|
1513
1509
|
};
|
|
1514
1510
|
}, useGlobal = () => {
|
|
1515
1511
|
const l = getCurrentInstance();
|
|
@@ -1728,11 +1724,11 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1728
1724
|
"Content-Type": "application/json",
|
|
1729
1725
|
"X-Requested-With": "XMLHttpRequest"
|
|
1730
1726
|
}
|
|
1731
|
-
},
|
|
1727
|
+
}, A = class A {
|
|
1732
1728
|
constructor() {
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1729
|
+
S(this, "router");
|
|
1730
|
+
S(this, "baseUrl", null);
|
|
1731
|
+
S(this, "getNetworkError", (a) => a ? {
|
|
1736
1732
|
400: "错误的请求",
|
|
1737
1733
|
401: "服务未授权,请重新登录",
|
|
1738
1734
|
403: "拒绝访问",
|
|
@@ -1755,27 +1751,27 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1755
1751
|
/** 重连原始请求 */
|
|
1756
1752
|
static retryOriginalRequest(a) {
|
|
1757
1753
|
return new Promise((o) => {
|
|
1758
|
-
|
|
1754
|
+
A.requests.push((h) => {
|
|
1759
1755
|
a.headers.Authorization = "Bearer " + h, o(a);
|
|
1760
1756
|
});
|
|
1761
1757
|
});
|
|
1762
1758
|
}
|
|
1763
1759
|
// 请求拦截
|
|
1764
1760
|
httpInterceptorsRequest() {
|
|
1765
|
-
|
|
1766
|
-
(a) => (has(a, "loading") && isRef(a.loading) && (a.loading.value = !0), NProgress.start(), typeof a.beforeRequestCallback == "function" ? (a.beforeRequestCallback(a), a) :
|
|
1761
|
+
A.axiosInstance.interceptors.request.use(
|
|
1762
|
+
(a) => (has(a, "loading") && isRef(a.loading) && (a.loading.value = !0), NProgress.start(), typeof a.beforeRequestCallback == "function" ? (a.beforeRequestCallback(a), a) : A.initConfig.beforeRequestCallback ? (A.initConfig.beforeRequestCallback(a), a) : ["/refreshToken", "/login"].some((h) => a.url.indexOf(h) > -1) ? a : new Promise((h) => {
|
|
1767
1763
|
const r = cookies.get(kTOKENKEY);
|
|
1768
1764
|
if (r) {
|
|
1769
1765
|
const e = JSON.parse(r), i = (/* @__PURE__ */ new Date()).getTime();
|
|
1770
|
-
e.expires - i <= 0 ? (
|
|
1766
|
+
e.expires - i <= 0 ? (A.isRefreshing || (A.isRefreshing = !0, this.get(this.baseUrl + "/uath/refreshToken", {
|
|
1771
1767
|
refreshToken: e.refreshToken
|
|
1772
1768
|
}).then((c) => {
|
|
1773
|
-
c != null && c.access_token ? (this.setToken(c), a.headers.Authorization = "Bearer " + c.access_token,
|
|
1769
|
+
c != null && c.access_token ? (this.setToken(c), a.headers.Authorization = "Bearer " + c.access_token, A.requests.forEach((t) => t(c.access_token)), A.requests = []) : this.routeToLogin();
|
|
1774
1770
|
}).catch(() => {
|
|
1775
1771
|
this.routeToLogin();
|
|
1776
1772
|
}).finally(() => {
|
|
1777
|
-
|
|
1778
|
-
})), h(
|
|
1773
|
+
A.isRefreshing = !1;
|
|
1774
|
+
})), h(A.retryOriginalRequest(a))) : (a.headers.Authorization = "Bearer " + e.accessToken, h(a));
|
|
1779
1775
|
} else {
|
|
1780
1776
|
const e = cookies.get("kCookies_token");
|
|
1781
1777
|
e && (a.headers["X-Token"] = e), h(a);
|
|
@@ -1793,14 +1789,14 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1793
1789
|
cookies.set(kTOKENKEY, JSON.stringify(e));
|
|
1794
1790
|
}
|
|
1795
1791
|
routeToLogin() {
|
|
1796
|
-
|
|
1792
|
+
A.requests = [], cookies.remove("kCookies_token"), cookies.remove("authorized-token"), cookies.remove("loginer"), this.router.push({ name: "login" });
|
|
1797
1793
|
}
|
|
1798
1794
|
// 响应拦截
|
|
1799
1795
|
httpInterceptorsResponse() {
|
|
1800
|
-
|
|
1796
|
+
A.axiosInstance.interceptors.response.use(
|
|
1801
1797
|
(o) => {
|
|
1802
1798
|
const h = o.config;
|
|
1803
|
-
return has(h, "loading") && isRef(h.loading) && (h.loading.value = !1), NProgress.done(), typeof h.beforeResponseCallback == "function" ? (h.beforeResponseCallback(o), o.data) :
|
|
1799
|
+
return has(h, "loading") && isRef(h.loading) && (h.loading.value = !1), NProgress.done(), typeof h.beforeResponseCallback == "function" ? (h.beforeResponseCallback(o), o.data) : A.initConfig.beforeResponseCallback ? (A.initConfig.beforeResponseCallback(o), o.data) : !o.data && o.msg ? Promise.reject(o.msg) : o.data;
|
|
1804
1800
|
},
|
|
1805
1801
|
(o) => {
|
|
1806
1802
|
var r;
|
|
@@ -1824,7 +1820,7 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1824
1820
|
...r
|
|
1825
1821
|
});
|
|
1826
1822
|
return new Promise((i, Z) => {
|
|
1827
|
-
|
|
1823
|
+
A.axiosInstance.request(e).then((c) => {
|
|
1828
1824
|
if (c && (c == null ? void 0 : c.code) === "0")
|
|
1829
1825
|
i(c.data);
|
|
1830
1826
|
else if (c.code === "500")
|
|
@@ -1872,11 +1868,11 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1872
1868
|
}
|
|
1873
1869
|
};
|
|
1874
1870
|
/** token过期后,暂存待执行的请求 */
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
let SuHttp =
|
|
1871
|
+
S(A, "requests", []), /** 防止重复刷新token */
|
|
1872
|
+
S(A, "isRefreshing", !1), // 初始化配置对象
|
|
1873
|
+
S(A, "initConfig", {}), // 保存当前Axios实例对象
|
|
1874
|
+
S(A, "axiosInstance", Axios.create(defaultConfig));
|
|
1875
|
+
let SuHttp = A;
|
|
1880
1876
|
const http = new SuHttp(), lunarCalendar = {
|
|
1881
1877
|
/**
|
|
1882
1878
|
* 农历1900-2100的润大小信息表
|
|
@@ -2688,45 +2684,45 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2688
2684
|
let n = !1;
|
|
2689
2685
|
f.getFullYear() === h && f.getMonth() + 1 === r && f.getDate() === e && (n = !0);
|
|
2690
2686
|
let m = i.getDay();
|
|
2691
|
-
const
|
|
2687
|
+
const p = this.nStr1[m];
|
|
2692
2688
|
m === 0 && (m = 7);
|
|
2693
|
-
const
|
|
2689
|
+
const u = Z;
|
|
2694
2690
|
c = this.leapMonth(Z);
|
|
2695
|
-
let
|
|
2691
|
+
let M = !1;
|
|
2696
2692
|
for (Z = 1; Z < 13 && d > 0; Z++)
|
|
2697
|
-
c > 0 && Z === c + 1 &&
|
|
2698
|
-
d === 0 && c > 0 && Z === c + 1 && (
|
|
2699
|
-
const
|
|
2700
|
-
let
|
|
2701
|
-
e >=
|
|
2702
|
-
let
|
|
2703
|
-
|
|
2704
|
-
const v = Date.UTC(h,
|
|
2705
|
-
let
|
|
2706
|
-
return
|
|
2693
|
+
c > 0 && Z === c + 1 && M === !1 ? (--Z, M = !0, t = this.leapDays(u)) : t = this.monthDays(u, Z), M === !0 && Z === c + 1 && (M = !1), d -= t;
|
|
2694
|
+
d === 0 && c > 0 && Z === c + 1 && (M ? M = !1 : (M = !0, --Z)), d < 0 && (d += t, --Z);
|
|
2695
|
+
const C = Z, y = d + 1, w = r - 1, V = this.toGanZhiYear(u), R = this.getTerm(h, r * 2 - 1), T = this.getTerm(h, r * 2);
|
|
2696
|
+
let g = this.toGanZhi((h - 1900) * 12 + r + 11);
|
|
2697
|
+
e >= R && (g = this.toGanZhi((h - 1900) * 12 + r + 12));
|
|
2698
|
+
let F = !1, I;
|
|
2699
|
+
R === e && (F = !0, I = this.solarTerm[r * 2 - 2]), T === e && (F = !0, I = this.solarTerm[r * 2 - 1]);
|
|
2700
|
+
const v = Date.UTC(h, w, 1, 0, 0, 0, 0) / 864e5 + 25567 + 10, H = this.toGanZhi(v + e - 1), b = this.toAstro(r, e), s = h + "-" + r + "-" + e, L = u + "-" + C + "-" + y, k = this.festival, x = this.lFestival, D = r + "-" + e;
|
|
2701
|
+
let N = C + "-" + y;
|
|
2702
|
+
return C === 12 && y === 29 && this.monthDays(u, C) === 29 && (N = "12-30"), {
|
|
2707
2703
|
date: s,
|
|
2708
|
-
lunarDate:
|
|
2709
|
-
festival:
|
|
2710
|
-
lunarFestival:
|
|
2711
|
-
lYear:
|
|
2712
|
-
lMonth:
|
|
2713
|
-
lDay:
|
|
2714
|
-
Animal: this.getAnimal(
|
|
2715
|
-
IMonthCn: (
|
|
2716
|
-
IDayCn: this.toChinaDay(
|
|
2704
|
+
lunarDate: L,
|
|
2705
|
+
festival: k[D] ? k[D].title : null,
|
|
2706
|
+
lunarFestival: x[N] ? x[N].title : null,
|
|
2707
|
+
lYear: u,
|
|
2708
|
+
lMonth: C,
|
|
2709
|
+
lDay: y,
|
|
2710
|
+
Animal: this.getAnimal(u),
|
|
2711
|
+
IMonthCn: (M ? "闰" : "") + this.toChinaMonth(C),
|
|
2712
|
+
IDayCn: this.toChinaDay(y),
|
|
2717
2713
|
cYear: h,
|
|
2718
2714
|
cMonth: r,
|
|
2719
2715
|
cDay: e,
|
|
2720
|
-
gzYear:
|
|
2721
|
-
gzMonth:
|
|
2722
|
-
gzDay:
|
|
2716
|
+
gzYear: V,
|
|
2717
|
+
gzMonth: g,
|
|
2718
|
+
gzDay: H,
|
|
2723
2719
|
isToday: n,
|
|
2724
|
-
isLeap:
|
|
2720
|
+
isLeap: M,
|
|
2725
2721
|
nWeek: m,
|
|
2726
|
-
ncWeek: "星期" +
|
|
2727
|
-
isTerm:
|
|
2728
|
-
Term:
|
|
2729
|
-
astro:
|
|
2722
|
+
ncWeek: "星期" + p,
|
|
2723
|
+
isTerm: F,
|
|
2724
|
+
Term: I,
|
|
2725
|
+
astro: b
|
|
2730
2726
|
};
|
|
2731
2727
|
},
|
|
2732
2728
|
/**
|
|
@@ -2755,8 +2751,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2755
2751
|
for (c = 1; c < a; c++)
|
|
2756
2752
|
t = this.leapMonth(l), d || t <= c && t > 0 && (Z += this.leapDays(l), d = !0), Z += this.monthDays(l, c);
|
|
2757
2753
|
h && (Z += e);
|
|
2758
|
-
const f = Date.UTC(1900, 1, 30, 0, 0, 0), n = new Date((Z + o - 31) * 864e5 + f), m = n.getUTCFullYear(),
|
|
2759
|
-
return this.solar2lunar(m,
|
|
2754
|
+
const f = Date.UTC(1900, 1, 30, 0, 0, 0), n = new Date((Z + o - 31) * 864e5 + f), m = n.getUTCFullYear(), p = n.getUTCMonth() + 1, u = n.getUTCDate();
|
|
2755
|
+
return this.solar2lunar(m, p, u);
|
|
2760
2756
|
}
|
|
2761
2757
|
}, dict = storageLocal.getItem("kLov"), formats = {
|
|
2762
2758
|
formatDate: {
|