@utogether/utils 3.0.0-beta.27 → 3.0.0-beta.28
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/pkg/formatData.d.ts +1 -1
- package/dist/pkg/useRender.d.ts +7 -0
- package/dist/utils.es.js +346 -325
- package/dist/utils.umd.js +1 -1
- package/package.json +30 -30
package/dist/utils.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var T = Object.defineProperty;
|
|
2
2
|
var U = (a, l, o) => l in a ? T(a, l, { enumerable: !0, configurable: !0, writable: !0, value: o }) : a[l] = o;
|
|
3
|
-
var
|
|
3
|
+
var S = (a, l, o) => U(a, typeof l != "symbol" ? l + "" : l, 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
|
-
import XEUtils, { isArray, findTree, isEmpty, isObject, isPlainObject, isUndefined, isFunction, isString, clone, has } from "xe-utils";
|
|
6
|
+
import XEUtils, { isArray, findTree, isEmpty, isObject, isPlainObject, isUndefined, isFunction, isString, clone, merge, has } from "xe-utils";
|
|
7
7
|
import localforage from "localforage";
|
|
8
8
|
import ResizeObserver from "resize-observer-polyfill";
|
|
9
9
|
import { VxeUI } from "vxe-pc-ui";
|
|
@@ -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
|
+
S(this, "storage");
|
|
16
|
+
S(this, "prefix");
|
|
17
|
+
S(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
|
+
S(this, "storage");
|
|
50
50
|
localforage.config({
|
|
51
51
|
name: "uapp",
|
|
52
52
|
storeName: "udb"
|
|
@@ -140,8 +140,8 @@ function init(a, l) {
|
|
|
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", (l) => {
|
|
145
145
|
this.prefix = l;
|
|
146
146
|
});
|
|
147
147
|
}
|
|
@@ -201,25 +201,25 @@ const VxetableRender = (VXETable, {
|
|
|
201
201
|
optionProps: Z = {},
|
|
202
202
|
events: e
|
|
203
203
|
} = a, {
|
|
204
|
-
label:
|
|
204
|
+
label: t = "label",
|
|
205
205
|
value: d = "value"
|
|
206
206
|
} = Z, {
|
|
207
|
-
loading:
|
|
208
|
-
multiple:
|
|
207
|
+
loading: f = !1,
|
|
208
|
+
multiple: m,
|
|
209
209
|
mapField: u
|
|
210
|
-
} = i, H = useComponent(), p =
|
|
210
|
+
} = i, H = useComponent(), p = m ? `_${r.field}` : r.field;
|
|
211
211
|
H.setDefaultValue(i, h, r.field);
|
|
212
|
-
function n(
|
|
213
|
-
H.remote(
|
|
212
|
+
function n(V) {
|
|
213
|
+
H.remote(V, r.field, a);
|
|
214
214
|
}
|
|
215
|
-
function y(
|
|
216
|
-
H.selectChange(
|
|
215
|
+
function y(V) {
|
|
216
|
+
H.selectChange(V, h, r.field, a, {
|
|
217
217
|
column: r,
|
|
218
218
|
datasource: "row"
|
|
219
219
|
});
|
|
220
220
|
}
|
|
221
|
-
function C(
|
|
222
|
-
e != null && e.input && e.input(l,
|
|
221
|
+
function C(V) {
|
|
222
|
+
e != null && e.input && e.input(l, V);
|
|
223
223
|
}
|
|
224
224
|
function A() {
|
|
225
225
|
H.clear(h, r.field, u, e, "row");
|
|
@@ -229,23 +229,23 @@ const VxetableRender = (VXETable, {
|
|
|
229
229
|
}
|
|
230
230
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
231
231
|
modelValue: h[p],
|
|
232
|
-
"onUpdate:modelValue": (
|
|
232
|
+
"onUpdate:modelValue": (V) => h[p] = V,
|
|
233
233
|
filterable: !0,
|
|
234
234
|
remote: !0,
|
|
235
235
|
clearable: !0,
|
|
236
236
|
placeholder: "请录入关键字搜索",
|
|
237
237
|
style: "width: 100%",
|
|
238
238
|
"remote-method": n,
|
|
239
|
-
loading:
|
|
239
|
+
loading: f
|
|
240
240
|
}, i, {
|
|
241
241
|
onFocus: () => w(),
|
|
242
|
-
onChange: (
|
|
242
|
+
onChange: (V) => y(V),
|
|
243
243
|
onClear: () => A(),
|
|
244
|
-
onInput: (
|
|
245
|
-
}), _isSlot(o = c.map((
|
|
246
|
-
key:
|
|
247
|
-
label:
|
|
248
|
-
value:
|
|
244
|
+
onInput: (V) => C(V)
|
|
245
|
+
}), _isSlot(o = c.map((V) => createVNode(resolveComponent("el-option"), {
|
|
246
|
+
key: V[d],
|
|
247
|
+
label: V[t],
|
|
248
|
+
value: V[d]
|
|
249
249
|
}, null))) ? o : {
|
|
250
250
|
default: () => [o]
|
|
251
251
|
})];
|
|
@@ -261,25 +261,25 @@ const VxetableRender = (VXETable, {
|
|
|
261
261
|
optionProps: Z = {},
|
|
262
262
|
events: e
|
|
263
263
|
} = a, {
|
|
264
|
-
label:
|
|
264
|
+
label: t = "label",
|
|
265
265
|
value: d = "value"
|
|
266
266
|
} = Z, {
|
|
267
|
-
loading:
|
|
268
|
-
multiple:
|
|
267
|
+
loading: f = !1,
|
|
268
|
+
multiple: m,
|
|
269
269
|
mapField: u
|
|
270
|
-
} = i, H = useComponent(), p =
|
|
270
|
+
} = i, H = useComponent(), p = m ? `_${r.field}` : r.field;
|
|
271
271
|
H.setDefaultValue(i, h, r.field);
|
|
272
|
-
function n(
|
|
273
|
-
H.remote(
|
|
272
|
+
function n(V) {
|
|
273
|
+
H.remote(V, r.field, a);
|
|
274
274
|
}
|
|
275
|
-
function y(
|
|
276
|
-
H.selectChange(
|
|
275
|
+
function y(V) {
|
|
276
|
+
H.selectChange(V, h, r.field, a, {
|
|
277
277
|
column: r,
|
|
278
278
|
datasource: "row"
|
|
279
279
|
});
|
|
280
280
|
}
|
|
281
|
-
function C(
|
|
282
|
-
e != null && e.input && e.input(l,
|
|
281
|
+
function C(V) {
|
|
282
|
+
e != null && e.input && e.input(l, V);
|
|
283
283
|
}
|
|
284
284
|
function A() {
|
|
285
285
|
H.clear(h, r.field, u, e, "row");
|
|
@@ -289,23 +289,23 @@ const VxetableRender = (VXETable, {
|
|
|
289
289
|
}
|
|
290
290
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
291
291
|
modelValue: h[p],
|
|
292
|
-
"onUpdate:modelValue": (
|
|
292
|
+
"onUpdate:modelValue": (V) => h[p] = V,
|
|
293
293
|
filterable: !0,
|
|
294
294
|
remote: !0,
|
|
295
295
|
clearable: !0,
|
|
296
296
|
placeholder: "请录入关键字搜索",
|
|
297
297
|
style: "width: 100%",
|
|
298
298
|
"remote-method": n,
|
|
299
|
-
loading:
|
|
299
|
+
loading: f
|
|
300
300
|
}, i, {
|
|
301
301
|
onFocus: () => w(),
|
|
302
|
-
onChange: (
|
|
302
|
+
onChange: (V) => y(V),
|
|
303
303
|
onClear: () => A(),
|
|
304
|
-
onInput: (
|
|
305
|
-
}), _isSlot(o = c.map((
|
|
306
|
-
key:
|
|
307
|
-
label:
|
|
308
|
-
value:
|
|
304
|
+
onInput: (V) => C(V)
|
|
305
|
+
}), _isSlot(o = c.map((V) => createVNode(resolveComponent("el-option"), {
|
|
306
|
+
key: V[d],
|
|
307
|
+
label: V[t],
|
|
308
|
+
value: V[d]
|
|
309
309
|
}, null))) ? o : {
|
|
310
310
|
default: () => [o]
|
|
311
311
|
})];
|
|
@@ -335,34 +335,34 @@ const VxetableRender = (VXETable, {
|
|
|
335
335
|
optionProps: Z = {},
|
|
336
336
|
events: e
|
|
337
337
|
} = a, {
|
|
338
|
-
label:
|
|
338
|
+
label: t = "label",
|
|
339
339
|
value: d = "value"
|
|
340
340
|
} = Z, {
|
|
341
|
-
mapField:
|
|
342
|
-
multiple:
|
|
341
|
+
mapField: f,
|
|
342
|
+
multiple: m,
|
|
343
343
|
loading: u = !1
|
|
344
|
-
} = i, H = useComponent(), p =
|
|
344
|
+
} = i, H = useComponent(), p = m ? `_${r}` : r;
|
|
345
345
|
H.setDefaultValue(i, h, r);
|
|
346
|
-
async function n(
|
|
347
|
-
H.remote(
|
|
346
|
+
async function n(V) {
|
|
347
|
+
H.remote(V, r, a);
|
|
348
348
|
}
|
|
349
|
-
function y(
|
|
350
|
-
H.selectChange(
|
|
349
|
+
function y(V) {
|
|
350
|
+
H.selectChange(V, h, r, a, {
|
|
351
351
|
datasource: "data"
|
|
352
352
|
});
|
|
353
353
|
}
|
|
354
|
-
function C(
|
|
355
|
-
e != null && e.input && e.input(l,
|
|
354
|
+
function C(V) {
|
|
355
|
+
e != null && e.input && e.input(l, V);
|
|
356
356
|
}
|
|
357
357
|
function A() {
|
|
358
|
-
H.clear(h, r,
|
|
358
|
+
H.clear(h, r, f, e, "data");
|
|
359
359
|
}
|
|
360
360
|
function w() {
|
|
361
361
|
!c.length && n(""), e != null && e.focus && e.focus(l);
|
|
362
362
|
}
|
|
363
363
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
364
364
|
modelValue: h[p],
|
|
365
|
-
"onUpdate:modelValue": (
|
|
365
|
+
"onUpdate:modelValue": (V) => h[p] = V,
|
|
366
366
|
filterable: !0,
|
|
367
367
|
remote: !0,
|
|
368
368
|
clearable: !0,
|
|
@@ -372,13 +372,13 @@ const VxetableRender = (VXETable, {
|
|
|
372
372
|
"remote-method": n
|
|
373
373
|
}, i, {
|
|
374
374
|
onFocus: () => w(),
|
|
375
|
-
onChange: (
|
|
375
|
+
onChange: (V) => y(V),
|
|
376
376
|
onClear: () => A(),
|
|
377
377
|
onInput: () => C()
|
|
378
|
-
}), _isSlot(o = c.map((
|
|
379
|
-
key:
|
|
380
|
-
label:
|
|
381
|
-
value:
|
|
378
|
+
}), _isSlot(o = c.map((V) => createVNode(resolveComponent("el-option"), {
|
|
379
|
+
key: V[d],
|
|
380
|
+
label: V[t],
|
|
381
|
+
value: V[d]
|
|
382
382
|
}, null))) ? o : {
|
|
383
383
|
default: () => [o]
|
|
384
384
|
})];
|
|
@@ -413,7 +413,7 @@ const VxetableRender = (VXETable, {
|
|
|
413
413
|
}, {
|
|
414
414
|
text: i18n("message.udp.anniversary", !0),
|
|
415
415
|
value: () => [Z(1, "year"), c]
|
|
416
|
-
}], Z = (e,
|
|
416
|
+
}], Z = (e, t) => dayjs().subtract(e, t).add("1", "day").format();
|
|
417
417
|
return [createVNode(resolveComponent("el-date-picker"), mergeProps({
|
|
418
418
|
modelValue: o[h],
|
|
419
419
|
"onUpdate:modelValue": (e) => o[h] = e,
|
|
@@ -437,16 +437,16 @@ const VxetableRender = (VXETable, {
|
|
|
437
437
|
optionProps: Z = {},
|
|
438
438
|
events: e
|
|
439
439
|
} = a, {
|
|
440
|
-
label:
|
|
440
|
+
label: t = "label",
|
|
441
441
|
value: d = "value",
|
|
442
|
-
extLabel:
|
|
442
|
+
extLabel: f
|
|
443
443
|
} = Z, {
|
|
444
|
-
mapField:
|
|
444
|
+
mapField: m
|
|
445
445
|
} = i, u = useComponent();
|
|
446
446
|
i.multiple && h[r.field] && !isArray(h[r.field]) && h[r.field].split(",").forEach((n) => {
|
|
447
|
-
!c.some((C) => C[
|
|
447
|
+
!c.some((C) => C[t] === n) && c.push({
|
|
448
448
|
[d]: n,
|
|
449
|
-
[
|
|
449
|
+
[t]: n
|
|
450
450
|
});
|
|
451
451
|
});
|
|
452
452
|
function H(n) {
|
|
@@ -456,7 +456,7 @@ const VxetableRender = (VXETable, {
|
|
|
456
456
|
});
|
|
457
457
|
}
|
|
458
458
|
function p() {
|
|
459
|
-
u.clear(h, r.field,
|
|
459
|
+
u.clear(h, r.field, m, e, "row");
|
|
460
460
|
}
|
|
461
461
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
462
462
|
modelValue: h[r.field],
|
|
@@ -469,7 +469,7 @@ const VxetableRender = (VXETable, {
|
|
|
469
469
|
onClear: () => p()
|
|
470
470
|
}), _isSlot(o = c.map((n) => createVNode(resolveComponent("el-option"), {
|
|
471
471
|
key: n[d],
|
|
472
|
-
label:
|
|
472
|
+
label: f && n[f] ? n[d] : n[t],
|
|
473
473
|
value: n[d]
|
|
474
474
|
}, null))) ? o : {
|
|
475
475
|
default: () => [o]
|
|
@@ -486,16 +486,16 @@ const VxetableRender = (VXETable, {
|
|
|
486
486
|
optionProps: Z = {},
|
|
487
487
|
events: e
|
|
488
488
|
} = a, {
|
|
489
|
-
label:
|
|
489
|
+
label: t = "label",
|
|
490
490
|
value: d = "value",
|
|
491
|
-
extLabel:
|
|
491
|
+
extLabel: f
|
|
492
492
|
} = Z, {
|
|
493
|
-
mapField:
|
|
493
|
+
mapField: m
|
|
494
494
|
} = i, u = useComponent();
|
|
495
495
|
i.multiple && h[r.field] && !isArray(h[r.field]) && h[r.field].split(",").forEach((n) => {
|
|
496
|
-
!c.some((C) => C[
|
|
496
|
+
!c.some((C) => C[t] === n) && c.push({
|
|
497
497
|
[d]: n,
|
|
498
|
-
[
|
|
498
|
+
[t]: n
|
|
499
499
|
});
|
|
500
500
|
});
|
|
501
501
|
function H(n) {
|
|
@@ -505,7 +505,7 @@ const VxetableRender = (VXETable, {
|
|
|
505
505
|
});
|
|
506
506
|
}
|
|
507
507
|
function p() {
|
|
508
|
-
u.clear(h, r.field,
|
|
508
|
+
u.clear(h, r.field, m, e, "row");
|
|
509
509
|
}
|
|
510
510
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
511
511
|
modelValue: h[r.field],
|
|
@@ -518,7 +518,7 @@ const VxetableRender = (VXETable, {
|
|
|
518
518
|
onClear: () => p()
|
|
519
519
|
}), _isSlot(o = c.map((n) => createVNode(resolveComponent("el-option"), {
|
|
520
520
|
key: n[d],
|
|
521
|
-
label:
|
|
521
|
+
label: f && n[f] ? n[d] : n[t],
|
|
522
522
|
value: n[d]
|
|
523
523
|
}, null))) ? o : {
|
|
524
524
|
default: () => [o]
|
|
@@ -555,20 +555,20 @@ const VxetableRender = (VXETable, {
|
|
|
555
555
|
optionProps: Z = {},
|
|
556
556
|
events: e
|
|
557
557
|
} = a, {
|
|
558
|
-
label:
|
|
558
|
+
label: t = "label",
|
|
559
559
|
value: d = "value"
|
|
560
|
-
} = Z,
|
|
561
|
-
defaultValues:
|
|
560
|
+
} = Z, f = useComponent(), {
|
|
561
|
+
defaultValues: m,
|
|
562
562
|
mapField: u
|
|
563
563
|
} = i;
|
|
564
|
-
|
|
564
|
+
m && (h[r] = m);
|
|
565
565
|
function H(n) {
|
|
566
|
-
|
|
566
|
+
f.selectChange(n, h, r, a, {
|
|
567
567
|
datasource: "data"
|
|
568
568
|
});
|
|
569
569
|
}
|
|
570
570
|
function p() {
|
|
571
|
-
|
|
571
|
+
f.clear(h, r, u, e, "data");
|
|
572
572
|
}
|
|
573
573
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
574
574
|
modelValue: h[r],
|
|
@@ -581,7 +581,7 @@ const VxetableRender = (VXETable, {
|
|
|
581
581
|
onClear: () => p()
|
|
582
582
|
}), _isSlot(o = c.map((n) => createVNode(resolveComponent("el-option"), {
|
|
583
583
|
key: n[d],
|
|
584
|
-
label: n[
|
|
584
|
+
label: n[t],
|
|
585
585
|
value: n[d]
|
|
586
586
|
}, null))) ? o : {
|
|
587
587
|
default: () => [o]
|
|
@@ -600,7 +600,7 @@ const VxetableRender = (VXETable, {
|
|
|
600
600
|
mapField: e
|
|
601
601
|
} = r;
|
|
602
602
|
Z && (o[h] = Z);
|
|
603
|
-
function
|
|
603
|
+
function t(f, m) {
|
|
604
604
|
const {
|
|
605
605
|
mapField: u,
|
|
606
606
|
field: H,
|
|
@@ -610,24 +610,23 @@ const VxetableRender = (VXETable, {
|
|
|
610
610
|
if (n) {
|
|
611
611
|
if (n) {
|
|
612
612
|
const C = {};
|
|
613
|
-
o[p || H] =
|
|
614
|
-
for (const
|
|
615
|
-
C[
|
|
613
|
+
o[p || H] = f.reduce((A, w) => {
|
|
614
|
+
for (const V in u)
|
|
615
|
+
C[V] = A ? C[V] + "," + w[u[V]] : w[u[V]];
|
|
616
616
|
return A = A ? A + "," + w[p || H] : w[p || H], A;
|
|
617
617
|
}, ""), Object.assign(o, C);
|
|
618
618
|
}
|
|
619
619
|
} else {
|
|
620
620
|
const C = {
|
|
621
|
-
[p || H]: m
|
|
621
|
+
[p || H]: f[m || p || H]
|
|
622
622
|
};
|
|
623
623
|
for (const A in u)
|
|
624
|
-
C[A] =
|
|
624
|
+
C[A] = f[u[A]];
|
|
625
625
|
Object.assign(o, C);
|
|
626
626
|
}
|
|
627
627
|
const y = {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
item: m,
|
|
628
|
+
data: o,
|
|
629
|
+
options: f,
|
|
631
630
|
field: H
|
|
632
631
|
};
|
|
633
632
|
c != null && c.change && c.change(y);
|
|
@@ -639,7 +638,7 @@ const VxetableRender = (VXETable, {
|
|
|
639
638
|
record: o
|
|
640
639
|
}, r, {
|
|
641
640
|
mode: "vxe",
|
|
642
|
-
onChange: (
|
|
641
|
+
onChange: (f, m) => t(f, m),
|
|
643
642
|
onClear: () => d()
|
|
644
643
|
}), null)];
|
|
645
644
|
},
|
|
@@ -652,22 +651,27 @@ const VxetableRender = (VXETable, {
|
|
|
652
651
|
props: r,
|
|
653
652
|
events: c
|
|
654
653
|
} = a, i = useComponent();
|
|
655
|
-
function Z(
|
|
654
|
+
function Z(t, d) {
|
|
656
655
|
const {
|
|
657
|
-
mapField:
|
|
658
|
-
field:
|
|
656
|
+
mapField: f,
|
|
657
|
+
field: m,
|
|
659
658
|
displayName: u,
|
|
660
659
|
multiple: H
|
|
661
660
|
} = r;
|
|
662
661
|
if (!H) {
|
|
663
|
-
const
|
|
664
|
-
[u ||
|
|
662
|
+
const n = {
|
|
663
|
+
[u || m]: t[d || u || m]
|
|
665
664
|
};
|
|
666
|
-
for (const
|
|
667
|
-
|
|
668
|
-
Object.assign(o,
|
|
665
|
+
for (const y in f)
|
|
666
|
+
n[y] = t[f[y]];
|
|
667
|
+
Object.assign(o, n);
|
|
669
668
|
}
|
|
670
|
-
|
|
669
|
+
const p = {
|
|
670
|
+
row: o,
|
|
671
|
+
options: t,
|
|
672
|
+
field: h.field
|
|
673
|
+
};
|
|
674
|
+
c != null && c.change && c.change(p);
|
|
671
675
|
}
|
|
672
676
|
function e() {
|
|
673
677
|
i.clear(o, h.field, mapField, c, "row");
|
|
@@ -677,7 +681,7 @@ const VxetableRender = (VXETable, {
|
|
|
677
681
|
mode: "vxe",
|
|
678
682
|
transfer: !0
|
|
679
683
|
}, r, {
|
|
680
|
-
onChange: (
|
|
684
|
+
onChange: (t, d) => Z(t, d),
|
|
681
685
|
onClear: () => e()
|
|
682
686
|
}), null)];
|
|
683
687
|
},
|
|
@@ -690,22 +694,27 @@ const VxetableRender = (VXETable, {
|
|
|
690
694
|
props: r,
|
|
691
695
|
events: c
|
|
692
696
|
} = a, i = useComponent();
|
|
693
|
-
function Z(
|
|
697
|
+
function Z(t, d) {
|
|
694
698
|
const {
|
|
695
|
-
mapField:
|
|
696
|
-
field:
|
|
699
|
+
mapField: f,
|
|
700
|
+
field: m,
|
|
697
701
|
displayName: u,
|
|
698
702
|
multiple: H
|
|
699
703
|
} = r;
|
|
700
704
|
if (!H) {
|
|
701
|
-
const
|
|
702
|
-
[u ||
|
|
705
|
+
const n = {
|
|
706
|
+
[u || m]: t[d || u || m]
|
|
703
707
|
};
|
|
704
|
-
for (const
|
|
705
|
-
|
|
706
|
-
Object.assign(o,
|
|
708
|
+
for (const y in f)
|
|
709
|
+
n[y] = t[f[y]];
|
|
710
|
+
Object.assign(o, n);
|
|
707
711
|
}
|
|
708
|
-
|
|
712
|
+
const p = {
|
|
713
|
+
row: o,
|
|
714
|
+
options: t,
|
|
715
|
+
field: h.field
|
|
716
|
+
};
|
|
717
|
+
c != null && c.change && c.change(p);
|
|
709
718
|
}
|
|
710
719
|
function e() {
|
|
711
720
|
i.clear(o, h.field, mapField, c, "row");
|
|
@@ -714,7 +723,7 @@ const VxetableRender = (VXETable, {
|
|
|
714
723
|
record: o,
|
|
715
724
|
mode: "ele"
|
|
716
725
|
}, r, {
|
|
717
|
-
onChange: (
|
|
726
|
+
onChange: (t, d) => Z(t, d),
|
|
718
727
|
onClear: () => e()
|
|
719
728
|
}), null)];
|
|
720
729
|
},
|
|
@@ -781,24 +790,24 @@ const VxetableRender = (VXETable, {
|
|
|
781
790
|
},
|
|
782
791
|
events: Z
|
|
783
792
|
} = a;
|
|
784
|
-
function e(
|
|
793
|
+
function e(t) {
|
|
785
794
|
const d = {
|
|
786
795
|
row: o,
|
|
787
796
|
column: h,
|
|
788
|
-
value:
|
|
797
|
+
value: t
|
|
789
798
|
};
|
|
790
799
|
Z != null && Z.change && Z.change(d);
|
|
791
800
|
}
|
|
792
801
|
return [o[h.field] ? createVNode(resolveComponent("el-switch"), mergeProps({
|
|
793
802
|
modelValue: o[h.field],
|
|
794
|
-
"onUpdate:modelValue": (
|
|
803
|
+
"onUpdate:modelValue": (t) => o[h.field] = t,
|
|
795
804
|
"inline-prompt": !0,
|
|
796
805
|
size: "large",
|
|
797
806
|
style: "--el-switch-on-color: #13ce66; --el-switch-off-color: #E6A23C"
|
|
798
807
|
}, a.props, {
|
|
799
808
|
"active-text": getValue(r, c),
|
|
800
809
|
"inactive-text": getValue(r, i),
|
|
801
|
-
onChange: (
|
|
810
|
+
onChange: (t) => e(t)
|
|
802
811
|
}), null) : null];
|
|
803
812
|
}
|
|
804
813
|
}), VXETable.renderer.add("#iconSelect", {
|
|
@@ -851,8 +860,8 @@ const VxetableRender = (VXETable, {
|
|
|
851
860
|
"check-strictly": !0
|
|
852
861
|
}, r, {
|
|
853
862
|
filterable: !0,
|
|
854
|
-
onCheckChange: (Z, e,
|
|
855
|
-
onNodeClick: (Z, e,
|
|
863
|
+
onCheckChange: (Z, e, t) => onCheckChange(Z, e, t, i),
|
|
864
|
+
onNodeClick: (Z, e, t) => onNodeClick(Z, e, t, i),
|
|
856
865
|
onCurrentChange: (Z, e) => onCurrentChange(Z, e, i)
|
|
857
866
|
}), null)];
|
|
858
867
|
},
|
|
@@ -866,7 +875,7 @@ const VxetableRender = (VXETable, {
|
|
|
866
875
|
} = a, {
|
|
867
876
|
children: i = "children",
|
|
868
877
|
label: Z = "label"
|
|
869
|
-
} = c, e = findTree(r, (
|
|
878
|
+
} = c, e = findTree(r, (t) => t.value === o[h.field], {
|
|
870
879
|
children: i
|
|
871
880
|
});
|
|
872
881
|
return e ? [createVNode("span", null, [e.item[Z]])] : null;
|
|
@@ -887,8 +896,8 @@ const VxetableRender = (VXETable, {
|
|
|
887
896
|
"check-strictly": !0
|
|
888
897
|
}, r, {
|
|
889
898
|
filterable: !0,
|
|
890
|
-
onCheckChange: (Z, e,
|
|
891
|
-
onNodeClick: (Z, e,
|
|
899
|
+
onCheckChange: (Z, e, t) => onCheckChange(Z, e, t, i),
|
|
900
|
+
onNodeClick: (Z, e, t) => onNodeClick(Z, e, t, i),
|
|
892
901
|
onCurrentChange: (Z, e) => onCurrentChange(Z, e, i)
|
|
893
902
|
}), null)];
|
|
894
903
|
}
|
|
@@ -896,8 +905,8 @@ const VxetableRender = (VXETable, {
|
|
|
896
905
|
const useComponent = () => ({
|
|
897
906
|
clear: (r, c, i, Z, e) => {
|
|
898
907
|
if (r[c] = null, !isEmpty(i))
|
|
899
|
-
for (const
|
|
900
|
-
r[
|
|
908
|
+
for (const t in i)
|
|
909
|
+
r[t] = null;
|
|
901
910
|
Z != null && Z.clear && Z.clear({
|
|
902
911
|
[e]: r,
|
|
903
912
|
field: c
|
|
@@ -907,53 +916,53 @@ const VxetableRender = (VXETable, {
|
|
|
907
916
|
const {
|
|
908
917
|
options: Z,
|
|
909
918
|
props: e,
|
|
910
|
-
events:
|
|
919
|
+
events: t
|
|
911
920
|
} = i, {
|
|
912
921
|
fetchField: d,
|
|
913
|
-
url:
|
|
914
|
-
defaultParams:
|
|
922
|
+
url: f,
|
|
923
|
+
defaultParams: m = {},
|
|
915
924
|
method: u = "get"
|
|
916
925
|
} = e, H = getCookieParam(), p = Object.assign({
|
|
917
926
|
pageSize: 20,
|
|
918
927
|
pageNum: 1,
|
|
919
928
|
...H,
|
|
920
|
-
...
|
|
929
|
+
...m
|
|
921
930
|
}, {
|
|
922
931
|
[d || c]: r
|
|
923
932
|
});
|
|
924
933
|
if (e.loading) return;
|
|
925
934
|
let n;
|
|
926
935
|
try {
|
|
927
|
-
Z.length = 0, e.loading = !0, n = await serviceApi[u](
|
|
936
|
+
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));
|
|
928
937
|
} finally {
|
|
929
938
|
e.loading = !1;
|
|
930
939
|
}
|
|
931
940
|
},
|
|
932
941
|
selectChange: (r, c, i, Z, e) => {
|
|
933
|
-
let
|
|
942
|
+
let t = null;
|
|
934
943
|
const {
|
|
935
944
|
datasource: d
|
|
936
945
|
} = e, {
|
|
937
|
-
options:
|
|
938
|
-
props:
|
|
946
|
+
options: f,
|
|
947
|
+
props: m,
|
|
939
948
|
optionProps: u = {},
|
|
940
949
|
events: H
|
|
941
950
|
} = Z, p = {
|
|
942
951
|
[d]: c,
|
|
943
952
|
field: i
|
|
944
953
|
};
|
|
945
|
-
c[i] = null, !isEmpty(r) && (
|
|
946
|
-
const y =
|
|
947
|
-
y && !isEmpty(
|
|
948
|
-
const A = y[
|
|
954
|
+
c[i] = null, !isEmpty(r) && (m != null && m.multiple) ? (c[i] = r.join(","), t = [], r.forEach((n) => {
|
|
955
|
+
const y = f.find((C) => n === C[u == null ? void 0 : u.value]);
|
|
956
|
+
y && !isEmpty(m.mapField) && isObject(m.mapField) && Object.keys(m.mapField).forEach((C) => {
|
|
957
|
+
const A = y[m.mapField[C]], w = c[C] ? c[C].toString() : "";
|
|
949
958
|
c[C] = w && !w.includes(A) ? `${w},${A}` : A;
|
|
950
|
-
}), y &&
|
|
959
|
+
}), y && t.push(y);
|
|
951
960
|
}), Object.assign(p, {
|
|
952
|
-
options:
|
|
953
|
-
})) : (c[i] =
|
|
954
|
-
c[n] =
|
|
961
|
+
options: t
|
|
962
|
+
})) : (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) => {
|
|
963
|
+
c[n] = t ? t[m.mapField[n]] : null;
|
|
955
964
|
}), Object.assign(p, {
|
|
956
|
-
option:
|
|
965
|
+
option: t
|
|
957
966
|
})), d === "row" && Object.assign(p, {
|
|
958
967
|
column: e.column
|
|
959
968
|
}), H != null && H.change && H.change(p);
|
|
@@ -963,10 +972,10 @@ const VxetableRender = (VXETable, {
|
|
|
963
972
|
const {
|
|
964
973
|
multiple: Z,
|
|
965
974
|
defaultValue: e
|
|
966
|
-
} = r,
|
|
967
|
-
!c[i] && e && (c[i] = e, isPlainObject(e) && Object.keys(e).forEach((
|
|
968
|
-
c[
|
|
969
|
-
})), !c[
|
|
975
|
+
} = r, t = Z ? `_${i}` : i;
|
|
976
|
+
!c[i] && e && (c[i] = e, isPlainObject(e) && Object.keys(e).forEach((m) => {
|
|
977
|
+
c[m] = c[m] || e[m];
|
|
978
|
+
})), !c[t] && c[i] && (c[t] = Z ? (d = c[i]) == null ? void 0 : d.split(",") : c[i]);
|
|
970
979
|
}
|
|
971
980
|
}), onCheckChange = (a, l, o, h) => {
|
|
972
981
|
console.log(a, l, o), h != null && h.checkChange && (h == null || h.checkChange(a, l, o));
|
|
@@ -1031,41 +1040,41 @@ const openLink = (a) => {
|
|
|
1031
1040
|
}, domSymbol = Symbol("watermark-dom");
|
|
1032
1041
|
function useWatermark(a = ref(document.body)) {
|
|
1033
1042
|
const l = useRafThrottle(function() {
|
|
1034
|
-
const
|
|
1035
|
-
if (!
|
|
1036
|
-
const { clientHeight: d, clientWidth:
|
|
1037
|
-
i({ height: d, width:
|
|
1043
|
+
const t = unref(a);
|
|
1044
|
+
if (!t) return;
|
|
1045
|
+
const { clientHeight: d, clientWidth: f } = t;
|
|
1046
|
+
i({ height: d, width: f });
|
|
1038
1047
|
}), o = domSymbol.toString(), h = shallowRef(), r = () => {
|
|
1039
|
-
const
|
|
1048
|
+
const t = unref(h);
|
|
1040
1049
|
h.value = void 0;
|
|
1041
1050
|
const d = unref(a);
|
|
1042
|
-
d && (
|
|
1051
|
+
d && (t && d.removeChild(t), removeResizeListener(d, l));
|
|
1043
1052
|
};
|
|
1044
|
-
function c(
|
|
1045
|
-
const
|
|
1046
|
-
Object.assign(
|
|
1047
|
-
const H =
|
|
1048
|
-
return H && (H.rotate(-20 * Math.PI / 120), H.font = (d == null ? void 0 : d.font) ?? "15px Reggae One", H.fillStyle = (d == null ? void 0 : d.fillStyle) ?? "rgba(180, 180, 180, 0.75)", H.textAlign = "left", H.textBaseline = "middle", H.fillText(
|
|
1053
|
+
function c(t, d) {
|
|
1054
|
+
const f = document.createElement("canvas"), m = 260, u = 180;
|
|
1055
|
+
Object.assign(f, { width: m, height: u });
|
|
1056
|
+
const H = f.getContext("2d");
|
|
1057
|
+
return H && (H.rotate(-20 * Math.PI / 120), H.font = (d == null ? void 0 : d.font) ?? "15px Reggae One", H.fillStyle = (d == null ? void 0 : d.fillStyle) ?? "rgba(180, 180, 180, 0.75)", H.textAlign = "left", H.textBaseline = "middle", H.fillText(t, m / 20, u)), f.toDataURL("image/png");
|
|
1049
1058
|
}
|
|
1050
|
-
function i(
|
|
1059
|
+
function i(t = {}) {
|
|
1051
1060
|
const d = unref(h);
|
|
1052
|
-
d && (isUndefined(
|
|
1053
|
-
|
|
1054
|
-
|
|
1061
|
+
d && (isUndefined(t.width) || (d.style.width = `${t.width}px`), isUndefined(t.height) || (d.style.height = `${t.height}px`), isUndefined(t.str) || (d.style.background = `url(${c(
|
|
1062
|
+
t.str,
|
|
1063
|
+
t.attr
|
|
1055
1064
|
)}) left top repeat`));
|
|
1056
1065
|
}
|
|
1057
|
-
const Z = (
|
|
1066
|
+
const Z = (t, d) => {
|
|
1058
1067
|
if (unref(h))
|
|
1059
|
-
return i({ str:
|
|
1060
|
-
const
|
|
1061
|
-
h.value =
|
|
1062
|
-
const
|
|
1063
|
-
if (!
|
|
1064
|
-
const { clientHeight: u, clientWidth: H } =
|
|
1065
|
-
return i({ str:
|
|
1068
|
+
return i({ str: t, attr: d }), o;
|
|
1069
|
+
const f = document.createElement("div");
|
|
1070
|
+
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";
|
|
1071
|
+
const m = unref(a);
|
|
1072
|
+
if (!m) return o;
|
|
1073
|
+
const { clientHeight: u, clientWidth: H } = m;
|
|
1074
|
+
return i({ str: t, width: H, height: u, attr: d }), m.appendChild(f), o;
|
|
1066
1075
|
};
|
|
1067
|
-
function e(
|
|
1068
|
-
Z(
|
|
1076
|
+
function e(t, d) {
|
|
1077
|
+
Z(t, d), addResizeListener(document.documentElement, l), getCurrentInstance() && onBeforeUnmount(() => {
|
|
1069
1078
|
r();
|
|
1070
1079
|
});
|
|
1071
1080
|
}
|
|
@@ -1080,182 +1089,189 @@ function useAttrs(a = {}) {
|
|
|
1080
1089
|
if (!l) return {};
|
|
1081
1090
|
const { excludeListeners: o = !1, excludeKeys: h = [] } = a, r = shallowRef({}), c = h.concat(DEFAULT_EXCLUDE_KEYS);
|
|
1082
1091
|
return l.attrs = reactive(l.attrs), watchEffect(() => {
|
|
1083
|
-
const i = entries(l.attrs).reduce((Z, [e,
|
|
1092
|
+
const i = entries(l.attrs).reduce((Z, [e, t]) => (!c.includes(e) && !(o && LISTENER_PREFIX.test(e)) && (Z[e] = t), Z), {});
|
|
1084
1093
|
r.value = i;
|
|
1085
1094
|
}), r;
|
|
1086
1095
|
}
|
|
1087
1096
|
const useRender = () => {
|
|
1088
|
-
const a = { value: "dictCode", label: "dictName" }, l = (
|
|
1089
|
-
var
|
|
1090
|
-
const
|
|
1097
|
+
const a = { value: "dictCode", label: "dictName" }, l = (v, b) => {
|
|
1098
|
+
var N;
|
|
1099
|
+
const M = k(b);
|
|
1091
1100
|
let s = {
|
|
1092
1101
|
clearable: !0,
|
|
1093
1102
|
disabled: !1,
|
|
1094
1103
|
showValue: !1,
|
|
1095
1104
|
placeholder: null
|
|
1096
|
-
}, L,
|
|
1097
|
-
isObject(
|
|
1098
|
-
const
|
|
1105
|
+
}, L, x;
|
|
1106
|
+
isObject(v) ? (s = Object.assign(s, v), L = v.defaultValue, x = v == null ? void 0 : v.code) : x = v;
|
|
1107
|
+
const D = (N = storageLocal.getItem("kLov")[x]) == null ? void 0 : N.children, F = D ? D.filter((E) => E.enabled === "1") : [];
|
|
1099
1108
|
return {
|
|
1100
1109
|
name: "#select",
|
|
1101
1110
|
optionProps: a,
|
|
1102
|
-
options:
|
|
1111
|
+
options: F,
|
|
1103
1112
|
props: s,
|
|
1104
1113
|
defaultValue: L,
|
|
1105
|
-
events:
|
|
1114
|
+
events: M
|
|
1106
1115
|
};
|
|
1107
|
-
}, o = (
|
|
1108
|
-
const
|
|
1116
|
+
}, o = (v, b) => {
|
|
1117
|
+
const M = k(b);
|
|
1109
1118
|
return {
|
|
1110
1119
|
name: "#SuSelect",
|
|
1111
|
-
optionProps: (
|
|
1112
|
-
props:
|
|
1113
|
-
options: (
|
|
1114
|
-
events:
|
|
1120
|
+
optionProps: (v == null ? void 0 : v.optionProps) || { label: "label", value: "value" },
|
|
1121
|
+
props: v == null ? void 0 : v.props,
|
|
1122
|
+
options: (v == null ? void 0 : v.options) || [],
|
|
1123
|
+
events: M
|
|
1115
1124
|
};
|
|
1116
|
-
}, h = (
|
|
1117
|
-
const
|
|
1125
|
+
}, h = (v, b) => {
|
|
1126
|
+
const M = {
|
|
1118
1127
|
optionProps: { extLabel: "userName", value: "employeeName" },
|
|
1119
1128
|
props: {
|
|
1120
|
-
attrs: { disabled:
|
|
1121
|
-
disabled:
|
|
1122
|
-
defaultValue:
|
|
1123
|
-
mapField:
|
|
1129
|
+
attrs: { disabled: v == null ? void 0 : v.disabled },
|
|
1130
|
+
disabled: v == null ? void 0 : v.disabled,
|
|
1131
|
+
defaultValue: v == null ? void 0 : v.defaultValue,
|
|
1132
|
+
mapField: v == null ? void 0 : v.mapField,
|
|
1124
1133
|
code: "SYS037",
|
|
1125
1134
|
url: "/uums/employee/listEmployeeIsUser",
|
|
1126
1135
|
fetchField: "employeeName"
|
|
1127
1136
|
}
|
|
1128
1137
|
};
|
|
1129
|
-
return o(
|
|
1130
|
-
}, r = (
|
|
1131
|
-
const
|
|
1138
|
+
return o(M, b);
|
|
1139
|
+
}, r = (v) => {
|
|
1140
|
+
const b = {
|
|
1132
1141
|
optionProps: { extLabel: "userName", value: "name" },
|
|
1133
1142
|
props: {
|
|
1134
1143
|
code: "sys/listUsers",
|
|
1135
1144
|
url: "/uums/user",
|
|
1136
1145
|
fetchField: "name",
|
|
1137
|
-
mapField:
|
|
1146
|
+
mapField: v == null ? void 0 : v.mapField
|
|
1138
1147
|
}
|
|
1139
1148
|
};
|
|
1140
|
-
return o(
|
|
1141
|
-
}, c = (
|
|
1142
|
-
const
|
|
1149
|
+
return o(b);
|
|
1150
|
+
}, c = (v, b) => {
|
|
1151
|
+
const M = {
|
|
1143
1152
|
label: "organizationName",
|
|
1144
|
-
value: (
|
|
1153
|
+
value: (v == null ? void 0 : v.field) || "organizationName"
|
|
1145
1154
|
}, s = {
|
|
1146
1155
|
mapField: {},
|
|
1147
|
-
defaultParams:
|
|
1156
|
+
defaultParams: v == null ? void 0 : v.defaultParams,
|
|
1148
1157
|
url: "/uums/cusOrganization",
|
|
1149
1158
|
fetchField: "organizationName"
|
|
1150
1159
|
}, L = {
|
|
1151
1160
|
organizationId: "id",
|
|
1152
1161
|
organizationCode: "organizationCode"
|
|
1153
1162
|
};
|
|
1154
|
-
return Object.assign(s.mapField, L, (
|
|
1155
|
-
}, i = (
|
|
1156
|
-
const
|
|
1163
|
+
return Object.assign(s.mapField, L, (v == null ? void 0 : v.mapField) || {}), { name: "#SuSelect", props: s, optionProps: M, options: [], methods: b };
|
|
1164
|
+
}, i = (v, b) => {
|
|
1165
|
+
const M = {
|
|
1157
1166
|
label: "orgName",
|
|
1158
|
-
value: (
|
|
1167
|
+
value: (v == null ? void 0 : v.field) || "orgName"
|
|
1159
1168
|
}, s = {
|
|
1160
1169
|
mapField: {},
|
|
1161
|
-
defaultParams:
|
|
1170
|
+
defaultParams: v == null ? void 0 : v.defaultParams,
|
|
1162
1171
|
url: "/uums/org",
|
|
1163
1172
|
fetchField: "orgName"
|
|
1164
1173
|
}, L = { orgId: "id", orgCode: "orgCode" };
|
|
1165
|
-
return Object.assign(s.mapField, L, (
|
|
1166
|
-
}, Z = (
|
|
1167
|
-
const
|
|
1174
|
+
return Object.assign(s.mapField, L, (v == null ? void 0 : v.mapField) || {}), { name: "#SuSelect", props: s, optionProps: M, options: [], methods: b };
|
|
1175
|
+
}, Z = (v, b) => {
|
|
1176
|
+
const M = Object.assign({ disabled: !1 }, v), s = M == null ? void 0 : M.defaultValue;
|
|
1168
1177
|
return {
|
|
1169
1178
|
name: "VxeInput",
|
|
1170
|
-
props:
|
|
1179
|
+
props: M,
|
|
1171
1180
|
defaultValue: s,
|
|
1172
|
-
events:
|
|
1181
|
+
events: k(b)
|
|
1173
1182
|
};
|
|
1174
|
-
}, e = (
|
|
1175
|
-
const
|
|
1183
|
+
}, e = (v, b) => {
|
|
1184
|
+
const M = Object.assign({ disabled: !1, rows: 3 }, v), s = M == null ? void 0 : M.defaultValue;
|
|
1176
1185
|
return {
|
|
1177
1186
|
name: "VxeTextarea",
|
|
1178
|
-
props:
|
|
1187
|
+
props: M,
|
|
1179
1188
|
defaultValue: s,
|
|
1180
|
-
events:
|
|
1189
|
+
events: k(b)
|
|
1181
1190
|
};
|
|
1182
|
-
},
|
|
1183
|
-
const
|
|
1184
|
-
return { name:
|
|
1185
|
-
}, d = (
|
|
1186
|
-
const
|
|
1187
|
-
return { name:
|
|
1188
|
-
},
|
|
1189
|
-
var
|
|
1190
|
-
let
|
|
1191
|
+
}, t = (v, b) => {
|
|
1192
|
+
const M = "VxeCheckbox", { defaultValue: s, options: L, props: x } = f(v);
|
|
1193
|
+
return { name: M, defaultValue: s, options: L, props: x, events: k(b) };
|
|
1194
|
+
}, d = (v, b) => {
|
|
1195
|
+
const M = "VxeRadio", { defaultValue: s, options: L, props: x } = f(v);
|
|
1196
|
+
return { name: M, defaultValue: s, options: L, props: x, events: k(b) };
|
|
1197
|
+
}, f = (v) => {
|
|
1198
|
+
var D;
|
|
1199
|
+
let b = { disabled: !1 }, M;
|
|
1191
1200
|
const s = storageLocal.getItem("kLov");
|
|
1192
1201
|
let L = "";
|
|
1193
|
-
isObject(
|
|
1194
|
-
const
|
|
1195
|
-
return { props:
|
|
1196
|
-
},
|
|
1197
|
-
const
|
|
1202
|
+
isObject(v) ? (M = v.defaultValue, L = v.code, b = Object.assign(b, v || {})) : isString(v) && (L = v);
|
|
1203
|
+
const x = L ? (D = s[L]) == null ? void 0 : D.children.map((F) => ({ label: F.dictName, value: F.dictCode })) : [];
|
|
1204
|
+
return { props: b, defaultValue: M, options: x };
|
|
1205
|
+
}, m = (v, b) => {
|
|
1206
|
+
const M = k(b);
|
|
1198
1207
|
return {
|
|
1199
1208
|
name: "VxeInput",
|
|
1200
1209
|
props: Object.assign(
|
|
1201
1210
|
{ type: "number", clearable: !0, min: 0, controls: !1 },
|
|
1202
|
-
|
|
1211
|
+
v || {}
|
|
1203
1212
|
),
|
|
1204
|
-
defaultValue:
|
|
1205
|
-
events:
|
|
1213
|
+
defaultValue: v == null ? void 0 : v.defaultValue,
|
|
1214
|
+
events: M
|
|
1206
1215
|
};
|
|
1207
|
-
}, u = (
|
|
1208
|
-
const
|
|
1209
|
-
return { name: "VxeInput", props: Object.assign({ type: "date", valueFormat: s, clearable: !0 },
|
|
1210
|
-
}, H = (
|
|
1211
|
-
const
|
|
1212
|
-
return { name: "#lov", props: Object.assign({},
|
|
1213
|
-
}, p = (
|
|
1214
|
-
const
|
|
1216
|
+
}, u = (v, b) => {
|
|
1217
|
+
const M = k(b), s = "yyyy-MM-dd HH:mm:ss", L = v == null ? void 0 : v.defaultValue;
|
|
1218
|
+
return { name: "VxeInput", props: Object.assign({ type: "date", valueFormat: s, clearable: !0 }, v || {}), defaultValue: L, events: M };
|
|
1219
|
+
}, H = (v, b) => {
|
|
1220
|
+
const M = k(b);
|
|
1221
|
+
return { name: "#lov", props: Object.assign({}, v || {}), events: M };
|
|
1222
|
+
}, p = (v, b) => {
|
|
1223
|
+
const M = k(b), s = (v == null ? void 0 : v.optionProps) || {
|
|
1215
1224
|
label: "label",
|
|
1216
1225
|
value: "value"
|
|
1217
1226
|
}, L = Object.assign(
|
|
1218
1227
|
{ clearable: !0, disabled: !1, showValue: !1 },
|
|
1219
|
-
|
|
1228
|
+
v || {}
|
|
1220
1229
|
);
|
|
1221
1230
|
return console.log("itemRender"), {
|
|
1222
1231
|
name: "#select",
|
|
1223
1232
|
optionProps: s,
|
|
1224
|
-
options: (
|
|
1233
|
+
options: (v == null ? void 0 : v.options) || [],
|
|
1225
1234
|
props: L,
|
|
1226
|
-
events:
|
|
1235
|
+
events: M
|
|
1227
1236
|
};
|
|
1228
|
-
}, n = (
|
|
1229
|
-
let
|
|
1237
|
+
}, n = (v, b) => {
|
|
1238
|
+
let M = {
|
|
1230
1239
|
openLabel: "是",
|
|
1231
1240
|
closeLabel: "否",
|
|
1232
1241
|
openValue: "Y",
|
|
1233
1242
|
closeValue: "N"
|
|
1234
1243
|
}, s = "Y";
|
|
1235
|
-
isObject(
|
|
1236
|
-
const L = isFunction(
|
|
1237
|
-
return { name: "VxeSwitch", props:
|
|
1238
|
-
}, y = (
|
|
1239
|
-
const
|
|
1244
|
+
isObject(v) && !isFunction(v) ? (M = Object.assign(M, v || {}), s = v.defaultValue || s) : !isEmpty(v) && isString(v) && (s = v, M = Object.assign(M, { defaultValue: s }));
|
|
1245
|
+
const L = isFunction(v) ? k(v) : k(b);
|
|
1246
|
+
return { name: "VxeSwitch", props: M, defaultValue: s, events: L };
|
|
1247
|
+
}, y = (v, b) => ({ name: "#tag", props: { code: v, tagMap: b } }), C = (v, b) => {
|
|
1248
|
+
const M = {
|
|
1240
1249
|
openLabel: "启用",
|
|
1241
1250
|
closeLabel: "禁用",
|
|
1242
1251
|
openValue: "1",
|
|
1243
1252
|
closeValue: "0",
|
|
1244
1253
|
defaultValue: "1"
|
|
1245
1254
|
};
|
|
1246
|
-
!isFunction(
|
|
1247
|
-
const s = isFunction(
|
|
1248
|
-
return n(
|
|
1249
|
-
}, A = () => ({ name: "#iconSelect" }), w = (
|
|
1250
|
-
|
|
1251
|
-
return
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1255
|
+
!isFunction(v) && isObject(v) && Object.assign(M, v);
|
|
1256
|
+
const s = isFunction(v) ? v : b;
|
|
1257
|
+
return n(M, s);
|
|
1258
|
+
}, A = () => ({ name: "#iconSelect" }), w = (v = [], b = {}, M) => ({ name: "#treeSelect", sourceData: v, props: b, events: M }), V = (v, b) => {
|
|
1259
|
+
const M = k(b);
|
|
1260
|
+
return {
|
|
1261
|
+
name: "#area",
|
|
1262
|
+
props: { mapField: (v == null ? void 0 : v.mapField) || ["province", "city", "region"] },
|
|
1263
|
+
events: M
|
|
1264
|
+
};
|
|
1265
|
+
}, k = (v) => {
|
|
1266
|
+
let b = {};
|
|
1267
|
+
return isObject(v) && !isFunction(v) ? b = {
|
|
1268
|
+
change: (v == null ? void 0 : v.change) || I,
|
|
1269
|
+
blur: (v == null ? void 0 : v.blur) || I,
|
|
1270
|
+
focus: (v == null ? void 0 : v.focus) || I,
|
|
1271
|
+
input: (v == null ? void 0 : v.input) || I,
|
|
1272
|
+
clear: (v == null ? void 0 : v.clear) || I,
|
|
1273
|
+
filterMethod: v == null ? void 0 : v.filterMethod
|
|
1274
|
+
} : v && (b = { change: v }), b;
|
|
1259
1275
|
};
|
|
1260
1276
|
function I() {
|
|
1261
1277
|
}
|
|
@@ -1264,13 +1280,13 @@ const useRender = () => {
|
|
|
1264
1280
|
renderSelect: o,
|
|
1265
1281
|
renderInput: Z,
|
|
1266
1282
|
renderTextarea: e,
|
|
1267
|
-
renderCheckBox:
|
|
1283
|
+
renderCheckBox: t,
|
|
1268
1284
|
renderRadio: d,
|
|
1269
1285
|
renderUser: h,
|
|
1270
1286
|
renderSysUser: r,
|
|
1271
1287
|
renderInvOrg: c,
|
|
1272
1288
|
renderBU: i,
|
|
1273
|
-
renderNumber:
|
|
1289
|
+
renderNumber: m,
|
|
1274
1290
|
renderLov: H,
|
|
1275
1291
|
renderSelectLocal: p,
|
|
1276
1292
|
renderDate: u,
|
|
@@ -1278,7 +1294,8 @@ const useRender = () => {
|
|
|
1278
1294
|
renderCellTag: y,
|
|
1279
1295
|
renderEnabled: C,
|
|
1280
1296
|
renderIconSelect: A,
|
|
1281
|
-
renderTreeSelect: w
|
|
1297
|
+
renderTreeSelect: w,
|
|
1298
|
+
renderArea: V
|
|
1282
1299
|
};
|
|
1283
1300
|
}, useGlobal = () => {
|
|
1284
1301
|
const a = getCurrentInstance();
|
|
@@ -1333,21 +1350,21 @@ const deviceDetection = () => {
|
|
|
1333
1350
|
}, errorMessage = (a = "操作失败", l = {}) => {
|
|
1334
1351
|
var o, h;
|
|
1335
1352
|
return l.type === "alert" ? (o = VxeUI.modal) == null ? void 0 : o.alert({ content: a, ...l, status: "error" }) : (h = VxeUI.modal) == null ? void 0 : h.message({ content: a, ...l, status: "error" });
|
|
1336
|
-
}, renderHook = useRender(), i18nColums = (a) => {
|
|
1337
|
-
let
|
|
1338
|
-
const
|
|
1339
|
-
return a.map((
|
|
1340
|
-
if (
|
|
1341
|
-
|
|
1342
|
-
const { showOverflow:
|
|
1343
|
-
return
|
|
1353
|
+
}, renderHook = useRender(), i18nColums = (a, l = !0) => {
|
|
1354
|
+
let o = 0, h = 0;
|
|
1355
|
+
const r = a.length - 1;
|
|
1356
|
+
return a.map((c, i) => {
|
|
1357
|
+
if (h = h + c.width, c.type) return c;
|
|
1358
|
+
c.title = c.title || `message.${c.field}`;
|
|
1359
|
+
const { showOverflow: Z } = c;
|
|
1360
|
+
return c.field !== "operate" && ((c.width > 99 || c.minWidth) && (c.showOverflow = Z === !1 ? Z : "tooltip"), c.sortable = !(l === !1 || c.sortable === !1)), o || (o = c.minWidth), !o && r === i && h < window.innerWidth && (c.minWidth = c.width, c.width = null), c;
|
|
1344
1361
|
});
|
|
1345
1362
|
}, formatItems = (a, l, o = 24) => a.length ? a.map((h) => {
|
|
1346
1363
|
var r, c, i;
|
|
1347
1364
|
if ((r = h.children) != null && r.length)
|
|
1348
1365
|
return h.children = formatItems(h.children, l, o), h;
|
|
1349
1366
|
{
|
|
1350
|
-
h.title = h.title || `message.${h.field}`, h.span = h.span || o, h.collapseNode && (h.title = "", h.titleWidth = 0);
|
|
1367
|
+
h.title = h.title || `message.${h.field}`, h.span = h.span || o, h.type === "collapseNode" && (h.title = "", h.titleWidth = 0);
|
|
1351
1368
|
let Z = !1;
|
|
1352
1369
|
l === "detail" ? (Z = !0, h.placeholder = null) : Z = h.disabled === !1 ? h.disabled : h.disabled || ((i = (c = h.itemRender) == null ? void 0 : c.props) == null ? void 0 : i.disabled);
|
|
1353
1370
|
let e = {
|
|
@@ -1383,20 +1400,20 @@ const deviceDetection = () => {
|
|
|
1383
1400
|
events: null
|
|
1384
1401
|
}
|
|
1385
1402
|
}, formatGridItems = (a, l) => {
|
|
1386
|
-
const o = a, h = o.length, r = h > 2 && o.some((
|
|
1403
|
+
const o = a, h = o.length, r = h > 2 && o.some((t, d) => d < 3 && (t.span > 6 || getDateRange(t))), c = r || h > 3, i = {
|
|
1387
1404
|
collapseTags: !0,
|
|
1388
1405
|
collapseTagsTooltip: !0,
|
|
1389
1406
|
multiple: !0
|
|
1390
|
-
}, Z = o.map((
|
|
1391
|
-
var
|
|
1392
|
-
return
|
|
1407
|
+
}, Z = o.map((t, d) => {
|
|
1408
|
+
var f, m, u;
|
|
1409
|
+
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(
|
|
1393
1410
|
i,
|
|
1394
|
-
((u =
|
|
1395
|
-
)),
|
|
1411
|
+
((u = t.itemRender) == null ? void 0 : u.props) || {}
|
|
1412
|
+
)), t;
|
|
1396
1413
|
}), e = clone(formSearchButtons, !0);
|
|
1397
1414
|
if (e.collapseNode = c, l && e.itemRender.options.length < 3 && (e.itemRender.options.push(l), e.itemRender.events = l.events), c) {
|
|
1398
|
-
const
|
|
1399
|
-
Z.splice(
|
|
1415
|
+
const t = r ? 2 : 3;
|
|
1416
|
+
Z.splice(t, 0, e);
|
|
1400
1417
|
} else
|
|
1401
1418
|
Z.push(e);
|
|
1402
1419
|
return Z;
|
|
@@ -1406,12 +1423,16 @@ const deviceDetection = () => {
|
|
|
1406
1423
|
}, formatRules = (a, l) => {
|
|
1407
1424
|
const o = {};
|
|
1408
1425
|
return a.forEach((h) => {
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1426
|
+
var r;
|
|
1427
|
+
if ((r = h.children) != null && r.length) {
|
|
1428
|
+
const c = formatRules(h.children, l);
|
|
1429
|
+
merge(o, c);
|
|
1430
|
+
} else if (h.required) {
|
|
1431
|
+
const { field: c, title: i } = h, Z = i == null ? void 0 : i.startsWith("message.");
|
|
1432
|
+
o[c] = [
|
|
1412
1433
|
{
|
|
1413
1434
|
required: !0,
|
|
1414
|
-
message: `${l("message.required")}${
|
|
1435
|
+
message: `${l("message.required")}${i && Z ? l(i) : i || l(`message.${c}`)}`
|
|
1415
1436
|
}
|
|
1416
1437
|
];
|
|
1417
1438
|
}
|
|
@@ -1494,9 +1515,9 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1494
1515
|
}
|
|
1495
1516
|
}, g = class g {
|
|
1496
1517
|
constructor() {
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1518
|
+
S(this, "router");
|
|
1519
|
+
S(this, "baseUrl", null);
|
|
1520
|
+
S(this, "getNetworkError", (l) => l ? {
|
|
1500
1521
|
400: "错误的请求",
|
|
1501
1522
|
401: "服务未授权,请重新登录",
|
|
1502
1523
|
403: "拒绝访问",
|
|
@@ -1534,7 +1555,7 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1534
1555
|
c.expires - i <= 0 ? (g.isRefreshing || (g.isRefreshing = !0, this.get(this.baseUrl + "/uath/refreshToken", {
|
|
1535
1556
|
refreshToken: c.refreshToken
|
|
1536
1557
|
}).then((e) => {
|
|
1537
|
-
this.setToken(e), l.headers.Authorization = "Bearer " + e.access_token, g.requests.forEach((
|
|
1558
|
+
this.setToken(e), l.headers.Authorization = "Bearer " + e.access_token, g.requests.forEach((t) => t(e.access_token)), g.requests = [];
|
|
1538
1559
|
}).finally(() => {
|
|
1539
1560
|
g.isRefreshing = !1;
|
|
1540
1561
|
})), h(g.retryOriginalRequest(l))) : (l.headers.Authorization = "Bearer " + c.accessToken, h(l));
|
|
@@ -1591,16 +1612,16 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1591
1612
|
else if ((e == null ? void 0 : e.code) !== "-1")
|
|
1592
1613
|
i(e);
|
|
1593
1614
|
else {
|
|
1594
|
-
const
|
|
1595
|
-
errorMessage(
|
|
1615
|
+
const t = (e == null ? void 0 : e.msg) || "服务异常";
|
|
1616
|
+
errorMessage(t, { duration: 8e3 }), Z(t);
|
|
1596
1617
|
}
|
|
1597
1618
|
}).catch((e) => {
|
|
1598
|
-
var
|
|
1619
|
+
var t, d, f;
|
|
1599
1620
|
if (e != null && e.code) {
|
|
1600
|
-
if (((
|
|
1621
|
+
if (((t = e == null ? void 0 : e.response) == null ? void 0 : t.status) === 401)
|
|
1601
1622
|
return (d = this.router) == null ? void 0 : d.push({ path: "/login" });
|
|
1602
1623
|
errorMessage(
|
|
1603
|
-
this.getNetworkError((
|
|
1624
|
+
this.getNetworkError((f = e == null ? void 0 : e.response) == null ? void 0 : f.status) || (e == null ? void 0 : e.message),
|
|
1604
1625
|
{ duration: 8e3 }
|
|
1605
1626
|
);
|
|
1606
1627
|
}
|
|
@@ -1631,10 +1652,10 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1631
1652
|
}
|
|
1632
1653
|
};
|
|
1633
1654
|
/** token过期后,暂存待执行的请求 */
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1655
|
+
S(g, "requests", []), /** 防止重复刷新token */
|
|
1656
|
+
S(g, "isRefreshing", !1), // 初始化配置对象
|
|
1657
|
+
S(g, "initConfig", {}), // 保存当前Axios实例对象
|
|
1658
|
+
S(g, "axiosInstance", Axios.create(defaultConfig));
|
|
1638
1659
|
let SuHttp = g;
|
|
1639
1660
|
const http = new SuHttp(), lunarCalendar = {
|
|
1640
1661
|
/**
|
|
@@ -2437,15 +2458,15 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2437
2458
|
return -1;
|
|
2438
2459
|
let i;
|
|
2439
2460
|
h ? i = new Date(h, parseInt(r.toString()) - 1, c) : i = /* @__PURE__ */ new Date();
|
|
2440
|
-
let Z, e = 0,
|
|
2461
|
+
let Z, e = 0, t = 0;
|
|
2441
2462
|
h = i.getFullYear(), r = i.getMonth() + 1, c = i.getDate();
|
|
2442
2463
|
let d = (Date.UTC(i.getFullYear(), i.getMonth(), i.getDate()) - Date.UTC(1900, 0, 31)) / 864e5;
|
|
2443
2464
|
for (Z = 1900; Z < 2101 && d > 0; Z++)
|
|
2444
|
-
|
|
2445
|
-
d < 0 && (d +=
|
|
2446
|
-
const
|
|
2447
|
-
let
|
|
2448
|
-
|
|
2465
|
+
t = this.lYearDays(Z), d -= t;
|
|
2466
|
+
d < 0 && (d += t, Z--);
|
|
2467
|
+
const f = /* @__PURE__ */ new Date();
|
|
2468
|
+
let m = !1;
|
|
2469
|
+
f.getFullYear() === h && f.getMonth() + 1 === r && f.getDate() === c && (m = !0);
|
|
2449
2470
|
let u = i.getDay();
|
|
2450
2471
|
const H = this.nStr1[u];
|
|
2451
2472
|
u === 0 && (u = 7);
|
|
@@ -2453,20 +2474,20 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2453
2474
|
e = this.leapMonth(Z);
|
|
2454
2475
|
let n = !1;
|
|
2455
2476
|
for (Z = 1; Z < 13 && d > 0; Z++)
|
|
2456
|
-
e > 0 && Z === e + 1 && n === !1 ? (--Z, n = !0,
|
|
2457
|
-
d === 0 && e > 0 && Z === e + 1 && (n ? n = !1 : (n = !0, --Z)), d < 0 && (d +=
|
|
2458
|
-
const y = Z, C = d + 1, A = r - 1, w = this.toGanZhiYear(p),
|
|
2459
|
-
let
|
|
2460
|
-
c >=
|
|
2461
|
-
let
|
|
2462
|
-
|
|
2463
|
-
const
|
|
2464
|
-
let
|
|
2465
|
-
return y === 12 && C === 29 && this.monthDays(p, y) === 29 && (
|
|
2477
|
+
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;
|
|
2478
|
+
d === 0 && e > 0 && Z === e + 1 && (n ? n = !1 : (n = !0, --Z)), d < 0 && (d += t, --Z);
|
|
2479
|
+
const y = Z, C = d + 1, A = r - 1, w = this.toGanZhiYear(p), V = this.getTerm(h, r * 2 - 1), k = this.getTerm(h, r * 2);
|
|
2480
|
+
let I = this.toGanZhi((h - 1900) * 12 + r + 11);
|
|
2481
|
+
c >= V && (I = this.toGanZhi((h - 1900) * 12 + r + 12));
|
|
2482
|
+
let v = !1, b;
|
|
2483
|
+
V === c && (v = !0, b = this.solarTerm[r * 2 - 2]), k === c && (v = !0, b = this.solarTerm[r * 2 - 1]);
|
|
2484
|
+
const M = Date.UTC(h, A, 1, 0, 0, 0, 0) / 864e5 + 25567 + 10, s = this.toGanZhi(M + c - 1), L = this.toAstro(r, c), x = h + "-" + r + "-" + c, D = p + "-" + y + "-" + C, F = this.festival, N = this.lFestival, E = r + "-" + c;
|
|
2485
|
+
let R = y + "-" + C;
|
|
2486
|
+
return y === 12 && C === 29 && this.monthDays(p, y) === 29 && (R = "12-30"), {
|
|
2466
2487
|
date: x,
|
|
2467
2488
|
lunarDate: D,
|
|
2468
|
-
festival: F[
|
|
2469
|
-
lunarFestival: N[
|
|
2489
|
+
festival: F[E] ? F[E].title : null,
|
|
2490
|
+
lunarFestival: N[R] ? N[R].title : null,
|
|
2470
2491
|
lYear: p,
|
|
2471
2492
|
lMonth: y,
|
|
2472
2493
|
lDay: C,
|
|
@@ -2477,15 +2498,15 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2477
2498
|
cMonth: r,
|
|
2478
2499
|
cDay: c,
|
|
2479
2500
|
gzYear: w,
|
|
2480
|
-
gzMonth:
|
|
2481
|
-
gzDay:
|
|
2482
|
-
isToday:
|
|
2501
|
+
gzMonth: I,
|
|
2502
|
+
gzDay: s,
|
|
2503
|
+
isToday: m,
|
|
2483
2504
|
isLeap: n,
|
|
2484
2505
|
nWeek: u,
|
|
2485
2506
|
ncWeek: "星期" + H,
|
|
2486
|
-
isTerm:
|
|
2507
|
+
isTerm: v,
|
|
2487
2508
|
Term: b,
|
|
2488
|
-
astro:
|
|
2509
|
+
astro: L
|
|
2489
2510
|
};
|
|
2490
2511
|
},
|
|
2491
2512
|
/**
|
|
@@ -2510,11 +2531,11 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2510
2531
|
let Z = 0, e;
|
|
2511
2532
|
for (e = 1900; e < a; e++)
|
|
2512
2533
|
Z += this.lYearDays(e);
|
|
2513
|
-
let
|
|
2534
|
+
let t = 0, d = !1;
|
|
2514
2535
|
for (e = 1; e < l; e++)
|
|
2515
|
-
|
|
2536
|
+
t = this.leapMonth(a), d || t <= e && t > 0 && (Z += this.leapDays(a), d = !0), Z += this.monthDays(a, e);
|
|
2516
2537
|
h && (Z += c);
|
|
2517
|
-
const
|
|
2538
|
+
const f = Date.UTC(1900, 1, 30, 0, 0, 0), m = new Date((Z + o - 31) * 864e5 + f), u = m.getUTCFullYear(), H = m.getUTCMonth() + 1, p = m.getUTCDate();
|
|
2518
2539
|
return this.solar2lunar(u, H, p);
|
|
2519
2540
|
}
|
|
2520
2541
|
}, dict = storageLocal.getItem("kLov"), formats = {
|