joy-admin-components 0.2.73 → 0.2.75
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.
|
@@ -1,2376 +1,2045 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { saveAs as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { createI18n as
|
|
7
|
-
import {
|
|
8
|
-
import { useRoute as
|
|
9
|
-
import { createNamespacedHelpers as
|
|
10
|
-
import { VxeUI as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
})
|
|
43
|
-
var
|
|
44
|
-
function
|
|
45
|
-
|
|
1
|
+
import { ElCol as e, ElForm as t, ElInputNumber as n, ElLink as r, ElMessageBox as i, ElRow as a, ElText as o } from "element-plus";
|
|
2
|
+
import { Fragment as s, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createSlots as p, createTextVNode as m, createVNode as h, defineComponent as g, h as _, isVNode as v, mergeModels as y, mergeProps as b, nextTick as x, normalizeClass as S, normalizeStyle as C, onMounted as w, onUnmounted as T, onUpdated as E, openBlock as D, reactive as O, ref as k, renderList as A, renderSlot as j, resolveComponent as M, resolveDynamicComponent as N, toDisplayString as P, unref as F, useAttrs as ee, useModel as I, watch as L, withCtx as R, withDirectives as z, withKeys as B, withModifiers as te } from "vue";
|
|
3
|
+
import { saveAs as V } from "file-saver";
|
|
4
|
+
import H from "exceljs";
|
|
5
|
+
import U from "dayjs";
|
|
6
|
+
import { createI18n as W, useI18n as G } from "vue-i18n";
|
|
7
|
+
import { cloneDeep as ne, debounce as re, isArray as ie } from "lodash";
|
|
8
|
+
import { useRoute as ae, useRouter as oe } from "vue-router";
|
|
9
|
+
import { createNamespacedHelpers as se, mapActions as ce, mapGetters as le, mapState as ue, useStore as K } from "vuex";
|
|
10
|
+
import { VxeUI as q } from "vxe-pc-ui";
|
|
11
|
+
//#region \0rolldown/runtime.js
|
|
12
|
+
var J = Object.create, Y = Object.defineProperty, X = Object.getOwnPropertyDescriptor, de = Object.getOwnPropertyNames, fe = Object.getPrototypeOf, pe = Object.prototype.hasOwnProperty, me = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), he = (e, t, n, r) => {
|
|
13
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = de(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !pe.call(e, s) && s !== n && Y(e, s, {
|
|
14
|
+
get: ((e) => t[e]).bind(null, s),
|
|
15
|
+
enumerable: !(r = X(t, s)) || r.enumerable
|
|
16
|
+
});
|
|
17
|
+
return e;
|
|
18
|
+
}, ge = (e, t, n) => (n = e == null ? {} : J(fe(e)), he(t || !e || !e.__esModule ? Y(n, "default", {
|
|
19
|
+
value: e,
|
|
20
|
+
enumerable: !0
|
|
21
|
+
}) : n, e)), _e = g({
|
|
22
|
+
name: "LayOutForm",
|
|
23
|
+
setup(n, { slots: r, attrs: i, emit: o }) {
|
|
24
|
+
let s = k(null), c = () => r.default ? r.default().filter((e) => e.type !== Symbol.for("v-cmt")).map((e) => e.type === Symbol.for("v-fgt") ? e.children : e).flat().map((t) => _(e, {
|
|
25
|
+
span: t.props?.span || t.props?.colProps?.span || 24,
|
|
26
|
+
...t.props?.colProps
|
|
27
|
+
}, { default: () => t })) : null;
|
|
28
|
+
w(() => {
|
|
29
|
+
o("ref", s.value);
|
|
30
|
+
});
|
|
31
|
+
function l() {
|
|
32
|
+
return _(t, {
|
|
33
|
+
...i,
|
|
34
|
+
ref: s
|
|
35
|
+
}, () => _(a, { gutter: i.gutter ?? 20 }, { default: () => c() }));
|
|
36
|
+
}
|
|
37
|
+
return l;
|
|
38
|
+
}
|
|
39
|
+
}), ve = /* @__PURE__ */ me(((e, t) => {
|
|
40
|
+
(function(n, r) {
|
|
41
|
+
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs_plugin_utc = r();
|
|
42
|
+
})(e, (function() {
|
|
43
|
+
var e = "minute", t = /[+-]\d\d(?::?\d\d)?/g, n = /([+-]|\d\d)/g;
|
|
44
|
+
return function(r, i, a) {
|
|
45
|
+
var o = i.prototype;
|
|
46
|
+
a.utc = function(e) {
|
|
47
|
+
return new i({
|
|
48
|
+
date: e,
|
|
49
|
+
utc: !0,
|
|
50
|
+
args: arguments
|
|
51
|
+
});
|
|
52
|
+
}, o.utc = function(t) {
|
|
53
|
+
var n = a(this.toDate(), {
|
|
54
|
+
locale: this.$L,
|
|
55
|
+
utc: !0
|
|
56
|
+
});
|
|
57
|
+
return t ? n.add(this.utcOffset(), e) : n;
|
|
58
|
+
}, o.local = function() {
|
|
59
|
+
return a(this.toDate(), {
|
|
60
|
+
locale: this.$L,
|
|
61
|
+
utc: !1
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
var s = o.parse;
|
|
65
|
+
o.parse = function(e) {
|
|
66
|
+
e.utc && (this.$u = !0), this.$utils().u(e.$offset) || (this.$offset = e.$offset), s.call(this, e);
|
|
67
|
+
};
|
|
68
|
+
var c = o.init;
|
|
69
|
+
o.init = function() {
|
|
70
|
+
if (this.$u) {
|
|
71
|
+
var e = this.$d;
|
|
72
|
+
this.$y = e.getUTCFullYear(), this.$M = e.getUTCMonth(), this.$D = e.getUTCDate(), this.$W = e.getUTCDay(), this.$H = e.getUTCHours(), this.$m = e.getUTCMinutes(), this.$s = e.getUTCSeconds(), this.$ms = e.getUTCMilliseconds();
|
|
73
|
+
} else c.call(this);
|
|
74
|
+
};
|
|
75
|
+
var l = o.utcOffset;
|
|
76
|
+
o.utcOffset = function(r, i) {
|
|
77
|
+
var a = this.$utils().u;
|
|
78
|
+
if (a(r)) return this.$u ? 0 : a(this.$offset) ? l.call(this) : this.$offset;
|
|
79
|
+
if (typeof r == "string" && (r = function(e) {
|
|
80
|
+
e === void 0 && (e = "");
|
|
81
|
+
var r = e.match(t);
|
|
82
|
+
if (!r) return null;
|
|
83
|
+
var i = ("" + r[0]).match(n) || [
|
|
84
|
+
"-",
|
|
85
|
+
0,
|
|
86
|
+
0
|
|
87
|
+
], a = i[0], o = 60 * i[1] + +i[2];
|
|
88
|
+
return o === 0 ? 0 : a === "+" ? o : -o;
|
|
89
|
+
}(r), r === null)) return this;
|
|
90
|
+
var o = Math.abs(r) <= 16 ? 60 * r : r;
|
|
91
|
+
if (o === 0) return this.utc(i);
|
|
92
|
+
var s = this.clone();
|
|
93
|
+
if (i) return s.$offset = o, s.$u = !1, s;
|
|
94
|
+
var c = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
|
|
95
|
+
return (s = this.local().add(o + c, e)).$offset = o, s.$x.$localOffset = c, s;
|
|
96
|
+
};
|
|
97
|
+
var u = o.format;
|
|
98
|
+
o.format = function(e) {
|
|
99
|
+
var t = e || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
|
|
100
|
+
return u.call(this, t);
|
|
101
|
+
}, o.valueOf = function() {
|
|
102
|
+
var e = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
|
|
103
|
+
return this.$d.valueOf() - 6e4 * e;
|
|
104
|
+
}, o.isUTC = function() {
|
|
105
|
+
return !!this.$u;
|
|
106
|
+
}, o.toISOString = function() {
|
|
107
|
+
return this.toDate().toISOString();
|
|
108
|
+
}, o.toString = function() {
|
|
109
|
+
return this.toDate().toUTCString();
|
|
110
|
+
};
|
|
111
|
+
var d = o.toDate;
|
|
112
|
+
o.toDate = function(e) {
|
|
113
|
+
return e === "s" && this.$offset ? a(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : d.call(this);
|
|
114
|
+
};
|
|
115
|
+
var f = o.diff;
|
|
116
|
+
o.diff = function(e, t, n) {
|
|
117
|
+
if (e && this.$u === e.$u) return f.call(this, e, t, n);
|
|
118
|
+
var r = this.local(), i = a(e).local();
|
|
119
|
+
return f.call(r, i, t, n);
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
}));
|
|
123
|
+
})), ye = /* @__PURE__ */ me(((e, t) => {
|
|
124
|
+
(function(n, r) {
|
|
125
|
+
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs_plugin_timezone = r();
|
|
126
|
+
})(e, (function() {
|
|
127
|
+
var e = {
|
|
128
|
+
year: 0,
|
|
129
|
+
month: 1,
|
|
130
|
+
day: 2,
|
|
131
|
+
hour: 3,
|
|
132
|
+
minute: 4,
|
|
133
|
+
second: 5
|
|
134
|
+
}, t = {};
|
|
135
|
+
return function(n, r, i) {
|
|
136
|
+
var a, o = function(e, n, r) {
|
|
137
|
+
r === void 0 && (r = {});
|
|
138
|
+
var i = new Date(e);
|
|
139
|
+
return function(e, n) {
|
|
140
|
+
n === void 0 && (n = {});
|
|
141
|
+
var r = n.timeZoneName || "short", i = e + "|" + r, a = t[i];
|
|
142
|
+
return a || (a = new Intl.DateTimeFormat("en-US", {
|
|
143
|
+
hour12: !1,
|
|
144
|
+
timeZone: e,
|
|
145
|
+
year: "numeric",
|
|
146
|
+
month: "2-digit",
|
|
147
|
+
day: "2-digit",
|
|
148
|
+
hour: "2-digit",
|
|
149
|
+
minute: "2-digit",
|
|
150
|
+
second: "2-digit",
|
|
151
|
+
timeZoneName: r
|
|
152
|
+
}), t[i] = a), a;
|
|
153
|
+
}(n, r).formatToParts(i);
|
|
154
|
+
}, s = function(t, n) {
|
|
155
|
+
for (var r = o(t, n), a = [], s = 0; s < r.length; s += 1) {
|
|
156
|
+
var c = r[s], l = c.type, u = c.value, d = e[l];
|
|
157
|
+
d >= 0 && (a[d] = parseInt(u, 10));
|
|
158
|
+
}
|
|
159
|
+
var f = a[3], p = f === 24 ? 0 : f, m = a[0] + "-" + a[1] + "-" + a[2] + " " + p + ":" + a[4] + ":" + a[5] + ":000", h = +t;
|
|
160
|
+
return (i.utc(m).valueOf() - (h -= h % 1e3)) / 6e4;
|
|
161
|
+
}, c = r.prototype;
|
|
162
|
+
c.tz = function(e, t) {
|
|
163
|
+
e === void 0 && (e = a);
|
|
164
|
+
var n, r = this.utcOffset(), o = this.toDate(), s = o.toLocaleString("en-US", { timeZone: e }), c = Math.round((o - new Date(s)) / 1e3 / 60), l = 15 * -Math.round(o.getTimezoneOffset() / 15) - c;
|
|
165
|
+
if (!Number(l)) n = this.utcOffset(0, t);
|
|
166
|
+
else if (n = i(s, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(l, !0), t) {
|
|
167
|
+
var u = n.utcOffset();
|
|
168
|
+
n = n.add(r - u, "minute");
|
|
169
|
+
}
|
|
170
|
+
return n.$x.$timezone = e, n;
|
|
171
|
+
}, c.offsetName = function(e) {
|
|
172
|
+
var t = this.$x.$timezone || i.tz.guess(), n = o(this.valueOf(), t, { timeZoneName: e }).find((function(e) {
|
|
173
|
+
return e.type.toLowerCase() === "timezonename";
|
|
174
|
+
}));
|
|
175
|
+
return n && n.value;
|
|
176
|
+
};
|
|
177
|
+
var l = c.startOf;
|
|
178
|
+
c.startOf = function(e, t) {
|
|
179
|
+
if (!this.$x || !this.$x.$timezone) return l.call(this, e, t);
|
|
180
|
+
var n = i(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
|
|
181
|
+
return l.call(n, e, t).tz(this.$x.$timezone, !0);
|
|
182
|
+
}, i.tz = function(e, t, n) {
|
|
183
|
+
var r = n && t, o = n || t || a, c = s(+i(), o);
|
|
184
|
+
if (typeof e != "string") return i(e).tz(o);
|
|
185
|
+
var l = function(e, t, n) {
|
|
186
|
+
var r = e - 60 * t * 1e3, i = s(r, n);
|
|
187
|
+
if (t === i) return [r, t];
|
|
188
|
+
var a = s(r -= 60 * (i - t) * 1e3, n);
|
|
189
|
+
return i === a ? [r, i] : [e - 60 * Math.min(i, a) * 1e3, Math.max(i, a)];
|
|
190
|
+
}(i.utc(e, r).valueOf(), c, o), u = l[0], d = l[1], f = i(u).utcOffset(d);
|
|
191
|
+
return f.$x.$timezone = o, f;
|
|
192
|
+
}, i.tz.guess = function() {
|
|
193
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
194
|
+
}, i.tz.setDefault = function(e) {
|
|
195
|
+
a = e;
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
}));
|
|
199
|
+
})), be = /* @__PURE__ */ ge(ve()), xe = /* @__PURE__ */ ge(ye()), Se = {
|
|
200
|
+
"dao-ru": "导入",
|
|
201
|
+
"quan-xuan": "全选",
|
|
202
|
+
"xia-zai-dao-ru-mo-ban": "下载导入模板",
|
|
203
|
+
"xu-hao": "序号",
|
|
204
|
+
"qing-shu-ru": "请输入",
|
|
205
|
+
"qing-xuan-ze": "请选择",
|
|
206
|
+
"kai-shi-shi-jian": "开始时间",
|
|
207
|
+
"jie-shu-shi-jian": "结束时间",
|
|
208
|
+
"shai-xuan": "筛选",
|
|
209
|
+
"chong-zhi": "重置",
|
|
210
|
+
"guan-bi": "关闭",
|
|
211
|
+
"zhan-kai": "展开",
|
|
212
|
+
"qu-xiao": "取消",
|
|
213
|
+
"ti-jiao": "提交",
|
|
214
|
+
"que-ding": "确定",
|
|
215
|
+
"que-ding-guan-bi-ma": "确定关闭吗",
|
|
216
|
+
"xia-zai-dao-ru-mo-ban": "下载导入模板",
|
|
217
|
+
excel: {
|
|
218
|
+
fieldsMappingRequired: "请输入列字段映射",
|
|
219
|
+
invalidInput: "非法输入",
|
|
220
|
+
invalidOption: "请输入有效选项!",
|
|
221
|
+
copyFailed: "复制失败",
|
|
222
|
+
sheetNameTooLong: "Sheet名称 \"{0}\" 长度超过31个字符,已自动截断为 \"{1}\""
|
|
223
|
+
},
|
|
224
|
+
validate: { invalidInput: "请输入正确内容" },
|
|
225
|
+
tools: { keysLengthError: "keys 长度必须大于2 默认前两位为 label value" }
|
|
226
|
+
}, Ce = {
|
|
227
|
+
"dao-ru": "Import",
|
|
228
|
+
"quan-xuan": "Select All",
|
|
229
|
+
"xia-zai-dao-ru-mo-ban": "Download Import Template",
|
|
230
|
+
"xu-hao": "No.",
|
|
231
|
+
"qing-shu-ru": "Please enter",
|
|
232
|
+
"qing-xuan-ze": "Please select",
|
|
233
|
+
"kai-shi-shi-jian": "Start Time",
|
|
234
|
+
"jie-shu-shi-jian": "End Time",
|
|
235
|
+
"shai-xuan": "Filter",
|
|
236
|
+
"chong-zhi": "Reset",
|
|
237
|
+
"guan-bi": "Collapse",
|
|
238
|
+
"zhan-kai": "Expand",
|
|
239
|
+
"qu-xiao": "Cancel",
|
|
240
|
+
"ti-jiao": "Submit",
|
|
241
|
+
"que-ding": "Confirm",
|
|
242
|
+
"que-ding-guan-bi-ma": "Are you sure to close?",
|
|
243
|
+
"xia-zai-dao-ru-mo-ban": "Download Import Template",
|
|
244
|
+
excel: {
|
|
245
|
+
fieldsMappingRequired: "Please enter column field mapping",
|
|
246
|
+
invalidInput: "Invalid input",
|
|
247
|
+
invalidOption: "Please enter a valid option!",
|
|
248
|
+
copyFailed: "Copy failed",
|
|
249
|
+
sheetNameTooLong: "Sheet name \"{0}\" exceeds 31 characters, automatically truncated to \"{1}\""
|
|
250
|
+
},
|
|
251
|
+
validate: { invalidInput: "Please enter valid content" },
|
|
252
|
+
tools: { keysLengthError: "Keys length must be greater than 2, default first two are label and value" }
|
|
253
|
+
}, we = {
|
|
254
|
+
zh_cn: Se,
|
|
255
|
+
en_us: Ce
|
|
256
|
+
}, Te = null;
|
|
257
|
+
function Ee(e = null) {
|
|
258
|
+
if (e) {
|
|
259
|
+
let { global: t } = e;
|
|
260
|
+
return t.messages.value.zh_cn ? t.mergeLocaleMessage("zh_cn", Se) : t.setLocaleMessage("zh_cn", Se), t.messages.value.en_us ? t.mergeLocaleMessage("en_us", Ce) : t.setLocaleMessage("en_us", Ce), Te = e, e;
|
|
261
|
+
}
|
|
262
|
+
return Te ||= W({
|
|
263
|
+
legacy: !1,
|
|
264
|
+
locale: "zh_cn",
|
|
265
|
+
fallbackLocale: "zh_cn",
|
|
266
|
+
messages: we
|
|
267
|
+
}), Te;
|
|
46
268
|
}
|
|
47
|
-
|
|
48
|
-
(
|
|
49
|
-
(function(n, a) {
|
|
50
|
-
e.exports = a();
|
|
51
|
-
})(ft, function() {
|
|
52
|
-
var n = "minute", a = /[+-]\d\d(?::?\d\d)?/g, r = /([+-]|\d\d)/g;
|
|
53
|
-
return function(o, l, s) {
|
|
54
|
-
var i = l.prototype;
|
|
55
|
-
s.utc = function(c) {
|
|
56
|
-
var v = { date: c, utc: !0, args: arguments };
|
|
57
|
-
return new l(v);
|
|
58
|
-
}, i.utc = function(c) {
|
|
59
|
-
var v = s(this.toDate(), { locale: this.$L, utc: !0 });
|
|
60
|
-
return c ? v.add(this.utcOffset(), n) : v;
|
|
61
|
-
}, i.local = function() {
|
|
62
|
-
return s(this.toDate(), { locale: this.$L, utc: !1 });
|
|
63
|
-
};
|
|
64
|
-
var g = i.parse;
|
|
65
|
-
i.parse = function(c) {
|
|
66
|
-
c.utc && (this.$u = !0), this.$utils().u(c.$offset) || (this.$offset = c.$offset), g.call(this, c);
|
|
67
|
-
};
|
|
68
|
-
var m = i.init;
|
|
69
|
-
i.init = function() {
|
|
70
|
-
if (this.$u) {
|
|
71
|
-
var c = this.$d;
|
|
72
|
-
this.$y = c.getUTCFullYear(), this.$M = c.getUTCMonth(), this.$D = c.getUTCDate(), this.$W = c.getUTCDay(), this.$H = c.getUTCHours(), this.$m = c.getUTCMinutes(), this.$s = c.getUTCSeconds(), this.$ms = c.getUTCMilliseconds();
|
|
73
|
-
} else
|
|
74
|
-
m.call(this);
|
|
75
|
-
};
|
|
76
|
-
var p = i.utcOffset;
|
|
77
|
-
i.utcOffset = function(c, v) {
|
|
78
|
-
var w = this.$utils().u;
|
|
79
|
-
if (w(c))
|
|
80
|
-
return this.$u ? 0 : w(this.$offset) ? p.call(this) : this.$offset;
|
|
81
|
-
if (typeof c == "string" && (c = function(V) {
|
|
82
|
-
V === void 0 && (V = "");
|
|
83
|
-
var K = V.match(a);
|
|
84
|
-
if (!K)
|
|
85
|
-
return null;
|
|
86
|
-
var I = ("" + K[0]).match(r) || ["-", 0, 0], A = I[0], $ = 60 * +I[1] + +I[2];
|
|
87
|
-
return $ === 0 ? 0 : A === "+" ? $ : -$;
|
|
88
|
-
}(c), c === null))
|
|
89
|
-
return this;
|
|
90
|
-
var x = Math.abs(c) <= 16 ? 60 * c : c;
|
|
91
|
-
if (x === 0)
|
|
92
|
-
return this.utc(v);
|
|
93
|
-
var C = this.clone();
|
|
94
|
-
if (v)
|
|
95
|
-
return C.$offset = x, C.$u = !1, C;
|
|
96
|
-
var S = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
|
|
97
|
-
return (C = this.local().add(x + S, n)).$offset = x, C.$x.$localOffset = S, C;
|
|
98
|
-
};
|
|
99
|
-
var y = i.format;
|
|
100
|
-
i.format = function(c) {
|
|
101
|
-
var v = c || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
|
|
102
|
-
return y.call(this, v);
|
|
103
|
-
}, i.valueOf = function() {
|
|
104
|
-
var c = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
|
|
105
|
-
return this.$d.valueOf() - 6e4 * c;
|
|
106
|
-
}, i.isUTC = function() {
|
|
107
|
-
return !!this.$u;
|
|
108
|
-
}, i.toISOString = function() {
|
|
109
|
-
return this.toDate().toISOString();
|
|
110
|
-
}, i.toString = function() {
|
|
111
|
-
return this.toDate().toUTCString();
|
|
112
|
-
};
|
|
113
|
-
var h = i.toDate;
|
|
114
|
-
i.toDate = function(c) {
|
|
115
|
-
return c === "s" && this.$offset ? s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : h.call(this);
|
|
116
|
-
};
|
|
117
|
-
var f = i.diff;
|
|
118
|
-
i.diff = function(c, v, w) {
|
|
119
|
-
if (c && this.$u === c.$u)
|
|
120
|
-
return f.call(this, c, v, w);
|
|
121
|
-
var x = this.local(), C = s(c).local();
|
|
122
|
-
return f.call(x, C, v, w);
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
});
|
|
126
|
-
})(mt);
|
|
127
|
-
var Kt = mt.exports;
|
|
128
|
-
const Ht = /* @__PURE__ */ ht(Kt);
|
|
129
|
-
var gt = { exports: {} };
|
|
130
|
-
(function(e, t) {
|
|
131
|
-
(function(n, a) {
|
|
132
|
-
e.exports = a();
|
|
133
|
-
})(ft, function() {
|
|
134
|
-
var n = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, a = {};
|
|
135
|
-
return function(r, o, l) {
|
|
136
|
-
var s, i = function(y, h, f) {
|
|
137
|
-
f === void 0 && (f = {});
|
|
138
|
-
var c = new Date(y), v = function(w, x) {
|
|
139
|
-
x === void 0 && (x = {});
|
|
140
|
-
var C = x.timeZoneName || "short", S = w + "|" + C, V = a[S];
|
|
141
|
-
return V || (V = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: w, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: C }), a[S] = V), V;
|
|
142
|
-
}(h, f);
|
|
143
|
-
return v.formatToParts(c);
|
|
144
|
-
}, g = function(y, h) {
|
|
145
|
-
for (var f = i(y, h), c = [], v = 0; v < f.length; v += 1) {
|
|
146
|
-
var w = f[v], x = w.type, C = w.value, S = n[x];
|
|
147
|
-
S >= 0 && (c[S] = parseInt(C, 10));
|
|
148
|
-
}
|
|
149
|
-
var V = c[3], K = V === 24 ? 0 : V, I = c[0] + "-" + c[1] + "-" + c[2] + " " + K + ":" + c[4] + ":" + c[5] + ":000", A = +y;
|
|
150
|
-
return (l.utc(I).valueOf() - (A -= A % 1e3)) / 6e4;
|
|
151
|
-
}, m = o.prototype;
|
|
152
|
-
m.tz = function(y, h) {
|
|
153
|
-
y === void 0 && (y = s);
|
|
154
|
-
var f, c = this.utcOffset(), v = this.toDate(), w = v.toLocaleString("en-US", { timeZone: y }), x = Math.round((v - new Date(w)) / 1e3 / 60), C = 15 * -Math.round(v.getTimezoneOffset() / 15) - x;
|
|
155
|
-
if (!Number(C))
|
|
156
|
-
f = this.utcOffset(0, h);
|
|
157
|
-
else if (f = l(w, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(C, !0), h) {
|
|
158
|
-
var S = f.utcOffset();
|
|
159
|
-
f = f.add(c - S, "minute");
|
|
160
|
-
}
|
|
161
|
-
return f.$x.$timezone = y, f;
|
|
162
|
-
}, m.offsetName = function(y) {
|
|
163
|
-
var h = this.$x.$timezone || l.tz.guess(), f = i(this.valueOf(), h, { timeZoneName: y }).find(function(c) {
|
|
164
|
-
return c.type.toLowerCase() === "timezonename";
|
|
165
|
-
});
|
|
166
|
-
return f && f.value;
|
|
167
|
-
};
|
|
168
|
-
var p = m.startOf;
|
|
169
|
-
m.startOf = function(y, h) {
|
|
170
|
-
if (!this.$x || !this.$x.$timezone)
|
|
171
|
-
return p.call(this, y, h);
|
|
172
|
-
var f = l(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
|
|
173
|
-
return p.call(f, y, h).tz(this.$x.$timezone, !0);
|
|
174
|
-
}, l.tz = function(y, h, f) {
|
|
175
|
-
var c = f && h, v = f || h || s, w = g(+l(), v);
|
|
176
|
-
if (typeof y != "string")
|
|
177
|
-
return l(y).tz(v);
|
|
178
|
-
var x = function(K, I, A) {
|
|
179
|
-
var $ = K - 60 * I * 1e3, ee = g($, A);
|
|
180
|
-
if (I === ee)
|
|
181
|
-
return [$, I];
|
|
182
|
-
var b = g($ -= 60 * (ee - I) * 1e3, A);
|
|
183
|
-
return ee === b ? [$, ee] : [K - 60 * Math.min(ee, b) * 1e3, Math.max(ee, b)];
|
|
184
|
-
}(l.utc(y, c).valueOf(), w, v), C = x[0], S = x[1], V = l(C).utcOffset(S);
|
|
185
|
-
return V.$x.$timezone = v, V;
|
|
186
|
-
}, l.tz.guess = function() {
|
|
187
|
-
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
188
|
-
}, l.tz.setDefault = function(y) {
|
|
189
|
-
s = y;
|
|
190
|
-
};
|
|
191
|
-
};
|
|
192
|
-
});
|
|
193
|
-
})(gt);
|
|
194
|
-
var Nt = gt.exports;
|
|
195
|
-
const Wt = /* @__PURE__ */ ht(Nt), Pe = {
|
|
196
|
-
// 组件通用文本
|
|
197
|
-
"dao-ru": "导入",
|
|
198
|
-
"quan-xuan": "全选",
|
|
199
|
-
"xia-zai-dao-ru-mo-ban": "下载导入模板",
|
|
200
|
-
"xu-hao": "序号",
|
|
201
|
-
"qing-shu-ru": "请输入",
|
|
202
|
-
"qing-xuan-ze": "请选择",
|
|
203
|
-
"kai-shi-shi-jian": "开始时间",
|
|
204
|
-
"jie-shu-shi-jian": "结束时间",
|
|
205
|
-
"shai-xuan": "筛选",
|
|
206
|
-
"chong-zhi": "重置",
|
|
207
|
-
"guan-bi": "关闭",
|
|
208
|
-
"zhan-kai": "展开",
|
|
209
|
-
"qu-xiao": "取消",
|
|
210
|
-
"ti-jiao": "提交",
|
|
211
|
-
"que-ding": "确定",
|
|
212
|
-
"que-ding-guan-bi-ma": "确定关闭吗",
|
|
213
|
-
"xia-zai-dao-ru-mo-ban": "下载导入模板",
|
|
214
|
-
// Excel 工具相关
|
|
215
|
-
excel: {
|
|
216
|
-
fieldsMappingRequired: "请输入列字段映射",
|
|
217
|
-
invalidInput: "非法输入",
|
|
218
|
-
invalidOption: "请输入有效选项!",
|
|
219
|
-
copyFailed: "复制失败",
|
|
220
|
-
sheetNameTooLong: 'Sheet名称 "{0}" 长度超过31个字符,已自动截断为 "{1}"'
|
|
221
|
-
},
|
|
222
|
-
// 表单验证相关
|
|
223
|
-
validate: {
|
|
224
|
-
invalidInput: "请输入正确内容"
|
|
225
|
-
},
|
|
226
|
-
// 工具函数相关
|
|
227
|
-
tools: {
|
|
228
|
-
keysLengthError: "keys 长度必须大于2 默认前两位为 label value"
|
|
229
|
-
}
|
|
230
|
-
}, Ae = {
|
|
231
|
-
// Common component text
|
|
232
|
-
"dao-ru": "Import",
|
|
233
|
-
"quan-xuan": "Select All",
|
|
234
|
-
"xia-zai-dao-ru-mo-ban": "Download Import Template",
|
|
235
|
-
"xu-hao": "No.",
|
|
236
|
-
"qing-shu-ru": "Please enter",
|
|
237
|
-
"qing-xuan-ze": "Please select",
|
|
238
|
-
"kai-shi-shi-jian": "Start Time",
|
|
239
|
-
"jie-shu-shi-jian": "End Time",
|
|
240
|
-
"shai-xuan": "Filter",
|
|
241
|
-
"chong-zhi": "Reset",
|
|
242
|
-
"guan-bi": "Collapse",
|
|
243
|
-
"zhan-kai": "Expand",
|
|
244
|
-
"qu-xiao": "Cancel",
|
|
245
|
-
"ti-jiao": "Submit",
|
|
246
|
-
"que-ding": "Confirm",
|
|
247
|
-
"que-ding-guan-bi-ma": "Are you sure to close?",
|
|
248
|
-
"xia-zai-dao-ru-mo-ban": "Download Import Template",
|
|
249
|
-
// Excel utilities
|
|
250
|
-
excel: {
|
|
251
|
-
fieldsMappingRequired: "Please enter column field mapping",
|
|
252
|
-
invalidInput: "Invalid input",
|
|
253
|
-
invalidOption: "Please enter a valid option!",
|
|
254
|
-
copyFailed: "Copy failed",
|
|
255
|
-
sheetNameTooLong: 'Sheet name "{0}" exceeds 31 characters, automatically truncated to "{1}"'
|
|
256
|
-
},
|
|
257
|
-
// Form validation
|
|
258
|
-
validate: {
|
|
259
|
-
invalidInput: "Please enter valid content"
|
|
260
|
-
},
|
|
261
|
-
// Tool functions
|
|
262
|
-
tools: {
|
|
263
|
-
keysLengthError: "Keys length must be greater than 2, default first two are label and value"
|
|
264
|
-
}
|
|
265
|
-
}, Zt = {
|
|
266
|
-
zh_cn: Pe,
|
|
267
|
-
en_us: Ae
|
|
268
|
-
};
|
|
269
|
-
let Ce = null;
|
|
270
|
-
function Gt(e = null) {
|
|
271
|
-
if (e) {
|
|
272
|
-
const { global: t } = e;
|
|
273
|
-
return t.messages.value.zh_cn ? t.mergeLocaleMessage("zh_cn", Pe) : t.setLocaleMessage("zh_cn", Pe), t.messages.value.en_us ? t.mergeLocaleMessage("en_us", Ae) : t.setLocaleMessage("en_us", Ae), Ce = e, e;
|
|
274
|
-
}
|
|
275
|
-
return Ce || (Ce = At({
|
|
276
|
-
legacy: !1,
|
|
277
|
-
locale: "zh_cn",
|
|
278
|
-
fallbackLocale: "zh_cn",
|
|
279
|
-
messages: Zt
|
|
280
|
-
})), Ce;
|
|
281
|
-
}
|
|
282
|
-
function Ke() {
|
|
283
|
-
return Ce || Gt();
|
|
269
|
+
function De() {
|
|
270
|
+
return Te || Ee();
|
|
284
271
|
}
|
|
285
|
-
function
|
|
286
|
-
|
|
272
|
+
function Z() {
|
|
273
|
+
return De().global.t;
|
|
287
274
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
}), r = null, o;
|
|
275
|
+
U.extend(be.default), U.extend(xe.default);
|
|
276
|
+
async function Oe(e, t) {
|
|
277
|
+
let { fields: n, range: r = 1 } = t;
|
|
278
|
+
if (!n) {
|
|
279
|
+
let e = Z();
|
|
280
|
+
throw Error(e("excel.fieldsMappingRequired"));
|
|
281
|
+
}
|
|
282
|
+
let i = new H.Workbook();
|
|
283
|
+
await i.xlsx.load(e);
|
|
284
|
+
let a = {};
|
|
285
|
+
return i.eachSheet(function(e, t) {
|
|
286
|
+
let i = [];
|
|
287
|
+
e.eachRow(function(e, t) {
|
|
288
|
+
if (t > r) {
|
|
289
|
+
let t = {}, r = !0;
|
|
290
|
+
Object.keys(n).forEach((i) => {
|
|
291
|
+
let a = e.getCell(n[i]).value;
|
|
292
|
+
t[i] = a, a && (r = !1);
|
|
293
|
+
}), r || i.push(t);
|
|
294
|
+
}
|
|
295
|
+
}), a[e._name] = i;
|
|
296
|
+
}), i = null, a;
|
|
311
297
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
});
|
|
328
|
-
ct(g);
|
|
329
|
-
} catch (i) {
|
|
330
|
-
console.log(i);
|
|
331
|
-
}
|
|
298
|
+
var ke = { columnWidth: 30 };
|
|
299
|
+
async function Ae(e, t, n = [], r = {}) {
|
|
300
|
+
if (!e || !t) return;
|
|
301
|
+
let { columnStyle: i } = r, { columnWidth: a } = ke;
|
|
302
|
+
t.forEach((e) => {
|
|
303
|
+
e.width = e.width ? e.width : a;
|
|
304
|
+
});
|
|
305
|
+
let { workbook: o, worksheet: s } = je();
|
|
306
|
+
s.columns = t, s.addRows(n), i && await Me(o, s, i);
|
|
307
|
+
try {
|
|
308
|
+
let t = await o.xlsx.writeBuffer();
|
|
309
|
+
V(new File([t], e, { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" }));
|
|
310
|
+
} catch (e) {
|
|
311
|
+
console.log(e);
|
|
312
|
+
}
|
|
332
313
|
}
|
|
333
|
-
function
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
314
|
+
function je() {
|
|
315
|
+
let e = new H.Workbook();
|
|
316
|
+
return e.creator = "distributor System", e.lastModifiedBy = "distributor System", e.created = /* @__PURE__ */ new Date(), e.modified = /* @__PURE__ */ new Date(), e.lastPrinted = /* @__PURE__ */ new Date(), {
|
|
317
|
+
workbook: e,
|
|
318
|
+
worksheet: e.addWorksheet("Sheet1")
|
|
319
|
+
};
|
|
338
320
|
}
|
|
339
|
-
async function
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
321
|
+
async function Me(e, t, n) {
|
|
322
|
+
let r = Object.keys(n);
|
|
323
|
+
for (let i of r) {
|
|
324
|
+
let r = n[i], { type: a } = r;
|
|
325
|
+
switch (a) {
|
|
326
|
+
case "IMG":
|
|
327
|
+
await Ne(e, t, i, r);
|
|
328
|
+
break;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
349
331
|
}
|
|
350
|
-
async function
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
}
|
|
332
|
+
async function Ne(e, t, n, r) {
|
|
333
|
+
let i = t.getColumn(n), a = i.values;
|
|
334
|
+
t.getColumn(n).width = 20, t.eachRow((e, t) => {
|
|
335
|
+
t > 1 && (e.height = 40);
|
|
336
|
+
});
|
|
337
|
+
for (let n = 0, r = a.length; n < r; n++) {
|
|
338
|
+
if (n < 2) continue;
|
|
339
|
+
let r = a[n];
|
|
340
|
+
r && (t.getCell(i.letter + n).value = "", await Pe(e, t, r, {
|
|
341
|
+
width: 100,
|
|
342
|
+
height: 50,
|
|
343
|
+
col: i._number - 1,
|
|
344
|
+
row: n - 1
|
|
345
|
+
}));
|
|
346
|
+
}
|
|
366
347
|
}
|
|
367
|
-
async function
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
348
|
+
async function Pe(e, t, n, r) {
|
|
349
|
+
let { col: i, row: a, width: o, height: s } = r, { success: c, base64: l } = await Fe(n, .3);
|
|
350
|
+
if (c) {
|
|
351
|
+
let n = e.addImage({
|
|
352
|
+
base64: l,
|
|
353
|
+
extension: "jpeg"
|
|
354
|
+
});
|
|
355
|
+
t.addImage(n, {
|
|
356
|
+
tl: {
|
|
357
|
+
col: i,
|
|
358
|
+
row: a
|
|
359
|
+
},
|
|
360
|
+
ext: {
|
|
361
|
+
width: o,
|
|
362
|
+
height: s
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
}
|
|
379
366
|
}
|
|
380
|
-
function
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
});
|
|
367
|
+
function Fe(e, t = 1) {
|
|
368
|
+
let n = new Image();
|
|
369
|
+
return n.setAttribute("crossOrigin", "anonymous"), n.crossOrigin = "anonymous", n.src = e, new Promise((e, r) => {
|
|
370
|
+
n.onload = () => {
|
|
371
|
+
let r = document.createElement("canvas");
|
|
372
|
+
r.width = n.width, r.height = n.height, r.getContext("2d").drawImage(n, 0, 0, r.width, r.height), e({
|
|
373
|
+
success: !0,
|
|
374
|
+
base64: r.toDataURL("image/jpeg", t)
|
|
375
|
+
});
|
|
376
|
+
}, n.onerror = () => {
|
|
377
|
+
e({ success: !1 });
|
|
378
|
+
};
|
|
379
|
+
});
|
|
394
380
|
}
|
|
395
|
-
|
|
396
|
-
async function
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
S = p[I] || "";
|
|
429
|
-
} else
|
|
430
|
-
C.result != null ? S = C.result : (V = C.value) != null && V.richText ? S = C.value.richText.reduce((K, I) => K + I.text, "") : C.type == 4 && C.value ? S = Fe(C.value).utc().format("YYYY-MM-DD HH:mm:ss") : S = C.value;
|
|
431
|
-
S && x == "option" && (S = S.split(Ue)[1]), f[v] = S, S && (c = !1);
|
|
432
|
-
}), c || i.push(f);
|
|
433
|
-
}
|
|
434
|
-
}), o[l._name] = i;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
}), r = null, o;
|
|
381
|
+
var Ie = "---";
|
|
382
|
+
async function Le(e, t) {
|
|
383
|
+
let { fields: n, range: r = 1 } = t;
|
|
384
|
+
if (!n) {
|
|
385
|
+
let e = Z();
|
|
386
|
+
throw Error(e("excel.fieldsMappingRequired"));
|
|
387
|
+
}
|
|
388
|
+
let i = new H.Workbook();
|
|
389
|
+
await i.xlsx.load(e);
|
|
390
|
+
let a = {};
|
|
391
|
+
return i.eachSheet(function(e, t) {
|
|
392
|
+
if (e.state == "visible") {
|
|
393
|
+
let t = [], o = n[e._name];
|
|
394
|
+
if (o) {
|
|
395
|
+
let n = Object.values(o).some((e) => e.includes("image")), s = {};
|
|
396
|
+
n && (e.getImages().forEach((e) => {
|
|
397
|
+
let { tl: t } = e.range, n = i.model.media.find((t) => t.index === e.imageId);
|
|
398
|
+
if (n) {
|
|
399
|
+
let e = n.buffer.toString("base64"), r = `data:image/${n.extension};base64,${e}`, i = `${Math.ceil(t.row)}_${Math.ceil(t.col)}`;
|
|
400
|
+
s[i] ? s[i].push(r) : s[i] = [r];
|
|
401
|
+
}
|
|
402
|
+
}), console.log("withImages-imageMap", s)), e.eachRow(function(e, i) {
|
|
403
|
+
if (i > r) {
|
|
404
|
+
let r = { _excelRowNumber: i }, a = !0;
|
|
405
|
+
Object.keys(o).forEach((t) => {
|
|
406
|
+
let [c, l] = o[t].split(Ie), u = e.getCell(c), d;
|
|
407
|
+
d = l == "image" && n ? s[`${i}_${u._column._number}`] || "" : u.result == null ? u.value?.richText ? u.value.richText.reduce((e, t) => e + t.text, "") : u.value?.hyperlink ? u.value.text || u.value.hyperlink : u.type == 4 && u.value ? U(u.value).utc().format("YYYY-MM-DD HH:mm:ss") : u.value : u.result, d && l == "option" && (d = d.split(Ie)[1]), r[t] = d, d && (a = !1);
|
|
408
|
+
}), a || t.push(r);
|
|
409
|
+
}
|
|
410
|
+
}), a[e._name] = t;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}), i = null, a;
|
|
438
414
|
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
415
|
+
var Re = {
|
|
416
|
+
date: "yyyy-mm-dd",
|
|
417
|
+
number: "0",
|
|
418
|
+
string: "@"
|
|
443
419
|
};
|
|
444
|
-
async function
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
const a = await n.xlsx.writeBuffer(), r = new File([a], e, {
|
|
490
|
-
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
491
|
-
});
|
|
492
|
-
ct(r);
|
|
493
|
-
} catch (a) {
|
|
494
|
-
console.log(a);
|
|
495
|
-
}
|
|
420
|
+
async function ze(e, t) {
|
|
421
|
+
if (!e || t.length == 0) return;
|
|
422
|
+
let n = Be(t);
|
|
423
|
+
for (let e of n.worksheets) {
|
|
424
|
+
let { columnWidth: r } = ke, i = t[e.name];
|
|
425
|
+
if (!i) continue;
|
|
426
|
+
let { tableHeader: a, tableData: o } = i;
|
|
427
|
+
a.forEach((e) => {
|
|
428
|
+
let { style: t = {}, required: n } = e, { font: r = {} } = t;
|
|
429
|
+
e.style = {
|
|
430
|
+
...t,
|
|
431
|
+
font: {
|
|
432
|
+
...r,
|
|
433
|
+
color: { argb: n ? "FFFF0000" : void 0 }
|
|
434
|
+
}
|
|
435
|
+
};
|
|
436
|
+
}), e.columns = a, e.addRows(o), a.forEach((t) => {
|
|
437
|
+
let { header: i, key: a, width: o, option: s, numFmt: c, locked: l, optionFormater: u } = t, d = e.getColumn(a);
|
|
438
|
+
if (d.numFmt = Re[c] || c, d.width = o || r, d.protection = { locked: l === !0 }, s) {
|
|
439
|
+
let t = n.addWorksheet(a);
|
|
440
|
+
t.state = "hidden", u ||= (e) => `${e.label}${Ie}${e.value}`, t.getColumn(1).values = s.map(u), Array(100).fill("").forEach((t, n) => {
|
|
441
|
+
if (n > 0) {
|
|
442
|
+
let t = Z();
|
|
443
|
+
e.getCell(`${d.letter}${n}`).dataValidation = {
|
|
444
|
+
type: "list",
|
|
445
|
+
formulae: [`${a}!$A$1:$A$${s.length}`],
|
|
446
|
+
showErrorMessage: !0,
|
|
447
|
+
error: t("excel.invalidInput"),
|
|
448
|
+
errorStyle: "stop",
|
|
449
|
+
errorMessage: t("excel.invalidOption")
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
}), a.some((e) => e.locked) && await e.protect("6737187214", {
|
|
455
|
+
selectLockedCells: !0,
|
|
456
|
+
selectUnlockedCells: !0
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
try {
|
|
460
|
+
let t = await n.xlsx.writeBuffer();
|
|
461
|
+
V(new File([t], e, { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" }));
|
|
462
|
+
} catch (e) {
|
|
463
|
+
console.log(e);
|
|
464
|
+
}
|
|
496
465
|
}
|
|
497
|
-
function
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
let o = r, l = !1;
|
|
504
|
-
/[\\/:*?\[\]]/g.test(r) && (r = r.replace(/[\\/:*?\[\]]/g, ""), l = !0), r.length > 31 && (r = r.substring(0, 31).trim(), l = !0, console.warn(t("excel.sheetNameTooLong", [o, r]))), l && (e[r] = e[o], delete e[o]), n.addWorksheet(r);
|
|
505
|
-
}), n;
|
|
466
|
+
function Be(e) {
|
|
467
|
+
let t = Z(), n = new H.Workbook();
|
|
468
|
+
return n.creator = "distributor System", n.lastModifiedBy = "distributor System", n.created = /* @__PURE__ */ new Date(), n.modified = /* @__PURE__ */ new Date(), n.lastPrinted = /* @__PURE__ */ new Date(), Object.keys(e).sort((t, n) => (e[t].sort ?? 0) - (e[n].sort ?? 0)).forEach((r) => {
|
|
469
|
+
let i = r, a = !1;
|
|
470
|
+
/[\\/:*?\[\]]/g.test(r) && (r = r.replace(/[\\/:*?\[\]]/g, ""), a = !0), r.length > 31 && (r = r.substring(0, 31).trim(), a = !0, console.warn(t("excel.sheetNameTooLong", [i, r]))), a && (e[r] = e[i], delete e[i]), n.addWorksheet(r);
|
|
471
|
+
}), n;
|
|
506
472
|
}
|
|
507
|
-
function
|
|
508
|
-
|
|
509
|
-
return String.fromCharCode(65 + e);
|
|
510
|
-
{
|
|
511
|
-
const t = String.fromCharCode(65 + Math.floor((e - 26) / 26)), n = String.fromCharCode(65 + (e - 26) % 26);
|
|
512
|
-
return t + n;
|
|
513
|
-
}
|
|
473
|
+
function Ve(e) {
|
|
474
|
+
return e < 26 ? String.fromCharCode(65 + e) : String.fromCharCode(65 + Math.floor((e - 26) / 26)) + String.fromCharCode(65 + (e - 26) % 26);
|
|
514
475
|
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
476
|
+
//#endregion
|
|
477
|
+
//#region src/utils/tools/tools.js
|
|
478
|
+
function He(e) {
|
|
479
|
+
return new Promise((t) => {
|
|
480
|
+
setTimeout(() => {
|
|
481
|
+
t();
|
|
482
|
+
}, e);
|
|
483
|
+
});
|
|
521
484
|
}
|
|
522
|
-
function
|
|
523
|
-
|
|
485
|
+
function Ue(e) {
|
|
486
|
+
return JSON.parse(JSON.stringify(e));
|
|
524
487
|
}
|
|
525
|
-
function
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
}), n[r.pid].children.push(o));
|
|
537
|
-
}
|
|
538
|
-
return t;
|
|
488
|
+
function We(e) {
|
|
489
|
+
let t = [], n = {}, r = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
|
|
490
|
+
for (let i of e) {
|
|
491
|
+
n[i.id] = {
|
|
492
|
+
...i,
|
|
493
|
+
children: r(n, i.id) ? n[i.id].children : []
|
|
494
|
+
};
|
|
495
|
+
let e = n[i.id];
|
|
496
|
+
i.pid == -1 ? t.push(e) : (r(n, i.pid) || (n[i.pid] = { children: [] }), n[i.pid].children.push(e));
|
|
497
|
+
}
|
|
498
|
+
return t;
|
|
539
499
|
}
|
|
540
|
-
function
|
|
541
|
-
|
|
500
|
+
function Ge(e, t = " ") {
|
|
501
|
+
return e ? e.split(t).filter((e) => e.trim()) : [];
|
|
542
502
|
}
|
|
543
|
-
class
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
503
|
+
var Ke = class {
|
|
504
|
+
constructor(e, t = [
|
|
505
|
+
"label",
|
|
506
|
+
"value",
|
|
507
|
+
"labelEn"
|
|
508
|
+
]) {
|
|
509
|
+
this.list = e.map((e) => ({
|
|
510
|
+
...e,
|
|
511
|
+
label: e[t[0]],
|
|
512
|
+
labelEn: e[t[2]] ?? e[t[0]] ?? "",
|
|
513
|
+
value: e[t[1]]
|
|
514
|
+
})), this.map = new Map(this.list.map((e) => [e[t[1]], e]));
|
|
515
|
+
}
|
|
516
|
+
getName(e) {
|
|
517
|
+
if (!this.has(e)) return "-";
|
|
518
|
+
let t = De().global.locale, { label: n, labelEn: r } = this.map.get(e);
|
|
519
|
+
return (t.value == "zh_cn" ? n : r) ?? n ?? "-";
|
|
520
|
+
}
|
|
521
|
+
getTag(e) {
|
|
522
|
+
if (!this.has(e)) return "info";
|
|
523
|
+
let { tag: t = "info" } = this.map.get(e);
|
|
524
|
+
return t;
|
|
525
|
+
}
|
|
526
|
+
getItem(e) {
|
|
527
|
+
return this.has(e) ? this.map.get(e) : null;
|
|
528
|
+
}
|
|
529
|
+
getColor(e) {
|
|
530
|
+
if (!this.has(e)) return null;
|
|
531
|
+
let { color: t } = this.map.get(e);
|
|
532
|
+
return t;
|
|
533
|
+
}
|
|
534
|
+
has(e) {
|
|
535
|
+
return this.map.has(e);
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
function qe(e, t = [], n = "i18nName") {
|
|
539
|
+
if (e.length == 0) return new Ke([]);
|
|
540
|
+
if (t.length < 2) {
|
|
541
|
+
let e = Z();
|
|
542
|
+
throw Error(e("tools.keysLengthError"));
|
|
543
|
+
}
|
|
544
|
+
return new Ke(e.map((e) => {
|
|
545
|
+
let r = {};
|
|
546
|
+
return n && (r.labelEn = e[n]), t.forEach((t, n) => {
|
|
547
|
+
n === 0 ? r.label = e[t] : n === 1 ? r.value = e[t] : r[t] = e[t];
|
|
548
|
+
}), r;
|
|
549
|
+
}));
|
|
576
550
|
}
|
|
577
|
-
function
|
|
578
|
-
|
|
579
|
-
return new et([]);
|
|
580
|
-
if (t.length < 2) {
|
|
581
|
-
const r = xe();
|
|
582
|
-
throw new Error(r("tools.keysLengthError"));
|
|
583
|
-
}
|
|
584
|
-
let a = e.map((r) => {
|
|
585
|
-
let o = {};
|
|
586
|
-
return n && (o.labelEn = r[n]), t.forEach((l, s) => {
|
|
587
|
-
s === 0 ? o.label = r[l] : s === 1 ? o.value = r[l] : o[l] = r[l];
|
|
588
|
-
}), o;
|
|
589
|
-
});
|
|
590
|
-
return new et(a);
|
|
551
|
+
function Je(e) {
|
|
552
|
+
return e ? e.replace(/<[^>]+>/g, "") : "";
|
|
591
553
|
}
|
|
592
|
-
function
|
|
593
|
-
|
|
554
|
+
function Ye(e) {
|
|
555
|
+
return e ? (e.includes("\\\\u") && (e = e.replace(/\\/g, "")), e.replace(/\\u[\dA-F]{4}/gi, (e) => String.fromCharCode(parseInt(e.replace(/\\u/g, ""), 16)))) : "";
|
|
594
556
|
}
|
|
595
|
-
function
|
|
596
|
-
|
|
557
|
+
function Xe(e, t = 10) {
|
|
558
|
+
let n = 1024 * 1024 * t;
|
|
559
|
+
return !(e.size > n);
|
|
597
560
|
}
|
|
598
|
-
function
|
|
599
|
-
|
|
600
|
-
return !(e.size > n);
|
|
561
|
+
function Ze(e) {
|
|
562
|
+
return Array.from(10).fill(0).map((t, n) => e + "_" + n);
|
|
601
563
|
}
|
|
602
|
-
function
|
|
603
|
-
|
|
564
|
+
function Qe(e) {
|
|
565
|
+
let t = {};
|
|
566
|
+
return e.map((e, n) => {
|
|
567
|
+
let { key: r, option: i, type: a, optionFormater: o } = e, s = Ve(n);
|
|
568
|
+
i && !o ? t[r] = `${s}---option` : a === "image" ? t[r] = `${s}---image` : t[r] = s;
|
|
569
|
+
}), t;
|
|
604
570
|
}
|
|
605
|
-
function
|
|
606
|
-
|
|
607
|
-
return e.map((n, a) => {
|
|
608
|
-
let { key: r, option: o, type: l, optionFormater: s } = n, i = rn(a);
|
|
609
|
-
o && !s ? t[r] = `${i}---option` : l === "image" ? t[r] = `${i}---image` : t[r] = i;
|
|
610
|
-
}), t;
|
|
571
|
+
function $e(e, t) {
|
|
572
|
+
return t.split(".").reduce((e, t) => e && e[t], e);
|
|
611
573
|
}
|
|
612
|
-
|
|
613
|
-
|
|
574
|
+
//#endregion
|
|
575
|
+
//#region \0plugin-vue:export-helper
|
|
576
|
+
var Q = (e, t) => {
|
|
577
|
+
let n = e.__vccOpts || e;
|
|
578
|
+
for (let [e, r] of t) n[e] = r;
|
|
579
|
+
return n;
|
|
580
|
+
}, et = ["onClick"], tt = /* @__PURE__ */ Q({
|
|
581
|
+
__name: "index",
|
|
582
|
+
props: /* @__PURE__ */ y({
|
|
583
|
+
api: { type: Function },
|
|
584
|
+
showCheckAll: {
|
|
585
|
+
type: Boolean,
|
|
586
|
+
default: !0
|
|
587
|
+
},
|
|
588
|
+
maxLimit: {
|
|
589
|
+
type: Number,
|
|
590
|
+
default: void 0
|
|
591
|
+
},
|
|
592
|
+
minLimit: {
|
|
593
|
+
type: Number,
|
|
594
|
+
default: void 0
|
|
595
|
+
},
|
|
596
|
+
optionClick: {
|
|
597
|
+
type: Function,
|
|
598
|
+
default: () => {}
|
|
599
|
+
},
|
|
600
|
+
data: { type: Array },
|
|
601
|
+
labelValue: {
|
|
602
|
+
type: Object,
|
|
603
|
+
default: () => ({
|
|
604
|
+
label: "label",
|
|
605
|
+
labelEn: "labelEn",
|
|
606
|
+
value: "value"
|
|
607
|
+
})
|
|
608
|
+
},
|
|
609
|
+
changeLocal: {
|
|
610
|
+
type: Boolean,
|
|
611
|
+
default: !1
|
|
612
|
+
}
|
|
613
|
+
}, {
|
|
614
|
+
modelValue: {},
|
|
615
|
+
modelModifiers: {}
|
|
616
|
+
}),
|
|
617
|
+
emits: /* @__PURE__ */ y([
|
|
618
|
+
"success",
|
|
619
|
+
"change",
|
|
620
|
+
"changeAll"
|
|
621
|
+
], ["update:modelValue"]),
|
|
622
|
+
setup(e, { emit: t }) {
|
|
623
|
+
let n = e, r = ee(), { t: i, locale: a } = G(), o = I(e, "modelValue"), g = c(() => r["value-key"] != null), _ = k(""), v = c(() => {
|
|
624
|
+
if (r.remote !== void 0) return n.data;
|
|
625
|
+
let e = Ge(_.value), { data: t, labelValue: i } = n, o = t || C.value;
|
|
626
|
+
if (e.length == 0) return o;
|
|
627
|
+
let { label: s, labelEn: c } = i, l = a.value == "en_us" ? c || "i18nName" : s;
|
|
628
|
+
return e.length == 1 ? o.filter((t) => t[l].toLowerCase().includes(e[0].toLowerCase())) : o.filter((t) => {
|
|
629
|
+
let n = !1;
|
|
630
|
+
return n = e.some((e) => t[l].toLowerCase() == e.toLowerCase()), n;
|
|
631
|
+
});
|
|
632
|
+
}), y = c({
|
|
633
|
+
get() {
|
|
634
|
+
return r.multiple == null || o.value == null ? !1 : o.value.length == v.value.length;
|
|
635
|
+
},
|
|
636
|
+
set(e) {
|
|
637
|
+
return e;
|
|
638
|
+
}
|
|
639
|
+
}), S = t, C = k([]);
|
|
640
|
+
n.api && (async () => {
|
|
641
|
+
let { data: e } = await n.api();
|
|
642
|
+
C.value = [...e], S("success", C);
|
|
643
|
+
})();
|
|
644
|
+
function w(e) {
|
|
645
|
+
S("change", e), T.value && x(() => {
|
|
646
|
+
n.optionClick && n.optionClick(T.value), T.value = null;
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
let T = k(null);
|
|
650
|
+
function E() {
|
|
651
|
+
S("change", o.value), x(() => {
|
|
652
|
+
n.optionClick && n.optionClick(null);
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
function O(e) {
|
|
656
|
+
T.value = e;
|
|
657
|
+
}
|
|
658
|
+
let N = n.labelValue.label.split("-"), z = (e) => {
|
|
659
|
+
if (N.length == 1) {
|
|
660
|
+
if (n.changeLocal) return i(e[n.labelValue.label]);
|
|
661
|
+
let t = a.value == "en_us" ? e[n.labelValue.labelEn || "i18nName"] : e[n.labelValue.label];
|
|
662
|
+
return t ||= e[n.labelValue.label], t + "";
|
|
663
|
+
} else {
|
|
664
|
+
let t = [];
|
|
665
|
+
return N.forEach((n) => {
|
|
666
|
+
t.push(e[n]);
|
|
667
|
+
}), t.join("-");
|
|
668
|
+
}
|
|
669
|
+
};
|
|
670
|
+
function B(e) {
|
|
671
|
+
let t = n.data ? n.data : C.value;
|
|
672
|
+
o.value = e ? t.map((e) => g.value ? e : e[n.labelValue.value]) : [], x(() => {
|
|
673
|
+
S("change", o.value), S("changeAll", o.value, t);
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
function V(e) {
|
|
677
|
+
S("change", g.value ? e : e[n.labelValue.value]), x(() => {
|
|
678
|
+
n.optionClick && n.optionClick(e);
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
function H(e) {
|
|
682
|
+
let t = g.value ? e : e[n.labelValue.value], r = g.value ? o.value.some((t) => t[n.labelValue.value] === e[n.labelValue.value]) : o.value.includes(t);
|
|
683
|
+
return !!(n.maxLimit > 0 && o.value.length >= n.maxLimit && !r || n.minLimit > 0 && o.value.length === n.minLimit && r);
|
|
684
|
+
}
|
|
685
|
+
function U(e) {
|
|
686
|
+
return e.map((e) => ({
|
|
687
|
+
...e,
|
|
688
|
+
label: z(e),
|
|
689
|
+
value: g.value ? e : e[n.labelValue.value]
|
|
690
|
+
}));
|
|
691
|
+
}
|
|
692
|
+
let W = k([]);
|
|
693
|
+
W.value = U(n.data ? n.data : C.value), L(() => n.data ? n.data : C.value, (e) => {
|
|
694
|
+
let t = U(e);
|
|
695
|
+
if (t.length !== W.value.length) W.value = t;
|
|
696
|
+
else {
|
|
697
|
+
let e = !1;
|
|
698
|
+
for (let n = 0; n < t.length; n++) if (t[n].value !== W.value[n]?.value) {
|
|
699
|
+
e = !0;
|
|
700
|
+
break;
|
|
701
|
+
}
|
|
702
|
+
e && (W.value = t);
|
|
703
|
+
}
|
|
704
|
+
}, { deep: !0 });
|
|
705
|
+
let ne = c(() => r.multiple !== void 0 && (n.maxLimit > 0 || n.minLimit > 0) ? W.value.map((e) => ({
|
|
706
|
+
...e,
|
|
707
|
+
disabled: H(e)
|
|
708
|
+
})) : W.value);
|
|
709
|
+
return (t, n) => {
|
|
710
|
+
let i = M("el-checkbox"), a = M("el-select-v2"), c = M("el-option"), x = M("el-select");
|
|
711
|
+
return F(r).v2 == null ? (D(), l(x, b({
|
|
712
|
+
key: 1,
|
|
713
|
+
modelValue: o.value,
|
|
714
|
+
"onUpdate:modelValue": n[3] ||= (e) => o.value = e,
|
|
715
|
+
filterable: "",
|
|
716
|
+
"collapse-tags": "",
|
|
717
|
+
"collapse-tags-tooltip": "",
|
|
718
|
+
"filter-method": F(r).remote == null ? (e) => _.value = e : void 0,
|
|
719
|
+
clearable: ""
|
|
720
|
+
}, F(r), { onClear: E }), {
|
|
721
|
+
default: R(() => [F(r).multiple != null && e.showCheckAll && e.maxLimit == null ? j(t.$slots, "header", { key: 0 }, () => [h(i, {
|
|
722
|
+
class: "mgl20",
|
|
723
|
+
modelValue: y.value,
|
|
724
|
+
"onUpdate:modelValue": n[2] ||= (e) => y.value = e,
|
|
725
|
+
onChange: B
|
|
726
|
+
}, {
|
|
727
|
+
default: R(() => [m(P(t.$t("quan-xuan")), 1)]),
|
|
728
|
+
_: 1
|
|
729
|
+
}, 8, ["modelValue"])], !0) : u("", !0), (D(!0), d(s, null, A(v.value, (t, n) => (D(), l(c, {
|
|
730
|
+
key: n,
|
|
731
|
+
label: z(t),
|
|
732
|
+
disabled: F(r).multiple != null && (e.maxLimit > 0 || e.minLimit > 0) ? H(t) : !1,
|
|
733
|
+
onClick: te((e) => V(t), ["stop"]),
|
|
734
|
+
value: g.value ? t : t[e.labelValue.value]
|
|
735
|
+
}, null, 8, [
|
|
736
|
+
"label",
|
|
737
|
+
"disabled",
|
|
738
|
+
"onClick",
|
|
739
|
+
"value"
|
|
740
|
+
]))), 128))]),
|
|
741
|
+
_: 3
|
|
742
|
+
}, 16, ["modelValue", "filter-method"])) : (D(), l(a, b({
|
|
743
|
+
key: 0,
|
|
744
|
+
options: ne.value,
|
|
745
|
+
modelValue: o.value,
|
|
746
|
+
"onUpdate:modelValue": n[1] ||= (e) => o.value = e
|
|
747
|
+
}, F(r), {
|
|
748
|
+
filterable: "",
|
|
749
|
+
"collapse-tags": "",
|
|
750
|
+
"collapse-tags-tooltip": "",
|
|
751
|
+
clearable: "",
|
|
752
|
+
onChange: w
|
|
753
|
+
}), p({
|
|
754
|
+
default: R(({ item: e }) => [f("div", { onClick: (t) => O(e) }, P(e.label), 9, et)]),
|
|
755
|
+
_: 2
|
|
756
|
+
}, [F(r).multiple == null ? void 0 : {
|
|
757
|
+
name: "header",
|
|
758
|
+
fn: R(() => [j(t.$slots, "header", {}, () => [h(i, {
|
|
759
|
+
class: "mgl20",
|
|
760
|
+
modelValue: y.value,
|
|
761
|
+
"onUpdate:modelValue": n[0] ||= (e) => y.value = e,
|
|
762
|
+
onChange: B
|
|
763
|
+
}, {
|
|
764
|
+
default: R(() => [m(P(t.$t("quan-xuan")), 1)]),
|
|
765
|
+
_: 1
|
|
766
|
+
}, 8, ["modelValue"])], !0)]),
|
|
767
|
+
key: "0"
|
|
768
|
+
}]), 1040, ["options", "modelValue"]));
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
}, [["__scopeId", "data-v-12794201"]]), nt = g({ props: { name: {
|
|
772
|
+
tyepe: String,
|
|
773
|
+
required: !0
|
|
774
|
+
} } });
|
|
775
|
+
function rt(e, t, n, r, i, a) {
|
|
776
|
+
let o = M("el-icon");
|
|
777
|
+
return D(), l(o, { class: "cmp-icon" }, {
|
|
778
|
+
default: R(() => [(D(), l(N(e.name)))]),
|
|
779
|
+
_: 1
|
|
780
|
+
});
|
|
614
781
|
}
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
if (x.length == 1) {
|
|
706
|
-
if (n.changeLocal)
|
|
707
|
-
return r(b[n.labelValue.label]);
|
|
708
|
-
let k = o.value == "en_us" ? b[n.labelValue.labelEn || "i18nName"] : b[n.labelValue.label];
|
|
709
|
-
return k = k || b[n.labelValue.label], k + "";
|
|
710
|
-
} else {
|
|
711
|
-
let k = [];
|
|
712
|
-
return x.forEach((R) => {
|
|
713
|
-
k.push(b[R]);
|
|
714
|
-
}), k.join("-");
|
|
715
|
-
}
|
|
716
|
-
};
|
|
717
|
-
function S(b) {
|
|
718
|
-
let k = n.data ? n.data : y.value;
|
|
719
|
-
l.value = b ? k.map((R) => s.value ? R : R[n.labelValue.value]) : [], be(() => {
|
|
720
|
-
p("change", l.value), p("changeAll", l.value, k);
|
|
721
|
-
});
|
|
722
|
-
}
|
|
723
|
-
function V(b) {
|
|
724
|
-
p("change", s.value ? b : b[n.labelValue.value]), be(() => {
|
|
725
|
-
n.optionClick && n.optionClick(b);
|
|
726
|
-
});
|
|
727
|
-
}
|
|
728
|
-
function K(b) {
|
|
729
|
-
const k = s.value ? b : b[n.labelValue.value], R = s.value ? l.value.some((_) => _[n.labelValue.value] === b[n.labelValue.value]) : l.value.includes(k);
|
|
730
|
-
return !!(n.maxLimit > 0 && l.value.length >= n.maxLimit && !R || n.minLimit > 0 && l.value.length === n.minLimit && R);
|
|
731
|
-
}
|
|
732
|
-
function I(b) {
|
|
733
|
-
return b.map((k) => ({
|
|
734
|
-
...k,
|
|
735
|
-
label: C(k),
|
|
736
|
-
value: s.value ? k : k[n.labelValue.value]
|
|
737
|
-
}));
|
|
738
|
-
}
|
|
739
|
-
const A = j([]), $ = n.data ? n.data : y.value;
|
|
740
|
-
A.value = I($), Re(
|
|
741
|
-
() => n.data ? n.data : y.value,
|
|
742
|
-
(b) => {
|
|
743
|
-
var R;
|
|
744
|
-
const k = I(b);
|
|
745
|
-
if (k.length !== A.value.length)
|
|
746
|
-
A.value = k;
|
|
747
|
-
else {
|
|
748
|
-
let _ = !1;
|
|
749
|
-
for (let oe = 0; oe < k.length; oe++)
|
|
750
|
-
if (k[oe].value !== ((R = A.value[oe]) == null ? void 0 : R.value)) {
|
|
751
|
-
_ = !0;
|
|
752
|
-
break;
|
|
753
|
-
}
|
|
754
|
-
_ && (A.value = k);
|
|
755
|
-
}
|
|
756
|
-
},
|
|
757
|
-
{ deep: !0 }
|
|
758
|
-
);
|
|
759
|
-
const ee = ue(() => a.multiple !== void 0 && (n.maxLimit > 0 || n.minLimit > 0) ? A.value.map((b) => ({
|
|
760
|
-
...b,
|
|
761
|
-
disabled: K(b)
|
|
762
|
-
})) : A.value);
|
|
763
|
-
return (b, k) => {
|
|
764
|
-
const R = O("el-checkbox"), _ = O("el-select-v2"), oe = O("el-option"), ge = O("el-select");
|
|
765
|
-
return N(a).v2 != null ? (E(), W(_, de({
|
|
766
|
-
key: 0,
|
|
767
|
-
options: ee.value,
|
|
768
|
-
modelValue: l.value,
|
|
769
|
-
"onUpdate:modelValue": k[1] || (k[1] = (M) => l.value = M)
|
|
770
|
-
}, N(a), {
|
|
771
|
-
filterable: "",
|
|
772
|
-
"collapse-tags": "",
|
|
773
|
-
"collapse-tags-tooltip": "",
|
|
774
|
-
clearable: "",
|
|
775
|
-
onChange: f
|
|
776
|
-
}), at({
|
|
777
|
-
default: D(({ item: M }) => [
|
|
778
|
-
ie("div", {
|
|
779
|
-
onClick: (pe) => w(M)
|
|
780
|
-
}, te(M.label), 9, sn)
|
|
781
|
-
]),
|
|
782
|
-
_: 2
|
|
783
|
-
}, [
|
|
784
|
-
N(a).multiple != null ? {
|
|
785
|
-
name: "header",
|
|
786
|
-
fn: D(() => [
|
|
787
|
-
Q(b.$slots, "header", {}, () => [
|
|
788
|
-
z(R, {
|
|
789
|
-
class: "mgl20",
|
|
790
|
-
modelValue: m.value,
|
|
791
|
-
"onUpdate:modelValue": k[0] || (k[0] = (M) => m.value = M),
|
|
792
|
-
onChange: S
|
|
793
|
-
}, {
|
|
794
|
-
default: D(() => [
|
|
795
|
-
ne(te(b.$t("quan-xuan")), 1)
|
|
796
|
-
]),
|
|
797
|
-
_: 1
|
|
798
|
-
}, 8, ["modelValue"])
|
|
799
|
-
], !0)
|
|
800
|
-
]),
|
|
801
|
-
key: "0"
|
|
802
|
-
} : void 0
|
|
803
|
-
]), 1040, ["options", "modelValue"])) : (E(), W(ge, de({
|
|
804
|
-
key: 1,
|
|
805
|
-
modelValue: l.value,
|
|
806
|
-
"onUpdate:modelValue": k[3] || (k[3] = (M) => l.value = M),
|
|
807
|
-
filterable: "",
|
|
808
|
-
"collapse-tags": "",
|
|
809
|
-
"collapse-tags-tooltip": "",
|
|
810
|
-
"filter-method": N(a).remote != null ? void 0 : (M) => i.value = M,
|
|
811
|
-
clearable: ""
|
|
812
|
-
}, N(a), { onClear: v }), {
|
|
813
|
-
default: D(() => [
|
|
814
|
-
N(a).multiple != null && e.showCheckAll && e.maxLimit == null ? Q(b.$slots, "header", { key: 0 }, () => [
|
|
815
|
-
z(R, {
|
|
816
|
-
class: "mgl20",
|
|
817
|
-
modelValue: m.value,
|
|
818
|
-
"onUpdate:modelValue": k[2] || (k[2] = (M) => m.value = M),
|
|
819
|
-
onChange: S
|
|
820
|
-
}, {
|
|
821
|
-
default: D(() => [
|
|
822
|
-
ne(te(b.$t("quan-xuan")), 1)
|
|
823
|
-
]),
|
|
824
|
-
_: 1
|
|
825
|
-
}, 8, ["modelValue"])
|
|
826
|
-
], !0) : me("", !0),
|
|
827
|
-
(E(!0), ce(Ve, null, rt(g.value, (M, pe) => (E(), W(oe, {
|
|
828
|
-
key: pe,
|
|
829
|
-
label: C(M),
|
|
830
|
-
disabled: N(a).multiple != null && (e.maxLimit > 0 || e.minLimit > 0) ? K(M) : !1,
|
|
831
|
-
onClick: qe((fe) => V(M), ["stop"]),
|
|
832
|
-
value: s.value ? M : M[e.labelValue.value]
|
|
833
|
-
}, null, 8, ["label", "disabled", "onClick", "value"]))), 128))
|
|
834
|
-
]),
|
|
835
|
-
_: 3
|
|
836
|
-
}, 16, ["modelValue", "filter-method"]));
|
|
837
|
-
};
|
|
838
|
-
}
|
|
839
|
-
}, un = /* @__PURE__ */ ke(cn, [["__scopeId", "data-v-12794201"]]);
|
|
840
|
-
const dn = ot({
|
|
841
|
-
props: {
|
|
842
|
-
name: {
|
|
843
|
-
tyepe: String,
|
|
844
|
-
required: !0
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
});
|
|
848
|
-
function fn(e, t, n, a, r, o) {
|
|
849
|
-
const l = O("el-icon");
|
|
850
|
-
return E(), W(l, { class: "cmp-icon" }, {
|
|
851
|
-
default: D(() => [
|
|
852
|
-
(E(), W(st(e.name)))
|
|
853
|
-
]),
|
|
854
|
-
_: 1
|
|
855
|
-
});
|
|
782
|
+
var it = /* @__PURE__ */ Q(nt, [["render", rt], ["__scopeId", "data-v-733f9daa"]]), at = { class: "confirm-button-wrapper" }, ot = /* @__PURE__ */ Q({
|
|
783
|
+
__name: "index",
|
|
784
|
+
emits: ["ok", "no"],
|
|
785
|
+
setup(e, { emit: t }) {
|
|
786
|
+
let n = t, r = re(() => {
|
|
787
|
+
n("ok");
|
|
788
|
+
}, 500);
|
|
789
|
+
function i() {
|
|
790
|
+
n("no");
|
|
791
|
+
}
|
|
792
|
+
return (e, t) => {
|
|
793
|
+
let n = M("el-popconfirm");
|
|
794
|
+
return D(), d("span", at, [h(n, b(e.$attrs, {
|
|
795
|
+
onConfirm: F(r),
|
|
796
|
+
onCancel: i
|
|
797
|
+
}), {
|
|
798
|
+
reference: R(() => [j(e.$slots, "default", {}, void 0, !0)]),
|
|
799
|
+
_: 3
|
|
800
|
+
}, 16, ["onConfirm"])]);
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
}, [["__scopeId", "data-v-24cb35fd"]]), st = { class: "ImportButton" }, ct = ["accept"], lt = /* @__PURE__ */ Q({
|
|
804
|
+
__name: "index",
|
|
805
|
+
props: {
|
|
806
|
+
accept: {
|
|
807
|
+
type: String,
|
|
808
|
+
default: ".xlsx,.xls"
|
|
809
|
+
},
|
|
810
|
+
fields: {
|
|
811
|
+
type: Object,
|
|
812
|
+
default: () => ({})
|
|
813
|
+
},
|
|
814
|
+
fileChange: {
|
|
815
|
+
type: Function,
|
|
816
|
+
required: !0
|
|
817
|
+
}
|
|
818
|
+
},
|
|
819
|
+
emits: ["fileChange"],
|
|
820
|
+
setup(e, { emit: t }) {
|
|
821
|
+
let n = e, r = k(null), i = k(!1);
|
|
822
|
+
async function a(e) {
|
|
823
|
+
i.value = !0;
|
|
824
|
+
let t = e.target.files[0], a = await Le(t, n.fields).catch(() => {
|
|
825
|
+
i.value = !1;
|
|
826
|
+
}).finally(() => {
|
|
827
|
+
r.value.value = null;
|
|
828
|
+
});
|
|
829
|
+
await n.fileChange(a).finally(() => {
|
|
830
|
+
i.value = !1;
|
|
831
|
+
});
|
|
832
|
+
}
|
|
833
|
+
return (t, n) => {
|
|
834
|
+
let o = M("el-button");
|
|
835
|
+
return D(), d("div", st, [h(o, b({
|
|
836
|
+
type: "primary",
|
|
837
|
+
loading: i.value,
|
|
838
|
+
class: "mgr10",
|
|
839
|
+
onClick: n[0] ||= (e) => r.value.click()
|
|
840
|
+
}, t.$attrs), {
|
|
841
|
+
default: R(() => [j(t.$slots, "default", {}, () => [m(P(t.$t("dao-ru")), 1)], !0)]),
|
|
842
|
+
_: 3
|
|
843
|
+
}, 16, ["loading"]), f("input", {
|
|
844
|
+
onChange: a,
|
|
845
|
+
ref_key: "input",
|
|
846
|
+
ref: r,
|
|
847
|
+
accept: e.accept,
|
|
848
|
+
style: {
|
|
849
|
+
position: "absolute",
|
|
850
|
+
width: "0px",
|
|
851
|
+
height: "0px",
|
|
852
|
+
opacity: "0"
|
|
853
|
+
},
|
|
854
|
+
type: "file"
|
|
855
|
+
}, null, 40, ct)]);
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
}, [["__scopeId", "data-v-ea0a4c60"]]);
|
|
859
|
+
//#endregion
|
|
860
|
+
//#region src/components/SearchBar/tools.js
|
|
861
|
+
function ut(e) {
|
|
862
|
+
let t = {};
|
|
863
|
+
return e.forEach((e) => {
|
|
864
|
+
let { key: n, type: r, option: i = {}, value: a, dateType: o = "date" } = e;
|
|
865
|
+
if (n) if (r == "input" && i?.multiple) t[n] = Ge(a);
|
|
866
|
+
else if (r == "date") if (o.includes("range")) {
|
|
867
|
+
let [e, r] = n, [i, s] = a || [];
|
|
868
|
+
i && o == "daterange" && (i = U(i).format("YYYY-MM-DD 00:00:00"), s = U(s).format("YYYY-MM-DD 23:59:59")), t[e] = i, t[r] = s;
|
|
869
|
+
} else t[n] = a;
|
|
870
|
+
else t[n] = a;
|
|
871
|
+
}), t;
|
|
856
872
|
}
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
873
|
+
//#endregion
|
|
874
|
+
//#region src/components/SearchBar/index.vue
|
|
875
|
+
var dt = { key: 0 }, ft = { class: "btns" }, pt = { class: "left" }, mt = { class: "right" }, ht = /* @__PURE__ */ Q({
|
|
876
|
+
__name: "index",
|
|
877
|
+
props: { form: {
|
|
878
|
+
type: Object,
|
|
879
|
+
required: !0
|
|
880
|
+
} },
|
|
881
|
+
emits: [
|
|
882
|
+
"confirm",
|
|
883
|
+
"reset",
|
|
884
|
+
"visibleChange"
|
|
885
|
+
],
|
|
886
|
+
setup(e, { expose: t, emit: n }) {
|
|
887
|
+
let r = e, i = n, a = k(!0), o = k(null), { t: p } = G(), g = {
|
|
888
|
+
datetimerange: "YYYY-MM-DD HH:mm:ss",
|
|
889
|
+
daterange: "YYYY-MM-DD",
|
|
890
|
+
month: "YYYY-MM"
|
|
891
|
+
}, _ = c(() => a.value ? p("guan-bi") : p("zhan-kai"));
|
|
892
|
+
function v() {
|
|
893
|
+
i("confirm");
|
|
894
|
+
}
|
|
895
|
+
function y(e) {
|
|
896
|
+
e.option.onClear && e.option.onClear(), i("confirm");
|
|
897
|
+
}
|
|
898
|
+
function x() {
|
|
899
|
+
i("reset");
|
|
900
|
+
}
|
|
901
|
+
function w() {
|
|
902
|
+
i("confirm");
|
|
903
|
+
}
|
|
904
|
+
function T() {
|
|
905
|
+
return ut(r.form.items);
|
|
906
|
+
}
|
|
907
|
+
let E = ne(r.form.items);
|
|
908
|
+
function O() {
|
|
909
|
+
r.form.items.forEach((e) => {
|
|
910
|
+
let t = E.find((t) => t.key == e.key);
|
|
911
|
+
t && (e.value = t.value);
|
|
912
|
+
});
|
|
913
|
+
}
|
|
914
|
+
return t({
|
|
915
|
+
getPrm: T,
|
|
916
|
+
reset: O
|
|
917
|
+
}), (t, n) => {
|
|
918
|
+
let r = M("el-input"), c = M("el-date-picker"), p = M("el-form-item"), T = M("el-form"), E = M("el-link"), O = M("el-button");
|
|
919
|
+
return D(), d("div", {
|
|
920
|
+
class: "searchBar-container mgt10 mgb10",
|
|
921
|
+
onKeydown: B(v, ["enter"])
|
|
922
|
+
}, [f("div", {
|
|
923
|
+
class: "searchBar",
|
|
924
|
+
style: C({ height: a.value ? "auto" : "32px" })
|
|
925
|
+
}, [h(T, {
|
|
926
|
+
inline: "",
|
|
927
|
+
model: e.form.data
|
|
928
|
+
}, {
|
|
929
|
+
default: R(() => [(D(!0), d(s, null, A(e.form.items.filter((e) => !e.hidden), (e) => (D(), d(s, { key: e.key }, [e.type == "br" ? (D(), d("br", dt)) : (D(), l(p, {
|
|
930
|
+
key: 1,
|
|
931
|
+
label: e.name
|
|
932
|
+
}, {
|
|
933
|
+
default: R(() => [
|
|
934
|
+
e.type === "input" ? (D(), l(r, {
|
|
935
|
+
key: 0,
|
|
936
|
+
modelValue: e.value,
|
|
937
|
+
"onUpdate:modelValue": (t) => e.value = t,
|
|
938
|
+
class: S(e.option?.class || "w150"),
|
|
939
|
+
placeholder: t.$t("qing-shu-ru"),
|
|
940
|
+
clearable: ""
|
|
941
|
+
}, null, 8, [
|
|
942
|
+
"modelValue",
|
|
943
|
+
"onUpdate:modelValue",
|
|
944
|
+
"class",
|
|
945
|
+
"placeholder"
|
|
946
|
+
])) : e.type === "custom" ? (D(), l(N(e.render), { key: 1 })) : u("", !0),
|
|
947
|
+
e.type === "select" ? (D(), l(tt, b({
|
|
948
|
+
key: 2,
|
|
949
|
+
class: e.option?.class || "w150",
|
|
950
|
+
modelValue: e.value,
|
|
951
|
+
"onUpdate:modelValue": (t) => e.value = t
|
|
952
|
+
}, { ref_for: !0 }, e.option, {
|
|
953
|
+
onChange: v,
|
|
954
|
+
onClear: (t) => y(e),
|
|
955
|
+
placeholder: t.$t("qing-xuan-ze")
|
|
956
|
+
}), null, 16, [
|
|
957
|
+
"class",
|
|
958
|
+
"modelValue",
|
|
959
|
+
"onUpdate:modelValue",
|
|
960
|
+
"onClear",
|
|
961
|
+
"placeholder"
|
|
962
|
+
])) : u("", !0),
|
|
963
|
+
e.type === "date" ? (D(), l(c, b({
|
|
964
|
+
key: 3,
|
|
965
|
+
class: {
|
|
966
|
+
datetimerange: "w300",
|
|
967
|
+
daterange: "w200"
|
|
968
|
+
}[e.dateType] || "w100",
|
|
969
|
+
modelValue: e.value,
|
|
970
|
+
"onUpdate:modelValue": (t) => e.value = t,
|
|
971
|
+
"value-format": g[e.dateType] || "YYYY-MM-DD",
|
|
972
|
+
type: e.dateType || "date",
|
|
973
|
+
onFocus: (t) => o.value = e,
|
|
974
|
+
onChange: (t) => w(e),
|
|
975
|
+
placeholder: t.$t("qing-xuan-ze"),
|
|
976
|
+
"start-placeholder": t.$t("kai-shi-shi-jian"),
|
|
977
|
+
"end-placeholder": t.$t("jie-shu-shi-jian")
|
|
978
|
+
}, { ref_for: !0 }, e.option), null, 16, [
|
|
979
|
+
"class",
|
|
980
|
+
"modelValue",
|
|
981
|
+
"onUpdate:modelValue",
|
|
982
|
+
"value-format",
|
|
983
|
+
"type",
|
|
984
|
+
"onFocus",
|
|
985
|
+
"onChange",
|
|
986
|
+
"placeholder",
|
|
987
|
+
"start-placeholder",
|
|
988
|
+
"end-placeholder"
|
|
989
|
+
])) : u("", !0)
|
|
990
|
+
]),
|
|
991
|
+
_: 2
|
|
992
|
+
}, 1032, ["label"]))], 64))), 128))]),
|
|
993
|
+
_: 1
|
|
994
|
+
}, 8, ["model"])], 4), f("div", ft, [f("div", pt, [j(t.$slots, "table-header-left", {}, void 0, !0)]), f("div", mt, [
|
|
995
|
+
h(E, {
|
|
996
|
+
underline: "never",
|
|
997
|
+
class: "mgr10",
|
|
998
|
+
onClick: n[0] ||= () => {
|
|
999
|
+
i("visibleChange", !a.value), a.value = !a.value;
|
|
1000
|
+
}
|
|
1001
|
+
}, {
|
|
1002
|
+
default: R(() => [h(it, { name: a.value ? "ArrowUp" : "ArrowDown" }, null, 8, ["name"]), m(" " + P(_.value), 1)]),
|
|
1003
|
+
_: 1
|
|
1004
|
+
}),
|
|
1005
|
+
h(O, {
|
|
1006
|
+
type: "primary",
|
|
1007
|
+
onClick: v
|
|
1008
|
+
}, {
|
|
1009
|
+
default: R(() => [m(P(t.$t("shai-xuan")), 1)]),
|
|
1010
|
+
_: 1
|
|
1011
|
+
}),
|
|
1012
|
+
h(O, {
|
|
1013
|
+
type: "primary",
|
|
1014
|
+
onClick: x
|
|
1015
|
+
}, {
|
|
1016
|
+
default: R(() => [m(P(t.$t("chong-zhi")), 1)]),
|
|
1017
|
+
_: 1
|
|
1018
|
+
}),
|
|
1019
|
+
j(t.$slots, "btn", {}, void 0, !0)
|
|
1020
|
+
])])], 32);
|
|
1021
|
+
};
|
|
1022
|
+
}
|
|
1023
|
+
}, [["__scopeId", "data-v-db6f71dd"]]), gt = {
|
|
1024
|
+
pageNoKey: "pageNo",
|
|
1025
|
+
pageSizeKey: "pageSize",
|
|
1026
|
+
totalKey: "total",
|
|
1027
|
+
defaultPageSize: 10,
|
|
1028
|
+
pageSizes: [
|
|
1029
|
+
10,
|
|
1030
|
+
50,
|
|
1031
|
+
100,
|
|
1032
|
+
500
|
|
1033
|
+
],
|
|
1034
|
+
responseDataKeys: {
|
|
1035
|
+
rows: [
|
|
1036
|
+
"rows",
|
|
1037
|
+
"records",
|
|
1038
|
+
"list"
|
|
1039
|
+
],
|
|
1040
|
+
total: ["totalRows", "total"]
|
|
1041
|
+
},
|
|
1042
|
+
showSearch: !1,
|
|
1043
|
+
showPage: !1,
|
|
1044
|
+
showShadow: !1,
|
|
1045
|
+
showCheckBox: !1,
|
|
1046
|
+
enableCellCopy: !0
|
|
1047
|
+
}, $ = { ...gt };
|
|
1048
|
+
function _t(e) {
|
|
1049
|
+
$ = {
|
|
1050
|
+
...$,
|
|
1051
|
+
...e,
|
|
1052
|
+
responseDataKeys: {
|
|
1053
|
+
...$.responseDataKeys,
|
|
1054
|
+
...e.responseDataKeys || {}
|
|
1055
|
+
}
|
|
1056
|
+
};
|
|
960
1057
|
}
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
props: {
|
|
964
|
-
form: {
|
|
965
|
-
type: Object,
|
|
966
|
-
required: !0
|
|
967
|
-
}
|
|
968
|
-
},
|
|
969
|
-
emits: ["confirm", "reset", "visibleChange"],
|
|
970
|
-
setup(e, { expose: t, emit: n }) {
|
|
971
|
-
const a = e, r = n, o = j(!0), l = j(null), { t: s } = we(), i = {
|
|
972
|
-
datetimerange: "YYYY-MM-DD HH:mm:ss",
|
|
973
|
-
daterange: "YYYY-MM-DD",
|
|
974
|
-
month: "YYYY-MM"
|
|
975
|
-
}, g = ue(() => o.value ? s("guan-bi") : s("zhan-kai"));
|
|
976
|
-
function m() {
|
|
977
|
-
r("confirm");
|
|
978
|
-
}
|
|
979
|
-
function p(w) {
|
|
980
|
-
w.option.onClear && w.option.onClear(), r("confirm");
|
|
981
|
-
}
|
|
982
|
-
function y() {
|
|
983
|
-
r("reset");
|
|
984
|
-
}
|
|
985
|
-
function h() {
|
|
986
|
-
r("confirm");
|
|
987
|
-
}
|
|
988
|
-
function f() {
|
|
989
|
-
return je(a.form.items);
|
|
990
|
-
}
|
|
991
|
-
const c = ut(a.form.items);
|
|
992
|
-
function v() {
|
|
993
|
-
a.form.items.forEach((w) => {
|
|
994
|
-
const x = c.find((C) => C.key == w.key);
|
|
995
|
-
x && (w.value = x.value);
|
|
996
|
-
});
|
|
997
|
-
}
|
|
998
|
-
return t({ getPrm: f, reset: v }), (w, x) => {
|
|
999
|
-
const C = O("el-input"), S = O("el-date-picker"), V = O("el-form-item"), K = O("el-form"), I = O("el-link"), A = O("el-button");
|
|
1000
|
-
return E(), ce("div", {
|
|
1001
|
-
class: "searchBar-container mgt10 mgb10",
|
|
1002
|
-
onKeydown: Mt(m, ["enter"])
|
|
1003
|
-
}, [
|
|
1004
|
-
ie("div", {
|
|
1005
|
-
class: "searchBar",
|
|
1006
|
-
style: zt({ height: o.value ? "auto" : "32px" })
|
|
1007
|
-
}, [
|
|
1008
|
-
z(K, {
|
|
1009
|
-
inline: "",
|
|
1010
|
-
model: e.form.data
|
|
1011
|
-
}, {
|
|
1012
|
-
default: D(() => [
|
|
1013
|
-
(E(!0), ce(Ve, null, rt(e.form.items.filter(($) => !$.hidden), ($) => (E(), ce(Ve, {
|
|
1014
|
-
key: $.key
|
|
1015
|
-
}, [
|
|
1016
|
-
$.type == "br" ? (E(), ce("br", vn)) : (E(), W(V, {
|
|
1017
|
-
key: 1,
|
|
1018
|
-
label: $.name
|
|
1019
|
-
}, {
|
|
1020
|
-
default: D(() => {
|
|
1021
|
-
var ee, b;
|
|
1022
|
-
return [
|
|
1023
|
-
$.type === "input" ? (E(), W(C, {
|
|
1024
|
-
key: 0,
|
|
1025
|
-
modelValue: $.value,
|
|
1026
|
-
"onUpdate:modelValue": (k) => $.value = k,
|
|
1027
|
-
class: it(((ee = $.option) == null ? void 0 : ee.class) || "w150"),
|
|
1028
|
-
placeholder: w.$t("qing-shu-ru"),
|
|
1029
|
-
clearable: ""
|
|
1030
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) : $.type === "custom" ? (E(), W(st($.render), { key: 1 })) : me("", !0),
|
|
1031
|
-
$.type === "select" ? (E(), W(un, de({
|
|
1032
|
-
key: 2,
|
|
1033
|
-
class: ((b = $.option) == null ? void 0 : b.class) || "w150",
|
|
1034
|
-
modelValue: $.value,
|
|
1035
|
-
"onUpdate:modelValue": (k) => $.value = k
|
|
1036
|
-
}, { ref_for: !0 }, $.option, {
|
|
1037
|
-
onChange: m,
|
|
1038
|
-
onClear: (k) => p($),
|
|
1039
|
-
placeholder: w.$t("qing-xuan-ze")
|
|
1040
|
-
}), null, 16, ["class", "modelValue", "onUpdate:modelValue", "onClear", "placeholder"])) : me("", !0),
|
|
1041
|
-
$.type === "date" ? (E(), W(S, de({
|
|
1042
|
-
key: 3,
|
|
1043
|
-
class: { datetimerange: "w300", daterange: "w200" }[$.dateType] || "w100",
|
|
1044
|
-
modelValue: $.value,
|
|
1045
|
-
"onUpdate:modelValue": (k) => $.value = k,
|
|
1046
|
-
"value-format": i[$.dateType] || "YYYY-MM-DD",
|
|
1047
|
-
type: $.dateType || "date",
|
|
1048
|
-
onFocus: (k) => l.value = $,
|
|
1049
|
-
onChange: (k) => h(),
|
|
1050
|
-
placeholder: w.$t("qing-xuan-ze"),
|
|
1051
|
-
"start-placeholder": w.$t("kai-shi-shi-jian"),
|
|
1052
|
-
"end-placeholder": w.$t("jie-shu-shi-jian")
|
|
1053
|
-
}, { ref_for: !0 }, $.option), null, 16, ["class", "modelValue", "onUpdate:modelValue", "value-format", "type", "onFocus", "onChange", "placeholder", "start-placeholder", "end-placeholder"])) : me("", !0)
|
|
1054
|
-
];
|
|
1055
|
-
}),
|
|
1056
|
-
_: 2
|
|
1057
|
-
}, 1032, ["label"]))
|
|
1058
|
-
], 64))), 128))
|
|
1059
|
-
]),
|
|
1060
|
-
_: 1
|
|
1061
|
-
}, 8, ["model"])
|
|
1062
|
-
], 4),
|
|
1063
|
-
ie("div", bn, [
|
|
1064
|
-
ie("div", wn, [
|
|
1065
|
-
Q(w.$slots, "table-header-left", {}, void 0, !0)
|
|
1066
|
-
]),
|
|
1067
|
-
ie("div", Cn, [
|
|
1068
|
-
z(I, {
|
|
1069
|
-
underline: "never",
|
|
1070
|
-
class: "mgr10",
|
|
1071
|
-
onClick: x[0] || (x[0] = () => {
|
|
1072
|
-
r("visibleChange", !o.value), o.value = !o.value;
|
|
1073
|
-
})
|
|
1074
|
-
}, {
|
|
1075
|
-
default: D(() => [
|
|
1076
|
-
z(vt, {
|
|
1077
|
-
name: o.value ? "ArrowUp" : "ArrowDown"
|
|
1078
|
-
}, null, 8, ["name"]),
|
|
1079
|
-
ne(" " + te(g.value), 1)
|
|
1080
|
-
]),
|
|
1081
|
-
_: 1
|
|
1082
|
-
}),
|
|
1083
|
-
z(A, {
|
|
1084
|
-
type: "primary",
|
|
1085
|
-
onClick: m
|
|
1086
|
-
}, {
|
|
1087
|
-
default: D(() => [
|
|
1088
|
-
ne(te(w.$t("shai-xuan")), 1)
|
|
1089
|
-
]),
|
|
1090
|
-
_: 1
|
|
1091
|
-
}),
|
|
1092
|
-
z(A, {
|
|
1093
|
-
type: "primary",
|
|
1094
|
-
onClick: y
|
|
1095
|
-
}, {
|
|
1096
|
-
default: D(() => [
|
|
1097
|
-
ne(te(w.$t("chong-zhi")), 1)
|
|
1098
|
-
]),
|
|
1099
|
-
_: 1
|
|
1100
|
-
}),
|
|
1101
|
-
Q(w.$slots, "btn", {}, void 0, !0)
|
|
1102
|
-
])
|
|
1103
|
-
])
|
|
1104
|
-
], 32);
|
|
1105
|
-
};
|
|
1106
|
-
}
|
|
1107
|
-
}, kn = /* @__PURE__ */ ke(xn, [["__scopeId", "data-v-db6f71dd"]]), bt = {
|
|
1108
|
-
// 分页参数名
|
|
1109
|
-
pageNoKey: "pageNo",
|
|
1110
|
-
// 页码参数名
|
|
1111
|
-
pageSizeKey: "pageSize",
|
|
1112
|
-
// 每页条数参数名
|
|
1113
|
-
totalKey: "total",
|
|
1114
|
-
// 总条数字段名
|
|
1115
|
-
// 分页默认值
|
|
1116
|
-
defaultPageSize: 10,
|
|
1117
|
-
pageSizes: [10, 50, 100, 500],
|
|
1118
|
-
// 响应数据字段映射
|
|
1119
|
-
responseDataKeys: {
|
|
1120
|
-
rows: ["rows", "records", "list"],
|
|
1121
|
-
// 数据列表字段名(优先级从左到右)
|
|
1122
|
-
total: ["totalRows", "total"]
|
|
1123
|
-
// 总条数字段名
|
|
1124
|
-
},
|
|
1125
|
-
// UI 功能默认配置
|
|
1126
|
-
showSearch: !1,
|
|
1127
|
-
// 是否显示搜索栏
|
|
1128
|
-
showPage: !1,
|
|
1129
|
-
// 是否显示分页
|
|
1130
|
-
showShadow: !1,
|
|
1131
|
-
// 是否显示阴影
|
|
1132
|
-
showCheckBox: !1,
|
|
1133
|
-
// 是否显示复选框列
|
|
1134
|
-
enableCellCopy: !0
|
|
1135
|
-
// 是否启用单元格选区复制功能
|
|
1136
|
-
};
|
|
1137
|
-
let Se = { ...bt };
|
|
1138
|
-
function ro(e) {
|
|
1139
|
-
Se = {
|
|
1140
|
-
...Se,
|
|
1141
|
-
...e,
|
|
1142
|
-
responseDataKeys: {
|
|
1143
|
-
...Se.responseDataKeys,
|
|
1144
|
-
...e.responseDataKeys || {}
|
|
1145
|
-
}
|
|
1146
|
-
};
|
|
1058
|
+
function vt() {
|
|
1059
|
+
return $;
|
|
1147
1060
|
}
|
|
1148
|
-
function
|
|
1149
|
-
|
|
1061
|
+
function yt() {
|
|
1062
|
+
$ = { ...gt };
|
|
1150
1063
|
}
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
}
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
Q(d.$slots, "default", {}, void 0, !0)
|
|
1620
|
-
]),
|
|
1621
|
-
_: 3
|
|
1622
|
-
}, 16, ["id", "loading", "data", "height", "onSortChange"])
|
|
1623
|
-
], 512),
|
|
1624
|
-
e.searchForm.showPage ? (E(), W(se, {
|
|
1625
|
-
key: 1,
|
|
1626
|
-
"current-page": h[N(p)],
|
|
1627
|
-
"onUpdate:currentPage": u[2] || (u[2] = (L) => h[N(p)] = L),
|
|
1628
|
-
class: "myPagination mgt10",
|
|
1629
|
-
background: "",
|
|
1630
|
-
layout: "total, sizes, prev, pager, next",
|
|
1631
|
-
total: h.total,
|
|
1632
|
-
"page-size": h[N(y)],
|
|
1633
|
-
"page-sizes": e.searchForm.pageSizes || N(o).pageSizes,
|
|
1634
|
-
onCurrentChange: xt,
|
|
1635
|
-
onSizeChange: kt
|
|
1636
|
-
}, null, 8, ["current-page", "total", "page-size", "page-sizes"])) : me("", !0)
|
|
1637
|
-
], 2);
|
|
1638
|
-
};
|
|
1639
|
-
}
|
|
1640
|
-
}, io = /* @__PURE__ */ ke(Sn, [["__scopeId", "data-v-c022c16d"]]), co = {
|
|
1641
|
-
__name: "index",
|
|
1642
|
-
props: {
|
|
1643
|
-
sheetsConfig: {
|
|
1644
|
-
type: Object,
|
|
1645
|
-
required: !0
|
|
1646
|
-
},
|
|
1647
|
-
fileName: {
|
|
1648
|
-
type: String,
|
|
1649
|
-
required: !0
|
|
1650
|
-
}
|
|
1651
|
-
},
|
|
1652
|
-
setup(e) {
|
|
1653
|
-
const t = e;
|
|
1654
|
-
function n() {
|
|
1655
|
-
ln(t.fileName, t.sheetsConfig);
|
|
1656
|
-
}
|
|
1657
|
-
return (a, r) => {
|
|
1658
|
-
const o = O("el-link");
|
|
1659
|
-
return E(), W(o, de({
|
|
1660
|
-
type: "primary",
|
|
1661
|
-
underline: "never"
|
|
1662
|
-
}, a.$attrs, { onClick: n }), {
|
|
1663
|
-
default: D(() => [
|
|
1664
|
-
Q(a.$slots, "default", {}, () => [
|
|
1665
|
-
ne(te(a.$t("xia-zai-dao-ru-mo-ban")), 1)
|
|
1666
|
-
])
|
|
1667
|
-
]),
|
|
1668
|
-
_: 3
|
|
1669
|
-
}, 16);
|
|
1670
|
-
};
|
|
1671
|
-
}
|
|
1672
|
-
}, Fn = {
|
|
1673
|
-
mounted(e, t) {
|
|
1674
|
-
t.value && tt(e);
|
|
1675
|
-
},
|
|
1676
|
-
updated(e, t) {
|
|
1677
|
-
t.value ? tt(e) : nt(e);
|
|
1678
|
-
},
|
|
1679
|
-
beforeUnmount(e) {
|
|
1680
|
-
nt(e);
|
|
1681
|
-
}
|
|
1064
|
+
//#endregion
|
|
1065
|
+
//#region src/components/ListPage/index.vue
|
|
1066
|
+
var bt = { class: "center" }, xt = /* @__PURE__ */ Q({
|
|
1067
|
+
__name: "index",
|
|
1068
|
+
props: {
|
|
1069
|
+
id: {
|
|
1070
|
+
type: String,
|
|
1071
|
+
required: !1
|
|
1072
|
+
},
|
|
1073
|
+
loading: {
|
|
1074
|
+
type: Boolean,
|
|
1075
|
+
default: !1
|
|
1076
|
+
},
|
|
1077
|
+
immediate: {
|
|
1078
|
+
type: Boolean,
|
|
1079
|
+
default: !0
|
|
1080
|
+
},
|
|
1081
|
+
searchForm: {
|
|
1082
|
+
type: Object,
|
|
1083
|
+
default: () => ({
|
|
1084
|
+
items: [],
|
|
1085
|
+
selections: []
|
|
1086
|
+
})
|
|
1087
|
+
},
|
|
1088
|
+
api: { type: Function },
|
|
1089
|
+
data: { type: Array },
|
|
1090
|
+
tableConfig: {
|
|
1091
|
+
type: Object,
|
|
1092
|
+
default: () => ({})
|
|
1093
|
+
}
|
|
1094
|
+
},
|
|
1095
|
+
setup(e, { expose: t }) {
|
|
1096
|
+
let { t: n, locale: r } = G(), i = ae(), a = vt(), o = e, s = k(!1), p = k([]);
|
|
1097
|
+
o.searchForm.showSearch === void 0 && (o.searchForm.showSearch = a.showSearch), o.searchForm.showPage === void 0 && (o.searchForm.showPage = a.showPage), o.searchForm.showShadow === void 0 && (o.searchForm.showShadow = a.showShadow), o.searchForm.showCheckBox === void 0 && (o.searchForm.showCheckBox = a.showCheckBox), o.searchForm.enableCellCopy === void 0 && (o.searchForm.enableCellCopy = a.enableCellCopy), o.searchForm.selections || (o.searchForm.selections = []);
|
|
1098
|
+
let g = c(() => {
|
|
1099
|
+
let e = i.path.replace(/\//g, "-").replace(/^-/, "") || "default-table";
|
|
1100
|
+
return o.id ? `listPageId-${e}-${o.id}` : `listPageId-${e}`;
|
|
1101
|
+
}), _ = ne(o.searchForm.items), v = o.searchForm.pageNoKey || a.pageNoKey, y = o.searchForm.pageSizeKey || a.pageSizeKey, C = O({
|
|
1102
|
+
[v]: 1,
|
|
1103
|
+
[y]: o.searchForm.defaultPageSize || a.defaultPageSize,
|
|
1104
|
+
total: 0
|
|
1105
|
+
}), A = k(null), N = k(null), ee = k(450), I = re(() => {
|
|
1106
|
+
x(() => {
|
|
1107
|
+
if (!N.value) return;
|
|
1108
|
+
let e = N.value.getBoundingClientRect(), t = window.innerHeight - e.top - 100;
|
|
1109
|
+
ee.value = Math.max(t, 200);
|
|
1110
|
+
});
|
|
1111
|
+
}, 100), L = () => {
|
|
1112
|
+
I();
|
|
1113
|
+
}, z = () => {
|
|
1114
|
+
if (!o.searchForm.enableCellCopy && !a.enableCellCopy) return !1;
|
|
1115
|
+
let e = A.value;
|
|
1116
|
+
if (!e || !e.$el) return !1;
|
|
1117
|
+
let t = e.$el;
|
|
1118
|
+
return t.classList.add("cell-copy-enabled"), t.setAttribute("tabindex", "-1"), t.removeEventListener("mousedown", J), t.removeEventListener("mousemove", Y), t.removeEventListener("mouseup", X), t.removeEventListener("keydown", he), t.addEventListener("mousedown", J), t.addEventListener("mousemove", Y), t.addEventListener("mouseup", X), t.addEventListener("keydown", he), !0;
|
|
1119
|
+
};
|
|
1120
|
+
w(() => {
|
|
1121
|
+
I(), window.addEventListener("resize", L), (o.searchForm.enableCellCopy || a.enableCellCopy) && (document.addEventListener("mouseup", ge), document.addEventListener("mousedown", _e), setTimeout(() => {
|
|
1122
|
+
z();
|
|
1123
|
+
}, 500));
|
|
1124
|
+
}), E(() => {
|
|
1125
|
+
(o.searchForm.enableCellCopy || a.enableCellCopy) && setTimeout(() => {
|
|
1126
|
+
z();
|
|
1127
|
+
}, 500);
|
|
1128
|
+
}), T(() => {
|
|
1129
|
+
if (window.removeEventListener("resize", L), o.searchForm.enableCellCopy || a.enableCellCopy) {
|
|
1130
|
+
document.removeEventListener("mouseup", ge), document.removeEventListener("mousedown", _e);
|
|
1131
|
+
let e = A.value;
|
|
1132
|
+
if (e && e.$el) {
|
|
1133
|
+
let t = e.$el;
|
|
1134
|
+
t.removeEventListener("mousedown", J), t.removeEventListener("mousemove", Y), t.removeEventListener("mouseup", X), t.removeEventListener("keydown", he);
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
});
|
|
1138
|
+
let B = c(() => ue.value.height || ee.value), V;
|
|
1139
|
+
async function H(e) {
|
|
1140
|
+
let { dataFormat: t } = o.tableConfig;
|
|
1141
|
+
e[v] != 1 && (e.nextSearchAfter = V), s.value = !0;
|
|
1142
|
+
let { code: n, data: r = {} } = await o.api(e).finally(() => {
|
|
1143
|
+
s.value = !1, o.searchForm.selections = [];
|
|
1144
|
+
});
|
|
1145
|
+
if (n == 200) {
|
|
1146
|
+
let e = [];
|
|
1147
|
+
for (let t of a.responseDataKeys.rows) if (r[t]) {
|
|
1148
|
+
e = r[t];
|
|
1149
|
+
break;
|
|
1150
|
+
}
|
|
1151
|
+
let n = 0;
|
|
1152
|
+
for (let e of a.responseDataKeys.total) if (r[e] !== void 0) {
|
|
1153
|
+
n = r[e];
|
|
1154
|
+
break;
|
|
1155
|
+
}
|
|
1156
|
+
p.value = t ? t(e) : e, C.total = n, V = r.nextSearchAfter, (o.searchForm.enableCellCopy || a.enableCellCopy) && x(() => {
|
|
1157
|
+
setTimeout(() => {
|
|
1158
|
+
z();
|
|
1159
|
+
}, 100);
|
|
1160
|
+
});
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
function U(e = {}) {
|
|
1164
|
+
let { searchData: t = () => ({}) } = o.tableConfig, n = t();
|
|
1165
|
+
H({
|
|
1166
|
+
...C,
|
|
1167
|
+
...ut(o.searchForm.items),
|
|
1168
|
+
...e,
|
|
1169
|
+
...n
|
|
1170
|
+
});
|
|
1171
|
+
}
|
|
1172
|
+
function W() {
|
|
1173
|
+
let { reset: e } = o.tableConfig;
|
|
1174
|
+
e && e(), o.searchForm.items.forEach((e) => {
|
|
1175
|
+
let t = _.find((t) => ie(e.key) && ie(t.key) ? e.key.join(",") == t.key.join(",") : t.key == e.key);
|
|
1176
|
+
t && (e.value = t.value);
|
|
1177
|
+
}), U();
|
|
1178
|
+
}
|
|
1179
|
+
o.api && o.immediate && U();
|
|
1180
|
+
function oe() {
|
|
1181
|
+
return {
|
|
1182
|
+
...C,
|
|
1183
|
+
...ut(o.searchForm.items)
|
|
1184
|
+
};
|
|
1185
|
+
}
|
|
1186
|
+
let se = () => {
|
|
1187
|
+
let e = A.value;
|
|
1188
|
+
e && e.clearSort();
|
|
1189
|
+
}, ce = O({ storage: !0 }), le = O({
|
|
1190
|
+
drag: !0,
|
|
1191
|
+
resizable: !0,
|
|
1192
|
+
maxFixedSize: 0
|
|
1193
|
+
}), ue = c(() => {
|
|
1194
|
+
let { customConfig: e, columnConfig: t, ...n } = o.tableConfig;
|
|
1195
|
+
return {
|
|
1196
|
+
headerAlign: "left",
|
|
1197
|
+
align: "center",
|
|
1198
|
+
customConfig: {
|
|
1199
|
+
...ce,
|
|
1200
|
+
...e
|
|
1201
|
+
},
|
|
1202
|
+
columnConfig: {
|
|
1203
|
+
...le,
|
|
1204
|
+
...t
|
|
1205
|
+
},
|
|
1206
|
+
"virtual-x-config": {
|
|
1207
|
+
enabled: !1,
|
|
1208
|
+
scrollToLeftOnChange: !1
|
|
1209
|
+
},
|
|
1210
|
+
"virtual-y-config": {
|
|
1211
|
+
enabled: !0,
|
|
1212
|
+
gt: 100
|
|
1213
|
+
},
|
|
1214
|
+
...n
|
|
1215
|
+
};
|
|
1216
|
+
}), K = O({
|
|
1217
|
+
isSelecting: !1,
|
|
1218
|
+
startCell: null,
|
|
1219
|
+
endCell: null,
|
|
1220
|
+
selectedCells: []
|
|
1221
|
+
}), q = (e) => {
|
|
1222
|
+
let t = e.closest(".vxe-body--column");
|
|
1223
|
+
if (!t || t.classList.contains("col--checkbox") || t.classList.contains("col--seq")) return null;
|
|
1224
|
+
let n = t.closest(".vxe-body--row");
|
|
1225
|
+
if (!n) return null;
|
|
1226
|
+
let r = A.value;
|
|
1227
|
+
if (!r) return null;
|
|
1228
|
+
let i = -1, a = n.getAttribute("data-rowid");
|
|
1229
|
+
if (a != null) i = parseInt(a, 10);
|
|
1230
|
+
else {
|
|
1231
|
+
let e = n.parentElement;
|
|
1232
|
+
i = Array.from(e.querySelectorAll(".vxe-body--row")).indexOf(n);
|
|
1233
|
+
}
|
|
1234
|
+
if (i < 0) return null;
|
|
1235
|
+
let s = -1, c = t.getAttribute("data-colid");
|
|
1236
|
+
if (c && (s = r.getColumns().findIndex((e) => e.id === c)), s < 0) {
|
|
1237
|
+
let e = Array.from(n.querySelectorAll(".vxe-body--column")).indexOf(t), i = !!t.closest(".vxe-table--fixed-left-wrapper"), a = !!t.closest(".vxe-table--fixed-right-wrapper"), c = r.getColumns();
|
|
1238
|
+
if (i) {
|
|
1239
|
+
let t = c.filter((e) => e.fixed === "left");
|
|
1240
|
+
e < t.length && (s = c.indexOf(t[e]));
|
|
1241
|
+
} else if (a) {
|
|
1242
|
+
let t = c.filter((e) => e.fixed === "right");
|
|
1243
|
+
e < t.length && (s = c.indexOf(t[e]));
|
|
1244
|
+
} else {
|
|
1245
|
+
let t = o.searchForm.showCheckBox ? 1 : 0;
|
|
1246
|
+
s = c.filter((e) => e.fixed === "left").length + e - t;
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
return s < 0 ? null : {
|
|
1250
|
+
rowIndex: i,
|
|
1251
|
+
colIndex: s,
|
|
1252
|
+
cell: t
|
|
1253
|
+
};
|
|
1254
|
+
}, J = (e) => {
|
|
1255
|
+
let t = q(e.target);
|
|
1256
|
+
if (!t) {
|
|
1257
|
+
de();
|
|
1258
|
+
return;
|
|
1259
|
+
}
|
|
1260
|
+
K.isSelecting = !0, K.startCell = {
|
|
1261
|
+
rowIndex: t.rowIndex,
|
|
1262
|
+
colIndex: t.colIndex
|
|
1263
|
+
}, K.endCell = { ...K.startCell }, fe(), pe();
|
|
1264
|
+
}, Y = (e) => {
|
|
1265
|
+
if (!K.isSelecting) return;
|
|
1266
|
+
let t = q(e.target);
|
|
1267
|
+
t && (K.endCell = {
|
|
1268
|
+
rowIndex: t.rowIndex,
|
|
1269
|
+
colIndex: t.colIndex
|
|
1270
|
+
}, fe(), pe());
|
|
1271
|
+
}, X = () => {
|
|
1272
|
+
K.isSelecting = !1;
|
|
1273
|
+
}, de = () => {
|
|
1274
|
+
K.selectedCells = [], K.startCell = null, K.endCell = null;
|
|
1275
|
+
let e = A.value;
|
|
1276
|
+
e && e.$el.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach((e) => {
|
|
1277
|
+
e.classList.remove("cell-selected", "cell-border-top", "cell-border-right", "cell-border-bottom", "cell-border-left");
|
|
1278
|
+
});
|
|
1279
|
+
}, fe = () => {
|
|
1280
|
+
if (!K.startCell || !K.endCell) {
|
|
1281
|
+
K.selectedCells = [];
|
|
1282
|
+
return;
|
|
1283
|
+
}
|
|
1284
|
+
let e = K.startCell.rowIndex, t = K.endCell.rowIndex, n = K.startCell.colIndex, r = K.endCell.colIndex, i = Math.min(e, t), a = Math.max(e, t), o = Math.min(n, r), s = Math.max(n, r);
|
|
1285
|
+
K.selectedCells = [];
|
|
1286
|
+
for (let e = i; e <= a; e++) for (let t = o; t <= s; t++) K.selectedCells.push({
|
|
1287
|
+
rowIndex: e,
|
|
1288
|
+
colIndex: t
|
|
1289
|
+
});
|
|
1290
|
+
}, pe = () => {
|
|
1291
|
+
x(() => {
|
|
1292
|
+
let e = A.value;
|
|
1293
|
+
if (!e) return;
|
|
1294
|
+
let t = e.$el;
|
|
1295
|
+
if (t.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach((e) => {
|
|
1296
|
+
e.classList.remove("cell-selected", "cell-border-top", "cell-border-right", "cell-border-bottom", "cell-border-left");
|
|
1297
|
+
}), K.selectedCells.length === 0) return;
|
|
1298
|
+
let n = e.getColumns(), r = K.selectedCells.map((e) => e.rowIndex), i = K.selectedCells.map((e) => e.colIndex), a = Math.min(...r), s = Math.max(...r), c = Math.min(...i), l = Math.max(...i), u = [
|
|
1299
|
+
t.querySelector(".vxe-table--body-wrapper tbody"),
|
|
1300
|
+
t.querySelector(".vxe-table--fixed-left-wrapper tbody"),
|
|
1301
|
+
t.querySelector(".vxe-table--fixed-right-wrapper tbody")
|
|
1302
|
+
].filter(Boolean);
|
|
1303
|
+
K.selectedCells.forEach(({ rowIndex: e, colIndex: t }) => {
|
|
1304
|
+
let r = n[t];
|
|
1305
|
+
if (!r) return;
|
|
1306
|
+
let i = r.fixed === "left", d = r.fixed === "right";
|
|
1307
|
+
for (let f of u) {
|
|
1308
|
+
let u = f.querySelectorAll(".vxe-body--row")[e];
|
|
1309
|
+
if (!u) continue;
|
|
1310
|
+
let p = Array.from(u.querySelectorAll(".vxe-body--column")), m = null;
|
|
1311
|
+
if (i && f.closest(".vxe-table--fixed-left-wrapper")) m = p[n.filter((e) => e.fixed === "left").indexOf(r)];
|
|
1312
|
+
else if (d && f.closest(".vxe-table--fixed-right-wrapper")) m = p[n.filter((e) => e.fixed === "right").indexOf(r)];
|
|
1313
|
+
else if (!i && !d && f.closest(".vxe-table--body-wrapper")) {
|
|
1314
|
+
let e = o.searchForm.showCheckBox ? 1 : 0;
|
|
1315
|
+
m = p[t - n.filter((e) => e.fixed === "left").length + e];
|
|
1316
|
+
}
|
|
1317
|
+
if (m && !m.classList.contains("col--checkbox") && !m.classList.contains("col--seq")) {
|
|
1318
|
+
m.classList.add("cell-selected"), e === a && m.classList.add("cell-border-top"), e === s && m.classList.add("cell-border-bottom"), t === c && m.classList.add("cell-border-left"), t === l && m.classList.add("cell-border-right");
|
|
1319
|
+
break;
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
});
|
|
1323
|
+
});
|
|
1324
|
+
}, me = async () => {
|
|
1325
|
+
if (K.selectedCells.length === 0) return;
|
|
1326
|
+
let e = A.value;
|
|
1327
|
+
if (!e) return;
|
|
1328
|
+
let t = e.$el, n = e.getColumns(), r = [...new Set(K.selectedCells.map((e) => e.rowIndex))].sort((e, t) => e - t), i = [...new Set(K.selectedCells.map((e) => e.colIndex))].sort((e, t) => e - t), a = [
|
|
1329
|
+
t.querySelector(".vxe-table--body-wrapper tbody"),
|
|
1330
|
+
t.querySelector(".vxe-table--fixed-left-wrapper tbody"),
|
|
1331
|
+
t.querySelector(".vxe-table--fixed-right-wrapper tbody")
|
|
1332
|
+
].filter(Boolean), s = [];
|
|
1333
|
+
r.forEach((e) => {
|
|
1334
|
+
let t = [];
|
|
1335
|
+
i.forEach((r) => {
|
|
1336
|
+
let i = n[r];
|
|
1337
|
+
if (!i) {
|
|
1338
|
+
t.push("");
|
|
1339
|
+
return;
|
|
1340
|
+
}
|
|
1341
|
+
let s = i.fixed === "left", c = i.fixed === "right", l = "";
|
|
1342
|
+
for (let t of a) {
|
|
1343
|
+
let a = t.querySelectorAll(".vxe-body--row")[e];
|
|
1344
|
+
if (!a) continue;
|
|
1345
|
+
let u = Array.from(a.querySelectorAll(".vxe-body--column")), d = null;
|
|
1346
|
+
if (s && t.closest(".vxe-table--fixed-left-wrapper")) d = u[n.filter((e) => e.fixed === "left").indexOf(i)];
|
|
1347
|
+
else if (c && t.closest(".vxe-table--fixed-right-wrapper")) d = u[n.filter((e) => e.fixed === "right").indexOf(i)];
|
|
1348
|
+
else if (!s && !c && t.closest(".vxe-table--body-wrapper")) {
|
|
1349
|
+
let e = o.searchForm.showCheckBox ? 1 : 0;
|
|
1350
|
+
d = u[r - n.filter((e) => e.fixed === "left").length + e];
|
|
1351
|
+
}
|
|
1352
|
+
if (d && !d.classList.contains("col--checkbox") && !d.classList.contains("col--seq")) {
|
|
1353
|
+
l = d.innerText || d.textContent || "", l = l.trim(), l = l.replace(/\n/g, " ").replace(/\s+/g, " ");
|
|
1354
|
+
break;
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
t.push(l);
|
|
1358
|
+
}), s.push(t.join(" "));
|
|
1359
|
+
});
|
|
1360
|
+
let c = s.join("\n");
|
|
1361
|
+
try {
|
|
1362
|
+
await navigator.clipboard.writeText(c);
|
|
1363
|
+
} catch (e) {
|
|
1364
|
+
console.error("复制失败:", e);
|
|
1365
|
+
}
|
|
1366
|
+
}, he = (e) => {
|
|
1367
|
+
!o.searchForm.enableCellCopy && !a.enableCellCopy || ((e.ctrlKey || e.metaKey) && e.key === "c" ? K.selectedCells.length > 0 && (e.preventDefault(), e.stopPropagation(), me()) : e.key === "Escape" && de());
|
|
1368
|
+
}, ge = () => {
|
|
1369
|
+
K.isSelecting = !1;
|
|
1370
|
+
}, _e = (e) => {
|
|
1371
|
+
let t = A.value;
|
|
1372
|
+
!t || !t.$el || t.$el.contains(e.target) || de();
|
|
1373
|
+
}, ve = (e) => {
|
|
1374
|
+
C[v] = e, U();
|
|
1375
|
+
}, ye = (e) => {
|
|
1376
|
+
C[y] = e, C[v] = 1, U();
|
|
1377
|
+
};
|
|
1378
|
+
function be() {
|
|
1379
|
+
let e = A.value.getCheckboxRecords();
|
|
1380
|
+
o.searchForm.selections = e;
|
|
1381
|
+
}
|
|
1382
|
+
let xe = (e) => {
|
|
1383
|
+
let t = A.value;
|
|
1384
|
+
if (t) {
|
|
1385
|
+
t.toggleCheckboxRow(e);
|
|
1386
|
+
let n = A.value.getCheckboxRecords();
|
|
1387
|
+
o.searchForm.selections = n;
|
|
1388
|
+
}
|
|
1389
|
+
};
|
|
1390
|
+
return t({
|
|
1391
|
+
tableRef: A,
|
|
1392
|
+
getList: U,
|
|
1393
|
+
getPrm: oe,
|
|
1394
|
+
clearSort: se,
|
|
1395
|
+
calculateTableHeight: I
|
|
1396
|
+
}), (t, n) => {
|
|
1397
|
+
let i = M("el-button"), o = M("el-checkbox"), c = M("el-text"), _ = M("vxe-column"), x = M("VxeTable"), w = M("el-pagination");
|
|
1398
|
+
return D(), d("div", { class: S({ box: e.searchForm.showShadow }) }, [
|
|
1399
|
+
e.searchForm.showSearch ? (D(), l(ht, {
|
|
1400
|
+
key: 0,
|
|
1401
|
+
form: e.searchForm,
|
|
1402
|
+
onReset: W,
|
|
1403
|
+
onConfirm: n[1] ||= (e) => U(),
|
|
1404
|
+
onVisibleChange: F(I)
|
|
1405
|
+
}, {
|
|
1406
|
+
btn: R(() => [
|
|
1407
|
+
n[3] ||= f("span", { class: "mgr10" }, null, -1),
|
|
1408
|
+
j(t.$slots, "search-bar-btn", {}, void 0, !0),
|
|
1409
|
+
h(i, {
|
|
1410
|
+
class: "mgl10",
|
|
1411
|
+
round: "",
|
|
1412
|
+
onClick: n[0] ||= (e) => A.value.openCustom()
|
|
1413
|
+
}, {
|
|
1414
|
+
default: R(() => [h(it, { name: "Tools" })]),
|
|
1415
|
+
_: 1
|
|
1416
|
+
})
|
|
1417
|
+
]),
|
|
1418
|
+
_: 3
|
|
1419
|
+
}, 8, ["form", "onVisibleChange"])) : u("", !0),
|
|
1420
|
+
j(t.$slots, "table-header-left", {}, void 0, !0),
|
|
1421
|
+
f("div", {
|
|
1422
|
+
ref_key: "tableContentRef",
|
|
1423
|
+
ref: N
|
|
1424
|
+
}, [h(x, b({
|
|
1425
|
+
id: g.value,
|
|
1426
|
+
ref_key: "tableRef",
|
|
1427
|
+
ref: A,
|
|
1428
|
+
loading: e.loading || s.value,
|
|
1429
|
+
data: e.api ? p.value : e.data,
|
|
1430
|
+
border: ""
|
|
1431
|
+
}, ue.value, {
|
|
1432
|
+
height: B.value,
|
|
1433
|
+
onCheckboxChange: be,
|
|
1434
|
+
onCheckboxAll: be,
|
|
1435
|
+
onSortChange: ue.value["sort-config"]?.sortChange
|
|
1436
|
+
}), {
|
|
1437
|
+
default: R(() => [e.searchForm.showCheckBox == null || e.searchForm.showCheckBox ? (D(), l(_, {
|
|
1438
|
+
key: 0,
|
|
1439
|
+
type: "checkbox",
|
|
1440
|
+
width: F(r) == "zh_cn" ? 80 : 150,
|
|
1441
|
+
title: t.$t("xu-hao"),
|
|
1442
|
+
fixed: "left"
|
|
1443
|
+
}, {
|
|
1444
|
+
checkbox: R(({ rowIndex: e, row: t, checked: n, disabled: r, indeterminate: i }) => [f("div", bt, [n ? (D(), l(o, {
|
|
1445
|
+
key: 0,
|
|
1446
|
+
checked: !0,
|
|
1447
|
+
disabled: r,
|
|
1448
|
+
size: "default",
|
|
1449
|
+
onClick: te((e) => !r && xe(t), ["stop"])
|
|
1450
|
+
}, null, 8, ["disabled", "onClick"])) : (D(), l(o, {
|
|
1451
|
+
key: 1,
|
|
1452
|
+
disabled: r,
|
|
1453
|
+
checked: !1,
|
|
1454
|
+
size: "default",
|
|
1455
|
+
onClick: te((e) => !r && xe(t), ["stop"])
|
|
1456
|
+
}, null, 8, ["disabled", "onClick"])), h(c, {
|
|
1457
|
+
type: "info",
|
|
1458
|
+
class: "mgl5"
|
|
1459
|
+
}, {
|
|
1460
|
+
default: R(() => [m(P(e + 1), 1)]),
|
|
1461
|
+
_: 2
|
|
1462
|
+
}, 1024)])]),
|
|
1463
|
+
_: 1
|
|
1464
|
+
}, 8, ["width", "title"])) : u("", !0), j(t.$slots, "default", {}, void 0, !0)]),
|
|
1465
|
+
_: 3
|
|
1466
|
+
}, 16, [
|
|
1467
|
+
"id",
|
|
1468
|
+
"loading",
|
|
1469
|
+
"data",
|
|
1470
|
+
"height",
|
|
1471
|
+
"onSortChange"
|
|
1472
|
+
])], 512),
|
|
1473
|
+
e.searchForm.showPage ? (D(), l(w, {
|
|
1474
|
+
key: 1,
|
|
1475
|
+
"current-page": C[F(v)],
|
|
1476
|
+
"onUpdate:currentPage": n[2] ||= (e) => C[F(v)] = e,
|
|
1477
|
+
class: "myPagination mgt10",
|
|
1478
|
+
background: "",
|
|
1479
|
+
layout: "total, sizes, prev, pager, next",
|
|
1480
|
+
total: C.total,
|
|
1481
|
+
"page-size": C[F(y)],
|
|
1482
|
+
"page-sizes": e.searchForm.pageSizes || F(a).pageSizes,
|
|
1483
|
+
onCurrentChange: ve,
|
|
1484
|
+
onSizeChange: ye
|
|
1485
|
+
}, null, 8, [
|
|
1486
|
+
"current-page",
|
|
1487
|
+
"total",
|
|
1488
|
+
"page-size",
|
|
1489
|
+
"page-sizes"
|
|
1490
|
+
])) : u("", !0)
|
|
1491
|
+
], 2);
|
|
1492
|
+
};
|
|
1493
|
+
}
|
|
1494
|
+
}, [["__scopeId", "data-v-c022c16d"]]), St = {
|
|
1495
|
+
__name: "index",
|
|
1496
|
+
props: {
|
|
1497
|
+
sheetsConfig: {
|
|
1498
|
+
type: Object,
|
|
1499
|
+
required: !0
|
|
1500
|
+
},
|
|
1501
|
+
fileName: {
|
|
1502
|
+
type: String,
|
|
1503
|
+
required: !0
|
|
1504
|
+
}
|
|
1505
|
+
},
|
|
1506
|
+
setup(e) {
|
|
1507
|
+
let t = e;
|
|
1508
|
+
function n() {
|
|
1509
|
+
ze(t.fileName, t.sheetsConfig);
|
|
1510
|
+
}
|
|
1511
|
+
return (e, t) => {
|
|
1512
|
+
let r = M("el-link");
|
|
1513
|
+
return D(), l(r, b({
|
|
1514
|
+
type: "primary",
|
|
1515
|
+
underline: "never"
|
|
1516
|
+
}, e.$attrs, { onClick: n }), {
|
|
1517
|
+
default: R(() => [j(e.$slots, "default", {}, () => [m(P(e.$t("xia-zai-dao-ru-mo-ban")), 1)])]),
|
|
1518
|
+
_: 3
|
|
1519
|
+
}, 16);
|
|
1520
|
+
};
|
|
1521
|
+
}
|
|
1522
|
+
}, Ct = {
|
|
1523
|
+
mounted(e, t) {
|
|
1524
|
+
t.value && wt(e);
|
|
1525
|
+
},
|
|
1526
|
+
updated(e, t) {
|
|
1527
|
+
t.value ? wt(e) : Tt(e);
|
|
1528
|
+
},
|
|
1529
|
+
beforeUnmount(e) {
|
|
1530
|
+
Tt(e);
|
|
1531
|
+
}
|
|
1682
1532
|
};
|
|
1683
|
-
async function
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
return new Promise((h, f) => {
|
|
1746
|
-
setTimeout(() => {
|
|
1747
|
-
h();
|
|
1748
|
-
}, 500);
|
|
1749
|
-
});
|
|
1750
|
-
}
|
|
1751
|
-
e.__mouseDown__ = i, e.__mouseUp__ = m, e.__mouseMove__ = g, e.__sizeChange__ = p;
|
|
1533
|
+
async function wt(e) {
|
|
1534
|
+
await f();
|
|
1535
|
+
let t = e.querySelector(".el-dialog");
|
|
1536
|
+
if (!t) return;
|
|
1537
|
+
let n = e.querySelector(".el-dialog__header"), r = e.querySelector(".el-overlay");
|
|
1538
|
+
r.style.cssText += "overflow: hidden;", n.style.cursor = "move";
|
|
1539
|
+
let i = !1, a = {
|
|
1540
|
+
window: {
|
|
1541
|
+
width: 0,
|
|
1542
|
+
height: 0
|
|
1543
|
+
},
|
|
1544
|
+
dialog: {
|
|
1545
|
+
x: 0,
|
|
1546
|
+
y: 0,
|
|
1547
|
+
width: 0,
|
|
1548
|
+
height: 0,
|
|
1549
|
+
marginTop: ""
|
|
1550
|
+
},
|
|
1551
|
+
mouse: {
|
|
1552
|
+
x: 0,
|
|
1553
|
+
y: 0
|
|
1554
|
+
},
|
|
1555
|
+
drag: {
|
|
1556
|
+
x: 0,
|
|
1557
|
+
y: 0
|
|
1558
|
+
}
|
|
1559
|
+
};
|
|
1560
|
+
n.addEventListener("mousedown", c), document.addEventListener("mousemove", l), document.addEventListener("mouseup", u), window.addEventListener("resize", d);
|
|
1561
|
+
function o() {
|
|
1562
|
+
a.mouse.x - a.drag.x >= a.dialog.x && (a.drag.x = a.mouse.x - a.dialog.x), a.drag.x - a.mouse.x >= a.window.width - (a.dialog.x + a.dialog.width) && (a.drag.x = a.mouse.x + a.window.width - a.dialog.x - a.dialog.width), a.mouse.y - a.drag.y >= a.dialog.y && (a.drag.y = a.mouse.y - a.dialog.y), a.drag.y - a.mouse.y >= a.window.height - (a.dialog.y + a.dialog.height) && (a.drag.y = a.mouse.y + a.window.height - a.dialog.y - a.dialog.height), s();
|
|
1563
|
+
}
|
|
1564
|
+
function s() {
|
|
1565
|
+
let e = a.drag.y - a.mouse.y + a.dialog.y, n = a.drag.x - a.mouse.x + a.dialog.x;
|
|
1566
|
+
t.style.cssText += `position: absolute; top: calc(${e}px - ${a.dialog.marginTop}); left: ${n}px;`;
|
|
1567
|
+
}
|
|
1568
|
+
function c(e) {
|
|
1569
|
+
e.button === 0 && (a.window = {
|
|
1570
|
+
width: document.body.clientWidth,
|
|
1571
|
+
height: document.body.clientHeight
|
|
1572
|
+
}, a.dialog = t.getBoundingClientRect(), a.dialog.marginTop = window.getComputedStyle(t).marginTop, a.mouse = {
|
|
1573
|
+
x: e.clientX,
|
|
1574
|
+
y: e.clientY
|
|
1575
|
+
}, i = !0);
|
|
1576
|
+
}
|
|
1577
|
+
function l(e) {
|
|
1578
|
+
i && (a.drag = {
|
|
1579
|
+
x: e.clientX,
|
|
1580
|
+
y: e.clientY
|
|
1581
|
+
}, r.style.userSelect = "none", o());
|
|
1582
|
+
}
|
|
1583
|
+
function u(e) {
|
|
1584
|
+
r.style.userSelect = "auto", i = !1;
|
|
1585
|
+
}
|
|
1586
|
+
function d(e) {}
|
|
1587
|
+
function f() {
|
|
1588
|
+
return new Promise((e, t) => {
|
|
1589
|
+
setTimeout(() => {
|
|
1590
|
+
e();
|
|
1591
|
+
}, 500);
|
|
1592
|
+
});
|
|
1593
|
+
}
|
|
1594
|
+
e.__mouseDown__ = c, e.__mouseUp__ = u, e.__mouseMove__ = l, e.__sizeChange__ = d;
|
|
1752
1595
|
}
|
|
1753
|
-
function
|
|
1754
|
-
|
|
1596
|
+
function Tt(e) {
|
|
1597
|
+
document.removeEventListener("mousedown", e.__mouseDown__), document.removeEventListener("mousemove", e.__mouseMove__), document.removeEventListener("mouseup", e.__mouseUp__), window.removeEventListener("resize", e.__sizeChange__);
|
|
1755
1598
|
}
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
onClick: N(o)
|
|
1855
|
-
}, {
|
|
1856
|
-
default: D(() => [
|
|
1857
|
-
ne(te(s.$t("ti-jiao")), 1)
|
|
1858
|
-
]),
|
|
1859
|
-
_: 1
|
|
1860
|
-
}, 8, ["onClick"])
|
|
1861
|
-
])
|
|
1862
|
-
]),
|
|
1863
|
-
key: "0"
|
|
1864
|
-
} : void 0
|
|
1865
|
-
]), 1032, ["modelValue", "title", "width"])
|
|
1866
|
-
])), [
|
|
1867
|
-
[N(Fn), e.layer.show]
|
|
1868
|
-
]);
|
|
1869
|
-
};
|
|
1870
|
-
}
|
|
1599
|
+
//#endregion
|
|
1600
|
+
//#region src/components/Layer/index.vue
|
|
1601
|
+
var Et = {
|
|
1602
|
+
key: 0,
|
|
1603
|
+
class: "drawer-btn"
|
|
1604
|
+
}, Dt = { key: 1 }, Ot = {
|
|
1605
|
+
__name: "index",
|
|
1606
|
+
props: {
|
|
1607
|
+
layer: {
|
|
1608
|
+
type: Object,
|
|
1609
|
+
default: () => ({
|
|
1610
|
+
show: !1,
|
|
1611
|
+
type: "layer",
|
|
1612
|
+
title: "",
|
|
1613
|
+
showButton: !1
|
|
1614
|
+
}),
|
|
1615
|
+
required: !0
|
|
1616
|
+
},
|
|
1617
|
+
loading: {
|
|
1618
|
+
type: Boolean,
|
|
1619
|
+
default: !1
|
|
1620
|
+
}
|
|
1621
|
+
},
|
|
1622
|
+
emits: ["confirm"],
|
|
1623
|
+
setup(e, { emit: t }) {
|
|
1624
|
+
let n = e, r = t, { t: a } = G(), o = re(() => {
|
|
1625
|
+
r("confirm");
|
|
1626
|
+
}, 300);
|
|
1627
|
+
async function s() {
|
|
1628
|
+
n.layer.type == "drawer" ? n.layer.onClose ? n.layer.onClose() : n.layer.closeConfirm ? await i.confirm(a("que-ding-guan-bi-ma"), {
|
|
1629
|
+
confirmButtonText: a("que-ding"),
|
|
1630
|
+
cancelButtonText: a("qu-xiao"),
|
|
1631
|
+
type: "warning"
|
|
1632
|
+
}).catch(() => {}) == "confirm" && (n.layer.show = !1) : n.layer.show = !1 : n.layer.show = !1;
|
|
1633
|
+
}
|
|
1634
|
+
return (t, n) => {
|
|
1635
|
+
let r = M("el-button"), i = M("el-drawer"), a = M("el-dialog");
|
|
1636
|
+
return e.layer.type ? (D(), l(i, {
|
|
1637
|
+
key: 0,
|
|
1638
|
+
modelValue: e.layer.show,
|
|
1639
|
+
"onUpdate:modelValue": n[0] ||= (t) => e.layer.show = t,
|
|
1640
|
+
size: e.layer.width || "100%",
|
|
1641
|
+
title: e.layer.title,
|
|
1642
|
+
direction: "rtl",
|
|
1643
|
+
"append-to-body": "",
|
|
1644
|
+
"before-close": s,
|
|
1645
|
+
class: "drawer-content"
|
|
1646
|
+
}, {
|
|
1647
|
+
default: R(() => [
|
|
1648
|
+
j(t.$slots, "default"),
|
|
1649
|
+
n[2] ||= f("p", { class: "mgt50" }, null, -1),
|
|
1650
|
+
e.layer.showButton ? (D(), d("div", Et, [j(t.$slots, "btn", {}, () => [h(r, { onClick: s }, {
|
|
1651
|
+
default: R(() => [m(P(t.$t("qu-xiao")), 1)]),
|
|
1652
|
+
_: 1
|
|
1653
|
+
}), h(r, {
|
|
1654
|
+
type: "primary",
|
|
1655
|
+
loading: e.loading,
|
|
1656
|
+
onClick: F(o)
|
|
1657
|
+
}, {
|
|
1658
|
+
default: R(() => [m(P(t.$t("ti-jiao")), 1)]),
|
|
1659
|
+
_: 1
|
|
1660
|
+
}, 8, ["loading", "onClick"])])])) : u("", !0)
|
|
1661
|
+
]),
|
|
1662
|
+
_: 3
|
|
1663
|
+
}, 8, [
|
|
1664
|
+
"modelValue",
|
|
1665
|
+
"size",
|
|
1666
|
+
"title"
|
|
1667
|
+
])) : z((D(), d("div", Dt, [h(a, {
|
|
1668
|
+
"close-on-click-modal": !1,
|
|
1669
|
+
modelValue: e.layer.show,
|
|
1670
|
+
"onUpdate:modelValue": n[1] ||= (t) => e.layer.show = t,
|
|
1671
|
+
title: e.layer.title,
|
|
1672
|
+
width: e.layer.width || 500,
|
|
1673
|
+
center: ""
|
|
1674
|
+
}, p({
|
|
1675
|
+
default: R(() => [j(t.$slots, "default")]),
|
|
1676
|
+
_: 2
|
|
1677
|
+
}, [e.layer.showButton ? {
|
|
1678
|
+
name: "footer",
|
|
1679
|
+
fn: R(() => [j(t.$slots, "btn", {}, () => [h(r, { onClick: s }, {
|
|
1680
|
+
default: R(() => [m(P(t.$t("qu-xiao")), 1)]),
|
|
1681
|
+
_: 1
|
|
1682
|
+
}), h(r, {
|
|
1683
|
+
type: "primary",
|
|
1684
|
+
onClick: F(o)
|
|
1685
|
+
}, {
|
|
1686
|
+
default: R(() => [m(P(t.$t("ti-jiao")), 1)]),
|
|
1687
|
+
_: 1
|
|
1688
|
+
}, 8, ["onClick"])])]),
|
|
1689
|
+
key: "0"
|
|
1690
|
+
} : void 0]), 1032, [
|
|
1691
|
+
"modelValue",
|
|
1692
|
+
"title",
|
|
1693
|
+
"width"
|
|
1694
|
+
])])), [[F(Ct), e.layer.show]]);
|
|
1695
|
+
};
|
|
1696
|
+
}
|
|
1871
1697
|
};
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
constructor(t = {}) {
|
|
1892
|
-
this.config = {
|
|
1893
|
-
clientCode: t.clientCode || "one-portal",
|
|
1894
|
-
casServerUrl: `https://one-portal${t.isTest ? "-test" : ""}.joy-group.com/api`,
|
|
1895
|
-
casPortalUrl: `https://one-portal${t.isTest ? "-test" : ""}.joy-group.com`,
|
|
1896
|
-
serviceUrl: t.serviceUrl || window.location.origin + "/cas/callback",
|
|
1897
|
-
tokenKey: t.tokenKey || "one_portal_token",
|
|
1898
|
-
userKey: t.userKey || "one_portal_user",
|
|
1899
|
-
debug: t.debug || !1,
|
|
1900
|
-
autoLogin: t.autoLogin !== !1,
|
|
1901
|
-
// 默认开启自动登录
|
|
1902
|
-
loginCallback: t.loginCallback || null,
|
|
1903
|
-
logoutCallback: t.logoutCallback || null,
|
|
1904
|
-
errorCallback: t.errorCallback || null
|
|
1905
|
-
}, this.token = null, this.user = null, this.init();
|
|
1906
|
-
}
|
|
1907
|
-
/**
|
|
1908
|
-
* 初始化SDK
|
|
1909
|
-
*/
|
|
1910
|
-
init() {
|
|
1911
|
-
this.log("OnePortal CAS SDK 初始化中..."), this.loadFromStorage();
|
|
1912
|
-
const n = new URLSearchParams(window.location.search).get("ticket");
|
|
1913
|
-
this.isLoggedIn() && this.config.loginCallback ? this.config.loginCallback(this.user, this.token) : n ? (this.log("检测到ST票据:", n), this.validateTicket(n)) : this.config.autoLogin && !this.isLoggedIn() && (this.log("用户未登录,准备跳转到CAS登录页面"), this.login());
|
|
1914
|
-
}
|
|
1915
|
-
/**
|
|
1916
|
-
* 从本地存储加载数据
|
|
1917
|
-
*/
|
|
1918
|
-
loadFromStorage() {
|
|
1919
|
-
try {
|
|
1920
|
-
this.token = localStorage.getItem(this.config.tokenKey);
|
|
1921
|
-
const t = localStorage.getItem(this.config.userKey);
|
|
1922
|
-
t && (this.user = JSON.parse(t)), this.log("从本地存储加载数据:", { token: !!this.token, user: !!this.user });
|
|
1923
|
-
} catch (t) {
|
|
1924
|
-
this.log("加载本地存储数据失败:", t);
|
|
1925
|
-
}
|
|
1926
|
-
}
|
|
1927
|
-
/**
|
|
1928
|
-
* 保存到本地存储
|
|
1929
|
-
*/
|
|
1930
|
-
saveToStorage() {
|
|
1931
|
-
try {
|
|
1932
|
-
this.token && localStorage.setItem(this.config.tokenKey, this.token), this.user && localStorage.setItem(this.config.userKey, JSON.stringify(this.user)), this.log("数据已保存到本地存储");
|
|
1933
|
-
} catch (t) {
|
|
1934
|
-
this.log("保存到本地存储失败:", t);
|
|
1935
|
-
}
|
|
1936
|
-
}
|
|
1937
|
-
/**
|
|
1938
|
-
* 清除本地存储
|
|
1939
|
-
*/
|
|
1940
|
-
clearStorage() {
|
|
1941
|
-
try {
|
|
1942
|
-
localStorage.removeItem(this.config.tokenKey), localStorage.removeItem(this.config.userKey), this.log("本地存储已清除");
|
|
1943
|
-
} catch (t) {
|
|
1944
|
-
this.log("清除本地存储失败:", t);
|
|
1945
|
-
}
|
|
1946
|
-
}
|
|
1947
|
-
/**
|
|
1948
|
-
* 检查用户是否已登录
|
|
1949
|
-
*/
|
|
1950
|
-
isLoggedIn() {
|
|
1951
|
-
return !!(this.token && this.user);
|
|
1952
|
-
}
|
|
1953
|
-
/**
|
|
1954
|
-
* 获取当前用户信息
|
|
1955
|
-
*/
|
|
1956
|
-
getUser() {
|
|
1957
|
-
return this.user;
|
|
1958
|
-
}
|
|
1959
|
-
/**
|
|
1960
|
-
* 获取当前token
|
|
1961
|
-
*/
|
|
1962
|
-
getToken() {
|
|
1963
|
-
return this.token;
|
|
1964
|
-
}
|
|
1965
|
-
/**
|
|
1966
|
-
* 登录 - 跳转到CAS登录页面
|
|
1967
|
-
*/
|
|
1968
|
-
login() {
|
|
1969
|
-
const t = `${this.config.casPortalUrl}?appCode=${this.config.clientCode}&redirectUrl=${encodeURIComponent(this.config.serviceUrl)}`;
|
|
1970
|
-
this.log("跳转到CAS登录页面:", t), window.location.href = t;
|
|
1971
|
-
}
|
|
1972
|
-
/**
|
|
1973
|
-
* 验证ST票据
|
|
1974
|
-
*/
|
|
1975
|
-
async validateTicket(t) {
|
|
1976
|
-
try {
|
|
1977
|
-
this.log("验证ST票据:", t);
|
|
1978
|
-
const n = await fetch(`${this.config.casServerUrl}/auth/validateST?ticket=${t}`, {
|
|
1979
|
-
method: "GET",
|
|
1980
|
-
headers: {
|
|
1981
|
-
"Content-Type": "application/json"
|
|
1982
|
-
}
|
|
1983
|
-
});
|
|
1984
|
-
if (!n.ok)
|
|
1985
|
-
throw new Error(`HTTP ${n.status}: ${n.statusText}`);
|
|
1986
|
-
const a = await n.json();
|
|
1987
|
-
if (a.success && a.data)
|
|
1988
|
-
return this.token = a.data.token, this.user = a.data.user, this.saveToStorage(), this.clearTicketFromUrl(), this.log("ST票据验证成功,用户登录成功:", this.user), this.config.loginCallback && this.config.loginCallback(this.user, this.token), !0;
|
|
1989
|
-
throw new Error(a.message || "ST票据验证失败");
|
|
1990
|
-
} catch (n) {
|
|
1991
|
-
return this.log("ST票据验证失败:", n), this.handleError(n), !1;
|
|
1992
|
-
}
|
|
1993
|
-
}
|
|
1994
|
-
/**
|
|
1995
|
-
* 清除URL中的ticket参数
|
|
1996
|
-
*/
|
|
1997
|
-
clearTicketFromUrl() {
|
|
1998
|
-
const t = new URL(window.location);
|
|
1999
|
-
t.searchParams.delete("ticket"), window.history.replaceState({}, document.title, t.toString());
|
|
2000
|
-
}
|
|
2001
|
-
/**
|
|
2002
|
-
* 登出
|
|
2003
|
-
*/
|
|
2004
|
-
async logout(t = !0) {
|
|
2005
|
-
try {
|
|
2006
|
-
if (this.log("用户登出"), this.token)
|
|
2007
|
-
try {
|
|
2008
|
-
await fetch(`${this.config.casServerUrl}/auth/logout`, {
|
|
2009
|
-
method: "POST",
|
|
2010
|
-
headers: {
|
|
2011
|
-
AppId: this.config.clientCode,
|
|
2012
|
-
Authorization: `Bearer ${this.token}`,
|
|
2013
|
-
"Content-Type": "application/json"
|
|
2014
|
-
}
|
|
2015
|
-
});
|
|
2016
|
-
} catch (n) {
|
|
2017
|
-
this.log("调用服务端登出接口失败:", n);
|
|
2018
|
-
}
|
|
2019
|
-
this.token = null, this.user = null, this.clearStorage(), this.config.logoutCallback && this.config.logoutCallback(), t && this.login();
|
|
2020
|
-
} catch (n) {
|
|
2021
|
-
this.log("登出失败:", n), this.handleError(n);
|
|
2022
|
-
}
|
|
2023
|
-
}
|
|
2024
|
-
/**
|
|
2025
|
-
* 发送带认证的HTTP请求
|
|
2026
|
-
*/
|
|
2027
|
-
async request(t, n = {}) {
|
|
2028
|
-
const a = {
|
|
2029
|
-
headers: {
|
|
2030
|
-
"Content-Type": "application/json",
|
|
2031
|
-
...n.headers
|
|
2032
|
-
},
|
|
2033
|
-
...n
|
|
2034
|
-
};
|
|
2035
|
-
a.headers.appId = this.config.clientCode, this.token && (a.headers.Authorization = `Bearer ${this.token}`);
|
|
2036
|
-
try {
|
|
2037
|
-
const r = await fetch(t, a);
|
|
2038
|
-
return r.status === 401 ? (this.log("Token已过期,需要重新登录"), this.logout(), null) : r;
|
|
2039
|
-
} catch (r) {
|
|
2040
|
-
throw this.log("请求失败:", r), r;
|
|
2041
|
-
}
|
|
2042
|
-
}
|
|
2043
|
-
/**
|
|
2044
|
-
* 获取用户信息(从服务端)
|
|
2045
|
-
*/
|
|
2046
|
-
async fetchUserInfo() {
|
|
2047
|
-
try {
|
|
2048
|
-
const t = await this.request(`${this.config.casServerUrl}/auth/user`);
|
|
2049
|
-
if (t && t.ok) {
|
|
2050
|
-
const n = await t.json();
|
|
2051
|
-
if (n.success && n.data)
|
|
2052
|
-
return this.user = n.data, this.saveToStorage(), this.user;
|
|
2053
|
-
}
|
|
2054
|
-
return null;
|
|
2055
|
-
} catch (t) {
|
|
2056
|
-
return this.log("获取用户信息失败:", t), null;
|
|
2057
|
-
}
|
|
2058
|
-
}
|
|
2059
|
-
/**
|
|
2060
|
-
* 刷新token
|
|
2061
|
-
*/
|
|
2062
|
-
async refreshToken() {
|
|
2063
|
-
this.log("Token刷新功能暂未实现");
|
|
2064
|
-
}
|
|
2065
|
-
/**
|
|
2066
|
-
* 错误处理
|
|
2067
|
-
*/
|
|
2068
|
-
handleError(t) {
|
|
2069
|
-
this.log("发生错误:", t), this.config.errorCallback && this.config.errorCallback(t);
|
|
2070
|
-
}
|
|
2071
|
-
/**
|
|
2072
|
-
* 日志输出
|
|
2073
|
-
*/
|
|
2074
|
-
log(...t) {
|
|
2075
|
-
this.config.debug && console.log("[OnePortal CAS SDK]", ...t);
|
|
2076
|
-
}
|
|
2077
|
-
/**
|
|
2078
|
-
* 检查登录状态并自动处理
|
|
2079
|
-
*/
|
|
2080
|
-
checkLoginStatus() {
|
|
2081
|
-
return !this.isLoggedIn() && this.config.autoLogin ? (this.login(), !1) : this.isLoggedIn();
|
|
2082
|
-
}
|
|
2083
|
-
/**
|
|
2084
|
-
* 设置配置
|
|
2085
|
-
*/
|
|
2086
|
-
setConfig(t, n) {
|
|
2087
|
-
this.config[t] = n;
|
|
2088
|
-
}
|
|
2089
|
-
/**
|
|
2090
|
-
* 获取配置
|
|
2091
|
-
*/
|
|
2092
|
-
getConfig(t) {
|
|
2093
|
-
return this.config[t];
|
|
2094
|
-
}
|
|
1698
|
+
//#endregion
|
|
1699
|
+
//#region src/utils/tools/validate.js
|
|
1700
|
+
function kt(e, t = {}) {
|
|
1701
|
+
let n = Z(), r = {
|
|
1702
|
+
inForm: !0,
|
|
1703
|
+
required: !0,
|
|
1704
|
+
...t
|
|
1705
|
+
}, i = {
|
|
1706
|
+
phone: /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/,
|
|
1707
|
+
password: /(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/,
|
|
1708
|
+
email: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
|
|
1709
|
+
}[e], { inForm: a, value: o, required: s, msg: c = n("validate.invalidInput") } = r;
|
|
1710
|
+
return a ? function(e, t, n) {
|
|
1711
|
+
if (s) {
|
|
1712
|
+
i.test(t) ? n() : n(Error(c));
|
|
1713
|
+
return;
|
|
1714
|
+
}
|
|
1715
|
+
t && !i.test(t) ? n(Error(c)) : n();
|
|
1716
|
+
} : i.test(o);
|
|
2095
1717
|
}
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
1718
|
+
//#endregion
|
|
1719
|
+
//#region src/utils/tools/one-portal-cas-sdk.js
|
|
1720
|
+
var At = class {
|
|
1721
|
+
constructor(e = {}) {
|
|
1722
|
+
this.config = {
|
|
1723
|
+
clientCode: e.clientCode || "one-portal",
|
|
1724
|
+
casServerUrl: `https://one-portal${e.isTest ? "-test" : ""}.joy-group.com/api`,
|
|
1725
|
+
casPortalUrl: `https://one-portal${e.isTest ? "-test" : ""}.joy-group.com`,
|
|
1726
|
+
serviceUrl: e.serviceUrl || window.location.origin + "/cas/callback",
|
|
1727
|
+
tokenKey: e.tokenKey || "one_portal_token",
|
|
1728
|
+
userKey: e.userKey || "one_portal_user",
|
|
1729
|
+
debug: e.debug || !1,
|
|
1730
|
+
autoLogin: e.autoLogin !== !1,
|
|
1731
|
+
loginCallback: e.loginCallback || null,
|
|
1732
|
+
logoutCallback: e.logoutCallback || null,
|
|
1733
|
+
errorCallback: e.errorCallback || null
|
|
1734
|
+
}, this.token = null, this.user = null, this.init();
|
|
1735
|
+
}
|
|
1736
|
+
init() {
|
|
1737
|
+
this.log("OnePortal CAS SDK 初始化中..."), this.loadFromStorage();
|
|
1738
|
+
let e = new URLSearchParams(window.location.search).get("ticket");
|
|
1739
|
+
this.isLoggedIn() && this.config.loginCallback ? this.config.loginCallback(this.user, this.token) : e ? (this.log("检测到ST票据:", e), this.validateTicket(e)) : this.config.autoLogin && !this.isLoggedIn() && (this.log("用户未登录,准备跳转到CAS登录页面"), this.login());
|
|
1740
|
+
}
|
|
1741
|
+
loadFromStorage() {
|
|
1742
|
+
try {
|
|
1743
|
+
this.token = localStorage.getItem(this.config.tokenKey);
|
|
1744
|
+
let e = localStorage.getItem(this.config.userKey);
|
|
1745
|
+
e && (this.user = JSON.parse(e)), this.log("从本地存储加载数据:", {
|
|
1746
|
+
token: !!this.token,
|
|
1747
|
+
user: !!this.user
|
|
1748
|
+
});
|
|
1749
|
+
} catch (e) {
|
|
1750
|
+
this.log("加载本地存储数据失败:", e);
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
saveToStorage() {
|
|
1754
|
+
try {
|
|
1755
|
+
this.token && localStorage.setItem(this.config.tokenKey, this.token), this.user && localStorage.setItem(this.config.userKey, JSON.stringify(this.user)), this.log("数据已保存到本地存储");
|
|
1756
|
+
} catch (e) {
|
|
1757
|
+
this.log("保存到本地存储失败:", e);
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
clearStorage() {
|
|
1761
|
+
try {
|
|
1762
|
+
localStorage.removeItem(this.config.tokenKey), localStorage.removeItem(this.config.userKey), this.log("本地存储已清除");
|
|
1763
|
+
} catch (e) {
|
|
1764
|
+
this.log("清除本地存储失败:", e);
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1767
|
+
isLoggedIn() {
|
|
1768
|
+
return !!(this.token && this.user);
|
|
1769
|
+
}
|
|
1770
|
+
getUser() {
|
|
1771
|
+
return this.user;
|
|
1772
|
+
}
|
|
1773
|
+
getToken() {
|
|
1774
|
+
return this.token;
|
|
1775
|
+
}
|
|
1776
|
+
login() {
|
|
1777
|
+
let e = `${this.config.casPortalUrl}?appCode=${this.config.clientCode}&redirectUrl=${encodeURIComponent(this.config.serviceUrl)}`;
|
|
1778
|
+
this.log("跳转到CAS登录页面:", e), window.location.href = e;
|
|
1779
|
+
}
|
|
1780
|
+
async validateTicket(e) {
|
|
1781
|
+
try {
|
|
1782
|
+
this.log("验证ST票据:", e);
|
|
1783
|
+
let t = await fetch(`${this.config.casServerUrl}/auth/validateST?ticket=${e}`, {
|
|
1784
|
+
method: "GET",
|
|
1785
|
+
headers: { "Content-Type": "application/json" }
|
|
1786
|
+
});
|
|
1787
|
+
if (!t.ok) throw Error(`HTTP ${t.status}: ${t.statusText}`);
|
|
1788
|
+
let n = await t.json();
|
|
1789
|
+
if (n.success && n.data) return this.token = n.data.token, this.user = n.data.user, this.saveToStorage(), this.clearTicketFromUrl(), this.log("ST票据验证成功,用户登录成功:", this.user), this.config.loginCallback && this.config.loginCallback(this.user, this.token), !0;
|
|
1790
|
+
throw Error(n.message || "ST票据验证失败");
|
|
1791
|
+
} catch (e) {
|
|
1792
|
+
return this.log("ST票据验证失败:", e), this.handleError(e), !1;
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1795
|
+
clearTicketFromUrl() {
|
|
1796
|
+
let e = new URL(window.location);
|
|
1797
|
+
e.searchParams.delete("ticket"), window.history.replaceState({}, document.title, e.toString());
|
|
1798
|
+
}
|
|
1799
|
+
async logout(e = !0) {
|
|
1800
|
+
try {
|
|
1801
|
+
if (this.log("用户登出"), this.token) try {
|
|
1802
|
+
await fetch(`${this.config.casServerUrl}/auth/logout`, {
|
|
1803
|
+
method: "POST",
|
|
1804
|
+
headers: {
|
|
1805
|
+
AppId: this.config.clientCode,
|
|
1806
|
+
Authorization: `Bearer ${this.token}`,
|
|
1807
|
+
"Content-Type": "application/json"
|
|
1808
|
+
}
|
|
1809
|
+
});
|
|
1810
|
+
} catch (e) {
|
|
1811
|
+
this.log("调用服务端登出接口失败:", e);
|
|
1812
|
+
}
|
|
1813
|
+
this.token = null, this.user = null, this.clearStorage(), this.config.logoutCallback && this.config.logoutCallback(), e && this.login();
|
|
1814
|
+
} catch (e) {
|
|
1815
|
+
this.log("登出失败:", e), this.handleError(e);
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
async request(e, t = {}) {
|
|
1819
|
+
let n = {
|
|
1820
|
+
headers: {
|
|
1821
|
+
"Content-Type": "application/json",
|
|
1822
|
+
...t.headers
|
|
1823
|
+
},
|
|
1824
|
+
...t
|
|
1825
|
+
};
|
|
1826
|
+
n.headers.appId = this.config.clientCode, this.token && (n.headers.Authorization = `Bearer ${this.token}`);
|
|
1827
|
+
try {
|
|
1828
|
+
let t = await fetch(e, n);
|
|
1829
|
+
return t.status === 401 ? (this.log("Token已过期,需要重新登录"), this.logout(), null) : t;
|
|
1830
|
+
} catch (e) {
|
|
1831
|
+
throw this.log("请求失败:", e), e;
|
|
1832
|
+
}
|
|
1833
|
+
}
|
|
1834
|
+
async fetchUserInfo() {
|
|
1835
|
+
try {
|
|
1836
|
+
let e = await this.request(`${this.config.casServerUrl}/auth/user`);
|
|
1837
|
+
if (e && e.ok) {
|
|
1838
|
+
let t = await e.json();
|
|
1839
|
+
if (t.success && t.data) return this.user = t.data, this.saveToStorage(), this.user;
|
|
1840
|
+
}
|
|
1841
|
+
return null;
|
|
1842
|
+
} catch (e) {
|
|
1843
|
+
return this.log("获取用户信息失败:", e), null;
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
async refreshToken() {
|
|
1847
|
+
this.log("Token刷新功能暂未实现");
|
|
1848
|
+
}
|
|
1849
|
+
handleError(e) {
|
|
1850
|
+
this.log("发生错误:", e), this.config.errorCallback && this.config.errorCallback(e);
|
|
1851
|
+
}
|
|
1852
|
+
log(...e) {
|
|
1853
|
+
this.config.debug && console.log("[OnePortal CAS SDK]", ...e);
|
|
1854
|
+
}
|
|
1855
|
+
checkLoginStatus() {
|
|
1856
|
+
return !this.isLoggedIn() && this.config.autoLogin ? (this.login(), !1) : this.isLoggedIn();
|
|
1857
|
+
}
|
|
1858
|
+
setConfig(e, t) {
|
|
1859
|
+
this.config[e] = t;
|
|
1860
|
+
}
|
|
1861
|
+
getConfig(e) {
|
|
1862
|
+
return this.config[e];
|
|
1863
|
+
}
|
|
1864
|
+
};
|
|
1865
|
+
//#endregion
|
|
1866
|
+
//#region src/utils/tools/format.js
|
|
1867
|
+
function jt(e, t = 2, n = ".", r = ",") {
|
|
1868
|
+
(e == null || e === "") && (e = 0);
|
|
1869
|
+
let i = Number(e);
|
|
1870
|
+
e = isNaN(i) ? 0 : i, t = Math.max(0, Math.floor(t));
|
|
1871
|
+
let a = e.toFixed(t).split("."), o = a[0], s = a[1], c = o.startsWith("-");
|
|
1872
|
+
return c && (o = o.slice(1)), o = o.replace(/\B(?=(\d{3})+(?!\d))/g, r), c && (o = "-" + o), t > 0 ? o + n + s : o;
|
|
2104
1873
|
}
|
|
2105
|
-
function
|
|
2106
|
-
|
|
1874
|
+
function Mt(e, t = 2) {
|
|
1875
|
+
return jt(e, t);
|
|
2107
1876
|
}
|
|
2108
|
-
function
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
const a = e * 100;
|
|
2113
|
-
return He(a, t) + "%";
|
|
1877
|
+
function Nt(e, t = 2) {
|
|
1878
|
+
(e == null || e === "") && (e = 0);
|
|
1879
|
+
let n = Number(e);
|
|
1880
|
+
return e = isNaN(n) ? 0 : n, jt(e * 100, t) + "%";
|
|
2114
1881
|
}
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
1882
|
+
//#endregion
|
|
1883
|
+
//#region src/utils/hook/common.js
|
|
1884
|
+
function Pt(e, t = {}) {
|
|
1885
|
+
let { manual: n, log: r, params: i = {}, cb: a, format: o } = Object.assign({
|
|
1886
|
+
manual: !1,
|
|
1887
|
+
log: !1,
|
|
1888
|
+
params: null,
|
|
1889
|
+
format: null
|
|
1890
|
+
}, t), s = k([]), c = k(!1), l = (t) => {
|
|
1891
|
+
let n = t || i;
|
|
1892
|
+
c.value = !0, e(n).then((e) => {
|
|
1893
|
+
let { code: t, data: c, msg: l } = e;
|
|
1894
|
+
if (a) {
|
|
1895
|
+
let { records: t, rows: n } = c || {};
|
|
1896
|
+
s.value = Lt(t || n ? t || n : c, o), a(e);
|
|
1897
|
+
}
|
|
1898
|
+
if (c) {
|
|
1899
|
+
if (c.records != null || c.rows != null) {
|
|
1900
|
+
let { records: e, rows: t, total: r = 0 } = c || {};
|
|
1901
|
+
n && n.total != null && (i.total = parseInt(r)), s.value = Lt(e || t || [], o);
|
|
1902
|
+
} else s.value = Lt(c, o);
|
|
1903
|
+
r && console.log("useRequest-res", s.value);
|
|
1904
|
+
}
|
|
1905
|
+
}).catch((e) => {
|
|
1906
|
+
a && (console.log("useRequestErr", e), a({ code: 500 }));
|
|
1907
|
+
}).finally(() => {
|
|
1908
|
+
c.value = !1;
|
|
1909
|
+
});
|
|
1910
|
+
};
|
|
1911
|
+
return n || l(), [
|
|
1912
|
+
c,
|
|
1913
|
+
s,
|
|
1914
|
+
l
|
|
1915
|
+
];
|
|
2145
1916
|
}
|
|
2146
|
-
function
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
1917
|
+
function Ft(e) {
|
|
1918
|
+
let t = k(e), n = k(""), r = k("");
|
|
1919
|
+
return L(t, (e) => {
|
|
1920
|
+
let t = e || ["", ""];
|
|
1921
|
+
n.value = t[0], r.value = t[1];
|
|
1922
|
+
}), [
|
|
1923
|
+
t,
|
|
1924
|
+
n,
|
|
1925
|
+
r
|
|
1926
|
+
];
|
|
2152
1927
|
}
|
|
2153
|
-
function
|
|
2154
|
-
|
|
1928
|
+
function It(e) {
|
|
1929
|
+
return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
|
|
2155
1930
|
}
|
|
2156
|
-
function
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
let n = {};
|
|
2165
|
-
return t.forEach((a) => n[a] = e[a]), n;
|
|
1931
|
+
function Lt(e, t) {
|
|
1932
|
+
if (!t) return e;
|
|
1933
|
+
if (e instanceof Array) return e.map((e) => {
|
|
1934
|
+
let n = {};
|
|
1935
|
+
return t.forEach((t) => n[t] = e[t]), n;
|
|
1936
|
+
});
|
|
1937
|
+
let n = {};
|
|
1938
|
+
return t.forEach((t) => n[t] = e[t]), n;
|
|
2166
1939
|
}
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
{ immediate: !0 }
|
|
2175
|
-
), a;
|
|
1940
|
+
//#endregion
|
|
1941
|
+
//#region src/utils/hook/i18n.js
|
|
1942
|
+
function Rt(e, t = []) {
|
|
1943
|
+
let { locale: n } = G(), r = k(e());
|
|
1944
|
+
return L([n, ...t], () => {
|
|
1945
|
+
r.value = e();
|
|
1946
|
+
}, { immediate: !0 }), r;
|
|
2176
1947
|
}
|
|
2177
|
-
function
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
1948
|
+
function zt(e, t = "zh_cn", n = "en_us") {
|
|
1949
|
+
return e && (e[{
|
|
1950
|
+
en_us: n,
|
|
1951
|
+
zh_cn: t
|
|
1952
|
+
}[De().global.locale.value]] || e[t]) || "-";
|
|
2182
1953
|
}
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
1954
|
+
//#endregion
|
|
1955
|
+
//#region src/utils/hook/storeHook.js
|
|
1956
|
+
function Bt(e, t) {
|
|
1957
|
+
let n = ue;
|
|
1958
|
+
return typeof e == "string" && e.length > 0 && (n = se(e).mapState), Ut(t, n);
|
|
2186
1959
|
}
|
|
2187
|
-
function
|
|
2188
|
-
|
|
2189
|
-
|
|
1960
|
+
function Vt(e, t) {
|
|
1961
|
+
let n = le;
|
|
1962
|
+
return typeof e == "string" && e.length > 0 && (n = se(e).mapGetters), Ut(t, n);
|
|
2190
1963
|
}
|
|
2191
|
-
function
|
|
2192
|
-
|
|
2193
|
-
|
|
1964
|
+
function Ht(e, t) {
|
|
1965
|
+
let n = ce;
|
|
1966
|
+
return typeof e == "string" && e.length > 0 && (n = se(e).mapActions), Wt(t, n);
|
|
2194
1967
|
}
|
|
2195
|
-
function
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
}), r;
|
|
1968
|
+
function Ut(e, t) {
|
|
1969
|
+
let n = K(), r = t(e), i = {};
|
|
1970
|
+
return Object.keys(r).forEach((e) => {
|
|
1971
|
+
i[e] = c(r[e].bind({ $store: n }));
|
|
1972
|
+
}), i;
|
|
2201
1973
|
}
|
|
2202
|
-
function
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
1974
|
+
function Wt(e, t) {
|
|
1975
|
+
let n = K(), r = t(e), i = {};
|
|
1976
|
+
return Object.keys(r).forEach((e) => {
|
|
1977
|
+
i[e] = r[e].bind({ $store: n });
|
|
1978
|
+
}), i;
|
|
2207
1979
|
}
|
|
2208
|
-
|
|
2209
|
-
|
|
1980
|
+
//#endregion
|
|
1981
|
+
//#region src/components/VxeTable/index.jsx
|
|
1982
|
+
function Gt(e) {
|
|
1983
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !v(e);
|
|
2210
1984
|
}
|
|
2211
|
-
function
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
cellFormatMethod({
|
|
2220
|
-
cellValue: e
|
|
2221
|
-
}, t = 2) {
|
|
2222
|
-
return In(e, t);
|
|
2223
|
-
}
|
|
2224
|
-
}), he.formats.add("formatPercent", {
|
|
2225
|
-
cellFormatMethod({
|
|
2226
|
-
cellValue: e
|
|
2227
|
-
}, t = 2) {
|
|
2228
|
-
return Tn(e, t);
|
|
2229
|
-
}
|
|
2230
|
-
});
|
|
1985
|
+
function Kt() {
|
|
1986
|
+
q.formats.add("formatNumber", { cellFormatMethod({ cellValue: e }, t = 2) {
|
|
1987
|
+
return jt(e, t);
|
|
1988
|
+
} }), q.formats.add("formatMoney", { cellFormatMethod({ cellValue: e }, t = 2) {
|
|
1989
|
+
return Mt(e, t);
|
|
1990
|
+
} }), q.formats.add("formatPercent", { cellFormatMethod({ cellValue: e }, t = 2) {
|
|
1991
|
+
return Nt(e, t);
|
|
1992
|
+
} });
|
|
2231
1993
|
}
|
|
2232
|
-
function
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
renderTableDefault(e, t) {
|
|
2279
|
-
const {
|
|
2280
|
-
locale: n
|
|
2281
|
-
} = we();
|
|
2282
|
-
let a = n.value == "zh_cn" ? t.column.field : e.fieldEn;
|
|
2283
|
-
return t.row[a] || t.row[t.column.field];
|
|
2284
|
-
}
|
|
2285
|
-
}), he.renderer.add("Link", {
|
|
2286
|
-
// 默认显示模板
|
|
2287
|
-
renderTableDefault(e, t) {
|
|
2288
|
-
let n = t.column.field;
|
|
2289
|
-
const a = jt(), {
|
|
2290
|
-
multiple: r,
|
|
2291
|
-
to: o,
|
|
2292
|
-
openType: l = "system"
|
|
2293
|
-
} = e, s = t.row[n];
|
|
2294
|
-
function i(g, m) {
|
|
2295
|
-
l == "blank" ? window.open(g) : a.push({
|
|
2296
|
-
path: g,
|
|
2297
|
-
query: {
|
|
2298
|
-
[n]: m
|
|
2299
|
-
}
|
|
2300
|
-
});
|
|
2301
|
-
}
|
|
2302
|
-
if (r) {
|
|
2303
|
-
const g = (s == null ? void 0 : s.split(",")) || [];
|
|
2304
|
-
return g.map((m, p) => z("span", null, [z(Je, {
|
|
2305
|
-
underline: "never",
|
|
2306
|
-
type: "primary",
|
|
2307
|
-
onclick: () => i(l == "stystem" ? o : m, m)
|
|
2308
|
-
}, Ie(m) ? m : {
|
|
2309
|
-
default: () => [m]
|
|
2310
|
-
}), p < g.length - 1 ? "," : ""]));
|
|
2311
|
-
}
|
|
2312
|
-
return z(Je, {
|
|
2313
|
-
underline: "never",
|
|
2314
|
-
type: "primary",
|
|
2315
|
-
onclick: () => i(l == "stystem" ? o : s, s)
|
|
2316
|
-
}, Ie(s) ? s : {
|
|
2317
|
-
default: () => [s]
|
|
2318
|
-
});
|
|
2319
|
-
}
|
|
2320
|
-
});
|
|
1994
|
+
function qt() {
|
|
1995
|
+
q.renderer.add("Enum", { renderTableDefault(e, t) {
|
|
1996
|
+
let n;
|
|
1997
|
+
if ([null, void 0].includes(t.row[t.column.field])) return "-";
|
|
1998
|
+
let r = t.row[t.column.field];
|
|
1999
|
+
if (e.type == "tag") {
|
|
2000
|
+
let t;
|
|
2001
|
+
return h(M("el-text"), { type: e.enum.getTag(r) }, Gt(t = e.enum.getName(r)) ? t : { default: () => [t] });
|
|
2002
|
+
}
|
|
2003
|
+
return h(M("el-text"), null, Gt(n = e.enum.getName(r)) ? n : { default: () => [n] });
|
|
2004
|
+
} }), q.renderer.add("InputNumber", { renderTableDefault(e, t) {
|
|
2005
|
+
return h(n, b({
|
|
2006
|
+
modelValue: t.row[t.column.field],
|
|
2007
|
+
"onUpdate:modelValue": (e) => t.row[t.column.field] = e
|
|
2008
|
+
}, e.props, {
|
|
2009
|
+
"step-strictly": !0,
|
|
2010
|
+
"value-on-clear": 0
|
|
2011
|
+
}), null);
|
|
2012
|
+
} }), q.renderer.add("TrueFalse", { renderTableDefault(e, t) {
|
|
2013
|
+
let { locale: n } = G(), r = n.value == "zh_cn";
|
|
2014
|
+
return h(o, { type: t.row[t.column.field] ? "success" : "danger" }, { default: () => [t.row[t.column.field] ? r ? "是" : "YES" : r ? "否" : "NO"] });
|
|
2015
|
+
} }), q.renderer.add("I18n", { renderTableDefault(e, t) {
|
|
2016
|
+
let { locale: n } = G(), r = n.value == "zh_cn" ? t.column.field : e.fieldEn;
|
|
2017
|
+
return t.row[r] || t.row[t.column.field];
|
|
2018
|
+
} }), q.renderer.add("Link", { renderTableDefault(e, t) {
|
|
2019
|
+
let n = t.column.field, i = oe(), { multiple: a, to: o, openType: s = "system" } = e, c = t.row[n];
|
|
2020
|
+
function l(e, t) {
|
|
2021
|
+
s == "blank" ? window.open(e) : i.push({
|
|
2022
|
+
path: e,
|
|
2023
|
+
query: { [n]: t }
|
|
2024
|
+
});
|
|
2025
|
+
}
|
|
2026
|
+
if (a) {
|
|
2027
|
+
let e = c?.split(",") || [];
|
|
2028
|
+
return e.map((t, n) => h("span", null, [h(r, {
|
|
2029
|
+
underline: "never",
|
|
2030
|
+
type: "primary",
|
|
2031
|
+
onclick: () => l(s == "stystem" ? o : t, t)
|
|
2032
|
+
}, Gt(t) ? t : { default: () => [t] }), n < e.length - 1 ? "," : ""]));
|
|
2033
|
+
}
|
|
2034
|
+
return h(r, {
|
|
2035
|
+
underline: "never",
|
|
2036
|
+
type: "primary",
|
|
2037
|
+
onclick: () => l(s == "stystem" ? o : c, c)
|
|
2038
|
+
}, Gt(c) ? c : { default: () => [c] });
|
|
2039
|
+
} });
|
|
2321
2040
|
}
|
|
2322
|
-
function
|
|
2323
|
-
|
|
2041
|
+
function Jt() {
|
|
2042
|
+
Kt(), qt();
|
|
2324
2043
|
}
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
vt as CmpIcon,
|
|
2328
|
-
lo as ConfrimButton,
|
|
2329
|
-
co as DownExcelTemp,
|
|
2330
|
-
ao as ImportButton,
|
|
2331
|
-
Kn as LayOutForm,
|
|
2332
|
-
uo as Layer,
|
|
2333
|
-
io as ListPage,
|
|
2334
|
-
ho as OnePortalCasSDK,
|
|
2335
|
-
kn as SearchBar,
|
|
2336
|
-
et as StatusMap,
|
|
2337
|
-
Zn as _toRaw,
|
|
2338
|
-
po as _typeOf,
|
|
2339
|
-
Jn as arrToStatusMap,
|
|
2340
|
-
Gn as arrayToTree,
|
|
2341
|
-
eo as checkFileSize,
|
|
2342
|
-
fo as creatValidator,
|
|
2343
|
-
no as createImportFields,
|
|
2344
|
-
to as createListPageId,
|
|
2345
|
-
Ae as en_us,
|
|
2346
|
-
Nn as exportExcel,
|
|
2347
|
-
ln as exportExcelMuilti,
|
|
2348
|
-
In as formatMoney,
|
|
2349
|
-
He as formatNumber,
|
|
2350
|
-
Tn as formatPercent,
|
|
2351
|
-
Ke as getI18n,
|
|
2352
|
-
xe as getI18nT,
|
|
2353
|
-
_n as getListPageConfig,
|
|
2354
|
-
vo as getLocaleValue,
|
|
2355
|
-
oo as getValueBykey,
|
|
2356
|
-
Hn as importExcel,
|
|
2357
|
-
nn as importExcelMuilti,
|
|
2358
|
-
Zt as messages,
|
|
2359
|
-
Mn as registerVxeFormatters,
|
|
2360
|
-
xo as registerVxePlugins,
|
|
2361
|
-
zn as registerVxeRenderers,
|
|
2362
|
-
so as resetListPageConfig,
|
|
2363
|
-
ro as setListPageConfig,
|
|
2364
|
-
Gt as setupI18n,
|
|
2365
|
-
Wn as sleep,
|
|
2366
|
-
yt as stringToArray,
|
|
2367
|
-
Xn as stripHtmlTags,
|
|
2368
|
-
Qn as unicode2Str,
|
|
2369
|
-
Co as useActions,
|
|
2370
|
-
go as useDatePicker,
|
|
2371
|
-
wo as useGetters,
|
|
2372
|
-
yo as useI18nReState,
|
|
2373
|
-
mo as useRequest,
|
|
2374
|
-
bo as useState,
|
|
2375
|
-
Pe as zh_cn
|
|
2376
|
-
};
|
|
2044
|
+
//#endregion
|
|
2045
|
+
export { tt as CmpDictionary, it as CmpIcon, ot as ConfrimButton, St as DownExcelTemp, lt as ImportButton, _e as LayOutForm, Ot as Layer, xt as ListPage, At as OnePortalCasSDK, ht as SearchBar, Ke as StatusMap, Ue as _toRaw, It as _typeOf, qe as arrToStatusMap, We as arrayToTree, Xe as checkFileSize, kt as creatValidator, Qe as createImportFields, Ze as createListPageId, Ce as en_us, Ae as exportExcel, ze as exportExcelMuilti, Mt as formatMoney, jt as formatNumber, Nt as formatPercent, De as getI18n, Z as getI18nT, vt as getListPageConfig, zt as getLocaleValue, $e as getValueBykey, Oe as importExcel, Le as importExcelMuilti, we as messages, Kt as registerVxeFormatters, Jt as registerVxePlugins, qt as registerVxeRenderers, yt as resetListPageConfig, _t as setListPageConfig, Ee as setupI18n, He as sleep, Ge as stringToArray, Je as stripHtmlTags, Ye as unicode2Str, Ht as useActions, Ft as useDatePicker, Vt as useGetters, Rt as useI18nReState, Pt as useRequest, Bt as useState, Se as zh_cn };
|