@utogether/utils 3.0.0-beta.6 → 3.0.0-beta.8
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/storage.d.ts +0 -1
- package/dist/utils.es.js +292 -226
- package/dist/utils.umd.js +1 -1
- package/package.json +1 -1
package/dist/utils.es.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var S = (a, l, h) =>
|
|
1
|
+
var T = Object.defineProperty;
|
|
2
|
+
var j = (a, l, h) => l in a ? T(a, l, { enumerable: !0, configurable: !0, writable: !0, value: h }) : a[l] = h;
|
|
3
|
+
var S = (a, l, h) => j(a, typeof l != "symbol" ? l + "" : l, h);
|
|
4
4
|
import { createVNode, resolveComponent, mergeProps, isVNode, ref, shallowRef, unref, getCurrentInstance, onBeforeUnmount, reactive, watchEffect, isRef } from "vue";
|
|
5
5
|
import dayjs from "dayjs";
|
|
6
6
|
import XEUtils, { isArray, findTree, isEmpty, isObject, isPlainObject, isUndefined, isFunction, isString, clone, has } from "xe-utils";
|
|
7
7
|
import localforage from "localforage";
|
|
8
|
-
import { setCookie, getCookie, removeCookie } from "typescript-cookie";
|
|
9
8
|
import ResizeObserver from "resize-observer-polyfill";
|
|
10
9
|
import { VxeUI } from "vxe-pc-ui";
|
|
11
10
|
import Axios from "axios";
|
|
12
11
|
import NProgress from "nprogress";
|
|
13
|
-
import { default as
|
|
12
|
+
import { default as W } from "nprogress";
|
|
14
13
|
class sessionStorageProxy {
|
|
15
14
|
constructor(l) {
|
|
16
15
|
S(this, "storage");
|
|
@@ -70,7 +69,75 @@ class localforageProxy {
|
|
|
70
69
|
this.storage.clear();
|
|
71
70
|
}
|
|
72
71
|
}
|
|
73
|
-
const
|
|
72
|
+
const storageLocal = new localStorageProxy(localStorage), dbstorage = new localforageProxy();
|
|
73
|
+
/*! typescript-cookie v1.0.6 | MIT */
|
|
74
|
+
const encodeName = (a) => encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape), encodeValue = (a) => encodeURIComponent(a).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent), decodeName = decodeURIComponent, decodeValue = (a) => (a[0] === '"' && (a = a.slice(1, -1)), a.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent));
|
|
75
|
+
function stringifyAttributes(a) {
|
|
76
|
+
return a = Object.assign({}, a), typeof a.expires == "number" && (a.expires = new Date(Date.now() + a.expires * 864e5)), a.expires != null && (a.expires = a.expires.toUTCString()), Object.entries(a).filter(([l, h]) => h != null && h !== !1).map(([l, h]) => h === !0 ? `; ${l}` : `; ${l}=${h.split(";")[0]}`).join("");
|
|
77
|
+
}
|
|
78
|
+
function get(a, l, h) {
|
|
79
|
+
const o = /(?:^|; )([^=]*)=([^;]*)/g, r = {};
|
|
80
|
+
let c;
|
|
81
|
+
for (; (c = o.exec(document.cookie)) != null; )
|
|
82
|
+
try {
|
|
83
|
+
const i = h(c[1]);
|
|
84
|
+
if (r[i] = l(c[2], i), a === i)
|
|
85
|
+
break;
|
|
86
|
+
} catch {
|
|
87
|
+
}
|
|
88
|
+
return a != null ? r[a] : r;
|
|
89
|
+
}
|
|
90
|
+
const DEFAULT_CODEC = Object.freeze({
|
|
91
|
+
decodeName,
|
|
92
|
+
decodeValue,
|
|
93
|
+
encodeName,
|
|
94
|
+
encodeValue
|
|
95
|
+
}), DEFAULT_ATTRIBUTES = Object.freeze({
|
|
96
|
+
path: "/"
|
|
97
|
+
});
|
|
98
|
+
function setCookie(a, l, h = DEFAULT_ATTRIBUTES, { encodeValue: o = encodeValue, encodeName: r = encodeName } = {}) {
|
|
99
|
+
return document.cookie = `${r(a)}=${o(l, a)}${stringifyAttributes(h)}`;
|
|
100
|
+
}
|
|
101
|
+
function getCookie(a, { decodeValue: l = decodeValue, decodeName: h = decodeName } = {}) {
|
|
102
|
+
return get(a, l, h);
|
|
103
|
+
}
|
|
104
|
+
function getCookies({ decodeValue: a = decodeValue, decodeName: l = decodeName } = {}) {
|
|
105
|
+
return get(void 0, a, l);
|
|
106
|
+
}
|
|
107
|
+
function removeCookie(a, l = DEFAULT_ATTRIBUTES) {
|
|
108
|
+
setCookie(a, "", Object.assign({}, l, {
|
|
109
|
+
expires: -1
|
|
110
|
+
}));
|
|
111
|
+
}
|
|
112
|
+
function init(a, l) {
|
|
113
|
+
const h = {
|
|
114
|
+
set: function(r, c, i) {
|
|
115
|
+
return setCookie(r, c, Object.assign({}, this.attributes, i), {
|
|
116
|
+
encodeValue: this.converter.write
|
|
117
|
+
});
|
|
118
|
+
},
|
|
119
|
+
get: function(r) {
|
|
120
|
+
if (arguments.length === 0)
|
|
121
|
+
return getCookies(this.converter.read);
|
|
122
|
+
if (r != null)
|
|
123
|
+
return getCookie(r, this.converter.read);
|
|
124
|
+
},
|
|
125
|
+
remove: function(r, c) {
|
|
126
|
+
removeCookie(r, Object.assign({}, this.attributes, c));
|
|
127
|
+
},
|
|
128
|
+
withAttributes: function(r) {
|
|
129
|
+
return init(this.converter, Object.assign({}, this.attributes, r));
|
|
130
|
+
},
|
|
131
|
+
withConverter: function(r) {
|
|
132
|
+
return init(Object.assign({}, this.converter, r), this.attributes);
|
|
133
|
+
}
|
|
134
|
+
}, o = {
|
|
135
|
+
attributes: { value: Object.freeze(l) },
|
|
136
|
+
converter: { value: Object.freeze(a) }
|
|
137
|
+
};
|
|
138
|
+
return Object.create(h, o);
|
|
139
|
+
}
|
|
140
|
+
init({ read: DEFAULT_CODEC.decodeValue, write: DEFAULT_CODEC.encodeValue }, DEFAULT_ATTRIBUTES);
|
|
74
141
|
class Cookies {
|
|
75
142
|
constructor() {
|
|
76
143
|
S(this, "prefix", null);
|
|
@@ -134,14 +201,14 @@ const VxetableRender = (VXETable, {
|
|
|
134
201
|
optionProps: Z = {},
|
|
135
202
|
events: t
|
|
136
203
|
} = a, {
|
|
137
|
-
label:
|
|
204
|
+
label: v = "label",
|
|
138
205
|
value: d = "value",
|
|
139
206
|
extLabel: f
|
|
140
207
|
} = Z, {
|
|
141
208
|
loading: m = !1,
|
|
142
|
-
multiple:
|
|
209
|
+
multiple: H,
|
|
143
210
|
mapField: b
|
|
144
|
-
} = i, M = useComponent(), n =
|
|
211
|
+
} = i, M = useComponent(), n = H ? `_${r.field}` : r.field;
|
|
145
212
|
M.setDefaultValue(i, o, r.field);
|
|
146
213
|
function s(y) {
|
|
147
214
|
M.remote(y, field, a);
|
|
@@ -178,7 +245,7 @@ const VxetableRender = (VXETable, {
|
|
|
178
245
|
onInput: (y) => g(y)
|
|
179
246
|
}), _isSlot(h = c.map((y) => createVNode(resolveComponent("el-option"), {
|
|
180
247
|
key: y[d],
|
|
181
|
-
label: y[
|
|
248
|
+
label: y[v],
|
|
182
249
|
value: y[d]
|
|
183
250
|
}, null))) ? h : {
|
|
184
251
|
default: () => [h]
|
|
@@ -208,37 +275,37 @@ const VxetableRender = (VXETable, {
|
|
|
208
275
|
options: i,
|
|
209
276
|
props: Z,
|
|
210
277
|
optionProps: t = {},
|
|
211
|
-
events:
|
|
278
|
+
events: v
|
|
212
279
|
} = a, {
|
|
213
280
|
label: d = "label",
|
|
214
281
|
value: f = "value",
|
|
215
282
|
extLabel: m
|
|
216
283
|
} = t, {
|
|
217
|
-
mapField:
|
|
284
|
+
mapField: H,
|
|
218
285
|
multiple: b,
|
|
219
286
|
loading: M = !1
|
|
220
287
|
} = Z, n = useComponent(), s = b ? `_${c}` : c;
|
|
221
288
|
n.setDefaultValue(Z, o, c);
|
|
222
|
-
async function C(
|
|
223
|
-
n.remote(
|
|
289
|
+
async function C(e) {
|
|
290
|
+
n.remote(e, c, a);
|
|
224
291
|
}
|
|
225
|
-
function g(
|
|
226
|
-
n.selectChange(
|
|
292
|
+
function g(e) {
|
|
293
|
+
n.selectChange(e, o, c, a, {
|
|
227
294
|
datasource: "data"
|
|
228
295
|
});
|
|
229
296
|
}
|
|
230
|
-
function k(
|
|
231
|
-
|
|
297
|
+
function k(e) {
|
|
298
|
+
v != null && v.input && v.input(l, e);
|
|
232
299
|
}
|
|
233
300
|
function L() {
|
|
234
|
-
n.clear(o, c,
|
|
301
|
+
n.clear(o, c, H, v, "data");
|
|
235
302
|
}
|
|
236
303
|
function y() {
|
|
237
|
-
!i.length && C(""),
|
|
304
|
+
!i.length && C(""), v != null && v.focus && v.focus(l);
|
|
238
305
|
}
|
|
239
306
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
240
307
|
modelValue: o[s],
|
|
241
|
-
"onUpdate:modelValue": (
|
|
308
|
+
"onUpdate:modelValue": (e) => o[s] = e,
|
|
242
309
|
filterable: !0,
|
|
243
310
|
remote: !0,
|
|
244
311
|
clearable: !0,
|
|
@@ -248,13 +315,13 @@ const VxetableRender = (VXETable, {
|
|
|
248
315
|
"remote-method": C
|
|
249
316
|
}, Z, {
|
|
250
317
|
onFocus: () => y(),
|
|
251
|
-
onChange: (
|
|
318
|
+
onChange: (e) => g(e),
|
|
252
319
|
onClear: () => L(),
|
|
253
320
|
onInput: () => k()
|
|
254
|
-
}), _isSlot(h = i.map((
|
|
255
|
-
key:
|
|
256
|
-
label:
|
|
257
|
-
value:
|
|
321
|
+
}), _isSlot(h = i.map((e) => createVNode(resolveComponent("el-option"), {
|
|
322
|
+
key: e[f],
|
|
323
|
+
label: e[d],
|
|
324
|
+
value: e[f]
|
|
258
325
|
}, null))) ? h : {
|
|
259
326
|
default: () => [h]
|
|
260
327
|
})];
|
|
@@ -289,7 +356,7 @@ const VxetableRender = (VXETable, {
|
|
|
289
356
|
}, {
|
|
290
357
|
text: i18n("message.udp.anniversary", !0),
|
|
291
358
|
value: () => [Z(1, "year"), c]
|
|
292
|
-
}], Z = (t,
|
|
359
|
+
}], Z = (t, v) => dayjs().subtract(t, v).add("1", "day").format();
|
|
293
360
|
return [createVNode(resolveComponent("el-date-picker"), mergeProps({
|
|
294
361
|
modelValue: h[o],
|
|
295
362
|
"onUpdate:modelValue": (t) => h[o] = t,
|
|
@@ -313,26 +380,26 @@ const VxetableRender = (VXETable, {
|
|
|
313
380
|
optionProps: Z = {},
|
|
314
381
|
events: t
|
|
315
382
|
} = a, {
|
|
316
|
-
label:
|
|
383
|
+
label: v = "label",
|
|
317
384
|
value: d = "value",
|
|
318
385
|
extLabel: f
|
|
319
386
|
} = Z, {
|
|
320
387
|
mapField: m
|
|
321
|
-
} = i,
|
|
388
|
+
} = i, H = useComponent();
|
|
322
389
|
i.multiple && o[r.field] && !isArray(o[r.field]) && o[r.field].split(",").forEach((n) => {
|
|
323
|
-
!c.some((C) => C[
|
|
390
|
+
!c.some((C) => C[v] === n) && c.push({
|
|
324
391
|
[d]: n,
|
|
325
|
-
[
|
|
392
|
+
[v]: n
|
|
326
393
|
});
|
|
327
394
|
});
|
|
328
395
|
function b(n) {
|
|
329
|
-
|
|
396
|
+
H.selectChange(n, o, r.field, a, {
|
|
330
397
|
column: r,
|
|
331
398
|
datasource: "row"
|
|
332
399
|
});
|
|
333
400
|
}
|
|
334
401
|
function M() {
|
|
335
|
-
|
|
402
|
+
H.clear(o, r.field, m, t, "row");
|
|
336
403
|
}
|
|
337
404
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
338
405
|
modelValue: o[r.field],
|
|
@@ -345,7 +412,7 @@ const VxetableRender = (VXETable, {
|
|
|
345
412
|
onClear: () => M()
|
|
346
413
|
}), _isSlot(h = c.map((n) => createVNode(resolveComponent("el-option"), {
|
|
347
414
|
key: n[d],
|
|
348
|
-
label: f && n[f] ? n[d] : n[
|
|
415
|
+
label: f && n[f] ? n[d] : n[v],
|
|
349
416
|
value: n[d]
|
|
350
417
|
}, null))) ? h : {
|
|
351
418
|
default: () => [h]
|
|
@@ -381,22 +448,22 @@ const VxetableRender = (VXETable, {
|
|
|
381
448
|
options: i,
|
|
382
449
|
props: Z,
|
|
383
450
|
optionProps: t = {},
|
|
384
|
-
events:
|
|
451
|
+
events: v
|
|
385
452
|
} = a, {
|
|
386
453
|
label: d = "label",
|
|
387
454
|
value: f = "value"
|
|
388
455
|
} = t, m = useComponent(), {
|
|
389
|
-
defaultValues:
|
|
456
|
+
defaultValues: H,
|
|
390
457
|
mapField: b
|
|
391
458
|
} = Z;
|
|
392
|
-
|
|
459
|
+
H && (o[c] = H);
|
|
393
460
|
function M(s) {
|
|
394
461
|
m.selectChange(s, o, c, a, {
|
|
395
462
|
datasource: "data"
|
|
396
463
|
});
|
|
397
464
|
}
|
|
398
465
|
function n() {
|
|
399
|
-
m.clear(o, c, b,
|
|
466
|
+
m.clear(o, c, b, v, "data");
|
|
400
467
|
}
|
|
401
468
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
402
469
|
modelValue: o[c],
|
|
@@ -428,9 +495,9 @@ const VxetableRender = (VXETable, {
|
|
|
428
495
|
mapField: t
|
|
429
496
|
} = r;
|
|
430
497
|
Z && (h[o] = Z);
|
|
431
|
-
function
|
|
498
|
+
function v(f, m) {
|
|
432
499
|
const {
|
|
433
|
-
mapField:
|
|
500
|
+
mapField: H,
|
|
434
501
|
field: b,
|
|
435
502
|
displayName: M,
|
|
436
503
|
multiple: n
|
|
@@ -439,8 +506,8 @@ const VxetableRender = (VXETable, {
|
|
|
439
506
|
if (n) {
|
|
440
507
|
const C = {};
|
|
441
508
|
h[M || b] = f.reduce((g, k) => {
|
|
442
|
-
for (const L in
|
|
443
|
-
C[L] = g ? C[L] + "," + k[
|
|
509
|
+
for (const L in H)
|
|
510
|
+
C[L] = g ? C[L] + "," + k[H[L]] : k[H[L]];
|
|
444
511
|
return g = g ? g + "," + k[M || b] : k[M || b], g;
|
|
445
512
|
}, ""), Object.assign(h, C);
|
|
446
513
|
}
|
|
@@ -448,8 +515,8 @@ const VxetableRender = (VXETable, {
|
|
|
448
515
|
const C = {
|
|
449
516
|
[M || b]: f[m || M || b]
|
|
450
517
|
};
|
|
451
|
-
for (const g in
|
|
452
|
-
C[g] = f[
|
|
518
|
+
for (const g in H)
|
|
519
|
+
C[g] = f[H[g]];
|
|
453
520
|
Object.assign(h, C);
|
|
454
521
|
}
|
|
455
522
|
const s = {
|
|
@@ -467,7 +534,7 @@ const VxetableRender = (VXETable, {
|
|
|
467
534
|
record: h
|
|
468
535
|
}, r, {
|
|
469
536
|
mode: "vxe",
|
|
470
|
-
onChange: (f, m) =>
|
|
537
|
+
onChange: (f, m) => v(f, m),
|
|
471
538
|
onClear: () => d()
|
|
472
539
|
}), null)];
|
|
473
540
|
},
|
|
@@ -480,22 +547,22 @@ const VxetableRender = (VXETable, {
|
|
|
480
547
|
props: r,
|
|
481
548
|
events: c
|
|
482
549
|
} = a, i = useComponent();
|
|
483
|
-
function Z(
|
|
550
|
+
function Z(v, d) {
|
|
484
551
|
const {
|
|
485
552
|
mapField: f,
|
|
486
553
|
field: m,
|
|
487
|
-
displayName:
|
|
554
|
+
displayName: H,
|
|
488
555
|
multiple: b
|
|
489
556
|
} = r;
|
|
490
557
|
if (!b) {
|
|
491
558
|
const M = {
|
|
492
|
-
[
|
|
559
|
+
[H || m]: v[d || H || m]
|
|
493
560
|
};
|
|
494
561
|
for (const n in f)
|
|
495
|
-
M[n] =
|
|
562
|
+
M[n] = v[f[n]];
|
|
496
563
|
Object.assign(h, M);
|
|
497
564
|
}
|
|
498
|
-
c != null && c.change && c.change(l,
|
|
565
|
+
c != null && c.change && c.change(l, v, h[o.field]);
|
|
499
566
|
}
|
|
500
567
|
function t() {
|
|
501
568
|
i.clear(h, field, mapField, c, "row");
|
|
@@ -504,7 +571,7 @@ const VxetableRender = (VXETable, {
|
|
|
504
571
|
record: h
|
|
505
572
|
}, r, {
|
|
506
573
|
mode: "ele",
|
|
507
|
-
onChange: (
|
|
574
|
+
onChange: (v, d) => Z(v, d),
|
|
508
575
|
onClear: () => t()
|
|
509
576
|
}), null)];
|
|
510
577
|
},
|
|
@@ -517,22 +584,22 @@ const VxetableRender = (VXETable, {
|
|
|
517
584
|
props: r,
|
|
518
585
|
events: c
|
|
519
586
|
} = a, i = useComponent();
|
|
520
|
-
function Z(
|
|
587
|
+
function Z(v, d) {
|
|
521
588
|
const {
|
|
522
589
|
mapField: f,
|
|
523
590
|
field: m,
|
|
524
|
-
displayName:
|
|
591
|
+
displayName: H,
|
|
525
592
|
multiple: b
|
|
526
593
|
} = r;
|
|
527
594
|
if (!b) {
|
|
528
595
|
const M = {
|
|
529
|
-
[
|
|
596
|
+
[H || m]: v[d || H || m]
|
|
530
597
|
};
|
|
531
598
|
for (const n in f)
|
|
532
|
-
M[n] =
|
|
599
|
+
M[n] = v[f[n]];
|
|
533
600
|
Object.assign(h, M);
|
|
534
601
|
}
|
|
535
|
-
c != null && c.change && c.change(l,
|
|
602
|
+
c != null && c.change && c.change(l, v, h[o.field]);
|
|
536
603
|
}
|
|
537
604
|
function t() {
|
|
538
605
|
i.clear(h, field, mapField, c, "row");
|
|
@@ -541,7 +608,7 @@ const VxetableRender = (VXETable, {
|
|
|
541
608
|
record: h
|
|
542
609
|
}, r, {
|
|
543
610
|
mode: "ele",
|
|
544
|
-
onChange: (
|
|
611
|
+
onChange: (v, d) => Z(v, d),
|
|
545
612
|
onClear: () => t()
|
|
546
613
|
}), null)];
|
|
547
614
|
},
|
|
@@ -608,24 +675,24 @@ const VxetableRender = (VXETable, {
|
|
|
608
675
|
},
|
|
609
676
|
events: Z
|
|
610
677
|
} = a;
|
|
611
|
-
function t(
|
|
678
|
+
function t(v) {
|
|
612
679
|
const d = {
|
|
613
680
|
row: h,
|
|
614
681
|
column: o,
|
|
615
|
-
value:
|
|
682
|
+
value: v
|
|
616
683
|
};
|
|
617
684
|
Z != null && Z.change && Z.change(d);
|
|
618
685
|
}
|
|
619
686
|
return [h[o.field] ? createVNode(resolveComponent("el-switch"), mergeProps({
|
|
620
687
|
modelValue: h[o.field],
|
|
621
|
-
"onUpdate:modelValue": (
|
|
688
|
+
"onUpdate:modelValue": (v) => h[o.field] = v,
|
|
622
689
|
"inline-prompt": !0,
|
|
623
690
|
size: "large",
|
|
624
691
|
style: "--el-switch-on-color: #13ce66; --el-switch-off-color: #E6A23C"
|
|
625
692
|
}, a.props, {
|
|
626
693
|
"active-text": getValue(r, c),
|
|
627
694
|
"inactive-text": getValue(r, i),
|
|
628
|
-
onChange: (
|
|
695
|
+
onChange: (v) => t(v)
|
|
629
696
|
}), null) : null];
|
|
630
697
|
}
|
|
631
698
|
}), VXETable.renderer.add("#iconSelect", {
|
|
@@ -678,8 +745,8 @@ const VxetableRender = (VXETable, {
|
|
|
678
745
|
"check-strictly": !0
|
|
679
746
|
}, r, {
|
|
680
747
|
filterable: !0,
|
|
681
|
-
onCheckChange: (Z, t,
|
|
682
|
-
onNodeClick: (Z, t,
|
|
748
|
+
onCheckChange: (Z, t, v) => onCheckChange(Z, t, v, i),
|
|
749
|
+
onNodeClick: (Z, t, v) => onNodeClick(Z, t, v, i),
|
|
683
750
|
onCurrentChange: (Z, t) => onCurrentChange(Z, t, i)
|
|
684
751
|
}), null)];
|
|
685
752
|
},
|
|
@@ -693,7 +760,7 @@ const VxetableRender = (VXETable, {
|
|
|
693
760
|
} = a, {
|
|
694
761
|
children: i = "children",
|
|
695
762
|
label: Z = "label"
|
|
696
|
-
} = c, t = findTree(r, (
|
|
763
|
+
} = c, t = findTree(r, (v) => v.value === h[o.field], {
|
|
697
764
|
children: i
|
|
698
765
|
});
|
|
699
766
|
return t ? [createVNode("span", null, [t.item[Z]])] : null;
|
|
@@ -714,8 +781,8 @@ const VxetableRender = (VXETable, {
|
|
|
714
781
|
"check-strictly": !0
|
|
715
782
|
}, r, {
|
|
716
783
|
filterable: !0,
|
|
717
|
-
onCheckChange: (Z, t,
|
|
718
|
-
onNodeClick: (Z, t,
|
|
784
|
+
onCheckChange: (Z, t, v) => onCheckChange(Z, t, v, i),
|
|
785
|
+
onNodeClick: (Z, t, v) => onNodeClick(Z, t, v, i),
|
|
719
786
|
onCurrentChange: (Z, t) => onCurrentChange(Z, t, i)
|
|
720
787
|
}), null)];
|
|
721
788
|
}
|
|
@@ -723,8 +790,8 @@ const VxetableRender = (VXETable, {
|
|
|
723
790
|
const useComponent = () => ({
|
|
724
791
|
clear: (r, c, i, Z, t) => {
|
|
725
792
|
if (r[c] = null, !isEmpty(i))
|
|
726
|
-
for (const
|
|
727
|
-
r[
|
|
793
|
+
for (const v in i)
|
|
794
|
+
r[v] = null;
|
|
728
795
|
Z != null && Z.clear && Z.clear({
|
|
729
796
|
[t]: r,
|
|
730
797
|
field: c
|
|
@@ -734,12 +801,12 @@ const VxetableRender = (VXETable, {
|
|
|
734
801
|
const {
|
|
735
802
|
options: Z,
|
|
736
803
|
props: t,
|
|
737
|
-
events:
|
|
804
|
+
events: v
|
|
738
805
|
} = i, {
|
|
739
806
|
fetchField: d,
|
|
740
807
|
url: f,
|
|
741
808
|
defaultParams: m = {},
|
|
742
|
-
method:
|
|
809
|
+
method: H = "get"
|
|
743
810
|
} = t, b = getCookieParam(), M = Object.assign({
|
|
744
811
|
pageSize: 20,
|
|
745
812
|
pageNum: 1,
|
|
@@ -751,36 +818,36 @@ const VxetableRender = (VXETable, {
|
|
|
751
818
|
if (t.loading) return;
|
|
752
819
|
let n;
|
|
753
820
|
try {
|
|
754
|
-
Z.length = 0, t.loading = !0, n = await serviceApi[
|
|
821
|
+
Z.length = 0, t.loading = !0, n = await serviceApi[H](f, M), v != null && v.filterMethod ? Z.push(...v.filterMethod(n.list || n)) : n && (n.list ? Z.push(...n.list) : Z.push(...n));
|
|
755
822
|
} finally {
|
|
756
823
|
t.loading = !1;
|
|
757
824
|
}
|
|
758
825
|
},
|
|
759
826
|
selectChange: (r, c, i, Z, t) => {
|
|
760
|
-
let
|
|
827
|
+
let v = null;
|
|
761
828
|
const {
|
|
762
829
|
datasource: d
|
|
763
830
|
} = t, {
|
|
764
831
|
options: f,
|
|
765
832
|
props: m,
|
|
766
|
-
optionProps:
|
|
833
|
+
optionProps: H = {},
|
|
767
834
|
events: b
|
|
768
835
|
} = Z, M = {
|
|
769
836
|
[d]: c,
|
|
770
837
|
field: i
|
|
771
838
|
};
|
|
772
|
-
c[i] = null, !isEmpty(r) && (m != null && m.multiple) ? (c[i] = r.join(","),
|
|
773
|
-
const s = f.find((C) => n === C[
|
|
839
|
+
c[i] = null, !isEmpty(r) && (m != null && m.multiple) ? (c[i] = r.join(","), v = [], r.forEach((n) => {
|
|
840
|
+
const s = f.find((C) => n === C[H == null ? void 0 : H.value]);
|
|
774
841
|
s && !isEmpty(m.mapField) && isObject(m.mapField) && Object.keys(m.mapField).forEach((C) => {
|
|
775
842
|
const g = s[m.mapField[C]], k = c[C] ? c[C].toString() : "";
|
|
776
843
|
c[C] = k && !k.includes(g) ? `${k},${g}` : g;
|
|
777
|
-
}), s &&
|
|
844
|
+
}), s && v.push(s);
|
|
778
845
|
}), Object.assign(M, {
|
|
779
|
-
options:
|
|
780
|
-
})) : (c[i] = m != null && m.multiple ? null : r,
|
|
781
|
-
c[n] =
|
|
846
|
+
options: v
|
|
847
|
+
})) : (c[i] = m != null && m.multiple ? null : r, v = f.find((n) => r === n[H == null ? void 0 : H.value]), !isEmpty(m.mapField) && isObject(m.mapField) && Object.keys(m.mapField).forEach((n) => {
|
|
848
|
+
c[n] = v ? v[m.mapField[n]] : null;
|
|
782
849
|
}), Object.assign(M, {
|
|
783
|
-
option:
|
|
850
|
+
option: v
|
|
784
851
|
})), d === "row" && Object.assign(M, {
|
|
785
852
|
column: t.column
|
|
786
853
|
}), b != null && b.change && b.change(M);
|
|
@@ -790,10 +857,10 @@ const VxetableRender = (VXETable, {
|
|
|
790
857
|
const {
|
|
791
858
|
multiple: Z,
|
|
792
859
|
defaultValue: t
|
|
793
|
-
} = r,
|
|
860
|
+
} = r, v = Z ? `_${i}` : i;
|
|
794
861
|
!c[i] && t && (c[i] = t, isPlainObject(t) && Object.keys(t).forEach((m) => {
|
|
795
862
|
c[m] = c[m] || t[m];
|
|
796
|
-
})), !c[
|
|
863
|
+
})), !c[v] && c[i] && (c[v] = Z ? (d = c[i]) == null ? void 0 : d.split(",") : c[i]);
|
|
797
864
|
}
|
|
798
865
|
}), onCheckChange = (a, l, h, o) => {
|
|
799
866
|
console.log(a, l, h), o != null && o.checkChange && (o == null || o.checkChange(a, l, h));
|
|
@@ -858,41 +925,41 @@ const openLink = (a) => {
|
|
|
858
925
|
}, domSymbol = Symbol("watermark-dom");
|
|
859
926
|
function useWatermark(a = ref(document.body)) {
|
|
860
927
|
const l = useRafThrottle(function() {
|
|
861
|
-
const
|
|
862
|
-
if (!
|
|
863
|
-
const { clientHeight: d, clientWidth: f } =
|
|
928
|
+
const v = unref(a);
|
|
929
|
+
if (!v) return;
|
|
930
|
+
const { clientHeight: d, clientWidth: f } = v;
|
|
864
931
|
i({ height: d, width: f });
|
|
865
932
|
}), h = domSymbol.toString(), o = shallowRef(), r = () => {
|
|
866
|
-
const
|
|
933
|
+
const v = unref(o);
|
|
867
934
|
o.value = void 0;
|
|
868
935
|
const d = unref(a);
|
|
869
|
-
d && (
|
|
936
|
+
d && (v && d.removeChild(v), removeResizeListener(d, l));
|
|
870
937
|
};
|
|
871
|
-
function c(
|
|
872
|
-
const f = document.createElement("canvas"), m = 260,
|
|
873
|
-
Object.assign(f, { width: m, height:
|
|
938
|
+
function c(v, d) {
|
|
939
|
+
const f = document.createElement("canvas"), m = 260, H = 180;
|
|
940
|
+
Object.assign(f, { width: m, height: H });
|
|
874
941
|
const b = f.getContext("2d");
|
|
875
|
-
return b && (b.rotate(-20 * Math.PI / 120), b.font = (d == null ? void 0 : d.font) ?? "15px Reggae One", b.fillStyle = (d == null ? void 0 : d.fillStyle) ?? "rgba(180, 180, 180, 0.75)", b.textAlign = "left", b.textBaseline = "middle", b.fillText(
|
|
942
|
+
return b && (b.rotate(-20 * Math.PI / 120), b.font = (d == null ? void 0 : d.font) ?? "15px Reggae One", b.fillStyle = (d == null ? void 0 : d.fillStyle) ?? "rgba(180, 180, 180, 0.75)", b.textAlign = "left", b.textBaseline = "middle", b.fillText(v, m / 20, H)), f.toDataURL("image/png");
|
|
876
943
|
}
|
|
877
|
-
function i(
|
|
944
|
+
function i(v = {}) {
|
|
878
945
|
const d = unref(o);
|
|
879
|
-
d && (isUndefined(
|
|
880
|
-
|
|
881
|
-
|
|
946
|
+
d && (isUndefined(v.width) || (d.style.width = `${v.width}px`), isUndefined(v.height) || (d.style.height = `${v.height}px`), isUndefined(v.str) || (d.style.background = `url(${c(
|
|
947
|
+
v.str,
|
|
948
|
+
v.attr
|
|
882
949
|
)}) left top repeat`));
|
|
883
950
|
}
|
|
884
|
-
const Z = (
|
|
951
|
+
const Z = (v, d) => {
|
|
885
952
|
if (unref(o))
|
|
886
|
-
return i({ str:
|
|
953
|
+
return i({ str: v, attr: d }), h;
|
|
887
954
|
const f = document.createElement("div");
|
|
888
955
|
o.value = f, f.id = h, f.style.pointerEvents = "none", f.style.top = "0px", f.style.left = "0px", f.style.position = "absolute", f.style.zIndex = "100000";
|
|
889
956
|
const m = unref(a);
|
|
890
957
|
if (!m) return h;
|
|
891
|
-
const { clientHeight:
|
|
892
|
-
return i({ str:
|
|
958
|
+
const { clientHeight: H, clientWidth: b } = m;
|
|
959
|
+
return i({ str: v, width: b, height: H, attr: d }), m.appendChild(f), h;
|
|
893
960
|
};
|
|
894
|
-
function t(
|
|
895
|
-
Z(
|
|
961
|
+
function t(v, d) {
|
|
962
|
+
Z(v, d), addResizeListener(document.documentElement, l), getCurrentInstance() && onBeforeUnmount(() => {
|
|
896
963
|
r();
|
|
897
964
|
});
|
|
898
965
|
}
|
|
@@ -907,182 +974,182 @@ function useAttrs(a = {}) {
|
|
|
907
974
|
if (!l) return {};
|
|
908
975
|
const { excludeListeners: h = !1, excludeKeys: o = [] } = a, r = shallowRef({}), c = o.concat(DEFAULT_EXCLUDE_KEYS);
|
|
909
976
|
return l.attrs = reactive(l.attrs), watchEffect(() => {
|
|
910
|
-
const i = entries(l.attrs).reduce((Z, [t,
|
|
977
|
+
const i = entries(l.attrs).reduce((Z, [t, v]) => (!c.includes(t) && !(h && LISTENER_PREFIX.test(t)) && (Z[t] = v), Z), {});
|
|
911
978
|
r.value = i;
|
|
912
979
|
}), r;
|
|
913
980
|
}
|
|
914
981
|
const useRender = () => {
|
|
915
|
-
const a = { value: "dictCode", label: "dictName" }, l = (
|
|
916
|
-
var
|
|
917
|
-
const
|
|
982
|
+
const a = { value: "dictCode", label: "dictName" }, l = (e, u) => {
|
|
983
|
+
var E;
|
|
984
|
+
const V = L(u);
|
|
918
985
|
let p = {
|
|
919
986
|
clearable: !0,
|
|
920
987
|
disabled: !1,
|
|
921
988
|
showValue: !1,
|
|
922
989
|
placeholder: null
|
|
923
990
|
}, A, x;
|
|
924
|
-
isObject(
|
|
925
|
-
const I = (
|
|
991
|
+
isObject(e) ? (p = Object.assign(p, e), A = e.defaultValue, x = e == null ? void 0 : e.code) : x = e;
|
|
992
|
+
const I = (E = storageLocal.getItem("kLov")[x]) == null ? void 0 : E.children, D = I ? I.filter((N) => N.enabled === "1") : [];
|
|
926
993
|
return {
|
|
927
994
|
name: "#select",
|
|
928
995
|
optionProps: a,
|
|
929
996
|
options: D,
|
|
930
997
|
props: p,
|
|
931
998
|
defaultValue: A,
|
|
932
|
-
events:
|
|
999
|
+
events: V
|
|
933
1000
|
};
|
|
934
|
-
}, h = (
|
|
935
|
-
const
|
|
1001
|
+
}, h = (e, u) => {
|
|
1002
|
+
const V = L(u);
|
|
936
1003
|
return {
|
|
937
1004
|
name: "#SuSelect",
|
|
938
|
-
optionProps: (
|
|
939
|
-
props:
|
|
940
|
-
options: (
|
|
941
|
-
events:
|
|
1005
|
+
optionProps: (e == null ? void 0 : e.optionProps) || { label: "label", value: "value" },
|
|
1006
|
+
props: e == null ? void 0 : e.props,
|
|
1007
|
+
options: (e == null ? void 0 : e.options) || [],
|
|
1008
|
+
events: V
|
|
942
1009
|
};
|
|
943
|
-
}, o = (
|
|
944
|
-
const
|
|
1010
|
+
}, o = (e, u) => {
|
|
1011
|
+
const V = {
|
|
945
1012
|
optionProps: { extLabel: "userName", value: "employeeName" },
|
|
946
1013
|
props: {
|
|
947
|
-
attrs: { disabled:
|
|
948
|
-
disabled:
|
|
949
|
-
defaultValue:
|
|
950
|
-
mapField:
|
|
1014
|
+
attrs: { disabled: e == null ? void 0 : e.disabled },
|
|
1015
|
+
disabled: e == null ? void 0 : e.disabled,
|
|
1016
|
+
defaultValue: e == null ? void 0 : e.defaultValue,
|
|
1017
|
+
mapField: e == null ? void 0 : e.mapField,
|
|
951
1018
|
code: "SYS037",
|
|
952
1019
|
url: "/uums/employee/listEmployeeIsUser",
|
|
953
1020
|
fetchField: "employeeName"
|
|
954
1021
|
}
|
|
955
1022
|
};
|
|
956
|
-
return h(
|
|
957
|
-
}, r = (
|
|
1023
|
+
return h(V, u);
|
|
1024
|
+
}, r = (e) => {
|
|
958
1025
|
const u = {
|
|
959
1026
|
optionProps: { extLabel: "userName", value: "name" },
|
|
960
1027
|
props: {
|
|
961
1028
|
code: "sys/listUsers",
|
|
962
1029
|
url: "/uums/user",
|
|
963
1030
|
fetchField: "name",
|
|
964
|
-
mapField:
|
|
1031
|
+
mapField: e == null ? void 0 : e.mapField
|
|
965
1032
|
}
|
|
966
1033
|
};
|
|
967
1034
|
return h(u);
|
|
968
|
-
}, c = (
|
|
969
|
-
const
|
|
1035
|
+
}, c = (e, u) => {
|
|
1036
|
+
const V = {
|
|
970
1037
|
label: "organizationName",
|
|
971
|
-
value: (
|
|
1038
|
+
value: (e == null ? void 0 : e.field) || "organizationName"
|
|
972
1039
|
}, p = {
|
|
973
1040
|
mapField: {},
|
|
974
|
-
defaultParams:
|
|
1041
|
+
defaultParams: e == null ? void 0 : e.defaultParams,
|
|
975
1042
|
url: "/uums/cusOrganization",
|
|
976
1043
|
fetchField: "organizationName"
|
|
977
1044
|
}, A = {
|
|
978
1045
|
organizationId: "id",
|
|
979
1046
|
organizationCode: "organizationCode"
|
|
980
1047
|
};
|
|
981
|
-
return Object.assign(p.mapField, A, (
|
|
982
|
-
}, i = (
|
|
983
|
-
const
|
|
1048
|
+
return Object.assign(p.mapField, A, (e == null ? void 0 : e.mapField) || {}), { name: "#SuSelect", props: p, optionProps: V, options: [], methods: u };
|
|
1049
|
+
}, i = (e, u) => {
|
|
1050
|
+
const V = {
|
|
984
1051
|
label: "orgName",
|
|
985
|
-
value: (
|
|
1052
|
+
value: (e == null ? void 0 : e.field) || "orgName"
|
|
986
1053
|
}, p = {
|
|
987
1054
|
mapField: {},
|
|
988
|
-
defaultParams:
|
|
1055
|
+
defaultParams: e == null ? void 0 : e.defaultParams,
|
|
989
1056
|
url: "/uums/org",
|
|
990
1057
|
fetchField: "orgName"
|
|
991
1058
|
}, A = { orgId: "id", orgCode: "orgCode" };
|
|
992
|
-
return Object.assign(p.mapField, A, (
|
|
993
|
-
}, Z = (
|
|
994
|
-
const
|
|
1059
|
+
return Object.assign(p.mapField, A, (e == null ? void 0 : e.mapField) || {}), { name: "#SuSelect", props: p, optionProps: V, options: [], methods: u };
|
|
1060
|
+
}, Z = (e, u) => {
|
|
1061
|
+
const V = Object.assign({ disabled: !1 }, e), p = V == null ? void 0 : V.defaultValue;
|
|
995
1062
|
return {
|
|
996
1063
|
name: "VxeInput",
|
|
997
|
-
props:
|
|
1064
|
+
props: V,
|
|
998
1065
|
defaultValue: p,
|
|
999
1066
|
events: L(u)
|
|
1000
1067
|
};
|
|
1001
|
-
}, t = (
|
|
1002
|
-
const
|
|
1068
|
+
}, t = (e, u) => {
|
|
1069
|
+
const V = Object.assign({ disabled: !1, rows: 3 }, e), p = V == null ? void 0 : V.defaultValue;
|
|
1003
1070
|
return {
|
|
1004
1071
|
name: "VxeTextarea",
|
|
1005
|
-
props:
|
|
1072
|
+
props: V,
|
|
1006
1073
|
defaultValue: p,
|
|
1007
1074
|
events: L(u)
|
|
1008
1075
|
};
|
|
1009
|
-
},
|
|
1010
|
-
const
|
|
1011
|
-
return { name:
|
|
1012
|
-
}, d = (
|
|
1013
|
-
const
|
|
1014
|
-
return { name:
|
|
1015
|
-
}, f = (
|
|
1076
|
+
}, v = (e, u) => {
|
|
1077
|
+
const V = "VxeCheckbox", { defaultValue: p, options: A, props: x } = f(e);
|
|
1078
|
+
return { name: V, defaultValue: p, options: A, props: x, events: L(u) };
|
|
1079
|
+
}, d = (e, u) => {
|
|
1080
|
+
const V = "VxeRadio", { defaultValue: p, options: A, props: x } = f(e);
|
|
1081
|
+
return { name: V, defaultValue: p, options: A, props: x, events: L(u) };
|
|
1082
|
+
}, f = (e) => {
|
|
1016
1083
|
var I;
|
|
1017
|
-
let u = { disabled: !1 },
|
|
1084
|
+
let u = { disabled: !1 }, V;
|
|
1018
1085
|
const p = storageLocal.getItem("kLov");
|
|
1019
1086
|
let A = "";
|
|
1020
|
-
isObject(
|
|
1087
|
+
isObject(e) ? (V = e.defaultValue, A = e.code, u = Object.assign(u, e || {})) : isString(e) && (A = e);
|
|
1021
1088
|
const x = A ? (I = p[A]) == null ? void 0 : I.children.map((D) => ({ label: D.dictName, value: D.dictCode })) : [];
|
|
1022
|
-
return { props: u, defaultValue:
|
|
1023
|
-
}, m = (
|
|
1024
|
-
const
|
|
1089
|
+
return { props: u, defaultValue: V, options: x };
|
|
1090
|
+
}, m = (e, u) => {
|
|
1091
|
+
const V = L(u);
|
|
1025
1092
|
return {
|
|
1026
1093
|
name: "VxeInput",
|
|
1027
1094
|
props: Object.assign(
|
|
1028
1095
|
{ type: "number", clearable: !0, min: 0, controls: !1 },
|
|
1029
|
-
|
|
1096
|
+
e || {}
|
|
1030
1097
|
),
|
|
1031
|
-
defaultValue:
|
|
1032
|
-
events:
|
|
1098
|
+
defaultValue: e == null ? void 0 : e.defaultValue,
|
|
1099
|
+
events: V
|
|
1033
1100
|
};
|
|
1034
|
-
},
|
|
1035
|
-
const
|
|
1036
|
-
return { name: "VxeInput", props: Object.assign({ type: "date", valueFormat: p, clearable: !0 },
|
|
1037
|
-
}, b = (
|
|
1038
|
-
const
|
|
1039
|
-
return { name: "#lov", props: Object.assign({},
|
|
1040
|
-
}, M = (
|
|
1041
|
-
const
|
|
1101
|
+
}, H = (e, u) => {
|
|
1102
|
+
const V = L(u), p = "yyyy-MM-dd HH:mm:ss", A = e == null ? void 0 : e.defaultValue;
|
|
1103
|
+
return { name: "VxeInput", props: Object.assign({ type: "date", valueFormat: p, clearable: !0 }, e || {}), defaultValue: A, events: V };
|
|
1104
|
+
}, b = (e, u) => {
|
|
1105
|
+
const V = L(u);
|
|
1106
|
+
return { name: "#lov", props: Object.assign({}, e || {}), events: V };
|
|
1107
|
+
}, M = (e, u) => {
|
|
1108
|
+
const V = L(u), p = (e == null ? void 0 : e.optionProps) || {
|
|
1042
1109
|
label: "label",
|
|
1043
1110
|
value: "value"
|
|
1044
1111
|
}, A = Object.assign(
|
|
1045
1112
|
{ clearable: !0, disabled: !1, showValue: !1 },
|
|
1046
|
-
|
|
1113
|
+
e || {}
|
|
1047
1114
|
);
|
|
1048
1115
|
return console.log("itemRender"), {
|
|
1049
1116
|
name: "#select",
|
|
1050
1117
|
optionProps: p,
|
|
1051
|
-
options: (
|
|
1118
|
+
options: (e == null ? void 0 : e.options) || [],
|
|
1052
1119
|
props: A,
|
|
1053
|
-
events:
|
|
1120
|
+
events: V
|
|
1054
1121
|
};
|
|
1055
|
-
}, n = (
|
|
1056
|
-
let
|
|
1122
|
+
}, n = (e, u) => {
|
|
1123
|
+
let V = {
|
|
1057
1124
|
openLabel: "是",
|
|
1058
1125
|
closeLabel: "否",
|
|
1059
1126
|
openValue: "Y",
|
|
1060
1127
|
closeValue: "N"
|
|
1061
1128
|
}, p = "Y";
|
|
1062
|
-
isObject(
|
|
1063
|
-
const A = isFunction(
|
|
1064
|
-
return { name: "VxeSwitch", props:
|
|
1065
|
-
}, s = (
|
|
1066
|
-
const
|
|
1129
|
+
isObject(e) && !isFunction(e) ? (V = Object.assign(V, e || {}), p = e.defaultValue || p) : !isEmpty(e) && isString(e) && (p = e, V = Object.assign(V, { defaultValue: p }));
|
|
1130
|
+
const A = isFunction(e) ? L(e) : L(u);
|
|
1131
|
+
return { name: "VxeSwitch", props: V, defaultValue: p, events: A };
|
|
1132
|
+
}, s = (e, u) => ({ name: "#tag", props: { code: e, tagMap: u } }), C = (e, u) => {
|
|
1133
|
+
const V = {
|
|
1067
1134
|
openLabel: "启用",
|
|
1068
1135
|
closeLabel: "禁用",
|
|
1069
1136
|
openValue: "1",
|
|
1070
1137
|
closeValue: "0",
|
|
1071
1138
|
defaultValue: "1"
|
|
1072
1139
|
};
|
|
1073
|
-
!isFunction(
|
|
1074
|
-
const p = isFunction(
|
|
1075
|
-
return n(
|
|
1076
|
-
}, g = () => ({ name: "#iconSelect" }), k = (
|
|
1140
|
+
!isFunction(e) && isObject(e) && Object.assign(V, e);
|
|
1141
|
+
const p = isFunction(e) ? e : u;
|
|
1142
|
+
return n(V, p);
|
|
1143
|
+
}, g = () => ({ name: "#iconSelect" }), k = (e = [], u = {}, V) => ({ name: "#treeSelect", sourceData: e, props: u, events: V }), L = (e) => {
|
|
1077
1144
|
let u = {};
|
|
1078
|
-
return isObject(
|
|
1079
|
-
change: (
|
|
1080
|
-
blur: (
|
|
1081
|
-
focus: (
|
|
1082
|
-
input: (
|
|
1083
|
-
clear: (
|
|
1084
|
-
filterMethod:
|
|
1085
|
-
} :
|
|
1145
|
+
return isObject(e) && !isFunction(e) ? u = {
|
|
1146
|
+
change: (e == null ? void 0 : e.change) || y,
|
|
1147
|
+
blur: (e == null ? void 0 : e.blur) || y,
|
|
1148
|
+
focus: (e == null ? void 0 : e.focus) || y,
|
|
1149
|
+
input: (e == null ? void 0 : e.input) || y,
|
|
1150
|
+
clear: (e == null ? void 0 : e.clear) || y,
|
|
1151
|
+
filterMethod: e == null ? void 0 : e.filterMethod
|
|
1152
|
+
} : e && (u = { change: e }), u;
|
|
1086
1153
|
};
|
|
1087
1154
|
function y() {
|
|
1088
1155
|
}
|
|
@@ -1091,7 +1158,7 @@ const useRender = () => {
|
|
|
1091
1158
|
renderSelect: h,
|
|
1092
1159
|
renderInput: Z,
|
|
1093
1160
|
renderTextarea: t,
|
|
1094
|
-
renderCheckBox:
|
|
1161
|
+
renderCheckBox: v,
|
|
1095
1162
|
renderRadio: d,
|
|
1096
1163
|
renderUser: o,
|
|
1097
1164
|
renderSysUser: r,
|
|
@@ -1100,7 +1167,7 @@ const useRender = () => {
|
|
|
1100
1167
|
renderNumber: m,
|
|
1101
1168
|
renderLov: b,
|
|
1102
1169
|
renderSelectLocal: M,
|
|
1103
|
-
renderDate:
|
|
1170
|
+
renderDate: H,
|
|
1104
1171
|
renderSwitch: n,
|
|
1105
1172
|
renderCellTag: s,
|
|
1106
1173
|
renderEnabled: C,
|
|
@@ -1206,20 +1273,20 @@ const deviceDetection = () => {
|
|
|
1206
1273
|
events: null
|
|
1207
1274
|
}
|
|
1208
1275
|
}, formatGridItems = (a, l) => {
|
|
1209
|
-
const h = a, o = h.length, r = o > 2 && h.some((
|
|
1276
|
+
const h = a, o = h.length, r = o > 2 && h.some((v, d) => d < 3 && (v.span > 6 || getDateRange(v))), c = r || o > 3, i = {
|
|
1210
1277
|
collapseTags: !0,
|
|
1211
1278
|
collapseTagsTooltip: !0,
|
|
1212
1279
|
multiple: !0
|
|
1213
|
-
}, Z = h.map((
|
|
1214
|
-
var f, m,
|
|
1215
|
-
return
|
|
1280
|
+
}, Z = h.map((v, d) => {
|
|
1281
|
+
var f, m, H;
|
|
1282
|
+
return v.folding = r ? c && d > 1 : c && d > 2, v.span = getDateRange(v) ? 12 : v.span || 6, v.code && !v.itemRender && (v.itemRender = renderHook.renderDict(v.code)), v.itemRender = v.itemRender || { name: "VxeInput" }, v.resetValue = v.itemRender.defaultValue, v.title = v.title || `message.${v.field}`, (v.multiple || (m = (f = v.itemRender) == null ? void 0 : f.props) != null && m.multiple) && (v.itemRender.props = Object.assign(
|
|
1216
1283
|
i,
|
|
1217
|
-
((
|
|
1218
|
-
)),
|
|
1284
|
+
((H = v.itemRender) == null ? void 0 : H.props) || {}
|
|
1285
|
+
)), v;
|
|
1219
1286
|
}), t = clone(formSearchButtons, !0);
|
|
1220
1287
|
if (t.collapseNode = c, l && t.itemRender.options.length < 3 && (t.itemRender.options.push(l), t.itemRender.events = l.events), c) {
|
|
1221
|
-
const
|
|
1222
|
-
Z.splice(
|
|
1288
|
+
const v = r ? 2 : 3;
|
|
1289
|
+
Z.splice(v, 0, t);
|
|
1223
1290
|
} else
|
|
1224
1291
|
Z.push(t);
|
|
1225
1292
|
return Z;
|
|
@@ -1359,7 +1426,7 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1359
1426
|
w.isRefreshing || (w.isRefreshing = !0, this.get(this.baseUrl + "/uath/refreshToken", {
|
|
1360
1427
|
refreshToken: c.refreshToken
|
|
1361
1428
|
}).then((t) => {
|
|
1362
|
-
this.setToken(t), l.headers.Authorization = "Bearer " + t.access_token, w.requests.forEach((
|
|
1429
|
+
this.setToken(t), l.headers.Authorization = "Bearer " + t.access_token, w.requests.forEach((v) => v(t.access_token)), w.requests = [];
|
|
1363
1430
|
}).finally(() => {
|
|
1364
1431
|
w.isRefreshing = !1;
|
|
1365
1432
|
})), o(w.retryOriginalRequest(l));
|
|
@@ -1418,13 +1485,13 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1418
1485
|
else if ((t == null ? void 0 : t.code) !== "-1")
|
|
1419
1486
|
i(t);
|
|
1420
1487
|
else {
|
|
1421
|
-
const
|
|
1422
|
-
errorMessage(
|
|
1488
|
+
const v = (t == null ? void 0 : t.msg) || "服务异常";
|
|
1489
|
+
errorMessage(v, { duration: 8e3 }), Z(v);
|
|
1423
1490
|
}
|
|
1424
1491
|
}).catch((t) => {
|
|
1425
|
-
var
|
|
1492
|
+
var v, d, f;
|
|
1426
1493
|
if (t != null && t.code) {
|
|
1427
|
-
if (((
|
|
1494
|
+
if (((v = t == null ? void 0 : t.response) == null ? void 0 : v.status) === 401)
|
|
1428
1495
|
return (d = this.router) == null ? void 0 : d.push({ path: "/login" });
|
|
1429
1496
|
errorMessage(
|
|
1430
1497
|
this.getNetworkError((f = t == null ? void 0 : t.response) == null ? void 0 : f.status) || (t == null ? void 0 : t.message),
|
|
@@ -2264,36 +2331,36 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2264
2331
|
return -1;
|
|
2265
2332
|
let i;
|
|
2266
2333
|
o ? i = new Date(o, parseInt(r.toString()) - 1, c) : i = /* @__PURE__ */ new Date();
|
|
2267
|
-
let Z, t = 0,
|
|
2334
|
+
let Z, t = 0, v = 0;
|
|
2268
2335
|
o = i.getFullYear(), r = i.getMonth() + 1, c = i.getDate();
|
|
2269
2336
|
let d = (Date.UTC(i.getFullYear(), i.getMonth(), i.getDate()) - Date.UTC(1900, 0, 31)) / 864e5;
|
|
2270
2337
|
for (Z = 1900; Z < 2101 && d > 0; Z++)
|
|
2271
|
-
|
|
2272
|
-
d < 0 && (d +=
|
|
2338
|
+
v = this.lYearDays(Z), d -= v;
|
|
2339
|
+
d < 0 && (d += v, Z--);
|
|
2273
2340
|
const f = /* @__PURE__ */ new Date();
|
|
2274
2341
|
let m = !1;
|
|
2275
2342
|
f.getFullYear() === o && f.getMonth() + 1 === r && f.getDate() === c && (m = !0);
|
|
2276
|
-
let
|
|
2277
|
-
const b = this.nStr1[
|
|
2278
|
-
|
|
2343
|
+
let H = i.getDay();
|
|
2344
|
+
const b = this.nStr1[H];
|
|
2345
|
+
H === 0 && (H = 7);
|
|
2279
2346
|
const M = Z;
|
|
2280
2347
|
t = this.leapMonth(Z);
|
|
2281
2348
|
let n = !1;
|
|
2282
2349
|
for (Z = 1; Z < 13 && d > 0; Z++)
|
|
2283
|
-
t > 0 && Z === t + 1 && n === !1 ? (--Z, n = !0,
|
|
2284
|
-
d === 0 && t > 0 && Z === t + 1 && (n ? n = !1 : (n = !0, --Z)), d < 0 && (d +=
|
|
2350
|
+
t > 0 && Z === t + 1 && n === !1 ? (--Z, n = !0, v = this.leapDays(M)) : v = this.monthDays(M, Z), n === !0 && Z === t + 1 && (n = !1), d -= v;
|
|
2351
|
+
d === 0 && t > 0 && Z === t + 1 && (n ? n = !1 : (n = !0, --Z)), d < 0 && (d += v, --Z);
|
|
2285
2352
|
const s = Z, C = d + 1, g = r - 1, k = this.toGanZhiYear(M), L = this.getTerm(o, r * 2 - 1), y = this.getTerm(o, r * 2);
|
|
2286
|
-
let
|
|
2287
|
-
c >= L && (
|
|
2288
|
-
let u = !1,
|
|
2289
|
-
L === c && (u = !0,
|
|
2290
|
-
const p = Date.UTC(o, g, 1, 0, 0, 0, 0) / 864e5 + 25567 + 10, A = this.toGanZhi(p + c - 1), x = this.toAstro(r, c), I = o + "-" + r + "-" + c, D = M + "-" + s + "-" + C,
|
|
2291
|
-
let
|
|
2292
|
-
return s === 12 && C === 29 && this.monthDays(M, s) === 29 && (
|
|
2353
|
+
let e = this.toGanZhi((o - 1900) * 12 + r + 11);
|
|
2354
|
+
c >= L && (e = this.toGanZhi((o - 1900) * 12 + r + 12));
|
|
2355
|
+
let u = !1, V;
|
|
2356
|
+
L === c && (u = !0, V = this.solarTerm[r * 2 - 2]), y === c && (u = !0, V = this.solarTerm[r * 2 - 1]);
|
|
2357
|
+
const p = Date.UTC(o, g, 1, 0, 0, 0, 0) / 864e5 + 25567 + 10, A = this.toGanZhi(p + c - 1), x = this.toAstro(r, c), I = o + "-" + r + "-" + c, D = M + "-" + s + "-" + C, E = this.festival, N = this.lFestival, R = r + "-" + c;
|
|
2358
|
+
let F = s + "-" + C;
|
|
2359
|
+
return s === 12 && C === 29 && this.monthDays(M, s) === 29 && (F = "12-30"), {
|
|
2293
2360
|
date: I,
|
|
2294
2361
|
lunarDate: D,
|
|
2295
|
-
festival:
|
|
2296
|
-
lunarFestival: N[
|
|
2362
|
+
festival: E[R] ? E[R].title : null,
|
|
2363
|
+
lunarFestival: N[F] ? N[F].title : null,
|
|
2297
2364
|
lYear: M,
|
|
2298
2365
|
lMonth: s,
|
|
2299
2366
|
lDay: C,
|
|
@@ -2304,14 +2371,14 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2304
2371
|
cMonth: r,
|
|
2305
2372
|
cDay: c,
|
|
2306
2373
|
gzYear: k,
|
|
2307
|
-
gzMonth:
|
|
2374
|
+
gzMonth: e,
|
|
2308
2375
|
gzDay: A,
|
|
2309
2376
|
isToday: m,
|
|
2310
2377
|
isLeap: n,
|
|
2311
|
-
nWeek:
|
|
2378
|
+
nWeek: H,
|
|
2312
2379
|
ncWeek: "星期" + b,
|
|
2313
2380
|
isTerm: u,
|
|
2314
|
-
Term:
|
|
2381
|
+
Term: V,
|
|
2315
2382
|
astro: x
|
|
2316
2383
|
};
|
|
2317
2384
|
},
|
|
@@ -2337,12 +2404,12 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2337
2404
|
let Z = 0, t;
|
|
2338
2405
|
for (t = 1900; t < a; t++)
|
|
2339
2406
|
Z += this.lYearDays(t);
|
|
2340
|
-
let
|
|
2407
|
+
let v = 0, d = !1;
|
|
2341
2408
|
for (t = 1; t < l; t++)
|
|
2342
|
-
|
|
2409
|
+
v = this.leapMonth(a), d || v <= t && v > 0 && (Z += this.leapDays(a), d = !0), Z += this.monthDays(a, t);
|
|
2343
2410
|
o && (Z += c);
|
|
2344
|
-
const f = Date.UTC(1900, 1, 30, 0, 0, 0), m = new Date((Z + h - 31) * 864e5 + f),
|
|
2345
|
-
return this.solar2lunar(
|
|
2411
|
+
const f = Date.UTC(1900, 1, 30, 0, 0, 0), m = new Date((Z + h - 31) * 864e5 + f), H = m.getUTCFullYear(), b = m.getUTCMonth() + 1, M = m.getUTCDate();
|
|
2412
|
+
return this.solar2lunar(H, b, M);
|
|
2346
2413
|
}
|
|
2347
2414
|
}, dict = storageLocal.getItem("kLov"), formats = {
|
|
2348
2415
|
formatDate: {
|
|
@@ -10055,14 +10122,14 @@ const delay = (a) => new Promise((l) => setTimeout(l, a)), useDark = () => ({ is
|
|
|
10055
10122
|
};
|
|
10056
10123
|
};
|
|
10057
10124
|
function isUrl(a) {
|
|
10058
|
-
return
|
|
10125
|
+
return /(((^http(s)?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/.test(a);
|
|
10059
10126
|
}
|
|
10060
10127
|
const getDictName = (a, l) => {
|
|
10061
10128
|
var o, r;
|
|
10062
10129
|
return !a || !l ? null : (r = (o = storageLocal.getItem("kLov")[a]) == null ? void 0 : o.children.find((c) => l === c.dictCode)) == null ? void 0 : r.dictName;
|
|
10063
10130
|
};
|
|
10064
10131
|
export {
|
|
10065
|
-
|
|
10132
|
+
W as NProgress,
|
|
10066
10133
|
VxetableRender,
|
|
10067
10134
|
addClass,
|
|
10068
10135
|
addResizeListener,
|
|
@@ -10096,7 +10163,6 @@ export {
|
|
|
10096
10163
|
showMessage,
|
|
10097
10164
|
sleep,
|
|
10098
10165
|
storageLocal,
|
|
10099
|
-
storageSession,
|
|
10100
10166
|
successMessage,
|
|
10101
10167
|
toggleClass,
|
|
10102
10168
|
useAttrs,
|