@utogether/utils 3.0.0-beta.27 → 3.0.0-beta.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pkg/formatData.d.ts +1 -1
- package/dist/pkg/useRender.d.ts +12 -0
- package/dist/utils.es.js +671 -607
- package/dist/utils.umd.js +1 -1
- package/package.json +29 -30
package/dist/utils.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var T = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
2
|
+
var j = (a, l, o) => l in a ? T(a, l, { enumerable: !0, configurable: !0, writable: !0, value: o }) : a[l] = o;
|
|
3
|
+
var S = (a, l, o) => j(a, typeof l != "symbol" ? l + "" : l, o);
|
|
4
4
|
import { createVNode, resolveComponent, mergeProps, isVNode, ref, shallowRef, unref, getCurrentInstance, onBeforeUnmount, reactive, watchEffect, isRef } from "vue";
|
|
5
5
|
import dayjs from "dayjs";
|
|
6
|
-
import XEUtils, { isArray, findTree, isEmpty, isObject, isPlainObject, isUndefined, isFunction, isString, clone, has } from "xe-utils";
|
|
6
|
+
import XEUtils, { isArray, findTree, isEmpty, isObject, isPlainObject, isUndefined, isFunction, isString, clone, merge, has } from "xe-utils";
|
|
7
7
|
import localforage from "localforage";
|
|
8
8
|
import ResizeObserver from "resize-observer-polyfill";
|
|
9
9
|
import { VxeUI } from "vxe-pc-ui";
|
|
@@ -12,9 +12,9 @@ import NProgress from "nprogress";
|
|
|
12
12
|
import { default as W } from "nprogress";
|
|
13
13
|
class sessionStorageProxy {
|
|
14
14
|
constructor(l) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
S(this, "storage");
|
|
16
|
+
S(this, "prefix");
|
|
17
|
+
S(this, "addPrefix", (l) => {
|
|
18
18
|
this.prefix = l;
|
|
19
19
|
});
|
|
20
20
|
this.storage = l;
|
|
@@ -46,7 +46,7 @@ class localStorageProxy extends sessionStorageProxy {
|
|
|
46
46
|
}
|
|
47
47
|
class localforageProxy {
|
|
48
48
|
constructor() {
|
|
49
|
-
|
|
49
|
+
S(this, "storage");
|
|
50
50
|
localforage.config({
|
|
51
51
|
name: "uapp",
|
|
52
52
|
storeName: "udb"
|
|
@@ -77,11 +77,11 @@ function stringifyAttributes(a) {
|
|
|
77
77
|
}
|
|
78
78
|
function get(a, l, o) {
|
|
79
79
|
const h = /(?:^|; )([^=]*)=([^;]*)/g, r = {};
|
|
80
|
-
let
|
|
81
|
-
for (; (
|
|
80
|
+
let e;
|
|
81
|
+
for (; (e = h.exec(document.cookie)) != null; )
|
|
82
82
|
try {
|
|
83
|
-
const i = o(
|
|
84
|
-
if (r[i] = l(
|
|
83
|
+
const i = o(e[1]);
|
|
84
|
+
if (r[i] = l(e[2], i), a === i)
|
|
85
85
|
break;
|
|
86
86
|
} catch {
|
|
87
87
|
}
|
|
@@ -111,8 +111,8 @@ function removeCookie(a, l = DEFAULT_ATTRIBUTES) {
|
|
|
111
111
|
}
|
|
112
112
|
function init(a, l) {
|
|
113
113
|
const o = {
|
|
114
|
-
set: function(r,
|
|
115
|
-
return setCookie(r,
|
|
114
|
+
set: function(r, e, i) {
|
|
115
|
+
return setCookie(r, e, Object.assign({}, this.attributes, i), {
|
|
116
116
|
encodeValue: this.converter.write
|
|
117
117
|
});
|
|
118
118
|
},
|
|
@@ -122,8 +122,8 @@ function init(a, l) {
|
|
|
122
122
|
if (r != null)
|
|
123
123
|
return getCookie(r, this.converter.read);
|
|
124
124
|
},
|
|
125
|
-
remove: function(r,
|
|
126
|
-
removeCookie(r, Object.assign({}, this.attributes,
|
|
125
|
+
remove: function(r, e) {
|
|
126
|
+
removeCookie(r, Object.assign({}, this.attributes, e));
|
|
127
127
|
},
|
|
128
128
|
withAttributes: function(r) {
|
|
129
129
|
return init(this.converter, Object.assign({}, this.attributes, r));
|
|
@@ -140,8 +140,8 @@ function init(a, l) {
|
|
|
140
140
|
init({ read: DEFAULT_CODEC.decodeValue, write: DEFAULT_CODEC.encodeValue }, DEFAULT_ATTRIBUTES);
|
|
141
141
|
class Cookies {
|
|
142
142
|
constructor() {
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
S(this, "prefix", null);
|
|
144
|
+
S(this, "addPrefix", (l) => {
|
|
145
145
|
this.prefix = l;
|
|
146
146
|
});
|
|
147
147
|
}
|
|
@@ -196,56 +196,56 @@ const VxetableRender = (VXETable, {
|
|
|
196
196
|
row: h,
|
|
197
197
|
column: r
|
|
198
198
|
} = l, {
|
|
199
|
-
options:
|
|
199
|
+
options: e,
|
|
200
200
|
props: i,
|
|
201
|
-
optionProps:
|
|
202
|
-
events:
|
|
201
|
+
optionProps: t = {},
|
|
202
|
+
events: c
|
|
203
203
|
} = a, {
|
|
204
|
-
label:
|
|
204
|
+
label: Z = "label",
|
|
205
205
|
value: d = "value"
|
|
206
|
-
} =
|
|
207
|
-
loading:
|
|
208
|
-
multiple:
|
|
209
|
-
mapField:
|
|
210
|
-
} = i,
|
|
211
|
-
|
|
212
|
-
function
|
|
213
|
-
|
|
206
|
+
} = t, {
|
|
207
|
+
loading: n = !1,
|
|
208
|
+
multiple: f,
|
|
209
|
+
mapField: H
|
|
210
|
+
} = i, m = useComponent(), s = f ? `_${r.field}` : r.field;
|
|
211
|
+
m.setDefaultValue(i, h, r.field);
|
|
212
|
+
function u(V) {
|
|
213
|
+
m.remote(V, r.field, a);
|
|
214
214
|
}
|
|
215
|
-
function
|
|
216
|
-
|
|
215
|
+
function M(V) {
|
|
216
|
+
m.selectChange(V, h, r.field, a, {
|
|
217
217
|
column: r,
|
|
218
218
|
datasource: "row"
|
|
219
219
|
});
|
|
220
220
|
}
|
|
221
|
-
function C(
|
|
222
|
-
|
|
221
|
+
function C(V) {
|
|
222
|
+
c != null && c.input && c.input(l, V);
|
|
223
223
|
}
|
|
224
224
|
function A() {
|
|
225
|
-
|
|
225
|
+
m.clear(h, r.field, H, c, "row");
|
|
226
226
|
}
|
|
227
227
|
function w() {
|
|
228
|
-
!
|
|
228
|
+
!e.length && u(""), c != null && c.focus && c.focus(l, r.field);
|
|
229
229
|
}
|
|
230
230
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
231
|
-
modelValue: h[
|
|
232
|
-
"onUpdate:modelValue": (
|
|
231
|
+
modelValue: h[s],
|
|
232
|
+
"onUpdate:modelValue": (V) => h[s] = V,
|
|
233
233
|
filterable: !0,
|
|
234
234
|
remote: !0,
|
|
235
235
|
clearable: !0,
|
|
236
236
|
placeholder: "请录入关键字搜索",
|
|
237
237
|
style: "width: 100%",
|
|
238
|
-
"remote-method":
|
|
239
|
-
loading:
|
|
238
|
+
"remote-method": u,
|
|
239
|
+
loading: n
|
|
240
240
|
}, i, {
|
|
241
241
|
onFocus: () => w(),
|
|
242
|
-
onChange: (
|
|
242
|
+
onChange: (V) => M(V),
|
|
243
243
|
onClear: () => A(),
|
|
244
|
-
onInput: (
|
|
245
|
-
}), _isSlot(o =
|
|
246
|
-
key:
|
|
247
|
-
label:
|
|
248
|
-
value:
|
|
244
|
+
onInput: (V) => C(V)
|
|
245
|
+
}), _isSlot(o = e.map((V) => createVNode(resolveComponent("el-option"), {
|
|
246
|
+
key: V[d],
|
|
247
|
+
label: V[Z],
|
|
248
|
+
value: V[d]
|
|
249
249
|
}, null))) ? o : {
|
|
250
250
|
default: () => [o]
|
|
251
251
|
})];
|
|
@@ -256,56 +256,56 @@ const VxetableRender = (VXETable, {
|
|
|
256
256
|
row: h,
|
|
257
257
|
column: r
|
|
258
258
|
} = l, {
|
|
259
|
-
options:
|
|
259
|
+
options: e,
|
|
260
260
|
props: i,
|
|
261
|
-
optionProps:
|
|
262
|
-
events:
|
|
261
|
+
optionProps: t = {},
|
|
262
|
+
events: c
|
|
263
263
|
} = a, {
|
|
264
|
-
label:
|
|
264
|
+
label: Z = "label",
|
|
265
265
|
value: d = "value"
|
|
266
|
-
} =
|
|
267
|
-
loading:
|
|
268
|
-
multiple:
|
|
269
|
-
mapField:
|
|
270
|
-
} = i,
|
|
271
|
-
|
|
272
|
-
function
|
|
273
|
-
|
|
266
|
+
} = t, {
|
|
267
|
+
loading: n = !1,
|
|
268
|
+
multiple: f,
|
|
269
|
+
mapField: H
|
|
270
|
+
} = i, m = useComponent(), s = f ? `_${r.field}` : r.field;
|
|
271
|
+
m.setDefaultValue(i, h, r.field);
|
|
272
|
+
function u(V) {
|
|
273
|
+
m.remote(V, r.field, a);
|
|
274
274
|
}
|
|
275
|
-
function
|
|
276
|
-
|
|
275
|
+
function M(V) {
|
|
276
|
+
m.selectChange(V, h, r.field, a, {
|
|
277
277
|
column: r,
|
|
278
278
|
datasource: "row"
|
|
279
279
|
});
|
|
280
280
|
}
|
|
281
|
-
function C(
|
|
282
|
-
|
|
281
|
+
function C(V) {
|
|
282
|
+
c != null && c.input && c.input(l, V);
|
|
283
283
|
}
|
|
284
284
|
function A() {
|
|
285
|
-
|
|
285
|
+
m.clear(h, r.field, H, c, "row");
|
|
286
286
|
}
|
|
287
287
|
function w() {
|
|
288
|
-
!
|
|
288
|
+
!e.length && u(""), c != null && c.focus && c.focus(l, r.field);
|
|
289
289
|
}
|
|
290
290
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
291
|
-
modelValue: h[
|
|
292
|
-
"onUpdate:modelValue": (
|
|
291
|
+
modelValue: h[s],
|
|
292
|
+
"onUpdate:modelValue": (V) => h[s] = V,
|
|
293
293
|
filterable: !0,
|
|
294
294
|
remote: !0,
|
|
295
295
|
clearable: !0,
|
|
296
296
|
placeholder: "请录入关键字搜索",
|
|
297
297
|
style: "width: 100%",
|
|
298
|
-
"remote-method":
|
|
299
|
-
loading:
|
|
298
|
+
"remote-method": u,
|
|
299
|
+
loading: n
|
|
300
300
|
}, i, {
|
|
301
301
|
onFocus: () => w(),
|
|
302
|
-
onChange: (
|
|
302
|
+
onChange: (V) => M(V),
|
|
303
303
|
onClear: () => A(),
|
|
304
|
-
onInput: (
|
|
305
|
-
}), _isSlot(o =
|
|
306
|
-
key:
|
|
307
|
-
label:
|
|
308
|
-
value:
|
|
304
|
+
onInput: (V) => C(V)
|
|
305
|
+
}), _isSlot(o = e.map((V) => createVNode(resolveComponent("el-option"), {
|
|
306
|
+
key: V[d],
|
|
307
|
+
label: V[Z],
|
|
308
|
+
value: V[d]
|
|
309
309
|
}, null))) ? o : {
|
|
310
310
|
default: () => [o]
|
|
311
311
|
})];
|
|
@@ -330,55 +330,55 @@ const VxetableRender = (VXETable, {
|
|
|
330
330
|
data: h,
|
|
331
331
|
field: r
|
|
332
332
|
} = l, {
|
|
333
|
-
options:
|
|
333
|
+
options: e,
|
|
334
334
|
props: i,
|
|
335
|
-
optionProps:
|
|
336
|
-
events:
|
|
335
|
+
optionProps: t = {},
|
|
336
|
+
events: c
|
|
337
337
|
} = a, {
|
|
338
|
-
label:
|
|
338
|
+
label: Z = "label",
|
|
339
339
|
value: d = "value"
|
|
340
|
-
} =
|
|
341
|
-
mapField:
|
|
342
|
-
multiple:
|
|
343
|
-
loading:
|
|
344
|
-
} = i,
|
|
345
|
-
|
|
346
|
-
async function
|
|
347
|
-
|
|
340
|
+
} = t, {
|
|
341
|
+
mapField: n,
|
|
342
|
+
multiple: f,
|
|
343
|
+
loading: H = !1
|
|
344
|
+
} = i, m = useComponent(), s = f ? `_${r}` : r;
|
|
345
|
+
m.setDefaultValue(i, h, r);
|
|
346
|
+
async function u(V) {
|
|
347
|
+
m.remote(V, r, a);
|
|
348
348
|
}
|
|
349
|
-
function
|
|
350
|
-
|
|
349
|
+
function M(V) {
|
|
350
|
+
m.selectChange(V, h, r, a, {
|
|
351
351
|
datasource: "data"
|
|
352
352
|
});
|
|
353
353
|
}
|
|
354
|
-
function C(
|
|
355
|
-
|
|
354
|
+
function C(V) {
|
|
355
|
+
c != null && c.input && c.input(l, V);
|
|
356
356
|
}
|
|
357
357
|
function A() {
|
|
358
|
-
|
|
358
|
+
m.clear(h, r, n, c, "data");
|
|
359
359
|
}
|
|
360
360
|
function w() {
|
|
361
|
-
!
|
|
361
|
+
!e.length && u(""), c != null && c.focus && c.focus(l);
|
|
362
362
|
}
|
|
363
363
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
364
|
-
modelValue: h[
|
|
365
|
-
"onUpdate:modelValue": (
|
|
364
|
+
modelValue: h[s],
|
|
365
|
+
"onUpdate:modelValue": (V) => h[s] = V,
|
|
366
366
|
filterable: !0,
|
|
367
367
|
remote: !0,
|
|
368
368
|
clearable: !0,
|
|
369
369
|
style: "width: 100%",
|
|
370
370
|
placeholder: "请录入关键字搜索",
|
|
371
|
-
loading:
|
|
372
|
-
"remote-method":
|
|
371
|
+
loading: H,
|
|
372
|
+
"remote-method": u
|
|
373
373
|
}, i, {
|
|
374
374
|
onFocus: () => w(),
|
|
375
|
-
onChange: (
|
|
375
|
+
onChange: (V) => M(V),
|
|
376
376
|
onClear: () => A(),
|
|
377
377
|
onInput: () => C()
|
|
378
|
-
}), _isSlot(o =
|
|
379
|
-
key:
|
|
380
|
-
label:
|
|
381
|
-
value:
|
|
378
|
+
}), _isSlot(o = e.map((V) => createVNode(resolveComponent("el-option"), {
|
|
379
|
+
key: V[d],
|
|
380
|
+
label: V[Z],
|
|
381
|
+
value: V[d]
|
|
382
382
|
}, null))) ? o : {
|
|
383
383
|
default: () => [o]
|
|
384
384
|
})];
|
|
@@ -392,31 +392,31 @@ const VxetableRender = (VXETable, {
|
|
|
392
392
|
props: r
|
|
393
393
|
} = a;
|
|
394
394
|
r != null && r.defaultValue && !o[h] && (o[h] = r.defaultValue, r.defaultValue = r.required ? r.defaultValue : null);
|
|
395
|
-
const
|
|
395
|
+
const e = /* @__PURE__ */ new Date(), i = [{
|
|
396
396
|
text: i18n("message.udp.today", !0),
|
|
397
|
-
value: () => [
|
|
397
|
+
value: () => [t(1, "day"), e]
|
|
398
398
|
}, {
|
|
399
399
|
text: i18n("message.udp.yesterday", !0),
|
|
400
|
-
value: () => [
|
|
400
|
+
value: () => [t(2, "day"), t(2, "day")]
|
|
401
401
|
}, {
|
|
402
402
|
text: i18n("message.udp.lastWeek", !0),
|
|
403
|
-
value: () => [
|
|
403
|
+
value: () => [t(7, "day"), e]
|
|
404
404
|
}, {
|
|
405
405
|
text: i18n("message.udp.lastMonth", !0),
|
|
406
|
-
value: () => [
|
|
406
|
+
value: () => [t(1, "month"), e]
|
|
407
407
|
}, {
|
|
408
408
|
text: i18n("message.udp.threeMonth", !0),
|
|
409
|
-
value: () => [
|
|
409
|
+
value: () => [t(3, "month"), e]
|
|
410
410
|
}, {
|
|
411
411
|
text: i18n("message.udp.halfYear", !0),
|
|
412
|
-
value: () => [
|
|
412
|
+
value: () => [t(6, "month"), e]
|
|
413
413
|
}, {
|
|
414
414
|
text: i18n("message.udp.anniversary", !0),
|
|
415
|
-
value: () => [
|
|
416
|
-
}],
|
|
415
|
+
value: () => [t(1, "year"), e]
|
|
416
|
+
}], t = (c, Z) => dayjs().subtract(c, Z).add("1", "day").format();
|
|
417
417
|
return [createVNode(resolveComponent("el-date-picker"), mergeProps({
|
|
418
418
|
modelValue: o[h],
|
|
419
|
-
"onUpdate:modelValue": (
|
|
419
|
+
"onUpdate:modelValue": (c) => o[h] = c,
|
|
420
420
|
type: (r == null ? void 0 : r.type) || "daterange",
|
|
421
421
|
shortcuts: i,
|
|
422
422
|
style: "width: 100%",
|
|
@@ -432,45 +432,40 @@ const VxetableRender = (VXETable, {
|
|
|
432
432
|
row: h,
|
|
433
433
|
column: r
|
|
434
434
|
} = l, {
|
|
435
|
-
options:
|
|
435
|
+
options: e,
|
|
436
436
|
props: i,
|
|
437
|
-
optionProps:
|
|
438
|
-
events:
|
|
437
|
+
optionProps: t = {},
|
|
438
|
+
events: c
|
|
439
439
|
} = a, {
|
|
440
|
-
label:
|
|
441
|
-
value: d = "value"
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
mapField:
|
|
445
|
-
} = i,
|
|
446
|
-
i
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
[v]: n
|
|
450
|
-
});
|
|
451
|
-
});
|
|
452
|
-
function H(n) {
|
|
453
|
-
u.selectChange(n, h, r.field, a, {
|
|
440
|
+
label: Z = "label",
|
|
441
|
+
value: d = "value"
|
|
442
|
+
} = t, {
|
|
443
|
+
multiple: n,
|
|
444
|
+
mapField: f
|
|
445
|
+
} = i, H = useComponent(), m = n ? `_${r.field}` : r.field;
|
|
446
|
+
H.setDefaultValue(i, h, r.field);
|
|
447
|
+
function s(M) {
|
|
448
|
+
H.selectChange(M, h, r.field, a, {
|
|
454
449
|
column: r,
|
|
455
450
|
datasource: "row"
|
|
456
451
|
});
|
|
457
452
|
}
|
|
458
|
-
function
|
|
459
|
-
|
|
453
|
+
function u() {
|
|
454
|
+
H.clear(h, r.field, f, c, "row");
|
|
460
455
|
}
|
|
461
456
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
462
|
-
modelValue: h[
|
|
463
|
-
"onUpdate:modelValue": (
|
|
457
|
+
modelValue: h[m],
|
|
458
|
+
"onUpdate:modelValue": (M) => h[m] = M,
|
|
464
459
|
filterable: !0,
|
|
465
460
|
clearable: !0
|
|
466
461
|
}, i, {
|
|
467
462
|
style: "width: 100%",
|
|
468
|
-
onChange: (
|
|
469
|
-
onClear: () =>
|
|
470
|
-
}), _isSlot(o =
|
|
471
|
-
key:
|
|
472
|
-
label:
|
|
473
|
-
value:
|
|
463
|
+
onChange: (M) => s(M),
|
|
464
|
+
onClear: () => u()
|
|
465
|
+
}), _isSlot(o = e.map((M) => createVNode(resolveComponent("el-option"), {
|
|
466
|
+
key: M[d],
|
|
467
|
+
label: M[Z],
|
|
468
|
+
value: M[d]
|
|
474
469
|
}, null))) ? o : {
|
|
475
470
|
default: () => [o]
|
|
476
471
|
})];
|
|
@@ -481,45 +476,41 @@ const VxetableRender = (VXETable, {
|
|
|
481
476
|
row: h,
|
|
482
477
|
column: r
|
|
483
478
|
} = l, {
|
|
484
|
-
options:
|
|
479
|
+
options: e,
|
|
485
480
|
props: i,
|
|
486
|
-
optionProps:
|
|
487
|
-
events:
|
|
481
|
+
optionProps: t = {},
|
|
482
|
+
events: c
|
|
488
483
|
} = a, {
|
|
489
|
-
label:
|
|
484
|
+
label: Z = "label",
|
|
490
485
|
value: d = "value",
|
|
491
|
-
extLabel:
|
|
492
|
-
} =
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
i
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
});
|
|
500
|
-
});
|
|
501
|
-
function H(n) {
|
|
502
|
-
u.selectChange(n, h, r.field, a, {
|
|
486
|
+
extLabel: n
|
|
487
|
+
} = t, {
|
|
488
|
+
multiple: f,
|
|
489
|
+
mapField: H
|
|
490
|
+
} = i, m = useComponent(), s = f ? `_${r.field}` : r.field;
|
|
491
|
+
m.setDefaultValue(i, h, r.field);
|
|
492
|
+
function u(C) {
|
|
493
|
+
m.selectChange(C, h, r.field, a, {
|
|
503
494
|
column: r,
|
|
504
495
|
datasource: "row"
|
|
505
496
|
});
|
|
506
497
|
}
|
|
507
|
-
function
|
|
508
|
-
|
|
498
|
+
function M() {
|
|
499
|
+
m.clear(h, r.field, H, c, "row");
|
|
509
500
|
}
|
|
510
501
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
511
|
-
modelValue: h[
|
|
512
|
-
"onUpdate:modelValue": (
|
|
502
|
+
modelValue: h[s],
|
|
503
|
+
"onUpdate:modelValue": (C) => h[s] = C,
|
|
513
504
|
filterable: !0,
|
|
514
505
|
clearable: !0
|
|
515
506
|
}, i, {
|
|
516
507
|
style: "width: 100%",
|
|
517
|
-
onChange: (
|
|
518
|
-
onClear: () =>
|
|
519
|
-
}), _isSlot(o =
|
|
520
|
-
key:
|
|
521
|
-
label:
|
|
522
|
-
value:
|
|
508
|
+
onChange: (C) => u(C),
|
|
509
|
+
onClear: () => M()
|
|
510
|
+
}), _isSlot(o = e.map((C) => createVNode(resolveComponent("el-option"), {
|
|
511
|
+
key: C[d],
|
|
512
|
+
label: n && C[n] ? C[d] : C[Z],
|
|
513
|
+
value: C[d]
|
|
523
514
|
}, null))) ? o : {
|
|
524
515
|
default: () => [o]
|
|
525
516
|
})];
|
|
@@ -550,39 +541,39 @@ const VxetableRender = (VXETable, {
|
|
|
550
541
|
data: h,
|
|
551
542
|
field: r
|
|
552
543
|
} = l, {
|
|
553
|
-
options:
|
|
544
|
+
options: e,
|
|
554
545
|
props: i,
|
|
555
|
-
optionProps:
|
|
556
|
-
events:
|
|
546
|
+
optionProps: t = {},
|
|
547
|
+
events: c
|
|
557
548
|
} = a, {
|
|
558
|
-
label:
|
|
549
|
+
label: Z = "label",
|
|
559
550
|
value: d = "value"
|
|
560
|
-
} =
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
} = i;
|
|
564
|
-
|
|
565
|
-
function
|
|
566
|
-
|
|
551
|
+
} = t, n = useComponent(), {
|
|
552
|
+
mapField: f,
|
|
553
|
+
multiple: H
|
|
554
|
+
} = i, m = H ? `_${r}` : r;
|
|
555
|
+
n.setDefaultValue(i, h, r);
|
|
556
|
+
function s(M) {
|
|
557
|
+
n.selectChange(M, h, r, a, {
|
|
567
558
|
datasource: "data"
|
|
568
559
|
});
|
|
569
560
|
}
|
|
570
|
-
function
|
|
571
|
-
|
|
561
|
+
function u() {
|
|
562
|
+
n.clear(h, r, f, c, "data");
|
|
572
563
|
}
|
|
573
564
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
574
|
-
modelValue: h[
|
|
575
|
-
"onUpdate:modelValue": (
|
|
565
|
+
modelValue: h[m],
|
|
566
|
+
"onUpdate:modelValue": (M) => h[m] = M,
|
|
576
567
|
filterable: !0,
|
|
577
568
|
clearable: !0,
|
|
578
569
|
style: "width: 100%"
|
|
579
570
|
}, i, {
|
|
580
|
-
onChange: (
|
|
581
|
-
onClear: () =>
|
|
582
|
-
}), _isSlot(o =
|
|
583
|
-
key:
|
|
584
|
-
label:
|
|
585
|
-
value:
|
|
571
|
+
onChange: (M) => s(M),
|
|
572
|
+
onClear: () => u()
|
|
573
|
+
}), _isSlot(o = e.map((M) => createVNode(resolveComponent("el-option"), {
|
|
574
|
+
key: M[d],
|
|
575
|
+
label: M[Z],
|
|
576
|
+
value: M[d]
|
|
586
577
|
}, null))) ? o : {
|
|
587
578
|
default: () => [o]
|
|
588
579
|
})];
|
|
@@ -594,52 +585,51 @@ const VxetableRender = (VXETable, {
|
|
|
594
585
|
field: h
|
|
595
586
|
} = l, {
|
|
596
587
|
props: r,
|
|
597
|
-
events:
|
|
588
|
+
events: e
|
|
598
589
|
} = a, i = useComponent(), {
|
|
599
|
-
defaultValues:
|
|
600
|
-
mapField:
|
|
590
|
+
defaultValues: t,
|
|
591
|
+
mapField: c
|
|
601
592
|
} = r;
|
|
602
|
-
|
|
603
|
-
function
|
|
593
|
+
t && (o[h] = t);
|
|
594
|
+
function Z(n, f) {
|
|
604
595
|
const {
|
|
605
|
-
mapField:
|
|
606
|
-
field:
|
|
607
|
-
displayName:
|
|
608
|
-
multiple:
|
|
596
|
+
mapField: H,
|
|
597
|
+
field: m,
|
|
598
|
+
displayName: s,
|
|
599
|
+
multiple: u
|
|
609
600
|
} = r;
|
|
610
|
-
if (
|
|
611
|
-
if (
|
|
601
|
+
if (u) {
|
|
602
|
+
if (u) {
|
|
612
603
|
const C = {};
|
|
613
|
-
o[
|
|
614
|
-
for (const
|
|
615
|
-
C[
|
|
616
|
-
return A = A ? A + "," + w[
|
|
604
|
+
o[s || m] = n.reduce((A, w) => {
|
|
605
|
+
for (const V in H)
|
|
606
|
+
C[V] = A ? C[V] + "," + w[H[V]] : w[H[V]];
|
|
607
|
+
return A = A ? A + "," + w[s || m] : w[s || m], A;
|
|
617
608
|
}, ""), Object.assign(o, C);
|
|
618
609
|
}
|
|
619
610
|
} else {
|
|
620
611
|
const C = {
|
|
621
|
-
[
|
|
612
|
+
[s || m]: n[f || s || m]
|
|
622
613
|
};
|
|
623
|
-
for (const A in
|
|
624
|
-
C[A] =
|
|
614
|
+
for (const A in H)
|
|
615
|
+
C[A] = n[H[A]];
|
|
625
616
|
Object.assign(o, C);
|
|
626
617
|
}
|
|
627
|
-
const
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
field: H
|
|
618
|
+
const M = {
|
|
619
|
+
data: o,
|
|
620
|
+
options: n,
|
|
621
|
+
field: m
|
|
632
622
|
};
|
|
633
|
-
|
|
623
|
+
e != null && e.change && e.change(M);
|
|
634
624
|
}
|
|
635
625
|
function d() {
|
|
636
|
-
i.clear(o, h,
|
|
626
|
+
i.clear(o, h, c, e, "data");
|
|
637
627
|
}
|
|
638
628
|
return [createVNode(resolveComponent("ut-lov"), mergeProps({
|
|
639
629
|
record: o
|
|
640
630
|
}, r, {
|
|
641
631
|
mode: "vxe",
|
|
642
|
-
onChange: (
|
|
632
|
+
onChange: (n, f) => Z(n, f),
|
|
643
633
|
onClear: () => d()
|
|
644
634
|
}), null)];
|
|
645
635
|
},
|
|
@@ -650,35 +640,40 @@ const VxetableRender = (VXETable, {
|
|
|
650
640
|
column: h
|
|
651
641
|
} = l, {
|
|
652
642
|
props: r,
|
|
653
|
-
events:
|
|
643
|
+
events: e
|
|
654
644
|
} = a, i = useComponent();
|
|
655
|
-
function Z
|
|
645
|
+
function t(Z, d) {
|
|
656
646
|
const {
|
|
657
|
-
mapField:
|
|
658
|
-
field:
|
|
659
|
-
displayName:
|
|
660
|
-
multiple:
|
|
647
|
+
mapField: n,
|
|
648
|
+
field: f,
|
|
649
|
+
displayName: H,
|
|
650
|
+
multiple: m
|
|
661
651
|
} = r;
|
|
662
|
-
if (!
|
|
663
|
-
const
|
|
664
|
-
[
|
|
652
|
+
if (!m) {
|
|
653
|
+
const u = {
|
|
654
|
+
[H || f]: Z[d || H || f]
|
|
665
655
|
};
|
|
666
|
-
for (const
|
|
667
|
-
|
|
668
|
-
Object.assign(o,
|
|
656
|
+
for (const M in n)
|
|
657
|
+
u[M] = Z[n[M]];
|
|
658
|
+
Object.assign(o, u);
|
|
669
659
|
}
|
|
670
|
-
|
|
660
|
+
const s = {
|
|
661
|
+
row: o,
|
|
662
|
+
options: Z,
|
|
663
|
+
field: h.field
|
|
664
|
+
};
|
|
665
|
+
e != null && e.change && e.change(s);
|
|
671
666
|
}
|
|
672
|
-
function
|
|
673
|
-
i.clear(o, h.field, mapField,
|
|
667
|
+
function c() {
|
|
668
|
+
i.clear(o, h.field, mapField, e, "row");
|
|
674
669
|
}
|
|
675
670
|
return [createVNode(resolveComponent("ut-lov"), mergeProps({
|
|
676
671
|
record: o,
|
|
677
672
|
mode: "vxe",
|
|
678
673
|
transfer: !0
|
|
679
674
|
}, r, {
|
|
680
|
-
onChange: (
|
|
681
|
-
onClear: () =>
|
|
675
|
+
onChange: (Z, d) => t(Z, d),
|
|
676
|
+
onClear: () => c()
|
|
682
677
|
}), null)];
|
|
683
678
|
},
|
|
684
679
|
// 单元格默认
|
|
@@ -688,34 +683,39 @@ const VxetableRender = (VXETable, {
|
|
|
688
683
|
column: h
|
|
689
684
|
} = l, {
|
|
690
685
|
props: r,
|
|
691
|
-
events:
|
|
686
|
+
events: e
|
|
692
687
|
} = a, i = useComponent();
|
|
693
|
-
function Z
|
|
688
|
+
function t(Z, d) {
|
|
694
689
|
const {
|
|
695
|
-
mapField:
|
|
696
|
-
field:
|
|
697
|
-
displayName:
|
|
698
|
-
multiple:
|
|
690
|
+
mapField: n,
|
|
691
|
+
field: f,
|
|
692
|
+
displayName: H,
|
|
693
|
+
multiple: m
|
|
699
694
|
} = r;
|
|
700
|
-
if (!
|
|
701
|
-
const
|
|
702
|
-
[
|
|
695
|
+
if (!m) {
|
|
696
|
+
const u = {
|
|
697
|
+
[H || f]: Z[d || H || f]
|
|
703
698
|
};
|
|
704
|
-
for (const
|
|
705
|
-
|
|
706
|
-
Object.assign(o,
|
|
699
|
+
for (const M in n)
|
|
700
|
+
u[M] = Z[n[M]];
|
|
701
|
+
Object.assign(o, u);
|
|
707
702
|
}
|
|
708
|
-
|
|
703
|
+
const s = {
|
|
704
|
+
row: o,
|
|
705
|
+
options: Z,
|
|
706
|
+
field: h.field
|
|
707
|
+
};
|
|
708
|
+
e != null && e.change && e.change(s);
|
|
709
709
|
}
|
|
710
|
-
function
|
|
711
|
-
i.clear(o, h.field, mapField,
|
|
710
|
+
function c() {
|
|
711
|
+
i.clear(o, h.field, mapField, e, "row");
|
|
712
712
|
}
|
|
713
713
|
return [createVNode(resolveComponent("ut-lov"), mergeProps({
|
|
714
714
|
record: o,
|
|
715
715
|
mode: "ele"
|
|
716
716
|
}, r, {
|
|
717
|
-
onChange: (
|
|
718
|
-
onClear: () =>
|
|
717
|
+
onChange: (Z, d) => t(Z, d),
|
|
718
|
+
onClear: () => c()
|
|
719
719
|
}), null)];
|
|
720
720
|
},
|
|
721
721
|
// 可编辑显示模板
|
|
@@ -727,22 +727,62 @@ const VxetableRender = (VXETable, {
|
|
|
727
727
|
return [createVNode("span", null, [o[h.field]])];
|
|
728
728
|
}
|
|
729
729
|
}), VXETable.renderer.add("#upload", {
|
|
730
|
+
renderTableEdit(a, l) {
|
|
731
|
+
const {
|
|
732
|
+
row: o,
|
|
733
|
+
column: h
|
|
734
|
+
} = l, {
|
|
735
|
+
props: r,
|
|
736
|
+
events: e
|
|
737
|
+
} = a;
|
|
738
|
+
function i(t, c) {
|
|
739
|
+
o[h.field] = "", e != null && e.remove && (e == null || e.remove(t, c));
|
|
740
|
+
}
|
|
741
|
+
return [createVNode(resolveComponent("form-upload"), mergeProps({
|
|
742
|
+
record: o,
|
|
743
|
+
field: h.field,
|
|
744
|
+
size: "mini"
|
|
745
|
+
}, r, {
|
|
746
|
+
"render-mode": "column",
|
|
747
|
+
"data-status": "edit",
|
|
748
|
+
onRemove: (t, c) => i(t, c)
|
|
749
|
+
}), null)];
|
|
750
|
+
},
|
|
751
|
+
// 可编辑显示模板
|
|
752
|
+
renderTableCell(a, l) {
|
|
753
|
+
const {
|
|
754
|
+
row: o,
|
|
755
|
+
column: h
|
|
756
|
+
} = l, {
|
|
757
|
+
props: r
|
|
758
|
+
} = a;
|
|
759
|
+
return [createVNode(resolveComponent("form-upload"), mergeProps({
|
|
760
|
+
record: o,
|
|
761
|
+
field: h.field,
|
|
762
|
+
size: "mini"
|
|
763
|
+
}, r, {
|
|
764
|
+
mode: "image",
|
|
765
|
+
"render-mode": "column",
|
|
766
|
+
"data-status": "detail"
|
|
767
|
+
}), null)];
|
|
768
|
+
},
|
|
730
769
|
renderItemContent(a, l) {
|
|
731
770
|
const {
|
|
732
771
|
data: o,
|
|
733
772
|
field: h
|
|
734
773
|
} = l, {
|
|
735
774
|
props: r,
|
|
736
|
-
events:
|
|
775
|
+
events: e
|
|
737
776
|
} = a;
|
|
738
|
-
function i() {
|
|
739
|
-
o[h] = "",
|
|
777
|
+
function i(t, c) {
|
|
778
|
+
o[h] = "", e != null && e.remove && (e == null || e.remove(t, c));
|
|
740
779
|
}
|
|
741
780
|
return [createVNode(resolveComponent("form-upload"), mergeProps({
|
|
742
781
|
record: o,
|
|
743
|
-
field: h
|
|
782
|
+
field: h,
|
|
783
|
+
mode: "image"
|
|
744
784
|
}, r, {
|
|
745
|
-
|
|
785
|
+
onRemove: (t, c) => i(t, c)
|
|
746
786
|
}), null)];
|
|
747
787
|
}
|
|
748
788
|
}), VXETable.renderer.add("#tag", {
|
|
@@ -754,17 +794,17 @@ const VxetableRender = (VXETable, {
|
|
|
754
794
|
column: r
|
|
755
795
|
} = l, {
|
|
756
796
|
props: {
|
|
757
|
-
code:
|
|
797
|
+
code: e,
|
|
758
798
|
tagMap: i
|
|
759
799
|
}
|
|
760
800
|
} = a;
|
|
761
|
-
function
|
|
801
|
+
function t() {
|
|
762
802
|
return h[r.field] ? i[h[r.field]] : null;
|
|
763
803
|
}
|
|
764
804
|
return [h[r.field] ? createVNode(resolveComponent("el-tag"), {
|
|
765
805
|
effect: "dark",
|
|
766
|
-
type:
|
|
767
|
-
}, _isSlot(o = getValue(
|
|
806
|
+
type: t()
|
|
807
|
+
}, _isSlot(o = getValue(e, h[r.field])) ? o : {
|
|
768
808
|
default: () => [o]
|
|
769
809
|
}) : null];
|
|
770
810
|
}
|
|
@@ -776,29 +816,29 @@ const VxetableRender = (VXETable, {
|
|
|
776
816
|
} = l, {
|
|
777
817
|
props: {
|
|
778
818
|
code: r,
|
|
779
|
-
activeValue:
|
|
819
|
+
activeValue: e,
|
|
780
820
|
inactiveValue: i
|
|
781
821
|
},
|
|
782
|
-
events:
|
|
822
|
+
events: t
|
|
783
823
|
} = a;
|
|
784
|
-
function
|
|
824
|
+
function c(Z) {
|
|
785
825
|
const d = {
|
|
786
826
|
row: o,
|
|
787
827
|
column: h,
|
|
788
|
-
value:
|
|
828
|
+
value: Z
|
|
789
829
|
};
|
|
790
|
-
|
|
830
|
+
t != null && t.change && t.change(d);
|
|
791
831
|
}
|
|
792
832
|
return [o[h.field] ? createVNode(resolveComponent("el-switch"), mergeProps({
|
|
793
833
|
modelValue: o[h.field],
|
|
794
|
-
"onUpdate:modelValue": (
|
|
834
|
+
"onUpdate:modelValue": (Z) => o[h.field] = Z,
|
|
795
835
|
"inline-prompt": !0,
|
|
796
836
|
size: "large",
|
|
797
837
|
style: "--el-switch-on-color: #13ce66; --el-switch-off-color: #E6A23C"
|
|
798
838
|
}, a.props, {
|
|
799
|
-
"active-text": getValue(r,
|
|
839
|
+
"active-text": getValue(r, e),
|
|
800
840
|
"inactive-text": getValue(r, i),
|
|
801
|
-
onChange: (
|
|
841
|
+
onChange: (Z) => c(Z)
|
|
802
842
|
}), null) : null];
|
|
803
843
|
}
|
|
804
844
|
}), VXETable.renderer.add("#iconSelect", {
|
|
@@ -841,19 +881,19 @@ const VxetableRender = (VXETable, {
|
|
|
841
881
|
column: h
|
|
842
882
|
} = l, {
|
|
843
883
|
props: r,
|
|
844
|
-
sourceData:
|
|
884
|
+
sourceData: e,
|
|
845
885
|
events: i
|
|
846
886
|
} = a;
|
|
847
887
|
return [createVNode(resolveComponent("el-tree-select"), mergeProps({
|
|
848
888
|
modelValue: o[h.field],
|
|
849
|
-
"onUpdate:modelValue": (
|
|
850
|
-
data:
|
|
889
|
+
"onUpdate:modelValue": (t) => o[h.field] = t,
|
|
890
|
+
data: e,
|
|
851
891
|
"check-strictly": !0
|
|
852
892
|
}, r, {
|
|
853
893
|
filterable: !0,
|
|
854
|
-
onCheckChange: (
|
|
855
|
-
onNodeClick: (
|
|
856
|
-
onCurrentChange: (
|
|
894
|
+
onCheckChange: (t, c, Z) => onCheckChange(t, c, Z, i),
|
|
895
|
+
onNodeClick: (t, c, Z) => onNodeClick(t, c, Z, i),
|
|
896
|
+
onCurrentChange: (t, c) => onCurrentChange(t, c, i)
|
|
857
897
|
}), null)];
|
|
858
898
|
},
|
|
859
899
|
renderTableCell(a, l) {
|
|
@@ -862,14 +902,14 @@ const VxetableRender = (VXETable, {
|
|
|
862
902
|
column: h
|
|
863
903
|
} = l, {
|
|
864
904
|
sourceData: r,
|
|
865
|
-
props:
|
|
905
|
+
props: e = {}
|
|
866
906
|
} = a, {
|
|
867
907
|
children: i = "children",
|
|
868
|
-
label:
|
|
869
|
-
} =
|
|
908
|
+
label: t = "label"
|
|
909
|
+
} = e, c = findTree(r, (Z) => Z.value === o[h.field], {
|
|
870
910
|
children: i
|
|
871
911
|
});
|
|
872
|
-
return
|
|
912
|
+
return c ? [createVNode("span", null, [c.item[t]])] : null;
|
|
873
913
|
},
|
|
874
914
|
renderItemContent(a, l) {
|
|
875
915
|
const {
|
|
@@ -877,96 +917,96 @@ const VxetableRender = (VXETable, {
|
|
|
877
917
|
field: h
|
|
878
918
|
} = l, {
|
|
879
919
|
props: r,
|
|
880
|
-
sourceData:
|
|
920
|
+
sourceData: e,
|
|
881
921
|
events: i
|
|
882
922
|
} = a;
|
|
883
923
|
return [createVNode(resolveComponent("el-tree-select"), mergeProps({
|
|
884
924
|
modelValue: o[h],
|
|
885
|
-
"onUpdate:modelValue": (
|
|
886
|
-
data:
|
|
925
|
+
"onUpdate:modelValue": (t) => o[h] = t,
|
|
926
|
+
data: e,
|
|
887
927
|
"check-strictly": !0
|
|
888
928
|
}, r, {
|
|
889
929
|
filterable: !0,
|
|
890
|
-
onCheckChange: (
|
|
891
|
-
onNodeClick: (
|
|
892
|
-
onCurrentChange: (
|
|
930
|
+
onCheckChange: (t, c, Z) => onCheckChange(t, c, Z, i),
|
|
931
|
+
onNodeClick: (t, c, Z) => onNodeClick(t, c, Z, i),
|
|
932
|
+
onCurrentChange: (t, c) => onCurrentChange(t, c, i)
|
|
893
933
|
}), null)];
|
|
894
934
|
}
|
|
895
935
|
});
|
|
896
936
|
const useComponent = () => ({
|
|
897
|
-
clear: (r,
|
|
898
|
-
if (r[
|
|
899
|
-
for (const
|
|
900
|
-
r[
|
|
901
|
-
|
|
902
|
-
[
|
|
903
|
-
field:
|
|
937
|
+
clear: (r, e, i, t, c) => {
|
|
938
|
+
if (r[e] = null, !isEmpty(i))
|
|
939
|
+
for (const Z in i)
|
|
940
|
+
r[Z] = null;
|
|
941
|
+
t != null && t.clear && t.clear({
|
|
942
|
+
[c]: r,
|
|
943
|
+
field: e
|
|
904
944
|
});
|
|
905
945
|
},
|
|
906
|
-
remote: async (r,
|
|
946
|
+
remote: async (r, e, i) => {
|
|
907
947
|
const {
|
|
908
|
-
options:
|
|
909
|
-
props:
|
|
910
|
-
events:
|
|
948
|
+
options: t,
|
|
949
|
+
props: c,
|
|
950
|
+
events: Z
|
|
911
951
|
} = i, {
|
|
912
952
|
fetchField: d,
|
|
913
|
-
url:
|
|
914
|
-
defaultParams:
|
|
915
|
-
method:
|
|
916
|
-
} =
|
|
953
|
+
url: n,
|
|
954
|
+
defaultParams: f = {},
|
|
955
|
+
method: H = "get"
|
|
956
|
+
} = c, m = getCookieParam(), s = Object.assign({
|
|
917
957
|
pageSize: 20,
|
|
918
958
|
pageNum: 1,
|
|
919
|
-
...
|
|
920
|
-
...
|
|
959
|
+
...m,
|
|
960
|
+
...f
|
|
921
961
|
}, {
|
|
922
|
-
[d ||
|
|
962
|
+
[d || e]: r
|
|
923
963
|
});
|
|
924
|
-
if (
|
|
925
|
-
let
|
|
964
|
+
if (c.loading) return;
|
|
965
|
+
let u;
|
|
926
966
|
try {
|
|
927
|
-
|
|
967
|
+
t.length = 0, c.loading = !0, u = await serviceApi[H](n, s), Z != null && Z.filterMethod ? t.push(...Z.filterMethod(u.list || u)) : u && (u.list ? t.push(...u.list) : t.push(...u));
|
|
928
968
|
} finally {
|
|
929
|
-
|
|
969
|
+
c.loading = !1;
|
|
930
970
|
}
|
|
931
971
|
},
|
|
932
|
-
selectChange: (r,
|
|
933
|
-
let
|
|
972
|
+
selectChange: (r, e, i, t, c) => {
|
|
973
|
+
let Z = null;
|
|
934
974
|
const {
|
|
935
975
|
datasource: d
|
|
936
|
-
} =
|
|
937
|
-
options:
|
|
938
|
-
props:
|
|
939
|
-
optionProps:
|
|
940
|
-
events:
|
|
941
|
-
} =
|
|
942
|
-
[d]:
|
|
976
|
+
} = c, {
|
|
977
|
+
options: n,
|
|
978
|
+
props: f,
|
|
979
|
+
optionProps: H = {},
|
|
980
|
+
events: m
|
|
981
|
+
} = t, s = {
|
|
982
|
+
[d]: e,
|
|
943
983
|
field: i
|
|
944
984
|
};
|
|
945
|
-
|
|
946
|
-
const
|
|
947
|
-
|
|
948
|
-
const A =
|
|
949
|
-
|
|
950
|
-
}),
|
|
951
|
-
}), Object.assign(
|
|
952
|
-
options:
|
|
953
|
-
})) : (
|
|
954
|
-
|
|
955
|
-
}), Object.assign(
|
|
956
|
-
option:
|
|
957
|
-
})), d === "row" && Object.assign(
|
|
958
|
-
column:
|
|
959
|
-
}),
|
|
960
|
-
},
|
|
961
|
-
setDefaultValue: (r,
|
|
985
|
+
e[i] = null, !isEmpty(r) && (f != null && f.multiple) ? (e[i] = r.join(","), Z = [], r.forEach((u) => {
|
|
986
|
+
const M = n.find((C) => u === C[H == null ? void 0 : H.value]);
|
|
987
|
+
M && !isEmpty(f.mapField) && isObject(f.mapField) && Object.keys(f.mapField).forEach((C) => {
|
|
988
|
+
const A = M[f.mapField[C]], w = e[C] ? e[C].toString() : "";
|
|
989
|
+
e[C] = w && !w.includes(A) ? `${w},${A}` : A;
|
|
990
|
+
}), M && Z.push(M);
|
|
991
|
+
}), Object.assign(s, {
|
|
992
|
+
options: Z
|
|
993
|
+
})) : (e[i] = f != null && f.multiple ? null : r, Z = n.find((u) => r === u[H == null ? void 0 : H.value]), !isEmpty(f.mapField) && isObject(f.mapField) && Object.keys(f.mapField).forEach((u) => {
|
|
994
|
+
e[u] = Z ? Z[f.mapField[u]] : null;
|
|
995
|
+
}), Object.assign(s, {
|
|
996
|
+
option: Z
|
|
997
|
+
})), d === "row" && Object.assign(s, {
|
|
998
|
+
column: c.column
|
|
999
|
+
}), m != null && m.change && m.change(s);
|
|
1000
|
+
},
|
|
1001
|
+
setDefaultValue: (r, e, i) => {
|
|
962
1002
|
var d;
|
|
963
1003
|
const {
|
|
964
|
-
multiple:
|
|
965
|
-
defaultValue:
|
|
966
|
-
} = r,
|
|
967
|
-
!
|
|
968
|
-
|
|
969
|
-
})), !
|
|
1004
|
+
multiple: t,
|
|
1005
|
+
defaultValue: c
|
|
1006
|
+
} = r, Z = t ? `_${i}` : i;
|
|
1007
|
+
!e[i] && c && (e[i] = c, isPlainObject(c) && Object.keys(c).forEach((f) => {
|
|
1008
|
+
e[f] = e[f] || c[f];
|
|
1009
|
+
})), !e[Z] && e[i] && (e[Z] = t ? (d = e[i]) == null ? void 0 : d.split(",") : e[i]);
|
|
970
1010
|
}
|
|
971
1011
|
}), onCheckChange = (a, l, o, h) => {
|
|
972
1012
|
console.log(a, l, o), h != null && h.checkChange && (h == null || h.checkChange(a, l, o));
|
|
@@ -977,7 +1017,7 @@ const VxetableRender = (VXETable, {
|
|
|
977
1017
|
};
|
|
978
1018
|
function getValue(a, l) {
|
|
979
1019
|
var o, h, r;
|
|
980
|
-
return !l || !a || !dict ? l : (r = (h = (o = dict[a]) == null ? void 0 : o.children) == null ? void 0 : h.find((
|
|
1020
|
+
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;
|
|
981
1021
|
}
|
|
982
1022
|
return VXETable;
|
|
983
1023
|
}, getCookieParam = () => {
|
|
@@ -991,12 +1031,12 @@ const VxetableRender = (VXETable, {
|
|
|
991
1031
|
}, removeClass = (a, l, o) => {
|
|
992
1032
|
var h, r;
|
|
993
1033
|
if (hasClass(a, l)) {
|
|
994
|
-
const
|
|
995
|
-
a.className = (h = a.className) == null ? void 0 : h.replace(
|
|
1034
|
+
const e = new RegExp("(\\s|^)" + l + "(\\s|$)");
|
|
1035
|
+
a.className = (h = a.className) == null ? void 0 : h.replace(e, " ").trim();
|
|
996
1036
|
}
|
|
997
1037
|
if (o && hasClass(a, o)) {
|
|
998
|
-
const
|
|
999
|
-
a.className = (r = a.className) == null ? void 0 : r.replace(
|
|
1038
|
+
const e = new RegExp("(\\s|^)" + o + "(\\s|$)");
|
|
1039
|
+
a.className = (r = a.className) == null ? void 0 : r.replace(e, " ").trim();
|
|
1000
1040
|
}
|
|
1001
1041
|
}, toggleClass = (a, l, o) => {
|
|
1002
1042
|
const h = o || document.body;
|
|
@@ -1031,45 +1071,45 @@ const openLink = (a) => {
|
|
|
1031
1071
|
}, domSymbol = Symbol("watermark-dom");
|
|
1032
1072
|
function useWatermark(a = ref(document.body)) {
|
|
1033
1073
|
const l = useRafThrottle(function() {
|
|
1034
|
-
const
|
|
1035
|
-
if (!
|
|
1036
|
-
const { clientHeight: d, clientWidth:
|
|
1037
|
-
i({ height: d, width:
|
|
1074
|
+
const Z = unref(a);
|
|
1075
|
+
if (!Z) return;
|
|
1076
|
+
const { clientHeight: d, clientWidth: n } = Z;
|
|
1077
|
+
i({ height: d, width: n });
|
|
1038
1078
|
}), o = domSymbol.toString(), h = shallowRef(), r = () => {
|
|
1039
|
-
const
|
|
1079
|
+
const Z = unref(h);
|
|
1040
1080
|
h.value = void 0;
|
|
1041
1081
|
const d = unref(a);
|
|
1042
|
-
d && (
|
|
1082
|
+
d && (Z && d.removeChild(Z), removeResizeListener(d, l));
|
|
1043
1083
|
};
|
|
1044
|
-
function
|
|
1045
|
-
const
|
|
1046
|
-
Object.assign(
|
|
1047
|
-
const
|
|
1048
|
-
return
|
|
1084
|
+
function e(Z, d) {
|
|
1085
|
+
const n = document.createElement("canvas"), f = 260, H = 180;
|
|
1086
|
+
Object.assign(n, { width: f, height: H });
|
|
1087
|
+
const m = n.getContext("2d");
|
|
1088
|
+
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, H)), n.toDataURL("image/png");
|
|
1049
1089
|
}
|
|
1050
|
-
function i(
|
|
1090
|
+
function i(Z = {}) {
|
|
1051
1091
|
const d = unref(h);
|
|
1052
|
-
d && (isUndefined(
|
|
1053
|
-
|
|
1054
|
-
|
|
1092
|
+
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(
|
|
1093
|
+
Z.str,
|
|
1094
|
+
Z.attr
|
|
1055
1095
|
)}) left top repeat`));
|
|
1056
1096
|
}
|
|
1057
|
-
const
|
|
1097
|
+
const t = (Z, d) => {
|
|
1058
1098
|
if (unref(h))
|
|
1059
|
-
return i({ str:
|
|
1060
|
-
const
|
|
1061
|
-
h.value =
|
|
1062
|
-
const
|
|
1063
|
-
if (!
|
|
1064
|
-
const { clientHeight:
|
|
1065
|
-
return i({ str:
|
|
1099
|
+
return i({ str: Z, attr: d }), o;
|
|
1100
|
+
const n = document.createElement("div");
|
|
1101
|
+
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";
|
|
1102
|
+
const f = unref(a);
|
|
1103
|
+
if (!f) return o;
|
|
1104
|
+
const { clientHeight: H, clientWidth: m } = f;
|
|
1105
|
+
return i({ str: Z, width: m, height: H, attr: d }), f.appendChild(n), o;
|
|
1066
1106
|
};
|
|
1067
|
-
function
|
|
1068
|
-
Z
|
|
1107
|
+
function c(Z, d) {
|
|
1108
|
+
t(Z, d), addResizeListener(document.documentElement, l), getCurrentInstance() && onBeforeUnmount(() => {
|
|
1069
1109
|
r();
|
|
1070
1110
|
});
|
|
1071
1111
|
}
|
|
1072
|
-
return { setWatermark:
|
|
1112
|
+
return { setWatermark: c, clear: r };
|
|
1073
1113
|
}
|
|
1074
1114
|
const DEFAULT_EXCLUDE_KEYS = ["class", "style"], LISTENER_PREFIX = /^on[A-Z]/;
|
|
1075
1115
|
function entries(a) {
|
|
@@ -1078,164 +1118,164 @@ function entries(a) {
|
|
|
1078
1118
|
function useAttrs(a = {}) {
|
|
1079
1119
|
const l = getCurrentInstance();
|
|
1080
1120
|
if (!l) return {};
|
|
1081
|
-
const { excludeListeners: o = !1, excludeKeys: h = [] } = a, r = shallowRef({}),
|
|
1121
|
+
const { excludeListeners: o = !1, excludeKeys: h = [] } = a, r = shallowRef({}), e = h.concat(DEFAULT_EXCLUDE_KEYS);
|
|
1082
1122
|
return l.attrs = reactive(l.attrs), watchEffect(() => {
|
|
1083
|
-
const i = entries(l.attrs).reduce((
|
|
1123
|
+
const i = entries(l.attrs).reduce((t, [c, Z]) => (!e.includes(c) && !(o && LISTENER_PREFIX.test(c)) && (t[c] = Z), t), {});
|
|
1084
1124
|
r.value = i;
|
|
1085
1125
|
}), r;
|
|
1086
1126
|
}
|
|
1087
1127
|
const useRender = () => {
|
|
1088
|
-
const a = { value: "dictCode", label: "dictName" }, l = (
|
|
1089
|
-
var
|
|
1090
|
-
const b =
|
|
1091
|
-
let
|
|
1128
|
+
const a = { value: "dictCode", label: "dictName" }, l = (v, p) => {
|
|
1129
|
+
var N;
|
|
1130
|
+
const b = k(p);
|
|
1131
|
+
let y = {
|
|
1092
1132
|
clearable: !0,
|
|
1093
1133
|
disabled: !1,
|
|
1094
1134
|
showValue: !1,
|
|
1095
1135
|
placeholder: null
|
|
1096
|
-
}, L,
|
|
1097
|
-
isObject(
|
|
1098
|
-
const
|
|
1136
|
+
}, L, x;
|
|
1137
|
+
isObject(v) ? (y = Object.assign(y, v), L = v.defaultValue, x = v == null ? void 0 : v.code) : x = v;
|
|
1138
|
+
const D = (N = storageLocal.getItem("kLov")[x]) == null ? void 0 : N.children, F = D ? D.filter((E) => E.enabled === "1") : [];
|
|
1099
1139
|
return {
|
|
1100
1140
|
name: "#select",
|
|
1101
1141
|
optionProps: a,
|
|
1102
|
-
options:
|
|
1103
|
-
props:
|
|
1142
|
+
options: F,
|
|
1143
|
+
props: y,
|
|
1104
1144
|
defaultValue: L,
|
|
1105
1145
|
events: b
|
|
1106
1146
|
};
|
|
1107
|
-
}, o = (
|
|
1108
|
-
const b =
|
|
1147
|
+
}, o = (v, p) => {
|
|
1148
|
+
const b = k(p);
|
|
1109
1149
|
return {
|
|
1110
1150
|
name: "#SuSelect",
|
|
1111
|
-
optionProps: (
|
|
1112
|
-
props:
|
|
1113
|
-
options: (
|
|
1151
|
+
optionProps: (v == null ? void 0 : v.optionProps) || { label: "label", value: "value" },
|
|
1152
|
+
props: v == null ? void 0 : v.props,
|
|
1153
|
+
options: (v == null ? void 0 : v.options) || [],
|
|
1114
1154
|
events: b
|
|
1115
1155
|
};
|
|
1116
|
-
}, h = (
|
|
1156
|
+
}, h = (v, p) => {
|
|
1117
1157
|
const b = {
|
|
1118
1158
|
optionProps: { extLabel: "userName", value: "employeeName" },
|
|
1119
1159
|
props: {
|
|
1120
|
-
attrs: { disabled:
|
|
1121
|
-
disabled:
|
|
1122
|
-
defaultValue:
|
|
1123
|
-
mapField:
|
|
1160
|
+
attrs: { disabled: v == null ? void 0 : v.disabled },
|
|
1161
|
+
disabled: v == null ? void 0 : v.disabled,
|
|
1162
|
+
defaultValue: v == null ? void 0 : v.defaultValue,
|
|
1163
|
+
mapField: v == null ? void 0 : v.mapField,
|
|
1124
1164
|
code: "SYS037",
|
|
1125
1165
|
url: "/uums/employee/listEmployeeIsUser",
|
|
1126
1166
|
fetchField: "employeeName"
|
|
1127
1167
|
}
|
|
1128
1168
|
};
|
|
1129
|
-
return o(b,
|
|
1130
|
-
}, r = (
|
|
1131
|
-
const
|
|
1169
|
+
return o(b, p);
|
|
1170
|
+
}, r = (v) => {
|
|
1171
|
+
const p = {
|
|
1132
1172
|
optionProps: { extLabel: "userName", value: "name" },
|
|
1133
1173
|
props: {
|
|
1134
1174
|
code: "sys/listUsers",
|
|
1135
1175
|
url: "/uums/user",
|
|
1136
1176
|
fetchField: "name",
|
|
1137
|
-
mapField:
|
|
1177
|
+
mapField: v == null ? void 0 : v.mapField
|
|
1138
1178
|
}
|
|
1139
1179
|
};
|
|
1140
|
-
return o(
|
|
1141
|
-
},
|
|
1180
|
+
return o(p);
|
|
1181
|
+
}, e = (v, p) => {
|
|
1142
1182
|
const b = {
|
|
1143
1183
|
label: "organizationName",
|
|
1144
|
-
value: (
|
|
1145
|
-
},
|
|
1184
|
+
value: (v == null ? void 0 : v.field) || "organizationName"
|
|
1185
|
+
}, y = {
|
|
1146
1186
|
mapField: {},
|
|
1147
|
-
defaultParams:
|
|
1187
|
+
defaultParams: v == null ? void 0 : v.defaultParams,
|
|
1148
1188
|
url: "/uums/cusOrganization",
|
|
1149
1189
|
fetchField: "organizationName"
|
|
1150
1190
|
}, L = {
|
|
1151
1191
|
organizationId: "id",
|
|
1152
1192
|
organizationCode: "organizationCode"
|
|
1153
1193
|
};
|
|
1154
|
-
return Object.assign(
|
|
1155
|
-
}, i = (
|
|
1194
|
+
return Object.assign(y.mapField, L, (v == null ? void 0 : v.mapField) || {}), { name: "#SuSelect", props: y, optionProps: b, options: [], methods: p };
|
|
1195
|
+
}, i = (v, p) => {
|
|
1156
1196
|
const b = {
|
|
1157
1197
|
label: "orgName",
|
|
1158
|
-
value: (
|
|
1159
|
-
},
|
|
1198
|
+
value: (v == null ? void 0 : v.field) || "orgName"
|
|
1199
|
+
}, y = {
|
|
1160
1200
|
mapField: {},
|
|
1161
|
-
defaultParams:
|
|
1201
|
+
defaultParams: v == null ? void 0 : v.defaultParams,
|
|
1162
1202
|
url: "/uums/org",
|
|
1163
1203
|
fetchField: "orgName"
|
|
1164
1204
|
}, L = { orgId: "id", orgCode: "orgCode" };
|
|
1165
|
-
return Object.assign(
|
|
1166
|
-
},
|
|
1167
|
-
const b = Object.assign({ disabled: !1 },
|
|
1205
|
+
return Object.assign(y.mapField, L, (v == null ? void 0 : v.mapField) || {}), { name: "#SuSelect", props: y, optionProps: b, options: [], methods: p };
|
|
1206
|
+
}, t = (v, p) => {
|
|
1207
|
+
const b = Object.assign({ disabled: !1 }, v), y = b == null ? void 0 : b.defaultValue;
|
|
1168
1208
|
return {
|
|
1169
1209
|
name: "VxeInput",
|
|
1170
1210
|
props: b,
|
|
1171
|
-
defaultValue:
|
|
1172
|
-
events:
|
|
1211
|
+
defaultValue: y,
|
|
1212
|
+
events: k(p)
|
|
1173
1213
|
};
|
|
1174
|
-
},
|
|
1175
|
-
const b = Object.assign({ disabled: !1, rows: 3 },
|
|
1214
|
+
}, c = (v, p) => {
|
|
1215
|
+
const b = Object.assign({ disabled: !1, rows: 3 }, v), y = b == null ? void 0 : b.defaultValue;
|
|
1176
1216
|
return {
|
|
1177
|
-
name: "
|
|
1217
|
+
name: "#textarea",
|
|
1178
1218
|
props: b,
|
|
1179
|
-
defaultValue:
|
|
1180
|
-
events:
|
|
1219
|
+
defaultValue: y,
|
|
1220
|
+
events: k(p)
|
|
1181
1221
|
};
|
|
1182
|
-
},
|
|
1183
|
-
const b = "VxeCheckbox", { defaultValue:
|
|
1184
|
-
return { name: b, defaultValue:
|
|
1185
|
-
}, d = (
|
|
1186
|
-
const b = "VxeRadio", { defaultValue:
|
|
1187
|
-
return { name: b, defaultValue:
|
|
1188
|
-
},
|
|
1189
|
-
var
|
|
1190
|
-
let
|
|
1191
|
-
const
|
|
1222
|
+
}, Z = (v, p) => {
|
|
1223
|
+
const b = "VxeCheckbox", { defaultValue: y, options: L, props: x } = n(v);
|
|
1224
|
+
return { name: b, defaultValue: y, options: L, props: x, events: k(p) };
|
|
1225
|
+
}, d = (v, p) => {
|
|
1226
|
+
const b = "VxeRadio", { defaultValue: y, options: L, props: x } = n(v);
|
|
1227
|
+
return { name: b, defaultValue: y, options: L, props: x, events: k(p) };
|
|
1228
|
+
}, n = (v) => {
|
|
1229
|
+
var D;
|
|
1230
|
+
let p = { disabled: !1 }, b;
|
|
1231
|
+
const y = storageLocal.getItem("kLov");
|
|
1192
1232
|
let L = "";
|
|
1193
|
-
isObject(
|
|
1194
|
-
const
|
|
1195
|
-
return { props:
|
|
1196
|
-
},
|
|
1197
|
-
const b =
|
|
1233
|
+
isObject(v) ? (b = v.defaultValue, L = v.code, p = Object.assign(p, v || {})) : isString(v) && (L = v);
|
|
1234
|
+
const x = L ? (D = y[L]) == null ? void 0 : D.children.map((F) => ({ label: F.dictName, value: F.dictCode })) : [];
|
|
1235
|
+
return { props: p, defaultValue: b, options: x };
|
|
1236
|
+
}, f = (v, p) => {
|
|
1237
|
+
const b = k(p);
|
|
1198
1238
|
return {
|
|
1199
1239
|
name: "VxeInput",
|
|
1200
1240
|
props: Object.assign(
|
|
1201
1241
|
{ type: "number", clearable: !0, min: 0, controls: !1 },
|
|
1202
|
-
|
|
1242
|
+
v || {}
|
|
1203
1243
|
),
|
|
1204
|
-
defaultValue:
|
|
1244
|
+
defaultValue: v == null ? void 0 : v.defaultValue,
|
|
1205
1245
|
events: b
|
|
1206
1246
|
};
|
|
1207
|
-
},
|
|
1208
|
-
const b =
|
|
1209
|
-
return { name: "VxeInput", props: Object.assign({ type: "date", valueFormat:
|
|
1210
|
-
},
|
|
1211
|
-
const b =
|
|
1212
|
-
return { name: "#lov", props: Object.assign({},
|
|
1213
|
-
},
|
|
1214
|
-
const b =
|
|
1247
|
+
}, H = (v, p) => {
|
|
1248
|
+
const b = k(p), y = "yyyy-MM-dd HH:mm:ss", L = v == null ? void 0 : v.defaultValue;
|
|
1249
|
+
return { name: "VxeInput", props: Object.assign({ type: "date", valueFormat: y, clearable: !0 }, v || {}), defaultValue: L, events: b };
|
|
1250
|
+
}, m = (v, p) => {
|
|
1251
|
+
const b = k(p);
|
|
1252
|
+
return { name: "#lov", props: Object.assign({}, v || {}), events: b };
|
|
1253
|
+
}, s = (v, p) => {
|
|
1254
|
+
const b = k(p), y = (v == null ? void 0 : v.optionProps) || {
|
|
1215
1255
|
label: "label",
|
|
1216
1256
|
value: "value"
|
|
1217
1257
|
}, L = Object.assign(
|
|
1218
1258
|
{ clearable: !0, disabled: !1, showValue: !1 },
|
|
1219
|
-
|
|
1259
|
+
v || {}
|
|
1220
1260
|
);
|
|
1221
1261
|
return console.log("itemRender"), {
|
|
1222
1262
|
name: "#select",
|
|
1223
|
-
optionProps:
|
|
1224
|
-
options: (
|
|
1263
|
+
optionProps: y,
|
|
1264
|
+
options: (v == null ? void 0 : v.options) || [],
|
|
1225
1265
|
props: L,
|
|
1226
1266
|
events: b
|
|
1227
1267
|
};
|
|
1228
|
-
},
|
|
1268
|
+
}, u = (v, p) => {
|
|
1229
1269
|
let b = {
|
|
1230
1270
|
openLabel: "是",
|
|
1231
1271
|
closeLabel: "否",
|
|
1232
1272
|
openValue: "Y",
|
|
1233
1273
|
closeValue: "N"
|
|
1234
|
-
},
|
|
1235
|
-
isObject(
|
|
1236
|
-
const L = isFunction(
|
|
1237
|
-
return { name: "VxeSwitch", props: b, defaultValue:
|
|
1238
|
-
},
|
|
1274
|
+
}, y = "Y";
|
|
1275
|
+
isObject(v) && !isFunction(v) ? (b = Object.assign(b, v || {}), y = v.defaultValue || y) : !isEmpty(v) && isString(v) && (y = v, b = Object.assign(b, { defaultValue: y }));
|
|
1276
|
+
const L = isFunction(v) ? k(v) : k(p);
|
|
1277
|
+
return { name: "VxeSwitch", props: b, defaultValue: y, events: L };
|
|
1278
|
+
}, M = (v, p) => ({ name: "#tag", props: { code: v, tagMap: p } }), C = (v, p) => {
|
|
1239
1279
|
const b = {
|
|
1240
1280
|
openLabel: "启用",
|
|
1241
1281
|
closeLabel: "禁用",
|
|
@@ -1243,55 +1283,75 @@ const useRender = () => {
|
|
|
1243
1283
|
closeValue: "0",
|
|
1244
1284
|
defaultValue: "1"
|
|
1245
1285
|
};
|
|
1246
|
-
!isFunction(
|
|
1247
|
-
const
|
|
1248
|
-
return
|
|
1249
|
-
}, A = () => ({ name: "#iconSelect" }), w = (
|
|
1250
|
-
|
|
1251
|
-
return
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1286
|
+
!isFunction(v) && isObject(v) && Object.assign(b, v);
|
|
1287
|
+
const y = isFunction(v) ? v : p;
|
|
1288
|
+
return u(b, y);
|
|
1289
|
+
}, A = () => ({ name: "#iconSelect" }), w = (v = [], p = {}, b) => ({ name: "#treeSelect", sourceData: v, props: p, events: b }), V = (v, p) => {
|
|
1290
|
+
const b = k(p);
|
|
1291
|
+
return {
|
|
1292
|
+
name: "#area",
|
|
1293
|
+
props: { mapField: (v == null ? void 0 : v.mapField) || ["province", "city", "region"] },
|
|
1294
|
+
events: b
|
|
1295
|
+
};
|
|
1296
|
+
}, k = (v) => {
|
|
1297
|
+
let p = {};
|
|
1298
|
+
return isObject(v) && !isFunction(v) ? p = {
|
|
1299
|
+
change: (v == null ? void 0 : v.change) || I,
|
|
1300
|
+
blur: (v == null ? void 0 : v.blur) || I,
|
|
1301
|
+
focus: (v == null ? void 0 : v.focus) || I,
|
|
1302
|
+
input: (v == null ? void 0 : v.input) || I,
|
|
1303
|
+
clear: (v == null ? void 0 : v.clear) || I,
|
|
1304
|
+
searchClick: v == null ? void 0 : v.searchClick,
|
|
1305
|
+
suffixClick: v == null ? void 0 : v.suffixClick,
|
|
1306
|
+
prefixClick: v == null ? void 0 : v.prefixClick,
|
|
1307
|
+
filterMethod: v == null ? void 0 : v.filterMethod
|
|
1308
|
+
} : v && (p = { change: v }), p;
|
|
1309
|
+
}, R = (v, p) => {
|
|
1310
|
+
v = v || {};
|
|
1311
|
+
const { singleMode: b, mode: y } = v;
|
|
1312
|
+
return b && Object.assign(v, {
|
|
1313
|
+
multiple: !1,
|
|
1314
|
+
limitCount: 1,
|
|
1315
|
+
autoHiddenButton: !0
|
|
1316
|
+
}), (!y || y === "image") && (v.imageTypes = ["jpg", "jpeg", "png", "gif", "apk"]), { name: "#upload", props: v, events: p };
|
|
1259
1317
|
};
|
|
1260
1318
|
function I() {
|
|
1261
1319
|
}
|
|
1262
1320
|
return {
|
|
1263
1321
|
renderDict: l,
|
|
1264
1322
|
renderSelect: o,
|
|
1265
|
-
renderInput:
|
|
1266
|
-
renderTextarea:
|
|
1267
|
-
renderCheckBox:
|
|
1323
|
+
renderInput: t,
|
|
1324
|
+
renderTextarea: c,
|
|
1325
|
+
renderCheckBox: Z,
|
|
1268
1326
|
renderRadio: d,
|
|
1269
1327
|
renderUser: h,
|
|
1270
1328
|
renderSysUser: r,
|
|
1271
|
-
renderInvOrg:
|
|
1329
|
+
renderInvOrg: e,
|
|
1272
1330
|
renderBU: i,
|
|
1273
|
-
renderNumber:
|
|
1274
|
-
renderLov:
|
|
1275
|
-
renderSelectLocal:
|
|
1276
|
-
renderDate:
|
|
1277
|
-
renderSwitch:
|
|
1278
|
-
renderCellTag:
|
|
1331
|
+
renderNumber: f,
|
|
1332
|
+
renderLov: m,
|
|
1333
|
+
renderSelectLocal: s,
|
|
1334
|
+
renderDate: H,
|
|
1335
|
+
renderSwitch: u,
|
|
1336
|
+
renderCellTag: M,
|
|
1279
1337
|
renderEnabled: C,
|
|
1280
1338
|
renderIconSelect: A,
|
|
1281
|
-
renderTreeSelect: w
|
|
1339
|
+
renderTreeSelect: w,
|
|
1340
|
+
renderArea: V,
|
|
1341
|
+
renderUpload: R
|
|
1282
1342
|
};
|
|
1283
1343
|
}, useGlobal = () => {
|
|
1284
1344
|
const a = getCurrentInstance();
|
|
1285
1345
|
if (!a) return { $global: {}, $storage: {}, $config: {} };
|
|
1286
|
-
const l = a.appContext.app.config.globalProperties, o = l.$storage, h = l.$config, r = l.$serviceApi,
|
|
1346
|
+
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;
|
|
1287
1347
|
return {
|
|
1288
1348
|
$global: l,
|
|
1289
1349
|
$storage: o,
|
|
1290
1350
|
$config: h,
|
|
1291
1351
|
$serviceApi: r,
|
|
1292
|
-
$hasAuthority:
|
|
1352
|
+
$hasAuthority: e,
|
|
1293
1353
|
$printPlugin: i,
|
|
1294
|
-
$mode:
|
|
1354
|
+
$mode: t
|
|
1295
1355
|
};
|
|
1296
1356
|
}, hexList = [];
|
|
1297
1357
|
for (let a = 0; a <= 15; a++)
|
|
@@ -1308,8 +1368,8 @@ function buildShortUUID(a = "") {
|
|
|
1308
1368
|
return unique++, a + "_" + o + unique + String(l);
|
|
1309
1369
|
}
|
|
1310
1370
|
const deviceDetection = () => {
|
|
1311
|
-
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",
|
|
1312
|
-
return l || o || h || r ||
|
|
1371
|
+
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";
|
|
1372
|
+
return l || o || h || r || e || i || t;
|
|
1313
1373
|
}, getBrowserInfo = () => {
|
|
1314
1374
|
const a = navigator.userAgent.toLowerCase(), l = /(msie|firefox|chrome|opera|version).*?([\d.]+)/, o = a.match(l);
|
|
1315
1375
|
return {
|
|
@@ -1333,29 +1393,29 @@ const deviceDetection = () => {
|
|
|
1333
1393
|
}, errorMessage = (a = "操作失败", l = {}) => {
|
|
1334
1394
|
var o, h;
|
|
1335
1395
|
return l.type === "alert" ? (o = VxeUI.modal) == null ? void 0 : o.alert({ content: a, ...l, status: "error" }) : (h = VxeUI.modal) == null ? void 0 : h.message({ content: a, ...l, status: "error" });
|
|
1336
|
-
}, renderHook = useRender(), i18nColums = (a) => {
|
|
1337
|
-
let
|
|
1338
|
-
const
|
|
1339
|
-
return a.map((
|
|
1340
|
-
if (
|
|
1341
|
-
|
|
1342
|
-
const { showOverflow:
|
|
1343
|
-
return
|
|
1396
|
+
}, renderHook = useRender(), i18nColums = (a, l = !0) => {
|
|
1397
|
+
let o = 0, h = 0;
|
|
1398
|
+
const r = a.length - 1;
|
|
1399
|
+
return a.map((e, i) => {
|
|
1400
|
+
if (h = h + e.width, e.type) return e;
|
|
1401
|
+
e.title = e.title || `message.${e.field}`;
|
|
1402
|
+
const { showOverflow: t } = e;
|
|
1403
|
+
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;
|
|
1344
1404
|
});
|
|
1345
1405
|
}, formatItems = (a, l, o = 24) => a.length ? a.map((h) => {
|
|
1346
|
-
var r,
|
|
1406
|
+
var r, e, i;
|
|
1347
1407
|
if ((r = h.children) != null && r.length)
|
|
1348
1408
|
return h.children = formatItems(h.children, l, o), h;
|
|
1349
1409
|
{
|
|
1350
|
-
h.title = h.title || `message.${h.field}`, h.span = h.span || o, h.collapseNode && (h.title = "", h.titleWidth = 0);
|
|
1351
|
-
let
|
|
1352
|
-
l === "detail" ? (
|
|
1353
|
-
let
|
|
1410
|
+
h.title = h.title || `message.${h.field}`, h.span = h.span || o, h.type === "collapseNode" && (h.title = "", h.titleWidth = 0);
|
|
1411
|
+
let t = !1;
|
|
1412
|
+
l === "detail" ? (t = !0, h.placeholder = null) : t = h.disabled === !1 ? h.disabled : h.disabled || ((i = (e = h.itemRender) == null ? void 0 : e.props) == null ? void 0 : i.disabled);
|
|
1413
|
+
let c = {
|
|
1354
1414
|
name: "VxeInput",
|
|
1355
|
-
props: { disabled:
|
|
1415
|
+
props: { disabled: t, placeholder: t ? "" : h.placeholder }
|
|
1356
1416
|
};
|
|
1357
|
-
return h.code && !h.itemRender && (
|
|
1358
|
-
disabled:
|
|
1417
|
+
return h.code && !h.itemRender && (c = renderHook.renderDict(h.code)), h.itemRender = h.itemRender || c, h.itemRender.props = Object.assign(h.itemRender.props || {}, {
|
|
1418
|
+
disabled: t
|
|
1359
1419
|
}), h;
|
|
1360
1420
|
}
|
|
1361
1421
|
}) : a, formSearchButtons = {
|
|
@@ -1383,35 +1443,39 @@ const deviceDetection = () => {
|
|
|
1383
1443
|
events: null
|
|
1384
1444
|
}
|
|
1385
1445
|
}, formatGridItems = (a, l) => {
|
|
1386
|
-
const o = a, h = o.length, r = h > 2 && o.some((
|
|
1446
|
+
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 = {
|
|
1387
1447
|
collapseTags: !0,
|
|
1388
1448
|
collapseTagsTooltip: !0,
|
|
1389
1449
|
multiple: !0
|
|
1390
|
-
},
|
|
1391
|
-
var
|
|
1392
|
-
return
|
|
1450
|
+
}, t = o.map((Z, d) => {
|
|
1451
|
+
var n, f, H;
|
|
1452
|
+
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(
|
|
1393
1453
|
i,
|
|
1394
|
-
((
|
|
1395
|
-
)),
|
|
1396
|
-
}),
|
|
1397
|
-
if (
|
|
1398
|
-
const
|
|
1399
|
-
|
|
1454
|
+
((H = Z.itemRender) == null ? void 0 : H.props) || {}
|
|
1455
|
+
)), Z;
|
|
1456
|
+
}), c = clone(formSearchButtons, !0);
|
|
1457
|
+
if (c.collapseNode = e, l && c.itemRender.options.length < 3 && (c.itemRender.options.push(l), c.itemRender.events = l.events), e) {
|
|
1458
|
+
const Z = r ? 2 : 3;
|
|
1459
|
+
t.splice(Z, 0, c);
|
|
1400
1460
|
} else
|
|
1401
|
-
|
|
1402
|
-
return
|
|
1461
|
+
t.push(c);
|
|
1462
|
+
return t;
|
|
1403
1463
|
}, getDateRange = (a) => {
|
|
1404
|
-
var l, o, h, r,
|
|
1405
|
-
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" || !((
|
|
1464
|
+
var l, o, h, r, e;
|
|
1465
|
+
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;
|
|
1406
1466
|
}, formatRules = (a, l) => {
|
|
1407
1467
|
const o = {};
|
|
1408
1468
|
return a.forEach((h) => {
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1469
|
+
var r;
|
|
1470
|
+
if ((r = h.children) != null && r.length) {
|
|
1471
|
+
const e = formatRules(h.children, l);
|
|
1472
|
+
merge(o, e);
|
|
1473
|
+
} else if (h.required) {
|
|
1474
|
+
const { field: e, title: i } = h, t = i == null ? void 0 : i.startsWith("message.");
|
|
1475
|
+
o[e] = [
|
|
1412
1476
|
{
|
|
1413
1477
|
required: !0,
|
|
1414
|
-
message: `${l("message.required")}${
|
|
1478
|
+
message: `${l("message.required")}${i && t ? l(i) : i || l(`message.${e}`)}`
|
|
1415
1479
|
}
|
|
1416
1480
|
];
|
|
1417
1481
|
}
|
|
@@ -1494,9 +1558,9 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1494
1558
|
}
|
|
1495
1559
|
}, g = class g {
|
|
1496
1560
|
constructor() {
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1561
|
+
S(this, "router");
|
|
1562
|
+
S(this, "baseUrl", null);
|
|
1563
|
+
S(this, "getNetworkError", (l) => l ? {
|
|
1500
1564
|
400: "错误的请求",
|
|
1501
1565
|
401: "服务未授权,请重新登录",
|
|
1502
1566
|
403: "拒绝访问",
|
|
@@ -1530,29 +1594,29 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1530
1594
|
(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) => {
|
|
1531
1595
|
const r = cookies.get(kTOKENKEY);
|
|
1532
1596
|
if (r) {
|
|
1533
|
-
const
|
|
1534
|
-
|
|
1535
|
-
refreshToken:
|
|
1536
|
-
}).then((
|
|
1537
|
-
this.setToken(
|
|
1597
|
+
const e = JSON.parse(r), i = (/* @__PURE__ */ new Date()).getTime();
|
|
1598
|
+
e.expires - i <= 0 ? (g.isRefreshing || (g.isRefreshing = !0, this.get(this.baseUrl + "/uath/refreshToken", {
|
|
1599
|
+
refreshToken: e.refreshToken
|
|
1600
|
+
}).then((c) => {
|
|
1601
|
+
this.setToken(c), l.headers.Authorization = "Bearer " + c.access_token, g.requests.forEach((Z) => Z(c.access_token)), g.requests = [];
|
|
1538
1602
|
}).finally(() => {
|
|
1539
1603
|
g.isRefreshing = !1;
|
|
1540
|
-
})), h(g.retryOriginalRequest(l))) : (l.headers.Authorization = "Bearer " +
|
|
1604
|
+
})), h(g.retryOriginalRequest(l))) : (l.headers.Authorization = "Bearer " + e.accessToken, h(l));
|
|
1541
1605
|
} else {
|
|
1542
|
-
const
|
|
1543
|
-
|
|
1606
|
+
const e = cookies.get("kCookies_token");
|
|
1607
|
+
e && (l.headers["X-Token"] = e), h(l);
|
|
1544
1608
|
}
|
|
1545
1609
|
})),
|
|
1546
1610
|
(l) => Promise.reject(l)
|
|
1547
1611
|
);
|
|
1548
1612
|
}
|
|
1549
1613
|
setToken(l) {
|
|
1550
|
-
const { access_token: o, expires_in: h, refresh_token: r } = l,
|
|
1614
|
+
const { access_token: o, expires_in: h, refresh_token: r } = l, e = {
|
|
1551
1615
|
accessToken: o,
|
|
1552
1616
|
refreshToken: r,
|
|
1553
1617
|
expires: Date.now() + h * 1e3
|
|
1554
1618
|
};
|
|
1555
|
-
cookies.set(kTOKENKEY, JSON.stringify(
|
|
1619
|
+
cookies.set(kTOKENKEY, JSON.stringify(e));
|
|
1556
1620
|
}
|
|
1557
1621
|
// 响应拦截
|
|
1558
1622
|
httpInterceptorsResponse() {
|
|
@@ -1569,7 +1633,7 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1569
1633
|
);
|
|
1570
1634
|
}
|
|
1571
1635
|
transformConfigByMethod(l, o) {
|
|
1572
|
-
const { method: h } = o, r = ["get"],
|
|
1636
|
+
const { method: h } = o, r = ["get"], e = h.toLocaleLowerCase(), i = r.includes(e) ? "params" : "data";
|
|
1573
1637
|
return {
|
|
1574
1638
|
...o,
|
|
1575
1639
|
[i]: l
|
|
@@ -1577,34 +1641,34 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1577
1641
|
}
|
|
1578
1642
|
// 通用请求工具函数
|
|
1579
1643
|
request(l, o, h, r) {
|
|
1580
|
-
const
|
|
1644
|
+
const e = this.transformConfigByMethod(h, {
|
|
1581
1645
|
method: l,
|
|
1582
1646
|
url: o,
|
|
1583
1647
|
...r
|
|
1584
1648
|
});
|
|
1585
|
-
return new Promise((i,
|
|
1586
|
-
g.axiosInstance.request(
|
|
1587
|
-
if (
|
|
1588
|
-
i(
|
|
1589
|
-
else if (
|
|
1590
|
-
errorMessage(
|
|
1591
|
-
else if ((
|
|
1592
|
-
i(
|
|
1649
|
+
return new Promise((i, t) => {
|
|
1650
|
+
g.axiosInstance.request(e).then((c) => {
|
|
1651
|
+
if (c && (c == null ? void 0 : c.code) === "0")
|
|
1652
|
+
i(c.data);
|
|
1653
|
+
else if (c.code === "500")
|
|
1654
|
+
errorMessage(c.msg, { duration: 8e3 }), e.method === "get" ? i(c) : t(c.msg);
|
|
1655
|
+
else if ((c == null ? void 0 : c.code) !== "-1")
|
|
1656
|
+
i(c);
|
|
1593
1657
|
else {
|
|
1594
|
-
const
|
|
1595
|
-
errorMessage(
|
|
1658
|
+
const Z = (c == null ? void 0 : c.msg) || "服务异常";
|
|
1659
|
+
errorMessage(Z, { duration: 8e3 }), t(Z);
|
|
1596
1660
|
}
|
|
1597
|
-
}).catch((
|
|
1598
|
-
var
|
|
1599
|
-
if (
|
|
1600
|
-
if (((
|
|
1661
|
+
}).catch((c) => {
|
|
1662
|
+
var Z, d, n;
|
|
1663
|
+
if (c != null && c.code) {
|
|
1664
|
+
if (((Z = c == null ? void 0 : c.response) == null ? void 0 : Z.status) === 401)
|
|
1601
1665
|
return (d = this.router) == null ? void 0 : d.push({ path: "/login" });
|
|
1602
1666
|
errorMessage(
|
|
1603
|
-
this.getNetworkError((
|
|
1667
|
+
this.getNetworkError((n = c == null ? void 0 : c.response) == null ? void 0 : n.status) || (c == null ? void 0 : c.message),
|
|
1604
1668
|
{ duration: 8e3 }
|
|
1605
1669
|
);
|
|
1606
1670
|
}
|
|
1607
|
-
|
|
1671
|
+
c.config.method === "get" ? i(c) : t(c);
|
|
1608
1672
|
});
|
|
1609
1673
|
});
|
|
1610
1674
|
}
|
|
@@ -1631,10 +1695,10 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1631
1695
|
}
|
|
1632
1696
|
};
|
|
1633
1697
|
/** token过期后,暂存待执行的请求 */
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1698
|
+
S(g, "requests", []), /** 防止重复刷新token */
|
|
1699
|
+
S(g, "isRefreshing", !1), // 初始化配置对象
|
|
1700
|
+
S(g, "initConfig", {}), // 保存当前Axios实例对象
|
|
1701
|
+
S(g, "axiosInstance", Axios.create(defaultConfig));
|
|
1638
1702
|
let SuHttp = g;
|
|
1639
1703
|
const http = new SuHttp(), lunarCalendar = {
|
|
1640
1704
|
/**
|
|
@@ -2373,8 +2437,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2373
2437
|
return -1;
|
|
2374
2438
|
const o = this.sTermInfo[a - 1900], h = [];
|
|
2375
2439
|
for (let r = 0; r < o.length; r += 5) {
|
|
2376
|
-
const
|
|
2377
|
-
h.push(
|
|
2440
|
+
const e = parseInt("0x" + o.substr(r, 5)).toString();
|
|
2441
|
+
h.push(e[0], e.substr(1, 2), e[3], e.substr(4, 2));
|
|
2378
2442
|
}
|
|
2379
2443
|
return parseInt(h[l - 1]);
|
|
2380
2444
|
},
|
|
@@ -2432,60 +2496,60 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2432
2496
|
* @eg:console.log(calendar.solar2lunar(1987,11,01));
|
|
2433
2497
|
*/
|
|
2434
2498
|
solar2lunar: function(a, l, o) {
|
|
2435
|
-
let h = parseInt(a), r = parseInt(l),
|
|
2436
|
-
if (h < 1900 || h > 2100 || h === 1900 && r === 1 &&
|
|
2499
|
+
let h = parseInt(a), r = parseInt(l), e = parseInt(o);
|
|
2500
|
+
if (h < 1900 || h > 2100 || h === 1900 && r === 1 && e < 31)
|
|
2437
2501
|
return -1;
|
|
2438
2502
|
let i;
|
|
2439
|
-
h ? i = new Date(h, parseInt(r.toString()) - 1,
|
|
2440
|
-
let
|
|
2441
|
-
h = i.getFullYear(), r = i.getMonth() + 1,
|
|
2503
|
+
h ? i = new Date(h, parseInt(r.toString()) - 1, e) : i = /* @__PURE__ */ new Date();
|
|
2504
|
+
let t, c = 0, Z = 0;
|
|
2505
|
+
h = i.getFullYear(), r = i.getMonth() + 1, e = i.getDate();
|
|
2442
2506
|
let d = (Date.UTC(i.getFullYear(), i.getMonth(), i.getDate()) - Date.UTC(1900, 0, 31)) / 864e5;
|
|
2443
|
-
for (
|
|
2444
|
-
|
|
2445
|
-
d < 0 && (d +=
|
|
2446
|
-
const
|
|
2447
|
-
let
|
|
2448
|
-
|
|
2449
|
-
let
|
|
2450
|
-
const
|
|
2451
|
-
|
|
2452
|
-
const
|
|
2453
|
-
|
|
2454
|
-
let
|
|
2455
|
-
for (
|
|
2456
|
-
|
|
2457
|
-
d === 0 &&
|
|
2458
|
-
const
|
|
2459
|
-
let
|
|
2460
|
-
|
|
2461
|
-
let
|
|
2462
|
-
|
|
2463
|
-
const
|
|
2464
|
-
let E =
|
|
2465
|
-
return
|
|
2466
|
-
date:
|
|
2467
|
-
lunarDate:
|
|
2468
|
-
festival:
|
|
2469
|
-
lunarFestival:
|
|
2470
|
-
lYear:
|
|
2471
|
-
lMonth:
|
|
2507
|
+
for (t = 1900; t < 2101 && d > 0; t++)
|
|
2508
|
+
Z = this.lYearDays(t), d -= Z;
|
|
2509
|
+
d < 0 && (d += Z, t--);
|
|
2510
|
+
const n = /* @__PURE__ */ new Date();
|
|
2511
|
+
let f = !1;
|
|
2512
|
+
n.getFullYear() === h && n.getMonth() + 1 === r && n.getDate() === e && (f = !0);
|
|
2513
|
+
let H = i.getDay();
|
|
2514
|
+
const m = this.nStr1[H];
|
|
2515
|
+
H === 0 && (H = 7);
|
|
2516
|
+
const s = t;
|
|
2517
|
+
c = this.leapMonth(t);
|
|
2518
|
+
let u = !1;
|
|
2519
|
+
for (t = 1; t < 13 && d > 0; t++)
|
|
2520
|
+
c > 0 && t === c + 1 && u === !1 ? (--t, u = !0, Z = this.leapDays(s)) : Z = this.monthDays(s, t), u === !0 && t === c + 1 && (u = !1), d -= Z;
|
|
2521
|
+
d === 0 && c > 0 && t === c + 1 && (u ? u = !1 : (u = !0, --t)), d < 0 && (d += Z, --t);
|
|
2522
|
+
const M = t, C = d + 1, A = r - 1, w = this.toGanZhiYear(s), V = this.getTerm(h, r * 2 - 1), k = this.getTerm(h, r * 2);
|
|
2523
|
+
let R = this.toGanZhi((h - 1900) * 12 + r + 11);
|
|
2524
|
+
e >= V && (R = this.toGanZhi((h - 1900) * 12 + r + 12));
|
|
2525
|
+
let I = !1, v;
|
|
2526
|
+
V === e && (I = !0, v = this.solarTerm[r * 2 - 2]), k === e && (I = !0, v = this.solarTerm[r * 2 - 1]);
|
|
2527
|
+
const p = Date.UTC(h, A, 1, 0, 0, 0, 0) / 864e5 + 25567 + 10, b = this.toGanZhi(p + e - 1), y = this.toAstro(r, e), L = h + "-" + r + "-" + e, x = s + "-" + M + "-" + C, D = this.festival, F = this.lFestival, N = r + "-" + e;
|
|
2528
|
+
let E = M + "-" + C;
|
|
2529
|
+
return M === 12 && C === 29 && this.monthDays(s, M) === 29 && (E = "12-30"), {
|
|
2530
|
+
date: L,
|
|
2531
|
+
lunarDate: x,
|
|
2532
|
+
festival: D[N] ? D[N].title : null,
|
|
2533
|
+
lunarFestival: F[E] ? F[E].title : null,
|
|
2534
|
+
lYear: s,
|
|
2535
|
+
lMonth: M,
|
|
2472
2536
|
lDay: C,
|
|
2473
|
-
Animal: this.getAnimal(
|
|
2474
|
-
IMonthCn: (
|
|
2537
|
+
Animal: this.getAnimal(s),
|
|
2538
|
+
IMonthCn: (u ? "闰" : "") + this.toChinaMonth(M),
|
|
2475
2539
|
IDayCn: this.toChinaDay(C),
|
|
2476
2540
|
cYear: h,
|
|
2477
2541
|
cMonth: r,
|
|
2478
|
-
cDay:
|
|
2542
|
+
cDay: e,
|
|
2479
2543
|
gzYear: w,
|
|
2480
|
-
gzMonth:
|
|
2481
|
-
gzDay:
|
|
2482
|
-
isToday:
|
|
2483
|
-
isLeap:
|
|
2484
|
-
nWeek:
|
|
2485
|
-
ncWeek: "星期" +
|
|
2486
|
-
isTerm:
|
|
2487
|
-
Term:
|
|
2488
|
-
astro:
|
|
2544
|
+
gzMonth: R,
|
|
2545
|
+
gzDay: b,
|
|
2546
|
+
isToday: f,
|
|
2547
|
+
isLeap: u,
|
|
2548
|
+
nWeek: H,
|
|
2549
|
+
ncWeek: "星期" + m,
|
|
2550
|
+
isTerm: I,
|
|
2551
|
+
Term: v,
|
|
2552
|
+
astro: y
|
|
2489
2553
|
};
|
|
2490
2554
|
},
|
|
2491
2555
|
/**
|
|
@@ -2503,19 +2567,19 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2503
2567
|
const r = this.leapMonth(a);
|
|
2504
2568
|
if (h && r !== l || a === 2100 && l === 12 && o > 1 || a === 1900 && l === 1 && o < 31)
|
|
2505
2569
|
return -1;
|
|
2506
|
-
const
|
|
2507
|
-
let i =
|
|
2570
|
+
const e = this.monthDays(a, l);
|
|
2571
|
+
let i = e;
|
|
2508
2572
|
if (h && (i = this.leapDays(a)), a < 1900 || a > 2100 || o > i)
|
|
2509
2573
|
return -1;
|
|
2510
|
-
let
|
|
2511
|
-
for (
|
|
2512
|
-
|
|
2513
|
-
let
|
|
2514
|
-
for (
|
|
2515
|
-
|
|
2516
|
-
h && (
|
|
2517
|
-
const
|
|
2518
|
-
return this.solar2lunar(
|
|
2574
|
+
let t = 0, c;
|
|
2575
|
+
for (c = 1900; c < a; c++)
|
|
2576
|
+
t += this.lYearDays(c);
|
|
2577
|
+
let Z = 0, d = !1;
|
|
2578
|
+
for (c = 1; c < l; c++)
|
|
2579
|
+
Z = this.leapMonth(a), d || Z <= c && Z > 0 && (t += this.leapDays(a), d = !0), t += this.monthDays(a, c);
|
|
2580
|
+
h && (t += e);
|
|
2581
|
+
const n = Date.UTC(1900, 1, 30, 0, 0, 0), f = new Date((t + o - 31) * 864e5 + n), H = f.getUTCFullYear(), m = f.getUTCMonth() + 1, s = f.getUTCDate();
|
|
2582
|
+
return this.solar2lunar(H, m, s);
|
|
2519
2583
|
}
|
|
2520
2584
|
}, dict = storageLocal.getItem("kLov"), formats = {
|
|
2521
2585
|
formatDate: {
|
|
@@ -2552,9 +2616,9 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2552
2616
|
formatDict: {
|
|
2553
2617
|
// 数据字段转化
|
|
2554
2618
|
tableCellFormatMethod({ cellValue: a }, l) {
|
|
2555
|
-
var r,
|
|
2619
|
+
var r, e;
|
|
2556
2620
|
if (!l) return a;
|
|
2557
|
-
const o = XEUtils.toValueString(a), h = dict ? (
|
|
2621
|
+
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;
|
|
2558
2622
|
return (h == null ? void 0 : h.dictName) || a;
|
|
2559
2623
|
}
|
|
2560
2624
|
},
|
|
@@ -2572,18 +2636,18 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2572
2636
|
},
|
|
2573
2637
|
formatSelectLocal: {
|
|
2574
2638
|
tableCellFormatMethod({ cellValue: a }, l) {
|
|
2575
|
-
const [o, h = "value", r = "label"] = l,
|
|
2576
|
-
return
|
|
2639
|
+
const [o, h = "value", r = "label"] = l, e = o == null ? void 0 : o.find((i) => i[h] === a);
|
|
2640
|
+
return e ? e[r] : a;
|
|
2577
2641
|
}
|
|
2578
2642
|
},
|
|
2579
2643
|
formatMultiValue: {
|
|
2580
2644
|
tableCellFormatMethod({ row: a }, l) {
|
|
2581
|
-
var
|
|
2645
|
+
var e;
|
|
2582
2646
|
const [o, h] = l;
|
|
2583
2647
|
let r;
|
|
2584
|
-
return (
|
|
2585
|
-
const
|
|
2586
|
-
r = r ? `${r},${
|
|
2648
|
+
return (e = a[o]) == null || e.split(",").forEach((i) => {
|
|
2649
|
+
const t = h.find((c) => c.value === i);
|
|
2650
|
+
r = r ? `${r},${t == null ? void 0 : t.label}` : t == null ? void 0 : t.label;
|
|
2587
2651
|
}), r;
|
|
2588
2652
|
}
|
|
2589
2653
|
}
|
|
@@ -10232,7 +10296,7 @@ function isUrl(a) {
|
|
|
10232
10296
|
}
|
|
10233
10297
|
const getDictName = (a, l) => {
|
|
10234
10298
|
var h, r;
|
|
10235
|
-
return !a || !l ? null : (r = (h = storageLocal.getItem("kLov")[a]) == null ? void 0 : h.children.find((
|
|
10299
|
+
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;
|
|
10236
10300
|
};
|
|
10237
10301
|
export {
|
|
10238
10302
|
W as NProgress,
|