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