@utogether/utils 3.0.0-beta.35 → 3.0.0-beta.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pkg/formatData.d.ts +1 -1
- package/dist/utils.es.js +498 -455
- 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, o) => l in a ? j(a, l, { enumerable: !0, configurable: !0, writable: !0, value: o }) : a[l] = o;
|
|
3
|
+
var x = (a, l, o) => U(a, typeof l != "symbol" ? l + "" : l, o);
|
|
4
4
|
import { createVNode, resolveComponent, mergeProps, isVNode, ref, shallowRef, unref, getCurrentInstance, onBeforeUnmount, reactive, watchEffect, isRef } from "vue";
|
|
5
5
|
import dayjs from "dayjs";
|
|
6
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, o) {
|
|
24
|
+
this.storage.setItem && this.storage.setItem(this.getKey(l), JSON.stringify(o || 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, o) {
|
|
57
|
+
this.storage.setItem(l, o);
|
|
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, o]) => o != null && o !== !1).map(([l, o]) => o === !0 ? `; ${l}` : `; ${l}=${o.split(";")[0]}`).join("");
|
|
77
77
|
}
|
|
78
|
-
function get(a, l,
|
|
79
|
-
const
|
|
78
|
+
function get(a, l, o) {
|
|
79
|
+
const h = /(?:^|; )([^=]*)=([^;]*)/g, r = {};
|
|
80
80
|
let e;
|
|
81
|
-
for (; (e =
|
|
81
|
+
for (; (e = h.exec(document.cookie)) != null; )
|
|
82
82
|
try {
|
|
83
|
-
const i =
|
|
83
|
+
const i = o(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, o = DEFAULT_ATTRIBUTES, { encodeValue: h = encodeValue, encodeName: r = encodeName } = {}) {
|
|
99
|
+
return document.cookie = `${r(a)}=${h(l, a)}${stringifyAttributes(o)}`;
|
|
100
100
|
}
|
|
101
|
-
function getCookie(a, { decodeValue: l = decodeValue, decodeName:
|
|
102
|
-
return get(a, l,
|
|
101
|
+
function getCookie(a, { decodeValue: l = decodeValue, decodeName: o = decodeName } = {}) {
|
|
102
|
+
return get(a, l, o);
|
|
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 o = {
|
|
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
|
+
}, h = {
|
|
135
135
|
attributes: { value: Object.freeze(l) },
|
|
136
136
|
converter: { value: Object.freeze(a) }
|
|
137
137
|
};
|
|
138
|
-
return Object.create(
|
|
138
|
+
return Object.create(o, h);
|
|
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", o = "") {
|
|
155
|
+
setCookie(`${this.getKey(l)}`, o);
|
|
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 o;
|
|
195
195
|
const {
|
|
196
|
-
row:
|
|
196
|
+
row: h,
|
|
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, h, 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, h, 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(h, 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: h[s],
|
|
232
|
+
"onUpdate:modelValue": (V) => h[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(o = 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))) ? o : {
|
|
250
|
+
default: () => [o]
|
|
251
251
|
})];
|
|
252
252
|
},
|
|
253
253
|
renderTableDefault(a, l) {
|
|
254
|
-
let
|
|
254
|
+
let o;
|
|
255
255
|
const {
|
|
256
|
-
row:
|
|
256
|
+
row: h,
|
|
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, h, 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, h, 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(h, 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: h[s],
|
|
292
|
+
"onUpdate:modelValue": (V) => h[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(o = 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))) ? o : {
|
|
310
|
+
default: () => [o]
|
|
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 o;
|
|
329
329
|
const {
|
|
330
|
-
data:
|
|
330
|
+
data: h,
|
|
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, h, 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, h, 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(h, 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: h[s],
|
|
365
|
+
"onUpdate:modelValue": (V) => h[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(o = 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))) ? o : {
|
|
383
|
+
default: () => [o]
|
|
384
384
|
})];
|
|
385
385
|
}
|
|
386
386
|
}), VXETable.renderer.add("#SuDateRange", {
|
|
387
387
|
renderItemContent(a, l) {
|
|
388
388
|
const {
|
|
389
|
-
data:
|
|
390
|
-
field:
|
|
389
|
+
data: o,
|
|
390
|
+
field: h
|
|
391
391
|
} = l, {
|
|
392
392
|
props: r
|
|
393
393
|
} = a;
|
|
394
|
-
r != null && r.defaultValue && !h
|
|
394
|
+
r != null && r.defaultValue && !o[h] && (o[h] = 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: h
|
|
419
|
-
"onUpdate:modelValue": (v) => h
|
|
418
|
+
modelValue: o[h],
|
|
419
|
+
"onUpdate:modelValue": (v) => o[h] = 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 o;
|
|
431
431
|
const {
|
|
432
|
-
row:
|
|
432
|
+
row: h,
|
|
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, h, r.field);
|
|
447
447
|
function s(p) {
|
|
448
|
-
b.selectChange(p,
|
|
448
|
+
b.selectChange(p, h, 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(h, r.field, f, v, "row");
|
|
455
455
|
}
|
|
456
456
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
457
|
-
modelValue:
|
|
458
|
-
"onUpdate:modelValue": (p) =>
|
|
457
|
+
modelValue: h[m],
|
|
458
|
+
"onUpdate:modelValue": (p) => h[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(o = 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))) ? o : {
|
|
470
|
+
default: () => [o]
|
|
471
471
|
})];
|
|
472
472
|
},
|
|
473
473
|
renderTableDefault(a, l) {
|
|
474
|
-
let
|
|
474
|
+
let o;
|
|
475
475
|
const {
|
|
476
|
-
row:
|
|
476
|
+
row: h,
|
|
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, h, r.field);
|
|
492
492
|
function M(y) {
|
|
493
|
-
m.selectChange(y,
|
|
493
|
+
m.selectChange(y, h, 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(h, r.field, b, v, "row");
|
|
500
500
|
}
|
|
501
501
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
502
|
-
modelValue:
|
|
503
|
-
"onUpdate:modelValue": (y) =>
|
|
502
|
+
modelValue: h[s],
|
|
503
|
+
"onUpdate:modelValue": (y) => h[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(o = 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))) ? o : {
|
|
515
|
+
default: () => [o]
|
|
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 o;
|
|
540
540
|
const {
|
|
541
|
-
data:
|
|
541
|
+
data: h,
|
|
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, h, r);
|
|
556
556
|
function s(p) {
|
|
557
|
-
n.selectChange(p,
|
|
557
|
+
n.selectChange(p, h, r, a, {
|
|
558
558
|
datasource: "data"
|
|
559
559
|
});
|
|
560
560
|
}
|
|
561
561
|
function M() {
|
|
562
|
-
n.clear(
|
|
562
|
+
n.clear(h, r, f, v, "data");
|
|
563
563
|
}
|
|
564
564
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
565
|
-
modelValue:
|
|
566
|
-
"onUpdate:modelValue": (p) =>
|
|
565
|
+
modelValue: h[m],
|
|
566
|
+
"onUpdate:modelValue": (p) => h[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(o = 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))) ? o : {
|
|
578
|
+
default: () => [o]
|
|
579
579
|
})];
|
|
580
580
|
}
|
|
581
581
|
}), VXETable.renderer.add("#lov", {
|
|
582
582
|
renderItemContent(a, l) {
|
|
583
583
|
const {
|
|
584
|
-
data:
|
|
585
|
-
field:
|
|
584
|
+
data: o,
|
|
585
|
+
field: h
|
|
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 && (h
|
|
593
|
+
t && (o[h] = 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
|
+
o[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(o, 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(o, y);
|
|
617
617
|
}
|
|
618
618
|
const p = {
|
|
619
|
-
data:
|
|
619
|
+
data: o,
|
|
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(o, h, v, e, "data");
|
|
627
627
|
}
|
|
628
628
|
return [createVNode(resolveComponent("ut-lov"), mergeProps({
|
|
629
|
-
record:
|
|
629
|
+
record: o
|
|
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: o,
|
|
640
|
+
column: h
|
|
641
641
|
} = l, {
|
|
642
642
|
props: r,
|
|
643
643
|
events: e
|
|
@@ -655,20 +655,21 @@ 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(o, M);
|
|
659
659
|
}
|
|
660
660
|
const s = {
|
|
661
|
-
row:
|
|
661
|
+
row: o,
|
|
662
662
|
options: Z,
|
|
663
|
-
field:
|
|
663
|
+
field: h.field,
|
|
664
|
+
column: h
|
|
664
665
|
};
|
|
665
666
|
e != null && e.change && e.change(s);
|
|
666
667
|
}
|
|
667
668
|
function v() {
|
|
668
|
-
i.clear(
|
|
669
|
+
i.clear(o, h.field, r.mapField, e, "row");
|
|
669
670
|
}
|
|
670
671
|
return [createVNode(resolveComponent("ut-lov"), mergeProps({
|
|
671
|
-
record:
|
|
672
|
+
record: o,
|
|
672
673
|
mode: "vxe",
|
|
673
674
|
transfer: !0
|
|
674
675
|
}, r, {
|
|
@@ -679,8 +680,8 @@ const VxetableRender = (VXETable, {
|
|
|
679
680
|
// 单元格默认
|
|
680
681
|
renderTableDefault(a, l) {
|
|
681
682
|
const {
|
|
682
|
-
row:
|
|
683
|
-
column:
|
|
683
|
+
row: o,
|
|
684
|
+
column: h
|
|
684
685
|
} = l, {
|
|
685
686
|
props: r,
|
|
686
687
|
events: e
|
|
@@ -698,20 +699,21 @@ const VxetableRender = (VXETable, {
|
|
|
698
699
|
};
|
|
699
700
|
for (const p in n)
|
|
700
701
|
M[p] = Z[n[p]];
|
|
701
|
-
Object.assign(
|
|
702
|
+
Object.assign(o, M);
|
|
702
703
|
}
|
|
703
704
|
const s = {
|
|
704
|
-
row:
|
|
705
|
+
row: o,
|
|
705
706
|
options: Z,
|
|
706
|
-
field:
|
|
707
|
+
field: h.field,
|
|
708
|
+
column: h
|
|
707
709
|
};
|
|
708
710
|
e != null && e.change && e.change(s);
|
|
709
711
|
}
|
|
710
712
|
function v() {
|
|
711
|
-
i.clear(
|
|
713
|
+
i.clear(o, h.field, mapField, e, "row");
|
|
712
714
|
}
|
|
713
715
|
return [createVNode(resolveComponent("ut-lov"), mergeProps({
|
|
714
|
-
record:
|
|
716
|
+
record: o,
|
|
715
717
|
mode: "ele"
|
|
716
718
|
}, r, {
|
|
717
719
|
onChange: (Z, d) => t(Z, d),
|
|
@@ -721,16 +723,16 @@ const VxetableRender = (VXETable, {
|
|
|
721
723
|
// 可编辑显示模板
|
|
722
724
|
renderTableCell(a, l) {
|
|
723
725
|
const {
|
|
724
|
-
row:
|
|
725
|
-
column:
|
|
726
|
+
row: o,
|
|
727
|
+
column: h
|
|
726
728
|
} = l;
|
|
727
|
-
return [createVNode("span", null, [h
|
|
729
|
+
return [createVNode("span", null, [o[h.field]])];
|
|
728
730
|
}
|
|
729
731
|
}), VXETable.renderer.add("#textarea", {
|
|
730
732
|
renderTableEdit(a, l) {
|
|
731
733
|
const {
|
|
732
|
-
row:
|
|
733
|
-
column:
|
|
734
|
+
row: o,
|
|
735
|
+
column: h
|
|
734
736
|
} = l, {
|
|
735
737
|
props: r,
|
|
736
738
|
events: e
|
|
@@ -738,17 +740,17 @@ const VxetableRender = (VXETable, {
|
|
|
738
740
|
mapField: i
|
|
739
741
|
} = r, t = useComponent();
|
|
740
742
|
function v(d) {
|
|
741
|
-
t.change(d,
|
|
742
|
-
column:
|
|
743
|
+
t.change(d, o, h.field, a, {
|
|
744
|
+
column: h,
|
|
743
745
|
datasource: "row"
|
|
744
746
|
});
|
|
745
747
|
}
|
|
746
748
|
function Z() {
|
|
747
|
-
t.clear(
|
|
749
|
+
t.clear(o, h.field, i, e, "row");
|
|
748
750
|
}
|
|
749
751
|
return [createVNode(resolveComponent("vxe-textarea"), mergeProps({
|
|
750
|
-
modelValue: h
|
|
751
|
-
"onUpdate:modelValue": (d) => h
|
|
752
|
+
modelValue: o[h.field],
|
|
753
|
+
"onUpdate:modelValue": (d) => o[h.field] = d
|
|
752
754
|
}, r, {
|
|
753
755
|
style: "width: 100%",
|
|
754
756
|
onChange: (d) => v(d),
|
|
@@ -757,8 +759,8 @@ const VxetableRender = (VXETable, {
|
|
|
757
759
|
},
|
|
758
760
|
renderTableDefault(a, l) {
|
|
759
761
|
const {
|
|
760
|
-
row:
|
|
761
|
-
column:
|
|
762
|
+
row: o,
|
|
763
|
+
column: h
|
|
762
764
|
} = l, {
|
|
763
765
|
props: r,
|
|
764
766
|
events: e
|
|
@@ -766,17 +768,17 @@ const VxetableRender = (VXETable, {
|
|
|
766
768
|
mapField: i
|
|
767
769
|
} = r, t = useComponent();
|
|
768
770
|
function v(d) {
|
|
769
|
-
t.change(d,
|
|
770
|
-
column:
|
|
771
|
+
t.change(d, o, h.field, a, {
|
|
772
|
+
column: h,
|
|
771
773
|
datasource: "row"
|
|
772
774
|
});
|
|
773
775
|
}
|
|
774
776
|
function Z() {
|
|
775
|
-
t.clear(
|
|
777
|
+
t.clear(o, h.field, i, e, "row");
|
|
776
778
|
}
|
|
777
779
|
return [createVNode(resolveComponent("vxe-textarea"), mergeProps({
|
|
778
|
-
modelValue: h
|
|
779
|
-
"onUpdate:modelValue": (d) => h
|
|
780
|
+
modelValue: o[h.field],
|
|
781
|
+
"onUpdate:modelValue": (d) => o[h.field] = d
|
|
780
782
|
}, r, {
|
|
781
783
|
onChange: (d) => v(d),
|
|
782
784
|
onClear: () => Z()
|
|
@@ -785,15 +787,15 @@ const VxetableRender = (VXETable, {
|
|
|
785
787
|
// 可编辑显示模板
|
|
786
788
|
renderTableCell(a, l) {
|
|
787
789
|
const {
|
|
788
|
-
row:
|
|
789
|
-
column:
|
|
790
|
+
row: o,
|
|
791
|
+
column: h
|
|
790
792
|
} = l;
|
|
791
|
-
return h
|
|
793
|
+
return o[h.field];
|
|
792
794
|
},
|
|
793
795
|
renderItemContent(a, l) {
|
|
794
796
|
const {
|
|
795
|
-
data:
|
|
796
|
-
field:
|
|
797
|
+
data: o,
|
|
798
|
+
field: h
|
|
797
799
|
} = l, {
|
|
798
800
|
props: r,
|
|
799
801
|
events: e
|
|
@@ -801,18 +803,18 @@ const VxetableRender = (VXETable, {
|
|
|
801
803
|
defaultValue: t,
|
|
802
804
|
mapField: v
|
|
803
805
|
} = r;
|
|
804
|
-
t && (h
|
|
806
|
+
t && (o[h] = t);
|
|
805
807
|
function Z(n) {
|
|
806
|
-
i.change(n,
|
|
808
|
+
i.change(n, o, h, a, {
|
|
807
809
|
datasource: "data"
|
|
808
810
|
});
|
|
809
811
|
}
|
|
810
812
|
function d() {
|
|
811
|
-
i.clear(
|
|
813
|
+
i.clear(o, h, v, e, "data");
|
|
812
814
|
}
|
|
813
815
|
return [createVNode(resolveComponent("vxe-textarea"), mergeProps({
|
|
814
|
-
modelValue: h
|
|
815
|
-
"onUpdate:modelValue": (n) => h
|
|
816
|
+
modelValue: o[h],
|
|
817
|
+
"onUpdate:modelValue": (n) => o[h] = n
|
|
816
818
|
}, r, {
|
|
817
819
|
onChange: (n) => Z(n),
|
|
818
820
|
onClear: () => d()
|
|
@@ -821,18 +823,18 @@ const VxetableRender = (VXETable, {
|
|
|
821
823
|
}), VXETable.renderer.add("#upload", {
|
|
822
824
|
renderTableEdit(a, l) {
|
|
823
825
|
const {
|
|
824
|
-
row:
|
|
825
|
-
column:
|
|
826
|
+
row: o,
|
|
827
|
+
column: h
|
|
826
828
|
} = l, {
|
|
827
829
|
props: r,
|
|
828
830
|
events: e
|
|
829
831
|
} = a;
|
|
830
832
|
function i(t, v) {
|
|
831
|
-
h
|
|
833
|
+
o[h.field] = "", e != null && e.remove && (e == null || e.remove(t, v));
|
|
832
834
|
}
|
|
833
835
|
return [createVNode(resolveComponent("form-upload"), mergeProps({
|
|
834
|
-
record:
|
|
835
|
-
field:
|
|
836
|
+
record: o,
|
|
837
|
+
field: h.field,
|
|
836
838
|
size: "mini"
|
|
837
839
|
}, r, {
|
|
838
840
|
"render-mode": "column",
|
|
@@ -843,14 +845,14 @@ const VxetableRender = (VXETable, {
|
|
|
843
845
|
// 可编辑显示模板
|
|
844
846
|
renderTableCell(a, l) {
|
|
845
847
|
const {
|
|
846
|
-
row:
|
|
847
|
-
column:
|
|
848
|
+
row: o,
|
|
849
|
+
column: h
|
|
848
850
|
} = l, {
|
|
849
851
|
props: r
|
|
850
852
|
} = a;
|
|
851
853
|
return [createVNode(resolveComponent("form-upload"), mergeProps({
|
|
852
|
-
record:
|
|
853
|
-
field:
|
|
854
|
+
record: o,
|
|
855
|
+
field: h.field,
|
|
854
856
|
size: "mini"
|
|
855
857
|
}, r, {
|
|
856
858
|
mode: "image",
|
|
@@ -860,18 +862,18 @@ const VxetableRender = (VXETable, {
|
|
|
860
862
|
},
|
|
861
863
|
renderItemContent(a, l) {
|
|
862
864
|
const {
|
|
863
|
-
data:
|
|
864
|
-
field:
|
|
865
|
+
data: o,
|
|
866
|
+
field: h
|
|
865
867
|
} = l, {
|
|
866
868
|
props: r,
|
|
867
869
|
events: e
|
|
868
870
|
} = a;
|
|
869
871
|
function i(t, v) {
|
|
870
|
-
h
|
|
872
|
+
o[h] = "", e != null && e.remove && (e == null || e.remove(t, v));
|
|
871
873
|
}
|
|
872
874
|
return [createVNode(resolveComponent("form-upload"), mergeProps({
|
|
873
|
-
record:
|
|
874
|
-
field:
|
|
875
|
+
record: o,
|
|
876
|
+
field: h,
|
|
875
877
|
mode: "image"
|
|
876
878
|
}, r, {
|
|
877
879
|
onRemove: (t, v) => i(t, v)
|
|
@@ -880,9 +882,9 @@ const VxetableRender = (VXETable, {
|
|
|
880
882
|
}), VXETable.renderer.add("#tag", {
|
|
881
883
|
// 默认显示模板
|
|
882
884
|
renderTableDefault(a, l) {
|
|
883
|
-
let
|
|
885
|
+
let o;
|
|
884
886
|
const {
|
|
885
|
-
row:
|
|
887
|
+
row: h,
|
|
886
888
|
column: r
|
|
887
889
|
} = l, {
|
|
888
890
|
props: {
|
|
@@ -891,20 +893,20 @@ const VxetableRender = (VXETable, {
|
|
|
891
893
|
}
|
|
892
894
|
} = a;
|
|
893
895
|
function t() {
|
|
894
|
-
return
|
|
896
|
+
return h[r.field] ? i[h[r.field]] : null;
|
|
895
897
|
}
|
|
896
|
-
return [
|
|
898
|
+
return [h[r.field] ? createVNode(resolveComponent("el-tag"), {
|
|
897
899
|
effect: "dark",
|
|
898
900
|
type: t()
|
|
899
|
-
}, _isSlot(
|
|
900
|
-
default: () => [
|
|
901
|
+
}, _isSlot(o = getValue(e, h[r.field])) ? o : {
|
|
902
|
+
default: () => [o]
|
|
901
903
|
}) : null];
|
|
902
904
|
}
|
|
903
905
|
}), VXETable.renderer.add("#switch", {
|
|
904
906
|
renderTableDefault(a, l) {
|
|
905
907
|
const {
|
|
906
|
-
row:
|
|
907
|
-
column:
|
|
908
|
+
row: o,
|
|
909
|
+
column: h
|
|
908
910
|
} = l, {
|
|
909
911
|
props: {
|
|
910
912
|
code: r,
|
|
@@ -915,15 +917,15 @@ const VxetableRender = (VXETable, {
|
|
|
915
917
|
} = a;
|
|
916
918
|
function v(Z) {
|
|
917
919
|
const d = {
|
|
918
|
-
row:
|
|
919
|
-
column:
|
|
920
|
+
row: o,
|
|
921
|
+
column: h,
|
|
920
922
|
value: Z
|
|
921
923
|
};
|
|
922
924
|
t != null && t.change && t.change(d);
|
|
923
925
|
}
|
|
924
|
-
return [h
|
|
925
|
-
modelValue: h
|
|
926
|
-
"onUpdate:modelValue": (Z) => h
|
|
926
|
+
return [o[h.field] ? createVNode(resolveComponent("el-switch"), mergeProps({
|
|
927
|
+
modelValue: o[h.field],
|
|
928
|
+
"onUpdate:modelValue": (Z) => o[h.field] = Z,
|
|
927
929
|
"inline-prompt": !0,
|
|
928
930
|
size: "large",
|
|
929
931
|
style: "--el-switch-on-color: #13ce66; --el-switch-off-color: #E6A23C"
|
|
@@ -936,49 +938,49 @@ const VxetableRender = (VXETable, {
|
|
|
936
938
|
}), VXETable.renderer.add("#iconSelect", {
|
|
937
939
|
renderTableEdit(a, l) {
|
|
938
940
|
const {
|
|
939
|
-
row:
|
|
940
|
-
column:
|
|
941
|
+
row: o,
|
|
942
|
+
column: h
|
|
941
943
|
} = l;
|
|
942
944
|
return [createVNode(resolveComponent("SuIconSelect"), {
|
|
943
|
-
modelValue: h
|
|
944
|
-
"onUpdate:modelValue": (r) => h
|
|
945
|
+
modelValue: o[h.field],
|
|
946
|
+
"onUpdate:modelValue": (r) => o[h.field] = r,
|
|
945
947
|
teleported: !1
|
|
946
948
|
}, null)];
|
|
947
949
|
},
|
|
948
950
|
renderTableCell(a, l) {
|
|
949
951
|
const {
|
|
950
|
-
row:
|
|
951
|
-
column:
|
|
952
|
+
row: o,
|
|
953
|
+
column: h
|
|
952
954
|
} = l;
|
|
953
955
|
return [createVNode(resolveComponent("IconifyIconOffline"), {
|
|
954
|
-
icon: h
|
|
956
|
+
icon: o[h.field],
|
|
955
957
|
style: "font-size: 16px;"
|
|
956
958
|
}, null)];
|
|
957
959
|
},
|
|
958
960
|
renderItemContent(a, l) {
|
|
959
961
|
const {
|
|
960
|
-
data:
|
|
961
|
-
field:
|
|
962
|
+
data: o,
|
|
963
|
+
field: h
|
|
962
964
|
} = l;
|
|
963
965
|
return [createVNode(resolveComponent("SuIconSelect"), {
|
|
964
|
-
modelValue: h
|
|
965
|
-
"onUpdate:modelValue": (r) => h
|
|
966
|
+
modelValue: o[h],
|
|
967
|
+
"onUpdate:modelValue": (r) => o[h] = r,
|
|
966
968
|
teleported: !0
|
|
967
969
|
}, null)];
|
|
968
970
|
}
|
|
969
971
|
}), VXETable.renderer.add("#treeSelect", {
|
|
970
972
|
renderTableEdit(a, l) {
|
|
971
973
|
const {
|
|
972
|
-
row:
|
|
973
|
-
column:
|
|
974
|
+
row: o,
|
|
975
|
+
column: h
|
|
974
976
|
} = l, {
|
|
975
977
|
props: r,
|
|
976
978
|
sourceData: e,
|
|
977
979
|
events: i
|
|
978
980
|
} = a;
|
|
979
981
|
return [createVNode(resolveComponent("el-tree-select"), mergeProps({
|
|
980
|
-
modelValue: h
|
|
981
|
-
"onUpdate:modelValue": (t) => h
|
|
982
|
+
modelValue: o[h.field],
|
|
983
|
+
"onUpdate:modelValue": (t) => o[h.field] = t,
|
|
982
984
|
data: e,
|
|
983
985
|
"check-strictly": !0
|
|
984
986
|
}, r, {
|
|
@@ -990,31 +992,31 @@ const VxetableRender = (VXETable, {
|
|
|
990
992
|
},
|
|
991
993
|
renderTableCell(a, l) {
|
|
992
994
|
const {
|
|
993
|
-
row:
|
|
994
|
-
column:
|
|
995
|
+
row: o,
|
|
996
|
+
column: h
|
|
995
997
|
} = l, {
|
|
996
998
|
sourceData: r,
|
|
997
999
|
props: e = {}
|
|
998
1000
|
} = a, {
|
|
999
1001
|
children: i = "children",
|
|
1000
1002
|
label: t = "label"
|
|
1001
|
-
} = e, v = findTree(r, (Z) => Z.value === h
|
|
1003
|
+
} = e, v = findTree(r, (Z) => Z.value === o[h.field], {
|
|
1002
1004
|
children: i
|
|
1003
1005
|
});
|
|
1004
1006
|
return v ? [createVNode("span", null, [v.item[t]])] : null;
|
|
1005
1007
|
},
|
|
1006
1008
|
renderItemContent(a, l) {
|
|
1007
1009
|
const {
|
|
1008
|
-
data:
|
|
1009
|
-
field:
|
|
1010
|
+
data: o,
|
|
1011
|
+
field: h
|
|
1010
1012
|
} = l, {
|
|
1011
1013
|
props: r,
|
|
1012
1014
|
sourceData: e,
|
|
1013
1015
|
events: i
|
|
1014
1016
|
} = a;
|
|
1015
1017
|
return [createVNode(resolveComponent("el-tree-select"), mergeProps({
|
|
1016
|
-
modelValue: h
|
|
1017
|
-
"onUpdate:modelValue": (t) => h
|
|
1018
|
+
modelValue: o[h],
|
|
1019
|
+
"onUpdate:modelValue": (t) => o[h] = t,
|
|
1018
1020
|
data: e,
|
|
1019
1021
|
"check-strictly": !0
|
|
1020
1022
|
}, r, {
|
|
@@ -1100,46 +1102,46 @@ const VxetableRender = (VXETable, {
|
|
|
1100
1102
|
e[f] = e[f] || v[f];
|
|
1101
1103
|
})), !e[Z] && e[i] && (e[Z] = t ? (d = e[i]) == null ? void 0 : d.split(",") : e[i]);
|
|
1102
1104
|
}
|
|
1103
|
-
}), onCheckChange = (a, l,
|
|
1104
|
-
console.log(a, l,
|
|
1105
|
-
}, onNodeClick = (a, l,
|
|
1106
|
-
|
|
1107
|
-
}, onCurrentChange = (a, l,
|
|
1108
|
-
|
|
1105
|
+
}), onCheckChange = (a, l, o, h) => {
|
|
1106
|
+
console.log(a, l, o), h != null && h.checkChange && (h == null || h.checkChange(a, l, o));
|
|
1107
|
+
}, onNodeClick = (a, l, o, h) => {
|
|
1108
|
+
h != null && h.checkChange && (h == null || h.checkChange(a, l, o));
|
|
1109
|
+
}, onCurrentChange = (a, l, o) => {
|
|
1110
|
+
o != null && o.checkChange && (o == null || o.checkChange(a, l));
|
|
1109
1111
|
};
|
|
1110
1112
|
function getValue(a, l) {
|
|
1111
|
-
var
|
|
1112
|
-
return !l || !a || !dict ? l : (r = (
|
|
1113
|
+
var o, h, r;
|
|
1114
|
+
return !l || !a || !dict ? l : (r = (h = (o = dict[a]) == null ? void 0 : o.children) == null ? void 0 : h.find((e) => e.dictCode === l)) == null ? void 0 : r.dictName;
|
|
1113
1115
|
}
|
|
1114
1116
|
return VXETable;
|
|
1115
1117
|
}, getCookieParam = () => {
|
|
1116
1118
|
const a = "kCookies_param";
|
|
1117
1119
|
return cookies.get(a) ? JSON.parse(cookies.get(a)) : {};
|
|
1118
1120
|
}, hasClass = (a, l) => {
|
|
1119
|
-
var
|
|
1120
|
-
return !!((
|
|
1121
|
-
}, addClass = (a, l,
|
|
1122
|
-
hasClass(a, l) || (a.className += " " + l),
|
|
1123
|
-
}, removeClass = (a, l,
|
|
1124
|
-
var
|
|
1121
|
+
var o;
|
|
1122
|
+
return !!((o = a.className) != null && o.match(new RegExp("(\\s|^)" + l + "(\\s|$)")));
|
|
1123
|
+
}, addClass = (a, l, o) => {
|
|
1124
|
+
hasClass(a, l) || (a.className += " " + l), o && (hasClass(a, o) || (a.className += " " + o));
|
|
1125
|
+
}, removeClass = (a, l, o) => {
|
|
1126
|
+
var h, r;
|
|
1125
1127
|
if (hasClass(a, l)) {
|
|
1126
1128
|
const e = new RegExp("(\\s|^)" + l + "(\\s|$)");
|
|
1127
|
-
a.className = (
|
|
1129
|
+
a.className = (h = a.className) == null ? void 0 : h.replace(e, " ").trim();
|
|
1128
1130
|
}
|
|
1129
|
-
if (
|
|
1130
|
-
const e = new RegExp("(\\s|^)" +
|
|
1131
|
+
if (o && hasClass(a, o)) {
|
|
1132
|
+
const e = new RegExp("(\\s|^)" + o + "(\\s|$)");
|
|
1131
1133
|
a.className = (r = a.className) == null ? void 0 : r.replace(e, " ").trim();
|
|
1132
1134
|
}
|
|
1133
|
-
}, toggleClass = (a, l,
|
|
1134
|
-
const
|
|
1135
|
-
let { className: r } =
|
|
1136
|
-
r = r == null ? void 0 : r.replace(l, ""),
|
|
1135
|
+
}, toggleClass = (a, l, o) => {
|
|
1136
|
+
const h = o || document.body;
|
|
1137
|
+
let { className: r } = h;
|
|
1138
|
+
r = r == null ? void 0 : r.replace(l, ""), h.className = r && a ? `${r} ${l} ` : r;
|
|
1137
1139
|
};
|
|
1138
1140
|
function useRafThrottle(a) {
|
|
1139
1141
|
let l = !1;
|
|
1140
|
-
return function(...
|
|
1142
|
+
return function(...o) {
|
|
1141
1143
|
l || (l = !0, window.requestAnimationFrame(() => {
|
|
1142
|
-
a.apply(this,
|
|
1144
|
+
a.apply(this, o), l = !1;
|
|
1143
1145
|
}));
|
|
1144
1146
|
};
|
|
1145
1147
|
}
|
|
@@ -1148,9 +1150,9 @@ const openLink = (a) => {
|
|
|
1148
1150
|
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
1151
|
}, isServer = typeof window > "u", resizeHandler = (a) => {
|
|
1150
1152
|
for (const l of a) {
|
|
1151
|
-
const
|
|
1152
|
-
|
|
1153
|
-
|
|
1153
|
+
const o = l.target.__resizeListeners__ || [];
|
|
1154
|
+
o.length && o.forEach((h) => {
|
|
1155
|
+
h();
|
|
1154
1156
|
});
|
|
1155
1157
|
}
|
|
1156
1158
|
}, addResizeListener = (a, l) => {
|
|
@@ -1167,9 +1169,9 @@ function useWatermark(a = ref(document.body)) {
|
|
|
1167
1169
|
if (!Z) return;
|
|
1168
1170
|
const { clientHeight: d, clientWidth: n } = Z;
|
|
1169
1171
|
i({ height: d, width: n });
|
|
1170
|
-
}),
|
|
1171
|
-
const Z = unref(
|
|
1172
|
-
|
|
1172
|
+
}), o = domSymbol.toString(), h = shallowRef(), r = () => {
|
|
1173
|
+
const Z = unref(h);
|
|
1174
|
+
h.value = void 0;
|
|
1173
1175
|
const d = unref(a);
|
|
1174
1176
|
d && (Z && d.removeChild(Z), removeResizeListener(d, l));
|
|
1175
1177
|
};
|
|
@@ -1180,21 +1182,21 @@ function useWatermark(a = ref(document.body)) {
|
|
|
1180
1182
|
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
1183
|
}
|
|
1182
1184
|
function i(Z = {}) {
|
|
1183
|
-
const d = unref(
|
|
1185
|
+
const d = unref(h);
|
|
1184
1186
|
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
1187
|
Z.str,
|
|
1186
1188
|
Z.attr
|
|
1187
1189
|
)}) left top repeat`));
|
|
1188
1190
|
}
|
|
1189
1191
|
const t = (Z, d) => {
|
|
1190
|
-
if (unref(
|
|
1191
|
-
return i({ str: Z, attr: d }),
|
|
1192
|
+
if (unref(h))
|
|
1193
|
+
return i({ str: Z, attr: d }), o;
|
|
1192
1194
|
const n = document.createElement("div");
|
|
1193
|
-
|
|
1195
|
+
h.value = n, n.id = o, n.style.pointerEvents = "none", n.style.top = "0px", n.style.left = "0px", n.style.position = "absolute", n.style.zIndex = "100000";
|
|
1194
1196
|
const f = unref(a);
|
|
1195
|
-
if (!f) return
|
|
1197
|
+
if (!f) return o;
|
|
1196
1198
|
const { clientHeight: b, clientWidth: m } = f;
|
|
1197
|
-
return i({ str: Z, width: m, height: b, attr: d }), f.appendChild(n),
|
|
1199
|
+
return i({ str: Z, width: m, height: b, attr: d }), f.appendChild(n), o;
|
|
1198
1200
|
};
|
|
1199
1201
|
function v(Z, d) {
|
|
1200
1202
|
t(Z, d), addResizeListener(document.documentElement, l), getCurrentInstance() && onBeforeUnmount(() => {
|
|
@@ -1210,16 +1212,16 @@ function entries(a) {
|
|
|
1210
1212
|
function useAttrs(a = {}) {
|
|
1211
1213
|
const l = getCurrentInstance();
|
|
1212
1214
|
if (!l) return {};
|
|
1213
|
-
const { excludeListeners:
|
|
1215
|
+
const { excludeListeners: o = !1, excludeKeys: h = [] } = a, r = shallowRef({}), e = h.concat(DEFAULT_EXCLUDE_KEYS);
|
|
1214
1216
|
return l.attrs = reactive(l.attrs), watchEffect(() => {
|
|
1215
|
-
const i = entries(l.attrs).reduce((t, [v, Z]) => (!e.includes(v) && !(
|
|
1217
|
+
const i = entries(l.attrs).reduce((t, [v, Z]) => (!e.includes(v) && !(o && LISTENER_PREFIX.test(v)) && (t[v] = Z), t), {});
|
|
1216
1218
|
r.value = i;
|
|
1217
1219
|
}), r;
|
|
1218
1220
|
}
|
|
1219
|
-
const useRender = () => {
|
|
1220
|
-
const a = { value: "dictCode", label: "dictName" }, l = (c,
|
|
1221
|
+
const i18n = window.$i18n, useRender = () => {
|
|
1222
|
+
const a = { value: "dictCode", label: "dictName" }, l = (c, u) => {
|
|
1221
1223
|
var N;
|
|
1222
|
-
const
|
|
1224
|
+
const H = w(u);
|
|
1223
1225
|
let C = {
|
|
1224
1226
|
clearable: !0,
|
|
1225
1227
|
disabled: !1,
|
|
@@ -1227,26 +1229,26 @@ const useRender = () => {
|
|
|
1227
1229
|
placeholder: null
|
|
1228
1230
|
}, L, S;
|
|
1229
1231
|
isObject(c) ? (C = Object.assign(C, c), L = c.defaultValue, S = c == null ? void 0 : c.code) : S = c;
|
|
1230
|
-
const I = (N = storageLocal.getItem("kLov")[S]) == null ? void 0 : N.children,
|
|
1232
|
+
const I = (N = storageLocal.getItem("kLov")[S]) == null ? void 0 : N.children, F = I ? I.filter((E) => E.enabled === "1") : [];
|
|
1231
1233
|
return {
|
|
1232
1234
|
name: "#select",
|
|
1233
1235
|
optionProps: a,
|
|
1234
|
-
options:
|
|
1236
|
+
options: F,
|
|
1235
1237
|
props: C,
|
|
1236
1238
|
defaultValue: L,
|
|
1237
|
-
events:
|
|
1239
|
+
events: H
|
|
1238
1240
|
};
|
|
1239
|
-
},
|
|
1240
|
-
const
|
|
1241
|
+
}, o = (c, u) => {
|
|
1242
|
+
const H = w(u);
|
|
1241
1243
|
return {
|
|
1242
1244
|
name: "#SuSelect",
|
|
1243
1245
|
optionProps: (c == null ? void 0 : c.optionProps) || { label: "label", value: "value" },
|
|
1244
1246
|
props: c == null ? void 0 : c.props,
|
|
1245
1247
|
options: (c == null ? void 0 : c.options) || [],
|
|
1246
|
-
events:
|
|
1248
|
+
events: H
|
|
1247
1249
|
};
|
|
1248
|
-
},
|
|
1249
|
-
const
|
|
1250
|
+
}, h = (c, u) => {
|
|
1251
|
+
const H = {
|
|
1250
1252
|
optionProps: { extLabel: "userName", value: "employeeName" },
|
|
1251
1253
|
props: {
|
|
1252
1254
|
attrs: { disabled: c == null ? void 0 : c.disabled },
|
|
@@ -1257,10 +1259,10 @@ const useRender = () => {
|
|
|
1257
1259
|
fetchField: "employeeName"
|
|
1258
1260
|
}
|
|
1259
1261
|
};
|
|
1260
|
-
return
|
|
1262
|
+
return o(H, u);
|
|
1261
1263
|
}, r = (c) => {
|
|
1262
|
-
const
|
|
1263
|
-
optionProps: {
|
|
1264
|
+
const u = {
|
|
1265
|
+
optionProps: { label: "userName", value: "userName" },
|
|
1264
1266
|
props: {
|
|
1265
1267
|
code: "sys/listUsers",
|
|
1266
1268
|
url: "/uums/user",
|
|
@@ -1268,9 +1270,9 @@ const useRender = () => {
|
|
|
1268
1270
|
mapField: c == null ? void 0 : c.mapField
|
|
1269
1271
|
}
|
|
1270
1272
|
};
|
|
1271
|
-
return
|
|
1272
|
-
}, e = (c,
|
|
1273
|
-
const
|
|
1273
|
+
return o(u);
|
|
1274
|
+
}, e = (c, u) => {
|
|
1275
|
+
const H = {
|
|
1274
1276
|
label: "organizationName",
|
|
1275
1277
|
value: (c == null ? void 0 : c.field) || "organizationName"
|
|
1276
1278
|
}, C = {
|
|
@@ -1286,12 +1288,12 @@ const useRender = () => {
|
|
|
1286
1288
|
return Object.assign(C.mapField, L, (c == null ? void 0 : c.mapField) || {}), {
|
|
1287
1289
|
name: "#SuSelect",
|
|
1288
1290
|
props: C,
|
|
1289
|
-
optionProps:
|
|
1291
|
+
optionProps: H,
|
|
1290
1292
|
options: [],
|
|
1291
|
-
events: w(
|
|
1293
|
+
events: w(u)
|
|
1292
1294
|
};
|
|
1293
|
-
}, i = (c,
|
|
1294
|
-
const
|
|
1295
|
+
}, i = (c, u) => {
|
|
1296
|
+
const H = {
|
|
1295
1297
|
label: "orgName",
|
|
1296
1298
|
value: (c == null ? void 0 : c.field) || "orgName"
|
|
1297
1299
|
}, C = {
|
|
@@ -1304,46 +1306,46 @@ const useRender = () => {
|
|
|
1304
1306
|
return Object.assign(C.mapField, L, (c == null ? void 0 : c.mapField) || {}), {
|
|
1305
1307
|
name: "#SuSelect",
|
|
1306
1308
|
props: C,
|
|
1307
|
-
optionProps:
|
|
1309
|
+
optionProps: H,
|
|
1308
1310
|
options: [],
|
|
1309
|
-
events: w(
|
|
1311
|
+
events: w(u)
|
|
1310
1312
|
};
|
|
1311
|
-
}, t = (c,
|
|
1312
|
-
const
|
|
1313
|
+
}, t = (c, u) => {
|
|
1314
|
+
const H = Object.assign({ disabled: !1 }, c), C = H == null ? void 0 : H.defaultValue;
|
|
1313
1315
|
return {
|
|
1314
1316
|
name: "VxeInput",
|
|
1315
|
-
props:
|
|
1317
|
+
props: H,
|
|
1316
1318
|
defaultValue: C,
|
|
1317
|
-
events: w(
|
|
1319
|
+
events: w(u)
|
|
1318
1320
|
};
|
|
1319
|
-
}, v = (c,
|
|
1320
|
-
const
|
|
1321
|
+
}, v = (c, u) => {
|
|
1322
|
+
const H = Object.assign({ disabled: !1, rows: 3 }, c), C = H == null ? void 0 : H.defaultValue;
|
|
1321
1323
|
return {
|
|
1322
|
-
name: "
|
|
1323
|
-
props:
|
|
1324
|
+
name: "VxeTextarea",
|
|
1325
|
+
props: H,
|
|
1324
1326
|
defaultValue: C,
|
|
1325
|
-
events: w(
|
|
1327
|
+
events: w(u)
|
|
1326
1328
|
};
|
|
1327
|
-
}, Z = (c,
|
|
1328
|
-
const
|
|
1329
|
-
return { name:
|
|
1330
|
-
}, d = (c,
|
|
1331
|
-
const
|
|
1332
|
-
return { name:
|
|
1329
|
+
}, Z = (c, u) => {
|
|
1330
|
+
const H = "VxeCheckboxGroup", { defaultValue: C, options: L, props: S } = n(c);
|
|
1331
|
+
return { name: H, defaultValue: C, options: L, props: S, events: w(u) };
|
|
1332
|
+
}, d = (c, u) => {
|
|
1333
|
+
const H = "VxeRadioGroup", { defaultValue: C, options: L, props: S } = n(c);
|
|
1334
|
+
return { name: H, defaultValue: C, options: L, props: S, events: w(u) };
|
|
1333
1335
|
}, n = (c) => {
|
|
1334
1336
|
var I;
|
|
1335
|
-
let
|
|
1337
|
+
let u = { disabled: !1 }, H;
|
|
1336
1338
|
const C = storageLocal.getItem("kLov");
|
|
1337
1339
|
let L = "";
|
|
1338
|
-
isObject(c) ? (
|
|
1339
|
-
const S = L ? (I = C[L]) == null ? void 0 : I.children.map((
|
|
1340
|
+
isObject(c) ? (H = c.defaultValue, L = c.code, c.options ? u = Object.assign(u, c.props || {}) : u = Object.assign(u, c || {})) : isString(c) && (L = c);
|
|
1341
|
+
const S = L ? (I = C[L]) == null ? void 0 : I.children.map((F) => ({ label: F.dictName, value: F.dictCode })) : [];
|
|
1340
1342
|
return {
|
|
1341
|
-
props:
|
|
1342
|
-
defaultValue:
|
|
1343
|
+
props: u,
|
|
1344
|
+
defaultValue: H,
|
|
1343
1345
|
options: isObject(c) && c.options ? c.options : S
|
|
1344
1346
|
};
|
|
1345
|
-
}, f = (c,
|
|
1346
|
-
const
|
|
1347
|
+
}, f = (c, u) => {
|
|
1348
|
+
const H = w(u);
|
|
1347
1349
|
return {
|
|
1348
1350
|
name: "VxeNumberInput",
|
|
1349
1351
|
props: Object.assign(
|
|
@@ -1351,27 +1353,64 @@ const useRender = () => {
|
|
|
1351
1353
|
c || {}
|
|
1352
1354
|
),
|
|
1353
1355
|
defaultValue: c == null ? void 0 : c.defaultValue,
|
|
1354
|
-
events:
|
|
1356
|
+
events: H
|
|
1355
1357
|
};
|
|
1356
|
-
}, b = (c,
|
|
1357
|
-
const
|
|
1358
|
-
return { name: "VxeDatePicker", props: Object.assign({ type: "date", valueFormat: C, clearable: !0 }, c || {}), defaultValue: L, events:
|
|
1359
|
-
}, m = (c,
|
|
1360
|
-
const
|
|
1358
|
+
}, b = (c, u) => {
|
|
1359
|
+
const H = w(u), C = "yyyy-MM-dd HH:mm:ss", L = c == null ? void 0 : c.defaultValue;
|
|
1360
|
+
return { name: "VxeDatePicker", props: Object.assign({ type: "date", valueFormat: C, clearable: !0 }, c || {}), defaultValue: L, events: H };
|
|
1361
|
+
}, m = (c, u) => {
|
|
1362
|
+
const H = w(u), C = "yyyy-MM-dd HH:mm:ss", L = c == null ? void 0 : c.startValue, S = c == null ? void 0 : c.endValue, I = c == null ? void 0 : c.startField, F = c == null ? void 0 : c.endField, N = {
|
|
1363
|
+
type: "date",
|
|
1364
|
+
valueFormat: C,
|
|
1365
|
+
clearable: !0,
|
|
1366
|
+
shortcutConfig: {
|
|
1367
|
+
enabled: !0,
|
|
1368
|
+
options: [
|
|
1369
|
+
{
|
|
1370
|
+
code: "utTodyay",
|
|
1371
|
+
content: i18n ? i18n("message.udp.today") : "今天"
|
|
1372
|
+
},
|
|
1373
|
+
{
|
|
1374
|
+
code: "utYesterDay",
|
|
1375
|
+
content: i18n ? i18n("message.udp.yesterday") : "昨天"
|
|
1376
|
+
},
|
|
1377
|
+
{
|
|
1378
|
+
code: "utRecentWeek",
|
|
1379
|
+
content: i18n ? i18n("message.udp.lastWeek") : "最近一周"
|
|
1380
|
+
},
|
|
1381
|
+
{
|
|
1382
|
+
code: "utRecentMonth",
|
|
1383
|
+
content: i18n ? i18n("message.udp.lastMonth") : "最近一个月"
|
|
1384
|
+
},
|
|
1385
|
+
{
|
|
1386
|
+
code: "utRecentThreeMonth",
|
|
1387
|
+
content: i18n ? i18n("message.udp.threeMonth") : "最近三个月"
|
|
1388
|
+
},
|
|
1389
|
+
{
|
|
1390
|
+
code: "utRecentHalfYear",
|
|
1391
|
+
content: i18n ? i18n("message.udp.halfYear") : "最近半年"
|
|
1392
|
+
},
|
|
1393
|
+
{
|
|
1394
|
+
code: "utRecentYear",
|
|
1395
|
+
content: i18n ? i18n("message.udp.anniversary") : "最近已年"
|
|
1396
|
+
}
|
|
1397
|
+
]
|
|
1398
|
+
}
|
|
1399
|
+
}, E = Object.assign(N, c || {});
|
|
1361
1400
|
return {
|
|
1362
1401
|
name: "VxeDateRangePicker",
|
|
1363
1402
|
startField: I,
|
|
1364
|
-
endField:
|
|
1403
|
+
endField: F,
|
|
1365
1404
|
startValue: L,
|
|
1366
1405
|
endValue: S,
|
|
1367
|
-
props:
|
|
1368
|
-
events:
|
|
1406
|
+
props: E,
|
|
1407
|
+
events: H
|
|
1369
1408
|
};
|
|
1370
|
-
}, s = (c,
|
|
1371
|
-
const
|
|
1372
|
-
return { name: "#lov", props: Object.assign({}, c || {}), events:
|
|
1373
|
-
}, M = (c,
|
|
1374
|
-
const
|
|
1409
|
+
}, s = (c, u) => {
|
|
1410
|
+
const H = w(u);
|
|
1411
|
+
return { name: "#lov", props: Object.assign({}, c || {}), events: H };
|
|
1412
|
+
}, M = (c, u) => {
|
|
1413
|
+
const H = w(u), C = (c == null ? void 0 : c.optionProps) || {
|
|
1375
1414
|
label: "label",
|
|
1376
1415
|
value: "value"
|
|
1377
1416
|
}, L = Object.assign(
|
|
@@ -1383,68 +1422,68 @@ const useRender = () => {
|
|
|
1383
1422
|
optionProps: C,
|
|
1384
1423
|
options: (c == null ? void 0 : c.options) || [],
|
|
1385
1424
|
props: L,
|
|
1386
|
-
events:
|
|
1425
|
+
events: H
|
|
1387
1426
|
};
|
|
1388
|
-
}, p = (c,
|
|
1389
|
-
let
|
|
1427
|
+
}, p = (c, u) => {
|
|
1428
|
+
let H = {
|
|
1390
1429
|
openLabel: "是",
|
|
1391
1430
|
closeLabel: "否",
|
|
1392
1431
|
openValue: "Y",
|
|
1393
1432
|
closeValue: "N"
|
|
1394
1433
|
}, C = "Y";
|
|
1395
|
-
isObject(c) && !isFunction(c) ? (
|
|
1396
|
-
const L = isFunction(c) ? w(c) : w(
|
|
1397
|
-
return { name: "VxeSwitch", props:
|
|
1398
|
-
}, y = (c,
|
|
1399
|
-
const
|
|
1434
|
+
isObject(c) && !isFunction(c) ? (H = Object.assign(H, c || {}), C = c.defaultValue || C) : !isEmpty(c) && isString(c) && (C = c, H = Object.assign(H, { defaultValue: C }));
|
|
1435
|
+
const L = isFunction(c) ? w(c) : w(u);
|
|
1436
|
+
return { name: "VxeSwitch", props: H, defaultValue: C, events: L };
|
|
1437
|
+
}, y = (c, u) => ({ name: "#tag", props: { code: c, tagMap: u } }), A = (c, u) => {
|
|
1438
|
+
const H = {
|
|
1400
1439
|
openLabel: "启用",
|
|
1401
1440
|
closeLabel: "禁用",
|
|
1402
1441
|
openValue: "1",
|
|
1403
1442
|
closeValue: "0",
|
|
1404
1443
|
defaultValue: "1"
|
|
1405
1444
|
};
|
|
1406
|
-
!isFunction(c) && isObject(c) && Object.assign(
|
|
1407
|
-
const C = isFunction(c) ? c :
|
|
1408
|
-
return p(
|
|
1409
|
-
}, k = () => ({ name: "#iconSelect" }), V = (c = [],
|
|
1410
|
-
const
|
|
1445
|
+
!isFunction(c) && isObject(c) && Object.assign(H, c);
|
|
1446
|
+
const C = isFunction(c) ? c : u;
|
|
1447
|
+
return p(H, C);
|
|
1448
|
+
}, k = () => ({ name: "#iconSelect" }), V = (c = [], u = {}, H) => ({ name: "#treeSelect", sourceData: c, props: u, events: H }), T = (c, u) => {
|
|
1449
|
+
const H = w(u);
|
|
1411
1450
|
return {
|
|
1412
1451
|
name: "#area",
|
|
1413
1452
|
props: { mapField: (c == null ? void 0 : c.mapField) || ["province", "city", "region"] },
|
|
1414
|
-
events:
|
|
1453
|
+
events: H
|
|
1415
1454
|
};
|
|
1416
1455
|
}, w = (c) => {
|
|
1417
|
-
let
|
|
1418
|
-
return isObject(c) && !isFunction(c) ?
|
|
1419
|
-
change: (c == null ? void 0 : c.change) ||
|
|
1420
|
-
blur: (c == null ? void 0 : c.blur) ||
|
|
1421
|
-
focus: (c == null ? void 0 : c.focus) ||
|
|
1422
|
-
input: (c == null ? void 0 : c.input) ||
|
|
1423
|
-
clear: (c == null ? void 0 : c.clear) ||
|
|
1456
|
+
let u = {};
|
|
1457
|
+
return isObject(c) && !isFunction(c) ? u = {
|
|
1458
|
+
change: (c == null ? void 0 : c.change) || D,
|
|
1459
|
+
blur: (c == null ? void 0 : c.blur) || D,
|
|
1460
|
+
focus: (c == null ? void 0 : c.focus) || D,
|
|
1461
|
+
input: (c == null ? void 0 : c.input) || D,
|
|
1462
|
+
clear: (c == null ? void 0 : c.clear) || D,
|
|
1424
1463
|
searchClick: c == null ? void 0 : c.searchClick,
|
|
1425
1464
|
suffixClick: c == null ? void 0 : c.suffixClick,
|
|
1426
1465
|
prefixClick: c == null ? void 0 : c.prefixClick,
|
|
1427
1466
|
filterMethod: c == null ? void 0 : c.filterMethod
|
|
1428
|
-
} : c && (
|
|
1429
|
-
},
|
|
1467
|
+
} : c && (u = { change: c }), u;
|
|
1468
|
+
}, R = (c, u) => {
|
|
1430
1469
|
c = c || { fieldType: "string", mode: "image" };
|
|
1431
|
-
const { singleMode:
|
|
1432
|
-
return
|
|
1470
|
+
const { singleMode: H, mode: C } = c;
|
|
1471
|
+
return H && Object.assign(c, {
|
|
1433
1472
|
multiple: !1,
|
|
1434
1473
|
limitCount: 1,
|
|
1435
1474
|
autoHiddenButton: !0
|
|
1436
|
-
}), C === "image" && (c.imageTypes = ["jpg", "jpeg", "png", "gif", "apk"]), { name: "#upload", props: c, events:
|
|
1475
|
+
}), C === "image" && (c.imageTypes = ["jpg", "jpeg", "png", "gif", "apk"]), { name: "#upload", props: c, events: u };
|
|
1437
1476
|
};
|
|
1438
|
-
function
|
|
1477
|
+
function D() {
|
|
1439
1478
|
}
|
|
1440
1479
|
return {
|
|
1441
1480
|
renderDict: l,
|
|
1442
|
-
renderSelect:
|
|
1481
|
+
renderSelect: o,
|
|
1443
1482
|
renderInput: t,
|
|
1444
1483
|
renderTextarea: v,
|
|
1445
1484
|
renderCheckBox: Z,
|
|
1446
1485
|
renderRadio: d,
|
|
1447
|
-
renderUser:
|
|
1486
|
+
renderUser: h,
|
|
1448
1487
|
renderSysUser: r,
|
|
1449
1488
|
renderInvOrg: e,
|
|
1450
1489
|
renderBU: i,
|
|
@@ -1458,17 +1497,17 @@ const useRender = () => {
|
|
|
1458
1497
|
renderEnabled: A,
|
|
1459
1498
|
renderIconSelect: k,
|
|
1460
1499
|
renderTreeSelect: V,
|
|
1461
|
-
renderArea:
|
|
1462
|
-
renderUpload:
|
|
1500
|
+
renderArea: T,
|
|
1501
|
+
renderUpload: R
|
|
1463
1502
|
};
|
|
1464
1503
|
}, useGlobal = () => {
|
|
1465
1504
|
const a = getCurrentInstance();
|
|
1466
1505
|
if (!a) return { $global: {}, $storage: {}, $config: {} };
|
|
1467
|
-
const l = a.appContext.app.config.globalProperties,
|
|
1506
|
+
const l = a.appContext.app.config.globalProperties, o = l.$storage, h = l.$config, r = l.$serviceApi, e = l.$hasAuthority, i = l.$printPlugin, t = l.$mode;
|
|
1468
1507
|
return {
|
|
1469
1508
|
$global: l,
|
|
1470
|
-
$storage:
|
|
1471
|
-
$config:
|
|
1509
|
+
$storage: o,
|
|
1510
|
+
$config: h,
|
|
1472
1511
|
$serviceApi: r,
|
|
1473
1512
|
$hasAuthority: e,
|
|
1474
1513
|
$printPlugin: i,
|
|
@@ -1485,60 +1524,60 @@ function buildUUID() {
|
|
|
1485
1524
|
}
|
|
1486
1525
|
let unique = 0;
|
|
1487
1526
|
function buildShortUUID(a = "") {
|
|
1488
|
-
const l = Date.now(),
|
|
1489
|
-
return unique++, a + "_" +
|
|
1527
|
+
const l = Date.now(), o = Math.floor(Math.random() * 1e9);
|
|
1528
|
+
return unique++, a + "_" + o + unique + String(l);
|
|
1490
1529
|
}
|
|
1491
1530
|
const deviceDetection = () => {
|
|
1492
|
-
const a = navigator.userAgent.toLowerCase(), l = a.match(/iphone os/i) === "iphone os",
|
|
1493
|
-
return l ||
|
|
1531
|
+
const a = navigator.userAgent.toLowerCase(), l = a.match(/iphone os/i) === "iphone os", o = a.match(/midp/i) === "midp", h = 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";
|
|
1532
|
+
return l || o || h || r || e || i || t;
|
|
1494
1533
|
}, getBrowserInfo = () => {
|
|
1495
|
-
const a = navigator.userAgent.toLowerCase(), l = /(msie|firefox|chrome|opera|version).*?([\d.]+)/,
|
|
1534
|
+
const a = navigator.userAgent.toLowerCase(), l = /(msie|firefox|chrome|opera|version).*?([\d.]+)/, o = a.match(l);
|
|
1496
1535
|
return {
|
|
1497
|
-
browser:
|
|
1498
|
-
version:
|
|
1536
|
+
browser: o[1].replace(/version/, "'safari"),
|
|
1537
|
+
version: o[2]
|
|
1499
1538
|
};
|
|
1500
|
-
}, showMessage = (a, l = "message",
|
|
1501
|
-
var
|
|
1502
|
-
return l === "alert" ? (
|
|
1539
|
+
}, showMessage = (a, l = "message", o = {}) => {
|
|
1540
|
+
var h, r;
|
|
1541
|
+
return l === "alert" ? (h = VxeUI.modal) == null ? void 0 : h.alert({ content: a, ...o }) : (r = VxeUI.modal) == null ? void 0 : r.message({ content: a, ...o });
|
|
1503
1542
|
}, successMessage = (a = "操作成功", l = {}) => {
|
|
1504
|
-
var
|
|
1505
|
-
return (
|
|
1543
|
+
var o;
|
|
1544
|
+
return (o = VxeUI.modal) == null ? void 0 : o.message({ content: a, ...l, status: "success" });
|
|
1506
1545
|
}, warnMessage = (a, l = {}) => {
|
|
1507
|
-
var
|
|
1508
|
-
return l.type === "alert" ? (
|
|
1546
|
+
var o, h;
|
|
1547
|
+
return l.type === "alert" ? (o = VxeUI.modal) == null ? void 0 : o.alert({ content: a, ...l, status: "warning" }) : (h = VxeUI.modal) == null ? void 0 : h.message({
|
|
1509
1548
|
content: a,
|
|
1510
1549
|
duration: 5e3,
|
|
1511
1550
|
...l,
|
|
1512
1551
|
status: "warning"
|
|
1513
1552
|
});
|
|
1514
1553
|
}, errorMessage = (a = "操作失败", l = {}) => {
|
|
1515
|
-
var
|
|
1516
|
-
return l.type === "alert" ? (
|
|
1554
|
+
var o, h;
|
|
1555
|
+
return l.type === "alert" ? (o = VxeUI.modal) == null ? void 0 : o.alert({ content: a, ...l, status: "error" }) : (h = VxeUI.modal) == null ? void 0 : h.message({ content: a, ...l, status: "error" });
|
|
1517
1556
|
}, renderHook = useRender(), i18nColums = (a, l = !0) => {
|
|
1518
|
-
let
|
|
1557
|
+
let o = 0, h = 0;
|
|
1519
1558
|
const r = a.length - 1;
|
|
1520
1559
|
return a.map((e, i) => {
|
|
1521
|
-
if (
|
|
1560
|
+
if (h = h + e.width, e.type) return e;
|
|
1522
1561
|
e.title = e.title || `message.${e.field}`;
|
|
1523
1562
|
const { showOverflow: t } = e;
|
|
1524
|
-
return e.field !== "operate" && ((e.width > 99 || e.minWidth) && (e.showOverflow = t === !1 ? t : "tooltip"), e.sortable = !(l === !1 || e.sortable === !1)),
|
|
1563
|
+
return e.field !== "operate" && ((e.width > 99 || e.minWidth) && (e.showOverflow = t === !1 ? t : "tooltip"), e.sortable = !(l === !1 || e.sortable === !1)), o || (o = e.minWidth), !o && r === i && h < window.innerWidth && (e.minWidth = e.width, e.width = null), e;
|
|
1525
1564
|
});
|
|
1526
|
-
}, formatItems = (a, l,
|
|
1527
|
-
var e, i
|
|
1528
|
-
if ((
|
|
1529
|
-
return
|
|
1565
|
+
}, formatItems = (a, l, o = 24) => a.length ? a.map((h) => {
|
|
1566
|
+
var r, e, i;
|
|
1567
|
+
if ((r = h.children) != null && r.length)
|
|
1568
|
+
return h.children = formatItems(h.children, l, o), h;
|
|
1530
1569
|
{
|
|
1531
|
-
|
|
1532
|
-
let
|
|
1533
|
-
l === "detail" ? (
|
|
1534
|
-
let
|
|
1570
|
+
h.title = h.title || `message.${h.field}`, h.span = h.span || o, h.type === "collapseNode" && (h.title = "", h.titleWidth = 0);
|
|
1571
|
+
let t = !1, v = window.$i18n ? window.$i18n("message.udp.placeholder") + window.$i18n(h.title) : "";
|
|
1572
|
+
l === "detail" ? (t = !0, v = null) : t = h.disabled === !1 ? h.disabled : h.disabled || ((i = (e = h.itemRender) == null ? void 0 : e.props) == null ? void 0 : i.disabled);
|
|
1573
|
+
let Z = {
|
|
1535
1574
|
name: "VxeInput",
|
|
1536
|
-
props: { disabled:
|
|
1575
|
+
props: { disabled: t, placeholder: t ? "" : v }
|
|
1537
1576
|
};
|
|
1538
|
-
return
|
|
1539
|
-
disabled:
|
|
1540
|
-
placeholder:
|
|
1541
|
-
}),
|
|
1577
|
+
return h.code && !h.itemRender && (Z = renderHook.renderDict(h.code)), h.itemRender = h.itemRender || Z, h.itemRender.props = Object.assign(h.itemRender.props || {}, {
|
|
1578
|
+
disabled: t,
|
|
1579
|
+
placeholder: t ? "" : v
|
|
1580
|
+
}), h;
|
|
1542
1581
|
}
|
|
1543
1582
|
}) : a, formSearchButtons = {
|
|
1544
1583
|
span: 6,
|
|
@@ -1565,11 +1604,11 @@ const deviceDetection = () => {
|
|
|
1565
1604
|
events: null
|
|
1566
1605
|
}
|
|
1567
1606
|
}, formatGridItems = (a, l) => {
|
|
1568
|
-
const
|
|
1607
|
+
const o = a, h = o.length, r = h > 2 && o.some((Z, d) => d < 3 && (Z.span > 6 || getDateRange(Z))), e = r || h > 3, i = {
|
|
1569
1608
|
collapseTags: !0,
|
|
1570
1609
|
collapseTagsTooltip: !0,
|
|
1571
1610
|
multiple: !0
|
|
1572
|
-
}, t =
|
|
1611
|
+
}, t = o.map((Z, d) => {
|
|
1573
1612
|
var n, f, b;
|
|
1574
1613
|
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(
|
|
1575
1614
|
i,
|
|
@@ -1583,25 +1622,25 @@ const deviceDetection = () => {
|
|
|
1583
1622
|
t.push(v);
|
|
1584
1623
|
return t;
|
|
1585
1624
|
}, getDateRange = (a) => {
|
|
1586
|
-
var l,
|
|
1587
|
-
return ((l = a.itemRender) == null ? void 0 : l.name) === "#SuDateRange" ? ((
|
|
1625
|
+
var l, o, h, r, e;
|
|
1626
|
+
return ((l = a.itemRender) == null ? void 0 : l.name) === "#SuDateRange" ? ((h = (o = a.itemRender) == null ? void 0 : o.props) == null ? void 0 : h.type) === "daterange" || !((e = (r = a.itemRender) == null ? void 0 : r.props) != null && e.type) : !1;
|
|
1588
1627
|
}, formatRules = (a, l) => {
|
|
1589
|
-
const
|
|
1590
|
-
return a.forEach((
|
|
1628
|
+
const o = {};
|
|
1629
|
+
return a.forEach((h) => {
|
|
1591
1630
|
var r;
|
|
1592
|
-
if ((r =
|
|
1593
|
-
const e = formatRules(
|
|
1594
|
-
merge(
|
|
1595
|
-
} else if (
|
|
1596
|
-
const { field: e, title: i } =
|
|
1597
|
-
|
|
1631
|
+
if ((r = h.children) != null && r.length) {
|
|
1632
|
+
const e = formatRules(h.children, l);
|
|
1633
|
+
merge(o, e);
|
|
1634
|
+
} else if (h.required) {
|
|
1635
|
+
const { field: e, title: i } = h, t = i == null ? void 0 : i.startsWith("message.");
|
|
1636
|
+
o[e] = [
|
|
1598
1637
|
{
|
|
1599
1638
|
required: !0,
|
|
1600
1639
|
message: `${l("message.required")}${i && t ? l(i) : i || l(`message.${e}`)}`
|
|
1601
1640
|
}
|
|
1602
1641
|
];
|
|
1603
1642
|
}
|
|
1604
|
-
}),
|
|
1643
|
+
}), o;
|
|
1605
1644
|
}, expandedPaths = [];
|
|
1606
1645
|
function extractPathList(a) {
|
|
1607
1646
|
if (!Array.isArray(a)) {
|
|
@@ -1620,8 +1659,8 @@ function deleteTreeChildren(a, l = []) {
|
|
|
1620
1659
|
return;
|
|
1621
1660
|
}
|
|
1622
1661
|
if (!(!a || a.length === 0)) {
|
|
1623
|
-
for (const [
|
|
1624
|
-
|
|
1662
|
+
for (const [o, h] of a.entries())
|
|
1663
|
+
h.children && h.children.length === 1 && delete h.children, h.id = o, h.parentId = l.length ? l[l.length - 1] : null, h.pathList = [...l, h.id], h.uniqueId = h.pathList.length > 1 ? h.pathList.join("-") : h.pathList[0], h.children && h.children.length > 0 && deleteTreeChildren(h.children, h.pathList);
|
|
1625
1664
|
return a;
|
|
1626
1665
|
}
|
|
1627
1666
|
}
|
|
@@ -1631,8 +1670,8 @@ function buildHierarchyTree(a, l = []) {
|
|
|
1631
1670
|
return;
|
|
1632
1671
|
}
|
|
1633
1672
|
if (!(!a || a.length === 0)) {
|
|
1634
|
-
for (const [
|
|
1635
|
-
|
|
1673
|
+
for (const [o, h] of a.entries())
|
|
1674
|
+
h.id = o, h.parentId = l.length ? l[l.length - 1] : null, h.pathList = [...l, h.id], h.children && h.children.length > 0 && buildHierarchyTree(h.children, h.pathList);
|
|
1636
1675
|
return a;
|
|
1637
1676
|
}
|
|
1638
1677
|
}
|
|
@@ -1642,20 +1681,20 @@ function getNodeByUniqueId(a, l) {
|
|
|
1642
1681
|
return;
|
|
1643
1682
|
}
|
|
1644
1683
|
if (!a || a.length === 0) return;
|
|
1645
|
-
const
|
|
1646
|
-
if (
|
|
1647
|
-
const
|
|
1648
|
-
return getNodeByUniqueId(
|
|
1684
|
+
const o = a.find((r) => r.uniqueId === l);
|
|
1685
|
+
if (o) return o;
|
|
1686
|
+
const h = a.filter((r) => r.children).map((r) => r.children).flat(1);
|
|
1687
|
+
return getNodeByUniqueId(h, l);
|
|
1649
1688
|
}
|
|
1650
|
-
function appendFieldByUniqueId(a, l,
|
|
1689
|
+
function appendFieldByUniqueId(a, l, o) {
|
|
1651
1690
|
if (!Array.isArray(a)) {
|
|
1652
1691
|
console.warn("menuTree must be an array");
|
|
1653
1692
|
return;
|
|
1654
1693
|
}
|
|
1655
1694
|
if (!a || a.length === 0) return {};
|
|
1656
|
-
for (const
|
|
1657
|
-
const r =
|
|
1658
|
-
|
|
1695
|
+
for (const h of a) {
|
|
1696
|
+
const r = h.children && h.children.length > 0;
|
|
1697
|
+
h.uniqueId === l && Object.prototype.toString.call(o) === "[object Object]" && Object.assign(h, o), r && appendFieldByUniqueId(h.children, l, o);
|
|
1659
1698
|
}
|
|
1660
1699
|
return a;
|
|
1661
1700
|
}
|
|
@@ -1704,16 +1743,16 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1704
1743
|
}
|
|
1705
1744
|
/** 重连原始请求 */
|
|
1706
1745
|
static retryOriginalRequest(l) {
|
|
1707
|
-
return new Promise((
|
|
1708
|
-
g.requests.push((
|
|
1709
|
-
l.headers.Authorization = "Bearer " +
|
|
1746
|
+
return new Promise((o) => {
|
|
1747
|
+
g.requests.push((h) => {
|
|
1748
|
+
l.headers.Authorization = "Bearer " + h, o(l);
|
|
1710
1749
|
});
|
|
1711
1750
|
});
|
|
1712
1751
|
}
|
|
1713
1752
|
// 请求拦截
|
|
1714
1753
|
httpInterceptorsRequest() {
|
|
1715
1754
|
g.axiosInstance.interceptors.request.use(
|
|
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((
|
|
1755
|
+
(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((h) => l.url.indexOf(h) > -1) ? l : new Promise((h) => {
|
|
1717
1756
|
const r = cookies.get(kTOKENKEY);
|
|
1718
1757
|
if (r) {
|
|
1719
1758
|
const e = JSON.parse(r), i = (/* @__PURE__ */ new Date()).getTime();
|
|
@@ -1725,20 +1764,20 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1725
1764
|
this.routeToLogin();
|
|
1726
1765
|
}).finally(() => {
|
|
1727
1766
|
g.isRefreshing = !1;
|
|
1728
|
-
})),
|
|
1767
|
+
})), h(g.retryOriginalRequest(l))) : (l.headers.Authorization = "Bearer " + e.accessToken, h(l));
|
|
1729
1768
|
} else {
|
|
1730
1769
|
const e = cookies.get("kCookies_token");
|
|
1731
|
-
e && (l.headers["X-Token"] = e),
|
|
1770
|
+
e && (l.headers["X-Token"] = e), h(l);
|
|
1732
1771
|
}
|
|
1733
1772
|
})),
|
|
1734
1773
|
(l) => Promise.reject(l)
|
|
1735
1774
|
);
|
|
1736
1775
|
}
|
|
1737
1776
|
setToken(l) {
|
|
1738
|
-
const { access_token:
|
|
1739
|
-
accessToken:
|
|
1777
|
+
const { access_token: o, expires_in: h, refresh_token: r } = l, e = {
|
|
1778
|
+
accessToken: o,
|
|
1740
1779
|
refreshToken: r,
|
|
1741
|
-
expires: Date.now() +
|
|
1780
|
+
expires: Date.now() + h * 1e3
|
|
1742
1781
|
};
|
|
1743
1782
|
cookies.set(kTOKENKEY, JSON.stringify(e));
|
|
1744
1783
|
}
|
|
@@ -1748,29 +1787,29 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1748
1787
|
// 响应拦截
|
|
1749
1788
|
httpInterceptorsResponse() {
|
|
1750
1789
|
g.axiosInstance.interceptors.response.use(
|
|
1751
|
-
(
|
|
1752
|
-
const
|
|
1753
|
-
return has(
|
|
1790
|
+
(o) => {
|
|
1791
|
+
const h = o.config;
|
|
1792
|
+
return has(h, "loading") && isRef(h.loading) && (h.loading.value = !1), NProgress.done(), typeof h.beforeResponseCallback == "function" ? (h.beforeResponseCallback(o), o.data) : (g.initConfig.beforeResponseCallback && g.initConfig.beforeResponseCallback(o), o.data);
|
|
1754
1793
|
},
|
|
1755
|
-
(
|
|
1794
|
+
(o) => {
|
|
1756
1795
|
var r;
|
|
1757
|
-
const
|
|
1758
|
-
return has(
|
|
1796
|
+
const h = o;
|
|
1797
|
+
return has(o.config, "loading") && isRef((r = o == null ? void 0 : o.config) == null ? void 0 : r.loading) && (o.config.loading.value = !1), h.isCancelRequest = Axios.isCancel(h), NProgress.done(), Promise.reject(h);
|
|
1759
1798
|
}
|
|
1760
1799
|
);
|
|
1761
1800
|
}
|
|
1762
|
-
transformConfigByMethod(l,
|
|
1763
|
-
const { method:
|
|
1801
|
+
transformConfigByMethod(l, o) {
|
|
1802
|
+
const { method: h } = o, r = ["get"], e = h.toLocaleLowerCase(), i = r.includes(e) ? "params" : "data";
|
|
1764
1803
|
return {
|
|
1765
|
-
...
|
|
1804
|
+
...o,
|
|
1766
1805
|
[i]: l
|
|
1767
1806
|
};
|
|
1768
1807
|
}
|
|
1769
1808
|
// 通用请求工具函数
|
|
1770
|
-
request(l,
|
|
1771
|
-
const e = this.transformConfigByMethod(
|
|
1809
|
+
request(l, o, h, r) {
|
|
1810
|
+
const e = this.transformConfigByMethod(h, {
|
|
1772
1811
|
method: l,
|
|
1773
|
-
url:
|
|
1812
|
+
url: o,
|
|
1774
1813
|
...r
|
|
1775
1814
|
});
|
|
1776
1815
|
return new Promise((i, t) => {
|
|
@@ -1800,22 +1839,22 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1800
1839
|
});
|
|
1801
1840
|
}
|
|
1802
1841
|
// 单独抽离的post工具函数
|
|
1803
|
-
post(l,
|
|
1804
|
-
return this.request("post", l,
|
|
1842
|
+
post(l, o, h) {
|
|
1843
|
+
return this.request("post", l, o, h);
|
|
1805
1844
|
}
|
|
1806
1845
|
// 单独抽离的delete工具函数
|
|
1807
|
-
delete(l,
|
|
1808
|
-
return this.request("delete", l,
|
|
1846
|
+
delete(l, o, h) {
|
|
1847
|
+
return this.request("delete", l, o, h);
|
|
1809
1848
|
}
|
|
1810
1849
|
// 单独抽离的put工具函数
|
|
1811
|
-
put(l,
|
|
1812
|
-
return this.request("put", l,
|
|
1850
|
+
put(l, o, h) {
|
|
1851
|
+
return this.request("put", l, o, h);
|
|
1813
1852
|
}
|
|
1814
1853
|
// 单独抽离的get工具函数
|
|
1815
|
-
get(l,
|
|
1816
|
-
for (const r in
|
|
1817
|
-
|
|
1818
|
-
return this.request("get", l,
|
|
1854
|
+
get(l, o, h) {
|
|
1855
|
+
for (const r in o)
|
|
1856
|
+
o[r] || delete o[r];
|
|
1857
|
+
return this.request("get", l, o, h);
|
|
1819
1858
|
}
|
|
1820
1859
|
postRouter(l) {
|
|
1821
1860
|
return this.request("post", "route/service", l);
|
|
@@ -2479,10 +2518,10 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2479
2518
|
* @eg:var count = calendar.lYearDays(1987) ;//count=387
|
|
2480
2519
|
*/
|
|
2481
2520
|
lYearDays: function(a) {
|
|
2482
|
-
let l,
|
|
2521
|
+
let l, o = 348;
|
|
2483
2522
|
for (l = 32768; l > 8; l >>= 1)
|
|
2484
|
-
|
|
2485
|
-
return
|
|
2523
|
+
o += this.lunarInfo[a - 1900] & l ? 1 : 0;
|
|
2524
|
+
return o + this.leapDays(a);
|
|
2486
2525
|
},
|
|
2487
2526
|
/**
|
|
2488
2527
|
* 返回农历y年闰月是哪个月;若y年没有闰月 则返回0
|
|
@@ -2522,8 +2561,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2522
2561
|
solarDays: function(a, l) {
|
|
2523
2562
|
if (l > 12 || l < 1)
|
|
2524
2563
|
return -1;
|
|
2525
|
-
const
|
|
2526
|
-
return
|
|
2564
|
+
const o = l - 1;
|
|
2565
|
+
return o === 1 ? a % 4 === 0 && a % 100 !== 0 || a % 400 === 0 ? 29 : 28 : this.solarMonth[o];
|
|
2527
2566
|
},
|
|
2528
2567
|
/**
|
|
2529
2568
|
* 农历年份转换为干支纪年
|
|
@@ -2531,8 +2570,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2531
2570
|
* @return Cn string
|
|
2532
2571
|
*/
|
|
2533
2572
|
toGanZhiYear: function(a) {
|
|
2534
|
-
let l = (a - 3) % 10,
|
|
2535
|
-
return l === 0 && (l = 10),
|
|
2573
|
+
let l = (a - 3) % 10, o = (a - 3) % 12;
|
|
2574
|
+
return l === 0 && (l = 10), o === 0 && (o = 12), this.Gan[l - 1] + this.Zhi[o - 1];
|
|
2536
2575
|
},
|
|
2537
2576
|
/**
|
|
2538
2577
|
* 公历月、日判断所属星座
|
|
@@ -2541,8 +2580,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2541
2580
|
* @return Cn string
|
|
2542
2581
|
*/
|
|
2543
2582
|
toAstro: function(a, l) {
|
|
2544
|
-
const
|
|
2545
|
-
return
|
|
2583
|
+
const o = "摩羯水瓶双鱼白羊金牛双子巨蟹狮子处女天秤天蝎射手摩羯", h = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22];
|
|
2584
|
+
return o.substr(a * 2 - (l < h[a - 1] ? 2 : 0), 2) + "座";
|
|
2546
2585
|
},
|
|
2547
2586
|
/**
|
|
2548
2587
|
* 传入offset偏移量返回干支
|
|
@@ -2562,12 +2601,12 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2562
2601
|
getTerm: function(a, l) {
|
|
2563
2602
|
if (a < 1900 || a > 2100 || l < 1 || l > 24)
|
|
2564
2603
|
return -1;
|
|
2565
|
-
const
|
|
2566
|
-
for (let r = 0; r <
|
|
2567
|
-
const e = parseInt("0x" +
|
|
2568
|
-
|
|
2604
|
+
const o = this.sTermInfo[a - 1900], h = [];
|
|
2605
|
+
for (let r = 0; r < o.length; r += 5) {
|
|
2606
|
+
const e = parseInt("0x" + o.substr(r, 5)).toString();
|
|
2607
|
+
h.push(e[0], e.substr(1, 2), e[3], e.substr(4, 2));
|
|
2569
2608
|
}
|
|
2570
|
-
return parseInt(
|
|
2609
|
+
return parseInt(h[l - 1]);
|
|
2571
2610
|
},
|
|
2572
2611
|
/**
|
|
2573
2612
|
* 传入农历数字月份返回汉语通俗表示法
|
|
@@ -2622,21 +2661,21 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2622
2661
|
* @return JSON object
|
|
2623
2662
|
* @eg:console.log(calendar.solar2lunar(1987,11,01));
|
|
2624
2663
|
*/
|
|
2625
|
-
solar2lunar: function(a, l,
|
|
2626
|
-
let
|
|
2627
|
-
if (
|
|
2664
|
+
solar2lunar: function(a, l, o) {
|
|
2665
|
+
let h = parseInt(a), r = parseInt(l), e = parseInt(o);
|
|
2666
|
+
if (h < 1900 || h > 2100 || h === 1900 && r === 1 && e < 31)
|
|
2628
2667
|
return -1;
|
|
2629
2668
|
let i;
|
|
2630
|
-
|
|
2669
|
+
h ? i = new Date(h, parseInt(r.toString()) - 1, e) : i = /* @__PURE__ */ new Date();
|
|
2631
2670
|
let t, v = 0, Z = 0;
|
|
2632
|
-
|
|
2671
|
+
h = i.getFullYear(), r = i.getMonth() + 1, e = i.getDate();
|
|
2633
2672
|
let d = (Date.UTC(i.getFullYear(), i.getMonth(), i.getDate()) - Date.UTC(1900, 0, 31)) / 864e5;
|
|
2634
2673
|
for (t = 1900; t < 2101 && d > 0; t++)
|
|
2635
2674
|
Z = this.lYearDays(t), d -= Z;
|
|
2636
2675
|
d < 0 && (d += Z, t--);
|
|
2637
2676
|
const n = /* @__PURE__ */ new Date();
|
|
2638
2677
|
let f = !1;
|
|
2639
|
-
n.getFullYear() ===
|
|
2678
|
+
n.getFullYear() === h && n.getMonth() + 1 === r && n.getDate() === e && (f = !0);
|
|
2640
2679
|
let b = i.getDay();
|
|
2641
2680
|
const m = this.nStr1[b];
|
|
2642
2681
|
b === 0 && (b = 7);
|
|
@@ -2646,17 +2685,17 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2646
2685
|
for (t = 1; t < 13 && d > 0; t++)
|
|
2647
2686
|
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;
|
|
2648
2687
|
d === 0 && v > 0 && t === v + 1 && (M ? M = !1 : (M = !0, --t)), d < 0 && (d += Z, --t);
|
|
2649
|
-
const p = t, y = d + 1, A = r - 1, k = this.toGanZhiYear(s), V = this.getTerm(
|
|
2650
|
-
let w = this.toGanZhi((
|
|
2651
|
-
e >= V && (w = this.toGanZhi((
|
|
2652
|
-
let
|
|
2653
|
-
V === e && (
|
|
2654
|
-
const c = Date.UTC(
|
|
2688
|
+
const p = t, y = d + 1, A = r - 1, k = this.toGanZhiYear(s), V = this.getTerm(h, r * 2 - 1), T = this.getTerm(h, r * 2);
|
|
2689
|
+
let w = this.toGanZhi((h - 1900) * 12 + r + 11);
|
|
2690
|
+
e >= V && (w = this.toGanZhi((h - 1900) * 12 + r + 12));
|
|
2691
|
+
let R = !1, D;
|
|
2692
|
+
V === e && (R = !0, D = this.solarTerm[r * 2 - 2]), T === e && (R = !0, D = this.solarTerm[r * 2 - 1]);
|
|
2693
|
+
const c = Date.UTC(h, A, 1, 0, 0, 0, 0) / 864e5 + 25567 + 10, u = this.toGanZhi(c + e - 1), H = this.toAstro(r, e), C = h + "-" + r + "-" + e, L = s + "-" + p + "-" + y, S = this.festival, I = this.lFestival, F = r + "-" + e;
|
|
2655
2694
|
let N = p + "-" + y;
|
|
2656
2695
|
return p === 12 && y === 29 && this.monthDays(s, p) === 29 && (N = "12-30"), {
|
|
2657
2696
|
date: C,
|
|
2658
2697
|
lunarDate: L,
|
|
2659
|
-
festival: S[
|
|
2698
|
+
festival: S[F] ? S[F].title : null,
|
|
2660
2699
|
lunarFestival: I[N] ? I[N].title : null,
|
|
2661
2700
|
lYear: s,
|
|
2662
2701
|
lMonth: p,
|
|
@@ -2664,19 +2703,19 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2664
2703
|
Animal: this.getAnimal(s),
|
|
2665
2704
|
IMonthCn: (M ? "闰" : "") + this.toChinaMonth(p),
|
|
2666
2705
|
IDayCn: this.toChinaDay(y),
|
|
2667
|
-
cYear:
|
|
2706
|
+
cYear: h,
|
|
2668
2707
|
cMonth: r,
|
|
2669
2708
|
cDay: e,
|
|
2670
2709
|
gzYear: k,
|
|
2671
2710
|
gzMonth: w,
|
|
2672
|
-
gzDay:
|
|
2711
|
+
gzDay: u,
|
|
2673
2712
|
isToday: f,
|
|
2674
2713
|
isLeap: M,
|
|
2675
2714
|
nWeek: b,
|
|
2676
2715
|
ncWeek: "星期" + m,
|
|
2677
|
-
isTerm:
|
|
2678
|
-
Term:
|
|
2679
|
-
astro:
|
|
2716
|
+
isTerm: R,
|
|
2717
|
+
Term: D,
|
|
2718
|
+
astro: H
|
|
2680
2719
|
};
|
|
2681
2720
|
},
|
|
2682
2721
|
/**
|
|
@@ -2689,14 +2728,14 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2689
2728
|
* @return JSON object
|
|
2690
2729
|
* @eg:console.log(calendar.lunar2solar(1987,9,10));
|
|
2691
2730
|
*/
|
|
2692
|
-
lunar2solar: function(a, l,
|
|
2693
|
-
a = parseInt(a), l = parseInt(l),
|
|
2731
|
+
lunar2solar: function(a, l, o, h) {
|
|
2732
|
+
a = parseInt(a), l = parseInt(l), o = parseInt(o), h = !!h;
|
|
2694
2733
|
const r = this.leapMonth(a);
|
|
2695
|
-
if (
|
|
2734
|
+
if (h && r !== l || a === 2100 && l === 12 && o > 1 || a === 1900 && l === 1 && o < 31)
|
|
2696
2735
|
return -1;
|
|
2697
2736
|
const e = this.monthDays(a, l);
|
|
2698
2737
|
let i = e;
|
|
2699
|
-
if (
|
|
2738
|
+
if (h && (i = this.leapDays(a)), a < 1900 || a > 2100 || o > i)
|
|
2700
2739
|
return -1;
|
|
2701
2740
|
let t = 0, v;
|
|
2702
2741
|
for (v = 1900; v < a; v++)
|
|
@@ -2704,8 +2743,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2704
2743
|
let Z = 0, d = !1;
|
|
2705
2744
|
for (v = 1; v < l; v++)
|
|
2706
2745
|
Z = this.leapMonth(a), d || Z <= v && Z > 0 && (t += this.leapDays(a), d = !0), t += this.monthDays(a, v);
|
|
2707
|
-
|
|
2708
|
-
const n = Date.UTC(1900, 1, 30, 0, 0, 0), f = new Date((t +
|
|
2746
|
+
h && (t += e);
|
|
2747
|
+
const n = Date.UTC(1900, 1, 30, 0, 0, 0), f = new Date((t + o - 31) * 864e5 + n), b = f.getUTCFullYear(), m = f.getUTCMonth() + 1, s = f.getUTCDate();
|
|
2709
2748
|
return this.solar2lunar(b, m, s);
|
|
2710
2749
|
}
|
|
2711
2750
|
}, dict = storageLocal.getItem("kLov"), formats = {
|
|
@@ -2745,8 +2784,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2745
2784
|
tableCellFormatMethod({ cellValue: a }, l) {
|
|
2746
2785
|
var r, e;
|
|
2747
2786
|
if (!l) return a;
|
|
2748
|
-
const
|
|
2749
|
-
return (
|
|
2787
|
+
const o = XEUtils.toValueString(a), h = dict ? (e = (r = dict[l]) == null ? void 0 : r.children) == null ? void 0 : e.find((i) => i.dictCode === o) : a;
|
|
2788
|
+
return (h == null ? void 0 : h.dictName) || a;
|
|
2750
2789
|
}
|
|
2751
2790
|
},
|
|
2752
2791
|
formatRelateField: {
|
|
@@ -2758,22 +2797,22 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2758
2797
|
formatContact: {
|
|
2759
2798
|
// 字段拼接展示
|
|
2760
2799
|
tableCellFormatMethod({ row: a }, l) {
|
|
2761
|
-
return l.reduce((
|
|
2800
|
+
return l.reduce((o, h) => a[h] ? o ? o += a[h] : a[h] : o, "");
|
|
2762
2801
|
}
|
|
2763
2802
|
},
|
|
2764
2803
|
formatSelectLocal: {
|
|
2765
2804
|
tableCellFormatMethod({ cellValue: a }, l) {
|
|
2766
|
-
const [
|
|
2805
|
+
const [o, h = "value", r = "label"] = l, e = o == null ? void 0 : o.find((i) => i[h] === a);
|
|
2767
2806
|
return e ? e[r] : a;
|
|
2768
2807
|
}
|
|
2769
2808
|
},
|
|
2770
2809
|
formatMultiValue: {
|
|
2771
2810
|
tableCellFormatMethod({ row: a }, l) {
|
|
2772
2811
|
var e;
|
|
2773
|
-
const [
|
|
2812
|
+
const [o, h] = l;
|
|
2774
2813
|
let r;
|
|
2775
|
-
return (e = a[
|
|
2776
|
-
const t =
|
|
2814
|
+
return (e = a[o]) == null || e.split(",").forEach((i) => {
|
|
2815
|
+
const t = h.find((v) => v.value === i);
|
|
2777
2816
|
r = r ? `${r},${t == null ? void 0 : t.label}` : t == null ? void 0 : t.label;
|
|
2778
2817
|
}), r;
|
|
2779
2818
|
}
|
|
@@ -10401,29 +10440,32 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
10401
10440
|
height: 24
|
|
10402
10441
|
}, withInstall = (a) => {
|
|
10403
10442
|
const l = a;
|
|
10404
|
-
return l.install = (
|
|
10405
|
-
|
|
10443
|
+
return l.install = (o) => {
|
|
10444
|
+
o.component(l.name || l.__name, a);
|
|
10406
10445
|
}, a;
|
|
10407
10446
|
};
|
|
10408
10447
|
function sleep(a = 64) {
|
|
10409
10448
|
return new Promise((l) => {
|
|
10410
|
-
const
|
|
10411
|
-
window.clearTimeout(
|
|
10449
|
+
const o = setTimeout(() => {
|
|
10450
|
+
window.clearTimeout(o), l(a);
|
|
10412
10451
|
}, a);
|
|
10413
10452
|
});
|
|
10414
10453
|
}
|
|
10415
10454
|
const delay = (a) => new Promise((l) => setTimeout(l, a)), useDark = () => ({ isDark: ref(document.documentElement.classList.contains("dark")) }), useDebounce = (a, l) => {
|
|
10416
|
-
let
|
|
10455
|
+
let o;
|
|
10417
10456
|
return () => {
|
|
10418
|
-
|
|
10457
|
+
o && clearTimeout(o), o = setTimeout(a, l);
|
|
10419
10458
|
};
|
|
10420
10459
|
};
|
|
10421
10460
|
function isUrl(a) {
|
|
10422
10461
|
return /(((^http(s)?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/.test(a);
|
|
10423
10462
|
}
|
|
10424
10463
|
const getDictName = (a, l) => {
|
|
10425
|
-
var
|
|
10426
|
-
return !a || !l ? null : (r = (
|
|
10464
|
+
var h, r;
|
|
10465
|
+
return !a || !l ? null : (r = (h = storageLocal.getItem("kLov")[a]) == null ? void 0 : h.children.find((e) => l === e.dictCode)) == null ? void 0 : r.dictName;
|
|
10466
|
+
}, getDictChildren = (a) => {
|
|
10467
|
+
var o;
|
|
10468
|
+
return a ? (o = storageLocal.getItem("kLov")[a]) == null ? void 0 : o.children : [];
|
|
10427
10469
|
};
|
|
10428
10470
|
export {
|
|
10429
10471
|
G as NProgress,
|
|
@@ -10446,6 +10488,7 @@ export {
|
|
|
10446
10488
|
formatRules,
|
|
10447
10489
|
formats,
|
|
10448
10490
|
getBrowserInfo,
|
|
10491
|
+
getDictChildren,
|
|
10449
10492
|
getDictName,
|
|
10450
10493
|
getNodeByUniqueId,
|
|
10451
10494
|
hasClass,
|