@utogether/utils 3.0.0-beta.43 → 3.0.0-beta.45
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 +353 -339
- 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
|
})];
|
|
@@ -548,28 +544,28 @@ const VxetableRender = (VXETable, {
|
|
|
548
544
|
} = Z, d = useComponent(), {
|
|
549
545
|
multiple: f
|
|
550
546
|
} = i, n = f ? `_${r}` : r;
|
|
551
|
-
d.setDefaultValue(i, h, r);
|
|
552
|
-
function m(
|
|
553
|
-
d.selectChange(
|
|
547
|
+
multipl && d.setDefaultValue(i, h, r);
|
|
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");
|
|
@@ -847,6 +843,24 @@ const VxetableRender = (VXETable, {
|
|
|
847
843
|
"data-status": "detail"
|
|
848
844
|
}), null)];
|
|
849
845
|
},
|
|
846
|
+
// 默认显示模板
|
|
847
|
+
renderDefault(l, a) {
|
|
848
|
+
const {
|
|
849
|
+
row: o,
|
|
850
|
+
column: h
|
|
851
|
+
} = a, {
|
|
852
|
+
props: r
|
|
853
|
+
} = l;
|
|
854
|
+
return [createVNode(resolveComponent("form-upload"), mergeProps({
|
|
855
|
+
record: o,
|
|
856
|
+
field: h.field,
|
|
857
|
+
size: "mini"
|
|
858
|
+
}, r, {
|
|
859
|
+
mode: "image",
|
|
860
|
+
"render-mode": "column",
|
|
861
|
+
"data-status": "detail"
|
|
862
|
+
}), null)];
|
|
863
|
+
},
|
|
850
864
|
renderItemContent(l, a) {
|
|
851
865
|
const {
|
|
852
866
|
data: o,
|
|
@@ -1040,18 +1054,18 @@ const VxetableRender = (VXETable, {
|
|
|
1040
1054
|
url: f,
|
|
1041
1055
|
defaultParams: n = {},
|
|
1042
1056
|
method: m = "get"
|
|
1043
|
-
} = c,
|
|
1057
|
+
} = c, p = getCookieParam(), u = Object.assign({
|
|
1044
1058
|
pageSize: 20,
|
|
1045
1059
|
pageNum: 1,
|
|
1046
|
-
...
|
|
1060
|
+
...p,
|
|
1047
1061
|
...n
|
|
1048
1062
|
}, {
|
|
1049
1063
|
[d || e]: r
|
|
1050
1064
|
});
|
|
1051
1065
|
if (c.loading) return;
|
|
1052
|
-
let
|
|
1066
|
+
let M;
|
|
1053
1067
|
try {
|
|
1054
|
-
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));
|
|
1055
1069
|
} finally {
|
|
1056
1070
|
c.loading = !1;
|
|
1057
1071
|
}
|
|
@@ -1064,26 +1078,26 @@ const VxetableRender = (VXETable, {
|
|
|
1064
1078
|
options: f,
|
|
1065
1079
|
props: n,
|
|
1066
1080
|
optionProps: m = {},
|
|
1067
|
-
events:
|
|
1068
|
-
} = Z,
|
|
1081
|
+
events: p
|
|
1082
|
+
} = Z, u = {
|
|
1069
1083
|
[d]: e,
|
|
1070
1084
|
field: i
|
|
1071
1085
|
};
|
|
1072
|
-
e[i] = null, !isEmpty(r) && (n != null && n.multiple) ? (e[i] = r.join(","), t = [], r.forEach((
|
|
1073
|
-
const
|
|
1074
|
-
|
|
1075
|
-
const
|
|
1076
|
-
e[
|
|
1077
|
-
}),
|
|
1078
|
-
}), 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, {
|
|
1079
1093
|
options: t
|
|
1080
|
-
})) : (e[i] = n != null && n.multiple ? null : r, t = f.find((
|
|
1081
|
-
e[
|
|
1082
|
-
}), 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, {
|
|
1083
1097
|
option: t
|
|
1084
|
-
})), d === "row" && Object.assign(
|
|
1098
|
+
})), d === "row" && Object.assign(u, {
|
|
1085
1099
|
column: c.column
|
|
1086
|
-
}),
|
|
1100
|
+
}), p != null && p.change && p.change(u);
|
|
1087
1101
|
},
|
|
1088
1102
|
setDefaultValue: (r, e, i) => {
|
|
1089
1103
|
var d;
|
|
@@ -1171,8 +1185,8 @@ function useWatermark(l = ref(document.body)) {
|
|
|
1171
1185
|
function e(t, d) {
|
|
1172
1186
|
const f = document.createElement("canvas"), n = 260, m = 180;
|
|
1173
1187
|
Object.assign(f, { width: n, height: m });
|
|
1174
|
-
const
|
|
1175
|
-
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");
|
|
1176
1190
|
}
|
|
1177
1191
|
function i(t = {}) {
|
|
1178
1192
|
const d = unref(h);
|
|
@@ -1188,8 +1202,8 @@ function useWatermark(l = ref(document.body)) {
|
|
|
1188
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";
|
|
1189
1203
|
const n = unref(l);
|
|
1190
1204
|
if (!n) return o;
|
|
1191
|
-
const { clientHeight: m, clientWidth:
|
|
1192
|
-
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;
|
|
1193
1207
|
};
|
|
1194
1208
|
function c(t, d) {
|
|
1195
1209
|
Z(t, d), addResizeListener(document.documentElement, a), getCurrentInstance() && onBeforeUnmount(() => {
|
|
@@ -1212,36 +1226,36 @@ function useAttrs(l = {}) {
|
|
|
1212
1226
|
}), r;
|
|
1213
1227
|
}
|
|
1214
1228
|
const i18n = window.$i18n, useRender = () => {
|
|
1215
|
-
const l = { value: "dictCode", label: "dictName" }, a = (v,
|
|
1216
|
-
var
|
|
1217
|
-
const
|
|
1229
|
+
const l = { value: "dictCode", label: "dictName" }, a = (v, H) => {
|
|
1230
|
+
var N;
|
|
1231
|
+
const b = g(H);
|
|
1218
1232
|
let s = {
|
|
1219
1233
|
clearable: !0,
|
|
1220
1234
|
disabled: !1,
|
|
1221
1235
|
showValue: !1,
|
|
1222
1236
|
placeholder: null
|
|
1223
|
-
},
|
|
1224
|
-
isObject(v) ? (s = Object.assign(s, v),
|
|
1225
|
-
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") : [];
|
|
1226
1240
|
return {
|
|
1227
1241
|
name: "#select",
|
|
1228
1242
|
optionProps: l,
|
|
1229
|
-
options:
|
|
1243
|
+
options: D,
|
|
1230
1244
|
props: s,
|
|
1231
|
-
defaultValue:
|
|
1232
|
-
events:
|
|
1245
|
+
defaultValue: L,
|
|
1246
|
+
events: b
|
|
1233
1247
|
};
|
|
1234
|
-
}, o = (v,
|
|
1235
|
-
const
|
|
1248
|
+
}, o = (v, H) => {
|
|
1249
|
+
const b = g(H);
|
|
1236
1250
|
return {
|
|
1237
1251
|
name: "#SuSelect",
|
|
1238
1252
|
optionProps: (v == null ? void 0 : v.optionProps) || { label: "label", value: "value" },
|
|
1239
1253
|
props: v == null ? void 0 : v.props,
|
|
1240
1254
|
options: (v == null ? void 0 : v.options) || [],
|
|
1241
|
-
events:
|
|
1255
|
+
events: b
|
|
1242
1256
|
};
|
|
1243
|
-
}, h = (v,
|
|
1244
|
-
const
|
|
1257
|
+
}, h = (v, H) => {
|
|
1258
|
+
const b = {
|
|
1245
1259
|
optionProps: { extLabel: "userName", value: "employeeName" },
|
|
1246
1260
|
props: {
|
|
1247
1261
|
attrs: { disabled: v == null ? void 0 : v.disabled },
|
|
@@ -1252,20 +1266,20 @@ const i18n = window.$i18n, useRender = () => {
|
|
|
1252
1266
|
fetchField: "employeeName"
|
|
1253
1267
|
}
|
|
1254
1268
|
};
|
|
1255
|
-
return o(
|
|
1269
|
+
return o(b, H);
|
|
1256
1270
|
}, r = (v) => {
|
|
1257
|
-
const
|
|
1271
|
+
const H = {
|
|
1258
1272
|
optionProps: { label: "userName", value: "userName" },
|
|
1259
1273
|
props: {
|
|
1260
1274
|
code: "sys/listUsers",
|
|
1261
1275
|
url: "/uums/user",
|
|
1262
|
-
fetchField: "
|
|
1276
|
+
fetchField: "userName",
|
|
1263
1277
|
mapField: v == null ? void 0 : v.mapField
|
|
1264
1278
|
}
|
|
1265
1279
|
};
|
|
1266
|
-
return o(
|
|
1267
|
-
}, e = (v,
|
|
1268
|
-
const
|
|
1280
|
+
return o(H);
|
|
1281
|
+
}, e = (v, H) => {
|
|
1282
|
+
const b = {
|
|
1269
1283
|
label: "organizationName",
|
|
1270
1284
|
value: (v == null ? void 0 : v.field) || "organizationName"
|
|
1271
1285
|
}, s = {
|
|
@@ -1274,19 +1288,19 @@ const i18n = window.$i18n, useRender = () => {
|
|
|
1274
1288
|
disabled: v == null ? void 0 : v.disabled,
|
|
1275
1289
|
url: "/uums/cusOrganization",
|
|
1276
1290
|
fetchField: "organizationName"
|
|
1277
|
-
},
|
|
1291
|
+
}, L = {
|
|
1278
1292
|
organizationId: "id",
|
|
1279
1293
|
organizationCode: "organizationCode"
|
|
1280
1294
|
};
|
|
1281
|
-
return Object.assign(s.mapField,
|
|
1295
|
+
return Object.assign(s.mapField, L, (v == null ? void 0 : v.mapField) || {}), {
|
|
1282
1296
|
name: "#SuSelect",
|
|
1283
1297
|
props: s,
|
|
1284
|
-
optionProps:
|
|
1298
|
+
optionProps: b,
|
|
1285
1299
|
options: [],
|
|
1286
|
-
events:
|
|
1300
|
+
events: g(H)
|
|
1287
1301
|
};
|
|
1288
|
-
}, i = (v,
|
|
1289
|
-
const
|
|
1302
|
+
}, i = (v, H) => {
|
|
1303
|
+
const b = {
|
|
1290
1304
|
label: "orgName",
|
|
1291
1305
|
value: (v == null ? void 0 : v.field) || "orgName"
|
|
1292
1306
|
}, s = {
|
|
@@ -1295,64 +1309,64 @@ const i18n = window.$i18n, useRender = () => {
|
|
|
1295
1309
|
defaultParams: v == null ? void 0 : v.defaultParams,
|
|
1296
1310
|
url: "/uums/org",
|
|
1297
1311
|
fetchField: "orgName"
|
|
1298
|
-
},
|
|
1299
|
-
return Object.assign(s.mapField,
|
|
1312
|
+
}, L = { orgId: "id", orgCode: "orgCode" };
|
|
1313
|
+
return Object.assign(s.mapField, L, (v == null ? void 0 : v.mapField) || {}), {
|
|
1300
1314
|
name: "#SuSelect",
|
|
1301
1315
|
props: s,
|
|
1302
|
-
optionProps:
|
|
1316
|
+
optionProps: b,
|
|
1303
1317
|
options: [],
|
|
1304
|
-
events:
|
|
1318
|
+
events: g(H)
|
|
1305
1319
|
};
|
|
1306
|
-
}, Z = (v,
|
|
1307
|
-
const
|
|
1320
|
+
}, Z = (v, H) => {
|
|
1321
|
+
const b = Object.assign({ disabled: !1 }, v), s = b == null ? void 0 : b.defaultValue;
|
|
1308
1322
|
return {
|
|
1309
1323
|
name: "VxeInput",
|
|
1310
|
-
props:
|
|
1324
|
+
props: b,
|
|
1311
1325
|
defaultValue: s,
|
|
1312
|
-
events:
|
|
1326
|
+
events: g(H)
|
|
1313
1327
|
};
|
|
1314
|
-
}, c = (v,
|
|
1315
|
-
const
|
|
1328
|
+
}, c = (v, H) => {
|
|
1329
|
+
const b = Object.assign({ disabled: !1, rows: 3 }, v), s = b == null ? void 0 : b.defaultValue;
|
|
1316
1330
|
return {
|
|
1317
1331
|
name: "VxeTextarea",
|
|
1318
|
-
props:
|
|
1332
|
+
props: b,
|
|
1319
1333
|
defaultValue: s,
|
|
1320
|
-
events:
|
|
1334
|
+
events: g(H)
|
|
1321
1335
|
};
|
|
1322
|
-
}, t = (v,
|
|
1323
|
-
const
|
|
1324
|
-
return { name:
|
|
1325
|
-
}, d = (v,
|
|
1326
|
-
const
|
|
1327
|
-
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) };
|
|
1328
1342
|
}, f = (v) => {
|
|
1329
|
-
var
|
|
1330
|
-
let
|
|
1343
|
+
var x;
|
|
1344
|
+
let H = { disabled: !1 }, b;
|
|
1331
1345
|
const s = storageLocal.getItem("kLov");
|
|
1332
|
-
let
|
|
1333
|
-
isObject(v) ? (
|
|
1334
|
-
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 })) : [];
|
|
1335
1349
|
return {
|
|
1336
|
-
props:
|
|
1337
|
-
defaultValue:
|
|
1338
|
-
options: isObject(v) && v.options ? v.options :
|
|
1350
|
+
props: H,
|
|
1351
|
+
defaultValue: b,
|
|
1352
|
+
options: isObject(v) && v.options ? v.options : k
|
|
1339
1353
|
};
|
|
1340
|
-
}, n = (v,
|
|
1341
|
-
const
|
|
1354
|
+
}, n = (v, H) => {
|
|
1355
|
+
const b = g(H);
|
|
1342
1356
|
return {
|
|
1343
1357
|
name: "VxeNumberInput",
|
|
1344
1358
|
props: Object.assign(
|
|
1345
|
-
{ type: "number", clearable: !0, min: 0, controls: !1 },
|
|
1359
|
+
{ type: "number", clearable: !0, min: void 0, controls: !1 },
|
|
1346
1360
|
v || {}
|
|
1347
1361
|
),
|
|
1348
1362
|
defaultValue: v == null ? void 0 : v.defaultValue,
|
|
1349
|
-
events:
|
|
1363
|
+
events: b
|
|
1350
1364
|
};
|
|
1351
|
-
}, m = (v,
|
|
1352
|
-
const
|
|
1353
|
-
return { name: "VxeDatePicker", props: Object.assign({ type: "date", valueFormat: s, clearable: !0 }, v || {}), defaultValue:
|
|
1354
|
-
},
|
|
1355
|
-
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 = {
|
|
1356
1370
|
type: "date",
|
|
1357
1371
|
valueFormat: s,
|
|
1358
1372
|
clearable: !0,
|
|
@@ -1389,24 +1403,24 @@ const i18n = window.$i18n, useRender = () => {
|
|
|
1389
1403
|
}
|
|
1390
1404
|
]
|
|
1391
1405
|
}
|
|
1392
|
-
}, E = Object.assign(
|
|
1406
|
+
}, E = Object.assign(N, v || {});
|
|
1393
1407
|
return {
|
|
1394
1408
|
name: "VxeDateRangePicker",
|
|
1395
|
-
startField:
|
|
1396
|
-
endField:
|
|
1397
|
-
startValue:
|
|
1398
|
-
endValue:
|
|
1409
|
+
startField: x,
|
|
1410
|
+
endField: D,
|
|
1411
|
+
startValue: L,
|
|
1412
|
+
endValue: k,
|
|
1399
1413
|
props: E,
|
|
1400
|
-
events:
|
|
1414
|
+
events: b
|
|
1401
1415
|
};
|
|
1402
|
-
},
|
|
1403
|
-
const
|
|
1404
|
-
return { name: "#lov", props: Object.assign({}, v || {}), events:
|
|
1405
|
-
},
|
|
1406
|
-
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) || {
|
|
1407
1421
|
label: "label",
|
|
1408
1422
|
value: "value"
|
|
1409
|
-
},
|
|
1423
|
+
}, L = Object.assign(
|
|
1410
1424
|
{ clearable: !0, disabled: !1, showValue: !1 },
|
|
1411
1425
|
v || {}
|
|
1412
1426
|
);
|
|
@@ -1414,60 +1428,60 @@ const i18n = window.$i18n, useRender = () => {
|
|
|
1414
1428
|
name: "#select",
|
|
1415
1429
|
optionProps: s,
|
|
1416
1430
|
options: (v == null ? void 0 : v.options) || [],
|
|
1417
|
-
props:
|
|
1418
|
-
events:
|
|
1431
|
+
props: L,
|
|
1432
|
+
events: b
|
|
1419
1433
|
};
|
|
1420
|
-
},
|
|
1421
|
-
let
|
|
1434
|
+
}, C = (v, H) => {
|
|
1435
|
+
let b = {
|
|
1422
1436
|
openLabel: "是",
|
|
1423
1437
|
closeLabel: "否",
|
|
1424
1438
|
openValue: "Y",
|
|
1425
1439
|
closeValue: "N"
|
|
1426
1440
|
}, s = "Y";
|
|
1427
|
-
isObject(v) && !isFunction(v) ? (
|
|
1428
|
-
const
|
|
1429
|
-
return { name: "VxeSwitch", props:
|
|
1430
|
-
},
|
|
1431
|
-
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 = {
|
|
1432
1446
|
openLabel: "启用",
|
|
1433
1447
|
closeLabel: "禁用",
|
|
1434
1448
|
openValue: "1",
|
|
1435
1449
|
closeValue: "0",
|
|
1436
1450
|
defaultValue: "1"
|
|
1437
1451
|
};
|
|
1438
|
-
!isFunction(v) && isObject(v) && Object.assign(
|
|
1439
|
-
const s = isFunction(v) ? v :
|
|
1440
|
-
return
|
|
1441
|
-
},
|
|
1442
|
-
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);
|
|
1443
1457
|
return {
|
|
1444
1458
|
name: "#area",
|
|
1445
1459
|
props: { mapField: (v == null ? void 0 : v.mapField) || ["province", "city", "region"] },
|
|
1446
|
-
events:
|
|
1460
|
+
events: b
|
|
1447
1461
|
};
|
|
1448
|
-
},
|
|
1449
|
-
let
|
|
1450
|
-
return isObject(v) && !isFunction(v) ?
|
|
1451
|
-
change: (v == null ? void 0 : v.change) ||
|
|
1452
|
-
blur: (v == null ? void 0 : v.blur) ||
|
|
1453
|
-
focus: (v == null ? void 0 : v.focus) ||
|
|
1454
|
-
input: (v == null ? void 0 : v.input) ||
|
|
1455
|
-
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,
|
|
1456
1470
|
searchClick: v == null ? void 0 : v.searchClick,
|
|
1457
1471
|
suffixClick: v == null ? void 0 : v.suffixClick,
|
|
1458
1472
|
prefixClick: v == null ? void 0 : v.prefixClick,
|
|
1459
1473
|
filterMethod: v == null ? void 0 : v.filterMethod
|
|
1460
|
-
} : v && (
|
|
1461
|
-
},
|
|
1474
|
+
} : v && (H = { change: v }), H;
|
|
1475
|
+
}, F = (v, H) => {
|
|
1462
1476
|
v = v || { fieldType: "string", mode: "image" };
|
|
1463
|
-
const { singleMode:
|
|
1464
|
-
return
|
|
1477
|
+
const { singleMode: b, mode: s } = v;
|
|
1478
|
+
return b && Object.assign(v, {
|
|
1465
1479
|
multiple: !1,
|
|
1466
1480
|
limitCount: 1,
|
|
1467
1481
|
autoHiddenButton: !0
|
|
1468
|
-
}), 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 };
|
|
1469
1483
|
};
|
|
1470
|
-
function
|
|
1484
|
+
function I() {
|
|
1471
1485
|
}
|
|
1472
1486
|
return {
|
|
1473
1487
|
renderDict: a,
|
|
@@ -1481,17 +1495,17 @@ const i18n = window.$i18n, useRender = () => {
|
|
|
1481
1495
|
renderInvOrg: e,
|
|
1482
1496
|
renderBU: i,
|
|
1483
1497
|
renderNumber: n,
|
|
1484
|
-
renderLov:
|
|
1485
|
-
renderSelectLocal:
|
|
1498
|
+
renderLov: u,
|
|
1499
|
+
renderSelectLocal: M,
|
|
1486
1500
|
renderDate: m,
|
|
1487
|
-
renderRangeDate:
|
|
1488
|
-
renderSwitch:
|
|
1489
|
-
renderCellTag:
|
|
1490
|
-
renderEnabled:
|
|
1491
|
-
renderIconSelect:
|
|
1492
|
-
renderTreeSelect:
|
|
1501
|
+
renderRangeDate: p,
|
|
1502
|
+
renderSwitch: C,
|
|
1503
|
+
renderCellTag: y,
|
|
1504
|
+
renderEnabled: w,
|
|
1505
|
+
renderIconSelect: V,
|
|
1506
|
+
renderTreeSelect: R,
|
|
1493
1507
|
renderArea: T,
|
|
1494
|
-
renderUpload:
|
|
1508
|
+
renderUpload: F
|
|
1495
1509
|
};
|
|
1496
1510
|
}, useGlobal = () => {
|
|
1497
1511
|
const l = getCurrentInstance();
|
|
@@ -1710,11 +1724,11 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1710
1724
|
"Content-Type": "application/json",
|
|
1711
1725
|
"X-Requested-With": "XMLHttpRequest"
|
|
1712
1726
|
}
|
|
1713
|
-
},
|
|
1727
|
+
}, A = class A {
|
|
1714
1728
|
constructor() {
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1729
|
+
S(this, "router");
|
|
1730
|
+
S(this, "baseUrl", null);
|
|
1731
|
+
S(this, "getNetworkError", (a) => a ? {
|
|
1718
1732
|
400: "错误的请求",
|
|
1719
1733
|
401: "服务未授权,请重新登录",
|
|
1720
1734
|
403: "拒绝访问",
|
|
@@ -1737,27 +1751,27 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1737
1751
|
/** 重连原始请求 */
|
|
1738
1752
|
static retryOriginalRequest(a) {
|
|
1739
1753
|
return new Promise((o) => {
|
|
1740
|
-
|
|
1754
|
+
A.requests.push((h) => {
|
|
1741
1755
|
a.headers.Authorization = "Bearer " + h, o(a);
|
|
1742
1756
|
});
|
|
1743
1757
|
});
|
|
1744
1758
|
}
|
|
1745
1759
|
// 请求拦截
|
|
1746
1760
|
httpInterceptorsRequest() {
|
|
1747
|
-
|
|
1748
|
-
(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) => {
|
|
1749
1763
|
const r = cookies.get(kTOKENKEY);
|
|
1750
1764
|
if (r) {
|
|
1751
1765
|
const e = JSON.parse(r), i = (/* @__PURE__ */ new Date()).getTime();
|
|
1752
|
-
e.expires - i <= 0 ? (
|
|
1766
|
+
e.expires - i <= 0 ? (A.isRefreshing || (A.isRefreshing = !0, this.get(this.baseUrl + "/uath/refreshToken", {
|
|
1753
1767
|
refreshToken: e.refreshToken
|
|
1754
1768
|
}).then((c) => {
|
|
1755
|
-
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();
|
|
1756
1770
|
}).catch(() => {
|
|
1757
1771
|
this.routeToLogin();
|
|
1758
1772
|
}).finally(() => {
|
|
1759
|
-
|
|
1760
|
-
})), h(
|
|
1773
|
+
A.isRefreshing = !1;
|
|
1774
|
+
})), h(A.retryOriginalRequest(a))) : (a.headers.Authorization = "Bearer " + e.accessToken, h(a));
|
|
1761
1775
|
} else {
|
|
1762
1776
|
const e = cookies.get("kCookies_token");
|
|
1763
1777
|
e && (a.headers["X-Token"] = e), h(a);
|
|
@@ -1775,14 +1789,14 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1775
1789
|
cookies.set(kTOKENKEY, JSON.stringify(e));
|
|
1776
1790
|
}
|
|
1777
1791
|
routeToLogin() {
|
|
1778
|
-
|
|
1792
|
+
A.requests = [], cookies.remove("kCookies_token"), cookies.remove("authorized-token"), cookies.remove("loginer"), this.router.push({ name: "login" });
|
|
1779
1793
|
}
|
|
1780
1794
|
// 响应拦截
|
|
1781
1795
|
httpInterceptorsResponse() {
|
|
1782
|
-
|
|
1796
|
+
A.axiosInstance.interceptors.response.use(
|
|
1783
1797
|
(o) => {
|
|
1784
1798
|
const h = o.config;
|
|
1785
|
-
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;
|
|
1786
1800
|
},
|
|
1787
1801
|
(o) => {
|
|
1788
1802
|
var r;
|
|
@@ -1806,7 +1820,7 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1806
1820
|
...r
|
|
1807
1821
|
});
|
|
1808
1822
|
return new Promise((i, Z) => {
|
|
1809
|
-
|
|
1823
|
+
A.axiosInstance.request(e).then((c) => {
|
|
1810
1824
|
if (c && (c == null ? void 0 : c.code) === "0")
|
|
1811
1825
|
i(c.data);
|
|
1812
1826
|
else if (c.code === "500")
|
|
@@ -1854,11 +1868,11 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1854
1868
|
}
|
|
1855
1869
|
};
|
|
1856
1870
|
/** token过期后,暂存待执行的请求 */
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
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;
|
|
1862
1876
|
const http = new SuHttp(), lunarCalendar = {
|
|
1863
1877
|
/**
|
|
1864
1878
|
* 农历1900-2100的润大小信息表
|
|
@@ -2670,45 +2684,45 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2670
2684
|
let n = !1;
|
|
2671
2685
|
f.getFullYear() === h && f.getMonth() + 1 === r && f.getDate() === e && (n = !0);
|
|
2672
2686
|
let m = i.getDay();
|
|
2673
|
-
const
|
|
2687
|
+
const p = this.nStr1[m];
|
|
2674
2688
|
m === 0 && (m = 7);
|
|
2675
|
-
const
|
|
2689
|
+
const u = Z;
|
|
2676
2690
|
c = this.leapMonth(Z);
|
|
2677
|
-
let
|
|
2691
|
+
let M = !1;
|
|
2678
2692
|
for (Z = 1; Z < 13 && d > 0; Z++)
|
|
2679
|
-
c > 0 && Z === c + 1 &&
|
|
2680
|
-
d === 0 && c > 0 && Z === c + 1 && (
|
|
2681
|
-
const
|
|
2682
|
-
let
|
|
2683
|
-
e >=
|
|
2684
|
-
let
|
|
2685
|
-
|
|
2686
|
-
const v = Date.UTC(h,
|
|
2687
|
-
let
|
|
2688
|
-
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"), {
|
|
2689
2703
|
date: s,
|
|
2690
|
-
lunarDate:
|
|
2691
|
-
festival:
|
|
2692
|
-
lunarFestival:
|
|
2693
|
-
lYear:
|
|
2694
|
-
lMonth:
|
|
2695
|
-
lDay:
|
|
2696
|
-
Animal: this.getAnimal(
|
|
2697
|
-
IMonthCn: (
|
|
2698
|
-
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),
|
|
2699
2713
|
cYear: h,
|
|
2700
2714
|
cMonth: r,
|
|
2701
2715
|
cDay: e,
|
|
2702
|
-
gzYear:
|
|
2703
|
-
gzMonth:
|
|
2704
|
-
gzDay:
|
|
2716
|
+
gzYear: V,
|
|
2717
|
+
gzMonth: g,
|
|
2718
|
+
gzDay: H,
|
|
2705
2719
|
isToday: n,
|
|
2706
|
-
isLeap:
|
|
2720
|
+
isLeap: M,
|
|
2707
2721
|
nWeek: m,
|
|
2708
|
-
ncWeek: "星期" +
|
|
2709
|
-
isTerm:
|
|
2710
|
-
Term:
|
|
2711
|
-
astro:
|
|
2722
|
+
ncWeek: "星期" + p,
|
|
2723
|
+
isTerm: F,
|
|
2724
|
+
Term: I,
|
|
2725
|
+
astro: b
|
|
2712
2726
|
};
|
|
2713
2727
|
},
|
|
2714
2728
|
/**
|
|
@@ -2737,8 +2751,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2737
2751
|
for (c = 1; c < a; c++)
|
|
2738
2752
|
t = this.leapMonth(l), d || t <= c && t > 0 && (Z += this.leapDays(l), d = !0), Z += this.monthDays(l, c);
|
|
2739
2753
|
h && (Z += e);
|
|
2740
|
-
const f = Date.UTC(1900, 1, 30, 0, 0, 0), n = new Date((Z + o - 31) * 864e5 + f), m = n.getUTCFullYear(),
|
|
2741
|
-
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);
|
|
2742
2756
|
}
|
|
2743
2757
|
}, dict = storageLocal.getItem("kLov"), formats = {
|
|
2744
2758
|
formatDate: {
|