@utogether/utils 3.0.0-beta.34 → 3.0.0-beta.35
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 +2 -1
- package/dist/pkg/useRender.d.ts +2 -0
- package/dist/utils.es.js +366 -364
- package/dist/utils.umd.js +1 -1
- package/package.json +1 -1
package/dist/utils.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var j = Object.defineProperty;
|
|
2
|
-
var U = (a, l,
|
|
3
|
-
var x = (a, l,
|
|
2
|
+
var U = (a, l, h) => l in a ? j(a, l, { enumerable: !0, configurable: !0, writable: !0, value: h }) : a[l] = h;
|
|
3
|
+
var x = (a, l, h) => U(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, merge, has } from "xe-utils";
|
|
@@ -20,8 +20,8 @@ class sessionStorageProxy {
|
|
|
20
20
|
this.storage = l;
|
|
21
21
|
}
|
|
22
22
|
// 存
|
|
23
|
-
setItem(l,
|
|
24
|
-
this.storage.setItem && this.storage.setItem(this.getKey(l), JSON.stringify(
|
|
23
|
+
setItem(l, h) {
|
|
24
|
+
this.storage.setItem && this.storage.setItem(this.getKey(l), JSON.stringify(h || null));
|
|
25
25
|
}
|
|
26
26
|
// 取
|
|
27
27
|
getItem(l) {
|
|
@@ -53,8 +53,8 @@ class localforageProxy {
|
|
|
53
53
|
}), this.storage = localforage;
|
|
54
54
|
}
|
|
55
55
|
// 存
|
|
56
|
-
setItem(l,
|
|
57
|
-
this.storage.setItem(l,
|
|
56
|
+
setItem(l, h) {
|
|
57
|
+
this.storage.setItem(l, h);
|
|
58
58
|
}
|
|
59
59
|
// 取
|
|
60
60
|
getItem(l) {
|
|
@@ -73,14 +73,14 @@ const storageSession = new sessionStorageProxy(sessionStorage), storageLocal = n
|
|
|
73
73
|
/*! typescript-cookie v1.0.6 | MIT */
|
|
74
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
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,
|
|
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
77
|
}
|
|
78
|
-
function get(a, l,
|
|
79
|
-
const
|
|
78
|
+
function get(a, l, h) {
|
|
79
|
+
const o = /(?:^|; )([^=]*)=([^;]*)/g, r = {};
|
|
80
80
|
let e;
|
|
81
|
-
for (; (e =
|
|
81
|
+
for (; (e = o.exec(document.cookie)) != null; )
|
|
82
82
|
try {
|
|
83
|
-
const i =
|
|
83
|
+
const i = h(e[1]);
|
|
84
84
|
if (r[i] = l(e[2], i), a === i)
|
|
85
85
|
break;
|
|
86
86
|
} catch {
|
|
@@ -95,11 +95,11 @@ const DEFAULT_CODEC = Object.freeze({
|
|
|
95
95
|
}), DEFAULT_ATTRIBUTES = Object.freeze({
|
|
96
96
|
path: "/"
|
|
97
97
|
});
|
|
98
|
-
function setCookie(a, l,
|
|
99
|
-
return document.cookie = `${r(a)}=${
|
|
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
100
|
}
|
|
101
|
-
function getCookie(a, { decodeValue: l = decodeValue, decodeName:
|
|
102
|
-
return get(a, l,
|
|
101
|
+
function getCookie(a, { decodeValue: l = decodeValue, decodeName: h = decodeName } = {}) {
|
|
102
|
+
return get(a, l, h);
|
|
103
103
|
}
|
|
104
104
|
function getCookies({ decodeValue: a = decodeValue, decodeName: l = decodeName } = {}) {
|
|
105
105
|
return get(void 0, a, l);
|
|
@@ -110,7 +110,7 @@ function removeCookie(a, l = DEFAULT_ATTRIBUTES) {
|
|
|
110
110
|
}));
|
|
111
111
|
}
|
|
112
112
|
function init(a, l) {
|
|
113
|
-
const
|
|
113
|
+
const h = {
|
|
114
114
|
set: function(r, e, i) {
|
|
115
115
|
return setCookie(r, e, Object.assign({}, this.attributes, i), {
|
|
116
116
|
encodeValue: this.converter.write
|
|
@@ -131,11 +131,11 @@ function init(a, l) {
|
|
|
131
131
|
withConverter: function(r) {
|
|
132
132
|
return init(Object.assign({}, this.converter, r), this.attributes);
|
|
133
133
|
}
|
|
134
|
-
},
|
|
134
|
+
}, o = {
|
|
135
135
|
attributes: { value: Object.freeze(l) },
|
|
136
136
|
converter: { value: Object.freeze(a) }
|
|
137
137
|
};
|
|
138
|
-
return Object.create(
|
|
138
|
+
return Object.create(h, o);
|
|
139
139
|
}
|
|
140
140
|
init({ read: DEFAULT_CODEC.decodeValue, write: DEFAULT_CODEC.encodeValue }, DEFAULT_ATTRIBUTES);
|
|
141
141
|
class Cookies {
|
|
@@ -151,8 +151,8 @@ class Cookies {
|
|
|
151
151
|
* @param value
|
|
152
152
|
* @param cookieSetting
|
|
153
153
|
*/
|
|
154
|
-
set(l = "default",
|
|
155
|
-
setCookie(`${this.getKey(l)}`,
|
|
154
|
+
set(l = "default", h = "") {
|
|
155
|
+
setCookie(`${this.getKey(l)}`, h);
|
|
156
156
|
}
|
|
157
157
|
/**
|
|
158
158
|
* 拿到 cookie 值
|
|
@@ -191,9 +191,9 @@ const VxetableRender = (VXETable, {
|
|
|
191
191
|
const dict = storageLocal.getItem("kLov");
|
|
192
192
|
VXETable.renderer.add("#SuSelect", {
|
|
193
193
|
renderTableEdit(a, l) {
|
|
194
|
-
let
|
|
194
|
+
let h;
|
|
195
195
|
const {
|
|
196
|
-
row:
|
|
196
|
+
row: o,
|
|
197
197
|
column: r
|
|
198
198
|
} = l, {
|
|
199
199
|
options: e,
|
|
@@ -208,12 +208,12 @@ const VxetableRender = (VXETable, {
|
|
|
208
208
|
multiple: f,
|
|
209
209
|
mapField: b
|
|
210
210
|
} = i, m = useComponent(), s = f ? `_${r.field}` : r.field;
|
|
211
|
-
m.setDefaultValue(i,
|
|
211
|
+
m.setDefaultValue(i, o, r.field);
|
|
212
212
|
function M(V) {
|
|
213
213
|
m.remote(V, r.field, a);
|
|
214
214
|
}
|
|
215
215
|
function p(V) {
|
|
216
|
-
m.selectChange(V,
|
|
216
|
+
m.selectChange(V, o, r.field, a, {
|
|
217
217
|
column: r,
|
|
218
218
|
datasource: "row"
|
|
219
219
|
});
|
|
@@ -222,14 +222,14 @@ const VxetableRender = (VXETable, {
|
|
|
222
222
|
v != null && v.input && v.input(l, V);
|
|
223
223
|
}
|
|
224
224
|
function A() {
|
|
225
|
-
m.clear(
|
|
225
|
+
m.clear(o, r.field, b, v, "row");
|
|
226
226
|
}
|
|
227
227
|
function k() {
|
|
228
228
|
!e.length && M(""), v != null && v.focus && v.focus(l, r.field);
|
|
229
229
|
}
|
|
230
230
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
231
|
-
modelValue:
|
|
232
|
-
"onUpdate:modelValue": (V) =>
|
|
231
|
+
modelValue: o[s],
|
|
232
|
+
"onUpdate:modelValue": (V) => o[s] = V,
|
|
233
233
|
filterable: !0,
|
|
234
234
|
remote: !0,
|
|
235
235
|
clearable: !0,
|
|
@@ -242,18 +242,18 @@ const VxetableRender = (VXETable, {
|
|
|
242
242
|
onChange: (V) => p(V),
|
|
243
243
|
onClear: () => A(),
|
|
244
244
|
onInput: (V) => y(V)
|
|
245
|
-
}), _isSlot(
|
|
245
|
+
}), _isSlot(h = e.map((V) => createVNode(resolveComponent("el-option"), {
|
|
246
246
|
key: V[d],
|
|
247
247
|
label: V[Z],
|
|
248
248
|
value: V[d]
|
|
249
|
-
}, null))) ?
|
|
250
|
-
default: () => [
|
|
249
|
+
}, null))) ? h : {
|
|
250
|
+
default: () => [h]
|
|
251
251
|
})];
|
|
252
252
|
},
|
|
253
253
|
renderTableDefault(a, l) {
|
|
254
|
-
let
|
|
254
|
+
let h;
|
|
255
255
|
const {
|
|
256
|
-
row:
|
|
256
|
+
row: o,
|
|
257
257
|
column: r
|
|
258
258
|
} = l, {
|
|
259
259
|
options: e,
|
|
@@ -268,12 +268,12 @@ const VxetableRender = (VXETable, {
|
|
|
268
268
|
multiple: f,
|
|
269
269
|
mapField: b
|
|
270
270
|
} = i, m = useComponent(), s = f ? `_${r.field}` : r.field;
|
|
271
|
-
m.setDefaultValue(i,
|
|
271
|
+
m.setDefaultValue(i, o, r.field);
|
|
272
272
|
function M(V) {
|
|
273
273
|
m.remote(V, r.field, a);
|
|
274
274
|
}
|
|
275
275
|
function p(V) {
|
|
276
|
-
m.selectChange(V,
|
|
276
|
+
m.selectChange(V, o, r.field, a, {
|
|
277
277
|
column: r,
|
|
278
278
|
datasource: "row"
|
|
279
279
|
});
|
|
@@ -282,14 +282,14 @@ const VxetableRender = (VXETable, {
|
|
|
282
282
|
v != null && v.input && v.input(l, V);
|
|
283
283
|
}
|
|
284
284
|
function A() {
|
|
285
|
-
m.clear(
|
|
285
|
+
m.clear(o, r.field, b, v, "row");
|
|
286
286
|
}
|
|
287
287
|
function k() {
|
|
288
288
|
!e.length && M(""), v != null && v.focus && v.focus(l, r.field);
|
|
289
289
|
}
|
|
290
290
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
291
|
-
modelValue:
|
|
292
|
-
"onUpdate:modelValue": (V) =>
|
|
291
|
+
modelValue: o[s],
|
|
292
|
+
"onUpdate:modelValue": (V) => o[s] = V,
|
|
293
293
|
filterable: !0,
|
|
294
294
|
remote: !0,
|
|
295
295
|
clearable: !0,
|
|
@@ -302,12 +302,12 @@ const VxetableRender = (VXETable, {
|
|
|
302
302
|
onChange: (V) => p(V),
|
|
303
303
|
onClear: () => A(),
|
|
304
304
|
onInput: (V) => y(V)
|
|
305
|
-
}), _isSlot(
|
|
305
|
+
}), _isSlot(h = e.map((V) => createVNode(resolveComponent("el-option"), {
|
|
306
306
|
key: V[d],
|
|
307
307
|
label: V[Z],
|
|
308
308
|
value: V[d]
|
|
309
|
-
}, null))) ?
|
|
310
|
-
default: () => [
|
|
309
|
+
}, null))) ? h : {
|
|
310
|
+
default: () => [h]
|
|
311
311
|
})];
|
|
312
312
|
},
|
|
313
313
|
// 可编辑显示模板
|
|
@@ -325,9 +325,9 @@ const VxetableRender = (VXETable, {
|
|
|
325
325
|
return textValue && (val = eval(`row.${textValue}`) || row[column.field]), val && multiple && isArray(val) && (val = val && val.join(",")), [createVNode("span", null, [val])];
|
|
326
326
|
},
|
|
327
327
|
renderItemContent(a, l) {
|
|
328
|
-
let
|
|
328
|
+
let h;
|
|
329
329
|
const {
|
|
330
|
-
data:
|
|
330
|
+
data: o,
|
|
331
331
|
field: r
|
|
332
332
|
} = l, {
|
|
333
333
|
options: e,
|
|
@@ -342,12 +342,12 @@ const VxetableRender = (VXETable, {
|
|
|
342
342
|
multiple: f,
|
|
343
343
|
loading: b = !1
|
|
344
344
|
} = i, m = useComponent(), s = f ? `_${r}` : r;
|
|
345
|
-
m.setDefaultValue(i,
|
|
345
|
+
m.setDefaultValue(i, o, r);
|
|
346
346
|
async function M(V) {
|
|
347
347
|
m.remote(V, r, a);
|
|
348
348
|
}
|
|
349
349
|
function p(V) {
|
|
350
|
-
m.selectChange(V,
|
|
350
|
+
m.selectChange(V, o, r, a, {
|
|
351
351
|
datasource: "data"
|
|
352
352
|
});
|
|
353
353
|
}
|
|
@@ -355,14 +355,14 @@ const VxetableRender = (VXETable, {
|
|
|
355
355
|
v != null && v.input && v.input(l, V);
|
|
356
356
|
}
|
|
357
357
|
function A() {
|
|
358
|
-
m.clear(
|
|
358
|
+
m.clear(o, r, n, v, "data");
|
|
359
359
|
}
|
|
360
360
|
function k() {
|
|
361
361
|
!e.length && M(""), v != null && v.focus && v.focus(l);
|
|
362
362
|
}
|
|
363
363
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
364
|
-
modelValue:
|
|
365
|
-
"onUpdate:modelValue": (V) =>
|
|
364
|
+
modelValue: o[s],
|
|
365
|
+
"onUpdate:modelValue": (V) => o[s] = V,
|
|
366
366
|
filterable: !0,
|
|
367
367
|
remote: !0,
|
|
368
368
|
clearable: !0,
|
|
@@ -375,23 +375,23 @@ const VxetableRender = (VXETable, {
|
|
|
375
375
|
onChange: (V) => p(V),
|
|
376
376
|
onClear: () => A(),
|
|
377
377
|
onInput: () => y()
|
|
378
|
-
}), _isSlot(
|
|
378
|
+
}), _isSlot(h = e.map((V) => createVNode(resolveComponent("el-option"), {
|
|
379
379
|
key: V[d],
|
|
380
380
|
label: V[Z],
|
|
381
381
|
value: V[d]
|
|
382
|
-
}, null))) ?
|
|
383
|
-
default: () => [
|
|
382
|
+
}, null))) ? h : {
|
|
383
|
+
default: () => [h]
|
|
384
384
|
})];
|
|
385
385
|
}
|
|
386
386
|
}), VXETable.renderer.add("#SuDateRange", {
|
|
387
387
|
renderItemContent(a, l) {
|
|
388
388
|
const {
|
|
389
|
-
data:
|
|
390
|
-
field:
|
|
389
|
+
data: h,
|
|
390
|
+
field: o
|
|
391
391
|
} = l, {
|
|
392
392
|
props: r
|
|
393
393
|
} = a;
|
|
394
|
-
r != null && r.defaultValue && !o
|
|
394
|
+
r != null && r.defaultValue && !h[o] && (h[o] = r.defaultValue, r.defaultValue = r.required ? r.defaultValue : null);
|
|
395
395
|
const e = /* @__PURE__ */ new Date(), i = [{
|
|
396
396
|
text: i18n("message.udp.today", !0),
|
|
397
397
|
value: () => [t(1, "day"), e]
|
|
@@ -415,8 +415,8 @@ const VxetableRender = (VXETable, {
|
|
|
415
415
|
value: () => [t(1, "year"), e]
|
|
416
416
|
}], t = (v, Z) => dayjs().subtract(v, Z).add("1", "day").format();
|
|
417
417
|
return [createVNode(resolveComponent("el-date-picker"), mergeProps({
|
|
418
|
-
modelValue: o
|
|
419
|
-
"onUpdate:modelValue": (v) => o
|
|
418
|
+
modelValue: h[o],
|
|
419
|
+
"onUpdate:modelValue": (v) => h[o] = v,
|
|
420
420
|
type: (r == null ? void 0 : r.type) || "daterange",
|
|
421
421
|
shortcuts: i,
|
|
422
422
|
style: "width: 100%",
|
|
@@ -427,9 +427,9 @@ const VxetableRender = (VXETable, {
|
|
|
427
427
|
}
|
|
428
428
|
}), VXETable.renderer.add("#select", {
|
|
429
429
|
renderTableEdit(a, l) {
|
|
430
|
-
let
|
|
430
|
+
let h;
|
|
431
431
|
const {
|
|
432
|
-
row:
|
|
432
|
+
row: o,
|
|
433
433
|
column: r
|
|
434
434
|
} = l, {
|
|
435
435
|
options: e,
|
|
@@ -443,37 +443,37 @@ const VxetableRender = (VXETable, {
|
|
|
443
443
|
multiple: n,
|
|
444
444
|
mapField: f
|
|
445
445
|
} = i, b = useComponent(), m = n ? `_${r.field}` : r.field;
|
|
446
|
-
b.setDefaultValue(i,
|
|
446
|
+
b.setDefaultValue(i, o, r.field);
|
|
447
447
|
function s(p) {
|
|
448
|
-
b.selectChange(p,
|
|
448
|
+
b.selectChange(p, o, r.field, a, {
|
|
449
449
|
column: r,
|
|
450
450
|
datasource: "row"
|
|
451
451
|
});
|
|
452
452
|
}
|
|
453
453
|
function M() {
|
|
454
|
-
b.clear(
|
|
454
|
+
b.clear(o, r.field, f, v, "row");
|
|
455
455
|
}
|
|
456
456
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
457
|
-
modelValue:
|
|
458
|
-
"onUpdate:modelValue": (p) =>
|
|
457
|
+
modelValue: o[m],
|
|
458
|
+
"onUpdate:modelValue": (p) => o[m] = p,
|
|
459
459
|
filterable: !0,
|
|
460
460
|
clearable: !0
|
|
461
461
|
}, i, {
|
|
462
462
|
style: "width: 100%",
|
|
463
463
|
onChange: (p) => s(p),
|
|
464
464
|
onClear: () => M()
|
|
465
|
-
}), _isSlot(
|
|
465
|
+
}), _isSlot(h = e.map((p) => createVNode(resolveComponent("el-option"), {
|
|
466
466
|
key: p[d],
|
|
467
467
|
label: p[Z],
|
|
468
468
|
value: p[d]
|
|
469
|
-
}, null))) ?
|
|
470
|
-
default: () => [
|
|
469
|
+
}, null))) ? h : {
|
|
470
|
+
default: () => [h]
|
|
471
471
|
})];
|
|
472
472
|
},
|
|
473
473
|
renderTableDefault(a, l) {
|
|
474
|
-
let
|
|
474
|
+
let h;
|
|
475
475
|
const {
|
|
476
|
-
row:
|
|
476
|
+
row: o,
|
|
477
477
|
column: r
|
|
478
478
|
} = l, {
|
|
479
479
|
options: e,
|
|
@@ -488,31 +488,31 @@ const VxetableRender = (VXETable, {
|
|
|
488
488
|
multiple: f,
|
|
489
489
|
mapField: b
|
|
490
490
|
} = i, m = useComponent(), s = f ? `_${r.field}` : r.field;
|
|
491
|
-
m.setDefaultValue(i,
|
|
491
|
+
m.setDefaultValue(i, o, r.field);
|
|
492
492
|
function M(y) {
|
|
493
|
-
m.selectChange(y,
|
|
493
|
+
m.selectChange(y, o, r.field, a, {
|
|
494
494
|
column: r,
|
|
495
495
|
datasource: "row"
|
|
496
496
|
});
|
|
497
497
|
}
|
|
498
498
|
function p() {
|
|
499
|
-
m.clear(
|
|
499
|
+
m.clear(o, r.field, b, v, "row");
|
|
500
500
|
}
|
|
501
501
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
502
|
-
modelValue:
|
|
503
|
-
"onUpdate:modelValue": (y) =>
|
|
502
|
+
modelValue: o[s],
|
|
503
|
+
"onUpdate:modelValue": (y) => o[s] = y,
|
|
504
504
|
filterable: !0,
|
|
505
505
|
clearable: !0
|
|
506
506
|
}, i, {
|
|
507
507
|
style: "width: 100%",
|
|
508
508
|
onChange: (y) => M(y),
|
|
509
509
|
onClear: () => p()
|
|
510
|
-
}), _isSlot(
|
|
510
|
+
}), _isSlot(h = e.map((y) => createVNode(resolveComponent("el-option"), {
|
|
511
511
|
key: y[d],
|
|
512
512
|
label: n && y[n] ? y[d] : y[Z],
|
|
513
513
|
value: y[d]
|
|
514
|
-
}, null))) ?
|
|
515
|
-
default: () => [
|
|
514
|
+
}, null))) ? h : {
|
|
515
|
+
default: () => [h]
|
|
516
516
|
})];
|
|
517
517
|
},
|
|
518
518
|
// 可编辑显示模板
|
|
@@ -536,9 +536,9 @@ const VxetableRender = (VXETable, {
|
|
|
536
536
|
return textValue && (val = eval(`row.${textValue}`) || row[column.field]), item && (val = extLabel ? item[value] : item[label]), val && (props != null && props.multiple) && isArray(val) && (val = val && val.join(",")), [createVNode("span", null, [val])];
|
|
537
537
|
},
|
|
538
538
|
renderItemContent(a, l) {
|
|
539
|
-
let
|
|
539
|
+
let h;
|
|
540
540
|
const {
|
|
541
|
-
data:
|
|
541
|
+
data: o,
|
|
542
542
|
field: r
|
|
543
543
|
} = l, {
|
|
544
544
|
options: e,
|
|
@@ -552,37 +552,37 @@ const VxetableRender = (VXETable, {
|
|
|
552
552
|
mapField: f,
|
|
553
553
|
multiple: b
|
|
554
554
|
} = i, m = b ? `_${r}` : r;
|
|
555
|
-
n.setDefaultValue(i,
|
|
555
|
+
n.setDefaultValue(i, o, r);
|
|
556
556
|
function s(p) {
|
|
557
|
-
n.selectChange(p,
|
|
557
|
+
n.selectChange(p, o, r, a, {
|
|
558
558
|
datasource: "data"
|
|
559
559
|
});
|
|
560
560
|
}
|
|
561
561
|
function M() {
|
|
562
|
-
n.clear(
|
|
562
|
+
n.clear(o, r, f, v, "data");
|
|
563
563
|
}
|
|
564
564
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
565
|
-
modelValue:
|
|
566
|
-
"onUpdate:modelValue": (p) =>
|
|
565
|
+
modelValue: o[m],
|
|
566
|
+
"onUpdate:modelValue": (p) => o[m] = p,
|
|
567
567
|
filterable: !0,
|
|
568
568
|
clearable: !0,
|
|
569
569
|
style: "width: 100%"
|
|
570
570
|
}, i, {
|
|
571
571
|
onChange: (p) => s(p),
|
|
572
572
|
onClear: () => M()
|
|
573
|
-
}), _isSlot(
|
|
573
|
+
}), _isSlot(h = e.map((p) => createVNode(resolveComponent("el-option"), {
|
|
574
574
|
key: p[d],
|
|
575
575
|
label: p[Z],
|
|
576
576
|
value: p[d]
|
|
577
|
-
}, null))) ?
|
|
578
|
-
default: () => [
|
|
577
|
+
}, null))) ? h : {
|
|
578
|
+
default: () => [h]
|
|
579
579
|
})];
|
|
580
580
|
}
|
|
581
581
|
}), VXETable.renderer.add("#lov", {
|
|
582
582
|
renderItemContent(a, l) {
|
|
583
583
|
const {
|
|
584
|
-
data:
|
|
585
|
-
field:
|
|
584
|
+
data: h,
|
|
585
|
+
field: o
|
|
586
586
|
} = l, {
|
|
587
587
|
props: r,
|
|
588
588
|
events: e
|
|
@@ -590,7 +590,7 @@ const VxetableRender = (VXETable, {
|
|
|
590
590
|
defaultValues: t,
|
|
591
591
|
mapField: v
|
|
592
592
|
} = r;
|
|
593
|
-
t && (o
|
|
593
|
+
t && (h[o] = t);
|
|
594
594
|
function Z(n, f) {
|
|
595
595
|
const {
|
|
596
596
|
mapField: b,
|
|
@@ -601,11 +601,11 @@ const VxetableRender = (VXETable, {
|
|
|
601
601
|
if (M) {
|
|
602
602
|
if (M) {
|
|
603
603
|
const y = {};
|
|
604
|
-
|
|
604
|
+
h[s || m] = n.reduce((A, k) => {
|
|
605
605
|
for (const V in b)
|
|
606
606
|
y[V] = A ? y[V] + "," + k[b[V]] : k[b[V]];
|
|
607
607
|
return A = A ? A + "," + k[s || m] : k[s || m], A;
|
|
608
|
-
}, ""), Object.assign(
|
|
608
|
+
}, ""), Object.assign(h, y);
|
|
609
609
|
}
|
|
610
610
|
} else {
|
|
611
611
|
const y = {
|
|
@@ -613,20 +613,20 @@ const VxetableRender = (VXETable, {
|
|
|
613
613
|
};
|
|
614
614
|
for (const A in b)
|
|
615
615
|
y[A] = n[b[A]];
|
|
616
|
-
Object.assign(
|
|
616
|
+
Object.assign(h, y);
|
|
617
617
|
}
|
|
618
618
|
const p = {
|
|
619
|
-
data:
|
|
619
|
+
data: h,
|
|
620
620
|
options: n,
|
|
621
621
|
field: m
|
|
622
622
|
};
|
|
623
623
|
e != null && e.change && e.change(p);
|
|
624
624
|
}
|
|
625
625
|
function d() {
|
|
626
|
-
i.clear(
|
|
626
|
+
i.clear(h, o, v, e, "data");
|
|
627
627
|
}
|
|
628
628
|
return [createVNode(resolveComponent("ut-lov"), mergeProps({
|
|
629
|
-
record:
|
|
629
|
+
record: h
|
|
630
630
|
}, r, {
|
|
631
631
|
mode: "vxe",
|
|
632
632
|
onChange: (n, f) => Z(n, f),
|
|
@@ -636,8 +636,8 @@ const VxetableRender = (VXETable, {
|
|
|
636
636
|
// 单元格编辑
|
|
637
637
|
renderTableEdit(a, l) {
|
|
638
638
|
const {
|
|
639
|
-
row:
|
|
640
|
-
column:
|
|
639
|
+
row: h,
|
|
640
|
+
column: o
|
|
641
641
|
} = l, {
|
|
642
642
|
props: r,
|
|
643
643
|
events: e
|
|
@@ -655,20 +655,20 @@ const VxetableRender = (VXETable, {
|
|
|
655
655
|
};
|
|
656
656
|
for (const p in n)
|
|
657
657
|
M[p] = Z[n[p]];
|
|
658
|
-
Object.assign(
|
|
658
|
+
Object.assign(h, M);
|
|
659
659
|
}
|
|
660
660
|
const s = {
|
|
661
|
-
row:
|
|
661
|
+
row: h,
|
|
662
662
|
options: Z,
|
|
663
|
-
field:
|
|
663
|
+
field: o.field
|
|
664
664
|
};
|
|
665
665
|
e != null && e.change && e.change(s);
|
|
666
666
|
}
|
|
667
667
|
function v() {
|
|
668
|
-
i.clear(
|
|
668
|
+
i.clear(h, o.field, r.mapField, e, "row");
|
|
669
669
|
}
|
|
670
670
|
return [createVNode(resolveComponent("ut-lov"), mergeProps({
|
|
671
|
-
record:
|
|
671
|
+
record: h,
|
|
672
672
|
mode: "vxe",
|
|
673
673
|
transfer: !0
|
|
674
674
|
}, r, {
|
|
@@ -679,8 +679,8 @@ const VxetableRender = (VXETable, {
|
|
|
679
679
|
// 单元格默认
|
|
680
680
|
renderTableDefault(a, l) {
|
|
681
681
|
const {
|
|
682
|
-
row:
|
|
683
|
-
column:
|
|
682
|
+
row: h,
|
|
683
|
+
column: o
|
|
684
684
|
} = l, {
|
|
685
685
|
props: r,
|
|
686
686
|
events: e
|
|
@@ -698,20 +698,20 @@ const VxetableRender = (VXETable, {
|
|
|
698
698
|
};
|
|
699
699
|
for (const p in n)
|
|
700
700
|
M[p] = Z[n[p]];
|
|
701
|
-
Object.assign(
|
|
701
|
+
Object.assign(h, M);
|
|
702
702
|
}
|
|
703
703
|
const s = {
|
|
704
|
-
row:
|
|
704
|
+
row: h,
|
|
705
705
|
options: Z,
|
|
706
|
-
field:
|
|
706
|
+
field: o.field
|
|
707
707
|
};
|
|
708
708
|
e != null && e.change && e.change(s);
|
|
709
709
|
}
|
|
710
710
|
function v() {
|
|
711
|
-
i.clear(
|
|
711
|
+
i.clear(h, o.field, mapField, e, "row");
|
|
712
712
|
}
|
|
713
713
|
return [createVNode(resolveComponent("ut-lov"), mergeProps({
|
|
714
|
-
record:
|
|
714
|
+
record: h,
|
|
715
715
|
mode: "ele"
|
|
716
716
|
}, r, {
|
|
717
717
|
onChange: (Z, d) => t(Z, d),
|
|
@@ -721,16 +721,16 @@ const VxetableRender = (VXETable, {
|
|
|
721
721
|
// 可编辑显示模板
|
|
722
722
|
renderTableCell(a, l) {
|
|
723
723
|
const {
|
|
724
|
-
row:
|
|
725
|
-
column:
|
|
724
|
+
row: h,
|
|
725
|
+
column: o
|
|
726
726
|
} = l;
|
|
727
|
-
return [createVNode("span", null, [o
|
|
727
|
+
return [createVNode("span", null, [h[o.field]])];
|
|
728
728
|
}
|
|
729
729
|
}), VXETable.renderer.add("#textarea", {
|
|
730
730
|
renderTableEdit(a, l) {
|
|
731
731
|
const {
|
|
732
|
-
row:
|
|
733
|
-
column:
|
|
732
|
+
row: h,
|
|
733
|
+
column: o
|
|
734
734
|
} = l, {
|
|
735
735
|
props: r,
|
|
736
736
|
events: e
|
|
@@ -738,17 +738,17 @@ const VxetableRender = (VXETable, {
|
|
|
738
738
|
mapField: i
|
|
739
739
|
} = r, t = useComponent();
|
|
740
740
|
function v(d) {
|
|
741
|
-
t.change(d,
|
|
742
|
-
column:
|
|
741
|
+
t.change(d, h, o.field, a, {
|
|
742
|
+
column: o,
|
|
743
743
|
datasource: "row"
|
|
744
744
|
});
|
|
745
745
|
}
|
|
746
746
|
function Z() {
|
|
747
|
-
t.clear(
|
|
747
|
+
t.clear(h, o.field, i, e, "row");
|
|
748
748
|
}
|
|
749
749
|
return [createVNode(resolveComponent("vxe-textarea"), mergeProps({
|
|
750
|
-
modelValue: o
|
|
751
|
-
"onUpdate:modelValue": (d) => o
|
|
750
|
+
modelValue: h[o.field],
|
|
751
|
+
"onUpdate:modelValue": (d) => h[o.field] = d
|
|
752
752
|
}, r, {
|
|
753
753
|
style: "width: 100%",
|
|
754
754
|
onChange: (d) => v(d),
|
|
@@ -757,8 +757,8 @@ const VxetableRender = (VXETable, {
|
|
|
757
757
|
},
|
|
758
758
|
renderTableDefault(a, l) {
|
|
759
759
|
const {
|
|
760
|
-
row:
|
|
761
|
-
column:
|
|
760
|
+
row: h,
|
|
761
|
+
column: o
|
|
762
762
|
} = l, {
|
|
763
763
|
props: r,
|
|
764
764
|
events: e
|
|
@@ -766,17 +766,17 @@ const VxetableRender = (VXETable, {
|
|
|
766
766
|
mapField: i
|
|
767
767
|
} = r, t = useComponent();
|
|
768
768
|
function v(d) {
|
|
769
|
-
t.change(d,
|
|
770
|
-
column:
|
|
769
|
+
t.change(d, h, o.field, a, {
|
|
770
|
+
column: o,
|
|
771
771
|
datasource: "row"
|
|
772
772
|
});
|
|
773
773
|
}
|
|
774
774
|
function Z() {
|
|
775
|
-
t.clear(
|
|
775
|
+
t.clear(h, o.field, i, e, "row");
|
|
776
776
|
}
|
|
777
777
|
return [createVNode(resolveComponent("vxe-textarea"), mergeProps({
|
|
778
|
-
modelValue: o
|
|
779
|
-
"onUpdate:modelValue": (d) => o
|
|
778
|
+
modelValue: h[o.field],
|
|
779
|
+
"onUpdate:modelValue": (d) => h[o.field] = d
|
|
780
780
|
}, r, {
|
|
781
781
|
onChange: (d) => v(d),
|
|
782
782
|
onClear: () => Z()
|
|
@@ -785,15 +785,15 @@ const VxetableRender = (VXETable, {
|
|
|
785
785
|
// 可编辑显示模板
|
|
786
786
|
renderTableCell(a, l) {
|
|
787
787
|
const {
|
|
788
|
-
row:
|
|
789
|
-
column:
|
|
788
|
+
row: h,
|
|
789
|
+
column: o
|
|
790
790
|
} = l;
|
|
791
|
-
return o
|
|
791
|
+
return h[o.field];
|
|
792
792
|
},
|
|
793
793
|
renderItemContent(a, l) {
|
|
794
794
|
const {
|
|
795
|
-
data:
|
|
796
|
-
field:
|
|
795
|
+
data: h,
|
|
796
|
+
field: o
|
|
797
797
|
} = l, {
|
|
798
798
|
props: r,
|
|
799
799
|
events: e
|
|
@@ -801,18 +801,18 @@ const VxetableRender = (VXETable, {
|
|
|
801
801
|
defaultValue: t,
|
|
802
802
|
mapField: v
|
|
803
803
|
} = r;
|
|
804
|
-
t && (o
|
|
804
|
+
t && (h[o] = t);
|
|
805
805
|
function Z(n) {
|
|
806
|
-
i.change(n,
|
|
806
|
+
i.change(n, h, o, a, {
|
|
807
807
|
datasource: "data"
|
|
808
808
|
});
|
|
809
809
|
}
|
|
810
810
|
function d() {
|
|
811
|
-
i.clear(
|
|
811
|
+
i.clear(h, o, v, e, "data");
|
|
812
812
|
}
|
|
813
813
|
return [createVNode(resolveComponent("vxe-textarea"), mergeProps({
|
|
814
|
-
modelValue: o
|
|
815
|
-
"onUpdate:modelValue": (n) => o
|
|
814
|
+
modelValue: h[o],
|
|
815
|
+
"onUpdate:modelValue": (n) => h[o] = n
|
|
816
816
|
}, r, {
|
|
817
817
|
onChange: (n) => Z(n),
|
|
818
818
|
onClear: () => d()
|
|
@@ -821,18 +821,18 @@ const VxetableRender = (VXETable, {
|
|
|
821
821
|
}), VXETable.renderer.add("#upload", {
|
|
822
822
|
renderTableEdit(a, l) {
|
|
823
823
|
const {
|
|
824
|
-
row:
|
|
825
|
-
column:
|
|
824
|
+
row: h,
|
|
825
|
+
column: o
|
|
826
826
|
} = l, {
|
|
827
827
|
props: r,
|
|
828
828
|
events: e
|
|
829
829
|
} = a;
|
|
830
830
|
function i(t, v) {
|
|
831
|
-
o
|
|
831
|
+
h[o.field] = "", e != null && e.remove && (e == null || e.remove(t, v));
|
|
832
832
|
}
|
|
833
833
|
return [createVNode(resolveComponent("form-upload"), mergeProps({
|
|
834
|
-
record:
|
|
835
|
-
field:
|
|
834
|
+
record: h,
|
|
835
|
+
field: o.field,
|
|
836
836
|
size: "mini"
|
|
837
837
|
}, r, {
|
|
838
838
|
"render-mode": "column",
|
|
@@ -843,14 +843,14 @@ const VxetableRender = (VXETable, {
|
|
|
843
843
|
// 可编辑显示模板
|
|
844
844
|
renderTableCell(a, l) {
|
|
845
845
|
const {
|
|
846
|
-
row:
|
|
847
|
-
column:
|
|
846
|
+
row: h,
|
|
847
|
+
column: o
|
|
848
848
|
} = l, {
|
|
849
849
|
props: r
|
|
850
850
|
} = a;
|
|
851
851
|
return [createVNode(resolveComponent("form-upload"), mergeProps({
|
|
852
|
-
record:
|
|
853
|
-
field:
|
|
852
|
+
record: h,
|
|
853
|
+
field: o.field,
|
|
854
854
|
size: "mini"
|
|
855
855
|
}, r, {
|
|
856
856
|
mode: "image",
|
|
@@ -860,18 +860,18 @@ const VxetableRender = (VXETable, {
|
|
|
860
860
|
},
|
|
861
861
|
renderItemContent(a, l) {
|
|
862
862
|
const {
|
|
863
|
-
data:
|
|
864
|
-
field:
|
|
863
|
+
data: h,
|
|
864
|
+
field: o
|
|
865
865
|
} = l, {
|
|
866
866
|
props: r,
|
|
867
867
|
events: e
|
|
868
868
|
} = a;
|
|
869
869
|
function i(t, v) {
|
|
870
|
-
o
|
|
870
|
+
h[o] = "", e != null && e.remove && (e == null || e.remove(t, v));
|
|
871
871
|
}
|
|
872
872
|
return [createVNode(resolveComponent("form-upload"), mergeProps({
|
|
873
|
-
record:
|
|
874
|
-
field:
|
|
873
|
+
record: h,
|
|
874
|
+
field: o,
|
|
875
875
|
mode: "image"
|
|
876
876
|
}, r, {
|
|
877
877
|
onRemove: (t, v) => i(t, v)
|
|
@@ -880,9 +880,9 @@ const VxetableRender = (VXETable, {
|
|
|
880
880
|
}), VXETable.renderer.add("#tag", {
|
|
881
881
|
// 默认显示模板
|
|
882
882
|
renderTableDefault(a, l) {
|
|
883
|
-
let
|
|
883
|
+
let h;
|
|
884
884
|
const {
|
|
885
|
-
row:
|
|
885
|
+
row: o,
|
|
886
886
|
column: r
|
|
887
887
|
} = l, {
|
|
888
888
|
props: {
|
|
@@ -891,20 +891,20 @@ const VxetableRender = (VXETable, {
|
|
|
891
891
|
}
|
|
892
892
|
} = a;
|
|
893
893
|
function t() {
|
|
894
|
-
return
|
|
894
|
+
return o[r.field] ? i[o[r.field]] : null;
|
|
895
895
|
}
|
|
896
|
-
return [
|
|
896
|
+
return [o[r.field] ? createVNode(resolveComponent("el-tag"), {
|
|
897
897
|
effect: "dark",
|
|
898
898
|
type: t()
|
|
899
|
-
}, _isSlot(
|
|
900
|
-
default: () => [
|
|
899
|
+
}, _isSlot(h = getValue(e, o[r.field])) ? h : {
|
|
900
|
+
default: () => [h]
|
|
901
901
|
}) : null];
|
|
902
902
|
}
|
|
903
903
|
}), VXETable.renderer.add("#switch", {
|
|
904
904
|
renderTableDefault(a, l) {
|
|
905
905
|
const {
|
|
906
|
-
row:
|
|
907
|
-
column:
|
|
906
|
+
row: h,
|
|
907
|
+
column: o
|
|
908
908
|
} = l, {
|
|
909
909
|
props: {
|
|
910
910
|
code: r,
|
|
@@ -915,15 +915,15 @@ const VxetableRender = (VXETable, {
|
|
|
915
915
|
} = a;
|
|
916
916
|
function v(Z) {
|
|
917
917
|
const d = {
|
|
918
|
-
row:
|
|
919
|
-
column:
|
|
918
|
+
row: h,
|
|
919
|
+
column: o,
|
|
920
920
|
value: Z
|
|
921
921
|
};
|
|
922
922
|
t != null && t.change && t.change(d);
|
|
923
923
|
}
|
|
924
|
-
return [o
|
|
925
|
-
modelValue: o
|
|
926
|
-
"onUpdate:modelValue": (Z) => o
|
|
924
|
+
return [h[o.field] ? createVNode(resolveComponent("el-switch"), mergeProps({
|
|
925
|
+
modelValue: h[o.field],
|
|
926
|
+
"onUpdate:modelValue": (Z) => h[o.field] = Z,
|
|
927
927
|
"inline-prompt": !0,
|
|
928
928
|
size: "large",
|
|
929
929
|
style: "--el-switch-on-color: #13ce66; --el-switch-off-color: #E6A23C"
|
|
@@ -936,49 +936,49 @@ const VxetableRender = (VXETable, {
|
|
|
936
936
|
}), VXETable.renderer.add("#iconSelect", {
|
|
937
937
|
renderTableEdit(a, l) {
|
|
938
938
|
const {
|
|
939
|
-
row:
|
|
940
|
-
column:
|
|
939
|
+
row: h,
|
|
940
|
+
column: o
|
|
941
941
|
} = l;
|
|
942
942
|
return [createVNode(resolveComponent("SuIconSelect"), {
|
|
943
|
-
modelValue: o
|
|
944
|
-
"onUpdate:modelValue": (r) => o
|
|
943
|
+
modelValue: h[o.field],
|
|
944
|
+
"onUpdate:modelValue": (r) => h[o.field] = r,
|
|
945
945
|
teleported: !1
|
|
946
946
|
}, null)];
|
|
947
947
|
},
|
|
948
948
|
renderTableCell(a, l) {
|
|
949
949
|
const {
|
|
950
|
-
row:
|
|
951
|
-
column:
|
|
950
|
+
row: h,
|
|
951
|
+
column: o
|
|
952
952
|
} = l;
|
|
953
953
|
return [createVNode(resolveComponent("IconifyIconOffline"), {
|
|
954
|
-
icon: o
|
|
954
|
+
icon: h[o.field],
|
|
955
955
|
style: "font-size: 16px;"
|
|
956
956
|
}, null)];
|
|
957
957
|
},
|
|
958
958
|
renderItemContent(a, l) {
|
|
959
959
|
const {
|
|
960
|
-
data:
|
|
961
|
-
field:
|
|
960
|
+
data: h,
|
|
961
|
+
field: o
|
|
962
962
|
} = l;
|
|
963
963
|
return [createVNode(resolveComponent("SuIconSelect"), {
|
|
964
|
-
modelValue: o
|
|
965
|
-
"onUpdate:modelValue": (r) => o
|
|
964
|
+
modelValue: h[o],
|
|
965
|
+
"onUpdate:modelValue": (r) => h[o] = r,
|
|
966
966
|
teleported: !0
|
|
967
967
|
}, null)];
|
|
968
968
|
}
|
|
969
969
|
}), VXETable.renderer.add("#treeSelect", {
|
|
970
970
|
renderTableEdit(a, l) {
|
|
971
971
|
const {
|
|
972
|
-
row:
|
|
973
|
-
column:
|
|
972
|
+
row: h,
|
|
973
|
+
column: o
|
|
974
974
|
} = l, {
|
|
975
975
|
props: r,
|
|
976
976
|
sourceData: e,
|
|
977
977
|
events: i
|
|
978
978
|
} = a;
|
|
979
979
|
return [createVNode(resolveComponent("el-tree-select"), mergeProps({
|
|
980
|
-
modelValue: o
|
|
981
|
-
"onUpdate:modelValue": (t) => o
|
|
980
|
+
modelValue: h[o.field],
|
|
981
|
+
"onUpdate:modelValue": (t) => h[o.field] = t,
|
|
982
982
|
data: e,
|
|
983
983
|
"check-strictly": !0
|
|
984
984
|
}, r, {
|
|
@@ -990,31 +990,31 @@ const VxetableRender = (VXETable, {
|
|
|
990
990
|
},
|
|
991
991
|
renderTableCell(a, l) {
|
|
992
992
|
const {
|
|
993
|
-
row:
|
|
994
|
-
column:
|
|
993
|
+
row: h,
|
|
994
|
+
column: o
|
|
995
995
|
} = l, {
|
|
996
996
|
sourceData: r,
|
|
997
997
|
props: e = {}
|
|
998
998
|
} = a, {
|
|
999
999
|
children: i = "children",
|
|
1000
1000
|
label: t = "label"
|
|
1001
|
-
} = e, v = findTree(r, (Z) => Z.value === o
|
|
1001
|
+
} = e, v = findTree(r, (Z) => Z.value === h[o.field], {
|
|
1002
1002
|
children: i
|
|
1003
1003
|
});
|
|
1004
1004
|
return v ? [createVNode("span", null, [v.item[t]])] : null;
|
|
1005
1005
|
},
|
|
1006
1006
|
renderItemContent(a, l) {
|
|
1007
1007
|
const {
|
|
1008
|
-
data:
|
|
1009
|
-
field:
|
|
1008
|
+
data: h,
|
|
1009
|
+
field: o
|
|
1010
1010
|
} = l, {
|
|
1011
1011
|
props: r,
|
|
1012
1012
|
sourceData: e,
|
|
1013
1013
|
events: i
|
|
1014
1014
|
} = a;
|
|
1015
1015
|
return [createVNode(resolveComponent("el-tree-select"), mergeProps({
|
|
1016
|
-
modelValue: o
|
|
1017
|
-
"onUpdate:modelValue": (t) => o
|
|
1016
|
+
modelValue: h[o],
|
|
1017
|
+
"onUpdate:modelValue": (t) => h[o] = t,
|
|
1018
1018
|
data: e,
|
|
1019
1019
|
"check-strictly": !0
|
|
1020
1020
|
}, r, {
|
|
@@ -1100,46 +1100,46 @@ const VxetableRender = (VXETable, {
|
|
|
1100
1100
|
e[f] = e[f] || v[f];
|
|
1101
1101
|
})), !e[Z] && e[i] && (e[Z] = t ? (d = e[i]) == null ? void 0 : d.split(",") : e[i]);
|
|
1102
1102
|
}
|
|
1103
|
-
}), onCheckChange = (a, l,
|
|
1104
|
-
console.log(a, l,
|
|
1105
|
-
}, onNodeClick = (a, l,
|
|
1106
|
-
|
|
1107
|
-
}, onCurrentChange = (a, l,
|
|
1108
|
-
|
|
1103
|
+
}), onCheckChange = (a, l, h, o) => {
|
|
1104
|
+
console.log(a, l, h), o != null && o.checkChange && (o == null || o.checkChange(a, l, h));
|
|
1105
|
+
}, onNodeClick = (a, l, h, o) => {
|
|
1106
|
+
o != null && o.checkChange && (o == null || o.checkChange(a, l, h));
|
|
1107
|
+
}, onCurrentChange = (a, l, h) => {
|
|
1108
|
+
h != null && h.checkChange && (h == null || h.checkChange(a, l));
|
|
1109
1109
|
};
|
|
1110
1110
|
function getValue(a, l) {
|
|
1111
|
-
var
|
|
1112
|
-
return !l || !a || !dict ? l : (r = (
|
|
1111
|
+
var h, o, r;
|
|
1112
|
+
return !l || !a || !dict ? l : (r = (o = (h = dict[a]) == null ? void 0 : h.children) == null ? void 0 : o.find((e) => e.dictCode === l)) == null ? void 0 : r.dictName;
|
|
1113
1113
|
}
|
|
1114
1114
|
return VXETable;
|
|
1115
1115
|
}, getCookieParam = () => {
|
|
1116
1116
|
const a = "kCookies_param";
|
|
1117
1117
|
return cookies.get(a) ? JSON.parse(cookies.get(a)) : {};
|
|
1118
1118
|
}, hasClass = (a, l) => {
|
|
1119
|
-
var
|
|
1120
|
-
return !!((
|
|
1121
|
-
}, addClass = (a, l,
|
|
1122
|
-
hasClass(a, l) || (a.className += " " + l),
|
|
1123
|
-
}, removeClass = (a, l,
|
|
1124
|
-
var
|
|
1119
|
+
var h;
|
|
1120
|
+
return !!((h = a.className) != null && h.match(new RegExp("(\\s|^)" + l + "(\\s|$)")));
|
|
1121
|
+
}, addClass = (a, l, h) => {
|
|
1122
|
+
hasClass(a, l) || (a.className += " " + l), h && (hasClass(a, h) || (a.className += " " + h));
|
|
1123
|
+
}, removeClass = (a, l, h) => {
|
|
1124
|
+
var o, r;
|
|
1125
1125
|
if (hasClass(a, l)) {
|
|
1126
1126
|
const e = new RegExp("(\\s|^)" + l + "(\\s|$)");
|
|
1127
|
-
a.className = (
|
|
1127
|
+
a.className = (o = a.className) == null ? void 0 : o.replace(e, " ").trim();
|
|
1128
1128
|
}
|
|
1129
|
-
if (
|
|
1130
|
-
const e = new RegExp("(\\s|^)" +
|
|
1129
|
+
if (h && hasClass(a, h)) {
|
|
1130
|
+
const e = new RegExp("(\\s|^)" + h + "(\\s|$)");
|
|
1131
1131
|
a.className = (r = a.className) == null ? void 0 : r.replace(e, " ").trim();
|
|
1132
1132
|
}
|
|
1133
|
-
}, toggleClass = (a, l,
|
|
1134
|
-
const
|
|
1135
|
-
let { className: r } =
|
|
1136
|
-
r = r == null ? void 0 : r.replace(l, ""),
|
|
1133
|
+
}, toggleClass = (a, l, h) => {
|
|
1134
|
+
const o = h || document.body;
|
|
1135
|
+
let { className: r } = o;
|
|
1136
|
+
r = r == null ? void 0 : r.replace(l, ""), o.className = r && a ? `${r} ${l} ` : r;
|
|
1137
1137
|
};
|
|
1138
1138
|
function useRafThrottle(a) {
|
|
1139
1139
|
let l = !1;
|
|
1140
|
-
return function(...
|
|
1140
|
+
return function(...h) {
|
|
1141
1141
|
l || (l = !0, window.requestAnimationFrame(() => {
|
|
1142
|
-
a.apply(this,
|
|
1142
|
+
a.apply(this, h), l = !1;
|
|
1143
1143
|
}));
|
|
1144
1144
|
};
|
|
1145
1145
|
}
|
|
@@ -1148,9 +1148,9 @@ const openLink = (a) => {
|
|
|
1148
1148
|
l.setAttribute("href", a), l.setAttribute("target", "_blank"), l.setAttribute("rel", "noreferrer noopener"), l.setAttribute("id", "external"), document.getElementById("external") && document.body.removeChild(document.getElementById("external")), document.body.appendChild(l), l.click(), l.remove();
|
|
1149
1149
|
}, isServer = typeof window > "u", resizeHandler = (a) => {
|
|
1150
1150
|
for (const l of a) {
|
|
1151
|
-
const
|
|
1152
|
-
|
|
1153
|
-
|
|
1151
|
+
const h = l.target.__resizeListeners__ || [];
|
|
1152
|
+
h.length && h.forEach((o) => {
|
|
1153
|
+
o();
|
|
1154
1154
|
});
|
|
1155
1155
|
}
|
|
1156
1156
|
}, addResizeListener = (a, l) => {
|
|
@@ -1167,9 +1167,9 @@ function useWatermark(a = ref(document.body)) {
|
|
|
1167
1167
|
if (!Z) return;
|
|
1168
1168
|
const { clientHeight: d, clientWidth: n } = Z;
|
|
1169
1169
|
i({ height: d, width: n });
|
|
1170
|
-
}),
|
|
1171
|
-
const Z = unref(
|
|
1172
|
-
|
|
1170
|
+
}), h = domSymbol.toString(), o = shallowRef(), r = () => {
|
|
1171
|
+
const Z = unref(o);
|
|
1172
|
+
o.value = void 0;
|
|
1173
1173
|
const d = unref(a);
|
|
1174
1174
|
d && (Z && d.removeChild(Z), removeResizeListener(d, l));
|
|
1175
1175
|
};
|
|
@@ -1180,21 +1180,21 @@ function useWatermark(a = ref(document.body)) {
|
|
|
1180
1180
|
return m && (m.rotate(-20 * Math.PI / 120), m.font = (d == null ? void 0 : d.font) ?? "15px Reggae One", m.fillStyle = (d == null ? void 0 : d.fillStyle) ?? "rgba(180, 180, 180, 0.75)", m.textAlign = "left", m.textBaseline = "middle", m.fillText(Z, f / 20, b)), n.toDataURL("image/png");
|
|
1181
1181
|
}
|
|
1182
1182
|
function i(Z = {}) {
|
|
1183
|
-
const d = unref(
|
|
1183
|
+
const d = unref(o);
|
|
1184
1184
|
d && (isUndefined(Z.width) || (d.style.width = `${Z.width}px`), isUndefined(Z.height) || (d.style.height = `${Z.height}px`), isUndefined(Z.str) || (d.style.background = `url(${e(
|
|
1185
1185
|
Z.str,
|
|
1186
1186
|
Z.attr
|
|
1187
1187
|
)}) left top repeat`));
|
|
1188
1188
|
}
|
|
1189
1189
|
const t = (Z, d) => {
|
|
1190
|
-
if (unref(
|
|
1191
|
-
return i({ str: Z, attr: d }),
|
|
1190
|
+
if (unref(o))
|
|
1191
|
+
return i({ str: Z, attr: d }), h;
|
|
1192
1192
|
const n = document.createElement("div");
|
|
1193
|
-
|
|
1193
|
+
o.value = n, n.id = h, n.style.pointerEvents = "none", n.style.top = "0px", n.style.left = "0px", n.style.position = "absolute", n.style.zIndex = "100000";
|
|
1194
1194
|
const f = unref(a);
|
|
1195
|
-
if (!f) return
|
|
1195
|
+
if (!f) return h;
|
|
1196
1196
|
const { clientHeight: b, clientWidth: m } = f;
|
|
1197
|
-
return i({ str: Z, width: m, height: b, attr: d }), f.appendChild(n),
|
|
1197
|
+
return i({ str: Z, width: m, height: b, attr: d }), f.appendChild(n), h;
|
|
1198
1198
|
};
|
|
1199
1199
|
function v(Z, d) {
|
|
1200
1200
|
t(Z, d), addResizeListener(document.documentElement, l), getCurrentInstance() && onBeforeUnmount(() => {
|
|
@@ -1210,9 +1210,9 @@ function entries(a) {
|
|
|
1210
1210
|
function useAttrs(a = {}) {
|
|
1211
1211
|
const l = getCurrentInstance();
|
|
1212
1212
|
if (!l) return {};
|
|
1213
|
-
const { excludeListeners:
|
|
1213
|
+
const { excludeListeners: h = !1, excludeKeys: o = [] } = a, r = shallowRef({}), e = o.concat(DEFAULT_EXCLUDE_KEYS);
|
|
1214
1214
|
return l.attrs = reactive(l.attrs), watchEffect(() => {
|
|
1215
|
-
const i = entries(l.attrs).reduce((t, [v, Z]) => (!e.includes(v) && !(
|
|
1215
|
+
const i = entries(l.attrs).reduce((t, [v, Z]) => (!e.includes(v) && !(h && LISTENER_PREFIX.test(v)) && (t[v] = Z), t), {});
|
|
1216
1216
|
r.value = i;
|
|
1217
1217
|
}), r;
|
|
1218
1218
|
}
|
|
@@ -1236,7 +1236,7 @@ const useRender = () => {
|
|
|
1236
1236
|
defaultValue: L,
|
|
1237
1237
|
events: u
|
|
1238
1238
|
};
|
|
1239
|
-
},
|
|
1239
|
+
}, h = (c, H) => {
|
|
1240
1240
|
const u = w(H);
|
|
1241
1241
|
return {
|
|
1242
1242
|
name: "#SuSelect",
|
|
@@ -1245,7 +1245,7 @@ const useRender = () => {
|
|
|
1245
1245
|
options: (c == null ? void 0 : c.options) || [],
|
|
1246
1246
|
events: u
|
|
1247
1247
|
};
|
|
1248
|
-
},
|
|
1248
|
+
}, o = (c, H) => {
|
|
1249
1249
|
const u = {
|
|
1250
1250
|
optionProps: { extLabel: "userName", value: "employeeName" },
|
|
1251
1251
|
props: {
|
|
@@ -1253,12 +1253,11 @@ const useRender = () => {
|
|
|
1253
1253
|
disabled: c == null ? void 0 : c.disabled,
|
|
1254
1254
|
defaultValue: c == null ? void 0 : c.defaultValue,
|
|
1255
1255
|
mapField: c == null ? void 0 : c.mapField,
|
|
1256
|
-
code: "SYS037",
|
|
1257
1256
|
url: "/uums/employee/listEmployeeIsUser",
|
|
1258
1257
|
fetchField: "employeeName"
|
|
1259
1258
|
}
|
|
1260
1259
|
};
|
|
1261
|
-
return
|
|
1260
|
+
return h(u, H);
|
|
1262
1261
|
}, r = (c) => {
|
|
1263
1262
|
const H = {
|
|
1264
1263
|
optionProps: { extLabel: "userName", value: "name" },
|
|
@@ -1269,7 +1268,7 @@ const useRender = () => {
|
|
|
1269
1268
|
mapField: c == null ? void 0 : c.mapField
|
|
1270
1269
|
}
|
|
1271
1270
|
};
|
|
1272
|
-
return
|
|
1271
|
+
return h(H);
|
|
1273
1272
|
}, e = (c, H) => {
|
|
1274
1273
|
const u = {
|
|
1275
1274
|
label: "organizationName",
|
|
@@ -1277,6 +1276,7 @@ const useRender = () => {
|
|
|
1277
1276
|
}, C = {
|
|
1278
1277
|
mapField: {},
|
|
1279
1278
|
defaultParams: c == null ? void 0 : c.defaultParams,
|
|
1279
|
+
disabled: c == null ? void 0 : c.disabled,
|
|
1280
1280
|
url: "/uums/cusOrganization",
|
|
1281
1281
|
fetchField: "organizationName"
|
|
1282
1282
|
}, L = {
|
|
@@ -1296,6 +1296,7 @@ const useRender = () => {
|
|
|
1296
1296
|
value: (c == null ? void 0 : c.field) || "orgName"
|
|
1297
1297
|
}, C = {
|
|
1298
1298
|
mapField: {},
|
|
1299
|
+
disabled: c == null ? void 0 : c.disabled,
|
|
1299
1300
|
defaultParams: c == null ? void 0 : c.defaultParams,
|
|
1300
1301
|
url: "/uums/org",
|
|
1301
1302
|
fetchField: "orgName"
|
|
@@ -1438,12 +1439,12 @@ const useRender = () => {
|
|
|
1438
1439
|
}
|
|
1439
1440
|
return {
|
|
1440
1441
|
renderDict: l,
|
|
1441
|
-
renderSelect:
|
|
1442
|
+
renderSelect: h,
|
|
1442
1443
|
renderInput: t,
|
|
1443
1444
|
renderTextarea: v,
|
|
1444
1445
|
renderCheckBox: Z,
|
|
1445
1446
|
renderRadio: d,
|
|
1446
|
-
renderUser:
|
|
1447
|
+
renderUser: o,
|
|
1447
1448
|
renderSysUser: r,
|
|
1448
1449
|
renderInvOrg: e,
|
|
1449
1450
|
renderBU: i,
|
|
@@ -1463,11 +1464,11 @@ const useRender = () => {
|
|
|
1463
1464
|
}, useGlobal = () => {
|
|
1464
1465
|
const a = getCurrentInstance();
|
|
1465
1466
|
if (!a) return { $global: {}, $storage: {}, $config: {} };
|
|
1466
|
-
const l = a.appContext.app.config.globalProperties,
|
|
1467
|
+
const l = a.appContext.app.config.globalProperties, h = l.$storage, o = l.$config, r = l.$serviceApi, e = l.$hasAuthority, i = l.$printPlugin, t = l.$mode;
|
|
1467
1468
|
return {
|
|
1468
1469
|
$global: l,
|
|
1469
|
-
$storage:
|
|
1470
|
-
$config:
|
|
1470
|
+
$storage: h,
|
|
1471
|
+
$config: o,
|
|
1471
1472
|
$serviceApi: r,
|
|
1472
1473
|
$hasAuthority: e,
|
|
1473
1474
|
$printPlugin: i,
|
|
@@ -1484,59 +1485,60 @@ function buildUUID() {
|
|
|
1484
1485
|
}
|
|
1485
1486
|
let unique = 0;
|
|
1486
1487
|
function buildShortUUID(a = "") {
|
|
1487
|
-
const l = Date.now(),
|
|
1488
|
-
return unique++, a + "_" +
|
|
1488
|
+
const l = Date.now(), h = Math.floor(Math.random() * 1e9);
|
|
1489
|
+
return unique++, a + "_" + h + unique + String(l);
|
|
1489
1490
|
}
|
|
1490
1491
|
const deviceDetection = () => {
|
|
1491
|
-
const a = navigator.userAgent.toLowerCase(), l = a.match(/iphone os/i) === "iphone os",
|
|
1492
|
-
return l ||
|
|
1492
|
+
const a = navigator.userAgent.toLowerCase(), l = a.match(/iphone os/i) === "iphone os", h = a.match(/midp/i) === "midp", o = a.match(/rv:1.2.3.4/i) === "rv:1.2.3.4", r = a.match(/ucweb/i) === "ucweb", e = a.match(/android/i) === "android", i = a.match(/windows ce/i) === "windows ce", t = a.match(/windows mobile/i) === "windows mobile";
|
|
1493
|
+
return l || h || o || r || e || i || t;
|
|
1493
1494
|
}, getBrowserInfo = () => {
|
|
1494
|
-
const a = navigator.userAgent.toLowerCase(), l = /(msie|firefox|chrome|opera|version).*?([\d.]+)/,
|
|
1495
|
+
const a = navigator.userAgent.toLowerCase(), l = /(msie|firefox|chrome|opera|version).*?([\d.]+)/, h = a.match(l);
|
|
1495
1496
|
return {
|
|
1496
|
-
browser:
|
|
1497
|
-
version:
|
|
1497
|
+
browser: h[1].replace(/version/, "'safari"),
|
|
1498
|
+
version: h[2]
|
|
1498
1499
|
};
|
|
1499
|
-
}, showMessage = (a, l = "message",
|
|
1500
|
-
var
|
|
1501
|
-
return l === "alert" ? (
|
|
1500
|
+
}, showMessage = (a, l = "message", h = {}) => {
|
|
1501
|
+
var o, r;
|
|
1502
|
+
return l === "alert" ? (o = VxeUI.modal) == null ? void 0 : o.alert({ content: a, ...h }) : (r = VxeUI.modal) == null ? void 0 : r.message({ content: a, ...h });
|
|
1502
1503
|
}, successMessage = (a = "操作成功", l = {}) => {
|
|
1503
|
-
var
|
|
1504
|
-
return (
|
|
1504
|
+
var h;
|
|
1505
|
+
return (h = VxeUI.modal) == null ? void 0 : h.message({ content: a, ...l, status: "success" });
|
|
1505
1506
|
}, warnMessage = (a, l = {}) => {
|
|
1506
|
-
var
|
|
1507
|
-
return l.type === "alert" ? (
|
|
1507
|
+
var h, o;
|
|
1508
|
+
return l.type === "alert" ? (h = VxeUI.modal) == null ? void 0 : h.alert({ content: a, ...l, status: "warning" }) : (o = VxeUI.modal) == null ? void 0 : o.message({
|
|
1508
1509
|
content: a,
|
|
1509
1510
|
duration: 5e3,
|
|
1510
1511
|
...l,
|
|
1511
1512
|
status: "warning"
|
|
1512
1513
|
});
|
|
1513
1514
|
}, errorMessage = (a = "操作失败", l = {}) => {
|
|
1514
|
-
var
|
|
1515
|
-
return l.type === "alert" ? (
|
|
1515
|
+
var h, o;
|
|
1516
|
+
return l.type === "alert" ? (h = VxeUI.modal) == null ? void 0 : h.alert({ content: a, ...l, status: "error" }) : (o = VxeUI.modal) == null ? void 0 : o.message({ content: a, ...l, status: "error" });
|
|
1516
1517
|
}, renderHook = useRender(), i18nColums = (a, l = !0) => {
|
|
1517
|
-
let
|
|
1518
|
+
let h = 0, o = 0;
|
|
1518
1519
|
const r = a.length - 1;
|
|
1519
1520
|
return a.map((e, i) => {
|
|
1520
|
-
if (
|
|
1521
|
+
if (o = o + e.width, e.type) return e;
|
|
1521
1522
|
e.title = e.title || `message.${e.field}`;
|
|
1522
1523
|
const { showOverflow: t } = e;
|
|
1523
|
-
return e.field !== "operate" && ((e.width > 99 || e.minWidth) && (e.showOverflow = t === !1 ? t : "tooltip"), e.sortable = !(l === !1 || e.sortable === !1)),
|
|
1524
|
+
return e.field !== "operate" && ((e.width > 99 || e.minWidth) && (e.showOverflow = t === !1 ? t : "tooltip"), e.sortable = !(l === !1 || e.sortable === !1)), h || (h = e.minWidth), !h && r === i && o < window.innerWidth && (e.minWidth = e.width, e.width = null), e;
|
|
1524
1525
|
});
|
|
1525
|
-
}, formatItems = (a, l, o = 24) => a.length ? a.map((
|
|
1526
|
-
var
|
|
1527
|
-
if ((
|
|
1528
|
-
return
|
|
1526
|
+
}, formatItems = (a, l, h, o = 24) => a.length ? a.map((r) => {
|
|
1527
|
+
var e, i, t;
|
|
1528
|
+
if ((e = r.children) != null && e.length)
|
|
1529
|
+
return r.children = formatItems(r.children, l, h, o), r;
|
|
1529
1530
|
{
|
|
1530
|
-
|
|
1531
|
-
let
|
|
1532
|
-
l === "detail" ? (
|
|
1533
|
-
let
|
|
1531
|
+
r.title = r.title || `message.${r.field}`, r.span = r.span || o, r.type === "collapseNode" && (r.title = "", r.titleWidth = 0);
|
|
1532
|
+
let v = !1, Z = h("message.udp.placeholder") + h(r.title);
|
|
1533
|
+
l === "detail" ? (v = !0, Z = null) : v = r.disabled === !1 ? r.disabled : r.disabled || ((t = (i = r.itemRender) == null ? void 0 : i.props) == null ? void 0 : t.disabled);
|
|
1534
|
+
let d = {
|
|
1534
1535
|
name: "VxeInput",
|
|
1535
|
-
props: { disabled:
|
|
1536
|
+
props: { disabled: v, placeholder: v ? "" : Z }
|
|
1536
1537
|
};
|
|
1537
|
-
return
|
|
1538
|
-
disabled:
|
|
1539
|
-
|
|
1538
|
+
return r.code && !r.itemRender && (d = renderHook.renderDict(r.code)), r.itemRender = r.itemRender || d, r.itemRender.props = Object.assign(r.itemRender.props || {}, {
|
|
1539
|
+
disabled: v,
|
|
1540
|
+
placeholder: v ? "" : Z
|
|
1541
|
+
}), r;
|
|
1540
1542
|
}
|
|
1541
1543
|
}) : a, formSearchButtons = {
|
|
1542
1544
|
span: 6,
|
|
@@ -1563,11 +1565,11 @@ const deviceDetection = () => {
|
|
|
1563
1565
|
events: null
|
|
1564
1566
|
}
|
|
1565
1567
|
}, formatGridItems = (a, l) => {
|
|
1566
|
-
const
|
|
1568
|
+
const h = a, o = h.length, r = o > 2 && h.some((Z, d) => d < 3 && (Z.span > 6 || getDateRange(Z))), e = r || o > 3, i = {
|
|
1567
1569
|
collapseTags: !0,
|
|
1568
1570
|
collapseTagsTooltip: !0,
|
|
1569
1571
|
multiple: !0
|
|
1570
|
-
}, t =
|
|
1572
|
+
}, t = h.map((Z, d) => {
|
|
1571
1573
|
var n, f, b;
|
|
1572
1574
|
return Z.folding = r ? e && d > 1 : e && d > 2, Z.span = getDateRange(Z) ? 12 : Z.span || 6, Z.code && !Z.itemRender && (Z.itemRender = renderHook.renderDict(Z.code)), Z.itemRender = Z.itemRender || { name: "VxeInput" }, Z.resetValue = Z.itemRender.defaultValue, Z.title = Z.title || `message.${Z.field}`, (Z.multiple || (f = (n = Z.itemRender) == null ? void 0 : n.props) != null && f.multiple) && (Z.itemRender.props = Object.assign(
|
|
1573
1575
|
i,
|
|
@@ -1581,25 +1583,25 @@ const deviceDetection = () => {
|
|
|
1581
1583
|
t.push(v);
|
|
1582
1584
|
return t;
|
|
1583
1585
|
}, getDateRange = (a) => {
|
|
1584
|
-
var l,
|
|
1585
|
-
return ((l = a.itemRender) == null ? void 0 : l.name) === "#SuDateRange" ? ((
|
|
1586
|
+
var l, h, o, r, e;
|
|
1587
|
+
return ((l = a.itemRender) == null ? void 0 : l.name) === "#SuDateRange" ? ((o = (h = a.itemRender) == null ? void 0 : h.props) == null ? void 0 : o.type) === "daterange" || !((e = (r = a.itemRender) == null ? void 0 : r.props) != null && e.type) : !1;
|
|
1586
1588
|
}, formatRules = (a, l) => {
|
|
1587
|
-
const
|
|
1588
|
-
return a.forEach((
|
|
1589
|
+
const h = {};
|
|
1590
|
+
return a.forEach((o) => {
|
|
1589
1591
|
var r;
|
|
1590
|
-
if ((r =
|
|
1591
|
-
const e = formatRules(
|
|
1592
|
-
merge(
|
|
1593
|
-
} else if (
|
|
1594
|
-
const { field: e, title: i } =
|
|
1595
|
-
|
|
1592
|
+
if ((r = o.children) != null && r.length) {
|
|
1593
|
+
const e = formatRules(o.children, l);
|
|
1594
|
+
merge(h, e);
|
|
1595
|
+
} else if (o.required) {
|
|
1596
|
+
const { field: e, title: i } = o, t = i == null ? void 0 : i.startsWith("message.");
|
|
1597
|
+
h[e] = [
|
|
1596
1598
|
{
|
|
1597
1599
|
required: !0,
|
|
1598
1600
|
message: `${l("message.required")}${i && t ? l(i) : i || l(`message.${e}`)}`
|
|
1599
1601
|
}
|
|
1600
1602
|
];
|
|
1601
1603
|
}
|
|
1602
|
-
}),
|
|
1604
|
+
}), h;
|
|
1603
1605
|
}, expandedPaths = [];
|
|
1604
1606
|
function extractPathList(a) {
|
|
1605
1607
|
if (!Array.isArray(a)) {
|
|
@@ -1618,8 +1620,8 @@ function deleteTreeChildren(a, l = []) {
|
|
|
1618
1620
|
return;
|
|
1619
1621
|
}
|
|
1620
1622
|
if (!(!a || a.length === 0)) {
|
|
1621
|
-
for (const [
|
|
1622
|
-
|
|
1623
|
+
for (const [h, o] of a.entries())
|
|
1624
|
+
o.children && o.children.length === 1 && delete o.children, o.id = h, o.parentId = l.length ? l[l.length - 1] : null, o.pathList = [...l, o.id], o.uniqueId = o.pathList.length > 1 ? o.pathList.join("-") : o.pathList[0], o.children && o.children.length > 0 && deleteTreeChildren(o.children, o.pathList);
|
|
1623
1625
|
return a;
|
|
1624
1626
|
}
|
|
1625
1627
|
}
|
|
@@ -1629,8 +1631,8 @@ function buildHierarchyTree(a, l = []) {
|
|
|
1629
1631
|
return;
|
|
1630
1632
|
}
|
|
1631
1633
|
if (!(!a || a.length === 0)) {
|
|
1632
|
-
for (const [
|
|
1633
|
-
|
|
1634
|
+
for (const [h, o] of a.entries())
|
|
1635
|
+
o.id = h, o.parentId = l.length ? l[l.length - 1] : null, o.pathList = [...l, o.id], o.children && o.children.length > 0 && buildHierarchyTree(o.children, o.pathList);
|
|
1634
1636
|
return a;
|
|
1635
1637
|
}
|
|
1636
1638
|
}
|
|
@@ -1640,20 +1642,20 @@ function getNodeByUniqueId(a, l) {
|
|
|
1640
1642
|
return;
|
|
1641
1643
|
}
|
|
1642
1644
|
if (!a || a.length === 0) return;
|
|
1643
|
-
const
|
|
1644
|
-
if (
|
|
1645
|
-
const
|
|
1646
|
-
return getNodeByUniqueId(
|
|
1645
|
+
const h = a.find((r) => r.uniqueId === l);
|
|
1646
|
+
if (h) return h;
|
|
1647
|
+
const o = a.filter((r) => r.children).map((r) => r.children).flat(1);
|
|
1648
|
+
return getNodeByUniqueId(o, l);
|
|
1647
1649
|
}
|
|
1648
|
-
function appendFieldByUniqueId(a, l,
|
|
1650
|
+
function appendFieldByUniqueId(a, l, h) {
|
|
1649
1651
|
if (!Array.isArray(a)) {
|
|
1650
1652
|
console.warn("menuTree must be an array");
|
|
1651
1653
|
return;
|
|
1652
1654
|
}
|
|
1653
1655
|
if (!a || a.length === 0) return {};
|
|
1654
|
-
for (const
|
|
1655
|
-
const r =
|
|
1656
|
-
|
|
1656
|
+
for (const o of a) {
|
|
1657
|
+
const r = o.children && o.children.length > 0;
|
|
1658
|
+
o.uniqueId === l && Object.prototype.toString.call(h) === "[object Object]" && Object.assign(o, h), r && appendFieldByUniqueId(o.children, l, h);
|
|
1657
1659
|
}
|
|
1658
1660
|
return a;
|
|
1659
1661
|
}
|
|
@@ -1702,16 +1704,16 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1702
1704
|
}
|
|
1703
1705
|
/** 重连原始请求 */
|
|
1704
1706
|
static retryOriginalRequest(l) {
|
|
1705
|
-
return new Promise((
|
|
1706
|
-
g.requests.push((
|
|
1707
|
-
l.headers.Authorization = "Bearer " +
|
|
1707
|
+
return new Promise((h) => {
|
|
1708
|
+
g.requests.push((o) => {
|
|
1709
|
+
l.headers.Authorization = "Bearer " + o, h(l);
|
|
1708
1710
|
});
|
|
1709
1711
|
});
|
|
1710
1712
|
}
|
|
1711
1713
|
// 请求拦截
|
|
1712
1714
|
httpInterceptorsRequest() {
|
|
1713
1715
|
g.axiosInstance.interceptors.request.use(
|
|
1714
|
-
(l) => (has(l, "loading") && isRef(l.loading) && (l.loading.value = !0), NProgress.start(), typeof l.beforeRequestCallback == "function" ? (l.beforeRequestCallback(l), l) : g.initConfig.beforeRequestCallback ? (g.initConfig.beforeRequestCallback(l), l) : ["/refreshToken", "/login"].some((
|
|
1716
|
+
(l) => (has(l, "loading") && isRef(l.loading) && (l.loading.value = !0), NProgress.start(), typeof l.beforeRequestCallback == "function" ? (l.beforeRequestCallback(l), l) : g.initConfig.beforeRequestCallback ? (g.initConfig.beforeRequestCallback(l), l) : ["/refreshToken", "/login"].some((o) => l.url.indexOf(o) > -1) ? l : new Promise((o) => {
|
|
1715
1717
|
const r = cookies.get(kTOKENKEY);
|
|
1716
1718
|
if (r) {
|
|
1717
1719
|
const e = JSON.parse(r), i = (/* @__PURE__ */ new Date()).getTime();
|
|
@@ -1723,20 +1725,20 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1723
1725
|
this.routeToLogin();
|
|
1724
1726
|
}).finally(() => {
|
|
1725
1727
|
g.isRefreshing = !1;
|
|
1726
|
-
})),
|
|
1728
|
+
})), o(g.retryOriginalRequest(l))) : (l.headers.Authorization = "Bearer " + e.accessToken, o(l));
|
|
1727
1729
|
} else {
|
|
1728
1730
|
const e = cookies.get("kCookies_token");
|
|
1729
|
-
e && (l.headers["X-Token"] = e),
|
|
1731
|
+
e && (l.headers["X-Token"] = e), o(l);
|
|
1730
1732
|
}
|
|
1731
1733
|
})),
|
|
1732
1734
|
(l) => Promise.reject(l)
|
|
1733
1735
|
);
|
|
1734
1736
|
}
|
|
1735
1737
|
setToken(l) {
|
|
1736
|
-
const { access_token:
|
|
1737
|
-
accessToken:
|
|
1738
|
+
const { access_token: h, expires_in: o, refresh_token: r } = l, e = {
|
|
1739
|
+
accessToken: h,
|
|
1738
1740
|
refreshToken: r,
|
|
1739
|
-
expires: Date.now() +
|
|
1741
|
+
expires: Date.now() + o * 1e3
|
|
1740
1742
|
};
|
|
1741
1743
|
cookies.set(kTOKENKEY, JSON.stringify(e));
|
|
1742
1744
|
}
|
|
@@ -1746,29 +1748,29 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1746
1748
|
// 响应拦截
|
|
1747
1749
|
httpInterceptorsResponse() {
|
|
1748
1750
|
g.axiosInstance.interceptors.response.use(
|
|
1749
|
-
(
|
|
1750
|
-
const
|
|
1751
|
-
return has(
|
|
1751
|
+
(h) => {
|
|
1752
|
+
const o = h.config;
|
|
1753
|
+
return has(o, "loading") && isRef(o.loading) && (o.loading.value = !1), NProgress.done(), typeof o.beforeResponseCallback == "function" ? (o.beforeResponseCallback(h), h.data) : (g.initConfig.beforeResponseCallback && g.initConfig.beforeResponseCallback(h), h.data);
|
|
1752
1754
|
},
|
|
1753
|
-
(
|
|
1755
|
+
(h) => {
|
|
1754
1756
|
var r;
|
|
1755
|
-
const
|
|
1756
|
-
return has(
|
|
1757
|
+
const o = h;
|
|
1758
|
+
return has(h.config, "loading") && isRef((r = h == null ? void 0 : h.config) == null ? void 0 : r.loading) && (h.config.loading.value = !1), o.isCancelRequest = Axios.isCancel(o), NProgress.done(), Promise.reject(o);
|
|
1757
1759
|
}
|
|
1758
1760
|
);
|
|
1759
1761
|
}
|
|
1760
|
-
transformConfigByMethod(l,
|
|
1761
|
-
const { method:
|
|
1762
|
+
transformConfigByMethod(l, h) {
|
|
1763
|
+
const { method: o } = h, r = ["get"], e = o.toLocaleLowerCase(), i = r.includes(e) ? "params" : "data";
|
|
1762
1764
|
return {
|
|
1763
|
-
...
|
|
1765
|
+
...h,
|
|
1764
1766
|
[i]: l
|
|
1765
1767
|
};
|
|
1766
1768
|
}
|
|
1767
1769
|
// 通用请求工具函数
|
|
1768
|
-
request(l,
|
|
1769
|
-
const e = this.transformConfigByMethod(
|
|
1770
|
+
request(l, h, o, r) {
|
|
1771
|
+
const e = this.transformConfigByMethod(o, {
|
|
1770
1772
|
method: l,
|
|
1771
|
-
url:
|
|
1773
|
+
url: h,
|
|
1772
1774
|
...r
|
|
1773
1775
|
});
|
|
1774
1776
|
return new Promise((i, t) => {
|
|
@@ -1798,22 +1800,22 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1798
1800
|
});
|
|
1799
1801
|
}
|
|
1800
1802
|
// 单独抽离的post工具函数
|
|
1801
|
-
post(l,
|
|
1802
|
-
return this.request("post", l,
|
|
1803
|
+
post(l, h, o) {
|
|
1804
|
+
return this.request("post", l, h, o);
|
|
1803
1805
|
}
|
|
1804
1806
|
// 单独抽离的delete工具函数
|
|
1805
|
-
delete(l,
|
|
1806
|
-
return this.request("delete", l,
|
|
1807
|
+
delete(l, h, o) {
|
|
1808
|
+
return this.request("delete", l, h, o);
|
|
1807
1809
|
}
|
|
1808
1810
|
// 单独抽离的put工具函数
|
|
1809
|
-
put(l,
|
|
1810
|
-
return this.request("put", l,
|
|
1811
|
+
put(l, h, o) {
|
|
1812
|
+
return this.request("put", l, h, o);
|
|
1811
1813
|
}
|
|
1812
1814
|
// 单独抽离的get工具函数
|
|
1813
|
-
get(l,
|
|
1814
|
-
for (const r in
|
|
1815
|
-
|
|
1816
|
-
return this.request("get", l,
|
|
1815
|
+
get(l, h, o) {
|
|
1816
|
+
for (const r in h)
|
|
1817
|
+
h[r] || delete h[r];
|
|
1818
|
+
return this.request("get", l, h, o);
|
|
1817
1819
|
}
|
|
1818
1820
|
postRouter(l) {
|
|
1819
1821
|
return this.request("post", "route/service", l);
|
|
@@ -2477,10 +2479,10 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2477
2479
|
* @eg:var count = calendar.lYearDays(1987) ;//count=387
|
|
2478
2480
|
*/
|
|
2479
2481
|
lYearDays: function(a) {
|
|
2480
|
-
let l,
|
|
2482
|
+
let l, h = 348;
|
|
2481
2483
|
for (l = 32768; l > 8; l >>= 1)
|
|
2482
|
-
|
|
2483
|
-
return
|
|
2484
|
+
h += this.lunarInfo[a - 1900] & l ? 1 : 0;
|
|
2485
|
+
return h + this.leapDays(a);
|
|
2484
2486
|
},
|
|
2485
2487
|
/**
|
|
2486
2488
|
* 返回农历y年闰月是哪个月;若y年没有闰月 则返回0
|
|
@@ -2520,8 +2522,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2520
2522
|
solarDays: function(a, l) {
|
|
2521
2523
|
if (l > 12 || l < 1)
|
|
2522
2524
|
return -1;
|
|
2523
|
-
const
|
|
2524
|
-
return
|
|
2525
|
+
const h = l - 1;
|
|
2526
|
+
return h === 1 ? a % 4 === 0 && a % 100 !== 0 || a % 400 === 0 ? 29 : 28 : this.solarMonth[h];
|
|
2525
2527
|
},
|
|
2526
2528
|
/**
|
|
2527
2529
|
* 农历年份转换为干支纪年
|
|
@@ -2529,8 +2531,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2529
2531
|
* @return Cn string
|
|
2530
2532
|
*/
|
|
2531
2533
|
toGanZhiYear: function(a) {
|
|
2532
|
-
let l = (a - 3) % 10,
|
|
2533
|
-
return l === 0 && (l = 10),
|
|
2534
|
+
let l = (a - 3) % 10, h = (a - 3) % 12;
|
|
2535
|
+
return l === 0 && (l = 10), h === 0 && (h = 12), this.Gan[l - 1] + this.Zhi[h - 1];
|
|
2534
2536
|
},
|
|
2535
2537
|
/**
|
|
2536
2538
|
* 公历月、日判断所属星座
|
|
@@ -2539,8 +2541,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2539
2541
|
* @return Cn string
|
|
2540
2542
|
*/
|
|
2541
2543
|
toAstro: function(a, l) {
|
|
2542
|
-
const
|
|
2543
|
-
return
|
|
2544
|
+
const h = "摩羯水瓶双鱼白羊金牛双子巨蟹狮子处女天秤天蝎射手摩羯", o = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22];
|
|
2545
|
+
return h.substr(a * 2 - (l < o[a - 1] ? 2 : 0), 2) + "座";
|
|
2544
2546
|
},
|
|
2545
2547
|
/**
|
|
2546
2548
|
* 传入offset偏移量返回干支
|
|
@@ -2560,12 +2562,12 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2560
2562
|
getTerm: function(a, l) {
|
|
2561
2563
|
if (a < 1900 || a > 2100 || l < 1 || l > 24)
|
|
2562
2564
|
return -1;
|
|
2563
|
-
const
|
|
2564
|
-
for (let r = 0; r <
|
|
2565
|
-
const e = parseInt("0x" +
|
|
2566
|
-
|
|
2565
|
+
const h = this.sTermInfo[a - 1900], o = [];
|
|
2566
|
+
for (let r = 0; r < h.length; r += 5) {
|
|
2567
|
+
const e = parseInt("0x" + h.substr(r, 5)).toString();
|
|
2568
|
+
o.push(e[0], e.substr(1, 2), e[3], e.substr(4, 2));
|
|
2567
2569
|
}
|
|
2568
|
-
return parseInt(
|
|
2570
|
+
return parseInt(o[l - 1]);
|
|
2569
2571
|
},
|
|
2570
2572
|
/**
|
|
2571
2573
|
* 传入农历数字月份返回汉语通俗表示法
|
|
@@ -2620,21 +2622,21 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2620
2622
|
* @return JSON object
|
|
2621
2623
|
* @eg:console.log(calendar.solar2lunar(1987,11,01));
|
|
2622
2624
|
*/
|
|
2623
|
-
solar2lunar: function(a, l,
|
|
2624
|
-
let
|
|
2625
|
-
if (
|
|
2625
|
+
solar2lunar: function(a, l, h) {
|
|
2626
|
+
let o = parseInt(a), r = parseInt(l), e = parseInt(h);
|
|
2627
|
+
if (o < 1900 || o > 2100 || o === 1900 && r === 1 && e < 31)
|
|
2626
2628
|
return -1;
|
|
2627
2629
|
let i;
|
|
2628
|
-
|
|
2630
|
+
o ? i = new Date(o, parseInt(r.toString()) - 1, e) : i = /* @__PURE__ */ new Date();
|
|
2629
2631
|
let t, v = 0, Z = 0;
|
|
2630
|
-
|
|
2632
|
+
o = i.getFullYear(), r = i.getMonth() + 1, e = i.getDate();
|
|
2631
2633
|
let d = (Date.UTC(i.getFullYear(), i.getMonth(), i.getDate()) - Date.UTC(1900, 0, 31)) / 864e5;
|
|
2632
2634
|
for (t = 1900; t < 2101 && d > 0; t++)
|
|
2633
2635
|
Z = this.lYearDays(t), d -= Z;
|
|
2634
2636
|
d < 0 && (d += Z, t--);
|
|
2635
2637
|
const n = /* @__PURE__ */ new Date();
|
|
2636
2638
|
let f = !1;
|
|
2637
|
-
n.getFullYear() ===
|
|
2639
|
+
n.getFullYear() === o && n.getMonth() + 1 === r && n.getDate() === e && (f = !0);
|
|
2638
2640
|
let b = i.getDay();
|
|
2639
2641
|
const m = this.nStr1[b];
|
|
2640
2642
|
b === 0 && (b = 7);
|
|
@@ -2644,12 +2646,12 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2644
2646
|
for (t = 1; t < 13 && d > 0; t++)
|
|
2645
2647
|
v > 0 && t === v + 1 && M === !1 ? (--t, M = !0, Z = this.leapDays(s)) : Z = this.monthDays(s, t), M === !0 && t === v + 1 && (M = !1), d -= Z;
|
|
2646
2648
|
d === 0 && v > 0 && t === v + 1 && (M ? M = !1 : (M = !0, --t)), d < 0 && (d += Z, --t);
|
|
2647
|
-
const p = t, y = d + 1, A = r - 1, k = this.toGanZhiYear(s), V = this.getTerm(
|
|
2648
|
-
let w = this.toGanZhi((
|
|
2649
|
-
e >= V && (w = this.toGanZhi((
|
|
2649
|
+
const p = t, y = d + 1, A = r - 1, k = this.toGanZhiYear(s), V = this.getTerm(o, r * 2 - 1), E = this.getTerm(o, r * 2);
|
|
2650
|
+
let w = this.toGanZhi((o - 1900) * 12 + r + 11);
|
|
2651
|
+
e >= V && (w = this.toGanZhi((o - 1900) * 12 + r + 12));
|
|
2650
2652
|
let T = !1, F;
|
|
2651
2653
|
V === e && (T = !0, F = this.solarTerm[r * 2 - 2]), E === e && (T = !0, F = this.solarTerm[r * 2 - 1]);
|
|
2652
|
-
const c = Date.UTC(
|
|
2654
|
+
const c = Date.UTC(o, A, 1, 0, 0, 0, 0) / 864e5 + 25567 + 10, H = this.toGanZhi(c + e - 1), u = this.toAstro(r, e), C = o + "-" + r + "-" + e, L = s + "-" + p + "-" + y, S = this.festival, I = this.lFestival, D = r + "-" + e;
|
|
2653
2655
|
let N = p + "-" + y;
|
|
2654
2656
|
return p === 12 && y === 29 && this.monthDays(s, p) === 29 && (N = "12-30"), {
|
|
2655
2657
|
date: C,
|
|
@@ -2662,7 +2664,7 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2662
2664
|
Animal: this.getAnimal(s),
|
|
2663
2665
|
IMonthCn: (M ? "闰" : "") + this.toChinaMonth(p),
|
|
2664
2666
|
IDayCn: this.toChinaDay(y),
|
|
2665
|
-
cYear:
|
|
2667
|
+
cYear: o,
|
|
2666
2668
|
cMonth: r,
|
|
2667
2669
|
cDay: e,
|
|
2668
2670
|
gzYear: k,
|
|
@@ -2687,14 +2689,14 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2687
2689
|
* @return JSON object
|
|
2688
2690
|
* @eg:console.log(calendar.lunar2solar(1987,9,10));
|
|
2689
2691
|
*/
|
|
2690
|
-
lunar2solar: function(a, l,
|
|
2691
|
-
a = parseInt(a), l = parseInt(l),
|
|
2692
|
+
lunar2solar: function(a, l, h, o) {
|
|
2693
|
+
a = parseInt(a), l = parseInt(l), h = parseInt(h), o = !!o;
|
|
2692
2694
|
const r = this.leapMonth(a);
|
|
2693
|
-
if (
|
|
2695
|
+
if (o && r !== l || a === 2100 && l === 12 && h > 1 || a === 1900 && l === 1 && h < 31)
|
|
2694
2696
|
return -1;
|
|
2695
2697
|
const e = this.monthDays(a, l);
|
|
2696
2698
|
let i = e;
|
|
2697
|
-
if (
|
|
2699
|
+
if (o && (i = this.leapDays(a)), a < 1900 || a > 2100 || h > i)
|
|
2698
2700
|
return -1;
|
|
2699
2701
|
let t = 0, v;
|
|
2700
2702
|
for (v = 1900; v < a; v++)
|
|
@@ -2702,8 +2704,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2702
2704
|
let Z = 0, d = !1;
|
|
2703
2705
|
for (v = 1; v < l; v++)
|
|
2704
2706
|
Z = this.leapMonth(a), d || Z <= v && Z > 0 && (t += this.leapDays(a), d = !0), t += this.monthDays(a, v);
|
|
2705
|
-
|
|
2706
|
-
const n = Date.UTC(1900, 1, 30, 0, 0, 0), f = new Date((t +
|
|
2707
|
+
o && (t += e);
|
|
2708
|
+
const n = Date.UTC(1900, 1, 30, 0, 0, 0), f = new Date((t + h - 31) * 864e5 + n), b = f.getUTCFullYear(), m = f.getUTCMonth() + 1, s = f.getUTCDate();
|
|
2707
2709
|
return this.solar2lunar(b, m, s);
|
|
2708
2710
|
}
|
|
2709
2711
|
}, dict = storageLocal.getItem("kLov"), formats = {
|
|
@@ -2743,8 +2745,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2743
2745
|
tableCellFormatMethod({ cellValue: a }, l) {
|
|
2744
2746
|
var r, e;
|
|
2745
2747
|
if (!l) return a;
|
|
2746
|
-
const
|
|
2747
|
-
return (
|
|
2748
|
+
const h = XEUtils.toValueString(a), o = dict ? (e = (r = dict[l]) == null ? void 0 : r.children) == null ? void 0 : e.find((i) => i.dictCode === h) : a;
|
|
2749
|
+
return (o == null ? void 0 : o.dictName) || a;
|
|
2748
2750
|
}
|
|
2749
2751
|
},
|
|
2750
2752
|
formatRelateField: {
|
|
@@ -2756,22 +2758,22 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2756
2758
|
formatContact: {
|
|
2757
2759
|
// 字段拼接展示
|
|
2758
2760
|
tableCellFormatMethod({ row: a }, l) {
|
|
2759
|
-
return l.reduce((
|
|
2761
|
+
return l.reduce((h, o) => a[o] ? h ? h += a[o] : a[o] : h, "");
|
|
2760
2762
|
}
|
|
2761
2763
|
},
|
|
2762
2764
|
formatSelectLocal: {
|
|
2763
2765
|
tableCellFormatMethod({ cellValue: a }, l) {
|
|
2764
|
-
const [
|
|
2766
|
+
const [h, o = "value", r = "label"] = l, e = h == null ? void 0 : h.find((i) => i[o] === a);
|
|
2765
2767
|
return e ? e[r] : a;
|
|
2766
2768
|
}
|
|
2767
2769
|
},
|
|
2768
2770
|
formatMultiValue: {
|
|
2769
2771
|
tableCellFormatMethod({ row: a }, l) {
|
|
2770
2772
|
var e;
|
|
2771
|
-
const [
|
|
2773
|
+
const [h, o] = l;
|
|
2772
2774
|
let r;
|
|
2773
|
-
return (e = a[
|
|
2774
|
-
const t =
|
|
2775
|
+
return (e = a[h]) == null || e.split(",").forEach((i) => {
|
|
2776
|
+
const t = o.find((v) => v.value === i);
|
|
2775
2777
|
r = r ? `${r},${t == null ? void 0 : t.label}` : t == null ? void 0 : t.label;
|
|
2776
2778
|
}), r;
|
|
2777
2779
|
}
|
|
@@ -10399,29 +10401,29 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
10399
10401
|
height: 24
|
|
10400
10402
|
}, withInstall = (a) => {
|
|
10401
10403
|
const l = a;
|
|
10402
|
-
return l.install = (
|
|
10403
|
-
|
|
10404
|
+
return l.install = (h) => {
|
|
10405
|
+
h.component(l.name || l.__name, a);
|
|
10404
10406
|
}, a;
|
|
10405
10407
|
};
|
|
10406
10408
|
function sleep(a = 64) {
|
|
10407
10409
|
return new Promise((l) => {
|
|
10408
|
-
const
|
|
10409
|
-
window.clearTimeout(
|
|
10410
|
+
const h = setTimeout(() => {
|
|
10411
|
+
window.clearTimeout(h), l(a);
|
|
10410
10412
|
}, a);
|
|
10411
10413
|
});
|
|
10412
10414
|
}
|
|
10413
10415
|
const delay = (a) => new Promise((l) => setTimeout(l, a)), useDark = () => ({ isDark: ref(document.documentElement.classList.contains("dark")) }), useDebounce = (a, l) => {
|
|
10414
|
-
let
|
|
10416
|
+
let h;
|
|
10415
10417
|
return () => {
|
|
10416
|
-
|
|
10418
|
+
h && clearTimeout(h), h = setTimeout(a, l);
|
|
10417
10419
|
};
|
|
10418
10420
|
};
|
|
10419
10421
|
function isUrl(a) {
|
|
10420
10422
|
return /(((^http(s)?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/.test(a);
|
|
10421
10423
|
}
|
|
10422
10424
|
const getDictName = (a, l) => {
|
|
10423
|
-
var
|
|
10424
|
-
return !a || !l ? null : (r = (
|
|
10425
|
+
var o, r;
|
|
10426
|
+
return !a || !l ? null : (r = (o = storageLocal.getItem("kLov")[a]) == null ? void 0 : o.children.find((e) => l === e.dictCode)) == null ? void 0 : r.dictName;
|
|
10425
10427
|
};
|
|
10426
10428
|
export {
|
|
10427
10429
|
G as NProgress,
|