@utogether/utils 3.0.0-beta.41 → 3.0.0-beta.43
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 +913 -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
|
+
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,108 @@ const VxetableRender = (VXETable, {
|
|
|
861
847
|
"data-status": "detail"
|
|
862
848
|
}), null)];
|
|
863
849
|
},
|
|
864
|
-
renderItemContent(
|
|
850
|
+
renderItemContent(l, a) {
|
|
865
851
|
const {
|
|
866
852
|
data: o,
|
|
867
853
|
field: h
|
|
868
|
-
} =
|
|
854
|
+
} = a, {
|
|
869
855
|
props: r,
|
|
870
856
|
events: e
|
|
871
|
-
} =
|
|
872
|
-
function i(
|
|
873
|
-
o[h] = "", e != null && e.remove && (e == null || e.remove(
|
|
857
|
+
} = l;
|
|
858
|
+
function i(Z, c) {
|
|
859
|
+
o[h] = "", e != null && e.remove && (e == null || e.remove(Z, c));
|
|
874
860
|
}
|
|
875
861
|
return [createVNode(resolveComponent("form-upload"), mergeProps({
|
|
876
862
|
record: o,
|
|
877
863
|
field: h,
|
|
878
864
|
mode: "image"
|
|
879
865
|
}, r, {
|
|
880
|
-
onRemove: (
|
|
866
|
+
onRemove: (Z, c) => i(Z, c)
|
|
881
867
|
}), null)];
|
|
882
868
|
}
|
|
883
869
|
}), VXETable.renderer.add("#tag", {
|
|
884
870
|
// 默认显示模板
|
|
885
|
-
renderTableDefault(
|
|
871
|
+
renderTableDefault(l, a) {
|
|
886
872
|
let o;
|
|
887
873
|
const {
|
|
888
874
|
row: h,
|
|
889
875
|
column: r
|
|
890
|
-
} =
|
|
876
|
+
} = a, {
|
|
891
877
|
props: {
|
|
892
878
|
code: e,
|
|
893
879
|
tagMap: i
|
|
894
880
|
}
|
|
895
|
-
} =
|
|
896
|
-
function
|
|
881
|
+
} = l;
|
|
882
|
+
function Z() {
|
|
897
883
|
return h[r.field] ? i[h[r.field]] : null;
|
|
898
884
|
}
|
|
899
885
|
return [h[r.field] ? createVNode(resolveComponent("el-tag"), {
|
|
900
886
|
effect: "dark",
|
|
901
|
-
type:
|
|
887
|
+
type: Z()
|
|
902
888
|
}, _isSlot(o = getValue(e, h[r.field])) ? o : {
|
|
903
889
|
default: () => [o]
|
|
904
890
|
}) : null];
|
|
905
891
|
}
|
|
906
892
|
}), VXETable.renderer.add("#switch", {
|
|
907
|
-
renderTableDefault(
|
|
893
|
+
renderTableDefault(l, a) {
|
|
908
894
|
const {
|
|
909
895
|
row: o,
|
|
910
896
|
column: h
|
|
911
|
-
} =
|
|
897
|
+
} = a, {
|
|
912
898
|
props: {
|
|
913
899
|
code: r,
|
|
914
900
|
activeValue: e,
|
|
915
901
|
inactiveValue: i
|
|
916
902
|
},
|
|
917
|
-
events:
|
|
918
|
-
} =
|
|
919
|
-
function
|
|
903
|
+
events: Z
|
|
904
|
+
} = l;
|
|
905
|
+
function c(t) {
|
|
920
906
|
const d = {
|
|
921
907
|
row: o,
|
|
922
908
|
column: h,
|
|
923
|
-
value:
|
|
909
|
+
value: t
|
|
924
910
|
};
|
|
925
|
-
|
|
911
|
+
Z != null && Z.change && Z.change(d);
|
|
926
912
|
}
|
|
927
913
|
return [o[h.field] ? createVNode(resolveComponent("el-switch"), mergeProps({
|
|
928
914
|
modelValue: o[h.field],
|
|
929
|
-
"onUpdate:modelValue": (
|
|
915
|
+
"onUpdate:modelValue": (t) => o[h.field] = t,
|
|
930
916
|
"inline-prompt": !0,
|
|
931
917
|
size: "large",
|
|
932
918
|
style: "--el-switch-on-color: #13ce66; --el-switch-off-color: #E6A23C"
|
|
933
|
-
},
|
|
919
|
+
}, l.props, {
|
|
934
920
|
"active-text": getValue(r, e),
|
|
935
921
|
"inactive-text": getValue(r, i),
|
|
936
|
-
onChange: (
|
|
922
|
+
onChange: (t) => c(t)
|
|
937
923
|
}), null) : null];
|
|
938
924
|
}
|
|
939
925
|
}), VXETable.renderer.add("#iconSelect", {
|
|
940
|
-
renderTableEdit(
|
|
926
|
+
renderTableEdit(l, a) {
|
|
941
927
|
const {
|
|
942
928
|
row: o,
|
|
943
929
|
column: h
|
|
944
|
-
} =
|
|
930
|
+
} = a;
|
|
945
931
|
return [createVNode(resolveComponent("SuIconSelect"), {
|
|
946
932
|
modelValue: o[h.field],
|
|
947
933
|
"onUpdate:modelValue": (r) => o[h.field] = r,
|
|
948
934
|
teleported: !1
|
|
949
935
|
}, null)];
|
|
950
936
|
},
|
|
951
|
-
renderTableCell(
|
|
937
|
+
renderTableCell(l, a) {
|
|
952
938
|
const {
|
|
953
939
|
row: o,
|
|
954
940
|
column: h
|
|
955
|
-
} =
|
|
941
|
+
} = a;
|
|
956
942
|
return [createVNode(resolveComponent("IconifyIconOffline"), {
|
|
957
943
|
icon: o[h.field],
|
|
958
944
|
style: "font-size: 16px;"
|
|
959
945
|
}, null)];
|
|
960
946
|
},
|
|
961
|
-
renderItemContent(
|
|
947
|
+
renderItemContent(l, a) {
|
|
962
948
|
const {
|
|
963
949
|
data: o,
|
|
964
950
|
field: h
|
|
965
|
-
} =
|
|
951
|
+
} = a;
|
|
966
952
|
return [createVNode(resolveComponent("SuIconSelect"), {
|
|
967
953
|
modelValue: o[h],
|
|
968
954
|
"onUpdate:modelValue": (r) => o[h] = r,
|
|
@@ -970,399 +956,405 @@ const VxetableRender = (VXETable, {
|
|
|
970
956
|
}, null)];
|
|
971
957
|
}
|
|
972
958
|
}), VXETable.renderer.add("#treeSelect", {
|
|
973
|
-
renderTableEdit(
|
|
959
|
+
renderTableEdit(l, a) {
|
|
974
960
|
const {
|
|
975
961
|
row: o,
|
|
976
962
|
column: h
|
|
977
|
-
} =
|
|
963
|
+
} = a, {
|
|
978
964
|
props: r,
|
|
979
965
|
sourceData: e,
|
|
980
966
|
events: i
|
|
981
|
-
} =
|
|
967
|
+
} = l;
|
|
982
968
|
return [createVNode(resolveComponent("el-tree-select"), mergeProps({
|
|
983
969
|
modelValue: o[h.field],
|
|
984
|
-
"onUpdate:modelValue": (
|
|
970
|
+
"onUpdate:modelValue": (Z) => o[h.field] = Z,
|
|
985
971
|
data: e,
|
|
986
972
|
"check-strictly": !0
|
|
987
973
|
}, r, {
|
|
988
974
|
filterable: !0,
|
|
989
|
-
onCheckChange: (
|
|
990
|
-
onNodeClick: (
|
|
991
|
-
onCurrentChange: (
|
|
975
|
+
onCheckChange: (Z, c, t) => onCheckChange(Z, c, t, i),
|
|
976
|
+
onNodeClick: (Z, c, t) => onNodeClick(Z, c, t, i),
|
|
977
|
+
onCurrentChange: (Z, c) => onCurrentChange(Z, c, i)
|
|
992
978
|
}), null)];
|
|
993
979
|
},
|
|
994
|
-
renderTableCell(
|
|
980
|
+
renderTableCell(l, a) {
|
|
995
981
|
const {
|
|
996
982
|
row: o,
|
|
997
983
|
column: h
|
|
998
|
-
} =
|
|
984
|
+
} = a, {
|
|
999
985
|
sourceData: r,
|
|
1000
986
|
props: e = {}
|
|
1001
|
-
} =
|
|
987
|
+
} = l, {
|
|
1002
988
|
children: i = "children",
|
|
1003
|
-
label:
|
|
1004
|
-
} = e,
|
|
989
|
+
label: Z = "label"
|
|
990
|
+
} = e, c = findTree(r, (t) => t.value === o[h.field], {
|
|
1005
991
|
children: i
|
|
1006
992
|
});
|
|
1007
|
-
return
|
|
993
|
+
return c ? [createVNode("span", null, [c.item[Z]])] : null;
|
|
1008
994
|
},
|
|
1009
|
-
renderItemContent(
|
|
995
|
+
renderItemContent(l, a) {
|
|
1010
996
|
const {
|
|
1011
997
|
data: o,
|
|
1012
998
|
field: h
|
|
1013
|
-
} =
|
|
999
|
+
} = a, {
|
|
1014
1000
|
props: r,
|
|
1015
1001
|
sourceData: e,
|
|
1016
1002
|
events: i
|
|
1017
|
-
} =
|
|
1003
|
+
} = l;
|
|
1018
1004
|
return [createVNode(resolveComponent("el-tree-select"), mergeProps({
|
|
1019
1005
|
modelValue: o[h],
|
|
1020
|
-
"onUpdate:modelValue": (
|
|
1006
|
+
"onUpdate:modelValue": (Z) => o[h] = Z,
|
|
1021
1007
|
data: e,
|
|
1022
1008
|
"check-strictly": !0
|
|
1023
1009
|
}, r, {
|
|
1024
1010
|
filterable: !0,
|
|
1025
|
-
onCheckChange: (
|
|
1026
|
-
onNodeClick: (
|
|
1027
|
-
onCurrentChange: (
|
|
1011
|
+
onCheckChange: (Z, c, t) => onCheckChange(Z, c, t, i),
|
|
1012
|
+
onNodeClick: (Z, c, t) => onNodeClick(Z, c, t, i),
|
|
1013
|
+
onCurrentChange: (Z, c) => onCurrentChange(Z, c, i)
|
|
1028
1014
|
}), null)];
|
|
1029
1015
|
}
|
|
1030
1016
|
});
|
|
1031
1017
|
const useComponent = () => ({
|
|
1032
|
-
clear: (r, e, i,
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1018
|
+
clear: (r, e, i, Z) => {
|
|
1019
|
+
const {
|
|
1020
|
+
props: c,
|
|
1021
|
+
events: t
|
|
1022
|
+
} = i, {
|
|
1023
|
+
mapField: d
|
|
1024
|
+
} = c;
|
|
1025
|
+
if (r[e] = null, c != null && c.multiple && (r[`_${e}`] = []), !isEmpty(d))
|
|
1026
|
+
for (const f in d)
|
|
1027
|
+
r[f] = null;
|
|
1036
1028
|
t != null && t.clear && t.clear({
|
|
1037
|
-
[
|
|
1029
|
+
[Z]: r,
|
|
1038
1030
|
field: e
|
|
1039
1031
|
});
|
|
1040
1032
|
},
|
|
1041
1033
|
remote: async (r, e, i) => {
|
|
1042
1034
|
const {
|
|
1043
|
-
options:
|
|
1044
|
-
props:
|
|
1045
|
-
events:
|
|
1035
|
+
options: Z,
|
|
1036
|
+
props: c,
|
|
1037
|
+
events: t
|
|
1046
1038
|
} = i, {
|
|
1047
1039
|
fetchField: d,
|
|
1048
|
-
url:
|
|
1049
|
-
defaultParams:
|
|
1050
|
-
method:
|
|
1051
|
-
} =
|
|
1040
|
+
url: f,
|
|
1041
|
+
defaultParams: n = {},
|
|
1042
|
+
method: m = "get"
|
|
1043
|
+
} = c, b = getCookieParam(), M = Object.assign({
|
|
1052
1044
|
pageSize: 20,
|
|
1053
1045
|
pageNum: 1,
|
|
1054
|
-
...
|
|
1055
|
-
...
|
|
1046
|
+
...b,
|
|
1047
|
+
...n
|
|
1056
1048
|
}, {
|
|
1057
1049
|
[d || e]: r
|
|
1058
1050
|
});
|
|
1059
|
-
if (
|
|
1060
|
-
let
|
|
1051
|
+
if (c.loading) return;
|
|
1052
|
+
let V;
|
|
1061
1053
|
try {
|
|
1062
|
-
|
|
1054
|
+
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
1055
|
} finally {
|
|
1064
|
-
|
|
1056
|
+
c.loading = !1;
|
|
1065
1057
|
}
|
|
1066
1058
|
},
|
|
1067
|
-
selectChange: (r, e, i,
|
|
1068
|
-
let
|
|
1059
|
+
selectChange: (r, e, i, Z, c) => {
|
|
1060
|
+
let t = null;
|
|
1069
1061
|
const {
|
|
1070
1062
|
datasource: d
|
|
1071
|
-
} =
|
|
1072
|
-
options:
|
|
1073
|
-
props:
|
|
1074
|
-
optionProps:
|
|
1075
|
-
events:
|
|
1076
|
-
} =
|
|
1063
|
+
} = c, {
|
|
1064
|
+
options: f,
|
|
1065
|
+
props: n,
|
|
1066
|
+
optionProps: m = {},
|
|
1067
|
+
events: b
|
|
1068
|
+
} = Z, M = {
|
|
1077
1069
|
[d]: e,
|
|
1078
1070
|
field: i
|
|
1079
1071
|
};
|
|
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
|
-
}),
|
|
1072
|
+
e[i] = null, !isEmpty(r) && (n != null && n.multiple) ? (e[i] = r.join(","), t = [], r.forEach((V) => {
|
|
1073
|
+
const p = f.find((L) => V === L[m == null ? void 0 : m.value]);
|
|
1074
|
+
p && !isEmpty(n.mapField) && isObject(n.mapField) && Object.keys(n.mapField).forEach((L) => {
|
|
1075
|
+
const k = p[n.mapField[L]], y = e[L] ? e[L].toString() : "";
|
|
1076
|
+
e[L] = y && !y.includes(k) ? `${y},${k}` : k;
|
|
1077
|
+
}), p && t.push(p);
|
|
1078
|
+
}), Object.assign(M, {
|
|
1079
|
+
options: t
|
|
1080
|
+
})) : (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) => {
|
|
1081
|
+
e[V] = t ? t[n.mapField[V]] : null;
|
|
1082
|
+
}), Object.assign(M, {
|
|
1083
|
+
option: t
|
|
1084
|
+
})), d === "row" && Object.assign(M, {
|
|
1085
|
+
column: c.column
|
|
1086
|
+
}), b != null && b.change && b.change(M);
|
|
1095
1087
|
},
|
|
1096
1088
|
setDefaultValue: (r, e, i) => {
|
|
1097
1089
|
var d;
|
|
1098
1090
|
const {
|
|
1099
|
-
multiple:
|
|
1100
|
-
defaultValue:
|
|
1101
|
-
} = r,
|
|
1102
|
-
!e[i] &&
|
|
1103
|
-
e[
|
|
1104
|
-
})), !e[
|
|
1091
|
+
multiple: Z,
|
|
1092
|
+
defaultValue: c
|
|
1093
|
+
} = r, t = Z ? `_${i}` : i;
|
|
1094
|
+
!e[i] && c && (e[i] = c, isPlainObject(c) && Object.keys(c).forEach((n) => {
|
|
1095
|
+
e[n] = e[n] || c[n];
|
|
1096
|
+
})), !e[t] && e[i] && (e[t] = Z ? (d = e[i]) == null ? void 0 : d.split(",") : e[i]);
|
|
1105
1097
|
}
|
|
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(
|
|
1098
|
+
}), onCheckChange = (l, a, o, h) => {
|
|
1099
|
+
console.log(l, a, o), h != null && h.checkChange && (h == null || h.checkChange(l, a, o));
|
|
1100
|
+
}, onNodeClick = (l, a, o, h) => {
|
|
1101
|
+
h != null && h.checkChange && (h == null || h.checkChange(l, a, o));
|
|
1102
|
+
}, onCurrentChange = (l, a, o) => {
|
|
1103
|
+
o != null && o.checkChange && (o == null || o.checkChange(l, a));
|
|
1112
1104
|
};
|
|
1113
|
-
function getValue(
|
|
1105
|
+
function getValue(l, a) {
|
|
1114
1106
|
var o, h, r;
|
|
1115
|
-
return !
|
|
1107
|
+
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
1108
|
}
|
|
1117
1109
|
return VXETable;
|
|
1118
1110
|
}, getCookieParam = () => {
|
|
1119
|
-
const
|
|
1120
|
-
return cookies.get(
|
|
1121
|
-
}, hasClass = (
|
|
1111
|
+
const l = "kCookies_param";
|
|
1112
|
+
return cookies.get(l) ? JSON.parse(cookies.get(l)) : {};
|
|
1113
|
+
}, hasClass = (l, a) => {
|
|
1122
1114
|
var o;
|
|
1123
|
-
return !!((o =
|
|
1124
|
-
}, addClass = (
|
|
1125
|
-
hasClass(
|
|
1126
|
-
}, removeClass = (
|
|
1115
|
+
return !!((o = l.className) != null && o.match(new RegExp("(\\s|^)" + a + "(\\s|$)")));
|
|
1116
|
+
}, addClass = (l, a, o) => {
|
|
1117
|
+
hasClass(l, a) || (l.className += " " + a), o && (hasClass(l, o) || (l.className += " " + o));
|
|
1118
|
+
}, removeClass = (l, a, o) => {
|
|
1127
1119
|
var h, r;
|
|
1128
|
-
if (hasClass(
|
|
1129
|
-
const e = new RegExp("(\\s|^)" +
|
|
1130
|
-
|
|
1120
|
+
if (hasClass(l, a)) {
|
|
1121
|
+
const e = new RegExp("(\\s|^)" + a + "(\\s|$)");
|
|
1122
|
+
l.className = (h = l.className) == null ? void 0 : h.replace(e, " ").trim();
|
|
1131
1123
|
}
|
|
1132
|
-
if (o && hasClass(
|
|
1124
|
+
if (o && hasClass(l, o)) {
|
|
1133
1125
|
const e = new RegExp("(\\s|^)" + o + "(\\s|$)");
|
|
1134
|
-
|
|
1126
|
+
l.className = (r = l.className) == null ? void 0 : r.replace(e, " ").trim();
|
|
1135
1127
|
}
|
|
1136
|
-
}, toggleClass = (
|
|
1128
|
+
}, toggleClass = (l, a, o) => {
|
|
1137
1129
|
const h = o || document.body;
|
|
1138
1130
|
let { className: r } = h;
|
|
1139
|
-
r = r == null ? void 0 : r.replace(
|
|
1131
|
+
r = r == null ? void 0 : r.replace(a, ""), h.className = r && l ? `${r} ${a} ` : r;
|
|
1140
1132
|
};
|
|
1141
|
-
function useRafThrottle(
|
|
1142
|
-
let
|
|
1133
|
+
function useRafThrottle(l) {
|
|
1134
|
+
let a = !1;
|
|
1143
1135
|
return function(...o) {
|
|
1144
|
-
|
|
1145
|
-
|
|
1136
|
+
a || (a = !0, window.requestAnimationFrame(() => {
|
|
1137
|
+
l.apply(this, o), a = !1;
|
|
1146
1138
|
}));
|
|
1147
1139
|
};
|
|
1148
1140
|
}
|
|
1149
|
-
const openLink = (
|
|
1150
|
-
const
|
|
1151
|
-
|
|
1152
|
-
}, isServer = typeof window > "u", resizeHandler = (
|
|
1153
|
-
for (const
|
|
1154
|
-
const o =
|
|
1141
|
+
const openLink = (l) => {
|
|
1142
|
+
const a = document.createElement("a");
|
|
1143
|
+
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();
|
|
1144
|
+
}, isServer = typeof window > "u", resizeHandler = (l) => {
|
|
1145
|
+
for (const a of l) {
|
|
1146
|
+
const o = a.target.__resizeListeners__ || [];
|
|
1155
1147
|
o.length && o.forEach((h) => {
|
|
1156
1148
|
h();
|
|
1157
1149
|
});
|
|
1158
1150
|
}
|
|
1159
|
-
}, addResizeListener = (
|
|
1160
|
-
isServer || (
|
|
1161
|
-
}, removeResizeListener = (
|
|
1162
|
-
!
|
|
1163
|
-
|
|
1151
|
+
}, addResizeListener = (l, a) => {
|
|
1152
|
+
isServer || (l.__resizeListeners__ || (l.__resizeListeners__ = [], l.__ro__ = new ResizeObserver(resizeHandler), l.__ro__.observe(l)), l.__resizeListeners__.push(a));
|
|
1153
|
+
}, removeResizeListener = (l, a) => {
|
|
1154
|
+
!l || !l.__resizeListeners__ || (l.__resizeListeners__.splice(
|
|
1155
|
+
l.__resizeListeners__.indexOf(a),
|
|
1164
1156
|
1
|
|
1165
|
-
),
|
|
1157
|
+
), l.__resizeListeners__.length || l.__ro__.disconnect());
|
|
1166
1158
|
}, domSymbol = Symbol("watermark-dom");
|
|
1167
|
-
function useWatermark(
|
|
1168
|
-
const
|
|
1169
|
-
const
|
|
1170
|
-
if (!
|
|
1171
|
-
const { clientHeight: d, clientWidth:
|
|
1172
|
-
i({ height: d, width:
|
|
1159
|
+
function useWatermark(l = ref(document.body)) {
|
|
1160
|
+
const a = useRafThrottle(function() {
|
|
1161
|
+
const t = unref(l);
|
|
1162
|
+
if (!t) return;
|
|
1163
|
+
const { clientHeight: d, clientWidth: f } = t;
|
|
1164
|
+
i({ height: d, width: f });
|
|
1173
1165
|
}), o = domSymbol.toString(), h = shallowRef(), r = () => {
|
|
1174
|
-
const
|
|
1166
|
+
const t = unref(h);
|
|
1175
1167
|
h.value = void 0;
|
|
1176
|
-
const d = unref(
|
|
1177
|
-
d && (
|
|
1168
|
+
const d = unref(l);
|
|
1169
|
+
d && (t && d.removeChild(t), removeResizeListener(d, a));
|
|
1178
1170
|
};
|
|
1179
|
-
function e(
|
|
1180
|
-
const
|
|
1181
|
-
Object.assign(
|
|
1182
|
-
const
|
|
1183
|
-
return
|
|
1171
|
+
function e(t, d) {
|
|
1172
|
+
const f = document.createElement("canvas"), n = 260, m = 180;
|
|
1173
|
+
Object.assign(f, { width: n, height: m });
|
|
1174
|
+
const b = f.getContext("2d");
|
|
1175
|
+
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
1176
|
}
|
|
1185
|
-
function i(
|
|
1177
|
+
function i(t = {}) {
|
|
1186
1178
|
const d = unref(h);
|
|
1187
|
-
d && (isUndefined(
|
|
1188
|
-
|
|
1189
|
-
|
|
1179
|
+
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(
|
|
1180
|
+
t.str,
|
|
1181
|
+
t.attr
|
|
1190
1182
|
)}) left top repeat`));
|
|
1191
1183
|
}
|
|
1192
|
-
const
|
|
1184
|
+
const Z = (t, d) => {
|
|
1193
1185
|
if (unref(h))
|
|
1194
|
-
return i({ str:
|
|
1195
|
-
const
|
|
1196
|
-
h.value =
|
|
1197
|
-
const
|
|
1198
|
-
if (!
|
|
1199
|
-
const { clientHeight:
|
|
1200
|
-
return i({ str:
|
|
1186
|
+
return i({ str: t, attr: d }), o;
|
|
1187
|
+
const f = document.createElement("div");
|
|
1188
|
+
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";
|
|
1189
|
+
const n = unref(l);
|
|
1190
|
+
if (!n) return o;
|
|
1191
|
+
const { clientHeight: m, clientWidth: b } = n;
|
|
1192
|
+
return i({ str: t, width: b, height: m, attr: d }), n.appendChild(f), o;
|
|
1201
1193
|
};
|
|
1202
|
-
function
|
|
1203
|
-
t
|
|
1194
|
+
function c(t, d) {
|
|
1195
|
+
Z(t, d), addResizeListener(document.documentElement, a), getCurrentInstance() && onBeforeUnmount(() => {
|
|
1204
1196
|
r();
|
|
1205
1197
|
});
|
|
1206
1198
|
}
|
|
1207
|
-
return { setWatermark:
|
|
1199
|
+
return { setWatermark: c, clear: r };
|
|
1208
1200
|
}
|
|
1209
1201
|
const DEFAULT_EXCLUDE_KEYS = ["class", "style"], LISTENER_PREFIX = /^on[A-Z]/;
|
|
1210
|
-
function entries(
|
|
1211
|
-
return Object.keys(
|
|
1202
|
+
function entries(l) {
|
|
1203
|
+
return Object.keys(l).map((a) => [a, l[a]]);
|
|
1212
1204
|
}
|
|
1213
|
-
function useAttrs(
|
|
1214
|
-
const
|
|
1215
|
-
if (!
|
|
1216
|
-
const { excludeListeners: o = !1, excludeKeys: h = [] } =
|
|
1217
|
-
return
|
|
1218
|
-
const i = entries(
|
|
1205
|
+
function useAttrs(l = {}) {
|
|
1206
|
+
const a = getCurrentInstance();
|
|
1207
|
+
if (!a) return {};
|
|
1208
|
+
const { excludeListeners: o = !1, excludeKeys: h = [] } = l, r = shallowRef({}), e = h.concat(DEFAULT_EXCLUDE_KEYS);
|
|
1209
|
+
return a.attrs = reactive(a.attrs), watchEffect(() => {
|
|
1210
|
+
const i = entries(a.attrs).reduce((Z, [c, t]) => (!e.includes(c) && !(o && LISTENER_PREFIX.test(c)) && (Z[c] = t), Z), {});
|
|
1219
1211
|
r.value = i;
|
|
1220
1212
|
}), r;
|
|
1221
1213
|
}
|
|
1222
1214
|
const i18n = window.$i18n, useRender = () => {
|
|
1223
|
-
const
|
|
1224
|
-
var
|
|
1215
|
+
const l = { value: "dictCode", label: "dictName" }, a = (v, u) => {
|
|
1216
|
+
var F;
|
|
1225
1217
|
const H = w(u);
|
|
1226
|
-
let
|
|
1218
|
+
let s = {
|
|
1227
1219
|
clearable: !0,
|
|
1228
1220
|
disabled: !1,
|
|
1229
1221
|
showValue: !1,
|
|
1230
1222
|
placeholder: null
|
|
1231
|
-
},
|
|
1232
|
-
isObject(
|
|
1233
|
-
const I = (
|
|
1223
|
+
}, A, S;
|
|
1224
|
+
isObject(v) ? (s = Object.assign(s, v), A = v.defaultValue, S = v == null ? void 0 : v.code) : S = v;
|
|
1225
|
+
const I = (F = storageLocal.getItem("kLov")[S]) == null ? void 0 : F.children, N = I ? I.filter((E) => E.enabled === "1") : [];
|
|
1234
1226
|
return {
|
|
1235
1227
|
name: "#select",
|
|
1236
|
-
optionProps:
|
|
1237
|
-
options:
|
|
1238
|
-
props:
|
|
1239
|
-
defaultValue:
|
|
1228
|
+
optionProps: l,
|
|
1229
|
+
options: N,
|
|
1230
|
+
props: s,
|
|
1231
|
+
defaultValue: A,
|
|
1240
1232
|
events: H
|
|
1241
1233
|
};
|
|
1242
|
-
}, o = (
|
|
1234
|
+
}, o = (v, u) => {
|
|
1243
1235
|
const H = w(u);
|
|
1244
1236
|
return {
|
|
1245
1237
|
name: "#SuSelect",
|
|
1246
|
-
optionProps: (
|
|
1247
|
-
props:
|
|
1248
|
-
options: (
|
|
1238
|
+
optionProps: (v == null ? void 0 : v.optionProps) || { label: "label", value: "value" },
|
|
1239
|
+
props: v == null ? void 0 : v.props,
|
|
1240
|
+
options: (v == null ? void 0 : v.options) || [],
|
|
1249
1241
|
events: H
|
|
1250
1242
|
};
|
|
1251
|
-
}, h = (
|
|
1243
|
+
}, h = (v, u) => {
|
|
1252
1244
|
const H = {
|
|
1253
1245
|
optionProps: { extLabel: "userName", value: "employeeName" },
|
|
1254
1246
|
props: {
|
|
1255
|
-
attrs: { disabled:
|
|
1256
|
-
disabled:
|
|
1257
|
-
defaultValue:
|
|
1258
|
-
mapField:
|
|
1247
|
+
attrs: { disabled: v == null ? void 0 : v.disabled },
|
|
1248
|
+
disabled: v == null ? void 0 : v.disabled,
|
|
1249
|
+
defaultValue: v == null ? void 0 : v.defaultValue,
|
|
1250
|
+
mapField: v == null ? void 0 : v.mapField,
|
|
1259
1251
|
url: "/uums/employee/listEmployeeIsUser",
|
|
1260
1252
|
fetchField: "employeeName"
|
|
1261
1253
|
}
|
|
1262
1254
|
};
|
|
1263
1255
|
return o(H, u);
|
|
1264
|
-
}, r = (
|
|
1256
|
+
}, r = (v) => {
|
|
1265
1257
|
const u = {
|
|
1266
1258
|
optionProps: { label: "userName", value: "userName" },
|
|
1267
1259
|
props: {
|
|
1268
1260
|
code: "sys/listUsers",
|
|
1269
1261
|
url: "/uums/user",
|
|
1270
1262
|
fetchField: "name",
|
|
1271
|
-
mapField:
|
|
1263
|
+
mapField: v == null ? void 0 : v.mapField
|
|
1272
1264
|
}
|
|
1273
1265
|
};
|
|
1274
1266
|
return o(u);
|
|
1275
|
-
}, e = (
|
|
1267
|
+
}, e = (v, u) => {
|
|
1276
1268
|
const H = {
|
|
1277
1269
|
label: "organizationName",
|
|
1278
|
-
value: (
|
|
1279
|
-
},
|
|
1270
|
+
value: (v == null ? void 0 : v.field) || "organizationName"
|
|
1271
|
+
}, s = {
|
|
1280
1272
|
mapField: {},
|
|
1281
|
-
defaultParams:
|
|
1282
|
-
disabled:
|
|
1273
|
+
defaultParams: v == null ? void 0 : v.defaultParams,
|
|
1274
|
+
disabled: v == null ? void 0 : v.disabled,
|
|
1283
1275
|
url: "/uums/cusOrganization",
|
|
1284
1276
|
fetchField: "organizationName"
|
|
1285
|
-
},
|
|
1277
|
+
}, A = {
|
|
1286
1278
|
organizationId: "id",
|
|
1287
1279
|
organizationCode: "organizationCode"
|
|
1288
1280
|
};
|
|
1289
|
-
return Object.assign(
|
|
1281
|
+
return Object.assign(s.mapField, A, (v == null ? void 0 : v.mapField) || {}), {
|
|
1290
1282
|
name: "#SuSelect",
|
|
1291
|
-
props:
|
|
1283
|
+
props: s,
|
|
1292
1284
|
optionProps: H,
|
|
1293
1285
|
options: [],
|
|
1294
1286
|
events: w(u)
|
|
1295
1287
|
};
|
|
1296
|
-
}, i = (
|
|
1288
|
+
}, i = (v, u) => {
|
|
1297
1289
|
const H = {
|
|
1298
1290
|
label: "orgName",
|
|
1299
|
-
value: (
|
|
1300
|
-
},
|
|
1291
|
+
value: (v == null ? void 0 : v.field) || "orgName"
|
|
1292
|
+
}, s = {
|
|
1301
1293
|
mapField: {},
|
|
1302
|
-
disabled:
|
|
1303
|
-
defaultParams:
|
|
1294
|
+
disabled: v == null ? void 0 : v.disabled,
|
|
1295
|
+
defaultParams: v == null ? void 0 : v.defaultParams,
|
|
1304
1296
|
url: "/uums/org",
|
|
1305
1297
|
fetchField: "orgName"
|
|
1306
|
-
},
|
|
1307
|
-
return Object.assign(
|
|
1298
|
+
}, A = { orgId: "id", orgCode: "orgCode" };
|
|
1299
|
+
return Object.assign(s.mapField, A, (v == null ? void 0 : v.mapField) || {}), {
|
|
1308
1300
|
name: "#SuSelect",
|
|
1309
|
-
props:
|
|
1301
|
+
props: s,
|
|
1310
1302
|
optionProps: H,
|
|
1311
1303
|
options: [],
|
|
1312
1304
|
events: w(u)
|
|
1313
1305
|
};
|
|
1314
|
-
},
|
|
1315
|
-
const H = Object.assign({ disabled: !1 },
|
|
1306
|
+
}, Z = (v, u) => {
|
|
1307
|
+
const H = Object.assign({ disabled: !1 }, v), s = H == null ? void 0 : H.defaultValue;
|
|
1316
1308
|
return {
|
|
1317
1309
|
name: "VxeInput",
|
|
1318
1310
|
props: H,
|
|
1319
|
-
defaultValue:
|
|
1311
|
+
defaultValue: s,
|
|
1320
1312
|
events: w(u)
|
|
1321
1313
|
};
|
|
1322
|
-
},
|
|
1323
|
-
const H = Object.assign({ disabled: !1, rows: 3 },
|
|
1314
|
+
}, c = (v, u) => {
|
|
1315
|
+
const H = Object.assign({ disabled: !1, rows: 3 }, v), s = H == null ? void 0 : H.defaultValue;
|
|
1324
1316
|
return {
|
|
1325
1317
|
name: "VxeTextarea",
|
|
1326
1318
|
props: H,
|
|
1327
|
-
defaultValue:
|
|
1319
|
+
defaultValue: s,
|
|
1328
1320
|
events: w(u)
|
|
1329
1321
|
};
|
|
1330
|
-
},
|
|
1331
|
-
const H = "VxeCheckboxGroup", { defaultValue:
|
|
1332
|
-
return { name: H, defaultValue:
|
|
1333
|
-
}, d = (
|
|
1334
|
-
const H = "VxeRadioGroup", { defaultValue:
|
|
1335
|
-
return { name: H, defaultValue:
|
|
1336
|
-
},
|
|
1322
|
+
}, t = (v, u) => {
|
|
1323
|
+
const H = "VxeCheckboxGroup", { defaultValue: s, options: A, props: S } = f(v);
|
|
1324
|
+
return { name: H, defaultValue: s, options: A, props: S, events: w(u) };
|
|
1325
|
+
}, d = (v, u) => {
|
|
1326
|
+
const H = "VxeRadioGroup", { defaultValue: s, options: A, props: S } = f(v);
|
|
1327
|
+
return { name: H, defaultValue: s, options: A, props: S, events: w(u) };
|
|
1328
|
+
}, f = (v) => {
|
|
1337
1329
|
var I;
|
|
1338
1330
|
let u = { disabled: !1 }, H;
|
|
1339
|
-
const
|
|
1340
|
-
let
|
|
1341
|
-
isObject(
|
|
1342
|
-
const S =
|
|
1331
|
+
const s = storageLocal.getItem("kLov");
|
|
1332
|
+
let A = "";
|
|
1333
|
+
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);
|
|
1334
|
+
const S = A ? (I = s[A]) == null ? void 0 : I.children.map((N) => ({ label: N.dictName, value: N.dictCode })) : [];
|
|
1343
1335
|
return {
|
|
1344
1336
|
props: u,
|
|
1345
1337
|
defaultValue: H,
|
|
1346
|
-
options: isObject(
|
|
1338
|
+
options: isObject(v) && v.options ? v.options : S
|
|
1347
1339
|
};
|
|
1348
|
-
},
|
|
1340
|
+
}, n = (v, u) => {
|
|
1349
1341
|
const H = w(u);
|
|
1350
1342
|
return {
|
|
1351
1343
|
name: "VxeNumberInput",
|
|
1352
1344
|
props: Object.assign(
|
|
1353
1345
|
{ type: "number", clearable: !0, min: 0, controls: !1 },
|
|
1354
|
-
|
|
1346
|
+
v || {}
|
|
1355
1347
|
),
|
|
1356
|
-
defaultValue:
|
|
1348
|
+
defaultValue: v == null ? void 0 : v.defaultValue,
|
|
1357
1349
|
events: H
|
|
1358
1350
|
};
|
|
1359
|
-
},
|
|
1360
|
-
const H = w(u),
|
|
1361
|
-
return { name: "VxeDatePicker", props: Object.assign({ type: "date", valueFormat:
|
|
1362
|
-
},
|
|
1363
|
-
const H = w(u),
|
|
1351
|
+
}, m = (v, u) => {
|
|
1352
|
+
const H = w(u), s = "yyyy-MM-dd HH:mm:ss", A = v == null ? void 0 : v.defaultValue;
|
|
1353
|
+
return { name: "VxeDatePicker", props: Object.assign({ type: "date", valueFormat: s, clearable: !0 }, v || {}), defaultValue: A, events: H };
|
|
1354
|
+
}, b = (v, u) => {
|
|
1355
|
+
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
1356
|
type: "date",
|
|
1365
|
-
valueFormat:
|
|
1357
|
+
valueFormat: s,
|
|
1366
1358
|
clearable: !0,
|
|
1367
1359
|
shortcutConfig: {
|
|
1368
1360
|
enabled: !0,
|
|
@@ -1393,49 +1385,49 @@ const i18n = window.$i18n, useRender = () => {
|
|
|
1393
1385
|
},
|
|
1394
1386
|
{
|
|
1395
1387
|
code: "utRecentYear",
|
|
1396
|
-
content: i18n ? i18n("message.udp.anniversary") : "
|
|
1388
|
+
content: i18n ? i18n("message.udp.anniversary") : "最近一年"
|
|
1397
1389
|
}
|
|
1398
1390
|
]
|
|
1399
1391
|
}
|
|
1400
|
-
}, E = Object.assign(
|
|
1392
|
+
}, E = Object.assign(F, v || {});
|
|
1401
1393
|
return {
|
|
1402
1394
|
name: "VxeDateRangePicker",
|
|
1403
1395
|
startField: I,
|
|
1404
|
-
endField:
|
|
1405
|
-
startValue:
|
|
1396
|
+
endField: N,
|
|
1397
|
+
startValue: A,
|
|
1406
1398
|
endValue: S,
|
|
1407
1399
|
props: E,
|
|
1408
1400
|
events: H
|
|
1409
1401
|
};
|
|
1410
|
-
},
|
|
1402
|
+
}, M = (v, u) => {
|
|
1411
1403
|
const H = w(u);
|
|
1412
|
-
return { name: "#lov", props: Object.assign({},
|
|
1413
|
-
},
|
|
1414
|
-
const H = w(u),
|
|
1404
|
+
return { name: "#lov", props: Object.assign({}, v || {}), events: H };
|
|
1405
|
+
}, V = (v, u) => {
|
|
1406
|
+
const H = w(u), s = (v == null ? void 0 : v.optionProps) || {
|
|
1415
1407
|
label: "label",
|
|
1416
1408
|
value: "value"
|
|
1417
|
-
},
|
|
1409
|
+
}, A = Object.assign(
|
|
1418
1410
|
{ clearable: !0, disabled: !1, showValue: !1 },
|
|
1419
|
-
|
|
1411
|
+
v || {}
|
|
1420
1412
|
);
|
|
1421
1413
|
return console.log("itemRender"), {
|
|
1422
1414
|
name: "#select",
|
|
1423
|
-
optionProps:
|
|
1424
|
-
options: (
|
|
1425
|
-
props:
|
|
1415
|
+
optionProps: s,
|
|
1416
|
+
options: (v == null ? void 0 : v.options) || [],
|
|
1417
|
+
props: A,
|
|
1426
1418
|
events: H
|
|
1427
1419
|
};
|
|
1428
|
-
}, p = (
|
|
1420
|
+
}, p = (v, u) => {
|
|
1429
1421
|
let H = {
|
|
1430
1422
|
openLabel: "是",
|
|
1431
1423
|
closeLabel: "否",
|
|
1432
1424
|
openValue: "Y",
|
|
1433
1425
|
closeValue: "N"
|
|
1434
|
-
},
|
|
1435
|
-
isObject(
|
|
1436
|
-
const
|
|
1437
|
-
return { name: "VxeSwitch", props: H, defaultValue:
|
|
1438
|
-
},
|
|
1426
|
+
}, s = "Y";
|
|
1427
|
+
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 }));
|
|
1428
|
+
const A = isFunction(v) ? w(v) : w(u);
|
|
1429
|
+
return { name: "VxeSwitch", props: H, defaultValue: s, events: A };
|
|
1430
|
+
}, L = (v, u) => ({ name: "#tag", props: { code: v, tagMap: u } }), k = (v, u) => {
|
|
1439
1431
|
const H = {
|
|
1440
1432
|
openLabel: "启用",
|
|
1441
1433
|
closeLabel: "禁用",
|
|
@@ -1443,144 +1435,144 @@ const i18n = window.$i18n, useRender = () => {
|
|
|
1443
1435
|
closeValue: "0",
|
|
1444
1436
|
defaultValue: "1"
|
|
1445
1437
|
};
|
|
1446
|
-
!isFunction(
|
|
1447
|
-
const
|
|
1448
|
-
return p(H,
|
|
1449
|
-
},
|
|
1438
|
+
!isFunction(v) && isObject(v) && Object.assign(H, v);
|
|
1439
|
+
const s = isFunction(v) ? v : u;
|
|
1440
|
+
return p(H, s);
|
|
1441
|
+
}, y = () => ({ name: "#iconSelect" }), C = (v = [], u = {}, H) => ({ name: "#treeSelect", sourceData: v, props: u, events: H }), T = (v, u) => {
|
|
1450
1442
|
const H = w(u);
|
|
1451
1443
|
return {
|
|
1452
1444
|
name: "#area",
|
|
1453
|
-
props: { mapField: (
|
|
1445
|
+
props: { mapField: (v == null ? void 0 : v.mapField) || ["province", "city", "region"] },
|
|
1454
1446
|
events: H
|
|
1455
1447
|
};
|
|
1456
|
-
}, w = (
|
|
1448
|
+
}, w = (v) => {
|
|
1457
1449
|
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(
|
|
1450
|
+
return isObject(v) && !isFunction(v) ? u = {
|
|
1451
|
+
change: (v == null ? void 0 : v.change) || D,
|
|
1452
|
+
blur: (v == null ? void 0 : v.blur) || D,
|
|
1453
|
+
focus: (v == null ? void 0 : v.focus) || D,
|
|
1454
|
+
input: (v == null ? void 0 : v.input) || D,
|
|
1455
|
+
clear: (v == null ? void 0 : v.clear) || D,
|
|
1456
|
+
searchClick: v == null ? void 0 : v.searchClick,
|
|
1457
|
+
suffixClick: v == null ? void 0 : v.suffixClick,
|
|
1458
|
+
prefixClick: v == null ? void 0 : v.prefixClick,
|
|
1459
|
+
filterMethod: v == null ? void 0 : v.filterMethod
|
|
1460
|
+
} : v && (u = { change: v }), u;
|
|
1461
|
+
}, R = (v, u) => {
|
|
1462
|
+
v = v || { fieldType: "string", mode: "image" };
|
|
1463
|
+
const { singleMode: H, mode: s } = v;
|
|
1464
|
+
return H && Object.assign(v, {
|
|
1473
1465
|
multiple: !1,
|
|
1474
1466
|
limitCount: 1,
|
|
1475
1467
|
autoHiddenButton: !0
|
|
1476
|
-
}),
|
|
1468
|
+
}), s === "image" && (v.imageTypes = ["jpg", "jpeg", "png", "gif", "apk"]), { name: "#upload", props: v, events: u };
|
|
1477
1469
|
};
|
|
1478
|
-
function
|
|
1470
|
+
function D() {
|
|
1479
1471
|
}
|
|
1480
1472
|
return {
|
|
1481
|
-
renderDict:
|
|
1473
|
+
renderDict: a,
|
|
1482
1474
|
renderSelect: o,
|
|
1483
|
-
renderInput:
|
|
1484
|
-
renderTextarea:
|
|
1485
|
-
renderCheckBox:
|
|
1475
|
+
renderInput: Z,
|
|
1476
|
+
renderTextarea: c,
|
|
1477
|
+
renderCheckBox: t,
|
|
1486
1478
|
renderRadio: d,
|
|
1487
1479
|
renderUser: h,
|
|
1488
1480
|
renderSysUser: r,
|
|
1489
1481
|
renderInvOrg: e,
|
|
1490
1482
|
renderBU: i,
|
|
1491
|
-
renderNumber:
|
|
1492
|
-
renderLov:
|
|
1493
|
-
renderSelectLocal:
|
|
1494
|
-
renderDate:
|
|
1495
|
-
renderRangeDate:
|
|
1483
|
+
renderNumber: n,
|
|
1484
|
+
renderLov: M,
|
|
1485
|
+
renderSelectLocal: V,
|
|
1486
|
+
renderDate: m,
|
|
1487
|
+
renderRangeDate: b,
|
|
1496
1488
|
renderSwitch: p,
|
|
1497
|
-
renderCellTag:
|
|
1498
|
-
renderEnabled:
|
|
1499
|
-
renderIconSelect:
|
|
1500
|
-
renderTreeSelect:
|
|
1489
|
+
renderCellTag: L,
|
|
1490
|
+
renderEnabled: k,
|
|
1491
|
+
renderIconSelect: y,
|
|
1492
|
+
renderTreeSelect: C,
|
|
1501
1493
|
renderArea: T,
|
|
1502
1494
|
renderUpload: R
|
|
1503
1495
|
};
|
|
1504
1496
|
}, useGlobal = () => {
|
|
1505
|
-
const
|
|
1506
|
-
if (!
|
|
1507
|
-
const
|
|
1497
|
+
const l = getCurrentInstance();
|
|
1498
|
+
if (!l) return { $global: {}, $storage: {}, $config: {} };
|
|
1499
|
+
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
1500
|
return {
|
|
1509
|
-
$global:
|
|
1501
|
+
$global: a,
|
|
1510
1502
|
$storage: o,
|
|
1511
1503
|
$config: h,
|
|
1512
1504
|
$serviceApi: r,
|
|
1513
1505
|
$hasAuthority: e,
|
|
1514
1506
|
$printPlugin: i,
|
|
1515
|
-
$mode:
|
|
1507
|
+
$mode: Z
|
|
1516
1508
|
};
|
|
1517
1509
|
}, hexList = [];
|
|
1518
|
-
for (let
|
|
1519
|
-
hexList[
|
|
1510
|
+
for (let l = 0; l <= 15; l++)
|
|
1511
|
+
hexList[l] = l.toString(16);
|
|
1520
1512
|
function buildUUID() {
|
|
1521
|
-
let
|
|
1522
|
-
for (let
|
|
1523
|
-
|
|
1524
|
-
return
|
|
1513
|
+
let l = "";
|
|
1514
|
+
for (let a = 1; a <= 36; a++)
|
|
1515
|
+
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];
|
|
1516
|
+
return l.replace(/-/g, "");
|
|
1525
1517
|
}
|
|
1526
1518
|
let unique = 0;
|
|
1527
|
-
function buildShortUUID(
|
|
1528
|
-
const
|
|
1529
|
-
return unique++,
|
|
1519
|
+
function buildShortUUID(l = "") {
|
|
1520
|
+
const a = Date.now(), o = Math.floor(Math.random() * 1e9);
|
|
1521
|
+
return unique++, l + "_" + o + unique + String(a);
|
|
1530
1522
|
}
|
|
1531
1523
|
const deviceDetection = () => {
|
|
1532
|
-
const
|
|
1533
|
-
return
|
|
1524
|
+
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";
|
|
1525
|
+
return a || o || h || r || e || i || Z;
|
|
1534
1526
|
}, getBrowserInfo = () => {
|
|
1535
|
-
const
|
|
1527
|
+
const l = navigator.userAgent.toLowerCase(), a = /(msie|firefox|chrome|opera|version).*?([\d.]+)/, o = l.match(a);
|
|
1536
1528
|
return {
|
|
1537
1529
|
browser: o[1].replace(/version/, "'safari"),
|
|
1538
1530
|
version: o[2]
|
|
1539
1531
|
};
|
|
1540
|
-
}, showMessage = (
|
|
1532
|
+
}, showMessage = (l, a = "message", o = {}) => {
|
|
1541
1533
|
var h, r;
|
|
1542
|
-
return
|
|
1543
|
-
}, successMessage = (
|
|
1534
|
+
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 });
|
|
1535
|
+
}, successMessage = (l = "操作成功", a = {}) => {
|
|
1544
1536
|
var o;
|
|
1545
|
-
return (o = VxeUI.modal) == null ? void 0 : o.message({ content:
|
|
1546
|
-
}, warnMessage = (
|
|
1537
|
+
return (o = VxeUI.modal) == null ? void 0 : o.message({ content: l, ...a, status: "success" });
|
|
1538
|
+
}, warnMessage = (l, a = {}) => {
|
|
1547
1539
|
var o, h;
|
|
1548
|
-
return
|
|
1549
|
-
content:
|
|
1540
|
+
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({
|
|
1541
|
+
content: l,
|
|
1550
1542
|
duration: 5e3,
|
|
1551
|
-
...
|
|
1543
|
+
...a,
|
|
1552
1544
|
status: "warning"
|
|
1553
1545
|
});
|
|
1554
|
-
}, errorMessage = (
|
|
1546
|
+
}, errorMessage = (l = "操作失败", a = {}) => {
|
|
1555
1547
|
var o, h;
|
|
1556
|
-
return
|
|
1557
|
-
}, renderHook = useRender(), i18nColums = (
|
|
1548
|
+
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" });
|
|
1549
|
+
}, renderHook = useRender(), i18nColums = (l, a = !0) => {
|
|
1558
1550
|
let o = 0, h = 0;
|
|
1559
|
-
const r =
|
|
1560
|
-
return
|
|
1551
|
+
const r = l.length - 1;
|
|
1552
|
+
return l.map((e, i) => {
|
|
1561
1553
|
if (h = h + e.width, e.type) return e;
|
|
1562
1554
|
e.title = e.title || `message.${e.field}`;
|
|
1563
|
-
const { showOverflow:
|
|
1564
|
-
return e.field !== "operate" && ((e.width > 99 || e.minWidth) && (e.showOverflow =
|
|
1555
|
+
const { showOverflow: Z } = e;
|
|
1556
|
+
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
1557
|
});
|
|
1566
|
-
}, formatItems = (
|
|
1558
|
+
}, formatItems = (l, a, o = 24) => l.length ? l.map((h) => {
|
|
1567
1559
|
var r, e, i;
|
|
1568
1560
|
if ((r = h.children) != null && r.length)
|
|
1569
|
-
return h.children = formatItems(h.children,
|
|
1561
|
+
return h.children = formatItems(h.children, a, o), h;
|
|
1570
1562
|
{
|
|
1571
1563
|
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
|
|
1564
|
+
let Z = !1, c = window.$i18n ? window.$i18n("message.udp.placeholder") + window.$i18n(h.title) : "";
|
|
1565
|
+
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);
|
|
1566
|
+
let t = {
|
|
1575
1567
|
name: "VxeInput",
|
|
1576
|
-
props: { disabled:
|
|
1568
|
+
props: { disabled: Z, placeholder: Z ? "" : c }
|
|
1577
1569
|
};
|
|
1578
|
-
return h.code && !h.itemRender && (
|
|
1579
|
-
disabled:
|
|
1580
|
-
placeholder:
|
|
1570
|
+
return h.code && !h.itemRender && (t = renderHook.renderDict(h.code)), h.itemRender = h.itemRender || t, h.itemRender.props = Object.assign(h.itemRender.props || {}, {
|
|
1571
|
+
disabled: Z,
|
|
1572
|
+
placeholder: Z ? "" : c
|
|
1581
1573
|
}), h;
|
|
1582
1574
|
}
|
|
1583
|
-
}) :
|
|
1575
|
+
}) : l, formSearchButtons = {
|
|
1584
1576
|
span: 6,
|
|
1585
1577
|
align: "right",
|
|
1586
1578
|
collapseNode: !1,
|
|
@@ -1604,100 +1596,100 @@ const deviceDetection = () => {
|
|
|
1604
1596
|
],
|
|
1605
1597
|
events: null
|
|
1606
1598
|
}
|
|
1607
|
-
}, formatGridItems = (
|
|
1608
|
-
const o =
|
|
1599
|
+
}, formatGridItems = (l, a) => {
|
|
1600
|
+
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
1601
|
collapseTags: !0,
|
|
1610
1602
|
collapseTagsTooltip: !0,
|
|
1611
1603
|
multiple: !0
|
|
1612
|
-
},
|
|
1613
|
-
var
|
|
1614
|
-
return
|
|
1604
|
+
}, Z = o.map((t, d) => {
|
|
1605
|
+
var f, n, m;
|
|
1606
|
+
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
1607
|
i,
|
|
1616
|
-
((
|
|
1617
|
-
)),
|
|
1618
|
-
}),
|
|
1619
|
-
if (
|
|
1620
|
-
const
|
|
1621
|
-
|
|
1608
|
+
((m = t.itemRender) == null ? void 0 : m.props) || {}
|
|
1609
|
+
)), t;
|
|
1610
|
+
}), c = clone(formSearchButtons, !0);
|
|
1611
|
+
if (c.collapseNode = e, a && c.itemRender.options.length < 3 && (c.itemRender.options.push(a), c.itemRender.events = a.events), e) {
|
|
1612
|
+
const t = r ? 2 : 3;
|
|
1613
|
+
Z.splice(t, 0, c);
|
|
1622
1614
|
} else
|
|
1623
|
-
|
|
1624
|
-
return
|
|
1625
|
-
}, getDateRange = (
|
|
1626
|
-
var
|
|
1627
|
-
return ((
|
|
1628
|
-
}, formatRules = (
|
|
1615
|
+
Z.push(c);
|
|
1616
|
+
return Z;
|
|
1617
|
+
}, getDateRange = (l) => {
|
|
1618
|
+
var a, o, h, r, e;
|
|
1619
|
+
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;
|
|
1620
|
+
}, formatRules = (l, a) => {
|
|
1629
1621
|
const o = {};
|
|
1630
|
-
return
|
|
1622
|
+
return l.forEach((h) => {
|
|
1631
1623
|
var r;
|
|
1632
1624
|
if ((r = h.children) != null && r.length) {
|
|
1633
|
-
const e = formatRules(h.children,
|
|
1625
|
+
const e = formatRules(h.children, a);
|
|
1634
1626
|
merge(o, e);
|
|
1635
1627
|
} else if (h.required) {
|
|
1636
|
-
const { field: e, title: i } = h,
|
|
1628
|
+
const { field: e, title: i } = h, Z = i == null ? void 0 : i.startsWith("message.");
|
|
1637
1629
|
o[e] = h.rules || [
|
|
1638
1630
|
{
|
|
1639
1631
|
required: !0,
|
|
1640
|
-
message: `${
|
|
1632
|
+
message: `${a("message.required")}${i && Z ? a(i) : i || a(`message.${e}`)}`
|
|
1641
1633
|
}
|
|
1642
1634
|
];
|
|
1643
1635
|
}
|
|
1644
1636
|
}), o;
|
|
1645
1637
|
}, expandedPaths = [];
|
|
1646
|
-
function extractPathList(
|
|
1647
|
-
if (!Array.isArray(
|
|
1638
|
+
function extractPathList(l) {
|
|
1639
|
+
if (!Array.isArray(l)) {
|
|
1648
1640
|
console.warn("menuTree must be an array");
|
|
1649
1641
|
return;
|
|
1650
1642
|
}
|
|
1651
|
-
if (!(!
|
|
1652
|
-
for (const
|
|
1653
|
-
|
|
1643
|
+
if (!(!l || l.length === 0)) {
|
|
1644
|
+
for (const a of l)
|
|
1645
|
+
a.children && a.children.length > 0 && extractPathList(a.children), expandedPaths.push(a.uniqueId);
|
|
1654
1646
|
return expandedPaths;
|
|
1655
1647
|
}
|
|
1656
1648
|
}
|
|
1657
|
-
function deleteTreeChildren(
|
|
1658
|
-
if (!Array.isArray(
|
|
1649
|
+
function deleteTreeChildren(l, a = []) {
|
|
1650
|
+
if (!Array.isArray(l)) {
|
|
1659
1651
|
console.warn("menuTree must be an array");
|
|
1660
1652
|
return;
|
|
1661
1653
|
}
|
|
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
|
|
1654
|
+
if (!(!l || l.length === 0)) {
|
|
1655
|
+
for (const [o, h] of l.entries())
|
|
1656
|
+
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);
|
|
1657
|
+
return l;
|
|
1666
1658
|
}
|
|
1667
1659
|
}
|
|
1668
|
-
function buildHierarchyTree(
|
|
1669
|
-
if (!Array.isArray(
|
|
1660
|
+
function buildHierarchyTree(l, a = []) {
|
|
1661
|
+
if (!Array.isArray(l)) {
|
|
1670
1662
|
console.warn("menuTree must be an array");
|
|
1671
1663
|
return;
|
|
1672
1664
|
}
|
|
1673
|
-
if (!(!
|
|
1674
|
-
for (const [o, h] of
|
|
1675
|
-
h.id = o, h.parentId =
|
|
1676
|
-
return
|
|
1665
|
+
if (!(!l || l.length === 0)) {
|
|
1666
|
+
for (const [o, h] of l.entries())
|
|
1667
|
+
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);
|
|
1668
|
+
return l;
|
|
1677
1669
|
}
|
|
1678
1670
|
}
|
|
1679
|
-
function getNodeByUniqueId(
|
|
1680
|
-
if (!Array.isArray(
|
|
1671
|
+
function getNodeByUniqueId(l, a) {
|
|
1672
|
+
if (!Array.isArray(l)) {
|
|
1681
1673
|
console.warn("menuTree must be an array");
|
|
1682
1674
|
return;
|
|
1683
1675
|
}
|
|
1684
|
-
if (!
|
|
1685
|
-
const o =
|
|
1676
|
+
if (!l || l.length === 0) return;
|
|
1677
|
+
const o = l.find((r) => r.uniqueId === a);
|
|
1686
1678
|
if (o) return o;
|
|
1687
|
-
const h =
|
|
1688
|
-
return getNodeByUniqueId(h,
|
|
1679
|
+
const h = l.filter((r) => r.children).map((r) => r.children).flat(1);
|
|
1680
|
+
return getNodeByUniqueId(h, a);
|
|
1689
1681
|
}
|
|
1690
|
-
function appendFieldByUniqueId(
|
|
1691
|
-
if (!Array.isArray(
|
|
1682
|
+
function appendFieldByUniqueId(l, a, o) {
|
|
1683
|
+
if (!Array.isArray(l)) {
|
|
1692
1684
|
console.warn("menuTree must be an array");
|
|
1693
1685
|
return;
|
|
1694
1686
|
}
|
|
1695
|
-
if (!
|
|
1696
|
-
for (const h of
|
|
1687
|
+
if (!l || l.length === 0) return {};
|
|
1688
|
+
for (const h of l) {
|
|
1697
1689
|
const r = h.children && h.children.length > 0;
|
|
1698
|
-
h.uniqueId ===
|
|
1690
|
+
h.uniqueId === a && Object.prototype.toString.call(o) === "[object Object]" && Object.assign(h, o), r && appendFieldByUniqueId(h.children, a, o);
|
|
1699
1691
|
}
|
|
1700
|
-
return
|
|
1692
|
+
return l;
|
|
1701
1693
|
}
|
|
1702
1694
|
NProgress.configure({
|
|
1703
1695
|
// 动画方式
|
|
@@ -1722,7 +1714,7 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1722
1714
|
constructor() {
|
|
1723
1715
|
x(this, "router");
|
|
1724
1716
|
x(this, "baseUrl", null);
|
|
1725
|
-
x(this, "getNetworkError", (
|
|
1717
|
+
x(this, "getNetworkError", (a) => a ? {
|
|
1726
1718
|
400: "错误的请求",
|
|
1727
1719
|
401: "服务未授权,请重新登录",
|
|
1728
1720
|
403: "拒绝访问",
|
|
@@ -1732,50 +1724,50 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1732
1724
|
502: "网络超时",
|
|
1733
1725
|
503: "服务不可用",
|
|
1734
1726
|
504: "网络超时"
|
|
1735
|
-
}[
|
|
1727
|
+
}[a] : null);
|
|
1736
1728
|
this.httpInterceptorsRequest(), this.httpInterceptorsResponse();
|
|
1737
1729
|
}
|
|
1738
1730
|
/** 设置router调整 */
|
|
1739
|
-
setRouter(
|
|
1740
|
-
this.router =
|
|
1731
|
+
setRouter(a) {
|
|
1732
|
+
this.router = a;
|
|
1741
1733
|
}
|
|
1742
|
-
setBaseUrl(
|
|
1743
|
-
this.baseUrl =
|
|
1734
|
+
setBaseUrl(a) {
|
|
1735
|
+
this.baseUrl = a;
|
|
1744
1736
|
}
|
|
1745
1737
|
/** 重连原始请求 */
|
|
1746
|
-
static retryOriginalRequest(
|
|
1738
|
+
static retryOriginalRequest(a) {
|
|
1747
1739
|
return new Promise((o) => {
|
|
1748
1740
|
g.requests.push((h) => {
|
|
1749
|
-
|
|
1741
|
+
a.headers.Authorization = "Bearer " + h, o(a);
|
|
1750
1742
|
});
|
|
1751
1743
|
});
|
|
1752
1744
|
}
|
|
1753
1745
|
// 请求拦截
|
|
1754
1746
|
httpInterceptorsRequest() {
|
|
1755
1747
|
g.axiosInstance.interceptors.request.use(
|
|
1756
|
-
(
|
|
1748
|
+
(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
1749
|
const r = cookies.get(kTOKENKEY);
|
|
1758
1750
|
if (r) {
|
|
1759
1751
|
const e = JSON.parse(r), i = (/* @__PURE__ */ new Date()).getTime();
|
|
1760
1752
|
e.expires - i <= 0 ? (g.isRefreshing || (g.isRefreshing = !0, this.get(this.baseUrl + "/uath/refreshToken", {
|
|
1761
1753
|
refreshToken: e.refreshToken
|
|
1762
|
-
}).then((
|
|
1763
|
-
|
|
1754
|
+
}).then((c) => {
|
|
1755
|
+
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
1756
|
}).catch(() => {
|
|
1765
1757
|
this.routeToLogin();
|
|
1766
1758
|
}).finally(() => {
|
|
1767
1759
|
g.isRefreshing = !1;
|
|
1768
|
-
})), h(g.retryOriginalRequest(
|
|
1760
|
+
})), h(g.retryOriginalRequest(a))) : (a.headers.Authorization = "Bearer " + e.accessToken, h(a));
|
|
1769
1761
|
} else {
|
|
1770
1762
|
const e = cookies.get("kCookies_token");
|
|
1771
|
-
e && (
|
|
1763
|
+
e && (a.headers["X-Token"] = e), h(a);
|
|
1772
1764
|
}
|
|
1773
1765
|
})),
|
|
1774
|
-
(
|
|
1766
|
+
(a) => Promise.reject(a)
|
|
1775
1767
|
);
|
|
1776
1768
|
}
|
|
1777
|
-
setToken(
|
|
1778
|
-
const { access_token: o, expires_in: h, refresh_token: r } =
|
|
1769
|
+
setToken(a) {
|
|
1770
|
+
const { access_token: o, expires_in: h, refresh_token: r } = a, e = {
|
|
1779
1771
|
accessToken: o,
|
|
1780
1772
|
refreshToken: r,
|
|
1781
1773
|
expires: Date.now() + h * 1e3
|
|
@@ -1799,66 +1791,66 @@ const kTOKENKEY = "authorized-token", defaultConfig = {
|
|
|
1799
1791
|
}
|
|
1800
1792
|
);
|
|
1801
1793
|
}
|
|
1802
|
-
transformConfigByMethod(
|
|
1794
|
+
transformConfigByMethod(a, o) {
|
|
1803
1795
|
const { method: h } = o, r = ["get"], e = h.toLocaleLowerCase(), i = r.includes(e) ? "params" : "data";
|
|
1804
1796
|
return {
|
|
1805
1797
|
...o,
|
|
1806
|
-
[i]:
|
|
1798
|
+
[i]: a
|
|
1807
1799
|
};
|
|
1808
1800
|
}
|
|
1809
1801
|
// 通用请求工具函数
|
|
1810
|
-
request(
|
|
1802
|
+
request(a, o, h, r) {
|
|
1811
1803
|
const e = this.transformConfigByMethod(h, {
|
|
1812
|
-
method:
|
|
1804
|
+
method: a,
|
|
1813
1805
|
url: o,
|
|
1814
1806
|
...r
|
|
1815
1807
|
});
|
|
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(
|
|
1808
|
+
return new Promise((i, Z) => {
|
|
1809
|
+
g.axiosInstance.request(e).then((c) => {
|
|
1810
|
+
if (c && (c == null ? void 0 : c.code) === "0")
|
|
1811
|
+
i(c.data);
|
|
1812
|
+
else if (c.code === "500")
|
|
1813
|
+
errorMessage(c.msg, { duration: 8e3 }), e.method === "get" ? i(c) : Z(c.msg);
|
|
1814
|
+
else if ((c == null ? void 0 : c.code) !== "-1")
|
|
1815
|
+
i(c);
|
|
1824
1816
|
else {
|
|
1825
|
-
const
|
|
1826
|
-
errorMessage(
|
|
1817
|
+
const t = (c == null ? void 0 : c.msg) || "服务异常";
|
|
1818
|
+
errorMessage(t, { duration: 8e3 }), Z(t);
|
|
1827
1819
|
}
|
|
1828
|
-
}).catch((
|
|
1829
|
-
var
|
|
1830
|
-
if (
|
|
1831
|
-
if (((
|
|
1820
|
+
}).catch((c) => {
|
|
1821
|
+
var t, d, f;
|
|
1822
|
+
if (c != null && c.code) {
|
|
1823
|
+
if (((t = c == null ? void 0 : c.response) == null ? void 0 : t.status) === 401)
|
|
1832
1824
|
return (d = this.router) == null ? void 0 : d.push({ path: "/login" });
|
|
1833
1825
|
errorMessage(
|
|
1834
|
-
this.getNetworkError((
|
|
1826
|
+
this.getNetworkError((f = c == null ? void 0 : c.response) == null ? void 0 : f.status) || (c == null ? void 0 : c.message),
|
|
1835
1827
|
{ duration: 8e3 }
|
|
1836
1828
|
);
|
|
1837
1829
|
}
|
|
1838
|
-
|
|
1830
|
+
c.config.method === "get" ? i(c) : Z(c);
|
|
1839
1831
|
});
|
|
1840
1832
|
});
|
|
1841
1833
|
}
|
|
1842
1834
|
// 单独抽离的post工具函数
|
|
1843
|
-
post(
|
|
1844
|
-
return this.request("post",
|
|
1835
|
+
post(a, o, h) {
|
|
1836
|
+
return this.request("post", a, o, h);
|
|
1845
1837
|
}
|
|
1846
1838
|
// 单独抽离的delete工具函数
|
|
1847
|
-
delete(
|
|
1848
|
-
return this.request("delete",
|
|
1839
|
+
delete(a, o, h) {
|
|
1840
|
+
return this.request("delete", a, o, h);
|
|
1849
1841
|
}
|
|
1850
1842
|
// 单独抽离的put工具函数
|
|
1851
|
-
put(
|
|
1852
|
-
return this.request("put",
|
|
1843
|
+
put(a, o, h) {
|
|
1844
|
+
return this.request("put", a, o, h);
|
|
1853
1845
|
}
|
|
1854
1846
|
// 单独抽离的get工具函数
|
|
1855
|
-
get(
|
|
1847
|
+
get(a, o, h) {
|
|
1856
1848
|
for (const r in o)
|
|
1857
1849
|
o[r] || delete o[r];
|
|
1858
|
-
return this.request("get",
|
|
1850
|
+
return this.request("get", a, o, h);
|
|
1859
1851
|
}
|
|
1860
|
-
postRouter(
|
|
1861
|
-
return this.request("post", "route/service",
|
|
1852
|
+
postRouter(a) {
|
|
1853
|
+
return this.request("post", "route/service", a);
|
|
1862
1854
|
}
|
|
1863
1855
|
};
|
|
1864
1856
|
/** token过期后,暂存待执行的请求 */
|
|
@@ -2216,15 +2208,15 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2216
2208
|
*
|
|
2217
2209
|
* @param param {Object} 按照festival的格式输入数据,设置阳历节日
|
|
2218
2210
|
*/
|
|
2219
|
-
setFestival(
|
|
2220
|
-
this.festival =
|
|
2211
|
+
setFestival(l = {}) {
|
|
2212
|
+
this.festival = l;
|
|
2221
2213
|
},
|
|
2222
2214
|
/**
|
|
2223
2215
|
*
|
|
2224
2216
|
* @param param {Object} 按照lFestival的格式输入数据,设置农历节日
|
|
2225
2217
|
*/
|
|
2226
|
-
setLunarFestival(
|
|
2227
|
-
this.lFestival =
|
|
2218
|
+
setLunarFestival(l = {}) {
|
|
2219
|
+
this.lFestival = l;
|
|
2228
2220
|
},
|
|
2229
2221
|
/**
|
|
2230
2222
|
* 24节气速查表
|
|
@@ -2518,11 +2510,11 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2518
2510
|
* @return Number
|
|
2519
2511
|
* @eg:var count = calendar.lYearDays(1987) ;//count=387
|
|
2520
2512
|
*/
|
|
2521
|
-
lYearDays: function(
|
|
2522
|
-
let
|
|
2523
|
-
for (
|
|
2524
|
-
o += this.lunarInfo[
|
|
2525
|
-
return o + this.leapDays(
|
|
2513
|
+
lYearDays: function(l) {
|
|
2514
|
+
let a, o = 348;
|
|
2515
|
+
for (a = 32768; a > 8; a >>= 1)
|
|
2516
|
+
o += this.lunarInfo[l - 1900] & a ? 1 : 0;
|
|
2517
|
+
return o + this.leapDays(l);
|
|
2526
2518
|
},
|
|
2527
2519
|
/**
|
|
2528
2520
|
* 返回农历y年闰月是哪个月;若y年没有闰月 则返回0
|
|
@@ -2530,8 +2522,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2530
2522
|
* @return Number (0-12)
|
|
2531
2523
|
* @eg:var leapMonth = calendar.leapMonth(1987) ;//leapMonth=6
|
|
2532
2524
|
*/
|
|
2533
|
-
leapMonth: function(
|
|
2534
|
-
return this.lunarInfo[
|
|
2525
|
+
leapMonth: function(l) {
|
|
2526
|
+
return this.lunarInfo[l - 1900] & 15;
|
|
2535
2527
|
},
|
|
2536
2528
|
/**
|
|
2537
2529
|
* 返回农历y年闰月的天数 若该年没有闰月则返回0
|
|
@@ -2539,8 +2531,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2539
2531
|
* @return Number (0、29、30)
|
|
2540
2532
|
* @eg:var leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29
|
|
2541
2533
|
*/
|
|
2542
|
-
leapDays: function(
|
|
2543
|
-
return this.leapMonth(
|
|
2534
|
+
leapDays: function(l) {
|
|
2535
|
+
return this.leapMonth(l) ? this.lunarInfo[l - 1900] & 65536 ? 30 : 29 : 0;
|
|
2544
2536
|
},
|
|
2545
2537
|
/**
|
|
2546
2538
|
* 返回农历y年m月(非闰月)的总天数,计算m为闰月时的天数请使用leapDays方法
|
|
@@ -2549,8 +2541,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2549
2541
|
* @return Number (-1、29、30)
|
|
2550
2542
|
* @eg:var MonthDay = calendar.monthDays(1987,9) ;//MonthDay=29
|
|
2551
2543
|
*/
|
|
2552
|
-
monthDays: function(
|
|
2553
|
-
return
|
|
2544
|
+
monthDays: function(l, a) {
|
|
2545
|
+
return a > 12 || a < 1 ? -1 : this.lunarInfo[l - 1900] & 65536 >> a ? 30 : 29;
|
|
2554
2546
|
},
|
|
2555
2547
|
/**
|
|
2556
2548
|
* 返回公历(!)y年m月的天数
|
|
@@ -2559,20 +2551,20 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2559
2551
|
* @return Number (-1、28、29、30、31)
|
|
2560
2552
|
* @eg:var solarMonthDay = calendar.leapDays(1987) ;//solarMonthDay=30
|
|
2561
2553
|
*/
|
|
2562
|
-
solarDays: function(
|
|
2563
|
-
if (
|
|
2554
|
+
solarDays: function(l, a) {
|
|
2555
|
+
if (a > 12 || a < 1)
|
|
2564
2556
|
return -1;
|
|
2565
|
-
const o =
|
|
2566
|
-
return o === 1 ?
|
|
2557
|
+
const o = a - 1;
|
|
2558
|
+
return o === 1 ? l % 4 === 0 && l % 100 !== 0 || l % 400 === 0 ? 29 : 28 : this.solarMonth[o];
|
|
2567
2559
|
},
|
|
2568
2560
|
/**
|
|
2569
2561
|
* 农历年份转换为干支纪年
|
|
2570
2562
|
* @param lYear 农历年的年份数
|
|
2571
2563
|
* @return Cn string
|
|
2572
2564
|
*/
|
|
2573
|
-
toGanZhiYear: function(
|
|
2574
|
-
let
|
|
2575
|
-
return
|
|
2565
|
+
toGanZhiYear: function(l) {
|
|
2566
|
+
let a = (l - 3) % 10, o = (l - 3) % 12;
|
|
2567
|
+
return a === 0 && (a = 10), o === 0 && (o = 12), this.Gan[a - 1] + this.Zhi[o - 1];
|
|
2576
2568
|
},
|
|
2577
2569
|
/**
|
|
2578
2570
|
* 公历月、日判断所属星座
|
|
@@ -2580,17 +2572,17 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2580
2572
|
* @param cDay [description]
|
|
2581
2573
|
* @return Cn string
|
|
2582
2574
|
*/
|
|
2583
|
-
toAstro: function(
|
|
2575
|
+
toAstro: function(l, a) {
|
|
2584
2576
|
const o = "摩羯水瓶双鱼白羊金牛双子巨蟹狮子处女天秤天蝎射手摩羯", h = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22];
|
|
2585
|
-
return o.substr(
|
|
2577
|
+
return o.substr(l * 2 - (a < h[l - 1] ? 2 : 0), 2) + "座";
|
|
2586
2578
|
},
|
|
2587
2579
|
/**
|
|
2588
2580
|
* 传入offset偏移量返回干支
|
|
2589
2581
|
* @param offset 相对甲子的偏移量
|
|
2590
2582
|
* @return Cn string
|
|
2591
2583
|
*/
|
|
2592
|
-
toGanZhi: function(
|
|
2593
|
-
return this.Gan[
|
|
2584
|
+
toGanZhi: function(l) {
|
|
2585
|
+
return this.Gan[l % 10] + this.Zhi[l % 12];
|
|
2594
2586
|
},
|
|
2595
2587
|
/**
|
|
2596
2588
|
* 传入公历(!)y年获得该年第n个节气的公历日期
|
|
@@ -2599,15 +2591,15 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2599
2591
|
* @return day Number
|
|
2600
2592
|
* @eg:var _24 = calendar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春
|
|
2601
2593
|
*/
|
|
2602
|
-
getTerm: function(
|
|
2603
|
-
if (
|
|
2594
|
+
getTerm: function(l, a) {
|
|
2595
|
+
if (l < 1900 || l > 2100 || a < 1 || a > 24)
|
|
2604
2596
|
return -1;
|
|
2605
|
-
const o = this.sTermInfo[
|
|
2597
|
+
const o = this.sTermInfo[l - 1900], h = [];
|
|
2606
2598
|
for (let r = 0; r < o.length; r += 5) {
|
|
2607
2599
|
const e = parseInt("0x" + o.substr(r, 5)).toString();
|
|
2608
2600
|
h.push(e[0], e.substr(1, 2), e[3], e.substr(4, 2));
|
|
2609
2601
|
}
|
|
2610
|
-
return parseInt(h[
|
|
2602
|
+
return parseInt(h[a - 1]);
|
|
2611
2603
|
},
|
|
2612
2604
|
/**
|
|
2613
2605
|
* 传入农历数字月份返回汉语通俗表示法
|
|
@@ -2615,11 +2607,11 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2615
2607
|
* @return Cn string
|
|
2616
2608
|
* @eg:var cnMonth = calendar.toChinaMonth(12) ;//cnMonth='腊月'
|
|
2617
2609
|
*/
|
|
2618
|
-
toChinaMonth: function(
|
|
2619
|
-
if (
|
|
2610
|
+
toChinaMonth: function(l) {
|
|
2611
|
+
if (l > 12 || l < 1)
|
|
2620
2612
|
return -1;
|
|
2621
|
-
let
|
|
2622
|
-
return
|
|
2613
|
+
let a = this.nStr3[l - 1];
|
|
2614
|
+
return a += "月", a;
|
|
2623
2615
|
},
|
|
2624
2616
|
/**
|
|
2625
2617
|
* 传入农历日期数字返回汉字表示法
|
|
@@ -2627,22 +2619,22 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2627
2619
|
* @return Cn string
|
|
2628
2620
|
* @eg:var cnDay = calendar.toChinaDay(21) ;//cnMonth='廿一'
|
|
2629
2621
|
*/
|
|
2630
|
-
toChinaDay: function(
|
|
2631
|
-
let
|
|
2632
|
-
switch (
|
|
2622
|
+
toChinaDay: function(l) {
|
|
2623
|
+
let a;
|
|
2624
|
+
switch (l) {
|
|
2633
2625
|
case 10:
|
|
2634
|
-
|
|
2626
|
+
a = "初十";
|
|
2635
2627
|
break;
|
|
2636
2628
|
case 20:
|
|
2637
|
-
|
|
2629
|
+
a = "二十";
|
|
2638
2630
|
break;
|
|
2639
2631
|
case 30:
|
|
2640
|
-
|
|
2632
|
+
a = "三十";
|
|
2641
2633
|
break;
|
|
2642
2634
|
default:
|
|
2643
|
-
|
|
2635
|
+
a = this.nStr2[Math.floor(l / 10)], a += this.nStr1[l % 10];
|
|
2644
2636
|
}
|
|
2645
|
-
return
|
|
2637
|
+
return a;
|
|
2646
2638
|
},
|
|
2647
2639
|
/**
|
|
2648
2640
|
* 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春”
|
|
@@ -2650,8 +2642,8 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2650
2642
|
* @return Cn string
|
|
2651
2643
|
* @eg:var animal = calendar.getAnimal(1987) ;//animal='兔'
|
|
2652
2644
|
*/
|
|
2653
|
-
getAnimal: function(
|
|
2654
|
-
return this.Animals[(
|
|
2645
|
+
getAnimal: function(l) {
|
|
2646
|
+
return this.Animals[(l - 4) % 12];
|
|
2655
2647
|
},
|
|
2656
2648
|
/**
|
|
2657
2649
|
* 传入阳历年月日获得详细的公历、农历object信息 <=>JSON
|
|
@@ -2662,60 +2654,60 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2662
2654
|
* @return JSON object
|
|
2663
2655
|
* @eg:console.log(calendar.solar2lunar(1987,11,01));
|
|
2664
2656
|
*/
|
|
2665
|
-
solar2lunar: function(
|
|
2666
|
-
let h = parseInt(
|
|
2657
|
+
solar2lunar: function(l, a, o) {
|
|
2658
|
+
let h = parseInt(l), r = parseInt(a), e = parseInt(o);
|
|
2667
2659
|
if (h < 1900 || h > 2100 || h === 1900 && r === 1 && e < 31)
|
|
2668
2660
|
return -1;
|
|
2669
2661
|
let i;
|
|
2670
2662
|
h ? i = new Date(h, parseInt(r.toString()) - 1, e) : i = /* @__PURE__ */ new Date();
|
|
2671
|
-
let
|
|
2663
|
+
let Z, c = 0, t = 0;
|
|
2672
2664
|
h = i.getFullYear(), r = i.getMonth() + 1, e = i.getDate();
|
|
2673
2665
|
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 =
|
|
2666
|
+
for (Z = 1900; Z < 2101 && d > 0; Z++)
|
|
2667
|
+
t = this.lYearDays(Z), d -= t;
|
|
2668
|
+
d < 0 && (d += t, Z--);
|
|
2669
|
+
const f = /* @__PURE__ */ new Date();
|
|
2670
|
+
let n = !1;
|
|
2671
|
+
f.getFullYear() === h && f.getMonth() + 1 === r && f.getDate() === e && (n = !0);
|
|
2672
|
+
let m = i.getDay();
|
|
2673
|
+
const b = this.nStr1[m];
|
|
2674
|
+
m === 0 && (m = 7);
|
|
2675
|
+
const M = Z;
|
|
2676
|
+
c = this.leapMonth(Z);
|
|
2677
|
+
let V = !1;
|
|
2678
|
+
for (Z = 1; Z < 13 && d > 0; Z++)
|
|
2679
|
+
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;
|
|
2680
|
+
d === 0 && c > 0 && Z === c + 1 && (V ? V = !1 : (V = !0, --Z)), d < 0 && (d += t, --Z);
|
|
2681
|
+
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
2682
|
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:
|
|
2683
|
+
e >= C && (w = this.toGanZhi((h - 1900) * 12 + r + 12));
|
|
2684
|
+
let R = !1, D;
|
|
2685
|
+
C === e && (R = !0, D = this.solarTerm[r * 2 - 2]), T === e && (R = !0, D = this.solarTerm[r * 2 - 1]);
|
|
2686
|
+
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;
|
|
2687
|
+
let F = p + "-" + L;
|
|
2688
|
+
return p === 12 && L === 29 && this.monthDays(M, p) === 29 && (F = "12-30"), {
|
|
2689
|
+
date: s,
|
|
2690
|
+
lunarDate: A,
|
|
2691
|
+
festival: S[N] ? S[N].title : null,
|
|
2692
|
+
lunarFestival: I[F] ? I[F].title : null,
|
|
2693
|
+
lYear: M,
|
|
2702
2694
|
lMonth: p,
|
|
2703
|
-
lDay:
|
|
2704
|
-
Animal: this.getAnimal(
|
|
2705
|
-
IMonthCn: (
|
|
2706
|
-
IDayCn: this.toChinaDay(
|
|
2695
|
+
lDay: L,
|
|
2696
|
+
Animal: this.getAnimal(M),
|
|
2697
|
+
IMonthCn: (V ? "闰" : "") + this.toChinaMonth(p),
|
|
2698
|
+
IDayCn: this.toChinaDay(L),
|
|
2707
2699
|
cYear: h,
|
|
2708
2700
|
cMonth: r,
|
|
2709
2701
|
cDay: e,
|
|
2710
|
-
gzYear:
|
|
2702
|
+
gzYear: y,
|
|
2711
2703
|
gzMonth: w,
|
|
2712
2704
|
gzDay: u,
|
|
2713
|
-
isToday:
|
|
2714
|
-
isLeap:
|
|
2715
|
-
nWeek:
|
|
2716
|
-
ncWeek: "星期" +
|
|
2705
|
+
isToday: n,
|
|
2706
|
+
isLeap: V,
|
|
2707
|
+
nWeek: m,
|
|
2708
|
+
ncWeek: "星期" + b,
|
|
2717
2709
|
isTerm: R,
|
|
2718
|
-
Term:
|
|
2710
|
+
Term: D,
|
|
2719
2711
|
astro: H
|
|
2720
2712
|
};
|
|
2721
2713
|
},
|
|
@@ -2729,40 +2721,40 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2729
2721
|
* @return JSON object
|
|
2730
2722
|
* @eg:console.log(calendar.lunar2solar(1987,9,10));
|
|
2731
2723
|
*/
|
|
2732
|
-
lunar2solar: function(
|
|
2733
|
-
|
|
2734
|
-
const r = this.leapMonth(
|
|
2735
|
-
if (h && r !==
|
|
2724
|
+
lunar2solar: function(l, a, o, h) {
|
|
2725
|
+
l = parseInt(l), a = parseInt(a), o = parseInt(o), h = !!h;
|
|
2726
|
+
const r = this.leapMonth(l);
|
|
2727
|
+
if (h && r !== a || l === 2100 && a === 12 && o > 1 || l === 1900 && a === 1 && o < 31)
|
|
2736
2728
|
return -1;
|
|
2737
|
-
const e = this.monthDays(
|
|
2729
|
+
const e = this.monthDays(l, a);
|
|
2738
2730
|
let i = e;
|
|
2739
|
-
if (h && (i = this.leapDays(
|
|
2731
|
+
if (h && (i = this.leapDays(l)), l < 1900 || l > 2100 || o > i)
|
|
2740
2732
|
return -1;
|
|
2741
|
-
let
|
|
2742
|
-
for (
|
|
2743
|
-
|
|
2744
|
-
let
|
|
2745
|
-
for (
|
|
2746
|
-
|
|
2747
|
-
h && (
|
|
2748
|
-
const
|
|
2749
|
-
return this.solar2lunar(
|
|
2733
|
+
let Z = 0, c;
|
|
2734
|
+
for (c = 1900; c < l; c++)
|
|
2735
|
+
Z += this.lYearDays(c);
|
|
2736
|
+
let t = 0, d = !1;
|
|
2737
|
+
for (c = 1; c < a; c++)
|
|
2738
|
+
t = this.leapMonth(l), d || t <= c && t > 0 && (Z += this.leapDays(l), d = !0), Z += this.monthDays(l, c);
|
|
2739
|
+
h && (Z += e);
|
|
2740
|
+
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();
|
|
2741
|
+
return this.solar2lunar(m, b, M);
|
|
2750
2742
|
}
|
|
2751
2743
|
}, dict = storageLocal.getItem("kLov"), formats = {
|
|
2752
2744
|
formatDate: {
|
|
2753
2745
|
// 格式化日期,默认 yyyy-MM-dd HH:mm:ss
|
|
2754
|
-
tableCellFormatMethod({ cellValue:
|
|
2755
|
-
return
|
|
2746
|
+
tableCellFormatMethod({ cellValue: l }, a) {
|
|
2747
|
+
return l && XEUtils.toDateString(l, a || "yyyy-MM-dd");
|
|
2756
2748
|
}
|
|
2757
2749
|
},
|
|
2758
2750
|
formatAmount: {
|
|
2759
|
-
tableCellFormatMethod({ cellValue:
|
|
2760
|
-
return XEUtils.commafy(Number(
|
|
2751
|
+
tableCellFormatMethod({ cellValue: l }, a = 2) {
|
|
2752
|
+
return XEUtils.commafy(Number(l), { digits: a });
|
|
2761
2753
|
}
|
|
2762
2754
|
},
|
|
2763
2755
|
formatBankcard: {
|
|
2764
|
-
tableCellFormatMethod({ cellValue:
|
|
2765
|
-
return XEUtils.commafy(XEUtils.toValueString(
|
|
2756
|
+
tableCellFormatMethod({ cellValue: l }) {
|
|
2757
|
+
return XEUtils.commafy(XEUtils.toValueString(l), {
|
|
2766
2758
|
spaceNumber: 4,
|
|
2767
2759
|
separator: " "
|
|
2768
2760
|
});
|
|
@@ -2770,33 +2762,33 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2770
2762
|
},
|
|
2771
2763
|
formatFixedNumber: {
|
|
2772
2764
|
// 四舍五入金额,每隔3位逗号分隔,默认2位数
|
|
2773
|
-
tableCellFormatMethod({ cellValue:
|
|
2774
|
-
return XEUtils.toFixed(XEUtils.round(
|
|
2765
|
+
tableCellFormatMethod({ cellValue: l }, a = 2) {
|
|
2766
|
+
return XEUtils.toFixed(XEUtils.round(l, a), a);
|
|
2775
2767
|
}
|
|
2776
2768
|
},
|
|
2777
2769
|
formatCutNumber: {
|
|
2778
2770
|
// 向下舍入,默认两位数
|
|
2779
|
-
tableCellFormatMethod({ cellValue:
|
|
2780
|
-
return XEUtils.toFixed(XEUtils.floor(
|
|
2771
|
+
tableCellFormatMethod({ cellValue: l }, a = 2) {
|
|
2772
|
+
return XEUtils.toFixed(XEUtils.floor(l, a), a);
|
|
2781
2773
|
}
|
|
2782
2774
|
},
|
|
2783
2775
|
formatDict: {
|
|
2784
2776
|
// 数据字段转化
|
|
2785
|
-
tableCellFormatMethod({ cellValue:
|
|
2777
|
+
tableCellFormatMethod({ cellValue: l }, a) {
|
|
2786
2778
|
var r, e;
|
|
2787
|
-
if (!
|
|
2788
|
-
const o = XEUtils.toValueString(
|
|
2789
|
-
return (h == null ? void 0 : h.dictName) ||
|
|
2779
|
+
if (!a) return l;
|
|
2780
|
+
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;
|
|
2781
|
+
return (h == null ? void 0 : h.dictName) || l;
|
|
2790
2782
|
}
|
|
2791
2783
|
},
|
|
2792
2784
|
formattMultileCode: {
|
|
2793
|
-
tableCellFormatMethod({ cellValue:
|
|
2794
|
-
if (!
|
|
2795
|
-
const o =
|
|
2785
|
+
tableCellFormatMethod({ cellValue: l }, a) {
|
|
2786
|
+
if (!a || !dict) return l;
|
|
2787
|
+
const o = l == null ? void 0 : l.split(",");
|
|
2796
2788
|
let h = "";
|
|
2797
2789
|
return o == null || o.forEach((r) => {
|
|
2798
|
-
var i,
|
|
2799
|
-
const e = (
|
|
2790
|
+
var i, Z;
|
|
2791
|
+
const e = (Z = (i = dict[a]) == null ? void 0 : i.children) == null ? void 0 : Z.find((c) => c.dictCode === r);
|
|
2800
2792
|
h ? h += `,${e.dictName}` : h = e.dictName;
|
|
2801
2793
|
}), h;
|
|
2802
2794
|
}
|
|
@@ -2809,24 +2801,24 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
2809
2801
|
},
|
|
2810
2802
|
formatContact: {
|
|
2811
2803
|
// 字段拼接展示
|
|
2812
|
-
tableCellFormatMethod({ row:
|
|
2813
|
-
return
|
|
2804
|
+
tableCellFormatMethod({ row: l }, a) {
|
|
2805
|
+
return a.reduce((o, h) => l[h] ? o ? o += l[h] : l[h] : o, "");
|
|
2814
2806
|
}
|
|
2815
2807
|
},
|
|
2816
2808
|
formatSelectLocal: {
|
|
2817
|
-
tableCellFormatMethod({ cellValue:
|
|
2818
|
-
const [o, h = "value", r = "label"] =
|
|
2819
|
-
return e ? e[r] :
|
|
2809
|
+
tableCellFormatMethod({ cellValue: l }, a) {
|
|
2810
|
+
const [o, h = "value", r = "label"] = a, e = o == null ? void 0 : o.find((i) => i[h] === l);
|
|
2811
|
+
return e ? e[r] : l;
|
|
2820
2812
|
}
|
|
2821
2813
|
},
|
|
2822
2814
|
formatMultiValue: {
|
|
2823
|
-
tableCellFormatMethod({ row:
|
|
2815
|
+
tableCellFormatMethod({ row: l }, a) {
|
|
2824
2816
|
var e;
|
|
2825
|
-
const [o, h] =
|
|
2817
|
+
const [o, h] = a;
|
|
2826
2818
|
let r;
|
|
2827
|
-
return (e =
|
|
2828
|
-
const
|
|
2829
|
-
r = r ? `${r},${
|
|
2819
|
+
return (e = l[o]) == null || e.split(",").forEach((i) => {
|
|
2820
|
+
const Z = h.find((c) => c.value === i);
|
|
2821
|
+
r = r ? `${r},${Z == null ? void 0 : Z.label}` : Z == null ? void 0 : Z.label;
|
|
2830
2822
|
}), r;
|
|
2831
2823
|
}
|
|
2832
2824
|
}
|
|
@@ -10451,34 +10443,34 @@ const http = new SuHttp(), lunarCalendar = {
|
|
|
10451
10443
|
},
|
|
10452
10444
|
width: 24,
|
|
10453
10445
|
height: 24
|
|
10454
|
-
}, withInstall = (
|
|
10455
|
-
const
|
|
10456
|
-
return
|
|
10457
|
-
o.component(
|
|
10458
|
-
},
|
|
10446
|
+
}, withInstall = (l) => {
|
|
10447
|
+
const a = l;
|
|
10448
|
+
return a.install = (o) => {
|
|
10449
|
+
o.component(a.name || a.__name, l);
|
|
10450
|
+
}, l;
|
|
10459
10451
|
};
|
|
10460
|
-
function sleep(
|
|
10461
|
-
return new Promise((
|
|
10452
|
+
function sleep(l = 64) {
|
|
10453
|
+
return new Promise((a) => {
|
|
10462
10454
|
const o = setTimeout(() => {
|
|
10463
|
-
window.clearTimeout(o), l
|
|
10464
|
-
},
|
|
10455
|
+
window.clearTimeout(o), a(l);
|
|
10456
|
+
}, l);
|
|
10465
10457
|
});
|
|
10466
10458
|
}
|
|
10467
|
-
const delay = (
|
|
10459
|
+
const delay = (l) => new Promise((a) => setTimeout(a, l)), useDark = () => ({ isDark: ref(document.documentElement.classList.contains("dark")) }), useDebounce = (l, a) => {
|
|
10468
10460
|
let o;
|
|
10469
10461
|
return () => {
|
|
10470
|
-
o && clearTimeout(o), o = setTimeout(
|
|
10462
|
+
o && clearTimeout(o), o = setTimeout(l, a);
|
|
10471
10463
|
};
|
|
10472
10464
|
};
|
|
10473
|
-
function isUrl(
|
|
10474
|
-
return /(((^http(s)?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/.test(
|
|
10465
|
+
function isUrl(l) {
|
|
10466
|
+
return /(((^http(s)?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/.test(l);
|
|
10475
10467
|
}
|
|
10476
|
-
const getDictName = (
|
|
10468
|
+
const getDictName = (l, a) => {
|
|
10477
10469
|
var h, r;
|
|
10478
|
-
return !
|
|
10479
|
-
}, getDictChildren = (
|
|
10470
|
+
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;
|
|
10471
|
+
}, getDictChildren = (l) => {
|
|
10480
10472
|
var o;
|
|
10481
|
-
return
|
|
10473
|
+
return l ? (o = storageLocal.getItem("kLov")[l]) == null ? void 0 : o.children : [];
|
|
10482
10474
|
};
|
|
10483
10475
|
export {
|
|
10484
10476
|
G as NProgress,
|