joy-admin-components 0.2.12 → 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 je, useStore 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": "全选",
|
|
@@ -256,192 +256,192 @@ const Ut = /* @__PURE__ */ st(Pt), Ve = {
|
|
|
256
256
|
tools: {
|
|
257
257
|
keysLengthError: "Keys length must be greater than 2, default first two are label and value"
|
|
258
258
|
}
|
|
259
|
-
},
|
|
259
|
+
}, Ht = {
|
|
260
260
|
zh_cn: Ve,
|
|
261
261
|
en_us: Me
|
|
262
262
|
};
|
|
263
|
-
let
|
|
264
|
-
function
|
|
265
|
-
if (
|
|
266
|
-
const { global: e } =
|
|
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),
|
|
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;
|
|
268
268
|
}
|
|
269
|
-
return
|
|
269
|
+
return ye || (ye = Mt({
|
|
270
270
|
legacy: !1,
|
|
271
271
|
locale: "zh_cn",
|
|
272
272
|
fallbackLocale: "zh_cn",
|
|
273
|
-
messages:
|
|
274
|
-
})),
|
|
273
|
+
messages: Ht
|
|
274
|
+
})), ye;
|
|
275
275
|
}
|
|
276
276
|
function Pe() {
|
|
277
|
-
return
|
|
277
|
+
return ye || Nt();
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function Re() {
|
|
280
280
|
return Pe().global.t;
|
|
281
281
|
}
|
|
282
|
-
Se.extend(
|
|
283
|
-
Se.extend(
|
|
284
|
-
async function
|
|
285
|
-
const { fields:
|
|
286
|
-
if (!
|
|
287
|
-
const
|
|
288
|
-
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"));
|
|
289
289
|
}
|
|
290
|
-
let
|
|
291
|
-
await
|
|
292
|
-
const
|
|
293
|
-
return
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
if (
|
|
297
|
-
let
|
|
298
|
-
Object.keys(
|
|
299
|
-
const
|
|
300
|
-
|
|
301
|
-
}),
|
|
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);
|
|
302
302
|
}
|
|
303
|
-
}),
|
|
304
|
-
}),
|
|
303
|
+
}), o[a._name] = c;
|
|
304
|
+
}), s = null, o;
|
|
305
305
|
}
|
|
306
|
-
const
|
|
306
|
+
const Zt = {
|
|
307
307
|
columnWidth: 30
|
|
308
308
|
};
|
|
309
|
-
async function
|
|
310
|
-
if (!
|
|
309
|
+
async function Gt(t, e, n = [], l = {}) {
|
|
310
|
+
if (!t || !e)
|
|
311
311
|
return;
|
|
312
|
-
const { columnStyle:
|
|
313
|
-
e.forEach((
|
|
314
|
-
|
|
312
|
+
const { columnStyle: s } = l, { columnWidth: o } = Zt;
|
|
313
|
+
e.forEach((c) => {
|
|
314
|
+
c.width = c.width ? c.width : o;
|
|
315
315
|
});
|
|
316
|
-
const { workbook:
|
|
317
|
-
|
|
316
|
+
const { workbook: a, worksheet: r } = Wt();
|
|
317
|
+
r.columns = e, r.addRows(n), s && await Jt(a, r, s);
|
|
318
318
|
try {
|
|
319
|
-
const
|
|
319
|
+
const c = await a.xlsx.writeBuffer(), b = new File([c], t, {
|
|
320
320
|
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
321
321
|
});
|
|
322
|
-
|
|
323
|
-
} catch (
|
|
324
|
-
console.log(
|
|
322
|
+
Vt(b);
|
|
323
|
+
} catch (c) {
|
|
324
|
+
console.log(c);
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
-
function
|
|
328
|
-
const
|
|
329
|
-
|
|
330
|
-
const e =
|
|
331
|
-
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 };
|
|
332
332
|
}
|
|
333
|
-
async function
|
|
334
|
-
const
|
|
335
|
-
for (const
|
|
336
|
-
const
|
|
337
|
-
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) {
|
|
338
338
|
case "IMG":
|
|
339
|
-
await
|
|
339
|
+
await Xt(t, e, s);
|
|
340
340
|
break;
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
|
-
async function
|
|
345
|
-
const
|
|
346
|
-
e.getColumn(
|
|
347
|
-
|
|
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);
|
|
348
348
|
});
|
|
349
|
-
for (let
|
|
350
|
-
if (
|
|
349
|
+
for (let a = 0, r = o.length; a < r; a++) {
|
|
350
|
+
if (a < 2)
|
|
351
351
|
continue;
|
|
352
|
-
let
|
|
353
|
-
|
|
352
|
+
let c = o[a];
|
|
353
|
+
c && (e.getCell(s.letter + a).value = "", await Qt(t, e, c, {
|
|
354
354
|
width: 100,
|
|
355
355
|
height: 50,
|
|
356
|
-
col:
|
|
357
|
-
row:
|
|
356
|
+
col: s._number - 1,
|
|
357
|
+
row: a - 1
|
|
358
358
|
}));
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
async function
|
|
362
|
-
const { col:
|
|
363
|
-
if (
|
|
364
|
-
const
|
|
365
|
-
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,
|
|
366
366
|
extension: "jpeg"
|
|
367
367
|
});
|
|
368
|
-
e.addImage(
|
|
369
|
-
tl: { col:
|
|
370
|
-
ext: { width:
|
|
368
|
+
e.addImage(C, {
|
|
369
|
+
tl: { col: s, row: o },
|
|
370
|
+
ext: { width: a, height: r }
|
|
371
371
|
});
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
|
-
function
|
|
375
|
-
const
|
|
376
|
-
return
|
|
377
|
-
|
|
378
|
-
const
|
|
379
|
-
|
|
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({
|
|
380
380
|
success: !0,
|
|
381
381
|
//canvas.toDataURL的方法将图片的绝对路径转换为base64编码
|
|
382
|
-
base64:
|
|
382
|
+
base64: o.toDataURL("image/jpeg", e)
|
|
383
383
|
});
|
|
384
|
-
},
|
|
385
|
-
|
|
384
|
+
}, n.onerror = () => {
|
|
385
|
+
l({ success: !1 });
|
|
386
386
|
};
|
|
387
387
|
});
|
|
388
388
|
}
|
|
389
|
-
function
|
|
390
|
-
if (
|
|
391
|
-
return String.fromCharCode(65 +
|
|
389
|
+
function tn(t) {
|
|
390
|
+
if (t < 26)
|
|
391
|
+
return String.fromCharCode(65 + t);
|
|
392
392
|
{
|
|
393
|
-
const e = String.fromCharCode(65 + Math.floor((
|
|
394
|
-
return e +
|
|
393
|
+
const e = String.fromCharCode(65 + Math.floor((t - 26) / 26)), n = String.fromCharCode(65 + (t - 26) % 26);
|
|
394
|
+
return e + n;
|
|
395
395
|
}
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function Vn(t) {
|
|
398
398
|
return new Promise((e) => {
|
|
399
399
|
setTimeout(() => {
|
|
400
400
|
e();
|
|
401
|
-
},
|
|
401
|
+
}, t);
|
|
402
402
|
});
|
|
403
403
|
}
|
|
404
|
-
function
|
|
405
|
-
return JSON.parse(JSON.stringify(
|
|
404
|
+
function Mn(t) {
|
|
405
|
+
return JSON.parse(JSON.stringify(t));
|
|
406
406
|
}
|
|
407
|
-
function
|
|
408
|
-
let e = [],
|
|
409
|
-
for (const
|
|
410
|
-
|
|
411
|
-
...
|
|
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,
|
|
412
412
|
// 判断当前项的子项 如果map有存储就用存储的子项 否则初始化
|
|
413
|
-
children:
|
|
413
|
+
children: l(n, s.id) ? n[s.id].children : []
|
|
414
414
|
};
|
|
415
|
-
const
|
|
416
|
-
|
|
415
|
+
const o = n[s.id];
|
|
416
|
+
s.pid == -1 ? e.push(o) : (l(n, s.pid) || (n[s.pid] = {
|
|
417
417
|
children: []
|
|
418
|
-
}),
|
|
418
|
+
}), n[s.pid].children.push(o));
|
|
419
419
|
}
|
|
420
420
|
return e;
|
|
421
421
|
}
|
|
422
|
-
function
|
|
423
|
-
return
|
|
422
|
+
function ht(t, e = " ") {
|
|
423
|
+
return t ? t.split(e).filter((n) => n.trim()) : [];
|
|
424
424
|
}
|
|
425
|
-
class
|
|
426
|
-
constructor(e,
|
|
427
|
-
this.list = e.map((
|
|
428
|
-
...
|
|
429
|
-
label:
|
|
430
|
-
labelEn:
|
|
431
|
-
value:
|
|
432
|
-
})), 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]));
|
|
433
433
|
}
|
|
434
434
|
getName(e) {
|
|
435
435
|
if (!this.has(e))
|
|
436
436
|
return "-";
|
|
437
|
-
const
|
|
438
|
-
return (
|
|
437
|
+
const n = Pe().global.locale, { label: l, labelEn: s } = this.map.get(e);
|
|
438
|
+
return (n.value == "zh_cn" ? l : s) || l || "-";
|
|
439
439
|
}
|
|
440
440
|
getTag(e) {
|
|
441
441
|
if (!this.has(e))
|
|
442
442
|
return "info";
|
|
443
|
-
const { tag:
|
|
444
|
-
return
|
|
443
|
+
const { tag: n = "info" } = this.map.get(e);
|
|
444
|
+
return n;
|
|
445
445
|
}
|
|
446
446
|
getItem(e) {
|
|
447
447
|
return this.has(e) ? this.map.get(e) : null;
|
|
@@ -449,59 +449,59 @@ class Je {
|
|
|
449
449
|
getColor(e) {
|
|
450
450
|
if (!this.has(e))
|
|
451
451
|
return null;
|
|
452
|
-
const { color:
|
|
453
|
-
return
|
|
452
|
+
const { color: n } = this.map.get(e);
|
|
453
|
+
return n;
|
|
454
454
|
}
|
|
455
455
|
has(e) {
|
|
456
456
|
return this.map.has(e);
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
|
-
function
|
|
460
|
-
if (
|
|
461
|
-
return new
|
|
459
|
+
function An(t, e = [], n = "i18nName") {
|
|
460
|
+
if (t.length == 0)
|
|
461
|
+
return new Xe([]);
|
|
462
462
|
if (e.length < 2) {
|
|
463
|
-
const
|
|
464
|
-
throw new Error(
|
|
463
|
+
const s = Re();
|
|
464
|
+
throw new Error(s("tools.keysLengthError"));
|
|
465
465
|
}
|
|
466
|
-
let
|
|
467
|
-
let
|
|
468
|
-
return
|
|
469
|
-
|
|
470
|
-
}),
|
|
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;
|
|
471
471
|
});
|
|
472
|
-
return new
|
|
472
|
+
return new Xe(l);
|
|
473
473
|
}
|
|
474
|
-
function
|
|
475
|
-
return
|
|
474
|
+
function Un(t) {
|
|
475
|
+
return t ? t.replace(/<[^>]+>/g, "") : "";
|
|
476
476
|
}
|
|
477
|
-
function
|
|
478
|
-
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)))) : "";
|
|
479
479
|
}
|
|
480
|
-
function
|
|
481
|
-
let
|
|
482
|
-
return !(
|
|
480
|
+
function Pn(t, e = 10) {
|
|
481
|
+
let n = 1048576 * e;
|
|
482
|
+
return !(t.size > n);
|
|
483
483
|
}
|
|
484
|
-
function
|
|
485
|
-
return Array.from(10).fill(0).map((
|
|
484
|
+
function Rn(t) {
|
|
485
|
+
return Array.from(10).fill(0).map((n, l) => t + "_" + l);
|
|
486
486
|
}
|
|
487
|
-
function
|
|
487
|
+
function Bn(t) {
|
|
488
488
|
let e = {};
|
|
489
|
-
return
|
|
490
|
-
let { key:
|
|
491
|
-
|
|
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;
|
|
492
492
|
}), e;
|
|
493
493
|
}
|
|
494
|
-
function
|
|
495
|
-
return e.split(".").reduce((
|
|
494
|
+
function Yn(t, e) {
|
|
495
|
+
return e.split(".").reduce((n, l) => n && n[l], t);
|
|
496
496
|
}
|
|
497
|
-
const
|
|
498
|
-
const
|
|
499
|
-
for (const [
|
|
500
|
-
|
|
501
|
-
return
|
|
502
|
-
},
|
|
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 = {
|
|
503
503
|
__name: "index",
|
|
504
|
-
props: /* @__PURE__ */
|
|
504
|
+
props: /* @__PURE__ */ We({
|
|
505
505
|
api: {
|
|
506
506
|
type: Function
|
|
507
507
|
},
|
|
@@ -537,128 +537,128 @@ const we = (n, e) => {
|
|
|
537
537
|
modelValue: {},
|
|
538
538
|
modelModifiers: {}
|
|
539
539
|
}),
|
|
540
|
-
emits: /* @__PURE__ */
|
|
541
|
-
setup(
|
|
542
|
-
const
|
|
543
|
-
if (
|
|
544
|
-
return
|
|
545
|
-
const
|
|
546
|
-
if (
|
|
547
|
-
return
|
|
548
|
-
const { label:
|
|
549
|
-
let
|
|
550
|
-
return
|
|
551
|
-
(
|
|
552
|
-
) :
|
|
553
|
-
let
|
|
554
|
-
return
|
|
555
|
-
(
|
|
556
|
-
),
|
|
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;
|
|
557
557
|
});
|
|
558
|
-
}),
|
|
558
|
+
}), C = se({
|
|
559
559
|
get() {
|
|
560
|
-
return
|
|
560
|
+
return l.multiple == null || a.value == null ? !1 : a.value.length == b.value.length;
|
|
561
561
|
},
|
|
562
|
-
set(
|
|
563
|
-
return
|
|
562
|
+
set(u) {
|
|
563
|
+
return u;
|
|
564
564
|
}
|
|
565
|
-
}),
|
|
566
|
-
const { data:
|
|
567
|
-
|
|
565
|
+
}), w = e, y = R([]), g = async () => {
|
|
566
|
+
const { data: u } = await n.api();
|
|
567
|
+
y.value = [...u], w("success", y);
|
|
568
568
|
};
|
|
569
|
-
|
|
570
|
-
function
|
|
571
|
-
|
|
569
|
+
n.api && g();
|
|
570
|
+
function h(u) {
|
|
571
|
+
w("change", u);
|
|
572
572
|
}
|
|
573
|
-
const f =
|
|
573
|
+
const f = n.labelValue.label.split("-"), m = (u) => {
|
|
574
574
|
if (f.length == 1) {
|
|
575
|
-
if (
|
|
576
|
-
return
|
|
577
|
-
let
|
|
578
|
-
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;
|
|
579
579
|
} else {
|
|
580
|
-
let
|
|
581
|
-
return f.forEach((
|
|
582
|
-
|
|
583
|
-
}),
|
|
580
|
+
let v = [];
|
|
581
|
+
return f.forEach((z) => {
|
|
582
|
+
v.push(u[z]);
|
|
583
|
+
}), v.join("-");
|
|
584
584
|
}
|
|
585
585
|
};
|
|
586
|
-
function _(
|
|
587
|
-
let
|
|
588
|
-
|
|
589
|
-
(
|
|
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]
|
|
590
590
|
) : [], _e(() => {
|
|
591
|
-
|
|
591
|
+
w("change", a.value), w("changeAll", a.value, v);
|
|
592
592
|
});
|
|
593
593
|
}
|
|
594
|
-
function
|
|
595
|
-
|
|
594
|
+
function k(u) {
|
|
595
|
+
n.optionClick && n.optionClick(u), w("change", r.value ? u : u[n.labelValue.value]);
|
|
596
596
|
}
|
|
597
|
-
function S(
|
|
598
|
-
return
|
|
597
|
+
function S(u) {
|
|
598
|
+
return a.value.length >= n.maxLimit && !a.value.includes(u[n.labelValue.value]);
|
|
599
599
|
}
|
|
600
|
-
function
|
|
601
|
-
return
|
|
602
|
-
...
|
|
603
|
-
label:
|
|
604
|
-
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]
|
|
605
605
|
}));
|
|
606
606
|
}
|
|
607
|
-
const
|
|
608
|
-
|
|
609
|
-
() =>
|
|
610
|
-
(
|
|
611
|
-
var
|
|
612
|
-
const
|
|
613
|
-
if (
|
|
614
|
-
|
|
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;
|
|
615
615
|
else {
|
|
616
|
-
let
|
|
617
|
-
for (let
|
|
618
|
-
if (
|
|
619
|
-
|
|
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;
|
|
620
620
|
break;
|
|
621
621
|
}
|
|
622
|
-
|
|
622
|
+
q && (E.value = v);
|
|
623
623
|
}
|
|
624
624
|
},
|
|
625
625
|
{ deep: !0 }
|
|
626
626
|
);
|
|
627
|
-
const
|
|
628
|
-
return (
|
|
629
|
-
const
|
|
630
|
-
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({
|
|
631
631
|
key: 0,
|
|
632
|
-
options:
|
|
633
|
-
modelValue:
|
|
634
|
-
"onUpdate:modelValue":
|
|
635
|
-
},
|
|
632
|
+
options: A.value,
|
|
633
|
+
modelValue: a.value,
|
|
634
|
+
"onUpdate:modelValue": v[1] || (v[1] = (p) => a.value = p)
|
|
635
|
+
}, K(l), {
|
|
636
636
|
filterable: "",
|
|
637
637
|
"collapse-tags": "",
|
|
638
638
|
"collapse-tags-tooltip": "",
|
|
639
639
|
clearable: "",
|
|
640
|
-
onChange:
|
|
641
|
-
onClear:
|
|
642
|
-
}),
|
|
643
|
-
default:
|
|
644
|
-
|
|
645
|
-
onClick: (ge) =>
|
|
646
|
-
},
|
|
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)
|
|
647
647
|
]),
|
|
648
648
|
_: 2
|
|
649
649
|
}, [
|
|
650
|
-
|
|
650
|
+
K(l).multiple != null ? {
|
|
651
651
|
name: "header",
|
|
652
|
-
fn:
|
|
653
|
-
|
|
654
|
-
|
|
652
|
+
fn: T(() => [
|
|
653
|
+
X(u.$slots, "header", {}, () => [
|
|
654
|
+
V(z, {
|
|
655
655
|
class: "mgl20",
|
|
656
|
-
modelValue:
|
|
657
|
-
"onUpdate:modelValue":
|
|
656
|
+
modelValue: C.value,
|
|
657
|
+
"onUpdate:modelValue": v[0] || (v[0] = (p) => C.value = p),
|
|
658
658
|
onChange: _
|
|
659
659
|
}, {
|
|
660
|
-
default:
|
|
661
|
-
|
|
660
|
+
default: T(() => [
|
|
661
|
+
Q(J(u.$t("quan-xuan")), 1)
|
|
662
662
|
]),
|
|
663
663
|
_: 1
|
|
664
664
|
}, 8, ["modelValue"])
|
|
@@ -666,44 +666,44 @@ const we = (n, e) => {
|
|
|
666
666
|
]),
|
|
667
667
|
key: "0"
|
|
668
668
|
} : void 0
|
|
669
|
-
]), 1040, ["options", "modelValue"])) : (
|
|
669
|
+
]), 1040, ["options", "modelValue"])) : (L(), B(ue, he({
|
|
670
670
|
key: 1,
|
|
671
|
-
modelValue:
|
|
672
|
-
"onUpdate:modelValue":
|
|
671
|
+
modelValue: a.value,
|
|
672
|
+
"onUpdate:modelValue": v[3] || (v[3] = (p) => a.value = p),
|
|
673
673
|
filterable: "",
|
|
674
674
|
"collapse-tags": "",
|
|
675
675
|
"collapse-tags-tooltip": "",
|
|
676
|
-
"filter-method":
|
|
676
|
+
"filter-method": K(l).remote != null ? void 0 : (p) => c.value = p,
|
|
677
677
|
clearable: ""
|
|
678
|
-
},
|
|
679
|
-
default:
|
|
680
|
-
|
|
681
|
-
|
|
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, {
|
|
682
682
|
class: "mgl20",
|
|
683
|
-
modelValue:
|
|
684
|
-
"onUpdate:modelValue":
|
|
683
|
+
modelValue: C.value,
|
|
684
|
+
"onUpdate:modelValue": v[2] || (v[2] = (p) => C.value = p),
|
|
685
685
|
onChange: _
|
|
686
686
|
}, {
|
|
687
|
-
default:
|
|
688
|
-
|
|
687
|
+
default: T(() => [
|
|
688
|
+
Q(J(u.$t("quan-xuan")), 1)
|
|
689
689
|
]),
|
|
690
690
|
_: 1
|
|
691
691
|
}, 8, ["modelValue"])
|
|
692
|
-
], !0) :
|
|
693
|
-
(
|
|
692
|
+
], !0) : ce("", !0),
|
|
693
|
+
(L(!0), re(ze, null, lt(b.value, (p, ge) => (L(), B(oe, {
|
|
694
694
|
key: ge,
|
|
695
|
-
label:
|
|
696
|
-
disabled:
|
|
697
|
-
onClick:
|
|
698
|
-
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]
|
|
699
699
|
}, null, 8, ["label", "disabled", "onClick", "value"]))), 128))
|
|
700
700
|
]),
|
|
701
701
|
_: 3
|
|
702
702
|
}, 16, ["modelValue", "filter-method", "onClear"]));
|
|
703
703
|
};
|
|
704
704
|
}
|
|
705
|
-
},
|
|
706
|
-
const
|
|
705
|
+
}, ln = /* @__PURE__ */ xe(on, [["__scopeId", "data-v-d12f3c20"]]);
|
|
706
|
+
const an = tt({
|
|
707
707
|
props: {
|
|
708
708
|
name: {
|
|
709
709
|
tyepe: String,
|
|
@@ -711,40 +711,40 @@ const tn = Qe({
|
|
|
711
711
|
}
|
|
712
712
|
}
|
|
713
713
|
});
|
|
714
|
-
function
|
|
715
|
-
const
|
|
716
|
-
return
|
|
717
|
-
default:
|
|
718
|
-
(
|
|
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)))
|
|
719
719
|
]),
|
|
720
720
|
_: 1
|
|
721
721
|
});
|
|
722
722
|
}
|
|
723
|
-
const
|
|
723
|
+
const mt = /* @__PURE__ */ xe(an, [["render", sn], ["__scopeId", "data-v-733f9daa"]]), Kn = {
|
|
724
724
|
__name: "index",
|
|
725
725
|
emits: ["ok", "no"],
|
|
726
|
-
setup(
|
|
727
|
-
const
|
|
728
|
-
|
|
726
|
+
setup(t, { emit: e }) {
|
|
727
|
+
const n = e, l = Ue(() => {
|
|
728
|
+
n("ok");
|
|
729
729
|
}, 500);
|
|
730
|
-
function
|
|
731
|
-
|
|
730
|
+
function s() {
|
|
731
|
+
n("no");
|
|
732
732
|
}
|
|
733
|
-
return (
|
|
734
|
-
const
|
|
735
|
-
return
|
|
736
|
-
onConfirm:
|
|
737
|
-
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
|
|
738
738
|
}), {
|
|
739
|
-
reference:
|
|
740
|
-
|
|
739
|
+
reference: T(() => [
|
|
740
|
+
X(o.$slots, "default")
|
|
741
741
|
]),
|
|
742
742
|
_: 3
|
|
743
743
|
}, 16, ["onConfirm"]);
|
|
744
744
|
};
|
|
745
745
|
}
|
|
746
746
|
};
|
|
747
|
-
const
|
|
747
|
+
const rn = ["accept"], cn = {
|
|
748
748
|
__name: "index",
|
|
749
749
|
props: {
|
|
750
750
|
accept: {
|
|
@@ -757,56 +757,56 @@ const on = ["accept"], ln = {
|
|
|
757
757
|
}
|
|
758
758
|
},
|
|
759
759
|
emits: ["fileChange"],
|
|
760
|
-
setup(
|
|
761
|
-
const
|
|
762
|
-
function
|
|
763
|
-
let
|
|
764
|
-
|
|
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;
|
|
765
765
|
}
|
|
766
|
-
return (
|
|
767
|
-
const
|
|
768
|
-
return
|
|
769
|
-
|
|
770
|
-
loading:
|
|
766
|
+
return (o, a) => {
|
|
767
|
+
const r = F("el-button");
|
|
768
|
+
return L(), re("span", null, [
|
|
769
|
+
V(r, {
|
|
770
|
+
loading: t.loading,
|
|
771
771
|
class: "mgr10",
|
|
772
|
-
onClick:
|
|
772
|
+
onClick: a[0] || (a[0] = (c) => l.value.click())
|
|
773
773
|
}, {
|
|
774
|
-
default:
|
|
775
|
-
|
|
774
|
+
default: T(() => [
|
|
775
|
+
Q(J(o.$t("dao-ru")), 1)
|
|
776
776
|
]),
|
|
777
777
|
_: 1
|
|
778
778
|
}, 8, ["loading"]),
|
|
779
|
-
|
|
780
|
-
onChange:
|
|
779
|
+
ae("input", {
|
|
780
|
+
onChange: s,
|
|
781
781
|
ref_key: "input",
|
|
782
|
-
ref:
|
|
783
|
-
accept:
|
|
782
|
+
ref: l,
|
|
783
|
+
accept: t.accept,
|
|
784
784
|
style: { position: "absolute", width: "0px", height: "0px", opacity: "0" },
|
|
785
785
|
type: "file"
|
|
786
|
-
}, null, 40,
|
|
786
|
+
}, null, 40, rn)
|
|
787
787
|
]);
|
|
788
788
|
};
|
|
789
789
|
}
|
|
790
|
-
},
|
|
791
|
-
function
|
|
790
|
+
}, Hn = /* @__PURE__ */ xe(cn, [["__scopeId", "data-v-5f1449ad"]]);
|
|
791
|
+
function qe(t) {
|
|
792
792
|
let e = {};
|
|
793
|
-
return
|
|
794
|
-
const { key:
|
|
795
|
-
if (
|
|
796
|
-
if (
|
|
797
|
-
e[
|
|
798
|
-
else if (
|
|
799
|
-
if (
|
|
800
|
-
const [
|
|
801
|
-
let [
|
|
802
|
-
|
|
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;
|
|
803
803
|
} else
|
|
804
|
-
e[
|
|
804
|
+
e[l] = a;
|
|
805
805
|
else
|
|
806
|
-
e[
|
|
806
|
+
e[l] = a;
|
|
807
807
|
}), e;
|
|
808
808
|
}
|
|
809
|
-
const
|
|
809
|
+
const un = { key: 0 }, dn = { class: "btns" }, fn = { class: "left" }, hn = { class: "right" }, mn = {
|
|
810
810
|
__name: "index",
|
|
811
811
|
props: {
|
|
812
812
|
form: {
|
|
@@ -815,85 +815,85 @@ const an = { key: 0 }, rn = { class: "btns" }, sn = { class: "left" }, cn = { cl
|
|
|
815
815
|
}
|
|
816
816
|
},
|
|
817
817
|
emits: ["confirm", "reset", "visibleChange"],
|
|
818
|
-
setup(
|
|
819
|
-
const
|
|
820
|
-
function
|
|
821
|
-
|
|
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");
|
|
822
822
|
}
|
|
823
|
-
function
|
|
824
|
-
|
|
823
|
+
function C(m) {
|
|
824
|
+
m.option.onClear && m.option.onClear(), s("confirm");
|
|
825
825
|
}
|
|
826
|
-
function
|
|
827
|
-
|
|
826
|
+
function w() {
|
|
827
|
+
s("reset");
|
|
828
828
|
}
|
|
829
|
-
function
|
|
830
|
-
|
|
829
|
+
function y() {
|
|
830
|
+
s("confirm");
|
|
831
831
|
}
|
|
832
|
-
function
|
|
833
|
-
return
|
|
832
|
+
function g() {
|
|
833
|
+
return qe(l.form.items);
|
|
834
834
|
}
|
|
835
|
-
const
|
|
835
|
+
const h = rt(l.form.items);
|
|
836
836
|
function f() {
|
|
837
|
-
|
|
838
|
-
const _ =
|
|
839
|
-
_ && (
|
|
837
|
+
l.form.items.forEach((m) => {
|
|
838
|
+
const _ = h.find((k) => k.key == m.key);
|
|
839
|
+
_ && (m.value = _.value);
|
|
840
840
|
});
|
|
841
841
|
}
|
|
842
|
-
return e({ getPrm:
|
|
843
|
-
const
|
|
844
|
-
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", {
|
|
845
845
|
class: "searchBar-container mgt10 mgb10",
|
|
846
|
-
onKeydown:
|
|
846
|
+
onKeydown: It(b, ["enter"])
|
|
847
847
|
}, [
|
|
848
|
-
|
|
848
|
+
ae("div", {
|
|
849
849
|
class: "searchBar",
|
|
850
|
-
style:
|
|
850
|
+
style: Tt({ height: o.value ? "auto" : "42px" })
|
|
851
851
|
}, [
|
|
852
|
-
|
|
852
|
+
V(E, {
|
|
853
853
|
inline: "",
|
|
854
|
-
model:
|
|
854
|
+
model: t.form.data
|
|
855
855
|
}, {
|
|
856
|
-
default:
|
|
857
|
-
(
|
|
858
|
-
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
|
|
859
859
|
}, [
|
|
860
|
-
|
|
860
|
+
u.type == "br" ? (L(), re("br", un)) : (L(), B(M, {
|
|
861
861
|
key: 1,
|
|
862
|
-
label:
|
|
862
|
+
label: u.name
|
|
863
863
|
}, {
|
|
864
|
-
default:
|
|
865
|
-
var
|
|
864
|
+
default: T(() => {
|
|
865
|
+
var v, z;
|
|
866
866
|
return [
|
|
867
|
-
|
|
867
|
+
u.type === "input" ? (L(), B(k, {
|
|
868
868
|
key: 0,
|
|
869
|
-
modelValue:
|
|
870
|
-
"onUpdate:modelValue": (
|
|
871
|
-
class: Oe(((
|
|
872
|
-
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"),
|
|
873
873
|
clearable: ""
|
|
874
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) :
|
|
875
|
-
|
|
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({
|
|
876
876
|
key: 2,
|
|
877
|
-
class: ((
|
|
878
|
-
modelValue:
|
|
879
|
-
"onUpdate:modelValue": (
|
|
880
|
-
}, { ref_for: !0 },
|
|
881
|
-
onChange:
|
|
882
|
-
onClear: (
|
|
883
|
-
}), null, 16, ["class", "modelValue", "onUpdate:modelValue", "onClear"])) :
|
|
884
|
-
|
|
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, {
|
|
885
885
|
key: 3,
|
|
886
|
-
class: Oe({ datetimerange: "w300", daterange: "w200" }[
|
|
887
|
-
modelValue:
|
|
888
|
-
"onUpdate:modelValue": (
|
|
889
|
-
"value-format": { datetimerange: "YYYY-MM-DD HH:mm:ss", daterange: "YYYY-MM-DD" }[
|
|
890
|
-
type:
|
|
891
|
-
onFocus: (
|
|
892
|
-
onChange: (
|
|
893
|
-
placeholder:
|
|
894
|
-
"start-placeholder":
|
|
895
|
-
"end-placeholder":
|
|
896
|
-
}, 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)
|
|
897
897
|
];
|
|
898
898
|
}),
|
|
899
899
|
_: 2
|
|
@@ -903,51 +903,51 @@ const an = { key: 0 }, rn = { class: "btns" }, sn = { class: "left" }, cn = { cl
|
|
|
903
903
|
_: 1
|
|
904
904
|
}, 8, ["model"])
|
|
905
905
|
], 4),
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
906
|
+
ae("div", dn, [
|
|
907
|
+
ae("div", fn, [
|
|
908
|
+
X(m.$slots, "table-header-left", {}, void 0, !0)
|
|
909
909
|
]),
|
|
910
|
-
|
|
911
|
-
|
|
910
|
+
ae("div", hn, [
|
|
911
|
+
V(W, {
|
|
912
912
|
underline: "never",
|
|
913
913
|
class: "mgr10",
|
|
914
914
|
onClick: _[0] || (_[0] = () => {
|
|
915
|
-
|
|
915
|
+
s("visibleChange", !o.value), o.value = !o.value;
|
|
916
916
|
})
|
|
917
917
|
}, {
|
|
918
|
-
default:
|
|
919
|
-
|
|
920
|
-
name:
|
|
918
|
+
default: T(() => [
|
|
919
|
+
V(mt, {
|
|
920
|
+
name: o.value ? "ArrowUp" : "ArrowDown"
|
|
921
921
|
}, null, 8, ["name"]),
|
|
922
|
-
|
|
922
|
+
Q(" " + J(c.value), 1)
|
|
923
923
|
]),
|
|
924
924
|
_: 1
|
|
925
925
|
}),
|
|
926
|
-
|
|
926
|
+
V(A, {
|
|
927
927
|
type: "primary",
|
|
928
|
-
onClick:
|
|
928
|
+
onClick: b
|
|
929
929
|
}, {
|
|
930
|
-
default:
|
|
931
|
-
|
|
930
|
+
default: T(() => [
|
|
931
|
+
Q(J(m.$t("shai-xuan")), 1)
|
|
932
932
|
]),
|
|
933
933
|
_: 1
|
|
934
934
|
}),
|
|
935
|
-
|
|
935
|
+
V(A, {
|
|
936
936
|
type: "primary",
|
|
937
|
-
onClick:
|
|
937
|
+
onClick: w
|
|
938
938
|
}, {
|
|
939
|
-
default:
|
|
940
|
-
|
|
939
|
+
default: T(() => [
|
|
940
|
+
Q(J(m.$t("chong-zhi")), 1)
|
|
941
941
|
]),
|
|
942
942
|
_: 1
|
|
943
943
|
}),
|
|
944
|
-
|
|
944
|
+
X(m.$slots, "btn", {}, void 0, !0)
|
|
945
945
|
])
|
|
946
946
|
])
|
|
947
947
|
], 32);
|
|
948
948
|
};
|
|
949
949
|
}
|
|
950
|
-
},
|
|
950
|
+
}, gn = /* @__PURE__ */ xe(mn, [["__scopeId", "data-v-3c0a6716"]]), gt = {
|
|
951
951
|
// 分页参数名
|
|
952
952
|
pageNoKey: "pageNo",
|
|
953
953
|
// 页码参数名
|
|
@@ -977,24 +977,24 @@ const an = { key: 0 }, rn = { class: "btns" }, sn = { class: "left" }, cn = { cl
|
|
|
977
977
|
enableCellCopy: !0
|
|
978
978
|
// 是否启用单元格选区复制功能
|
|
979
979
|
};
|
|
980
|
-
let
|
|
981
|
-
function
|
|
982
|
-
|
|
983
|
-
...
|
|
984
|
-
...
|
|
980
|
+
let Ce = { ...gt };
|
|
981
|
+
function Nn(t) {
|
|
982
|
+
Ce = {
|
|
983
|
+
...Ce,
|
|
984
|
+
...t,
|
|
985
985
|
responseDataKeys: {
|
|
986
|
-
...
|
|
987
|
-
...
|
|
986
|
+
...Ce.responseDataKeys,
|
|
987
|
+
...t.responseDataKeys || {}
|
|
988
988
|
}
|
|
989
989
|
};
|
|
990
990
|
}
|
|
991
|
-
function
|
|
992
|
-
return
|
|
991
|
+
function pn() {
|
|
992
|
+
return Ce;
|
|
993
993
|
}
|
|
994
|
-
function
|
|
995
|
-
|
|
994
|
+
function Zn() {
|
|
995
|
+
Ce = { ...gt };
|
|
996
996
|
}
|
|
997
|
-
const
|
|
997
|
+
const yn = { class: "center" }, vn = {
|
|
998
998
|
__name: "index",
|
|
999
999
|
props: {
|
|
1000
1000
|
// 表格id 本地存储列设置时使用,不传则使用路由路径自动生成
|
|
@@ -1030,111 +1030,111 @@ const hn = { class: "center" }, gn = {
|
|
|
1030
1030
|
default: () => ({})
|
|
1031
1031
|
}
|
|
1032
1032
|
},
|
|
1033
|
-
setup(
|
|
1034
|
-
const { t, locale:
|
|
1035
|
-
|
|
1036
|
-
const
|
|
1037
|
-
const
|
|
1038
|
-
return
|
|
1039
|
-
}),
|
|
1040
|
-
[
|
|
1041
|
-
[
|
|
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,
|
|
1042
1042
|
total: 0
|
|
1043
|
-
}),
|
|
1043
|
+
}), h = R(null), f = R(null), m = R(450), _ = Ue(() => {
|
|
1044
1044
|
_e(() => {
|
|
1045
1045
|
if (!f.value)
|
|
1046
1046
|
return;
|
|
1047
|
-
const
|
|
1048
|
-
|
|
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);
|
|
1049
1049
|
});
|
|
1050
|
-
}, 100),
|
|
1050
|
+
}, 100), k = () => {
|
|
1051
1051
|
_();
|
|
1052
1052
|
}, S = () => {
|
|
1053
|
-
if (!
|
|
1053
|
+
if (!a.searchForm.enableCellCopy)
|
|
1054
1054
|
return !1;
|
|
1055
|
-
const
|
|
1056
|
-
if (!
|
|
1055
|
+
const d = h.value;
|
|
1056
|
+
if (!d || !d.$el)
|
|
1057
1057
|
return !1;
|
|
1058
|
-
const
|
|
1059
|
-
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;
|
|
1060
1060
|
};
|
|
1061
|
-
|
|
1062
|
-
_(), window.addEventListener("resize",
|
|
1061
|
+
nt(() => {
|
|
1062
|
+
_(), window.addEventListener("resize", k), a.searchForm.enableCellCopy && (document.addEventListener("mouseup", Ke), document.addEventListener("mousedown", He), setTimeout(() => {
|
|
1063
1063
|
S();
|
|
1064
1064
|
}, 500));
|
|
1065
1065
|
}), Ft(() => {
|
|
1066
|
-
|
|
1066
|
+
a.searchForm.enableCellCopy && setTimeout(() => {
|
|
1067
1067
|
S();
|
|
1068
1068
|
}, 500);
|
|
1069
|
-
}),
|
|
1070
|
-
if (window.removeEventListener("resize",
|
|
1071
|
-
document.removeEventListener("mouseup",
|
|
1072
|
-
const
|
|
1073
|
-
if (
|
|
1074
|
-
const
|
|
1075
|
-
|
|
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);
|
|
1076
1076
|
}
|
|
1077
1077
|
}
|
|
1078
1078
|
});
|
|
1079
|
-
const
|
|
1080
|
-
let
|
|
1081
|
-
async function W(
|
|
1082
|
-
const { dataFormat:
|
|
1083
|
-
|
|
1084
|
-
const { code:
|
|
1085
|
-
|
|
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 = [];
|
|
1086
1086
|
});
|
|
1087
|
-
if (
|
|
1088
|
-
let
|
|
1089
|
-
for (const
|
|
1090
|
-
if (
|
|
1091
|
-
|
|
1087
|
+
if (x == 200) {
|
|
1088
|
+
let j = [];
|
|
1089
|
+
for (const D of o.responseDataKeys.rows)
|
|
1090
|
+
if (I[D]) {
|
|
1091
|
+
j = I[D];
|
|
1092
1092
|
break;
|
|
1093
1093
|
}
|
|
1094
|
-
let
|
|
1095
|
-
for (const
|
|
1096
|
-
if (
|
|
1097
|
-
|
|
1094
|
+
let N = 0;
|
|
1095
|
+
for (const D of o.responseDataKeys.total)
|
|
1096
|
+
if (I[D] !== void 0) {
|
|
1097
|
+
N = I[D];
|
|
1098
1098
|
break;
|
|
1099
1099
|
}
|
|
1100
|
-
|
|
1100
|
+
c.value = i ? i(j) : j, g.total = N, E = I.nextSearchAfter, a.searchForm.enableCellCopy && _e(() => {
|
|
1101
1101
|
setTimeout(() => {
|
|
1102
1102
|
S();
|
|
1103
1103
|
}, 100);
|
|
1104
1104
|
});
|
|
1105
1105
|
}
|
|
1106
1106
|
}
|
|
1107
|
-
function
|
|
1108
|
-
const { searchData:
|
|
1109
|
-
W({ ...
|
|
1107
|
+
function A(d = {}) {
|
|
1108
|
+
const { searchData: i = () => ({}) } = a.tableConfig, x = i();
|
|
1109
|
+
W({ ...g, ...qe(a.searchForm.items), ...d, ...x });
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1112
|
-
const { reset:
|
|
1113
|
-
|
|
1114
|
-
const
|
|
1115
|
-
|
|
1116
|
-
}),
|
|
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();
|
|
1117
1117
|
}
|
|
1118
|
-
|
|
1119
|
-
function
|
|
1120
|
-
return { ...
|
|
1118
|
+
a.api && a.immediate && A();
|
|
1119
|
+
function v() {
|
|
1120
|
+
return { ...g, ...qe(a.searchForm.items) };
|
|
1121
1121
|
}
|
|
1122
|
-
const
|
|
1123
|
-
const
|
|
1124
|
-
|
|
1125
|
-
},
|
|
1122
|
+
const z = () => {
|
|
1123
|
+
const d = h.value;
|
|
1124
|
+
d && d.clearSort();
|
|
1125
|
+
}, q = ke({
|
|
1126
1126
|
storage: !0
|
|
1127
|
-
}),
|
|
1127
|
+
}), oe = ke({
|
|
1128
1128
|
drag: !0,
|
|
1129
1129
|
resizable: !0,
|
|
1130
1130
|
maxFixedSize: 0
|
|
1131
|
-
}),
|
|
1132
|
-
const { customConfig:
|
|
1131
|
+
}), ue = se(() => {
|
|
1132
|
+
const { customConfig: d, columnConfig: i, ...x } = a.tableConfig;
|
|
1133
1133
|
return {
|
|
1134
1134
|
headerAlign: "left",
|
|
1135
1135
|
align: "center",
|
|
1136
|
-
customConfig: { ...
|
|
1137
|
-
columnConfig: { ...
|
|
1136
|
+
customConfig: { ...q, ...d },
|
|
1137
|
+
columnConfig: { ...oe, ...i },
|
|
1138
1138
|
// 列过多时 自动宽度 虚拟滚动会闪屏 关闭虚拟滚动
|
|
1139
1139
|
"virtual-x-config": {
|
|
1140
1140
|
enabled: !1,
|
|
@@ -1142,9 +1142,9 @@ const hn = { class: "center" }, gn = {
|
|
|
1142
1142
|
},
|
|
1143
1143
|
// 纵向虚拟滚动 大于100条开启
|
|
1144
1144
|
"virtual-y-config": { enabled: !0, gt: 100 },
|
|
1145
|
-
...
|
|
1145
|
+
...x
|
|
1146
1146
|
};
|
|
1147
|
-
}),
|
|
1147
|
+
}), p = ke({
|
|
1148
1148
|
isSelecting: !1,
|
|
1149
1149
|
// 是否正在选择
|
|
1150
1150
|
startCell: null,
|
|
@@ -1153,71 +1153,71 @@ const hn = { class: "center" }, gn = {
|
|
|
1153
1153
|
// 结束单元格
|
|
1154
1154
|
selectedCells: []
|
|
1155
1155
|
// 选中的单元格列表 [{ rowIndex, colIndex }]
|
|
1156
|
-
}), ge = (
|
|
1157
|
-
const
|
|
1158
|
-
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"))
|
|
1159
1159
|
return null;
|
|
1160
|
-
const
|
|
1161
|
-
if (!
|
|
1160
|
+
const x = i.closest(".vxe-body--row");
|
|
1161
|
+
if (!x)
|
|
1162
1162
|
return null;
|
|
1163
|
-
const
|
|
1164
|
-
if (!
|
|
1163
|
+
const I = h.value;
|
|
1164
|
+
if (!I)
|
|
1165
1165
|
return null;
|
|
1166
|
-
let
|
|
1167
|
-
const
|
|
1168
|
-
if (
|
|
1169
|
-
|
|
1166
|
+
let j = -1;
|
|
1167
|
+
const N = x.getAttribute("data-rowid");
|
|
1168
|
+
if (N != null)
|
|
1169
|
+
j = parseInt(N, 10);
|
|
1170
1170
|
else {
|
|
1171
|
-
const
|
|
1172
|
-
|
|
1171
|
+
const O = x.parentElement;
|
|
1172
|
+
j = Array.from(O.querySelectorAll(".vxe-body--row")).indexOf(x);
|
|
1173
1173
|
}
|
|
1174
|
-
if (
|
|
1174
|
+
if (j < 0)
|
|
1175
1175
|
return null;
|
|
1176
|
-
let
|
|
1177
|
-
const
|
|
1178
|
-
if (
|
|
1179
|
-
const $ = Array.from(
|
|
1180
|
-
if (
|
|
1181
|
-
const
|
|
1182
|
-
$ <
|
|
1183
|
-
} else if (
|
|
1184
|
-
const
|
|
1185
|
-
$ <
|
|
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[$]));
|
|
1186
1186
|
} else {
|
|
1187
|
-
const
|
|
1188
|
-
|
|
1187
|
+
const G = a.searchForm.showCheckBox ? 1 : 0;
|
|
1188
|
+
D = P.filter((ee) => ee.fixed === "left").length + $ - G;
|
|
1189
1189
|
}
|
|
1190
1190
|
}
|
|
1191
|
-
return
|
|
1192
|
-
},
|
|
1193
|
-
const
|
|
1194
|
-
if (!
|
|
1191
|
+
return D < 0 ? null : { rowIndex: j, colIndex: D, cell: i };
|
|
1192
|
+
}, ie = (d) => {
|
|
1193
|
+
const i = ge(d.target);
|
|
1194
|
+
if (!i) {
|
|
1195
1195
|
$e();
|
|
1196
1196
|
return;
|
|
1197
1197
|
}
|
|
1198
|
-
|
|
1199
|
-
rowIndex:
|
|
1200
|
-
colIndex:
|
|
1201
|
-
},
|
|
1202
|
-
},
|
|
1203
|
-
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)
|
|
1204
1204
|
return;
|
|
1205
|
-
const
|
|
1206
|
-
|
|
1207
|
-
rowIndex:
|
|
1208
|
-
colIndex:
|
|
1209
|
-
},
|
|
1210
|
-
},
|
|
1211
|
-
|
|
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;
|
|
1212
1212
|
}, $e = () => {
|
|
1213
|
-
|
|
1214
|
-
const
|
|
1215
|
-
if (!
|
|
1213
|
+
p.selectedCells = [], p.startCell = null, p.endCell = null;
|
|
1214
|
+
const d = h.value;
|
|
1215
|
+
if (!d)
|
|
1216
1216
|
return;
|
|
1217
|
-
|
|
1217
|
+
d.$el.querySelectorAll(
|
|
1218
1218
|
".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left"
|
|
1219
|
-
).forEach((
|
|
1220
|
-
|
|
1219
|
+
).forEach((x) => {
|
|
1220
|
+
x.classList.remove(
|
|
1221
1221
|
"cell-selected",
|
|
1222
1222
|
"cell-border-top",
|
|
1223
1223
|
"cell-border-right",
|
|
@@ -1225,257 +1225,257 @@ const hn = { class: "center" }, gn = {
|
|
|
1225
1225
|
"cell-border-left"
|
|
1226
1226
|
);
|
|
1227
1227
|
});
|
|
1228
|
-
},
|
|
1229
|
-
if (!
|
|
1230
|
-
|
|
1228
|
+
}, Be = () => {
|
|
1229
|
+
if (!p.startCell || !p.endCell) {
|
|
1230
|
+
p.selectedCells = [];
|
|
1231
1231
|
return;
|
|
1232
1232
|
}
|
|
1233
|
-
const
|
|
1234
|
-
|
|
1235
|
-
for (let
|
|
1236
|
-
for (let $ =
|
|
1237
|
-
|
|
1238
|
-
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,
|
|
1239
1239
|
colIndex: $
|
|
1240
1240
|
});
|
|
1241
|
-
},
|
|
1241
|
+
}, Ye = () => {
|
|
1242
1242
|
_e(() => {
|
|
1243
|
-
const
|
|
1244
|
-
if (!
|
|
1243
|
+
const d = h.value;
|
|
1244
|
+
if (!d)
|
|
1245
1245
|
return;
|
|
1246
|
-
const
|
|
1247
|
-
if (
|
|
1246
|
+
const i = d.$el;
|
|
1247
|
+
if (i.querySelectorAll(
|
|
1248
1248
|
".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left"
|
|
1249
|
-
).forEach((
|
|
1250
|
-
|
|
1249
|
+
).forEach((Y) => {
|
|
1250
|
+
Y.classList.remove(
|
|
1251
1251
|
"cell-selected",
|
|
1252
1252
|
"cell-border-top",
|
|
1253
1253
|
"cell-border-right",
|
|
1254
1254
|
"cell-border-bottom",
|
|
1255
1255
|
"cell-border-left"
|
|
1256
1256
|
);
|
|
1257
|
-
}),
|
|
1257
|
+
}), p.selectedCells.length === 0)
|
|
1258
1258
|
return;
|
|
1259
|
-
const
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
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")
|
|
1263
1263
|
].filter(Boolean);
|
|
1264
|
-
|
|
1265
|
-
const
|
|
1266
|
-
if (!
|
|
1264
|
+
p.selectedCells.forEach(({ rowIndex: Y, colIndex: Z }) => {
|
|
1265
|
+
const P = x[Z];
|
|
1266
|
+
if (!P)
|
|
1267
1267
|
return;
|
|
1268
|
-
const
|
|
1269
|
-
for (const
|
|
1270
|
-
const
|
|
1271
|
-
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)
|
|
1272
1272
|
continue;
|
|
1273
|
-
const
|
|
1274
|
-
let
|
|
1275
|
-
if (
|
|
1276
|
-
const
|
|
1277
|
-
|
|
1278
|
-
} else if (
|
|
1279
|
-
const
|
|
1280
|
-
|
|
1281
|
-
} else if (!
|
|
1282
|
-
const
|
|
1283
|
-
|
|
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];
|
|
1284
1284
|
}
|
|
1285
|
-
if (
|
|
1286
|
-
|
|
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");
|
|
1287
1287
|
break;
|
|
1288
1288
|
}
|
|
1289
1289
|
}
|
|
1290
1290
|
});
|
|
1291
1291
|
});
|
|
1292
|
-
},
|
|
1293
|
-
if (
|
|
1292
|
+
}, yt = async () => {
|
|
1293
|
+
if (p.selectedCells.length === 0)
|
|
1294
1294
|
return;
|
|
1295
|
-
const
|
|
1296
|
-
if (!
|
|
1295
|
+
const d = h.value;
|
|
1296
|
+
if (!d)
|
|
1297
1297
|
return;
|
|
1298
|
-
const
|
|
1299
|
-
(
|
|
1300
|
-
),
|
|
1301
|
-
(
|
|
1302
|
-
),
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
].filter(Boolean),
|
|
1307
|
-
|
|
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) => {
|
|
1308
1308
|
const $ = [];
|
|
1309
|
-
|
|
1310
|
-
const
|
|
1311
|
-
if (!
|
|
1309
|
+
j.forEach((Y) => {
|
|
1310
|
+
const Z = x[Y];
|
|
1311
|
+
if (!Z) {
|
|
1312
1312
|
$.push("");
|
|
1313
1313
|
return;
|
|
1314
1314
|
}
|
|
1315
|
-
const
|
|
1316
|
-
let
|
|
1317
|
-
for (const
|
|
1318
|
-
const
|
|
1319
|
-
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)
|
|
1320
1320
|
continue;
|
|
1321
|
-
const
|
|
1322
|
-
let
|
|
1323
|
-
if (
|
|
1324
|
-
const
|
|
1325
|
-
|
|
1326
|
-
} else if (
|
|
1327
|
-
const
|
|
1328
|
-
|
|
1329
|
-
} else if (!
|
|
1330
|
-
const
|
|
1331
|
-
|
|
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];
|
|
1332
1332
|
}
|
|
1333
|
-
if (
|
|
1334
|
-
|
|
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, " ");
|
|
1335
1335
|
break;
|
|
1336
1336
|
}
|
|
1337
1337
|
}
|
|
1338
|
-
$.push(
|
|
1339
|
-
}),
|
|
1338
|
+
$.push(H);
|
|
1339
|
+
}), D.push($.join(" "));
|
|
1340
1340
|
});
|
|
1341
|
-
const
|
|
1341
|
+
const le = D.join(`
|
|
1342
1342
|
`);
|
|
1343
1343
|
try {
|
|
1344
|
-
await navigator.clipboard.writeText(
|
|
1345
|
-
} catch (
|
|
1346
|
-
console.error("复制失败:",
|
|
1344
|
+
await navigator.clipboard.writeText(le);
|
|
1345
|
+
} catch (O) {
|
|
1346
|
+
console.error("复制失败:", O);
|
|
1347
1347
|
}
|
|
1348
|
-
},
|
|
1349
|
-
|
|
1350
|
-
},
|
|
1351
|
-
|
|
1352
|
-
},
|
|
1353
|
-
const
|
|
1354
|
-
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)
|
|
1355
1355
|
return;
|
|
1356
|
-
|
|
1357
|
-
},
|
|
1358
|
-
|
|
1359
|
-
},
|
|
1360
|
-
|
|
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();
|
|
1361
1361
|
};
|
|
1362
|
-
function
|
|
1363
|
-
const
|
|
1364
|
-
|
|
1362
|
+
function Ne() {
|
|
1363
|
+
const d = h.value.getCheckboxRecords();
|
|
1364
|
+
a.searchForm.selections = d;
|
|
1365
1365
|
}
|
|
1366
|
-
const
|
|
1367
|
-
const
|
|
1368
|
-
if (
|
|
1369
|
-
|
|
1370
|
-
const
|
|
1371
|
-
|
|
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;
|
|
1372
1372
|
}
|
|
1373
1373
|
};
|
|
1374
|
-
return e({ tableRef:
|
|
1375
|
-
var
|
|
1376
|
-
const
|
|
1377
|
-
return
|
|
1378
|
-
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 })
|
|
1379
1379
|
}, [
|
|
1380
|
-
|
|
1380
|
+
t.searchForm.showSearch ? (L(), B(gn, {
|
|
1381
1381
|
key: 0,
|
|
1382
|
-
form:
|
|
1383
|
-
onReset:
|
|
1384
|
-
onConfirm:
|
|
1385
|
-
onVisibleChange:
|
|
1382
|
+
form: t.searchForm,
|
|
1383
|
+
onReset: u,
|
|
1384
|
+
onConfirm: i[1] || (i[1] = ($) => A()),
|
|
1385
|
+
onVisibleChange: K(_)
|
|
1386
1386
|
}, {
|
|
1387
|
-
btn:
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
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, {
|
|
1391
1391
|
class: "mgl10",
|
|
1392
1392
|
round: "",
|
|
1393
|
-
onClick:
|
|
1393
|
+
onClick: i[0] || (i[0] = ($) => h.value.openCustom())
|
|
1394
1394
|
}, {
|
|
1395
|
-
default:
|
|
1396
|
-
|
|
1395
|
+
default: T(() => [
|
|
1396
|
+
V(mt, { name: "Tools" })
|
|
1397
1397
|
]),
|
|
1398
1398
|
_: 1
|
|
1399
1399
|
})
|
|
1400
1400
|
]),
|
|
1401
1401
|
_: 3
|
|
1402
|
-
}, 8, ["form", "onVisibleChange"])) :
|
|
1403
|
-
|
|
1404
|
-
|
|
1402
|
+
}, 8, ["form", "onVisibleChange"])) : ce("", !0),
|
|
1403
|
+
X(d.$slots, "table-header-left", {}, void 0, !0),
|
|
1404
|
+
ae("div", {
|
|
1405
1405
|
ref_key: "tableContentRef",
|
|
1406
1406
|
ref: f
|
|
1407
1407
|
}, [
|
|
1408
|
-
|
|
1409
|
-
id:
|
|
1408
|
+
V(D, he({
|
|
1409
|
+
id: b.value,
|
|
1410
1410
|
ref_key: "tableRef",
|
|
1411
|
-
ref:
|
|
1412
|
-
loading:
|
|
1413
|
-
data:
|
|
1411
|
+
ref: h,
|
|
1412
|
+
loading: t.loading || r.value,
|
|
1413
|
+
data: t.api ? c.value : t.data,
|
|
1414
1414
|
border: ""
|
|
1415
|
-
},
|
|
1416
|
-
height:
|
|
1417
|
-
onCheckboxChange:
|
|
1418
|
-
onCheckboxAll:
|
|
1419
|
-
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
|
|
1420
1420
|
}), {
|
|
1421
|
-
default:
|
|
1422
|
-
|
|
1421
|
+
default: T(() => [
|
|
1422
|
+
t.searchForm.showCheckBox == null || t.searchForm.showCheckBox ? (L(), B(N, {
|
|
1423
1423
|
key: 0,
|
|
1424
1424
|
type: "checkbox",
|
|
1425
|
-
width:
|
|
1426
|
-
title:
|
|
1425
|
+
width: K(l) == "zh_cn" ? 80 : 150,
|
|
1426
|
+
title: d.$t("xu-hao"),
|
|
1427
1427
|
fixed: "left"
|
|
1428
1428
|
}, {
|
|
1429
|
-
checkbox:
|
|
1430
|
-
|
|
1431
|
-
|
|
1429
|
+
checkbox: T(({ rowIndex: $, row: Y, checked: Z, disabled: P, indeterminate: G }) => [
|
|
1430
|
+
ae("div", yn, [
|
|
1431
|
+
Z ? (L(), B(I, {
|
|
1432
1432
|
key: 0,
|
|
1433
1433
|
checked: !0,
|
|
1434
|
-
disabled:
|
|
1434
|
+
disabled: P,
|
|
1435
1435
|
size: "default",
|
|
1436
|
-
onClick:
|
|
1437
|
-
}, null, 8, ["disabled", "onClick"])) : (
|
|
1436
|
+
onClick: De((H) => !P && Ze(Y), ["stop"])
|
|
1437
|
+
}, null, 8, ["disabled", "onClick"])) : (L(), B(I, {
|
|
1438
1438
|
key: 1,
|
|
1439
|
-
disabled:
|
|
1439
|
+
disabled: P,
|
|
1440
1440
|
checked: !1,
|
|
1441
1441
|
size: "default",
|
|
1442
|
-
onClick:
|
|
1442
|
+
onClick: De((H) => !P && Ze(Y), ["stop"])
|
|
1443
1443
|
}, null, 8, ["disabled", "onClick"])),
|
|
1444
|
-
|
|
1444
|
+
V(j, {
|
|
1445
1445
|
type: "info",
|
|
1446
1446
|
class: "mgl5"
|
|
1447
1447
|
}, {
|
|
1448
|
-
default:
|
|
1449
|
-
|
|
1448
|
+
default: T(() => [
|
|
1449
|
+
Q(J($ + 1), 1)
|
|
1450
1450
|
]),
|
|
1451
1451
|
_: 2
|
|
1452
1452
|
}, 1024)
|
|
1453
1453
|
])
|
|
1454
1454
|
]),
|
|
1455
1455
|
_: 1
|
|
1456
|
-
}, 8, ["width", "title"])) :
|
|
1457
|
-
|
|
1456
|
+
}, 8, ["width", "title"])) : ce("", !0),
|
|
1457
|
+
X(d.$slots, "default", {}, void 0, !0)
|
|
1458
1458
|
]),
|
|
1459
1459
|
_: 3
|
|
1460
1460
|
}, 16, ["id", "loading", "data", "height", "onSortChange"])
|
|
1461
1461
|
], 512),
|
|
1462
|
-
|
|
1462
|
+
t.searchForm.showPage ? (L(), B(le, {
|
|
1463
1463
|
key: 1,
|
|
1464
|
-
"current-page":
|
|
1465
|
-
"onUpdate:currentPage":
|
|
1464
|
+
"current-page": g[K(w)],
|
|
1465
|
+
"onUpdate:currentPage": i[2] || (i[2] = ($) => g[K(w)] = $),
|
|
1466
1466
|
class: "myPagination mgt10",
|
|
1467
1467
|
background: "",
|
|
1468
1468
|
layout: "total, sizes, prev, pager, next",
|
|
1469
|
-
total:
|
|
1470
|
-
"page-size":
|
|
1471
|
-
"page-sizes":
|
|
1472
|
-
onCurrentChange:
|
|
1473
|
-
onSizeChange:
|
|
1474
|
-
}, 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)
|
|
1475
1475
|
], 2);
|
|
1476
1476
|
};
|
|
1477
1477
|
}
|
|
1478
|
-
},
|
|
1478
|
+
}, Gn = /* @__PURE__ */ xe(vn, [["__scopeId", "data-v-d93cad32"]]), Wn = {
|
|
1479
1479
|
__name: "index",
|
|
1480
1480
|
props: {
|
|
1481
1481
|
sheetsConfig: {
|
|
@@ -1487,44 +1487,243 @@ const hn = { class: "center" }, gn = {
|
|
|
1487
1487
|
required: !0
|
|
1488
1488
|
}
|
|
1489
1489
|
},
|
|
1490
|
-
setup(
|
|
1491
|
-
const e =
|
|
1492
|
-
function
|
|
1493
|
-
|
|
1490
|
+
setup(t) {
|
|
1491
|
+
const e = t;
|
|
1492
|
+
function n() {
|
|
1493
|
+
Gt(e.fileName, e.sheetsConfig);
|
|
1494
1494
|
}
|
|
1495
|
-
return (
|
|
1496
|
-
const
|
|
1497
|
-
return
|
|
1495
|
+
return (l, s) => {
|
|
1496
|
+
const o = F("el-link");
|
|
1497
|
+
return L(), B(o, he({
|
|
1498
1498
|
type: "primary",
|
|
1499
1499
|
underline: "never"
|
|
1500
|
-
},
|
|
1501
|
-
default:
|
|
1502
|
-
|
|
1500
|
+
}, l.$attrs, { onClick: n }), {
|
|
1501
|
+
default: T(() => [
|
|
1502
|
+
Q(J(l.$t("xia-zai-dao-ru-mo-ban")), 1)
|
|
1503
1503
|
]),
|
|
1504
1504
|
_: 1
|
|
1505
1505
|
}, 16);
|
|
1506
1506
|
};
|
|
1507
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
|
+
}
|
|
1508
1518
|
};
|
|
1509
|
-
function
|
|
1510
|
-
|
|
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 = {
|
|
1511
1710
|
inForm: !0,
|
|
1512
1711
|
required: !0,
|
|
1513
1712
|
...e
|
|
1514
|
-
},
|
|
1713
|
+
}, s = {
|
|
1515
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}$/,
|
|
1516
1715
|
password: /(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/,
|
|
1517
1716
|
email: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
|
|
1518
|
-
}[
|
|
1519
|
-
return
|
|
1520
|
-
if (
|
|
1521
|
-
|
|
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));
|
|
1522
1721
|
return;
|
|
1523
1722
|
}
|
|
1524
|
-
|
|
1525
|
-
} :
|
|
1723
|
+
C && !s.test(C) ? w(new Error(c)) : w();
|
|
1724
|
+
} : s.test(a);
|
|
1526
1725
|
}
|
|
1527
|
-
class
|
|
1726
|
+
class Qn {
|
|
1528
1727
|
constructor(e = {}) {
|
|
1529
1728
|
this.config = {
|
|
1530
1729
|
clientCode: e.clientCode || "one-portal",
|
|
@@ -1546,8 +1745,8 @@ class Kn {
|
|
|
1546
1745
|
*/
|
|
1547
1746
|
init() {
|
|
1548
1747
|
this.log("OnePortal CAS SDK 初始化中..."), this.loadFromStorage();
|
|
1549
|
-
const
|
|
1550
|
-
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());
|
|
1551
1750
|
}
|
|
1552
1751
|
/**
|
|
1553
1752
|
* 从本地存储加载数据
|
|
@@ -1612,20 +1811,20 @@ class Kn {
|
|
|
1612
1811
|
async validateTicket(e) {
|
|
1613
1812
|
try {
|
|
1614
1813
|
this.log("验证ST票据:", e);
|
|
1615
|
-
const
|
|
1814
|
+
const n = await fetch(`${this.config.casServerUrl}/auth/validateST?ticket=${e}`, {
|
|
1616
1815
|
method: "GET",
|
|
1617
1816
|
headers: {
|
|
1618
1817
|
"Content-Type": "application/json"
|
|
1619
1818
|
}
|
|
1620
1819
|
});
|
|
1621
|
-
if (!
|
|
1622
|
-
throw new Error(`HTTP ${
|
|
1623
|
-
const
|
|
1624
|
-
if (
|
|
1625
|
-
return this.token =
|
|
1626
|
-
throw new Error(
|
|
1627
|
-
} catch (
|
|
1628
|
-
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;
|
|
1629
1828
|
}
|
|
1630
1829
|
}
|
|
1631
1830
|
/**
|
|
@@ -1650,31 +1849,31 @@ class Kn {
|
|
|
1650
1849
|
"Content-Type": "application/json"
|
|
1651
1850
|
}
|
|
1652
1851
|
});
|
|
1653
|
-
} catch (
|
|
1654
|
-
this.log("调用服务端登出接口失败:",
|
|
1852
|
+
} catch (n) {
|
|
1853
|
+
this.log("调用服务端登出接口失败:", n);
|
|
1655
1854
|
}
|
|
1656
1855
|
this.token = null, this.user = null, this.clearStorage(), this.config.logoutCallback && this.config.logoutCallback(), e && this.login();
|
|
1657
|
-
} catch (
|
|
1658
|
-
this.log("登出失败:",
|
|
1856
|
+
} catch (n) {
|
|
1857
|
+
this.log("登出失败:", n), this.handleError(n);
|
|
1659
1858
|
}
|
|
1660
1859
|
}
|
|
1661
1860
|
/**
|
|
1662
1861
|
* 发送带认证的HTTP请求
|
|
1663
1862
|
*/
|
|
1664
|
-
async request(e,
|
|
1665
|
-
const
|
|
1863
|
+
async request(e, n = {}) {
|
|
1864
|
+
const l = {
|
|
1666
1865
|
headers: {
|
|
1667
1866
|
"Content-Type": "application/json",
|
|
1668
|
-
...
|
|
1867
|
+
...n.headers
|
|
1669
1868
|
},
|
|
1670
|
-
...
|
|
1869
|
+
...n
|
|
1671
1870
|
};
|
|
1672
|
-
|
|
1871
|
+
l.headers.appId = this.config.clientCode, this.token && (l.headers.Authorization = `Bearer ${this.token}`);
|
|
1673
1872
|
try {
|
|
1674
|
-
const
|
|
1675
|
-
return
|
|
1676
|
-
} catch (
|
|
1677
|
-
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;
|
|
1678
1877
|
}
|
|
1679
1878
|
}
|
|
1680
1879
|
/**
|
|
@@ -1684,9 +1883,9 @@ class Kn {
|
|
|
1684
1883
|
try {
|
|
1685
1884
|
const e = await this.request(`${this.config.casServerUrl}/auth/user`);
|
|
1686
1885
|
if (e && e.ok) {
|
|
1687
|
-
const
|
|
1688
|
-
if (
|
|
1689
|
-
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;
|
|
1690
1889
|
}
|
|
1691
1890
|
return null;
|
|
1692
1891
|
} catch (e) {
|
|
@@ -1720,8 +1919,8 @@ class Kn {
|
|
|
1720
1919
|
/**
|
|
1721
1920
|
* 设置配置
|
|
1722
1921
|
*/
|
|
1723
|
-
setConfig(e,
|
|
1724
|
-
this.config[e] =
|
|
1922
|
+
setConfig(e, n) {
|
|
1923
|
+
this.config[e] = n;
|
|
1725
1924
|
}
|
|
1726
1925
|
/**
|
|
1727
1926
|
* 获取配置
|
|
@@ -1730,234 +1929,235 @@ class Kn {
|
|
|
1730
1929
|
return this.config[e];
|
|
1731
1930
|
}
|
|
1732
1931
|
}
|
|
1733
|
-
function
|
|
1734
|
-
const
|
|
1932
|
+
function eo(t, e = {}) {
|
|
1933
|
+
const l = Object.assign({
|
|
1735
1934
|
manual: !1,
|
|
1736
1935
|
// 手动执行
|
|
1737
1936
|
log: !1,
|
|
1738
1937
|
params: null,
|
|
1739
1938
|
format: null
|
|
1740
|
-
}, e), { manual:
|
|
1741
|
-
const
|
|
1742
|
-
|
|
1743
|
-
const { code: f, data:
|
|
1744
|
-
if (
|
|
1745
|
-
const { records:
|
|
1746
|
-
|
|
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);
|
|
1747
1946
|
}
|
|
1748
|
-
if (
|
|
1749
|
-
if (
|
|
1750
|
-
const { records:
|
|
1751
|
-
|
|
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);
|
|
1752
1951
|
} else
|
|
1753
|
-
|
|
1754
|
-
|
|
1952
|
+
b.value = Te(m, c);
|
|
1953
|
+
o && console.log("useRequest-res", b.value);
|
|
1755
1954
|
}
|
|
1756
|
-
}).catch((
|
|
1757
|
-
|
|
1955
|
+
}).catch((h) => {
|
|
1956
|
+
r && (console.log("useRequestErr", h), r({ code: 500 }));
|
|
1758
1957
|
}).finally(() => {
|
|
1759
|
-
|
|
1958
|
+
C.value = !1;
|
|
1760
1959
|
});
|
|
1761
1960
|
};
|
|
1762
|
-
return
|
|
1961
|
+
return s || w(), [C, b, w];
|
|
1763
1962
|
}
|
|
1764
|
-
function
|
|
1765
|
-
const e = R(
|
|
1766
|
-
return
|
|
1767
|
-
const
|
|
1768
|
-
|
|
1769
|
-
}), [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];
|
|
1770
1969
|
}
|
|
1771
|
-
function
|
|
1772
|
-
return Object.prototype.toString.call(
|
|
1970
|
+
function no(t) {
|
|
1971
|
+
return Object.prototype.toString.call(t).slice(8, -1).toLowerCase();
|
|
1773
1972
|
}
|
|
1774
|
-
function Te(
|
|
1973
|
+
function Te(t, e) {
|
|
1775
1974
|
if (!e)
|
|
1776
|
-
return
|
|
1777
|
-
if (
|
|
1778
|
-
return
|
|
1779
|
-
let
|
|
1780
|
-
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;
|
|
1781
1980
|
});
|
|
1782
|
-
let
|
|
1783
|
-
return e.forEach((
|
|
1981
|
+
let n = {};
|
|
1982
|
+
return e.forEach((l) => n[l] = t[l]), n;
|
|
1784
1983
|
}
|
|
1785
|
-
function
|
|
1786
|
-
const { locale:
|
|
1787
|
-
return
|
|
1788
|
-
[
|
|
1984
|
+
function oo(t, e = []) {
|
|
1985
|
+
const { locale: n } = me(), l = R(t());
|
|
1986
|
+
return Ae(
|
|
1987
|
+
[n, ...e],
|
|
1789
1988
|
() => {
|
|
1790
|
-
|
|
1989
|
+
l.value = t();
|
|
1791
1990
|
},
|
|
1792
1991
|
{ immediate: !0 }
|
|
1793
|
-
),
|
|
1992
|
+
), l;
|
|
1794
1993
|
}
|
|
1795
|
-
function
|
|
1796
|
-
if (!
|
|
1994
|
+
function lo(t, e = "zh_cn", n = "en_us") {
|
|
1995
|
+
if (!t)
|
|
1797
1996
|
return "-";
|
|
1798
|
-
const
|
|
1799
|
-
return
|
|
1997
|
+
const l = { en_us: n, zh_cn: e }, o = Pe().global.locale.value;
|
|
1998
|
+
return t[l[o]] || t[e] || "-";
|
|
1800
1999
|
}
|
|
1801
|
-
function
|
|
1802
|
-
let
|
|
1803
|
-
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);
|
|
1804
2003
|
}
|
|
1805
|
-
function
|
|
1806
|
-
let
|
|
1807
|
-
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);
|
|
1808
2007
|
}
|
|
1809
|
-
function
|
|
1810
|
-
let
|
|
1811
|
-
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);
|
|
1812
2011
|
}
|
|
1813
|
-
function
|
|
1814
|
-
const
|
|
1815
|
-
return Object.keys(
|
|
1816
|
-
const
|
|
1817
|
-
|
|
1818
|
-
}),
|
|
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;
|
|
1819
2018
|
}
|
|
1820
|
-
function
|
|
1821
|
-
const
|
|
1822
|
-
return Object.keys(
|
|
1823
|
-
|
|
1824
|
-
}),
|
|
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;
|
|
1825
2024
|
}
|
|
1826
|
-
function
|
|
1827
|
-
return typeof
|
|
2025
|
+
function Fe(t) {
|
|
2026
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !Ot(t);
|
|
1828
2027
|
}
|
|
1829
|
-
function
|
|
1830
|
-
|
|
2028
|
+
function io() {
|
|
2029
|
+
we.renderer.add("Enum", {
|
|
1831
2030
|
// 默认显示模板
|
|
1832
|
-
renderTableDefault(
|
|
1833
|
-
let
|
|
2031
|
+
renderTableDefault(t, e) {
|
|
2032
|
+
let n;
|
|
1834
2033
|
if ([null, void 0].includes(e.row[e.column.field]))
|
|
1835
2034
|
return "-";
|
|
1836
|
-
const
|
|
1837
|
-
if (
|
|
1838
|
-
let
|
|
1839
|
-
return
|
|
1840
|
-
type:
|
|
1841
|
-
},
|
|
1842
|
-
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]
|
|
1843
2042
|
});
|
|
1844
2043
|
}
|
|
1845
|
-
return
|
|
1846
|
-
default: () => [
|
|
2044
|
+
return V(F("el-text"), null, Fe(n = t.enum.getName(l)) ? n : {
|
|
2045
|
+
default: () => [n]
|
|
1847
2046
|
});
|
|
1848
2047
|
}
|
|
1849
|
-
}),
|
|
2048
|
+
}), we.renderer.add("InputNumber", {
|
|
1850
2049
|
// 默认显示模板
|
|
1851
|
-
renderTableDefault(
|
|
1852
|
-
return
|
|
2050
|
+
renderTableDefault(t, e) {
|
|
2051
|
+
return V(St, he({
|
|
1853
2052
|
modelValue: e.row[e.column.field],
|
|
1854
|
-
"onUpdate:modelValue": (
|
|
1855
|
-
},
|
|
2053
|
+
"onUpdate:modelValue": (n) => e.row[e.column.field] = n
|
|
2054
|
+
}, t.props, {
|
|
1856
2055
|
"step-strictly": !0,
|
|
1857
2056
|
"value-on-clear": 0
|
|
1858
2057
|
}), null);
|
|
1859
2058
|
}
|
|
1860
|
-
}),
|
|
2059
|
+
}), we.renderer.add("TrueFalse", {
|
|
1861
2060
|
// 默认显示模板
|
|
1862
|
-
renderTableDefault(
|
|
2061
|
+
renderTableDefault(t, e) {
|
|
1863
2062
|
const {
|
|
1864
|
-
locale:
|
|
1865
|
-
} =
|
|
1866
|
-
let
|
|
1867
|
-
return
|
|
2063
|
+
locale: n
|
|
2064
|
+
} = me();
|
|
2065
|
+
let l = n.value == "zh_cn";
|
|
2066
|
+
return V($t, {
|
|
1868
2067
|
type: e.row[e.column.field] ? "success" : "danger"
|
|
1869
2068
|
}, {
|
|
1870
|
-
default: () => [e.row[e.column.field] ?
|
|
2069
|
+
default: () => [e.row[e.column.field] ? l ? "是" : "YES" : l ? "否" : "NO"]
|
|
1871
2070
|
});
|
|
1872
2071
|
}
|
|
1873
|
-
}),
|
|
2072
|
+
}), we.renderer.add("I18n", {
|
|
1874
2073
|
// 默认显示模板
|
|
1875
|
-
renderTableDefault(
|
|
2074
|
+
renderTableDefault(t, e) {
|
|
1876
2075
|
const {
|
|
1877
|
-
locale:
|
|
1878
|
-
} =
|
|
1879
|
-
let
|
|
1880
|
-
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];
|
|
1881
2080
|
}
|
|
1882
|
-
}),
|
|
2081
|
+
}), we.renderer.add("Link", {
|
|
1883
2082
|
// 默认显示模板
|
|
1884
|
-
renderTableDefault(
|
|
1885
|
-
var
|
|
1886
|
-
let
|
|
1887
|
-
const
|
|
1888
|
-
multiple:
|
|
1889
|
-
to:
|
|
1890
|
-
} =
|
|
1891
|
-
if (!
|
|
1892
|
-
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, {
|
|
1893
2092
|
underline: "never",
|
|
1894
2093
|
type: "primary",
|
|
1895
|
-
onclick: () =>
|
|
1896
|
-
path:
|
|
2094
|
+
onclick: () => l.push({
|
|
2095
|
+
path: o,
|
|
1897
2096
|
query: {
|
|
1898
|
-
[
|
|
2097
|
+
[n]: e.row[n]
|
|
1899
2098
|
}
|
|
1900
2099
|
})
|
|
1901
2100
|
}, {
|
|
1902
|
-
default: () => [e.row[
|
|
2101
|
+
default: () => [e.row[n]]
|
|
1903
2102
|
});
|
|
1904
|
-
const
|
|
1905
|
-
return
|
|
2103
|
+
const a = ((r = e.row[n]) == null ? void 0 : r.split(",")) || [];
|
|
2104
|
+
return a.map((c, b) => V("span", null, [V(Ge, {
|
|
1906
2105
|
underline: "never",
|
|
1907
2106
|
type: "primary",
|
|
1908
|
-
onclick: () =>
|
|
1909
|
-
path:
|
|
2107
|
+
onclick: () => l.push({
|
|
2108
|
+
path: o,
|
|
1910
2109
|
query: {
|
|
1911
|
-
[
|
|
2110
|
+
[n]: c
|
|
1912
2111
|
}
|
|
1913
2112
|
})
|
|
1914
|
-
},
|
|
1915
|
-
default: () => [
|
|
1916
|
-
}),
|
|
2113
|
+
}, Fe(c) ? c : {
|
|
2114
|
+
default: () => [c]
|
|
2115
|
+
}), b < a.length - 1 ? "," : ""]));
|
|
1917
2116
|
}
|
|
1918
2117
|
});
|
|
1919
2118
|
}
|
|
1920
2119
|
export {
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
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,
|
|
1939
2139
|
Me as en_us,
|
|
1940
|
-
|
|
2140
|
+
Gt as exportExcel,
|
|
1941
2141
|
Pe as getI18n,
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
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,
|
|
1962
2162
|
Ve as zh_cn
|
|
1963
2163
|
};
|