@utogether/utils 3.0.0-beta.42 → 3.0.0-beta.44
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/utils.es.js +931 -921
- 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 = (
|
|
3
|
-
var x = (
|
|
2
|
+
var U = (l, a, o) => a in l ? j(l, a, { enumerable: !0, configurable: !0, writable: !0, value: o }) : l[a] = o;
|
|
3
|
+
var x = (l, a, o) => U(l, typeof a != "symbol" ? a + "" : a, 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";
|
|
@@ -11,28 +11,28 @@ import Axios from "axios";
|
|
|
11
11
|
import NProgress from "nprogress";
|
|
12
12
|
import { default as G } from "nprogress";
|
|
13
13
|
class sessionStorageProxy {
|
|
14
|
-
constructor(
|
|
14
|
+
constructor(a) {
|
|
15
15
|
x(this, "storage");
|
|
16
16
|
x(this, "prefix");
|
|
17
|
-
x(this, "addPrefix", (
|
|
18
|
-
this.prefix =
|
|
17
|
+
x(this, "addPrefix", (a) => {
|
|
18
|
+
this.prefix = a;
|
|
19
19
|
});
|
|
20
|
-
this.storage =
|
|
20
|
+
this.storage = a;
|
|
21
21
|
}
|
|
22
22
|
// 存
|
|
23
|
-
setItem(
|
|
24
|
-
this.storage.setItem && this.storage.setItem(this.getKey(
|
|
23
|
+
setItem(a, o) {
|
|
24
|
+
this.storage.setItem && this.storage.setItem(this.getKey(a), JSON.stringify(o || null));
|
|
25
25
|
}
|
|
26
26
|
// 取
|
|
27
|
-
getItem(
|
|
28
|
-
return this.storage.getItem ? JSON.parse(this.storage.getItem(this.getKey(
|
|
27
|
+
getItem(a) {
|
|
28
|
+
return this.storage.getItem ? JSON.parse(this.storage.getItem(this.getKey(a))) : null;
|
|
29
29
|
}
|
|
30
30
|
// 删
|
|
31
|
-
removeItem(
|
|
32
|
-
this.storage.removeItem && this.storage.removeItem(this.getKey(
|
|
31
|
+
removeItem(a) {
|
|
32
|
+
this.storage.removeItem && this.storage.removeItem(this.getKey(a));
|
|
33
33
|
}
|
|
34
|
-
getKey(
|
|
35
|
-
return this.prefix ? this.prefix + "_" +
|
|
34
|
+
getKey(a) {
|
|
35
|
+
return this.prefix ? this.prefix + "_" + a : a;
|
|
36
36
|
}
|
|
37
37
|
// 清空
|
|
38
38
|
clear() {
|
|
@@ -40,8 +40,8 @@ class sessionStorageProxy {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
class localStorageProxy extends sessionStorageProxy {
|
|
43
|
-
constructor(
|
|
44
|
-
super(
|
|
43
|
+
constructor(a) {
|
|
44
|
+
super(a);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
class localforageProxy {
|
|
@@ -53,16 +53,16 @@ class localforageProxy {
|
|
|
53
53
|
}), this.storage = localforage;
|
|
54
54
|
}
|
|
55
55
|
// 存
|
|
56
|
-
setItem(
|
|
57
|
-
this.storage.setItem(
|
|
56
|
+
setItem(a, o) {
|
|
57
|
+
this.storage.setItem(a, o);
|
|
58
58
|
}
|
|
59
59
|
// 取
|
|
60
|
-
getItem(
|
|
61
|
-
return this.storage.getItem(
|
|
60
|
+
getItem(a) {
|
|
61
|
+
return this.storage.getItem(a);
|
|
62
62
|
}
|
|
63
63
|
// 删
|
|
64
|
-
removeItem(
|
|
65
|
-
this.storage.removeItem(
|
|
64
|
+
removeItem(a) {
|
|
65
|
+
this.storage.removeItem(a);
|
|
66
66
|
}
|
|
67
67
|
// 清空
|
|
68
68
|
clear() {
|
|
@@ -71,21 +71,21 @@ class localforageProxy {
|
|
|
71
71
|
}
|
|
72
72
|
const storageSession = new sessionStorageProxy(sessionStorage), storageLocal = new localStorageProxy(localStorage), dbstorage = new localforageProxy();
|
|
73
73
|
/*! typescript-cookie v1.0.6 | MIT */
|
|
74
|
-
const encodeName = (
|
|
75
|
-
function stringifyAttributes(
|
|
76
|
-
return
|
|
74
|
+
const encodeName = (l) => encodeURIComponent(l).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape), encodeValue = (l) => encodeURIComponent(l).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent), decodeName = decodeURIComponent, decodeValue = (l) => (l[0] === '"' && (l = l.slice(1, -1)), l.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent));
|
|
75
|
+
function stringifyAttributes(l) {
|
|
76
|
+
return l = Object.assign({}, l), typeof l.expires == "number" && (l.expires = new Date(Date.now() + l.expires * 864e5)), l.expires != null && (l.expires = l.expires.toUTCString()), Object.entries(l).filter(([a, o]) => o != null && o !== !1).map(([a, o]) => o === !0 ? `; ${a}` : `; ${a}=${o.split(";")[0]}`).join("");
|
|
77
77
|
}
|
|
78
|
-
function get(
|
|
78
|
+
function get(l, a, o) {
|
|
79
79
|
const h = /(?:^|; )([^=]*)=([^;]*)/g, r = {};
|
|
80
80
|
let e;
|
|
81
81
|
for (; (e = h.exec(document.cookie)) != null; )
|
|
82
82
|
try {
|
|
83
83
|
const i = o(e[1]);
|
|
84
|
-
if (r[i] =
|
|
84
|
+
if (r[i] = a(e[2], i), l === i)
|
|
85
85
|
break;
|
|
86
86
|
} catch {
|
|
87
87
|
}
|
|
88
|
-
return
|
|
88
|
+
return l != null ? r[l] : r;
|
|
89
89
|
}
|
|
90
90
|
const DEFAULT_CODEC = Object.freeze({
|
|
91
91
|
decodeName,
|
|
@@ -95,21 +95,21 @@ const DEFAULT_CODEC = Object.freeze({
|
|
|
95
95
|
}), DEFAULT_ATTRIBUTES = Object.freeze({
|
|
96
96
|
path: "/"
|
|
97
97
|
});
|
|
98
|
-
function setCookie(
|
|
99
|
-
return document.cookie = `${r(
|
|
98
|
+
function setCookie(l, a, o = DEFAULT_ATTRIBUTES, { encodeValue: h = encodeValue, encodeName: r = encodeName } = {}) {
|
|
99
|
+
return document.cookie = `${r(l)}=${h(a, l)}${stringifyAttributes(o)}`;
|
|
100
100
|
}
|
|
101
|
-
function getCookie(
|
|
102
|
-
return get(
|
|
101
|
+
function getCookie(l, { decodeValue: a = decodeValue, decodeName: o = decodeName } = {}) {
|
|
102
|
+
return get(l, a, o);
|
|
103
103
|
}
|
|
104
|
-
function getCookies({ decodeValue:
|
|
105
|
-
return get(void 0,
|
|
104
|
+
function getCookies({ decodeValue: l = decodeValue, decodeName: a = decodeName } = {}) {
|
|
105
|
+
return get(void 0, l, a);
|
|
106
106
|
}
|
|
107
|
-
function removeCookie(
|
|
108
|
-
setCookie(
|
|
107
|
+
function removeCookie(l, a = DEFAULT_ATTRIBUTES) {
|
|
108
|
+
setCookie(l, "", Object.assign({}, a, {
|
|
109
109
|
expires: -1
|
|
110
110
|
}));
|
|
111
111
|
}
|
|
112
|
-
function init(
|
|
112
|
+
function init(l, a) {
|
|
113
113
|
const o = {
|
|
114
114
|
set: function(r, e, i) {
|
|
115
115
|
return setCookie(r, e, Object.assign({}, this.attributes, i), {
|
|
@@ -132,8 +132,8 @@ function init(a, l) {
|
|
|
132
132
|
return init(Object.assign({}, this.converter, r), this.attributes);
|
|
133
133
|
}
|
|
134
134
|
}, h = {
|
|
135
|
-
attributes: { value: Object.freeze(
|
|
136
|
-
converter: { value: Object.freeze(
|
|
135
|
+
attributes: { value: Object.freeze(a) },
|
|
136
|
+
converter: { value: Object.freeze(l) }
|
|
137
137
|
};
|
|
138
138
|
return Object.create(o, h);
|
|
139
139
|
}
|
|
@@ -141,8 +141,8 @@ init({ read: DEFAULT_CODEC.decodeValue, write: DEFAULT_CODEC.encodeValue }, DEFA
|
|
|
141
141
|
class Cookies {
|
|
142
142
|
constructor() {
|
|
143
143
|
x(this, "prefix", null);
|
|
144
|
-
x(this, "addPrefix", (
|
|
145
|
-
this.prefix =
|
|
144
|
+
x(this, "addPrefix", (a) => {
|
|
145
|
+
this.prefix = a;
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
@@ -151,16 +151,16 @@ class Cookies {
|
|
|
151
151
|
* @param value
|
|
152
152
|
* @param cookieSetting
|
|
153
153
|
*/
|
|
154
|
-
set(
|
|
155
|
-
setCookie(`${this.getKey(
|
|
154
|
+
set(a = "default", o = "") {
|
|
155
|
+
setCookie(`${this.getKey(a)}`, o);
|
|
156
156
|
}
|
|
157
157
|
/**
|
|
158
158
|
* 拿到 cookie 值
|
|
159
159
|
* @param name
|
|
160
160
|
* @returns
|
|
161
161
|
*/
|
|
162
|
-
get(
|
|
163
|
-
return getCookie(`${this.getKey(
|
|
162
|
+
get(a = "default") {
|
|
163
|
+
return getCookie(`${this.getKey(a)}`);
|
|
164
164
|
}
|
|
165
165
|
/**
|
|
166
166
|
* 拿到 cookie 全部的值
|
|
@@ -173,16 +173,16 @@ class Cookies {
|
|
|
173
173
|
* 删除 cookie
|
|
174
174
|
* @param name
|
|
175
175
|
*/
|
|
176
|
-
remove(
|
|
177
|
-
removeCookie(`${this.getKey(
|
|
176
|
+
remove(a = "default") {
|
|
177
|
+
removeCookie(`${this.getKey(a)}`);
|
|
178
178
|
}
|
|
179
|
-
getKey(
|
|
180
|
-
return this.prefix ? this.prefix + "_" +
|
|
179
|
+
getKey(a) {
|
|
180
|
+
return this.prefix ? this.prefix + "_" + a : a;
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
const cookies = new Cookies();
|
|
184
|
-
function _isSlot(
|
|
185
|
-
return typeof
|
|
184
|
+
function _isSlot(l) {
|
|
185
|
+
return typeof l == "function" || Object.prototype.toString.call(l) === "[object Object]" && !isVNode(l);
|
|
186
186
|
}
|
|
187
187
|
const VxetableRender = (VXETable, {
|
|
188
188
|
serviceApi,
|
|
@@ -190,122 +190,121 @@ const VxetableRender = (VXETable, {
|
|
|
190
190
|
}) => {
|
|
191
191
|
const dict = storageLocal.getItem("kLov");
|
|
192
192
|
VXETable.renderer.add("#SuSelect", {
|
|
193
|
-
renderTableEdit(
|
|
193
|
+
renderTableEdit(l, a) {
|
|
194
194
|
let o;
|
|
195
195
|
const {
|
|
196
196
|
row: h,
|
|
197
197
|
column: r
|
|
198
|
-
} =
|
|
198
|
+
} = a, {
|
|
199
199
|
options: e,
|
|
200
200
|
props: i,
|
|
201
|
-
optionProps:
|
|
202
|
-
events:
|
|
203
|
-
} =
|
|
204
|
-
label:
|
|
201
|
+
optionProps: Z = {},
|
|
202
|
+
events: c
|
|
203
|
+
} = l, {
|
|
204
|
+
label: t = "label",
|
|
205
205
|
value: d = "value"
|
|
206
|
-
} =
|
|
207
|
-
loading:
|
|
208
|
-
multiple:
|
|
209
|
-
|
|
210
|
-
} = i, m = useComponent(), s = f ? `_${r.field}` : r.field;
|
|
206
|
+
} = Z, {
|
|
207
|
+
loading: f = !1,
|
|
208
|
+
multiple: n
|
|
209
|
+
} = i, m = useComponent(), b = n ? `_${r.field}` : r.field;
|
|
211
210
|
m.setDefaultValue(i, h, r.field);
|
|
212
|
-
function M(
|
|
213
|
-
m.remote(
|
|
211
|
+
function M(y) {
|
|
212
|
+
m.remote(y, r.field, l);
|
|
214
213
|
}
|
|
215
|
-
function
|
|
216
|
-
m.selectChange(
|
|
214
|
+
function V(y) {
|
|
215
|
+
m.selectChange(y, h, r.field, l, {
|
|
217
216
|
column: r,
|
|
218
217
|
datasource: "row"
|
|
219
218
|
});
|
|
220
219
|
}
|
|
221
|
-
function y
|
|
222
|
-
|
|
220
|
+
function p(y) {
|
|
221
|
+
c != null && c.input && c.input(a, y);
|
|
223
222
|
}
|
|
224
|
-
function
|
|
225
|
-
m.clear(h, r.field,
|
|
223
|
+
function L() {
|
|
224
|
+
m.clear(h, r.field, l, "row");
|
|
226
225
|
}
|
|
227
226
|
function k() {
|
|
228
|
-
!e.length && M(""),
|
|
227
|
+
!e.length && M(""), c != null && c.focus && c.focus(a, r.field);
|
|
229
228
|
}
|
|
230
229
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
231
|
-
modelValue: h[
|
|
232
|
-
"onUpdate:modelValue": (
|
|
230
|
+
modelValue: h[b],
|
|
231
|
+
"onUpdate:modelValue": (y) => h[b] = y,
|
|
233
232
|
filterable: !0,
|
|
234
233
|
remote: !0,
|
|
235
234
|
clearable: !0,
|
|
236
235
|
placeholder: "请录入关键字搜索",
|
|
237
236
|
style: "width: 100%",
|
|
238
237
|
"remote-method": M,
|
|
239
|
-
loading:
|
|
238
|
+
loading: f
|
|
240
239
|
}, i, {
|
|
241
240
|
onFocus: () => k(),
|
|
242
|
-
onChange: (
|
|
243
|
-
onClear: () =>
|
|
244
|
-
onInput: (
|
|
245
|
-
}), _isSlot(o = e.map((
|
|
246
|
-
key:
|
|
247
|
-
label:
|
|
248
|
-
value:
|
|
241
|
+
onChange: (y) => V(y),
|
|
242
|
+
onClear: () => L(),
|
|
243
|
+
onInput: (y) => p(y)
|
|
244
|
+
}), _isSlot(o = e.map((y) => createVNode(resolveComponent("el-option"), {
|
|
245
|
+
key: y[d],
|
|
246
|
+
label: y[t],
|
|
247
|
+
value: y[d]
|
|
249
248
|
}, null))) ? o : {
|
|
250
249
|
default: () => [o]
|
|
251
250
|
})];
|
|
252
251
|
},
|
|
253
|
-
renderTableDefault(
|
|
252
|
+
renderTableDefault(l, a) {
|
|
254
253
|
let o;
|
|
255
254
|
const {
|
|
256
255
|
row: h,
|
|
257
256
|
column: r
|
|
258
|
-
} =
|
|
257
|
+
} = a, {
|
|
259
258
|
options: e,
|
|
260
259
|
props: i,
|
|
261
|
-
optionProps:
|
|
262
|
-
events:
|
|
263
|
-
} =
|
|
264
|
-
label:
|
|
260
|
+
optionProps: Z = {},
|
|
261
|
+
events: c
|
|
262
|
+
} = l, {
|
|
263
|
+
label: t = "label",
|
|
265
264
|
value: d = "value"
|
|
266
|
-
} =
|
|
267
|
-
loading:
|
|
268
|
-
multiple:
|
|
269
|
-
mapField:
|
|
270
|
-
} = i,
|
|
271
|
-
|
|
272
|
-
function
|
|
273
|
-
|
|
265
|
+
} = Z, {
|
|
266
|
+
loading: f = !1,
|
|
267
|
+
multiple: n,
|
|
268
|
+
mapField: m
|
|
269
|
+
} = i, b = useComponent(), M = n ? `_${r.field}` : r.field;
|
|
270
|
+
b.setDefaultValue(i, h, r.field);
|
|
271
|
+
function V(C) {
|
|
272
|
+
b.remote(C, r.field, l);
|
|
274
273
|
}
|
|
275
|
-
function p(
|
|
276
|
-
|
|
274
|
+
function p(C) {
|
|
275
|
+
b.selectChange(C, h, r.field, l, {
|
|
277
276
|
column: r,
|
|
278
277
|
datasource: "row"
|
|
279
278
|
});
|
|
280
279
|
}
|
|
281
|
-
function
|
|
282
|
-
|
|
283
|
-
}
|
|
284
|
-
function A() {
|
|
285
|
-
m.clear(h, r.field, b, v, "row");
|
|
280
|
+
function L(C) {
|
|
281
|
+
c != null && c.input && c.input(a, C);
|
|
286
282
|
}
|
|
287
283
|
function k() {
|
|
288
|
-
|
|
284
|
+
b.clear(h, r.field, m, c, "row");
|
|
285
|
+
}
|
|
286
|
+
function y() {
|
|
287
|
+
!e.length && V(""), c != null && c.focus && c.focus(a, r.field);
|
|
289
288
|
}
|
|
290
289
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
291
|
-
modelValue: h[
|
|
292
|
-
"onUpdate:modelValue": (
|
|
290
|
+
modelValue: h[M],
|
|
291
|
+
"onUpdate:modelValue": (C) => h[M] = C,
|
|
293
292
|
filterable: !0,
|
|
294
293
|
remote: !0,
|
|
295
294
|
clearable: !0,
|
|
296
295
|
placeholder: "请录入关键字搜索",
|
|
297
296
|
style: "width: 100%",
|
|
298
|
-
"remote-method":
|
|
299
|
-
loading:
|
|
297
|
+
"remote-method": V,
|
|
298
|
+
loading: f
|
|
300
299
|
}, i, {
|
|
301
|
-
onFocus: () =>
|
|
302
|
-
onChange: (
|
|
303
|
-
onClear: () =>
|
|
304
|
-
onInput: (
|
|
305
|
-
}), _isSlot(o = e.map((
|
|
306
|
-
key:
|
|
307
|
-
label:
|
|
308
|
-
value:
|
|
300
|
+
onFocus: () => y(),
|
|
301
|
+
onChange: (C) => p(C),
|
|
302
|
+
onClear: () => k(),
|
|
303
|
+
onInput: (C) => L(C)
|
|
304
|
+
}), _isSlot(o = e.map((C) => createVNode(resolveComponent("el-option"), {
|
|
305
|
+
key: C[d],
|
|
306
|
+
label: C[t],
|
|
307
|
+
value: C[d]
|
|
309
308
|
}, null))) ? o : {
|
|
310
309
|
default: () => [o]
|
|
311
310
|
})];
|
|
@@ -324,99 +323,99 @@ const VxetableRender = (VXETable, {
|
|
|
324
323
|
let val = row[column.field];
|
|
325
324
|
return textValue && (val = eval(`row.${textValue}`) || row[column.field]), val && multiple && isArray(val) && (val = val && val.join(",")), [createVNode("span", null, [val])];
|
|
326
325
|
},
|
|
327
|
-
renderItemContent(
|
|
326
|
+
renderItemContent(l, a) {
|
|
328
327
|
let o;
|
|
329
328
|
const {
|
|
330
329
|
data: h,
|
|
331
330
|
field: r
|
|
332
|
-
} =
|
|
331
|
+
} = a, {
|
|
333
332
|
options: e,
|
|
334
333
|
props: i,
|
|
335
|
-
optionProps:
|
|
336
|
-
events:
|
|
337
|
-
} =
|
|
338
|
-
label:
|
|
334
|
+
optionProps: Z = {},
|
|
335
|
+
events: c
|
|
336
|
+
} = l, {
|
|
337
|
+
label: t = "label",
|
|
339
338
|
value: d = "value"
|
|
340
|
-
} =
|
|
341
|
-
mapField:
|
|
342
|
-
multiple:
|
|
343
|
-
loading:
|
|
344
|
-
} = i,
|
|
345
|
-
|
|
346
|
-
async function
|
|
347
|
-
|
|
339
|
+
} = Z, {
|
|
340
|
+
mapField: f,
|
|
341
|
+
multiple: n,
|
|
342
|
+
loading: m = !1
|
|
343
|
+
} = i, b = useComponent(), M = n ? `_${r}` : r;
|
|
344
|
+
b.setDefaultValue(i, h, r);
|
|
345
|
+
async function V(C) {
|
|
346
|
+
b.remote(C, r, l);
|
|
348
347
|
}
|
|
349
|
-
function p(
|
|
350
|
-
|
|
348
|
+
function p(C) {
|
|
349
|
+
b.selectChange(C, h, r, l, {
|
|
351
350
|
datasource: "data"
|
|
352
351
|
});
|
|
353
352
|
}
|
|
354
|
-
function
|
|
355
|
-
|
|
356
|
-
}
|
|
357
|
-
function A() {
|
|
358
|
-
m.clear(h, r, n, v, "data");
|
|
353
|
+
function L(C) {
|
|
354
|
+
c != null && c.input && c.input(a, C);
|
|
359
355
|
}
|
|
360
356
|
function k() {
|
|
361
|
-
|
|
357
|
+
b.clear(h, r, f, c, "data");
|
|
358
|
+
}
|
|
359
|
+
function y() {
|
|
360
|
+
!e.length && V(""), c != null && c.focus && c.focus(a);
|
|
362
361
|
}
|
|
363
362
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
364
|
-
modelValue: h[
|
|
365
|
-
"onUpdate:modelValue": (
|
|
363
|
+
modelValue: h[M],
|
|
364
|
+
"onUpdate:modelValue": (C) => h[M] = C,
|
|
366
365
|
filterable: !0,
|
|
367
366
|
remote: !0,
|
|
368
367
|
clearable: !0,
|
|
369
368
|
style: "width: 100%",
|
|
370
369
|
placeholder: "请录入关键字搜索",
|
|
371
|
-
loading:
|
|
372
|
-
"remote-method":
|
|
370
|
+
loading: m,
|
|
371
|
+
"remote-method": V
|
|
373
372
|
}, i, {
|
|
374
|
-
onFocus: () =>
|
|
375
|
-
onChange: (
|
|
376
|
-
onClear: () =>
|
|
377
|
-
onInput: () =>
|
|
378
|
-
}), _isSlot(o = e.map((
|
|
379
|
-
key:
|
|
380
|
-
label:
|
|
381
|
-
value:
|
|
373
|
+
onFocus: () => y(),
|
|
374
|
+
onChange: (C) => p(C),
|
|
375
|
+
onClear: () => k(),
|
|
376
|
+
onInput: () => L()
|
|
377
|
+
}), _isSlot(o = e.map((C) => createVNode(resolveComponent("el-option"), {
|
|
378
|
+
key: C[d],
|
|
379
|
+
label: C[t],
|
|
380
|
+
value: C[d]
|
|
382
381
|
}, null))) ? o : {
|
|
383
382
|
default: () => [o]
|
|
384
383
|
})];
|
|
385
384
|
}
|
|
386
385
|
}), VXETable.renderer.add("#SuDateRange", {
|
|
387
|
-
renderItemContent(
|
|
386
|
+
renderItemContent(l, a) {
|
|
388
387
|
const {
|
|
389
388
|
data: o,
|
|
390
389
|
field: h
|
|
391
|
-
} =
|
|
390
|
+
} = a, {
|
|
392
391
|
props: r
|
|
393
|
-
} =
|
|
392
|
+
} = l;
|
|
394
393
|
r != null && r.defaultValue && !o[h] && (o[h] = r.defaultValue, r.defaultValue = r.required ? r.defaultValue : null);
|
|
395
394
|
const e = /* @__PURE__ */ new Date(), i = [{
|
|
396
395
|
text: i18n("message.udp.today", !0),
|
|
397
|
-
value: () => [
|
|
396
|
+
value: () => [Z(1, "day"), e]
|
|
398
397
|
}, {
|
|
399
398
|
text: i18n("message.udp.yesterday", !0),
|
|
400
|
-
value: () => [
|
|
399
|
+
value: () => [Z(2, "day"), Z(2, "day")]
|
|
401
400
|
}, {
|
|
402
401
|
text: i18n("message.udp.lastWeek", !0),
|
|
403
|
-
value: () => [
|
|
402
|
+
value: () => [Z(7, "day"), e]
|
|
404
403
|
}, {
|
|
405
404
|
text: i18n("message.udp.lastMonth", !0),
|
|
406
|
-
value: () => [
|
|
405
|
+
value: () => [Z(1, "month"), e]
|
|
407
406
|
}, {
|
|
408
407
|
text: i18n("message.udp.threeMonth", !0),
|
|
409
|
-
value: () => [
|
|
408
|
+
value: () => [Z(3, "month"), e]
|
|
410
409
|
}, {
|
|
411
410
|
text: i18n("message.udp.halfYear", !0),
|
|
412
|
-
value: () => [
|
|
411
|
+
value: () => [Z(6, "month"), e]
|
|
413
412
|
}, {
|
|
414
413
|
text: i18n("message.udp.anniversary", !0),
|
|
415
|
-
value: () => [
|
|
416
|
-
}],
|
|
414
|
+
value: () => [Z(1, "year"), e]
|
|
415
|
+
}], Z = (c, t) => dayjs().subtract(c, t).add("1", "day").format();
|
|
417
416
|
return [createVNode(resolveComponent("el-date-picker"), mergeProps({
|
|
418
417
|
modelValue: o[h],
|
|
419
|
-
"onUpdate:modelValue": (
|
|
418
|
+
"onUpdate:modelValue": (c) => o[h] = c,
|
|
420
419
|
type: (r == null ? void 0 : r.type) || "daterange",
|
|
421
420
|
shortcuts: i,
|
|
422
421
|
style: "width: 100%",
|
|
@@ -426,92 +425,90 @@ const VxetableRender = (VXETable, {
|
|
|
426
425
|
}, r), null)];
|
|
427
426
|
}
|
|
428
427
|
}), VXETable.renderer.add("#select", {
|
|
429
|
-
renderTableEdit(
|
|
428
|
+
renderTableEdit(l, a) {
|
|
430
429
|
let o;
|
|
431
430
|
const {
|
|
432
431
|
row: h,
|
|
433
432
|
column: r
|
|
434
|
-
} =
|
|
433
|
+
} = a, {
|
|
435
434
|
options: e,
|
|
436
435
|
props: i,
|
|
437
|
-
optionProps:
|
|
438
|
-
events:
|
|
439
|
-
} =
|
|
440
|
-
label:
|
|
436
|
+
optionProps: Z = {},
|
|
437
|
+
events: c
|
|
438
|
+
} = l, {
|
|
439
|
+
label: t = "label",
|
|
441
440
|
value: d = "value"
|
|
442
|
-
} =
|
|
443
|
-
multiple:
|
|
444
|
-
mapField:
|
|
445
|
-
} = i,
|
|
446
|
-
|
|
447
|
-
function
|
|
448
|
-
|
|
441
|
+
} = Z, {
|
|
442
|
+
multiple: f,
|
|
443
|
+
mapField: n
|
|
444
|
+
} = i, m = useComponent(), b = f ? `_${r.field}` : r.field;
|
|
445
|
+
m.setDefaultValue(i, h, r.field);
|
|
446
|
+
function M(p) {
|
|
447
|
+
m.selectChange(p, h, r.field, l, {
|
|
449
448
|
column: r,
|
|
450
449
|
datasource: "row"
|
|
451
450
|
});
|
|
452
451
|
}
|
|
453
|
-
function
|
|
454
|
-
|
|
452
|
+
function V() {
|
|
453
|
+
m.clear(h, r.field, n, c, "row");
|
|
455
454
|
}
|
|
456
455
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
457
|
-
modelValue: h[
|
|
458
|
-
"onUpdate:modelValue": (p) => h[
|
|
456
|
+
modelValue: h[b],
|
|
457
|
+
"onUpdate:modelValue": (p) => h[b] = p,
|
|
459
458
|
filterable: !0,
|
|
460
459
|
clearable: !0
|
|
461
460
|
}, i, {
|
|
462
461
|
style: "width: 100%",
|
|
463
462
|
class: "udp-select-wrapper",
|
|
464
|
-
onChange: (p) =>
|
|
465
|
-
onClear: () =>
|
|
463
|
+
onChange: (p) => M(p),
|
|
464
|
+
onClear: () => V()
|
|
466
465
|
}), _isSlot(o = e.map((p) => createVNode(resolveComponent("el-option"), {
|
|
467
466
|
key: p[d],
|
|
468
|
-
label: p[
|
|
467
|
+
label: p[t],
|
|
469
468
|
value: p[d]
|
|
470
469
|
}, null))) ? o : {
|
|
471
470
|
default: () => [o]
|
|
472
471
|
})];
|
|
473
472
|
},
|
|
474
|
-
renderTableDefault(
|
|
473
|
+
renderTableDefault(l, a) {
|
|
475
474
|
let o;
|
|
476
475
|
const {
|
|
477
476
|
row: h,
|
|
478
477
|
column: r
|
|
479
|
-
} =
|
|
478
|
+
} = a, {
|
|
480
479
|
options: e,
|
|
481
480
|
props: i,
|
|
482
|
-
optionProps:
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
function M(y) {
|
|
494
|
-
m.selectChange(y, h, r.field, a, {
|
|
481
|
+
optionProps: Z = {}
|
|
482
|
+
} = l, {
|
|
483
|
+
label: c = "label",
|
|
484
|
+
value: t = "value",
|
|
485
|
+
extLabel: d
|
|
486
|
+
} = Z, {
|
|
487
|
+
multiple: f
|
|
488
|
+
} = i, n = useComponent(), m = f ? `_${r.field}` : r.field;
|
|
489
|
+
n.setDefaultValue(i, h, r.field);
|
|
490
|
+
function b(V) {
|
|
491
|
+
n.selectChange(V, h, r.field, l, {
|
|
495
492
|
column: r,
|
|
496
493
|
datasource: "row"
|
|
497
494
|
});
|
|
498
495
|
}
|
|
499
|
-
function
|
|
500
|
-
|
|
496
|
+
function M() {
|
|
497
|
+
n.clear(h, r.field, l, "row");
|
|
501
498
|
}
|
|
502
499
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
503
|
-
modelValue: h[
|
|
504
|
-
"onUpdate:modelValue": (
|
|
500
|
+
modelValue: h[m],
|
|
501
|
+
"onUpdate:modelValue": (V) => h[m] = V,
|
|
505
502
|
filterable: !0,
|
|
506
503
|
clearable: !0
|
|
507
504
|
}, i, {
|
|
508
505
|
style: "width: 100%",
|
|
509
|
-
onChange: (
|
|
510
|
-
onClear: () =>
|
|
511
|
-
}), _isSlot(o = e.map((
|
|
512
|
-
key:
|
|
513
|
-
label:
|
|
514
|
-
value:
|
|
506
|
+
onChange: (V) => b(V),
|
|
507
|
+
onClear: () => M()
|
|
508
|
+
}), _isSlot(o = e.map((V) => createVNode(resolveComponent("el-option"), {
|
|
509
|
+
key: V[t],
|
|
510
|
+
label: d && V[d] ? V[t] : V[c],
|
|
511
|
+
value: V[t]
|
|
515
512
|
}, null))) ? o : {
|
|
516
513
|
default: () => [o]
|
|
517
514
|
})];
|
|
@@ -533,305 +530,294 @@ const VxetableRender = (VXETable, {
|
|
|
533
530
|
textValue
|
|
534
531
|
} = props;
|
|
535
532
|
let val = row[column.field];
|
|
536
|
-
const item = options.find((
|
|
533
|
+
const item = options.find((l) => l[value] === val);
|
|
537
534
|
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])];
|
|
538
535
|
},
|
|
539
|
-
renderItemContent(
|
|
536
|
+
renderItemContent(l, a) {
|
|
540
537
|
let o;
|
|
541
538
|
const {
|
|
542
539
|
data: h,
|
|
543
540
|
field: r
|
|
544
|
-
} =
|
|
541
|
+
} = a, {
|
|
545
542
|
options: e,
|
|
546
543
|
props: i,
|
|
547
|
-
optionProps:
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
function s(p) {
|
|
558
|
-
n.selectChange(p, h, r, a, {
|
|
544
|
+
optionProps: Z = {}
|
|
545
|
+
} = l, {
|
|
546
|
+
label: c = "label",
|
|
547
|
+
value: t = "value"
|
|
548
|
+
} = Z, d = useComponent(), {
|
|
549
|
+
multiple: f
|
|
550
|
+
} = i, n = f ? `_${r}` : r;
|
|
551
|
+
f && d.setDefaultValue(i, h, r);
|
|
552
|
+
function m(M) {
|
|
553
|
+
d.selectChange(M, h, r, l, {
|
|
559
554
|
datasource: "data"
|
|
560
555
|
});
|
|
561
556
|
}
|
|
562
|
-
function
|
|
563
|
-
|
|
557
|
+
function b() {
|
|
558
|
+
d.clear(h, r, l, "data");
|
|
564
559
|
}
|
|
565
560
|
return [createVNode(resolveComponent("el-select"), mergeProps({
|
|
566
|
-
modelValue: h[
|
|
567
|
-
"onUpdate:modelValue": (
|
|
561
|
+
modelValue: h[n],
|
|
562
|
+
"onUpdate:modelValue": (M) => h[n] = M,
|
|
568
563
|
filterable: !0,
|
|
569
564
|
clearable: !0,
|
|
570
565
|
style: "width: 100%"
|
|
571
566
|
}, i, {
|
|
572
|
-
onChange: (
|
|
573
|
-
onClear: () =>
|
|
574
|
-
}), _isSlot(o = e.map((
|
|
575
|
-
key:
|
|
576
|
-
label:
|
|
577
|
-
value:
|
|
567
|
+
onChange: (M) => m(M),
|
|
568
|
+
onClear: () => b()
|
|
569
|
+
}), _isSlot(o = e.map((M) => createVNode(resolveComponent("el-option"), {
|
|
570
|
+
key: M[t],
|
|
571
|
+
label: M[c],
|
|
572
|
+
value: M[t]
|
|
578
573
|
}, null))) ? o : {
|
|
579
574
|
default: () => [o]
|
|
580
575
|
})];
|
|
581
576
|
}
|
|
582
577
|
}), VXETable.renderer.add("#lov", {
|
|
583
|
-
renderItemContent(
|
|
578
|
+
renderItemContent(l, a) {
|
|
584
579
|
const {
|
|
585
580
|
data: o,
|
|
586
581
|
field: h
|
|
587
|
-
} =
|
|
582
|
+
} = a, {
|
|
588
583
|
props: r,
|
|
589
584
|
events: e
|
|
590
|
-
} =
|
|
591
|
-
defaultValues:
|
|
592
|
-
mapField: v
|
|
585
|
+
} = l, i = useComponent(), {
|
|
586
|
+
defaultValues: Z
|
|
593
587
|
} = r;
|
|
594
|
-
|
|
595
|
-
function
|
|
588
|
+
Z && (o[h] = Z);
|
|
589
|
+
function c(d, f) {
|
|
596
590
|
const {
|
|
597
|
-
mapField:
|
|
591
|
+
mapField: n,
|
|
598
592
|
field: m,
|
|
599
|
-
displayName:
|
|
593
|
+
displayName: b,
|
|
600
594
|
multiple: M
|
|
601
595
|
} = r;
|
|
602
596
|
if (M) {
|
|
603
597
|
if (M) {
|
|
604
|
-
const
|
|
605
|
-
o[
|
|
606
|
-
for (const
|
|
607
|
-
y
|
|
608
|
-
return
|
|
609
|
-
}, ""), Object.assign(o,
|
|
598
|
+
const p = {};
|
|
599
|
+
o[b || m] = d.reduce((L, k) => {
|
|
600
|
+
for (const y in n)
|
|
601
|
+
p[y] = L ? p[y] + "," + k[n[y]] : k[n[y]];
|
|
602
|
+
return L = L ? L + "," + k[b || m] : k[b || m], L;
|
|
603
|
+
}, ""), Object.assign(o, p);
|
|
610
604
|
}
|
|
611
605
|
} else {
|
|
612
|
-
const
|
|
613
|
-
[
|
|
606
|
+
const p = {
|
|
607
|
+
[b || m]: d[f || b || m]
|
|
614
608
|
};
|
|
615
|
-
for (const
|
|
616
|
-
|
|
617
|
-
Object.assign(o,
|
|
609
|
+
for (const L in n)
|
|
610
|
+
p[L] = d[n[L]];
|
|
611
|
+
Object.assign(o, p);
|
|
618
612
|
}
|
|
619
|
-
const
|
|
613
|
+
const V = {
|
|
620
614
|
data: o,
|
|
621
|
-
options:
|
|
615
|
+
options: d,
|
|
622
616
|
field: m
|
|
623
617
|
};
|
|
624
|
-
e != null && e.change && e.change(
|
|
618
|
+
e != null && e.change && e.change(V);
|
|
625
619
|
}
|
|
626
|
-
function
|
|
627
|
-
i.clear(o, h,
|
|
620
|
+
function t() {
|
|
621
|
+
i.clear(o, h, l, "data");
|
|
628
622
|
}
|
|
629
623
|
return [createVNode(resolveComponent("ut-lov"), mergeProps({
|
|
630
624
|
record: o
|
|
631
625
|
}, r, {
|
|
632
626
|
mode: "vxe",
|
|
633
|
-
onChange: (
|
|
634
|
-
onClear: () =>
|
|
627
|
+
onChange: (d, f) => c(d, f),
|
|
628
|
+
onClear: () => t()
|
|
635
629
|
}), null)];
|
|
636
630
|
},
|
|
637
631
|
// 单元格编辑
|
|
638
|
-
renderTableEdit(
|
|
632
|
+
renderTableEdit(l, a) {
|
|
639
633
|
const {
|
|
640
634
|
row: o,
|
|
641
635
|
column: h
|
|
642
|
-
} =
|
|
636
|
+
} = a, {
|
|
643
637
|
props: r,
|
|
644
638
|
events: e
|
|
645
|
-
} =
|
|
646
|
-
function t
|
|
639
|
+
} = l, i = useComponent();
|
|
640
|
+
function Z(t, d) {
|
|
647
641
|
const {
|
|
648
|
-
mapField:
|
|
649
|
-
field:
|
|
650
|
-
displayName:
|
|
651
|
-
multiple:
|
|
642
|
+
mapField: f,
|
|
643
|
+
field: n,
|
|
644
|
+
displayName: m,
|
|
645
|
+
multiple: b
|
|
652
646
|
} = r;
|
|
653
|
-
if (!
|
|
654
|
-
const
|
|
655
|
-
[
|
|
647
|
+
if (!b) {
|
|
648
|
+
const V = {
|
|
649
|
+
[m || n]: t[d || m || n]
|
|
656
650
|
};
|
|
657
|
-
for (const p in
|
|
658
|
-
|
|
659
|
-
Object.assign(o,
|
|
651
|
+
for (const p in f)
|
|
652
|
+
V[p] = t[f[p]];
|
|
653
|
+
Object.assign(o, V);
|
|
660
654
|
}
|
|
661
|
-
const
|
|
655
|
+
const M = {
|
|
662
656
|
row: o,
|
|
663
|
-
options:
|
|
657
|
+
options: t,
|
|
664
658
|
field: h.field,
|
|
665
659
|
column: h
|
|
666
660
|
};
|
|
667
|
-
e != null && e.change && e.change(
|
|
661
|
+
e != null && e.change && e.change(M);
|
|
668
662
|
}
|
|
669
|
-
function
|
|
670
|
-
i.clear(o, h.field,
|
|
663
|
+
function c() {
|
|
664
|
+
i.clear(o, h.field, l, "row");
|
|
671
665
|
}
|
|
672
666
|
return [createVNode(resolveComponent("ut-lov"), mergeProps({
|
|
673
667
|
record: o,
|
|
674
668
|
mode: "vxe",
|
|
675
669
|
transfer: !0
|
|
676
670
|
}, r, {
|
|
677
|
-
onChange: (
|
|
678
|
-
onClear: () =>
|
|
671
|
+
onChange: (t, d) => Z(t, d),
|
|
672
|
+
onClear: () => c()
|
|
679
673
|
}), null)];
|
|
680
674
|
},
|
|
681
675
|
// 单元格默认
|
|
682
|
-
renderTableDefault(
|
|
676
|
+
renderTableDefault(l, a) {
|
|
683
677
|
const {
|
|
684
678
|
row: o,
|
|
685
679
|
column: h
|
|
686
|
-
} =
|
|
680
|
+
} = a, {
|
|
687
681
|
props: r,
|
|
688
682
|
events: e
|
|
689
|
-
} =
|
|
690
|
-
function t
|
|
683
|
+
} = l, i = useComponent();
|
|
684
|
+
function Z(t, d) {
|
|
691
685
|
const {
|
|
692
|
-
mapField:
|
|
693
|
-
field:
|
|
694
|
-
displayName:
|
|
695
|
-
multiple:
|
|
686
|
+
mapField: f,
|
|
687
|
+
field: n,
|
|
688
|
+
displayName: m,
|
|
689
|
+
multiple: b
|
|
696
690
|
} = r;
|
|
697
|
-
if (!
|
|
698
|
-
const
|
|
699
|
-
[
|
|
691
|
+
if (!b) {
|
|
692
|
+
const V = {
|
|
693
|
+
[m || n]: t[d || m || n]
|
|
700
694
|
};
|
|
701
|
-
for (const p in
|
|
702
|
-
|
|
703
|
-
Object.assign(o,
|
|
695
|
+
for (const p in f)
|
|
696
|
+
V[p] = t[f[p]];
|
|
697
|
+
Object.assign(o, V);
|
|
704
698
|
}
|
|
705
|
-
const
|
|
699
|
+
const M = {
|
|
706
700
|
row: o,
|
|
707
|
-
options:
|
|
701
|
+
options: t,
|
|
708
702
|
field: h.field,
|
|
709
703
|
column: h
|
|
710
704
|
};
|
|
711
|
-
e != null && e.change && e.change(
|
|
705
|
+
e != null && e.change && e.change(M);
|
|
712
706
|
}
|
|
713
|
-
function
|
|
714
|
-
i.clear(o, h.field,
|
|
707
|
+
function c() {
|
|
708
|
+
i.clear(o, h.field, l, "row");
|
|
715
709
|
}
|
|
716
710
|
return [createVNode(resolveComponent("ut-lov"), mergeProps({
|
|
717
711
|
record: o,
|
|
718
712
|
mode: "ele"
|
|
719
713
|
}, r, {
|
|
720
|
-
onChange: (
|
|
721
|
-
onClear: () =>
|
|
714
|
+
onChange: (t, d) => Z(t, d),
|
|
715
|
+
onClear: () => c()
|
|
722
716
|
}), null)];
|
|
723
717
|
},
|
|
724
718
|
// 可编辑显示模板
|
|
725
|
-
renderTableCell(
|
|
719
|
+
renderTableCell(l, a) {
|
|
726
720
|
const {
|
|
727
721
|
row: o,
|
|
728
722
|
column: h
|
|
729
|
-
} =
|
|
723
|
+
} = a;
|
|
730
724
|
return [createVNode("span", null, [o[h.field]])];
|
|
731
725
|
}
|
|
732
726
|
}), VXETable.renderer.add("#textarea", {
|
|
733
|
-
renderTableEdit(
|
|
727
|
+
renderTableEdit(l, a) {
|
|
734
728
|
const {
|
|
735
729
|
row: o,
|
|
736
730
|
column: h
|
|
737
|
-
} = l, {
|
|
738
|
-
props: r,
|
|
739
|
-
events: e
|
|
740
731
|
} = a, {
|
|
741
|
-
|
|
742
|
-
} =
|
|
743
|
-
function
|
|
744
|
-
|
|
732
|
+
props: r
|
|
733
|
+
} = l, e = useComponent();
|
|
734
|
+
function i(c) {
|
|
735
|
+
e.change(c, o, h.field, l, {
|
|
745
736
|
column: h,
|
|
746
737
|
datasource: "row"
|
|
747
738
|
});
|
|
748
739
|
}
|
|
749
740
|
function Z() {
|
|
750
|
-
|
|
741
|
+
e.clear(o, h.field, l, "row");
|
|
751
742
|
}
|
|
752
743
|
return [createVNode(resolveComponent("vxe-textarea"), mergeProps({
|
|
753
744
|
modelValue: o[h.field],
|
|
754
|
-
"onUpdate:modelValue": (
|
|
745
|
+
"onUpdate:modelValue": (c) => o[h.field] = c
|
|
755
746
|
}, r, {
|
|
756
747
|
style: "width: 100%",
|
|
757
|
-
onChange: (
|
|
748
|
+
onChange: (c) => i(c),
|
|
758
749
|
onClear: () => Z()
|
|
759
750
|
}), null)];
|
|
760
751
|
},
|
|
761
|
-
renderTableDefault(
|
|
752
|
+
renderTableDefault(l, a) {
|
|
762
753
|
const {
|
|
763
754
|
row: o,
|
|
764
755
|
column: h
|
|
765
|
-
} = l, {
|
|
766
|
-
props: r,
|
|
767
|
-
events: e
|
|
768
756
|
} = a, {
|
|
769
|
-
|
|
770
|
-
} =
|
|
771
|
-
function
|
|
772
|
-
|
|
757
|
+
props: r
|
|
758
|
+
} = l, e = useComponent();
|
|
759
|
+
function i(c) {
|
|
760
|
+
e.change(c, o, h.field, l, {
|
|
773
761
|
column: h,
|
|
774
762
|
datasource: "row"
|
|
775
763
|
});
|
|
776
764
|
}
|
|
777
765
|
function Z() {
|
|
778
|
-
|
|
766
|
+
e.clear(o, h.field, l, "row");
|
|
779
767
|
}
|
|
780
768
|
return [createVNode(resolveComponent("vxe-textarea"), mergeProps({
|
|
781
769
|
modelValue: o[h.field],
|
|
782
|
-
"onUpdate:modelValue": (
|
|
770
|
+
"onUpdate:modelValue": (c) => o[h.field] = c
|
|
783
771
|
}, r, {
|
|
784
|
-
onChange: (
|
|
772
|
+
onChange: (c) => i(c),
|
|
785
773
|
onClear: () => Z()
|
|
786
774
|
}), null)];
|
|
787
775
|
},
|
|
788
776
|
// 可编辑显示模板
|
|
789
|
-
renderTableCell(
|
|
777
|
+
renderTableCell(l, a) {
|
|
790
778
|
const {
|
|
791
779
|
row: o,
|
|
792
780
|
column: h
|
|
793
|
-
} =
|
|
781
|
+
} = a;
|
|
794
782
|
return o[h.field];
|
|
795
783
|
},
|
|
796
|
-
renderItemContent(
|
|
784
|
+
renderItemContent(l, a) {
|
|
797
785
|
const {
|
|
798
786
|
data: o,
|
|
799
787
|
field: h
|
|
800
|
-
} =
|
|
801
|
-
props: r
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
defaultValue: t,
|
|
805
|
-
mapField: v
|
|
788
|
+
} = a, {
|
|
789
|
+
props: r
|
|
790
|
+
} = l, e = useComponent(), {
|
|
791
|
+
defaultValue: i
|
|
806
792
|
} = r;
|
|
807
|
-
|
|
808
|
-
function Z(
|
|
809
|
-
|
|
793
|
+
i && (o[h] = i);
|
|
794
|
+
function Z(t) {
|
|
795
|
+
e.change(t, o, h, l, {
|
|
810
796
|
datasource: "data"
|
|
811
797
|
});
|
|
812
798
|
}
|
|
813
|
-
function
|
|
814
|
-
|
|
799
|
+
function c() {
|
|
800
|
+
e.clear(o, h, l, "data");
|
|
815
801
|
}
|
|
816
802
|
return [createVNode(resolveComponent("vxe-textarea"), mergeProps({
|
|
817
803
|
modelValue: o[h],
|
|
818
|
-
"onUpdate:modelValue": (
|
|
804
|
+
"onUpdate:modelValue": (t) => o[h] = t
|
|
819
805
|
}, r, {
|
|
820
|
-
onChange: (
|
|
821
|
-
onClear: () =>
|
|
806
|
+
onChange: (t) => Z(t),
|
|
807
|
+
onClear: () => c()
|
|
822
808
|
}), null)];
|
|
823
809
|
}
|
|
824
810
|
}), VXETable.renderer.add("#upload", {
|
|
825
|
-
renderTableEdit(
|
|
811
|
+
renderTableEdit(l, a) {
|
|
826
812
|
const {
|
|
827
813
|
row: o,
|
|
828
814
|
column: h
|
|
829
|
-
} =
|
|
815
|
+
} = a, {
|
|
830
816
|
props: r,
|
|
831
817
|
events: e
|
|
832
|
-
} =
|
|
833
|
-
function i(
|
|
834
|
-
o[h.field] = "", e != null && e.remove && (e == null || e.remove(
|
|
818
|
+
} = l;
|
|
819
|
+
function i(Z, c) {
|
|
820
|
+
o[h.field] = "", e != null && e.remove && (e == null || e.remove(Z, c));
|
|
835
821
|
}
|
|
836
822
|
return [createVNode(resolveComponent("form-upload"), mergeProps({
|
|
837
823
|
record: o,
|
|
@@ -840,17 +826,17 @@ const VxetableRender = (VXETable, {
|
|
|
840
826
|
}, r, {
|
|
841
827
|
"render-mode": "column",
|
|
842
828
|
"data-status": "edit",
|
|
843
|
-
onRemove: (
|
|
829
|
+
onRemove: (Z, c) => i(Z, c)
|
|
844
830
|
}), null)];
|
|
845
831
|
},
|
|
846
832
|
// 可编辑显示模板
|
|
847
|
-
renderTableCell(
|
|
833
|
+
renderTableCell(l, a) {
|
|
848
834
|
const {
|
|
849
835
|
row: o,
|
|
850
836
|
column: h
|
|
851
|
-
} =
|
|
837
|
+
} = a, {
|
|
852
838
|
props: r
|
|
853
|
-
} =
|
|
839
|
+
} = l;
|
|
854
840
|
return [createVNode(resolveComponent("form-upload"), mergeProps({
|
|
855
841
|
record: o,
|
|
856
842
|
field: h.field,
|
|
@@ -861,108 +847,126 @@ const VxetableRender = (VXETable, {
|
|
|
861
847
|
"data-status": "detail"
|
|
862
848
|
}), null)];
|
|
863
849
|
},
|
|
864
|
-
|
|
850
|
+
// 默认显示模板
|
|
851
|
+
renderDefault(l, a) {
|
|
852
|
+
const {
|
|
853
|
+
row: o,
|
|
854
|
+
column: h
|
|
855
|
+
} = a, {
|
|
856
|
+
props: r
|
|
857
|
+
} = l;
|
|
858
|
+
return [createVNode(resolveComponent("form-upload"), mergeProps({
|
|
859
|
+
record: o,
|
|
860
|
+
field: h.field,
|
|
861
|
+
size: "mini"
|
|
862
|
+
}, r, {
|
|
863
|
+
mode: "image",
|
|
864
|
+
"render-mode": "column",
|
|
865
|
+
"data-status": "detail"
|
|
866
|
+
}), null)];
|
|
867
|
+
},
|
|
868
|
+
renderItemContent(l, a) {
|
|
865
869
|
const {
|
|
866
870
|
data: o,
|
|
867
871
|
field: h
|
|
868
|
-
} =
|
|
872
|
+
} = a, {
|
|
869
873
|
props: r,
|
|
870
874
|
events: e
|
|
871
|
-
} =
|
|
872
|
-
function i(
|
|
873
|
-
o[h] = "", e != null && e.remove && (e == null || e.remove(
|
|
875
|
+
} = l;
|
|
876
|
+
function i(Z, c) {
|
|
877
|
+
o[h] = "", e != null && e.remove && (e == null || e.remove(Z, c));
|
|
874
878
|
}
|
|
875
879
|
return [createVNode(resolveComponent("form-upload"), mergeProps({
|
|
876
880
|
record: o,
|
|
877
881
|
field: h,
|
|
878
882
|
mode: "image"
|
|
879
883
|
}, r, {
|
|
880
|
-
onRemove: (
|
|
884
|
+
onRemove: (Z, c) => i(Z, c)
|
|
881
885
|
}), null)];
|
|
882
886
|
}
|
|
883
887
|
}), VXETable.renderer.add("#tag", {
|
|
884
888
|
// 默认显示模板
|
|
885
|
-
renderTableDefault(
|
|
889
|
+
renderTableDefault(l, a) {
|
|
886
890
|
let o;
|
|
887
891
|
const {
|
|
888
892
|
row: h,
|
|
889
893
|
column: r
|
|
890
|
-
} =
|
|
894
|
+
} = a, {
|
|
891
895
|
props: {
|
|
892
896
|
code: e,
|
|
893
897
|
tagMap: i
|
|
894
898
|
}
|
|
895
|
-
} =
|
|
896
|
-
function
|
|
899
|
+
} = l;
|
|
900
|
+
function Z() {
|
|
897
901
|
return h[r.field] ? i[h[r.field]] : null;
|
|
898
902
|
}
|
|
899
903
|
return [h[r.field] ? createVNode(resolveComponent("el-tag"), {
|
|
900
904
|
effect: "dark",
|
|
901
|
-
type:
|
|
905
|
+
type: Z()
|
|
902
906
|
}, _isSlot(o = getValue(e, h[r.field])) ? o : {
|
|
903
907
|
default: () => [o]
|
|
904
908
|
}) : null];
|
|
905
909
|
}
|
|
906
910
|
}), VXETable.renderer.add("#switch", {
|
|
907
|
-
renderTableDefault(
|
|
911
|
+
renderTableDefault(l, a) {
|
|
908
912
|
const {
|
|
909
913
|
row: o,
|
|
910
914
|
column: h
|
|
911
|
-
} =
|
|
915
|
+
} = a, {
|
|
912
916
|
props: {
|
|
913
917
|
code: r,
|
|
914
918
|
activeValue: e,
|
|
915
919
|
inactiveValue: i
|
|
916
920
|
},
|
|
917
|
-
events:
|
|
918
|
-
} =
|
|
919
|
-
function
|
|
921
|
+
events: Z
|
|
922
|
+
} = l;
|
|
923
|
+
function c(t) {
|
|
920
924
|
const d = {
|
|
921
925
|
row: o,
|
|
922
926
|
column: h,
|
|
923
|
-
value:
|
|
927
|
+
value: t
|
|
924
928
|
};
|
|
925
|
-
|
|
929
|
+
Z != null && Z.change && Z.change(d);
|
|
926
930
|
}
|
|
927
931
|
return [o[h.field] ? createVNode(resolveComponent("el-switch"), mergeProps({
|
|
928
932
|
modelValue: o[h.field],
|
|
929
|
-
"onUpdate:modelValue": (
|
|
933
|
+
"onUpdate:modelValue": (t) => o[h.field] = t,
|
|
930
934
|
"inline-prompt": !0,
|
|
931
935
|
size: "large",
|
|
932
936
|
style: "--el-switch-on-color: #13ce66; --el-switch-off-color: #E6A23C"
|
|
933
|
-
},
|
|
937
|
+
}, l.props, {
|
|
934
938
|
"active-text": getValue(r, e),
|
|
935
939
|
"inactive-text": getValue(r, i),
|
|
936
|
-
onChange: (
|
|
940
|
+
onChange: (t) => c(t)
|
|
937
941
|
}), null) : null];
|
|
938
942
|
}
|
|
939
943
|
}), VXETable.renderer.add("#iconSelect", {
|
|
940
|
-
renderTableEdit(
|
|
944
|
+
renderTableEdit(l, a) {
|
|
941
945
|
const {
|
|
942
946
|
row: o,
|
|
943
947
|
column: h
|
|
944
|
-
} =
|
|
948
|
+
} = a;
|
|
945
949
|
return [createVNode(resolveComponent("SuIconSelect"), {
|
|
946
950
|
modelValue: o[h.field],
|
|
947
951
|
"onUpdate:modelValue": (r) => o[h.field] = r,
|
|
948
952
|
teleported: !1
|
|
949
953
|
}, null)];
|
|
950
954
|
},
|
|
951
|
-
renderTableCell(
|
|
955
|
+
renderTableCell(l, a) {
|
|
952
956
|
const {
|
|
953
957
|
row: o,
|
|
954
958
|
column: h
|
|
955
|
-
} =
|
|
959
|
+
} = a;
|
|
956
960
|
return [createVNode(resolveComponent("IconifyIconOffline"), {
|
|
957
961
|
icon: o[h.field],
|
|
958
962
|
style: "font-size: 16px;"
|
|
959
963
|
}, null)];
|
|
960
964
|
},
|
|
961
|
-
renderItemContent(
|
|
965
|
+
renderItemContent(l, a) {
|
|
962
966
|
const {
|
|
963
967
|
data: o,
|
|
964
968
|
field: h
|
|
965
|
-
} =
|
|
969
|
+
} = a;
|
|
966
970
|
return [createVNode(resolveComponent("SuIconSelect"), {
|
|
967
971
|
modelValue: o[h],
|
|
968
972
|
"onUpdate:modelValue": (r) => o[h] = r,
|
|
@@ -970,399 +974,405 @@ const VxetableRender = (VXETable, {
|
|
|
970
974
|
}, null)];
|
|
971
975
|
}
|
|
972
976
|
}), VXETable.renderer.add("#treeSelect", {
|
|
973
|
-
renderTableEdit(
|
|
977
|
+
renderTableEdit(l, a) {
|
|
974
978
|
const {
|
|
975
979
|
row: o,
|
|
976
980
|
column: h
|
|
977
|
-
} =
|
|
981
|
+
} = a, {
|
|
978
982
|
props: r,
|
|
979
983
|
sourceData: e,
|
|
980
984
|
events: i
|
|
981
|
-
} =
|
|
985
|
+
} = l;
|
|
982
986
|
return [createVNode(resolveComponent("el-tree-select"), mergeProps({
|
|
983
987
|
modelValue: o[h.field],
|
|
984
|
-
"onUpdate:modelValue": (
|
|
988
|
+
"onUpdate:modelValue": (Z) => o[h.field] = Z,
|
|
985
989
|
data: e,
|
|
986
990
|
"check-strictly": !0
|
|
987
991
|
}, r, {
|
|
988
992
|
filterable: !0,
|
|
989
|
-
onCheckChange: (
|
|
990
|
-
onNodeClick: (
|
|
991
|
-
onCurrentChange: (
|
|
993
|
+
onCheckChange: (Z, c, t) => onCheckChange(Z, c, t, i),
|
|
994
|
+
onNodeClick: (Z, c, t) => onNodeClick(Z, c, t, i),
|
|
995
|
+
onCurrentChange: (Z, c) => onCurrentChange(Z, c, i)
|
|
992
996
|
}), null)];
|
|
993
997
|
},
|
|
994
|
-
renderTableCell(
|
|
998
|
+
renderTableCell(l, a) {
|
|
995
999
|
const {
|
|
996
1000
|
row: o,
|
|
997
1001
|
column: h
|
|
998
|
-
} =
|
|
1002
|
+
} = a, {
|
|
999
1003
|
sourceData: r,
|
|
1000
1004
|
props: e = {}
|
|
1001
|
-
} =
|
|
1005
|
+
} = l, {
|
|
1002
1006
|
children: i = "children",
|
|
1003
|
-
label:
|
|
1004
|
-
} = e,
|
|
1007
|
+
label: Z = "label"
|
|
1008
|
+
} = e, c = findTree(r, (t) => t.value === o[h.field], {
|
|
1005
1009
|
children: i
|
|
1006
1010
|
});
|
|
1007
|
-
return
|
|
1011
|
+
return c ? [createVNode("span", null, [c.item[Z]])] : null;
|
|
1008
1012
|
},
|
|
1009
|
-
renderItemContent(
|
|
1013
|
+
renderItemContent(l, a) {
|
|
1010
1014
|
const {
|
|
1011
1015
|
data: o,
|
|
1012
1016
|
field: h
|
|
1013
|
-
} =
|
|
1017
|
+
} = a, {
|
|
1014
1018
|
props: r,
|
|
1015
1019
|
sourceData: e,
|
|
1016
1020
|
events: i
|
|
1017
|
-
} =
|
|
1021
|
+
} = l;
|
|
1018
1022
|
return [createVNode(resolveComponent("el-tree-select"), mergeProps({
|
|
1019
1023
|
modelValue: o[h],
|
|
1020
|
-
"onUpdate:modelValue": (
|
|
1024
|
+
"onUpdate:modelValue": (Z) => o[h] = Z,
|
|
1021
1025
|
data: e,
|
|
1022
1026
|
"check-strictly": !0
|
|
1023
1027
|
}, r, {
|
|
1024
1028
|
filterable: !0,
|
|
1025
|
-
onCheckChange: (
|
|
1026
|
-
onNodeClick: (
|
|
1027
|
-
onCurrentChange: (
|
|
1029
|
+
onCheckChange: (Z, c, t) => onCheckChange(Z, c, t, i),
|
|
1030
|
+
onNodeClick: (Z, c, t) => onNodeClick(Z, c, t, i),
|
|
1031
|
+
onCurrentChange: (Z, c) => onCurrentChange(Z, c, i)
|
|
1028
1032
|
}), null)];
|
|
1029
1033
|
}
|
|
1030
1034
|
});
|
|
1031
1035
|
const useComponent = () => ({
|
|
1032
|
-
clear: (r, e, i,
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
+
clear: (r, e, i, Z) => {
|
|
1037
|
+
const {
|
|
1038
|
+
props: c,
|
|
1039
|
+
events: t
|
|
1040
|
+
} = i, {
|
|
1041
|
+
mapField: d
|
|
1042
|
+
} = c;
|
|
1043
|
+
if (r[e] = null, c != null && c.multiple && (r[`_${e}`] = []), !isEmpty(d))
|
|
1044
|
+
for (const f in d)
|
|
1045
|
+
r[f] = null;
|
|
1036
1046
|
t != null && t.clear && t.clear({
|
|
1037
|
-
[
|
|
1047
|
+
[Z]: r,
|
|
1038
1048
|
field: e
|
|
1039
1049
|
});
|
|
1040
1050
|
},
|
|
1041
1051
|
remote: async (r, e, i) => {
|
|
1042
1052
|
const {
|
|
1043
|
-
options:
|
|
1044
|
-
props:
|
|
1045
|
-
events:
|
|
1053
|
+
options: Z,
|
|
1054
|
+
props: c,
|
|
1055
|
+
events: t
|
|
1046
1056
|
} = i, {
|
|
1047
1057
|
fetchField: d,
|
|
1048
|
-
url:
|
|
1049
|
-
defaultParams:
|
|
1050
|
-
method:
|
|
1051
|
-
} =
|
|
1058
|
+
url: f,
|
|
1059
|
+
defaultParams: n = {},
|
|
1060
|
+
method: m = "get"
|
|
1061
|
+
} = c, b = getCookieParam(), M = Object.assign({
|
|
1052
1062
|
pageSize: 20,
|
|
1053
1063
|
pageNum: 1,
|
|
1054
|
-
...
|
|
1055
|
-
...
|
|
1064
|
+
...b,
|
|
1065
|
+
...n
|
|
1056
1066
|
}, {
|
|
1057
1067
|
[d || e]: r
|
|
1058
1068
|
});
|
|
1059
|
-
if (
|
|
1060
|
-
let
|
|
1069
|
+
if (c.loading) return;
|
|
1070
|
+
let V;
|
|
1061
1071
|
try {
|
|
1062
|
-
|
|
1072
|
+
Z.length = 0, c.loading = !0, V = await serviceApi[m](f, M), t != null && t.filterMethod ? Z.push(...t.filterMethod(V.list || V)) : V && (V.list ? Z.push(...V.list) : Z.push(...V));
|
|
1063
1073
|
} finally {
|
|
1064
|
-
|
|
1074
|
+
c.loading = !1;
|
|
1065
1075
|
}
|
|
1066
1076
|
},
|
|
1067
|
-
selectChange: (r, e, i,
|
|
1068
|
-
let
|
|
1077
|
+
selectChange: (r, e, i, Z, c) => {
|
|
1078
|
+
let t = null;
|
|
1069
1079
|
const {
|
|
1070
1080
|
datasource: d
|
|
1071
|
-
} =
|
|
1072
|
-
options:
|
|
1073
|
-
props:
|
|
1074
|
-
optionProps:
|
|
1075
|
-
events:
|
|
1076
|
-
} =
|
|
1081
|
+
} = c, {
|
|
1082
|
+
options: f,
|
|
1083
|
+
props: n,
|
|
1084
|
+
optionProps: m = {},
|
|
1085
|
+
events: b
|
|
1086
|
+
} = Z, M = {
|
|
1077
1087
|
[d]: e,
|
|
1078
1088
|
field: i
|
|
1079
1089
|
};
|
|
1080
|
-
e[i] = null, !isEmpty(r) && (
|
|
1081
|
-
const p =
|
|
1082
|
-
p && !isEmpty(
|
|
1083
|
-
const
|
|
1084
|
-
e[
|
|
1085
|
-
}), p &&
|
|
1086
|
-
}), Object.assign(
|
|
1087
|
-
options:
|
|
1088
|
-
})) : (e[i] =
|
|
1089
|
-
e[
|
|
1090
|
-
}), Object.assign(
|
|
1091
|
-
option:
|
|
1092
|
-
})), d === "row" && Object.assign(
|
|
1093
|
-
column:
|
|
1094
|
-
}),
|
|
1090
|
+
e[i] = null, !isEmpty(r) && (n != null && n.multiple) ? (e[i] = r.join(","), t = [], r.forEach((V) => {
|
|
1091
|
+
const p = f.find((L) => V === L[m == null ? void 0 : m.value]);
|
|
1092
|
+
p && !isEmpty(n.mapField) && isObject(n.mapField) && Object.keys(n.mapField).forEach((L) => {
|
|
1093
|
+
const k = p[n.mapField[L]], y = e[L] ? e[L].toString() : "";
|
|
1094
|
+
e[L] = y && !y.includes(k) ? `${y},${k}` : k;
|
|
1095
|
+
}), p && t.push(p);
|
|
1096
|
+
}), Object.assign(M, {
|
|
1097
|
+
options: t
|
|
1098
|
+
})) : (e[i] = n != null && n.multiple ? null : r, t = f.find((V) => r === V[m == null ? void 0 : m.value]), !isEmpty(n.mapField) && isObject(n.mapField) && Object.keys(n.mapField).forEach((V) => {
|
|
1099
|
+
e[V] = t ? t[n.mapField[V]] : null;
|
|
1100
|
+
}), Object.assign(M, {
|
|
1101
|
+
option: t
|
|
1102
|
+
})), d === "row" && Object.assign(M, {
|
|
1103
|
+
column: c.column
|
|
1104
|
+
}), b != null && b.change && b.change(M);
|
|
1095
1105
|
},
|
|
1096
1106
|
setDefaultValue: (r, e, i) => {
|
|
1097
1107
|
var d;
|
|
1098
1108
|
const {
|
|
1099
|
-
multiple:
|
|
1100
|
-
defaultValue:
|
|
1101
|
-
} = r,
|
|
1102
|
-
!e[i] &&
|
|
1103
|
-
e[
|
|
1104
|
-
})), !e[
|
|
1109
|
+
multiple: Z,
|
|
1110
|
+
defaultValue: c
|
|
1111
|
+
} = r, t = Z ? `_${i}` : i;
|
|
1112
|
+
!e[i] && c && (e[i] = c, isPlainObject(c) && Object.keys(c).forEach((n) => {
|
|
1113
|
+
e[n] = e[n] || c[n];
|
|
1114
|
+
})), !e[t] && e[i] && (e[t] = Z ? (d = e[i]) == null ? void 0 : d.split(",") : e[i]);
|
|
1105
1115
|
}
|
|
1106
|
-
}), onCheckChange = (
|
|
1107
|
-
console.log(
|
|
1108
|
-
}, onNodeClick = (
|
|
1109
|
-
h != null && h.checkChange && (h == null || h.checkChange(
|
|
1110
|
-
}, onCurrentChange = (
|
|
1111
|
-
o != null && o.checkChange && (o == null || o.checkChange(
|
|
1116
|
+
}), onCheckChange = (l, a, o, h) => {
|
|
1117
|
+
console.log(l, a, o), h != null && h.checkChange && (h == null || h.checkChange(l, a, o));
|
|
1118
|
+
}, onNodeClick = (l, a, o, h) => {
|
|
1119
|
+
h != null && h.checkChange && (h == null || h.checkChange(l, a, o));
|
|
1120
|
+
}, onCurrentChange = (l, a, o) => {
|
|
1121
|
+
o != null && o.checkChange && (o == null || o.checkChange(l, a));
|
|
1112
1122
|
};
|
|
1113
|
-
function getValue(
|
|
1123
|
+
function getValue(l, a) {
|
|
1114
1124
|
var o, h, r;
|
|
1115
|
-
return !
|
|
1125
|
+
return !a || !l || !dict ? a : (r = (h = (o = dict[l]) == null ? void 0 : o.children) == null ? void 0 : h.find((e) => e.dictCode === a)) == null ? void 0 : r.dictName;
|
|
1116
1126
|
}
|
|
1117
1127
|
return VXETable;
|
|
1118
1128
|
}, getCookieParam = () => {
|
|
1119
|
-
const
|
|
1120
|
-
return cookies.get(
|
|
1121
|
-
}, hasClass = (
|
|
1129
|
+
const l = "kCookies_param";
|
|
1130
|
+
return cookies.get(l) ? JSON.parse(cookies.get(l)) : {};
|
|
1131
|
+
}, hasClass = (l, a) => {
|
|
1122
1132
|
var o;
|
|
1123
|
-
return !!((o =
|
|
1124
|
-
}, addClass = (
|
|
1125
|
-
hasClass(
|
|
1126
|
-
}, removeClass = (
|
|
1133
|
+
return !!((o = l.className) != null && o.match(new RegExp("(\\s|^)" + a + "(\\s|$)")));
|
|
1134
|
+
}, addClass = (l, a, o) => {
|
|
1135
|
+
hasClass(l, a) || (l.className += " " + a), o && (hasClass(l, o) || (l.className += " " + o));
|
|
1136
|
+
}, removeClass = (l, a, o) => {
|
|
1127
1137
|
var h, r;
|
|
1128
|
-
if (hasClass(
|
|
1129
|
-
const e = new RegExp("(\\s|^)" +
|
|
1130
|
-
|
|
1138
|
+
if (hasClass(l, a)) {
|
|
1139
|
+
const e = new RegExp("(\\s|^)" + a + "(\\s|$)");
|
|
1140
|
+
l.className = (h = l.className) == null ? void 0 : h.replace(e, " ").trim();
|
|
1131
1141
|
}
|
|
1132
|
-
if (o && hasClass(
|
|
1142
|
+
if (o && hasClass(l, o)) {
|
|
1133
1143
|
const e = new RegExp("(\\s|^)" + o + "(\\s|$)");
|
|
1134
|
-
|
|
1144
|
+
l.className = (r = l.className) == null ? void 0 : r.replace(e, " ").trim();
|
|
1135
1145
|
}
|
|
1136
|
-
}, toggleClass = (
|
|
1146
|
+
}, toggleClass = (l, a, o) => {
|
|
1137
1147
|
const h = o || document.body;
|
|
1138
1148
|
let { className: r } = h;
|
|
1139
|
-
r = r == null ? void 0 : r.replace(
|
|
1149
|
+
r = r == null ? void 0 : r.replace(a, ""), h.className = r && l ? `${r} ${a} ` : r;
|
|
1140
1150
|
};
|
|
1141
|
-
function useRafThrottle(
|
|
1142
|
-
let
|
|
1151
|
+
function useRafThrottle(l) {
|
|
1152
|
+
let a = !1;
|
|
1143
1153
|
return function(...o) {
|
|
1144
|
-
|
|
1145
|
-
|
|
1154
|
+
a || (a = !0, window.requestAnimationFrame(() => {
|
|
1155
|
+
l.apply(this, o), a = !1;
|
|
1146
1156
|
}));
|
|
1147
1157
|
};
|
|
1148
1158
|
}
|
|
1149
|
-
const openLink = (
|
|
1150
|
-
const
|
|
1151
|
-
|
|
1152
|
-
}, isServer = typeof window > "u", resizeHandler = (
|
|
1153
|
-
for (const
|
|
1154
|
-
const o =
|
|
1159
|
+
const openLink = (l) => {
|
|
1160
|
+
const a = document.createElement("a");
|
|
1161
|
+
a.setAttribute("href", l), a.setAttribute("target", "_blank"), a.setAttribute("rel", "noreferrer noopener"), a.setAttribute("id", "external"), document.getElementById("external") && document.body.removeChild(document.getElementById("external")), document.body.appendChild(a), a.click(), a.remove();
|
|
1162
|
+
}, isServer = typeof window > "u", resizeHandler = (l) => {
|
|
1163
|
+
for (const a of l) {
|
|
1164
|
+
const o = a.target.__resizeListeners__ || [];
|
|
1155
1165
|
o.length && o.forEach((h) => {
|
|
1156
1166
|
h();
|
|
1157
1167
|
});
|
|
1158
1168
|
}
|
|
1159
|
-
}, addResizeListener = (
|
|
1160
|
-
isServer || (
|
|
1161
|
-
}, removeResizeListener = (
|
|
1162
|
-
!
|
|
1163
|
-
|
|
1169
|
+
}, addResizeListener = (l, a) => {
|
|
1170
|
+
isServer || (l.__resizeListeners__ || (l.__resizeListeners__ = [], l.__ro__ = new ResizeObserver(resizeHandler), l.__ro__.observe(l)), l.__resizeListeners__.push(a));
|
|
1171
|
+
}, removeResizeListener = (l, a) => {
|
|
1172
|
+
!l || !l.__resizeListeners__ || (l.__resizeListeners__.splice(
|
|
1173
|
+
l.__resizeListeners__.indexOf(a),
|
|
1164
1174
|
1
|
|
1165
|
-
),
|
|
1175
|
+
), l.__resizeListeners__.length || l.__ro__.disconnect());
|
|
1166
1176
|
}, domSymbol = Symbol("watermark-dom");
|
|
1167
|
-
function useWatermark(
|
|
1168
|
-
const
|
|
1169
|
-
const
|
|
1170
|
-
if (!
|
|
1171
|
-
const { clientHeight: d, clientWidth:
|
|
1172
|
-
i({ height: d, width:
|
|
1177
|
+
function useWatermark(l = ref(document.body)) {
|
|
1178
|
+
const a = useRafThrottle(function() {
|
|
1179
|
+
const t = unref(l);
|
|
1180
|
+
if (!t) return;
|
|
1181
|
+
const { clientHeight: d, clientWidth: f } = t;
|
|
1182
|
+
i({ height: d, width: f });
|
|
1173
1183
|
}), o = domSymbol.toString(), h = shallowRef(), r = () => {
|
|
1174
|
-
const
|
|
1184
|
+
const t = unref(h);
|
|
1175
1185
|
h.value = void 0;
|
|
1176
|
-
const d = unref(
|
|
1177
|
-
d && (
|
|
1186
|
+
const d = unref(l);
|
|
1187
|
+
d && (t && d.removeChild(t), removeResizeListener(d, a));
|
|
1178
1188
|
};
|
|
1179
|
-
function e(
|
|
1180
|
-
const
|
|
1181
|
-
Object.assign(
|
|
1182
|
-
const
|
|
1183
|
-
return
|
|
1189
|
+
function e(t, d) {
|
|
1190
|
+
const f = document.createElement("canvas"), n = 260, m = 180;
|
|
1191
|
+
Object.assign(f, { width: n, height: m });
|
|
1192
|
+
const b = f.getContext("2d");
|
|
1193
|
+
return b && (b.rotate(-20 * Math.PI / 120), b.font = (d == null ? void 0 : d.font) ?? "15px Reggae One", b.fillStyle = (d == null ? void 0 : d.fillStyle) ?? "rgba(180, 180, 180, 0.75)", b.textAlign = "left", b.textBaseline = "middle", b.fillText(t, n / 20, m)), f.toDataURL("image/png");
|
|
1184
1194
|
}
|
|
1185
|
-
function i(
|
|
1195
|
+
function i(t = {}) {
|
|
1186
1196
|
const d = unref(h);
|
|
1187
|
-
d && (isUndefined(
|
|
1188
|
-
|
|
1189
|
-
|
|
1197
|
+
d && (isUndefined(t.width) || (d.style.width = `${t.width}px`), isUndefined(t.height) || (d.style.height = `${t.height}px`), isUndefined(t.str) || (d.style.background = `url(${e(
|
|
1198
|
+
t.str,
|
|
1199
|
+
t.attr
|
|
1190
1200
|
)}) left top repeat`));
|
|
1191
1201
|
}
|
|
1192
|
-
const
|
|
1202
|
+
const Z = (t, d) => {
|
|
1193
1203
|
if (unref(h))
|
|
1194
|
-
return i({ str:
|
|
1195
|
-
const
|
|
1196
|
-
h.value =
|
|
1197
|
-
const
|
|
1198
|
-
if (!
|
|
1199
|
-
const { clientHeight:
|
|
1200
|
-
return i({ str:
|
|
1204
|
+
return i({ str: t, attr: d }), o;
|
|
1205
|
+
const f = document.createElement("div");
|
|
1206
|
+
h.value = f, f.id = o, f.style.pointerEvents = "none", f.style.top = "0px", f.style.left = "0px", f.style.position = "absolute", f.style.zIndex = "100000";
|
|
1207
|
+
const n = unref(l);
|
|
1208
|
+
if (!n) return o;
|
|
1209
|
+
const { clientHeight: m, clientWidth: b } = n;
|
|
1210
|
+
return i({ str: t, width: b, height: m, attr: d }), n.appendChild(f), o;
|
|
1201
1211
|
};
|
|
1202
|
-
function
|
|
1203
|
-
t
|
|
1212
|
+
function c(t, d) {
|
|
1213
|
+
Z(t, d), addResizeListener(document.documentElement, a), getCurrentInstance() && onBeforeUnmount(() => {
|
|
1204
1214
|
r();
|
|
1205
1215
|
});
|
|
1206
1216
|
}
|
|
1207
|
-
return { setWatermark:
|
|
1217
|
+
return { setWatermark: c, clear: r };
|
|
1208
1218
|
}
|
|
1209
1219
|
const DEFAULT_EXCLUDE_KEYS = ["class", "style"], LISTENER_PREFIX = /^on[A-Z]/;
|
|
1210
|
-
function entries(
|
|
1211
|
-
return Object.keys(
|
|
1220
|
+
function entries(l) {
|
|
1221
|
+
return Object.keys(l).map((a) => [a, l[a]]);
|
|
1212
1222
|
}
|
|
1213
|
-
function useAttrs(
|
|
1214
|
-
const
|
|
1215
|
-
if (!
|
|
1216
|
-
const { excludeListeners: o = !1, excludeKeys: h = [] } =
|
|
1217
|
-
return
|
|
1218
|
-
const i = entries(
|
|
1223
|
+
function useAttrs(l = {}) {
|
|
1224
|
+
const a = getCurrentInstance();
|
|
1225
|
+
if (!a) return {};
|
|
1226
|
+
const { excludeListeners: o = !1, excludeKeys: h = [] } = l, r = shallowRef({}), e = h.concat(DEFAULT_EXCLUDE_KEYS);
|
|
1227
|
+
return a.attrs = reactive(a.attrs), watchEffect(() => {
|
|
1228
|
+
const i = entries(a.attrs).reduce((Z, [c, t]) => (!e.includes(c) && !(o && LISTENER_PREFIX.test(c)) && (Z[c] = t), Z), {});
|
|
1219
1229
|
r.value = i;
|
|
1220
1230
|
}), r;
|
|
1221
1231
|
}
|
|
1222
1232
|
const i18n = window.$i18n, useRender = () => {
|
|
1223
|
-
const
|
|
1224
|
-
var
|
|
1233
|
+
const l = { value: "dictCode", label: "dictName" }, a = (v, u) => {
|
|
1234
|
+
var F;
|
|
1225
1235
|
const H = w(u);
|
|
1226
|
-
let
|
|
1236
|
+
let s = {
|
|
1227
1237
|
clearable: !0,
|
|
1228
1238
|
disabled: !1,
|
|
1229
1239
|
showValue: !1,
|
|
1230
1240
|
placeholder: null
|
|
1231
|
-
},
|
|
1232
|
-
isObject(
|
|
1233
|
-
const I = (
|
|
1241
|
+
}, A, S;
|
|
1242
|
+
isObject(v) ? (s = Object.assign(s, v), A = v.defaultValue, S = v == null ? void 0 : v.code) : S = v;
|
|
1243
|
+
const I = (F = storageLocal.getItem("kLov")[S]) == null ? void 0 : F.children, N = I ? I.filter((E) => E.enabled === "1") : [];
|
|
1234
1244
|
return {
|
|
1235
1245
|
name: "#select",
|
|
1236
|
-
optionProps:
|
|
1237
|
-
options:
|
|
1238
|
-
props:
|
|
1239
|
-
defaultValue:
|
|
1246
|
+
optionProps: l,
|
|
1247
|
+
options: N,
|
|
1248
|
+
props: s,
|
|
1249
|
+
defaultValue: A,
|
|
1240
1250
|
events: H
|
|
1241
1251
|
};
|
|
1242
|
-
}, o = (
|
|
1252
|
+
}, o = (v, u) => {
|
|
1243
1253
|
const H = w(u);
|
|
1244
1254
|
return {
|
|
1245
1255
|
name: "#SuSelect",
|
|
1246
|
-
optionProps: (
|
|
1247
|
-
props:
|
|
1248
|
-
options: (
|
|
1256
|
+
optionProps: (v == null ? void 0 : v.optionProps) || { label: "label", value: "value" },
|
|
1257
|
+
props: v == null ? void 0 : v.props,
|
|
1258
|
+
options: (v == null ? void 0 : v.options) || [],
|
|
1249
1259
|
events: H
|
|
1250
1260
|
};
|
|
1251
|
-
}, h = (
|
|
1261
|
+
}, h = (v, u) => {
|
|
1252
1262
|
const H = {
|
|
1253
1263
|
optionProps: { extLabel: "userName", value: "employeeName" },
|
|
1254
1264
|
props: {
|
|
1255
|
-
attrs: { disabled:
|
|
1256
|
-
disabled:
|
|
1257
|
-
defaultValue:
|
|
1258
|
-
mapField:
|
|
1265
|
+
attrs: { disabled: v == null ? void 0 : v.disabled },
|
|
1266
|
+
disabled: v == null ? void 0 : v.disabled,
|
|
1267
|
+
defaultValue: v == null ? void 0 : v.defaultValue,
|
|
1268
|
+
mapField: v == null ? void 0 : v.mapField,
|
|
1259
1269
|
url: "/uums/employee/listEmployeeIsUser",
|
|
1260
1270
|
fetchField: "employeeName"
|
|
1261
1271
|
}
|
|
1262
1272
|
};
|
|
1263
1273
|
return o(H, u);
|
|
1264
|
-
}, r = (
|
|
1274
|
+
}, r = (v) => {
|
|
1265
1275
|
const u = {
|
|
1266
1276
|
optionProps: { label: "userName", value: "userName" },
|
|
1267
1277
|
props: {
|
|
1268
1278
|
code: "sys/listUsers",
|
|
1269
1279
|
url: "/uums/user",
|
|
1270
1280
|
fetchField: "name",
|
|
1271
|
-
mapField:
|
|
1281
|
+
mapField: v == null ? void 0 : v.mapField
|
|
1272
1282
|
}
|
|
1273
1283
|
};
|
|
1274
1284
|
return o(u);
|
|
1275
|
-
}, e = (
|
|
1285
|
+
}, e = (v, u) => {
|
|
1276
1286
|
const H = {
|
|
1277
1287
|
label: "organizationName",
|
|
1278
|
-
value: (
|
|
1279
|
-
},
|
|
1288
|
+
value: (v == null ? void 0 : v.field) || "organizationName"
|
|
1289
|
+
}, s = {
|
|
1280
1290
|
mapField: {},
|
|
1281
|
-
defaultParams:
|
|
1282
|
-
disabled:
|
|
1291
|
+
defaultParams: v == null ? void 0 : v.defaultParams,
|
|
1292
|
+
disabled: v == null ? void 0 : v.disabled,
|
|
1283
1293
|
url: "/uums/cusOrganization",
|
|
1284
1294
|
fetchField: "organizationName"
|
|
1285
|
-
},
|
|
1295
|
+
}, A = {
|
|
1286
1296
|
organizationId: "id",
|
|
1287
1297
|
organizationCode: "organizationCode"
|
|
1288
1298
|
};
|
|
1289
|
-
return Object.assign(
|
|
1299
|
+
return Object.assign(s.mapField, A, (v == null ? void 0 : v.mapField) || {}), {
|
|
1290
1300
|
name: "#SuSelect",
|
|
1291
|
-
props:
|
|
1301
|
+
props: s,
|
|
1292
1302
|
optionProps: H,
|
|
1293
1303
|
options: [],
|
|
1294
1304
|
events: w(u)
|
|
1295
1305
|
};
|
|
1296
|
-
}, i = (
|
|
1306
|
+
}, i = (v, u) => {
|
|
1297
1307
|
const H = {
|
|
1298
1308
|
label: "orgName",
|
|
1299
|
-
value: (
|
|
1300
|
-
},
|
|
1309
|
+
value: (v == null ? void 0 : v.field) || "orgName"
|
|
1310
|
+
}, s = {
|
|
1301
1311
|
mapField: {},
|
|
1302
|
-
disabled:
|
|
1303
|
-
defaultParams:
|
|
1312
|
+
disabled: v == null ? void 0 : v.disabled,
|
|
1313
|
+
defaultParams: v == null ? void 0 : v.defaultParams,
|
|
1304
1314
|
url: "/uums/org",
|
|
1305
1315
|
fetchField: "orgName"
|
|
1306
|
-
},
|
|
1307
|
-
return Object.assign(
|
|
1316
|
+
}, A = { orgId: "id", orgCode: "orgCode" };
|
|
1317
|
+
return Object.assign(s.mapField, A, (v == null ? void 0 : v.mapField) || {}), {
|
|
1308
1318
|
name: "#SuSelect",
|
|
1309
|
-
props:
|
|
1319
|
+
props: s,
|
|
1310
1320
|
optionProps: H,
|
|
1311
1321
|
options: [],
|
|
1312
1322
|
events: w(u)
|
|
1313
1323
|
};
|
|
1314
|
-
},
|
|
1315
|
-
const H = Object.assign({ disabled: !1 },
|
|
1324
|
+
}, Z = (v, u) => {
|
|
1325
|
+
const H = Object.assign({ disabled: !1 }, v), s = H == null ? void 0 : H.defaultValue;
|
|
1316
1326
|
return {
|
|
1317
1327
|
name: "VxeInput",
|
|
1318
1328
|
props: H,
|
|
1319
|
-
defaultValue:
|
|
1329
|
+
defaultValue: s,
|
|
1320
1330
|
events: w(u)
|
|
1321
1331
|
};
|
|
1322
|
-
},
|
|
1323
|
-
const H = Object.assign({ disabled: !1, rows: 3 },
|
|
1332
|
+
}, c = (v, u) => {
|
|
1333
|
+
const H = Object.assign({ disabled: !1, rows: 3 }, v), s = H == null ? void 0 : H.defaultValue;
|
|
1324
1334
|
return {
|
|
1325
1335
|
name: "VxeTextarea",
|
|
1326
1336
|
props: H,
|
|
1327
|
-
defaultValue:
|
|
1337
|
+
defaultValue: s,
|
|
1328
1338
|
events: w(u)
|
|
1329
1339
|
};
|
|
1330
|
-
},
|
|
1331
|
-
const H = "VxeCheckboxGroup", { defaultValue:
|
|
1332
|
-
return { name: H, defaultValue:
|
|
1333
|
-
}, d = (
|
|
1334
|
-
const H = "VxeRadioGroup", { defaultValue:
|
|
1335
|
-
return { name: H, defaultValue:
|
|
1336
|
-
},
|
|
1340
|
+
}, t = (v, u) => {
|
|
1341
|
+
const H = "VxeCheckboxGroup", { defaultValue: s, options: A, props: S } = f(v);
|
|
1342
|
+
return { name: H, defaultValue: s, options: A, props: S, events: w(u) };
|
|
1343
|
+
}, d = (v, u) => {
|
|
1344
|
+
const H = "VxeRadioGroup", { defaultValue: s, options: A, props: S } = f(v);
|
|
1345
|
+
return { name: H, defaultValue: s, options: A, props: S, events: w(u) };
|
|
1346
|
+
}, f = (v) => {
|
|
1337
1347
|
var I;
|
|
1338
1348
|
let u = { disabled: !1 }, H;
|
|
1339
|
-
const
|
|
1340
|
-
let
|
|
1341
|
-
isObject(
|
|
1342
|
-
const S =
|
|
1349
|
+
const s = storageLocal.getItem("kLov");
|
|
1350
|
+
let A = "";
|
|
1351
|
+
isObject(v) ? (H = v.defaultValue, A = v.code, v.options ? u = Object.assign(u, v.props || {}) : u = Object.assign(u, v || {})) : isString(v) && (A = v);
|
|
1352
|
+
const S = A ? (I = s[A]) == null ? void 0 : I.children.map((N) => ({ label: N.dictName, value: N.dictCode })) : [];
|
|
1343
1353
|
return {
|
|
1344
1354
|
props: u,
|
|
1345
1355
|
defaultValue: H,
|
|
1346
|
-
options: isObject(
|
|
1356
|
+
options: isObject(v) && v.options ? v.options : S
|
|
1347
1357
|
};
|
|
1348
|
-
},
|
|
1358
|
+
}, n = (v, u) => {
|
|
1349
1359
|
const H = w(u);
|
|
1350
1360
|
return {
|
|
1351
1361
|
name: "VxeNumberInput",
|
|
1352
1362
|
props: Object.assign(
|
|
1353
|
-
{ type: "number", clearable: !0, min: 0, controls: !1 },
|
|
1354
|
-
|
|
1363
|
+
{ type: "number", clearable: !0, min: void 0, controls: !1 },
|
|
1364
|
+
v || {}
|
|
1355
1365
|
),
|
|
1356
|
-
defaultValue:
|
|
1366
|
+
defaultValue: v == null ? void 0 : v.defaultValue,
|
|
1357
1367
|
events: H
|
|
1358
1368
|
};
|
|
1359
|
-
},
|
|
1360
|
-
const H = w(u),
|
|
1361
|
-
return { name: "VxeDatePicker", props: Object.assign({ type: "date", valueFormat:
|
|
1362
|
-
},
|
|
1363
|
-
const H = w(u),
|
|
1369
|
+
}, m = (v, u) => {
|
|
1370
|
+
const H = w(u), s = "yyyy-MM-dd HH:mm:ss", A = v == null ? void 0 : v.defaultValue;
|
|
1371
|
+
return { name: "VxeDatePicker", props: Object.assign({ type: "date", valueFormat: s, clearable: !0 }, v || {}), defaultValue: A, events: H };
|
|
1372
|
+
}, b = (v, u) => {
|
|
1373
|
+
const H = w(u), s = "yyyy-MM-dd HH:mm:ss", A = v == null ? void 0 : v.startValue, S = v == null ? void 0 : v.endValue, I = v == null ? void 0 : v.startField, N = v == null ? void 0 : v.endField, F = {
|
|
1364
1374
|
type: "date",
|
|
1365
|
-
valueFormat:
|
|
1375
|
+
valueFormat: s,
|
|
1366
1376
|
clearable: !0,
|
|
1367
1377
|
shortcutConfig: {
|
|
1368
1378
|
enabled: !0,
|
|
@@ -1397,45 +1407,45 @@ const i18n = window.$i18n, useRender = () => {
|
|
|
1397
1407
|
}
|
|
1398
1408
|
]
|
|
1399
1409
|
}
|
|
1400
|
-
}, E = Object.assign(
|
|
1410
|
+
}, E = Object.assign(F, v || {});
|
|
1401
1411
|
return {
|
|
1402
1412
|
name: "VxeDateRangePicker",
|
|
1403
1413
|
startField: I,
|
|
1404
|
-
endField:
|
|
1405
|
-
startValue:
|
|
1414
|
+
endField: N,
|
|
1415
|
+
startValue: A,
|
|
1406
1416
|
endValue: S,
|
|
1407
1417
|
props: E,
|
|
1408
1418
|
events: H
|
|
1409
1419
|
};
|
|
1410
|
-
},
|
|
1420
|
+
}, M = (v, u) => {
|
|
1411
1421
|
const H = w(u);
|
|
1412
|
-
return { name: "#lov", props: Object.assign({},
|
|
1413
|
-
},
|
|
1414
|
-
const H = w(u),
|
|
1422
|
+
return { name: "#lov", props: Object.assign({}, v || {}), events: H };
|
|
1423
|
+
}, V = (v, u) => {
|
|
1424
|
+
const H = w(u), s = (v == null ? void 0 : v.optionProps) || {
|
|
1415
1425
|
label: "label",
|
|
1416
1426
|
value: "value"
|
|
1417
|
-
},
|
|
1427
|
+
}, A = Object.assign(
|
|
1418
1428
|
{ clearable: !0, disabled: !1, showValue: !1 },
|
|
1419
|
-
|
|
1429
|
+
v || {}
|
|
1420
1430
|
);
|
|
1421
1431
|
return console.log("itemRender"), {
|
|
1422
1432
|
name: "#select",
|
|
1423
|
-
optionProps:
|
|
1424
|
-
options: (
|
|
1425
|
-
props:
|
|
1433
|
+
optionProps: s,
|
|
1434
|
+
options: (v == null ? void 0 : v.options) || [],
|
|
1435
|
+
props: A,
|
|
1426
1436
|
events: H
|
|
1427
1437
|
};
|
|
1428
|
-
}, p = (
|
|
1438
|
+
}, p = (v, u) => {
|
|
1429
1439
|
let H = {
|
|
1430
1440
|
openLabel: "是",
|
|
1431
1441
|
closeLabel: "否",
|
|
1432
1442
|
openValue: "Y",
|
|
1433
1443
|
closeValue: "N"
|
|
1434
|
-
},
|
|
1435
|
-
isObject(
|
|
1436
|
-
const
|
|
1437
|
-
return { name: "VxeSwitch", props: H, defaultValue:
|
|
1438
|
-
},
|
|
1444
|
+
}, s = "Y";
|
|
1445
|
+
isObject(v) && !isFunction(v) ? (H = Object.assign(H, v || {}), s = v.defaultValue || s) : !isEmpty(v) && isString(v) && (s = v, H = Object.assign(H, { defaultValue: s }));
|
|
1446
|
+
const A = isFunction(v) ? w(v) : w(u);
|
|
1447
|
+
return { name: "VxeSwitch", props: H, defaultValue: s, events: A };
|
|
1448
|
+
}, L = (v, u) => ({ name: "#tag", props: { code: v, tagMap: u } }), k = (v, u) => {
|
|
1439
1449
|
const H = {
|
|
1440
1450
|
openLabel: "启用",
|
|
1441
1451
|
closeLabel: "禁用",
|
|
@@ -1443,144 +1453,144 @@ const i18n = window.$i18n, useRender = () => {
|
|
|
1443
1453
|
closeValue: "0",
|
|
1444
1454
|
defaultValue: "1"
|
|
1445
1455
|
};
|
|
1446
|
-
!isFunction(
|
|
1447
|
-
const
|
|
1448
|
-
return p(H,
|
|
1449
|
-
},
|
|
1456
|
+
!isFunction(v) && isObject(v) && Object.assign(H, v);
|
|
1457
|
+
const s = isFunction(v) ? v : u;
|
|
1458
|
+
return p(H, s);
|
|
1459
|
+
}, y = () => ({ name: "#iconSelect" }), C = (v = [], u = {}, H) => ({ name: "#treeSelect", sourceData: v, props: u, events: H }), T = (v, u) => {
|
|
1450
1460
|
const H = w(u);
|
|
1451
1461
|
return {
|
|
1452
1462
|
name: "#area",
|
|
1453
|
-
props: { mapField: (
|
|
1463
|
+
props: { mapField: (v == null ? void 0 : v.mapField) || ["province", "city", "region"] },
|
|
1454
1464
|
events: H
|
|
1455
1465
|
};
|
|
1456
|
-
}, w = (
|
|
1466
|
+
}, w = (v) => {
|
|
1457
1467
|
let u = {};
|
|
1458
|
-
return isObject(
|
|
1459
|
-
change: (
|
|
1460
|
-
blur: (
|
|
1461
|
-
focus: (
|
|
1462
|
-
input: (
|
|
1463
|
-
clear: (
|
|
1464
|
-
searchClick:
|
|
1465
|
-
suffixClick:
|
|
1466
|
-
prefixClick:
|
|
1467
|
-
filterMethod:
|
|
1468
|
-
} :
|
|
1469
|
-
}, R = (
|
|
1470
|
-
|
|
1471
|
-
const { singleMode: H, mode:
|
|
1472
|
-
return H && Object.assign(
|
|
1468
|
+
return isObject(v) && !isFunction(v) ? u = {
|
|
1469
|
+
change: (v == null ? void 0 : v.change) || D,
|
|
1470
|
+
blur: (v == null ? void 0 : v.blur) || D,
|
|
1471
|
+
focus: (v == null ? void 0 : v.focus) || D,
|
|
1472
|
+
input: (v == null ? void 0 : v.input) || D,
|
|
1473
|
+
clear: (v == null ? void 0 : v.clear) || D,
|
|
1474
|
+
searchClick: v == null ? void 0 : v.searchClick,
|
|
1475
|
+
suffixClick: v == null ? void 0 : v.suffixClick,
|
|
1476
|
+
prefixClick: v == null ? void 0 : v.prefixClick,
|
|
1477
|
+
filterMethod: v == null ? void 0 : v.filterMethod
|
|
1478
|
+
} : v && (u = { change: v }), u;
|
|
1479
|
+
}, R = (v, u) => {
|
|
1480
|
+
v = v || { fieldType: "string", mode: "image" };
|
|
1481
|
+
const { singleMode: H, mode: s } = v;
|
|
1482
|
+
return H && Object.assign(v, {
|
|
1473
1483
|
multiple: !1,
|
|
1474
1484
|
limitCount: 1,
|
|
1475
1485
|
autoHiddenButton: !0
|
|
1476
|
-
}),
|
|
1486
|
+
}), s === "image" && (v.imageTypes = ["jpg", "jpeg", "png", "gif", "apk"]), { name: "#upload", props: v, events: u };
|
|
1477
1487
|
};
|
|
1478
|
-
function
|
|
1488
|
+
function D() {
|
|
1479
1489
|
}
|
|
1480
1490
|
return {
|
|
1481
|
-
renderDict:
|
|
1491
|
+
renderDict: a,
|
|
1482
1492
|
renderSelect: o,
|
|
1483
|
-
renderInput:
|
|
1484
|
-
renderTextarea:
|
|
1485
|
-
renderCheckBox:
|
|
1493
|
+
renderInput: Z,
|
|
1494
|
+
renderTextarea: c,
|
|
1495
|
+
renderCheckBox: t,
|
|
1486
1496
|
renderRadio: d,
|
|
1487
1497
|
renderUser: h,
|
|
1488
1498
|
renderSysUser: r,
|
|
1489
1499
|
renderInvOrg: e,
|
|
1490
1500
|
renderBU: i,
|
|
1491
|
-
renderNumber:
|
|
1492
|
-
renderLov:
|
|
1493
|
-
renderSelectLocal:
|
|
1494
|
-
renderDate:
|
|
1495
|
-
renderRangeDate:
|
|
1501
|
+
renderNumber: n,
|
|
1502
|
+
renderLov: M,
|
|
1503
|
+
renderSelectLocal: V,
|
|
1504
|
+
renderDate: m,
|
|
1505
|
+
renderRangeDate: b,
|
|
1496
1506
|
renderSwitch: p,
|
|
1497
|
-
renderCellTag:
|
|
1498
|
-
renderEnabled:
|
|
1499
|
-
renderIconSelect:
|
|
1500
|
-
renderTreeSelect:
|
|
1507
|
+
renderCellTag: L,
|
|
1508
|
+
renderEnabled: k,
|
|
1509
|
+
renderIconSelect: y,
|
|
1510
|
+
renderTreeSelect: C,
|
|
1501
1511
|
renderArea: T,
|
|
1502
1512
|
renderUpload: R
|
|
1503
1513
|
};
|
|
1504
1514
|
}, useGlobal = () => {
|
|
1505
|
-
const
|
|
1506
|
-
if (!
|
|
1507
|
-
const
|
|
1515
|
+
const l = getCurrentInstance();
|
|
1516
|
+
if (!l) return { $global: {}, $storage: {}, $config: {} };
|
|
1517
|
+
const a = l.appContext.app.config.globalProperties, o = a.$storage, h = a.$config, r = a.$serviceApi, e = a.$hasAuthority, i = a.$printPlugin, Z = a.$mode;
|
|
1508
1518
|
return {
|
|
1509
|
-
$global:
|
|
1519
|
+
$global: a,
|
|
1510
1520
|
$storage: o,
|
|
1511
1521
|
$config: h,
|
|
1512
1522
|
$serviceApi: r,
|
|
1513
1523
|
$hasAuthority: e,
|
|
1514
1524
|
$printPlugin: i,
|
|
1515
|
-
$mode:
|
|
1525
|
+
$mode: Z
|
|
1516
1526
|
};
|
|
1517
1527
|
}, hexList = [];
|
|
1518
|
-
for (let
|
|
1519
|
-
hexList[
|
|
1528
|
+
for (let l = 0; l <= 15; l++)
|
|
1529
|
+
hexList[l] = l.toString(16);
|
|
1520
1530
|
function buildUUID() {
|
|
1521
|
-
let
|
|
1522
|
-
for (let
|
|
1523
|
-
|
|
1524
|
-
return
|
|
1531
|
+
let l = "";
|
|
1532
|
+
for (let a = 1; a <= 36; a++)
|
|
1533
|
+
a === 9 || a === 14 || a === 19 || a === 24 ? l += "-" : a === 15 ? l += 4 : a === 20 ? l += hexList[Math.random() * 4 | 8] : l += hexList[Math.random() * 16 | 0];
|
|
1534
|
+
return l.replace(/-/g, "");
|
|
1525
1535
|
}
|
|
1526
1536
|
let unique = 0;
|
|
1527
|
-
function buildShortUUID(
|
|
1528
|
-
const
|
|
1529
|
-
return unique++,
|
|
1537
|
+
function buildShortUUID(l = "") {
|
|
1538
|
+
const a = Date.now(), o = Math.floor(Math.random() * 1e9);
|
|
1539
|
+
return unique++, l + "_" + o + unique + String(a);
|
|
1530
1540
|
}
|
|
1531
1541
|
const deviceDetection = () => {
|
|
1532
|
-
const
|
|
1533
|
-
return
|
|
1542
|
+
const l = navigator.userAgent.toLowerCase(), a = l.match(/iphone os/i) === "iphone os", o = l.match(/midp/i) === "midp", h = l.match(/rv:1.2.3.4/i) === "rv:1.2.3.4", r = l.match(/ucweb/i) === "ucweb", e = l.match(/android/i) === "android", i = l.match(/windows ce/i) === "windows ce", Z = l.match(/windows mobile/i) === "windows mobile";
|
|
1543
|
+
return a || o || h || r || e || i || Z;
|
|
1534
1544
|
}, getBrowserInfo = () => {
|
|
1535
|
-
const
|
|
1545
|
+
const l = navigator.userAgent.toLowerCase(), a = /(msie|firefox|chrome|opera|version).*?([\d.]+)/, o = l.match(a);
|
|
1536
1546
|
return {
|
|
1537
1547
|
browser: o[1].replace(/version/, "'safari"),
|
|
1538
1548
|
version: o[2]
|
|
1539
1549
|
};
|
|
1540
|
-
}, showMessage = (
|
|
1550
|
+
}, showMessage = (l, a = "message", o = {}) => {
|
|
1541
1551
|
var h, r;
|
|
1542
|
-
return
|
|
1543
|
-
}, successMessage = (
|
|
1552
|
+
return a === "alert" ? (h = VxeUI.modal) == null ? void 0 : h.alert({ content: l, ...o }) : (r = VxeUI.modal) == null ? void 0 : r.message({ content: l, ...o });
|
|
1553
|
+
}, successMessage = (l = "操作成功", a = {}) => {
|
|
1544
1554
|
var o;
|
|
1545
|
-
return (o = VxeUI.modal) == null ? void 0 : o.message({ content:
|
|
1546
|
-
}, warnMessage = (
|
|
1555
|
+
return (o = VxeUI.modal) == null ? void 0 : o.message({ content: l, ...a, status: "success" });
|
|
1556
|
+
}, warnMessage = (l, a = {}) => {
|
|
1547
1557
|
var o, h;
|
|
1548
|
-
return
|
|
1549
|
-
content:
|
|
1558
|
+
return a.type === "alert" ? (o = VxeUI.modal) == null ? void 0 : o.alert({ content: l, ...a, status: "warning" }) : (h = VxeUI.modal) == null ? void 0 : h.message({
|
|
1559
|
+
content: l,
|
|
1550
1560
|
duration: 5e3,
|
|
1551
|
-
...
|
|
1561
|
+
...a,
|
|
1552
1562
|
status: "warning"
|
|
1553
1563
|
});
|
|
1554
|
-
}, errorMessage = (
|
|
1564
|
+
}, errorMessage = (l = "操作失败", a = {}) => {
|
|
1555
1565
|
var o, h;
|
|
1556
|
-
return
|
|
1557
|
-
}, renderHook = useRender(), i18nColums = (
|
|
1566
|
+
return a.type === "alert" ? (o = VxeUI.modal) == null ? void 0 : o.alert({ content: l, ...a, status: "error" }) : (h = VxeUI.modal) == null ? void 0 : h.message({ content: l, ...a, status: "error" });
|
|
1567
|
+
}, renderHook = useRender(), i18nColums = (l, a = !0) => {
|
|
1558
1568
|
let o = 0, h = 0;
|
|
1559
|
-
const r =
|
|
1560
|
-
return
|
|
1569
|
+
const r = l.length - 1;
|
|
1570
|
+
return l.map((e, i) => {
|
|
1561
1571
|
if (h = h + e.width, e.type) return e;
|
|
1562
1572
|
e.title = e.title || `message.${e.field}`;
|
|
1563
|
-
const { showOverflow:
|
|
1564
|
-
return e.field !== "operate" && ((e.width > 99 || e.minWidth) && (e.showOverflow =
|
|
1573
|
+
const { showOverflow: Z } = e;
|
|
1574
|
+
return e.field !== "operate" && ((e.width > 99 || e.minWidth) && (e.showOverflow = Z === !1 ? Z : "tooltip"), e.sortable = !(a === !1 || e.sortable === !1)), o || (o = e.minWidth), !o && r === i && h < window.innerWidth && (e.minWidth = e.width, e.width = null), e;
|
|
1565
1575
|
});
|
|
1566
|
-
}, formatItems = (
|
|
1576
|
+
}, formatItems = (l, a, o = 24) => l.length ? l.map((h) => {
|
|
1567
1577
|
var r, e, i;
|
|
1568
1578
|
if ((r = h.children) != null && r.length)
|
|
1569
|
-
return h.children = formatItems(h.children,
|
|
1579
|
+
return h.children = formatItems(h.children, a, o), h;
|
|
1570
1580
|
{
|
|
1571
1581
|
h.title = h.title || `message.${h.field}`, h.span = h.span || o, h.type === "collapseNode" && (h.title = "", h.titleWidth = 0);
|
|
1572
|
-
let
|
|
1573
|
-
|
|
1574
|
-
let
|
|
1582
|
+
let Z = !1, c = window.$i18n ? window.$i18n("message.udp.placeholder") + window.$i18n(h.title) : "";
|
|
1583
|
+
a === "detail" ? (Z = !0, c = null) : Z = h.disabled === !1 ? h.disabled : h.disabled || ((i = (e = h.itemRender) == null ? void 0 : e.props) == null ? void 0 : i.disabled);
|
|
1584
|
+
let t = {
|
|
1575
1585
|
name: "VxeInput",
|
|
1576
|
-
props: { disabled:
|
|
1586
|
+
props: { disabled: Z, placeholder: Z ? "" : c }
|
|
1577
1587
|
};
|
|
1578
|
-
return h.code && !h.itemRender && (
|
|
1579
|
-
disabled:
|
|
1580
|
-
placeholder:
|
|
1588
|
+
return h.code && !h.itemRender && (t = renderHook.renderDict(h.code)), h.itemRender = h.itemRender || t, h.itemRender.props = Object.assign(h.itemRender.props || {}, {
|
|
1589
|
+
disabled: Z,
|
|
1590
|
+
placeholder: Z ? "" : c
|
|
1581
1591
|
}), h;
|
|
1582
1592
|
}
|
|
1583
|
-
}) :
|
|
1593
|
+
}) : l, formSearchButtons = {
|
|
1584
1594
|
span: 6,
|
|
1585
1595
|
align: "right",
|
|
1586
1596
|
collapseNode: !1,
|
|
@@ -1604,100 +1614,100 @@ const deviceDetection = () => {
|
|
|
1604
1614
|
],
|
|
1605
1615
|
events: null
|
|
1606
1616
|
}
|
|
1607
|
-
}, formatGridItems = (
|
|
1608
|
-
const o =
|
|
1617
|
+
}, formatGridItems = (l, a) => {
|
|
1618
|
+
const o = l.filter((t) => t.visible !== !1), h = o.length, r = h > 2 && o.some((t, d) => d < 3 && (t.span > 6 || getDateRange(t))), e = r || h > 3, i = {
|
|
1609
1619
|
collapseTags: !0,
|
|
1610
1620
|
collapseTagsTooltip: !0,
|
|
1611
1621
|
multiple: !0
|
|
1612
|
-
},
|
|
1613
|
-
var
|
|
1614
|
-
return
|
|
1622
|
+
}, Z = o.map((t, d) => {
|
|
1623
|
+
var f, n, m;
|
|
1624
|
+
return t.folding = r ? e && d > 1 : e && d > 2, t.span = getDateRange(t) ? 12 : t.span || 6, t.code && !t.itemRender && (t.itemRender = renderHook.renderDict(t.code)), t.itemRender = t.itemRender || { name: "VxeInput" }, t.resetValue = t.itemRender.defaultValue, t.title = t.title || `message.${t.field}`, (t.multiple || (n = (f = t.itemRender) == null ? void 0 : f.props) != null && n.multiple) && (t.itemRender.props = Object.assign(
|
|
1615
1625
|
i,
|
|
1616
|
-
((
|
|
1617
|
-
)),
|
|
1618
|
-
}),
|
|
1619
|
-
if (
|
|
1620
|
-
const
|
|
1621
|
-
|
|
1626
|
+
((m = t.itemRender) == null ? void 0 : m.props) || {}
|
|
1627
|
+
)), t;
|
|
1628
|
+
}), c = clone(formSearchButtons, !0);
|
|
1629
|
+
if (c.collapseNode = e, a && c.itemRender.options.length < 3 && (c.itemRender.options.push(a), c.itemRender.events = a.events), e) {
|
|
1630
|
+
const t = r ? 2 : 3;
|
|
1631
|
+
Z.splice(t, 0, c);
|
|
1622
1632
|
} else
|
|
1623
|
-
|
|
1624
|
-
return
|
|
1625
|
-
}, getDateRange = (
|
|
1626
|
-
var
|
|
1627
|
-
return ((
|
|
1628
|
-
}, formatRules = (
|
|
1633
|
+
Z.push(c);
|
|
1634
|
+
return Z;
|
|
1635
|
+
}, getDateRange = (l) => {
|
|
1636
|
+
var a, o, h, r, e;
|
|
1637
|
+
return ((a = l.itemRender) == null ? void 0 : a.name) === "#SuDateRange" ? ((h = (o = l.itemRender) == null ? void 0 : o.props) == null ? void 0 : h.type) === "daterange" || !((e = (r = l.itemRender) == null ? void 0 : r.props) != null && e.type) : !1;
|
|
1638
|
+
}, formatRules = (l, a) => {
|
|
1629
1639
|
const o = {};
|
|
1630
|
-
return
|
|
1640
|
+
return l.forEach((h) => {
|
|
1631
1641
|
var r;
|
|
1632
1642
|
if ((r = h.children) != null && r.length) {
|
|
1633
|
-
const e = formatRules(h.children,
|
|
1643
|
+
const e = formatRules(h.children, a);
|
|
1634
1644
|
merge(o, e);
|
|
1635
1645
|
} else if (h.required) {
|
|
1636
|
-
const { field: e, title: i } = h,
|
|
1646
|
+
const { field: e, title: i } = h, Z = i == null ? void 0 : i.startsWith("message.");
|
|
1637
1647
|
o[e] = h.rules || [
|
|
1638
1648
|
{
|
|
1639
1649
|
required: !0,
|
|
1640
|
-
message: `${
|
|
1650
|
+
message: `${a("message.required")}${i && Z ? a(i) : i || a(`message.${e}`)}`
|
|
1641
1651
|
}
|
|
1642
1652
|
];
|
|
1643
1653
|
}
|
|
1644
1654
|
}), o;
|
|
1645
1655
|
}, expandedPaths = [];
|
|
1646
|
-
function extractPathList(
|
|
1647
|
-
if (!Array.isArray(
|
|
1656
|
+
function extractPathList(l) {
|
|
1657
|
+
if (!Array.isArray(l)) {
|
|
1648
1658
|
console.warn("menuTree must be an array");
|
|
1649
1659
|
return;
|
|
1650
1660
|
}
|
|
1651
|
-
if (!(!
|
|
1652
|
-
for (const
|
|
1653
|
-
|
|
1661
|
+
if (!(!l || l.length === 0)) {
|
|
1662
|
+
for (const a of l)
|
|
1663
|
+
a.children && a.children.length > 0 && extractPathList(a.children), expandedPaths.push(a.uniqueId);
|
|
1654
1664
|
return expandedPaths;
|
|
1655
1665
|
}
|
|
1656
1666
|
}
|
|
1657
|
-
function deleteTreeChildren(
|
|
1658
|
-
if (!Array.isArray(
|
|
1667
|
+
function deleteTreeChildren(l, a = []) {
|
|
1668
|
+
if (!Array.isArray(l)) {
|
|
1659
1669
|
console.warn("menuTree must be an array");
|
|
1660
1670
|
return;
|
|
1661
1671
|
}
|
|
1662
|
-
if (!(!
|
|
1663
|
-
for (const [o, h] of
|
|
1664
|
-
h.children && h.children.length === 1 && delete h.children, h.id = o, h.parentId =
|
|
1665
|
-
return
|
|
1672
|
+
if (!(!l || l.length === 0)) {
|
|
1673
|
+
for (const [o, h] of l.entries())
|
|
1674
|
+
h.children && h.children.length === 1 && delete h.children, h.id = o, h.parentId = a.length ? a[a.length - 1] : null, h.pathList = [...a, 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);
|
|
1675
|
+
return l;
|
|
1666
1676
|
}
|
|
1667
1677
|
}
|
|
1668
|
-
function buildHierarchyTree(
|
|
1669
|
-
if (!Array.isArray(
|
|
1678
|
+
function buildHierarchyTree(l, a = []) {
|
|
1679
|
+
if (!Array.isArray(l)) {
|
|
1670
1680
|
console.warn("menuTree must be an array");
|
|
1671
1681
|
return;
|
|
1672
1682
|
}
|
|
1673
|
-
if (!(!
|
|
1674
|
-
for (const [o, h] of
|
|
1675
|
-
h.id = o, h.parentId =
|
|
1676
|
-
return
|
|
1683
|
+
if (!(!l || l.length === 0)) {
|
|
1684
|
+
for (const [o, h] of l.entries())
|
|
1685
|
+
h.id = o, h.parentId = a.length ? a[a.length - 1] : null, h.pathList = [...a, h.id], h.children && h.children.length > 0 && buildHierarchyTree(h.children, h.pathList);
|
|
1686
|
+
return l;
|
|
1677
1687
|
}
|
|
1678
1688
|
}
|
|
1679
|
-
function getNodeByUniqueId(
|
|
1680
|
-
if (!Array.isArray(
|
|
1689
|
+
function getNodeByUniqueId(l, a) {
|
|
1690
|
+
if (!Array.isArray(l)) {
|
|
1681
1691
|
console.warn("menuTree must be an array");
|
|
1682
1692
|
return;
|
|
1683
1693
|
}
|
|
1684
|
-
if (!
|
|
1685
|
-
const o =
|
|
1694
|
+
if (!l || l.length === 0) return;
|
|
1695
|
+
const o = l.find((r) => r.uniqueId === a);
|
|
1686
1696
|
if (o) return o;
|
|
1687
|
-
const h =
|
|
1688
|
-
return getNodeByUniqueId(h,
|
|
1697
|
+
const h = l.filter((r) => r.children).map((r) => r.children).flat(1);
|
|
1698
|
+
return getNodeByUniqueId(h, a);
|
|
1689
1699
|
}
|
|
1690
|
-
function appendFieldByUniqueId(
|
|
1691
|
-
if (!Array.isArray(
|
|
1700
|
+
function appendFieldByUniqueId(l, a, o) {
|
|
1701
|
+
if (!Array.isArray(l)) {
|
|
1692
1702
|
console.warn("menuTree must be an array");
|
|
1693
1703
|
return;
|
|
1694
1704
|
}
|
|
1695
|
-
if (!
|
|
1696
|
-
for (const h of
|
|
1705
|
+
if (!l || l.length === 0) return {};
|
|
1706
|
+
for (const h of l) {
|
|
1697
1707
|
const r = h.children && h.children.length > 0;
|
|
1698
|
-
h.uniqueId ===
|
|
1708
|
+
h.uniqueId === a && Object.prototype.toString.call(o) === "[object Object]" && Object.assign(h, o), r && appendFieldByUniqueId(h.children, a, o);
|
|
1699
1709
|
}
|
|
1700
|
-
return
|
|
1710
|
+
return l;
|
|
1701
1711
|
}
|
|
1702
1712
|
NProgress.configure({
|
|
1703
1713
|
// 动画方式
|
|
@@ -1722,7 +1732,7 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1722
1732
|
constructor() {
|
|
1723
1733
|
x(this, "router");
|
|
1724
1734
|
x(this, "baseUrl", null);
|
|
1725
|
-
x(this, "getNetworkError", (
|
|
1735
|
+
x(this, "getNetworkError", (a) => a ? {
|
|
1726
1736
|
400: "错误的请求",
|
|
1727
1737
|
401: "服务未授权,请重新登录",
|
|
1728
1738
|
403: "拒绝访问",
|
|
@@ -1732,50 +1742,50 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1732
1742
|
502: "网络超时",
|
|
1733
1743
|
503: "服务不可用",
|
|
1734
1744
|
504: "网络超时"
|
|
1735
|
-
}[
|
|
1745
|
+
}[a] : null);
|
|
1736
1746
|
this.httpInterceptorsRequest(), this.httpInterceptorsResponse();
|
|
1737
1747
|
}
|
|
1738
1748
|
/** 设置router调整 */
|
|
1739
|
-
setRouter(
|
|
1740
|
-
this.router =
|
|
1749
|
+
setRouter(a) {
|
|
1750
|
+
this.router = a;
|
|
1741
1751
|
}
|
|
1742
|
-
setBaseUrl(
|
|
1743
|
-
this.baseUrl =
|
|
1752
|
+
setBaseUrl(a) {
|
|
1753
|
+
this.baseUrl = a;
|
|
1744
1754
|
}
|
|
1745
1755
|
/** 重连原始请求 */
|
|
1746
|
-
static retryOriginalRequest(
|
|
1756
|
+
static retryOriginalRequest(a) {
|
|
1747
1757
|
return new Promise((o) => {
|
|
1748
1758
|
g.requests.push((h) => {
|
|
1749
|
-
|
|
1759
|
+
a.headers.Authorization = "Bearer " + h, o(a);
|
|
1750
1760
|
});
|
|
1751
1761
|
});
|
|
1752
1762
|
}
|
|
1753
1763
|
// 请求拦截
|
|
1754
1764
|
httpInterceptorsRequest() {
|
|
1755
1765
|
g.axiosInstance.interceptors.request.use(
|
|
1756
|
-
(
|
|
1766
|
+
(a) => (has(a, "loading") && isRef(a.loading) && (a.loading.value = !0), NProgress.start(), typeof a.beforeRequestCallback == "function" ? (a.beforeRequestCallback(a), a) : g.initConfig.beforeRequestCallback ? (g.initConfig.beforeRequestCallback(a), a) : ["/refreshToken", "/login"].some((h) => a.url.indexOf(h) > -1) ? a : new Promise((h) => {
|
|
1757
1767
|
const r = cookies.get(kTOKENKEY);
|
|
1758
1768
|
if (r) {
|
|
1759
1769
|
const e = JSON.parse(r), i = (/* @__PURE__ */ new Date()).getTime();
|
|
1760
1770
|
e.expires - i <= 0 ? (g.isRefreshing || (g.isRefreshing = !0, this.get(this.baseUrl + "/uath/refreshToken", {
|
|
1761
1771
|
refreshToken: e.refreshToken
|
|
1762
|
-
}).then((
|
|
1763
|
-
|
|
1772
|
+
}).then((c) => {
|
|
1773
|
+
c != null && c.access_token ? (this.setToken(c), a.headers.Authorization = "Bearer " + c.access_token, g.requests.forEach((t) => t(c.access_token)), g.requests = []) : this.routeToLogin();
|
|
1764
1774
|
}).catch(() => {
|
|
1765
1775
|
this.routeToLogin();
|
|
1766
1776
|
}).finally(() => {
|
|
1767
1777
|
g.isRefreshing = !1;
|
|
1768
|
-
})), h(g.retryOriginalRequest(
|
|
1778
|
+
})), h(g.retryOriginalRequest(a))) : (a.headers.Authorization = "Bearer " + e.accessToken, h(a));
|
|
1769
1779
|
} else {
|
|
1770
1780
|
const e = cookies.get("kCookies_token");
|
|
1771
|
-
e && (
|
|
1781
|
+
e && (a.headers["X-Token"] = e), h(a);
|
|
1772
1782
|
}
|
|
1773
1783
|
})),
|
|
1774
|
-
(
|
|
1784
|
+
(a) => Promise.reject(a)
|
|
1775
1785
|
);
|
|
1776
1786
|
}
|
|
1777
|
-
setToken(
|
|
1778
|
-
const { access_token: o, expires_in: h, refresh_token: r } =
|
|
1787
|
+
setToken(a) {
|
|
1788
|
+
const { access_token: o, expires_in: h, refresh_token: r } = a, e = {
|
|
1779
1789
|
accessToken: o,
|
|
1780
1790
|
refreshToken: r,
|
|
1781
1791
|
expires: Date.now() + h * 1e3
|
|
@@ -1799,66 +1809,66 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1799
1809
|
}
|
|
1800
1810
|
);
|
|
1801
1811
|
}
|
|
1802
|
-
transformConfigByMethod(
|
|
1812
|
+
transformConfigByMethod(a, o) {
|
|
1803
1813
|
const { method: h } = o, r = ["get"], e = h.toLocaleLowerCase(), i = r.includes(e) ? "params" : "data";
|
|
1804
1814
|
return {
|
|
1805
1815
|
...o,
|
|
1806
|
-
[i]:
|
|
1816
|
+
[i]: a
|
|
1807
1817
|
};
|
|
1808
1818
|
}
|
|
1809
1819
|
// 通用请求工具函数
|
|
1810
|
-
request(
|
|
1820
|
+
request(a, o, h, r) {
|
|
1811
1821
|
const e = this.transformConfigByMethod(h, {
|
|
1812
|
-
method:
|
|
1822
|
+
method: a,
|
|
1813
1823
|
url: o,
|
|
1814
1824
|
...r
|
|
1815
1825
|
});
|
|
1816
|
-
return new Promise((i,
|
|
1817
|
-
g.axiosInstance.request(e).then((
|
|
1818
|
-
if (
|
|
1819
|
-
i(
|
|
1820
|
-
else if (
|
|
1821
|
-
errorMessage(
|
|
1822
|
-
else if ((
|
|
1823
|
-
i(
|
|
1826
|
+
return new Promise((i, Z) => {
|
|
1827
|
+
g.axiosInstance.request(e).then((c) => {
|
|
1828
|
+
if (c && (c == null ? void 0 : c.code) === "0")
|
|
1829
|
+
i(c.data);
|
|
1830
|
+
else if (c.code === "500")
|
|
1831
|
+
errorMessage(c.msg, { duration: 8e3 }), e.method === "get" ? i(c) : Z(c.msg);
|
|
1832
|
+
else if ((c == null ? void 0 : c.code) !== "-1")
|
|
1833
|
+
i(c);
|
|
1824
1834
|
else {
|
|
1825
|
-
const
|
|
1826
|
-
errorMessage(
|
|
1835
|
+
const t = (c == null ? void 0 : c.msg) || "服务异常";
|
|
1836
|
+
errorMessage(t, { duration: 8e3 }), Z(t);
|
|
1827
1837
|
}
|
|
1828
|
-
}).catch((
|
|
1829
|
-
var
|
|
1830
|
-
if (
|
|
1831
|
-
if (((
|
|
1838
|
+
}).catch((c) => {
|
|
1839
|
+
var t, d, f;
|
|
1840
|
+
if (c != null && c.code) {
|
|
1841
|
+
if (((t = c == null ? void 0 : c.response) == null ? void 0 : t.status) === 401)
|
|
1832
1842
|
return (d = this.router) == null ? void 0 : d.push({ path: "/login" });
|
|
1833
1843
|
errorMessage(
|
|
1834
|
-
this.getNetworkError((
|
|
1844
|
+
this.getNetworkError((f = c == null ? void 0 : c.response) == null ? void 0 : f.status) || (c == null ? void 0 : c.message),
|
|
1835
1845
|
{ duration: 8e3 }
|
|
1836
1846
|
);
|
|
1837
1847
|
}
|
|
1838
|
-
|
|
1848
|
+
c.config.method === "get" ? i(c) : Z(c);
|
|
1839
1849
|
});
|
|
1840
1850
|
});
|
|
1841
1851
|
}
|
|
1842
1852
|
// 单独抽离的post工具函数
|
|
1843
|
-
post(
|
|
1844
|
-
return this.request("post",
|
|
1853
|
+
post(a, o, h) {
|
|
1854
|
+
return this.request("post", a, o, h);
|
|
1845
1855
|
}
|
|
1846
1856
|
// 单独抽离的delete工具函数
|
|
1847
|
-
delete(
|
|
1848
|
-
return this.request("delete",
|
|
1857
|
+
delete(a, o, h) {
|
|
1858
|
+
return this.request("delete", a, o, h);
|
|
1849
1859
|
}
|
|
1850
1860
|
// 单独抽离的put工具函数
|
|
1851
|
-
put(
|
|
1852
|
-
return this.request("put",
|
|
1861
|
+
put(a, o, h) {
|
|
1862
|
+
return this.request("put", a, o, h);
|
|
1853
1863
|
}
|
|
1854
1864
|
// 单独抽离的get工具函数
|
|
1855
|
-
get(
|
|
1865
|
+
get(a, o, h) {
|
|
1856
1866
|
for (const r in o)
|
|
1857
1867
|
o[r] || delete o[r];
|
|
1858
|
-
return this.request("get",
|
|
1868
|
+
return this.request("get", a, o, h);
|
|
1859
1869
|
}
|
|
1860
|
-
postRouter(
|
|
1861
|
-
return this.request("post", "route/service",
|
|
1870
|
+
postRouter(a) {
|
|
1871
|
+
return this.request("post", "route/service", a);
|
|
1862
1872
|
}
|
|
1863
1873
|
};
|
|
1864
1874
|
/** token过期后,暂存待执行的请求 */
|
|
@@ -2216,15 +2226,15 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2216
2226
|
*
|
|
2217
2227
|
* @param param {Object} 按照festival的格式输入数据,设置阳历节日
|
|
2218
2228
|
*/
|
|
2219
|
-
setFestival(
|
|
2220
|
-
this.festival =
|
|
2229
|
+
setFestival(l = {}) {
|
|
2230
|
+
this.festival = l;
|
|
2221
2231
|
},
|
|
2222
2232
|
/**
|
|
2223
2233
|
*
|
|
2224
2234
|
* @param param {Object} 按照lFestival的格式输入数据,设置农历节日
|
|
2225
2235
|
*/
|
|
2226
|
-
setLunarFestival(
|
|
2227
|
-
this.lFestival =
|
|
2236
|
+
setLunarFestival(l = {}) {
|
|
2237
|
+
this.lFestival = l;
|
|
2228
2238
|
},
|
|
2229
2239
|
/**
|
|
2230
2240
|
* 24节气速查表
|
|
@@ -2518,11 +2528,11 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2518
2528
|
* @return Number
|
|
2519
2529
|
* @eg:var count = calendar.lYearDays(1987) ;//count=387
|
|
2520
2530
|
*/
|
|
2521
|
-
lYearDays: function(
|
|
2522
|
-
let
|
|
2523
|
-
for (
|
|
2524
|
-
o += this.lunarInfo[
|
|
2525
|
-
return o + this.leapDays(
|
|
2531
|
+
lYearDays: function(l) {
|
|
2532
|
+
let a, o = 348;
|
|
2533
|
+
for (a = 32768; a > 8; a >>= 1)
|
|
2534
|
+
o += this.lunarInfo[l - 1900] & a ? 1 : 0;
|
|
2535
|
+
return o + this.leapDays(l);
|
|
2526
2536
|
},
|
|
2527
2537
|
/**
|
|
2528
2538
|
* 返回农历y年闰月是哪个月;若y年没有闰月 则返回0
|
|
@@ -2530,8 +2540,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2530
2540
|
* @return Number (0-12)
|
|
2531
2541
|
* @eg:var leapMonth = calendar.leapMonth(1987) ;//leapMonth=6
|
|
2532
2542
|
*/
|
|
2533
|
-
leapMonth: function(
|
|
2534
|
-
return this.lunarInfo[
|
|
2543
|
+
leapMonth: function(l) {
|
|
2544
|
+
return this.lunarInfo[l - 1900] & 15;
|
|
2535
2545
|
},
|
|
2536
2546
|
/**
|
|
2537
2547
|
* 返回农历y年闰月的天数 若该年没有闰月则返回0
|
|
@@ -2539,8 +2549,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2539
2549
|
* @return Number (0、29、30)
|
|
2540
2550
|
* @eg:var leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29
|
|
2541
2551
|
*/
|
|
2542
|
-
leapDays: function(
|
|
2543
|
-
return this.leapMonth(
|
|
2552
|
+
leapDays: function(l) {
|
|
2553
|
+
return this.leapMonth(l) ? this.lunarInfo[l - 1900] & 65536 ? 30 : 29 : 0;
|
|
2544
2554
|
},
|
|
2545
2555
|
/**
|
|
2546
2556
|
* 返回农历y年m月(非闰月)的总天数,计算m为闰月时的天数请使用leapDays方法
|
|
@@ -2549,8 +2559,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2549
2559
|
* @return Number (-1、29、30)
|
|
2550
2560
|
* @eg:var MonthDay = calendar.monthDays(1987,9) ;//MonthDay=29
|
|
2551
2561
|
*/
|
|
2552
|
-
monthDays: function(
|
|
2553
|
-
return
|
|
2562
|
+
monthDays: function(l, a) {
|
|
2563
|
+
return a > 12 || a < 1 ? -1 : this.lunarInfo[l - 1900] & 65536 >> a ? 30 : 29;
|
|
2554
2564
|
},
|
|
2555
2565
|
/**
|
|
2556
2566
|
* 返回公历(!)y年m月的天数
|
|
@@ -2559,20 +2569,20 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2559
2569
|
* @return Number (-1、28、29、30、31)
|
|
2560
2570
|
* @eg:var solarMonthDay = calendar.leapDays(1987) ;//solarMonthDay=30
|
|
2561
2571
|
*/
|
|
2562
|
-
solarDays: function(
|
|
2563
|
-
if (
|
|
2572
|
+
solarDays: function(l, a) {
|
|
2573
|
+
if (a > 12 || a < 1)
|
|
2564
2574
|
return -1;
|
|
2565
|
-
const o =
|
|
2566
|
-
return o === 1 ?
|
|
2575
|
+
const o = a - 1;
|
|
2576
|
+
return o === 1 ? l % 4 === 0 && l % 100 !== 0 || l % 400 === 0 ? 29 : 28 : this.solarMonth[o];
|
|
2567
2577
|
},
|
|
2568
2578
|
/**
|
|
2569
2579
|
* 农历年份转换为干支纪年
|
|
2570
2580
|
* @param lYear 农历年的年份数
|
|
2571
2581
|
* @return Cn string
|
|
2572
2582
|
*/
|
|
2573
|
-
toGanZhiYear: function(
|
|
2574
|
-
let
|
|
2575
|
-
return
|
|
2583
|
+
toGanZhiYear: function(l) {
|
|
2584
|
+
let a = (l - 3) % 10, o = (l - 3) % 12;
|
|
2585
|
+
return a === 0 && (a = 10), o === 0 && (o = 12), this.Gan[a - 1] + this.Zhi[o - 1];
|
|
2576
2586
|
},
|
|
2577
2587
|
/**
|
|
2578
2588
|
* 公历月、日判断所属星座
|
|
@@ -2580,17 +2590,17 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2580
2590
|
* @param cDay [description]
|
|
2581
2591
|
* @return Cn string
|
|
2582
2592
|
*/
|
|
2583
|
-
toAstro: function(
|
|
2593
|
+
toAstro: function(l, a) {
|
|
2584
2594
|
const o = "摩羯水瓶双鱼白羊金牛双子巨蟹狮子处女天秤天蝎射手摩羯", h = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22];
|
|
2585
|
-
return o.substr(
|
|
2595
|
+
return o.substr(l * 2 - (a < h[l - 1] ? 2 : 0), 2) + "座";
|
|
2586
2596
|
},
|
|
2587
2597
|
/**
|
|
2588
2598
|
* 传入offset偏移量返回干支
|
|
2589
2599
|
* @param offset 相对甲子的偏移量
|
|
2590
2600
|
* @return Cn string
|
|
2591
2601
|
*/
|
|
2592
|
-
toGanZhi: function(
|
|
2593
|
-
return this.Gan[
|
|
2602
|
+
toGanZhi: function(l) {
|
|
2603
|
+
return this.Gan[l % 10] + this.Zhi[l % 12];
|
|
2594
2604
|
},
|
|
2595
2605
|
/**
|
|
2596
2606
|
* 传入公历(!)y年获得该年第n个节气的公历日期
|
|
@@ -2599,15 +2609,15 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2599
2609
|
* @return day Number
|
|
2600
2610
|
* @eg:var _24 = calendar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春
|
|
2601
2611
|
*/
|
|
2602
|
-
getTerm: function(
|
|
2603
|
-
if (
|
|
2612
|
+
getTerm: function(l, a) {
|
|
2613
|
+
if (l < 1900 || l > 2100 || a < 1 || a > 24)
|
|
2604
2614
|
return -1;
|
|
2605
|
-
const o = this.sTermInfo[
|
|
2615
|
+
const o = this.sTermInfo[l - 1900], h = [];
|
|
2606
2616
|
for (let r = 0; r < o.length; r += 5) {
|
|
2607
2617
|
const e = parseInt("0x" + o.substr(r, 5)).toString();
|
|
2608
2618
|
h.push(e[0], e.substr(1, 2), e[3], e.substr(4, 2));
|
|
2609
2619
|
}
|
|
2610
|
-
return parseInt(h[
|
|
2620
|
+
return parseInt(h[a - 1]);
|
|
2611
2621
|
},
|
|
2612
2622
|
/**
|
|
2613
2623
|
* 传入农历数字月份返回汉语通俗表示法
|
|
@@ -2615,11 +2625,11 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2615
2625
|
* @return Cn string
|
|
2616
2626
|
* @eg:var cnMonth = calendar.toChinaMonth(12) ;//cnMonth='腊月'
|
|
2617
2627
|
*/
|
|
2618
|
-
toChinaMonth: function(
|
|
2619
|
-
if (
|
|
2628
|
+
toChinaMonth: function(l) {
|
|
2629
|
+
if (l > 12 || l < 1)
|
|
2620
2630
|
return -1;
|
|
2621
|
-
let
|
|
2622
|
-
return
|
|
2631
|
+
let a = this.nStr3[l - 1];
|
|
2632
|
+
return a += "月", a;
|
|
2623
2633
|
},
|
|
2624
2634
|
/**
|
|
2625
2635
|
* 传入农历日期数字返回汉字表示法
|
|
@@ -2627,22 +2637,22 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2627
2637
|
* @return Cn string
|
|
2628
2638
|
* @eg:var cnDay = calendar.toChinaDay(21) ;//cnMonth='廿一'
|
|
2629
2639
|
*/
|
|
2630
|
-
toChinaDay: function(
|
|
2631
|
-
let
|
|
2632
|
-
switch (
|
|
2640
|
+
toChinaDay: function(l) {
|
|
2641
|
+
let a;
|
|
2642
|
+
switch (l) {
|
|
2633
2643
|
case 10:
|
|
2634
|
-
|
|
2644
|
+
a = "初十";
|
|
2635
2645
|
break;
|
|
2636
2646
|
case 20:
|
|
2637
|
-
|
|
2647
|
+
a = "二十";
|
|
2638
2648
|
break;
|
|
2639
2649
|
case 30:
|
|
2640
|
-
|
|
2650
|
+
a = "三十";
|
|
2641
2651
|
break;
|
|
2642
2652
|
default:
|
|
2643
|
-
|
|
2653
|
+
a = this.nStr2[Math.floor(l / 10)], a += this.nStr1[l % 10];
|
|
2644
2654
|
}
|
|
2645
|
-
return
|
|
2655
|
+
return a;
|
|
2646
2656
|
},
|
|
2647
2657
|
/**
|
|
2648
2658
|
* 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春”
|
|
@@ -2650,8 +2660,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2650
2660
|
* @return Cn string
|
|
2651
2661
|
* @eg:var animal = calendar.getAnimal(1987) ;//animal='兔'
|
|
2652
2662
|
*/
|
|
2653
|
-
getAnimal: function(
|
|
2654
|
-
return this.Animals[(
|
|
2663
|
+
getAnimal: function(l) {
|
|
2664
|
+
return this.Animals[(l - 4) % 12];
|
|
2655
2665
|
},
|
|
2656
2666
|
/**
|
|
2657
2667
|
* 传入阳历年月日获得详细的公历、农历object信息 <=>JSON
|
|
@@ -2662,60 +2672,60 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2662
2672
|
* @return JSON object
|
|
2663
2673
|
* @eg:console.log(calendar.solar2lunar(1987,11,01));
|
|
2664
2674
|
*/
|
|
2665
|
-
solar2lunar: function(
|
|
2666
|
-
let h = parseInt(
|
|
2675
|
+
solar2lunar: function(l, a, o) {
|
|
2676
|
+
let h = parseInt(l), r = parseInt(a), e = parseInt(o);
|
|
2667
2677
|
if (h < 1900 || h > 2100 || h === 1900 && r === 1 && e < 31)
|
|
2668
2678
|
return -1;
|
|
2669
2679
|
let i;
|
|
2670
2680
|
h ? i = new Date(h, parseInt(r.toString()) - 1, e) : i = /* @__PURE__ */ new Date();
|
|
2671
|
-
let
|
|
2681
|
+
let Z, c = 0, t = 0;
|
|
2672
2682
|
h = i.getFullYear(), r = i.getMonth() + 1, e = i.getDate();
|
|
2673
2683
|
let d = (Date.UTC(i.getFullYear(), i.getMonth(), i.getDate()) - Date.UTC(1900, 0, 31)) / 864e5;
|
|
2674
|
-
for (
|
|
2675
|
-
|
|
2676
|
-
d < 0 && (d +=
|
|
2677
|
-
const
|
|
2678
|
-
let
|
|
2679
|
-
|
|
2680
|
-
let
|
|
2681
|
-
const
|
|
2682
|
-
|
|
2683
|
-
const
|
|
2684
|
-
|
|
2685
|
-
let
|
|
2686
|
-
for (
|
|
2687
|
-
|
|
2688
|
-
d === 0 &&
|
|
2689
|
-
const p =
|
|
2684
|
+
for (Z = 1900; Z < 2101 && d > 0; Z++)
|
|
2685
|
+
t = this.lYearDays(Z), d -= t;
|
|
2686
|
+
d < 0 && (d += t, Z--);
|
|
2687
|
+
const f = /* @__PURE__ */ new Date();
|
|
2688
|
+
let n = !1;
|
|
2689
|
+
f.getFullYear() === h && f.getMonth() + 1 === r && f.getDate() === e && (n = !0);
|
|
2690
|
+
let m = i.getDay();
|
|
2691
|
+
const b = this.nStr1[m];
|
|
2692
|
+
m === 0 && (m = 7);
|
|
2693
|
+
const M = Z;
|
|
2694
|
+
c = this.leapMonth(Z);
|
|
2695
|
+
let V = !1;
|
|
2696
|
+
for (Z = 1; Z < 13 && d > 0; Z++)
|
|
2697
|
+
c > 0 && Z === c + 1 && V === !1 ? (--Z, V = !0, t = this.leapDays(M)) : t = this.monthDays(M, Z), V === !0 && Z === c + 1 && (V = !1), d -= t;
|
|
2698
|
+
d === 0 && c > 0 && Z === c + 1 && (V ? V = !1 : (V = !0, --Z)), d < 0 && (d += t, --Z);
|
|
2699
|
+
const p = Z, L = d + 1, k = r - 1, y = this.toGanZhiYear(M), C = this.getTerm(h, r * 2 - 1), T = this.getTerm(h, r * 2);
|
|
2690
2700
|
let w = this.toGanZhi((h - 1900) * 12 + r + 11);
|
|
2691
|
-
e >=
|
|
2692
|
-
let R = !1,
|
|
2693
|
-
|
|
2694
|
-
const
|
|
2695
|
-
let
|
|
2696
|
-
return p === 12 &&
|
|
2697
|
-
date:
|
|
2698
|
-
lunarDate:
|
|
2699
|
-
festival: S[
|
|
2700
|
-
lunarFestival: I[
|
|
2701
|
-
lYear:
|
|
2701
|
+
e >= C && (w = this.toGanZhi((h - 1900) * 12 + r + 12));
|
|
2702
|
+
let R = !1, D;
|
|
2703
|
+
C === e && (R = !0, D = this.solarTerm[r * 2 - 2]), T === e && (R = !0, D = this.solarTerm[r * 2 - 1]);
|
|
2704
|
+
const v = Date.UTC(h, k, 1, 0, 0, 0, 0) / 864e5 + 25567 + 10, u = this.toGanZhi(v + e - 1), H = this.toAstro(r, e), s = h + "-" + r + "-" + e, A = M + "-" + p + "-" + L, S = this.festival, I = this.lFestival, N = r + "-" + e;
|
|
2705
|
+
let F = p + "-" + L;
|
|
2706
|
+
return p === 12 && L === 29 && this.monthDays(M, p) === 29 && (F = "12-30"), {
|
|
2707
|
+
date: s,
|
|
2708
|
+
lunarDate: A,
|
|
2709
|
+
festival: S[N] ? S[N].title : null,
|
|
2710
|
+
lunarFestival: I[F] ? I[F].title : null,
|
|
2711
|
+
lYear: M,
|
|
2702
2712
|
lMonth: p,
|
|
2703
|
-
lDay:
|
|
2704
|
-
Animal: this.getAnimal(
|
|
2705
|
-
IMonthCn: (
|
|
2706
|
-
IDayCn: this.toChinaDay(
|
|
2713
|
+
lDay: L,
|
|
2714
|
+
Animal: this.getAnimal(M),
|
|
2715
|
+
IMonthCn: (V ? "闰" : "") + this.toChinaMonth(p),
|
|
2716
|
+
IDayCn: this.toChinaDay(L),
|
|
2707
2717
|
cYear: h,
|
|
2708
2718
|
cMonth: r,
|
|
2709
2719
|
cDay: e,
|
|
2710
|
-
gzYear:
|
|
2720
|
+
gzYear: y,
|
|
2711
2721
|
gzMonth: w,
|
|
2712
2722
|
gzDay: u,
|
|
2713
|
-
isToday:
|
|
2714
|
-
isLeap:
|
|
2715
|
-
nWeek:
|
|
2716
|
-
ncWeek: "星期" +
|
|
2723
|
+
isToday: n,
|
|
2724
|
+
isLeap: V,
|
|
2725
|
+
nWeek: m,
|
|
2726
|
+
ncWeek: "星期" + b,
|
|
2717
2727
|
isTerm: R,
|
|
2718
|
-
Term:
|
|
2728
|
+
Term: D,
|
|
2719
2729
|
astro: H
|
|
2720
2730
|
};
|
|
2721
2731
|
},
|
|
@@ -2729,40 +2739,40 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2729
2739
|
* @return JSON object
|
|
2730
2740
|
* @eg:console.log(calendar.lunar2solar(1987,9,10));
|
|
2731
2741
|
*/
|
|
2732
|
-
lunar2solar: function(
|
|
2733
|
-
|
|
2734
|
-
const r = this.leapMonth(
|
|
2735
|
-
if (h && r !==
|
|
2742
|
+
lunar2solar: function(l, a, o, h) {
|
|
2743
|
+
l = parseInt(l), a = parseInt(a), o = parseInt(o), h = !!h;
|
|
2744
|
+
const r = this.leapMonth(l);
|
|
2745
|
+
if (h && r !== a || l === 2100 && a === 12 && o > 1 || l === 1900 && a === 1 && o < 31)
|
|
2736
2746
|
return -1;
|
|
2737
|
-
const e = this.monthDays(
|
|
2747
|
+
const e = this.monthDays(l, a);
|
|
2738
2748
|
let i = e;
|
|
2739
|
-
if (h && (i = this.leapDays(
|
|
2749
|
+
if (h && (i = this.leapDays(l)), l < 1900 || l > 2100 || o > i)
|
|
2740
2750
|
return -1;
|
|
2741
|
-
let
|
|
2742
|
-
for (
|
|
2743
|
-
|
|
2744
|
-
let
|
|
2745
|
-
for (
|
|
2746
|
-
|
|
2747
|
-
h && (
|
|
2748
|
-
const
|
|
2749
|
-
return this.solar2lunar(
|
|
2751
|
+
let Z = 0, c;
|
|
2752
|
+
for (c = 1900; c < l; c++)
|
|
2753
|
+
Z += this.lYearDays(c);
|
|
2754
|
+
let t = 0, d = !1;
|
|
2755
|
+
for (c = 1; c < a; c++)
|
|
2756
|
+
t = this.leapMonth(l), d || t <= c && t > 0 && (Z += this.leapDays(l), d = !0), Z += this.monthDays(l, c);
|
|
2757
|
+
h && (Z += e);
|
|
2758
|
+
const f = Date.UTC(1900, 1, 30, 0, 0, 0), n = new Date((Z + o - 31) * 864e5 + f), m = n.getUTCFullYear(), b = n.getUTCMonth() + 1, M = n.getUTCDate();
|
|
2759
|
+
return this.solar2lunar(m, b, M);
|
|
2750
2760
|
}
|
|
2751
2761
|
}, dict = storageLocal.getItem("kLov"), formats = {
|
|
2752
2762
|
formatDate: {
|
|
2753
2763
|
// 格式化日期,默认 yyyy-MM-dd HH:mm:ss
|
|
2754
|
-
tableCellFormatMethod({ cellValue:
|
|
2755
|
-
return
|
|
2764
|
+
tableCellFormatMethod({ cellValue: l }, a) {
|
|
2765
|
+
return l && XEUtils.toDateString(l, a || "yyyy-MM-dd");
|
|
2756
2766
|
}
|
|
2757
2767
|
},
|
|
2758
2768
|
formatAmount: {
|
|
2759
|
-
tableCellFormatMethod({ cellValue:
|
|
2760
|
-
return XEUtils.commafy(Number(
|
|
2769
|
+
tableCellFormatMethod({ cellValue: l }, a = 2) {
|
|
2770
|
+
return XEUtils.commafy(Number(l), { digits: a });
|
|
2761
2771
|
}
|
|
2762
2772
|
},
|
|
2763
2773
|
formatBankcard: {
|
|
2764
|
-
tableCellFormatMethod({ cellValue:
|
|
2765
|
-
return XEUtils.commafy(XEUtils.toValueString(
|
|
2774
|
+
tableCellFormatMethod({ cellValue: l }) {
|
|
2775
|
+
return XEUtils.commafy(XEUtils.toValueString(l), {
|
|
2766
2776
|
spaceNumber: 4,
|
|
2767
2777
|
separator: " "
|
|
2768
2778
|
});
|
|
@@ -2770,33 +2780,33 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2770
2780
|
},
|
|
2771
2781
|
formatFixedNumber: {
|
|
2772
2782
|
// 四舍五入金额,每隔3位逗号分隔,默认2位数
|
|
2773
|
-
tableCellFormatMethod({ cellValue:
|
|
2774
|
-
return XEUtils.toFixed(XEUtils.round(
|
|
2783
|
+
tableCellFormatMethod({ cellValue: l }, a = 2) {
|
|
2784
|
+
return XEUtils.toFixed(XEUtils.round(l, a), a);
|
|
2775
2785
|
}
|
|
2776
2786
|
},
|
|
2777
2787
|
formatCutNumber: {
|
|
2778
2788
|
// 向下舍入,默认两位数
|
|
2779
|
-
tableCellFormatMethod({ cellValue:
|
|
2780
|
-
return XEUtils.toFixed(XEUtils.floor(
|
|
2789
|
+
tableCellFormatMethod({ cellValue: l }, a = 2) {
|
|
2790
|
+
return XEUtils.toFixed(XEUtils.floor(l, a), a);
|
|
2781
2791
|
}
|
|
2782
2792
|
},
|
|
2783
2793
|
formatDict: {
|
|
2784
2794
|
// 数据字段转化
|
|
2785
|
-
tableCellFormatMethod({ cellValue:
|
|
2795
|
+
tableCellFormatMethod({ cellValue: l }, a) {
|
|
2786
2796
|
var r, e;
|
|
2787
|
-
if (!
|
|
2788
|
-
const o = XEUtils.toValueString(
|
|
2789
|
-
return (h == null ? void 0 : h.dictName) ||
|
|
2797
|
+
if (!a) return l;
|
|
2798
|
+
const o = XEUtils.toValueString(l), h = dict ? (e = (r = dict[a]) == null ? void 0 : r.children) == null ? void 0 : e.find((i) => i.dictCode === o) : l;
|
|
2799
|
+
return (h == null ? void 0 : h.dictName) || l;
|
|
2790
2800
|
}
|
|
2791
2801
|
},
|
|
2792
2802
|
formattMultileCode: {
|
|
2793
|
-
tableCellFormatMethod({ cellValue:
|
|
2794
|
-
if (!
|
|
2795
|
-
const o =
|
|
2803
|
+
tableCellFormatMethod({ cellValue: l }, a) {
|
|
2804
|
+
if (!a || !dict) return l;
|
|
2805
|
+
const o = l == null ? void 0 : l.split(",");
|
|
2796
2806
|
let h = "";
|
|
2797
2807
|
return o == null || o.forEach((r) => {
|
|
2798
|
-
var i,
|
|
2799
|
-
const e = (
|
|
2808
|
+
var i, Z;
|
|
2809
|
+
const e = (Z = (i = dict[a]) == null ? void 0 : i.children) == null ? void 0 : Z.find((c) => c.dictCode === r);
|
|
2800
2810
|
h ? h += `,${e.dictName}` : h = e.dictName;
|
|
2801
2811
|
}), h;
|
|
2802
2812
|
}
|
|
@@ -2809,24 +2819,24 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2809
2819
|
},
|
|
2810
2820
|
formatContact: {
|
|
2811
2821
|
// 字段拼接展示
|
|
2812
|
-
tableCellFormatMethod({ row:
|
|
2813
|
-
return
|
|
2822
|
+
tableCellFormatMethod({ row: l }, a) {
|
|
2823
|
+
return a.reduce((o, h) => l[h] ? o ? o += l[h] : l[h] : o, "");
|
|
2814
2824
|
}
|
|
2815
2825
|
},
|
|
2816
2826
|
formatSelectLocal: {
|
|
2817
|
-
tableCellFormatMethod({ cellValue:
|
|
2818
|
-
const [o, h = "value", r = "label"] =
|
|
2819
|
-
return e ? e[r] :
|
|
2827
|
+
tableCellFormatMethod({ cellValue: l }, a) {
|
|
2828
|
+
const [o, h = "value", r = "label"] = a, e = o == null ? void 0 : o.find((i) => i[h] === l);
|
|
2829
|
+
return e ? e[r] : l;
|
|
2820
2830
|
}
|
|
2821
2831
|
},
|
|
2822
2832
|
formatMultiValue: {
|
|
2823
|
-
tableCellFormatMethod({ row:
|
|
2833
|
+
tableCellFormatMethod({ row: l }, a) {
|
|
2824
2834
|
var e;
|
|
2825
|
-
const [o, h] =
|
|
2835
|
+
const [o, h] = a;
|
|
2826
2836
|
let r;
|
|
2827
|
-
return (e =
|
|
2828
|
-
const
|
|
2829
|
-
r = r ? `${r},${
|
|
2837
|
+
return (e = l[o]) == null || e.split(",").forEach((i) => {
|
|
2838
|
+
const Z = h.find((c) => c.value === i);
|
|
2839
|
+
r = r ? `${r},${Z == null ? void 0 : Z.label}` : Z == null ? void 0 : Z.label;
|
|
2830
2840
|
}), r;
|
|
2831
2841
|
}
|
|
2832
2842
|
}
|
|
@@ -10451,34 +10461,34 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
10451
10461
|
},
|
|
10452
10462
|
width: 24,
|
|
10453
10463
|
height: 24
|
|
10454
|
-
}, withInstall = (
|
|
10455
|
-
const
|
|
10456
|
-
return
|
|
10457
|
-
o.component(
|
|
10458
|
-
},
|
|
10464
|
+
}, withInstall = (l) => {
|
|
10465
|
+
const a = l;
|
|
10466
|
+
return a.install = (o) => {
|
|
10467
|
+
o.component(a.name || a.__name, l);
|
|
10468
|
+
}, l;
|
|
10459
10469
|
};
|
|
10460
|
-
function sleep(
|
|
10461
|
-
return new Promise((
|
|
10470
|
+
function sleep(l = 64) {
|
|
10471
|
+
return new Promise((a) => {
|
|
10462
10472
|
const o = setTimeout(() => {
|
|
10463
|
-
window.clearTimeout(o), l
|
|
10464
|
-
},
|
|
10473
|
+
window.clearTimeout(o), a(l);
|
|
10474
|
+
}, l);
|
|
10465
10475
|
});
|
|
10466
10476
|
}
|
|
10467
|
-
const delay = (
|
|
10477
|
+
const delay = (l) => new Promise((a) => setTimeout(a, l)), useDark = () => ({ isDark: ref(document.documentElement.classList.contains("dark")) }), useDebounce = (l, a) => {
|
|
10468
10478
|
let o;
|
|
10469
10479
|
return () => {
|
|
10470
|
-
o && clearTimeout(o), o = setTimeout(
|
|
10480
|
+
o && clearTimeout(o), o = setTimeout(l, a);
|
|
10471
10481
|
};
|
|
10472
10482
|
};
|
|
10473
|
-
function isUrl(
|
|
10474
|
-
return /(((^http(s)?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/.test(
|
|
10483
|
+
function isUrl(l) {
|
|
10484
|
+
return /(((^http(s)?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/.test(l);
|
|
10475
10485
|
}
|
|
10476
|
-
const getDictName = (
|
|
10486
|
+
const getDictName = (l, a) => {
|
|
10477
10487
|
var h, r;
|
|
10478
|
-
return !
|
|
10479
|
-
}, getDictChildren = (
|
|
10488
|
+
return !l || !a ? null : (r = (h = storageLocal.getItem("kLov")[l]) == null ? void 0 : h.children.find((e) => a === e.dictCode)) == null ? void 0 : r.dictName;
|
|
10489
|
+
}, getDictChildren = (l) => {
|
|
10480
10490
|
var o;
|
|
10481
|
-
return
|
|
10491
|
+
return l ? (o = storageLocal.getItem("kLov")[l]) == null ? void 0 : o.children : [];
|
|
10482
10492
|
};
|
|
10483
10493
|
export {
|
|
10484
10494
|
G as NProgress,
|