joy-admin-components 0.1.43 → 0.1.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/joy-admin-components.es.js +829 -821
- package/dist/joy-admin-components.umd.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,194 +1,194 @@
|
|
|
1
|
-
import { ElForm as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { saveAs as
|
|
4
|
-
import
|
|
1
|
+
import { ElForm as ht, ElRow as mt, ElCol as gt, ElInputNumber as pt, ElText as vt, ElLink as Pe } from "element-plus";
|
|
2
|
+
import { defineComponent as Ne, ref as q, onMounted as Ke, h as _e, mergeModels as Be, useAttrs as bt, useModel as yt, computed as se, resolveComponent as O, openBlock as T, createBlock as U, mergeProps as me, unref as Z, withCtx as R, renderSlot as ie, createVNode as W, createTextVNode as te, toDisplayString as ne, createCommentVNode as ce, createElementBlock as re, Fragment as Ie, renderList as Ze, withModifiers as Ee, resolveDynamicComponent as Ge, createElementVNode as ae, withKeys as Ct, normalizeStyle as xt, normalizeClass as Le, reactive as pe, nextTick as $e, onUpdated as wt, onUnmounted as kt, watch as We } from "vue";
|
|
3
|
+
import { saveAs as _t } from "file-saver";
|
|
4
|
+
import Je from "exceljs";
|
|
5
5
|
import ve from "dayjs";
|
|
6
|
-
import { createI18n as
|
|
7
|
-
import { debounce as
|
|
8
|
-
import {
|
|
6
|
+
import { createI18n as $t, useI18n as de } from "vue-i18n";
|
|
7
|
+
import { debounce as Qe, cloneDeep as Xe, isArray as Ye } from "lodash";
|
|
8
|
+
import { useRoute as St, useRouter as It } from "vue-router";
|
|
9
|
+
import { createNamespacedHelpers as De, useStore as et, mapState as Et, mapGetters as Lt, mapActions as Tt } from "vuex";
|
|
9
10
|
import { VxeUI as he } from "vxe-pc-ui";
|
|
10
|
-
|
|
11
|
-
const mn = Ye({
|
|
11
|
+
const bn = Ne({
|
|
12
12
|
name: "LayOutForm",
|
|
13
|
-
setup(n, { slots: e, attrs: t, emit:
|
|
14
|
-
const
|
|
15
|
-
(
|
|
16
|
-
var
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
{ span: ((
|
|
13
|
+
setup(n, { slots: e, attrs: t, emit: o }) {
|
|
14
|
+
const r = q(null), l = () => e.default ? e.default().filter((d) => d.type !== Symbol.for("v-cmt")).map((d) => d.type === Symbol.for("v-fgt") ? d.children : d).flat().map(
|
|
15
|
+
(d) => {
|
|
16
|
+
var c;
|
|
17
|
+
return _e(
|
|
18
|
+
gt,
|
|
19
|
+
{ span: ((c = d.props) == null ? void 0 : c.span) || 24 },
|
|
20
20
|
{
|
|
21
|
-
default: () =>
|
|
21
|
+
default: () => d
|
|
22
22
|
}
|
|
23
23
|
);
|
|
24
24
|
}
|
|
25
25
|
) : null;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
Ke(() => {
|
|
27
|
+
o("ref", r.value);
|
|
28
28
|
});
|
|
29
29
|
function a() {
|
|
30
|
-
return
|
|
31
|
-
|
|
32
|
-
{ ...t, ref:
|
|
33
|
-
() =>
|
|
30
|
+
return _e(
|
|
31
|
+
ht,
|
|
32
|
+
{ ...t, ref: r },
|
|
33
|
+
() => _e(mt, { gutter: t.gutter ?? 20 }, { default: () => l() })
|
|
34
34
|
);
|
|
35
35
|
}
|
|
36
36
|
return a;
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
var
|
|
40
|
-
function
|
|
39
|
+
var tt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
40
|
+
function nt(n) {
|
|
41
41
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
42
42
|
}
|
|
43
|
-
var
|
|
43
|
+
var ot = { exports: {} };
|
|
44
44
|
(function(n, e) {
|
|
45
|
-
(function(t,
|
|
46
|
-
n.exports =
|
|
47
|
-
})(
|
|
48
|
-
var t = "minute",
|
|
49
|
-
return function(
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
var f = { date:
|
|
45
|
+
(function(t, o) {
|
|
46
|
+
n.exports = o();
|
|
47
|
+
})(tt, function() {
|
|
48
|
+
var t = "minute", o = /[+-]\d\d(?::?\d\d)?/g, r = /([+-]|\d\d)/g;
|
|
49
|
+
return function(l, a, d) {
|
|
50
|
+
var c = a.prototype;
|
|
51
|
+
d.utc = function(u) {
|
|
52
|
+
var f = { date: u, utc: !0, args: arguments };
|
|
53
53
|
return new a(f);
|
|
54
|
-
},
|
|
55
|
-
var f =
|
|
56
|
-
return
|
|
57
|
-
},
|
|
58
|
-
return
|
|
54
|
+
}, c.utc = function(u) {
|
|
55
|
+
var f = d(this.toDate(), { locale: this.$L, utc: !0 });
|
|
56
|
+
return u ? f.add(this.utcOffset(), t) : f;
|
|
57
|
+
}, c.local = function() {
|
|
58
|
+
return d(this.toDate(), { locale: this.$L, utc: !1 });
|
|
59
59
|
};
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
var w = c.parse;
|
|
61
|
+
c.parse = function(u) {
|
|
62
|
+
u.utc && (this.$u = !0), this.$utils().u(u.$offset) || (this.$offset = u.$offset), w.call(this, u);
|
|
63
63
|
};
|
|
64
|
-
var
|
|
65
|
-
|
|
64
|
+
var C = c.init;
|
|
65
|
+
c.init = function() {
|
|
66
66
|
if (this.$u) {
|
|
67
|
-
var
|
|
68
|
-
this.$y =
|
|
67
|
+
var u = this.$d;
|
|
68
|
+
this.$y = u.getUTCFullYear(), this.$M = u.getUTCMonth(), this.$D = u.getUTCDate(), this.$W = u.getUTCDay(), this.$H = u.getUTCHours(), this.$m = u.getUTCMinutes(), this.$s = u.getUTCSeconds(), this.$ms = u.getUTCMilliseconds();
|
|
69
69
|
} else
|
|
70
|
-
|
|
70
|
+
C.call(this);
|
|
71
71
|
};
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
var
|
|
75
|
-
if (
|
|
76
|
-
return this.$u ? 0 :
|
|
77
|
-
if (typeof
|
|
78
|
-
|
|
79
|
-
var
|
|
80
|
-
if (!
|
|
72
|
+
var b = c.utcOffset;
|
|
73
|
+
c.utcOffset = function(u, f) {
|
|
74
|
+
var _ = this.$utils().u;
|
|
75
|
+
if (_(u))
|
|
76
|
+
return this.$u ? 0 : _(this.$offset) ? b.call(this) : this.$offset;
|
|
77
|
+
if (typeof u == "string" && (u = function($) {
|
|
78
|
+
$ === void 0 && ($ = "");
|
|
79
|
+
var B = $.match(o);
|
|
80
|
+
if (!B)
|
|
81
81
|
return null;
|
|
82
|
-
var
|
|
83
|
-
return
|
|
84
|
-
}(
|
|
82
|
+
var S = ("" + B[0]).match(r) || ["-", 0, 0], v = S[0], Y = 60 * +S[1] + +S[2];
|
|
83
|
+
return Y === 0 ? 0 : v === "+" ? Y : -Y;
|
|
84
|
+
}(u), u === null))
|
|
85
85
|
return this;
|
|
86
|
-
var h = Math.abs(
|
|
86
|
+
var h = Math.abs(u) <= 16 ? 60 * u : u;
|
|
87
87
|
if (h === 0)
|
|
88
88
|
return this.utc(f);
|
|
89
|
-
var
|
|
89
|
+
var g = this.clone();
|
|
90
90
|
if (f)
|
|
91
|
-
return
|
|
92
|
-
var
|
|
93
|
-
return (
|
|
91
|
+
return g.$offset = h, g.$u = !1, g;
|
|
92
|
+
var E = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
|
|
93
|
+
return (g = this.local().add(h + E, t)).$offset = h, g.$x.$localOffset = E, g;
|
|
94
94
|
};
|
|
95
|
-
var
|
|
96
|
-
|
|
97
|
-
var f =
|
|
98
|
-
return
|
|
99
|
-
},
|
|
100
|
-
var
|
|
101
|
-
return this.$d.valueOf() - 6e4 *
|
|
102
|
-
},
|
|
95
|
+
var m = c.format;
|
|
96
|
+
c.format = function(u) {
|
|
97
|
+
var f = u || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
|
|
98
|
+
return m.call(this, f);
|
|
99
|
+
}, c.valueOf = function() {
|
|
100
|
+
var u = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
|
|
101
|
+
return this.$d.valueOf() - 6e4 * u;
|
|
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
|
|
109
|
+
var x = c.toDate;
|
|
110
|
+
c.toDate = function(u) {
|
|
111
|
+
return u === "s" && this.$offset ? d(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : x.call(this);
|
|
112
112
|
};
|
|
113
|
-
var
|
|
114
|
-
|
|
115
|
-
if (
|
|
116
|
-
return
|
|
117
|
-
var h = this.local(),
|
|
118
|
-
return
|
|
113
|
+
var p = c.diff;
|
|
114
|
+
c.diff = function(u, f, _) {
|
|
115
|
+
if (u && this.$u === u.$u)
|
|
116
|
+
return p.call(this, u, f, _);
|
|
117
|
+
var h = this.local(), g = d(u).local();
|
|
118
|
+
return p.call(h, g, f, _);
|
|
119
119
|
};
|
|
120
120
|
};
|
|
121
121
|
});
|
|
122
|
-
})(
|
|
123
|
-
var
|
|
124
|
-
const
|
|
125
|
-
var
|
|
122
|
+
})(ot);
|
|
123
|
+
var Ft = ot.exports;
|
|
124
|
+
const Ot = /* @__PURE__ */ nt(Ft);
|
|
125
|
+
var lt = { exports: {} };
|
|
126
126
|
(function(n, e) {
|
|
127
|
-
(function(t,
|
|
128
|
-
n.exports =
|
|
129
|
-
})(
|
|
130
|
-
var t = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 },
|
|
131
|
-
return function(
|
|
132
|
-
var
|
|
133
|
-
|
|
134
|
-
var
|
|
127
|
+
(function(t, o) {
|
|
128
|
+
n.exports = o();
|
|
129
|
+
})(tt, function() {
|
|
130
|
+
var t = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, o = {};
|
|
131
|
+
return function(r, l, a) {
|
|
132
|
+
var d, c = function(m, x, p) {
|
|
133
|
+
p === void 0 && (p = {});
|
|
134
|
+
var u = new Date(m), f = function(_, h) {
|
|
135
135
|
h === void 0 && (h = {});
|
|
136
|
-
var
|
|
137
|
-
return
|
|
138
|
-
}(
|
|
139
|
-
return f.formatToParts(
|
|
140
|
-
},
|
|
141
|
-
for (var
|
|
142
|
-
var
|
|
143
|
-
|
|
136
|
+
var g = h.timeZoneName || "short", E = _ + "|" + g, $ = o[E];
|
|
137
|
+
return $ || ($ = 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: g }), o[E] = $), $;
|
|
138
|
+
}(x, p);
|
|
139
|
+
return f.formatToParts(u);
|
|
140
|
+
}, w = function(m, x) {
|
|
141
|
+
for (var p = c(m, x), u = [], f = 0; f < p.length; f += 1) {
|
|
142
|
+
var _ = p[f], h = _.type, g = _.value, E = t[h];
|
|
143
|
+
E >= 0 && (u[E] = parseInt(g, 10));
|
|
144
144
|
}
|
|
145
|
-
var
|
|
146
|
-
return (a.utc(
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
var
|
|
151
|
-
if (!Number(
|
|
152
|
-
|
|
153
|
-
else if (
|
|
154
|
-
var
|
|
155
|
-
|
|
145
|
+
var $ = u[3], B = $ === 24 ? 0 : $, S = u[0] + "-" + u[1] + "-" + u[2] + " " + B + ":" + u[4] + ":" + u[5] + ":000", v = +m;
|
|
146
|
+
return (a.utc(S).valueOf() - (v -= v % 1e3)) / 6e4;
|
|
147
|
+
}, C = l.prototype;
|
|
148
|
+
C.tz = function(m, x) {
|
|
149
|
+
m === void 0 && (m = d);
|
|
150
|
+
var p, u = this.utcOffset(), f = this.toDate(), _ = f.toLocaleString("en-US", { timeZone: m }), h = Math.round((f - new Date(_)) / 1e3 / 60), g = 15 * -Math.round(f.getTimezoneOffset() / 15) - h;
|
|
151
|
+
if (!Number(g))
|
|
152
|
+
p = this.utcOffset(0, x);
|
|
153
|
+
else if (p = a(_, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(g, !0), x) {
|
|
154
|
+
var E = p.utcOffset();
|
|
155
|
+
p = p.add(u - E, "minute");
|
|
156
156
|
}
|
|
157
|
-
return
|
|
158
|
-
},
|
|
159
|
-
var
|
|
160
|
-
return
|
|
157
|
+
return p.$x.$timezone = m, p;
|
|
158
|
+
}, C.offsetName = function(m) {
|
|
159
|
+
var x = this.$x.$timezone || a.tz.guess(), p = c(this.valueOf(), x, { timeZoneName: m }).find(function(u) {
|
|
160
|
+
return u.type.toLowerCase() === "timezonename";
|
|
161
161
|
});
|
|
162
|
-
return
|
|
162
|
+
return p && p.value;
|
|
163
163
|
};
|
|
164
|
-
var
|
|
165
|
-
|
|
164
|
+
var b = C.startOf;
|
|
165
|
+
C.startOf = function(m, x) {
|
|
166
166
|
if (!this.$x || !this.$x.$timezone)
|
|
167
|
-
return
|
|
168
|
-
var
|
|
169
|
-
return
|
|
170
|
-
}, a.tz = function(
|
|
171
|
-
var
|
|
172
|
-
if (typeof
|
|
173
|
-
return a(
|
|
174
|
-
var h = function(
|
|
175
|
-
var
|
|
176
|
-
if (
|
|
177
|
-
return [
|
|
178
|
-
var z =
|
|
179
|
-
return
|
|
180
|
-
}(a.utc(
|
|
181
|
-
return
|
|
167
|
+
return b.call(this, m, x);
|
|
168
|
+
var p = a(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
|
|
169
|
+
return b.call(p, m, x).tz(this.$x.$timezone, !0);
|
|
170
|
+
}, a.tz = function(m, x, p) {
|
|
171
|
+
var u = p && x, f = p || x || d, _ = w(+a(), f);
|
|
172
|
+
if (typeof m != "string")
|
|
173
|
+
return a(m).tz(f);
|
|
174
|
+
var h = function(B, S, v) {
|
|
175
|
+
var Y = B - 60 * S * 1e3, H = w(Y, v);
|
|
176
|
+
if (S === H)
|
|
177
|
+
return [Y, S];
|
|
178
|
+
var z = w(Y -= 60 * (H - S) * 1e3, v);
|
|
179
|
+
return H === z ? [Y, H] : [B - 60 * Math.min(H, z) * 1e3, Math.max(H, z)];
|
|
180
|
+
}(a.utc(m, u).valueOf(), _, f), g = h[0], E = h[1], $ = a(g).utcOffset(E);
|
|
181
|
+
return $.$x.$timezone = f, $;
|
|
182
182
|
}, a.tz.guess = function() {
|
|
183
183
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
184
|
-
}, a.tz.setDefault = function(
|
|
185
|
-
|
|
184
|
+
}, a.tz.setDefault = function(m) {
|
|
185
|
+
d = m;
|
|
186
186
|
};
|
|
187
187
|
};
|
|
188
188
|
});
|
|
189
|
-
})(
|
|
190
|
-
var
|
|
191
|
-
const
|
|
189
|
+
})(lt);
|
|
190
|
+
var Dt = lt.exports;
|
|
191
|
+
const zt = /* @__PURE__ */ nt(Dt), Te = {
|
|
192
192
|
// 组件通用文本
|
|
193
193
|
"dao-ru": "导入",
|
|
194
194
|
"quan-xuan": "全选",
|
|
@@ -218,7 +218,7 @@ const Tt = /* @__PURE__ */ et(Lt), Le = {
|
|
|
218
218
|
tools: {
|
|
219
219
|
keysLengthError: "keys 长度必须大于2 默认前两位为 label value"
|
|
220
220
|
}
|
|
221
|
-
},
|
|
221
|
+
}, Fe = {
|
|
222
222
|
// Common component text
|
|
223
223
|
"dao-ru": "Import",
|
|
224
224
|
"quan-xuan": "Select All",
|
|
@@ -248,137 +248,137 @@ const Tt = /* @__PURE__ */ et(Lt), Le = {
|
|
|
248
248
|
tools: {
|
|
249
249
|
keysLengthError: "Keys length must be greater than 2, default first two are label and value"
|
|
250
250
|
}
|
|
251
|
-
},
|
|
252
|
-
zh_cn:
|
|
253
|
-
en:
|
|
251
|
+
}, Mt = {
|
|
252
|
+
zh_cn: Te,
|
|
253
|
+
en: Fe
|
|
254
254
|
};
|
|
255
|
-
let
|
|
256
|
-
function
|
|
255
|
+
let ue = null;
|
|
256
|
+
function Rt(n = null) {
|
|
257
257
|
if (n) {
|
|
258
258
|
const { global: e } = n;
|
|
259
|
-
return e.messages.value.zh_cn ? e.mergeLocaleMessage("zh_cn",
|
|
259
|
+
return e.messages.value.zh_cn ? e.mergeLocaleMessage("zh_cn", Te) : e.setLocaleMessage("zh_cn", Te), e.messages.value.en ? e.mergeLocaleMessage("en", Fe) : e.setLocaleMessage("en", Fe), ue = n, n;
|
|
260
260
|
}
|
|
261
|
-
return
|
|
261
|
+
return ue || (ue = $t({
|
|
262
262
|
legacy: !1,
|
|
263
263
|
locale: "zh_cn",
|
|
264
264
|
fallbackLocale: "zh_cn",
|
|
265
|
-
messages:
|
|
266
|
-
})),
|
|
265
|
+
messages: Mt
|
|
266
|
+
})), ue;
|
|
267
267
|
}
|
|
268
|
-
function
|
|
269
|
-
return
|
|
268
|
+
function rt() {
|
|
269
|
+
return ue || Rt();
|
|
270
270
|
}
|
|
271
|
-
function
|
|
272
|
-
return
|
|
271
|
+
function ze() {
|
|
272
|
+
return rt().global.t;
|
|
273
273
|
}
|
|
274
|
-
ve.extend(
|
|
275
|
-
ve.extend(
|
|
276
|
-
async function
|
|
277
|
-
const { fields: t, range:
|
|
274
|
+
ve.extend(Ot);
|
|
275
|
+
ve.extend(zt);
|
|
276
|
+
async function yn(n, e) {
|
|
277
|
+
const { fields: t, range: o = 1 } = e;
|
|
278
278
|
if (!t) {
|
|
279
|
-
const a =
|
|
279
|
+
const a = ze();
|
|
280
280
|
throw new Error(a("excel.fieldsMappingRequired"));
|
|
281
281
|
}
|
|
282
|
-
let
|
|
283
|
-
await
|
|
284
|
-
const
|
|
285
|
-
return
|
|
286
|
-
const
|
|
287
|
-
a.eachRow(function(
|
|
288
|
-
if (
|
|
289
|
-
let
|
|
290
|
-
Object.keys(t).forEach((
|
|
291
|
-
const
|
|
292
|
-
|
|
293
|
-
}),
|
|
282
|
+
let r = new Je.Workbook();
|
|
283
|
+
await r.xlsx.load(n);
|
|
284
|
+
const l = {};
|
|
285
|
+
return r.eachSheet(function(a, d) {
|
|
286
|
+
const c = [];
|
|
287
|
+
a.eachRow(function(w, C) {
|
|
288
|
+
if (C > o) {
|
|
289
|
+
let b = {}, m = !0;
|
|
290
|
+
Object.keys(t).forEach((x) => {
|
|
291
|
+
const p = w.getCell(t[x]).value;
|
|
292
|
+
b[x] = p, p && (m = !1);
|
|
293
|
+
}), m || c.push(b);
|
|
294
294
|
}
|
|
295
|
-
}),
|
|
296
|
-
}),
|
|
295
|
+
}), l[a._name] = c;
|
|
296
|
+
}), r = null, l;
|
|
297
297
|
}
|
|
298
|
-
const
|
|
298
|
+
const At = {
|
|
299
299
|
columnWidth: 30
|
|
300
300
|
};
|
|
301
|
-
async function
|
|
301
|
+
async function Vt(n, e, t = [], o = {}) {
|
|
302
302
|
if (!n || !e)
|
|
303
303
|
return;
|
|
304
|
-
const { columnStyle:
|
|
305
|
-
e.forEach((
|
|
306
|
-
|
|
304
|
+
const { columnStyle: r } = o, { columnWidth: l } = At;
|
|
305
|
+
e.forEach((c) => {
|
|
306
|
+
c.width = c.width ? c.width : l;
|
|
307
307
|
});
|
|
308
|
-
const { workbook: a, worksheet:
|
|
309
|
-
|
|
308
|
+
const { workbook: a, worksheet: d } = Ut();
|
|
309
|
+
d.columns = e, d.addRows(t), r && await jt(a, d, r);
|
|
310
310
|
try {
|
|
311
|
-
const
|
|
311
|
+
const c = await a.xlsx.writeBuffer(), w = new File([c], n, {
|
|
312
312
|
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
313
313
|
});
|
|
314
|
-
|
|
315
|
-
} catch (
|
|
316
|
-
console.log(
|
|
314
|
+
_t(w);
|
|
315
|
+
} catch (c) {
|
|
316
|
+
console.log(c);
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
|
-
function
|
|
320
|
-
const n = new
|
|
319
|
+
function Ut() {
|
|
320
|
+
const n = new Je.Workbook();
|
|
321
321
|
n.creator = "distributor System", n.lastModifiedBy = "distributor System", n.created = /* @__PURE__ */ new Date(), n.modified = /* @__PURE__ */ new Date(), n.lastPrinted = /* @__PURE__ */ new Date();
|
|
322
322
|
const e = n.addWorksheet("Sheet1");
|
|
323
323
|
return { workbook: n, worksheet: e };
|
|
324
324
|
}
|
|
325
|
-
async function
|
|
326
|
-
const
|
|
327
|
-
for (const
|
|
328
|
-
const
|
|
325
|
+
async function jt(n, e, t) {
|
|
326
|
+
const o = Object.keys(t);
|
|
327
|
+
for (const r of o) {
|
|
328
|
+
const l = t[r], { type: a } = l;
|
|
329
329
|
switch (a) {
|
|
330
330
|
case "IMG":
|
|
331
|
-
await
|
|
331
|
+
await qt(n, e, r);
|
|
332
332
|
break;
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
}
|
|
336
|
-
async function
|
|
337
|
-
const
|
|
338
|
-
e.getColumn(t).width = 20, e.eachRow((a,
|
|
339
|
-
|
|
336
|
+
async function qt(n, e, t, o) {
|
|
337
|
+
const r = e.getColumn(t), l = r.values;
|
|
338
|
+
e.getColumn(t).width = 20, e.eachRow((a, d) => {
|
|
339
|
+
d > 1 && (a.height = 40);
|
|
340
340
|
});
|
|
341
|
-
for (let a = 0,
|
|
341
|
+
for (let a = 0, d = l.length; a < d; a++) {
|
|
342
342
|
if (a < 2)
|
|
343
343
|
continue;
|
|
344
|
-
let
|
|
345
|
-
|
|
344
|
+
let c = l[a];
|
|
345
|
+
c && (e.getCell(r.letter + a).value = "", await Pt(n, e, c, {
|
|
346
346
|
width: 100,
|
|
347
347
|
height: 50,
|
|
348
|
-
col:
|
|
348
|
+
col: r._number - 1,
|
|
349
349
|
row: a - 1
|
|
350
350
|
}));
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
async function
|
|
354
|
-
const { col:
|
|
355
|
-
if (
|
|
356
|
-
const
|
|
357
|
-
base64:
|
|
353
|
+
async function Pt(n, e, t, o) {
|
|
354
|
+
const { col: r, row: l, width: a, height: d } = o, { success: c, base64: w } = await Bt(t, 0.3);
|
|
355
|
+
if (c) {
|
|
356
|
+
const C = n.addImage({
|
|
357
|
+
base64: w,
|
|
358
358
|
extension: "jpeg"
|
|
359
359
|
});
|
|
360
|
-
e.addImage(
|
|
361
|
-
tl: { col:
|
|
362
|
-
ext: { width: a, height:
|
|
360
|
+
e.addImage(C, {
|
|
361
|
+
tl: { col: r, row: l },
|
|
362
|
+
ext: { width: a, height: d }
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function Bt(n, e = 1) {
|
|
367
367
|
const t = new Image();
|
|
368
|
-
return t.setAttribute("crossOrigin", "anonymous"), t.crossOrigin = "anonymous", t.src = n, new Promise((
|
|
368
|
+
return t.setAttribute("crossOrigin", "anonymous"), t.crossOrigin = "anonymous", t.src = n, new Promise((o, r) => {
|
|
369
369
|
t.onload = () => {
|
|
370
|
-
const
|
|
371
|
-
|
|
370
|
+
const l = document.createElement("canvas");
|
|
371
|
+
l.width = t.width, l.height = t.height, l.getContext("2d").drawImage(t, 0, 0, l.width, l.height), o({
|
|
372
372
|
success: !0,
|
|
373
373
|
//canvas.toDataURL的方法将图片的绝对路径转换为base64编码
|
|
374
|
-
base64:
|
|
374
|
+
base64: l.toDataURL("image/jpeg", e)
|
|
375
375
|
});
|
|
376
376
|
}, t.onerror = () => {
|
|
377
|
-
|
|
377
|
+
o({ success: !1 });
|
|
378
378
|
};
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function Yt(n) {
|
|
382
382
|
if (n < 26)
|
|
383
383
|
return String.fromCharCode(65 + n);
|
|
384
384
|
{
|
|
@@ -386,52 +386,52 @@ function jt(n) {
|
|
|
386
386
|
return e + t;
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
|
-
function
|
|
389
|
+
function Cn(n) {
|
|
390
390
|
return new Promise((e) => {
|
|
391
391
|
setTimeout(() => {
|
|
392
392
|
e();
|
|
393
393
|
}, n);
|
|
394
394
|
});
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function xn(n) {
|
|
397
397
|
return JSON.parse(JSON.stringify(n));
|
|
398
398
|
}
|
|
399
|
-
function
|
|
400
|
-
let e = [], t = {},
|
|
401
|
-
for (const
|
|
402
|
-
t[
|
|
403
|
-
...
|
|
399
|
+
function wn(n) {
|
|
400
|
+
let e = [], t = {}, o = (r, l) => Object.prototype.hasOwnProperty.call(r, l);
|
|
401
|
+
for (const r of n) {
|
|
402
|
+
t[r.id] = {
|
|
403
|
+
...r,
|
|
404
404
|
// 判断当前项的子项 如果map有存储就用存储的子项 否则初始化
|
|
405
|
-
children:
|
|
405
|
+
children: o(t, r.id) ? t[r.id].children : []
|
|
406
406
|
};
|
|
407
|
-
const
|
|
408
|
-
|
|
407
|
+
const l = t[r.id];
|
|
408
|
+
r.pid == -1 ? e.push(l) : (o(t, r.pid) || (t[r.pid] = {
|
|
409
409
|
children: []
|
|
410
|
-
}), t[
|
|
410
|
+
}), t[r.pid].children.push(l));
|
|
411
411
|
}
|
|
412
412
|
return e;
|
|
413
413
|
}
|
|
414
|
-
function
|
|
414
|
+
function at(n, e = " ") {
|
|
415
415
|
return n ? n.split(e).filter((t) => t.trim()) : [];
|
|
416
416
|
}
|
|
417
|
-
class
|
|
417
|
+
class He {
|
|
418
418
|
constructor(e, t = ["label", "value", "labelEn"]) {
|
|
419
419
|
this.list = e, this.map = new Map(
|
|
420
|
-
e.map((
|
|
421
|
-
let
|
|
422
|
-
...
|
|
423
|
-
label:
|
|
424
|
-
value:
|
|
420
|
+
e.map((o) => {
|
|
421
|
+
let r = {
|
|
422
|
+
...o,
|
|
423
|
+
label: o[t[0]],
|
|
424
|
+
value: o[t[1]]
|
|
425
425
|
};
|
|
426
|
-
return t[2] && (
|
|
426
|
+
return t[2] && (r.labelEn = o[t[2]]), [o[t[1]], r];
|
|
427
427
|
})
|
|
428
428
|
);
|
|
429
429
|
}
|
|
430
430
|
getName(e, t) {
|
|
431
431
|
if (!this.has(e))
|
|
432
432
|
return "-";
|
|
433
|
-
const { label:
|
|
434
|
-
return (t == "zh_cn" ?
|
|
433
|
+
const { label: o, labelEn: r } = this.map.get(e);
|
|
434
|
+
return (t == "zh_cn" ? o : r) || o || "-";
|
|
435
435
|
}
|
|
436
436
|
getTag(e) {
|
|
437
437
|
if (!this.has(e))
|
|
@@ -452,52 +452,52 @@ class Be {
|
|
|
452
452
|
return this.map.has(e);
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function kn(n, e = [], t = "i18nName") {
|
|
456
456
|
if (n.length == 0)
|
|
457
|
-
return new
|
|
457
|
+
return new He([]);
|
|
458
458
|
if (e.length < 2) {
|
|
459
|
-
const
|
|
460
|
-
throw new Error(
|
|
459
|
+
const r = ze();
|
|
460
|
+
throw new Error(r("tools.keysLengthError"));
|
|
461
461
|
}
|
|
462
|
-
let
|
|
463
|
-
let
|
|
464
|
-
return t && (
|
|
465
|
-
|
|
466
|
-
}),
|
|
462
|
+
let o = n.map((r) => {
|
|
463
|
+
let l = {};
|
|
464
|
+
return t && (l.labelEn = r[t]), e.forEach((a, d) => {
|
|
465
|
+
d === 0 ? l.label = r[a] : d === 1 ? l.value = r[a] : l[a] = r[a];
|
|
466
|
+
}), l;
|
|
467
467
|
});
|
|
468
|
-
return new
|
|
468
|
+
return new He(o);
|
|
469
469
|
}
|
|
470
|
-
function
|
|
470
|
+
function _n(n) {
|
|
471
471
|
return n ? n.replace(/<[^>]+>/g, "") : "";
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function $n(n) {
|
|
474
474
|
return n ? (n.includes("\\\\u") && (n = n.replace(/\\/g, "")), n.replace(/\\u[\dA-F]{4}/gi, (e) => String.fromCharCode(parseInt(e.replace(/\\u/g, ""), 16)))) : "";
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function Sn(n, e = 10) {
|
|
477
477
|
let t = 1048576 * e;
|
|
478
478
|
return !(n.size > t);
|
|
479
479
|
}
|
|
480
|
-
function
|
|
481
|
-
return Array.from(10).fill(0).map((t,
|
|
480
|
+
function In(n) {
|
|
481
|
+
return Array.from(10).fill(0).map((t, o) => n + "_" + o);
|
|
482
482
|
}
|
|
483
|
-
function
|
|
483
|
+
function En(n) {
|
|
484
484
|
let e = {};
|
|
485
|
-
return n.map((t,
|
|
486
|
-
let { key:
|
|
487
|
-
|
|
485
|
+
return n.map((t, o) => {
|
|
486
|
+
let { key: r, option: l, type: a } = t, d = Yt(o);
|
|
487
|
+
l ? e[r] = `${d}---option` : a === "image" ? e[r] = `${d}---image` : e[r] = d;
|
|
488
488
|
}), e;
|
|
489
489
|
}
|
|
490
|
-
function
|
|
491
|
-
return e.split(".").reduce((t,
|
|
490
|
+
function Ln(n, e) {
|
|
491
|
+
return e.split(".").reduce((t, o) => t && t[o], n);
|
|
492
492
|
}
|
|
493
493
|
const ge = (n, e) => {
|
|
494
494
|
const t = n.__vccOpts || n;
|
|
495
|
-
for (const [
|
|
496
|
-
t[
|
|
495
|
+
for (const [o, r] of e)
|
|
496
|
+
t[o] = r;
|
|
497
497
|
return t;
|
|
498
|
-
},
|
|
498
|
+
}, Ht = {
|
|
499
499
|
__name: "index",
|
|
500
|
-
props: /* @__PURE__ */
|
|
500
|
+
props: /* @__PURE__ */ Be({
|
|
501
501
|
api: {
|
|
502
502
|
type: Function
|
|
503
503
|
},
|
|
@@ -533,95 +533,95 @@ const ge = (n, e) => {
|
|
|
533
533
|
modelValue: {},
|
|
534
534
|
modelModifiers: {}
|
|
535
535
|
}),
|
|
536
|
-
emits: /* @__PURE__ */
|
|
536
|
+
emits: /* @__PURE__ */ Be(["success", "change"], ["update:modelValue"]),
|
|
537
537
|
setup(n, { emit: e }) {
|
|
538
|
-
const t = n,
|
|
539
|
-
if (
|
|
538
|
+
const t = n, o = bt(), { t: r, locale: l } = de(), a = yt(n, "modelValue"), d = q(""), c = se(() => {
|
|
539
|
+
if (o.remote !== void 0)
|
|
540
540
|
return t.data;
|
|
541
|
-
const h =
|
|
541
|
+
const h = at(d.value), { data: g, labelValue: E } = t, $ = g || b.value;
|
|
542
542
|
if (h.length == 0)
|
|
543
|
-
return
|
|
544
|
-
const { label:
|
|
545
|
-
let
|
|
546
|
-
return h.length == 1 ?
|
|
547
|
-
(
|
|
548
|
-
) :
|
|
543
|
+
return $;
|
|
544
|
+
const { label: B, labelEn: S } = E;
|
|
545
|
+
let v = l.value == "en_us" ? S || "i18nName" : B;
|
|
546
|
+
return h.length == 1 ? $.filter(
|
|
547
|
+
(H) => H[v].toLowerCase().includes(h[0].toLowerCase())
|
|
548
|
+
) : $.filter((H) => {
|
|
549
549
|
let z = !1;
|
|
550
|
-
return z = h.some((
|
|
550
|
+
return z = h.some((k) => H[v].toLowerCase() == k.toLowerCase()), z;
|
|
551
551
|
});
|
|
552
|
-
}),
|
|
552
|
+
}), w = se({
|
|
553
553
|
get() {
|
|
554
|
-
return
|
|
554
|
+
return o.multiple == null || a.value == null ? !1 : a.value.length == c.value.length;
|
|
555
555
|
},
|
|
556
556
|
set(h) {
|
|
557
557
|
return h;
|
|
558
558
|
}
|
|
559
|
-
}),
|
|
559
|
+
}), C = e, b = q([]), m = async () => {
|
|
560
560
|
const { data: h } = await t.api();
|
|
561
|
-
|
|
561
|
+
b.value = [...h], C("success", b);
|
|
562
562
|
};
|
|
563
|
-
t.api &&
|
|
564
|
-
const
|
|
565
|
-
if (
|
|
563
|
+
t.api && m();
|
|
564
|
+
const x = t.labelValue.label.split("-"), p = (h) => {
|
|
565
|
+
if (x.length == 1) {
|
|
566
566
|
if (t.changeLocal)
|
|
567
|
-
return
|
|
568
|
-
let
|
|
569
|
-
return
|
|
567
|
+
return r(h[t.labelValue.label]);
|
|
568
|
+
let g = l.value == "en_us" ? h[t.labelValue.labelEn || "i18nName"] : h[t.labelValue.label];
|
|
569
|
+
return g = g || h[t.labelValue.label], g;
|
|
570
570
|
} else {
|
|
571
|
-
let
|
|
572
|
-
return
|
|
573
|
-
|
|
574
|
-
}),
|
|
571
|
+
let g = [];
|
|
572
|
+
return x.forEach((E) => {
|
|
573
|
+
g.push(h[E]);
|
|
574
|
+
}), g.join("-");
|
|
575
575
|
}
|
|
576
576
|
};
|
|
577
|
-
function
|
|
578
|
-
a.value = h ?
|
|
577
|
+
function u(h) {
|
|
578
|
+
a.value = h ? c.value.map((g) => g[t.labelValue.value]) : [], C("change", a.value);
|
|
579
579
|
}
|
|
580
580
|
function f(h) {
|
|
581
|
-
t.optionClick(h),
|
|
581
|
+
t.optionClick(h), C("change", o["value-key"] ? h : h[t.labelValue.value]);
|
|
582
582
|
}
|
|
583
|
-
function
|
|
583
|
+
function _(h) {
|
|
584
584
|
return a.value.length >= t.maxLimit && !a.value.includes(h[t.labelValue.value]);
|
|
585
585
|
}
|
|
586
|
-
return (h,
|
|
587
|
-
const
|
|
588
|
-
return
|
|
586
|
+
return (h, g) => {
|
|
587
|
+
const E = O("el-checkbox"), $ = O("el-option"), B = O("el-select");
|
|
588
|
+
return T(), U(B, me({
|
|
589
589
|
modelValue: a.value,
|
|
590
|
-
"onUpdate:modelValue":
|
|
590
|
+
"onUpdate:modelValue": g[1] || (g[1] = (S) => a.value = S),
|
|
591
591
|
filterable: "",
|
|
592
592
|
"collapse-tags": "",
|
|
593
593
|
"collapse-tags-tooltip": "",
|
|
594
|
-
"filter-method":
|
|
594
|
+
"filter-method": Z(o).remote != null ? void 0 : (S) => d.value = S,
|
|
595
595
|
clearable: ""
|
|
596
|
-
},
|
|
596
|
+
}, Z(o), { onClear: n.optionClick }), {
|
|
597
597
|
default: R(() => [
|
|
598
|
-
|
|
599
|
-
|
|
598
|
+
Z(o).multiple != null && n.showCheckAll && n.maxLimit == null ? ie(h.$slots, "header", { key: 0 }, () => [
|
|
599
|
+
W(E, {
|
|
600
600
|
class: "mgl20",
|
|
601
|
-
modelValue:
|
|
602
|
-
"onUpdate:modelValue":
|
|
603
|
-
onChange:
|
|
601
|
+
modelValue: w.value,
|
|
602
|
+
"onUpdate:modelValue": g[0] || (g[0] = (S) => w.value = S),
|
|
603
|
+
onChange: u
|
|
604
604
|
}, {
|
|
605
605
|
default: R(() => [
|
|
606
|
-
|
|
606
|
+
te(ne(h.$t("quan-xuan")), 1)
|
|
607
607
|
]),
|
|
608
608
|
_: 1
|
|
609
609
|
}, 8, ["modelValue"])
|
|
610
|
-
], !0) :
|
|
611
|
-
(
|
|
612
|
-
key:
|
|
613
|
-
label:
|
|
614
|
-
disabled:
|
|
615
|
-
onClick:
|
|
616
|
-
value:
|
|
610
|
+
], !0) : ce("", !0),
|
|
611
|
+
(T(!0), re(Ie, null, Ze(c.value, (S, v) => (T(), U($, {
|
|
612
|
+
key: v,
|
|
613
|
+
label: p(S),
|
|
614
|
+
disabled: Z(o).multiple != null && n.maxLimit > 0 ? _(S) : !1,
|
|
615
|
+
onClick: Ee((Y) => f(S), ["stop"]),
|
|
616
|
+
value: Z(o)["value-key"] ? S : S[n.labelValue.value]
|
|
617
617
|
}, null, 8, ["label", "disabled", "onClick", "value"]))), 128))
|
|
618
618
|
]),
|
|
619
619
|
_: 3
|
|
620
620
|
}, 16, ["modelValue", "filter-method", "onClear"]);
|
|
621
621
|
};
|
|
622
622
|
}
|
|
623
|
-
},
|
|
624
|
-
const
|
|
623
|
+
}, Nt = /* @__PURE__ */ ge(Ht, [["__scopeId", "data-v-34eb8641"]]);
|
|
624
|
+
const Kt = Ne({
|
|
625
625
|
props: {
|
|
626
626
|
name: {
|
|
627
627
|
tyepe: String,
|
|
@@ -629,38 +629,38 @@ const Bt = Ye({
|
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
631
|
});
|
|
632
|
-
function
|
|
632
|
+
function Zt(n, e, t, o, r, l) {
|
|
633
633
|
const a = O("el-icon");
|
|
634
|
-
return
|
|
634
|
+
return T(), U(a, { class: "cmp-icon" }, {
|
|
635
635
|
default: R(() => [
|
|
636
|
-
(
|
|
636
|
+
(T(), U(Ge(n.name)))
|
|
637
637
|
]),
|
|
638
638
|
_: 1
|
|
639
639
|
});
|
|
640
640
|
}
|
|
641
|
-
const
|
|
641
|
+
const st = /* @__PURE__ */ ge(Kt, [["render", Zt], ["__scopeId", "data-v-733f9daa"]]), Tn = {
|
|
642
642
|
__name: "index",
|
|
643
643
|
emits: ["ok", "no"],
|
|
644
644
|
setup(n, { emit: e }) {
|
|
645
|
-
const t = e,
|
|
645
|
+
const t = e, o = Qe(() => {
|
|
646
646
|
t("ok");
|
|
647
647
|
}, 500);
|
|
648
|
-
function
|
|
648
|
+
function r() {
|
|
649
649
|
t("no");
|
|
650
650
|
}
|
|
651
|
-
return (
|
|
652
|
-
const
|
|
653
|
-
return
|
|
654
|
-
onConfirm:
|
|
655
|
-
onCancel:
|
|
651
|
+
return (l, a) => {
|
|
652
|
+
const d = O("el-link"), c = O("el-popconfirm");
|
|
653
|
+
return T(), U(c, me(l.$attrs, {
|
|
654
|
+
onConfirm: Z(o),
|
|
655
|
+
onCancel: r
|
|
656
656
|
}), {
|
|
657
657
|
reference: R(() => [
|
|
658
|
-
|
|
658
|
+
W(d, {
|
|
659
659
|
underline: "never",
|
|
660
|
-
type:
|
|
660
|
+
type: l.$attrs.type
|
|
661
661
|
}, {
|
|
662
662
|
default: R(() => [
|
|
663
|
-
|
|
663
|
+
ie(l.$slots, "default")
|
|
664
664
|
]),
|
|
665
665
|
_: 3
|
|
666
666
|
}, 8, ["type"])
|
|
@@ -670,7 +670,7 @@ const rt = /* @__PURE__ */ ge(Bt, [["render", Yt], ["__scopeId", "data-v-733f9da
|
|
|
670
670
|
};
|
|
671
671
|
}
|
|
672
672
|
};
|
|
673
|
-
const
|
|
673
|
+
const Gt = ["accept"], Wt = {
|
|
674
674
|
__name: "index",
|
|
675
675
|
props: {
|
|
676
676
|
accept: {
|
|
@@ -684,55 +684,55 @@ const Ht = ["accept"], Nt = {
|
|
|
684
684
|
},
|
|
685
685
|
emits: ["fileChange"],
|
|
686
686
|
setup(n, { emit: e }) {
|
|
687
|
-
const t = e,
|
|
688
|
-
function
|
|
689
|
-
let a =
|
|
690
|
-
t("fileChange", a),
|
|
687
|
+
const t = e, o = q(null);
|
|
688
|
+
function r(l) {
|
|
689
|
+
let a = l.target.files[0];
|
|
690
|
+
t("fileChange", a), o.value.value = null;
|
|
691
691
|
}
|
|
692
|
-
return (
|
|
693
|
-
const
|
|
694
|
-
return
|
|
695
|
-
|
|
692
|
+
return (l, a) => {
|
|
693
|
+
const d = O("el-button");
|
|
694
|
+
return T(), re("span", null, [
|
|
695
|
+
W(d, {
|
|
696
696
|
loading: n.loading,
|
|
697
697
|
class: "mgr10",
|
|
698
|
-
onClick: a[0] || (a[0] = (
|
|
698
|
+
onClick: a[0] || (a[0] = (c) => o.value.click())
|
|
699
699
|
}, {
|
|
700
700
|
default: R(() => [
|
|
701
|
-
|
|
701
|
+
te(ne(l.$t("dao-ru")), 1)
|
|
702
702
|
]),
|
|
703
703
|
_: 1
|
|
704
704
|
}, 8, ["loading"]),
|
|
705
|
-
|
|
706
|
-
onChange:
|
|
705
|
+
ae("input", {
|
|
706
|
+
onChange: r,
|
|
707
707
|
ref_key: "input",
|
|
708
|
-
ref:
|
|
708
|
+
ref: o,
|
|
709
709
|
accept: n.accept,
|
|
710
710
|
style: { position: "absolute", width: "0px", height: "0px", opacity: "0" },
|
|
711
711
|
type: "file"
|
|
712
|
-
}, null, 40,
|
|
712
|
+
}, null, 40, Gt)
|
|
713
713
|
]);
|
|
714
714
|
};
|
|
715
715
|
}
|
|
716
|
-
},
|
|
717
|
-
function
|
|
716
|
+
}, Fn = /* @__PURE__ */ ge(Wt, [["__scopeId", "data-v-5f1449ad"]]);
|
|
717
|
+
function Oe(n) {
|
|
718
718
|
let e = {};
|
|
719
719
|
return n.forEach((t) => {
|
|
720
|
-
const { key:
|
|
721
|
-
if (
|
|
722
|
-
if (
|
|
723
|
-
e[
|
|
724
|
-
else if (
|
|
725
|
-
if (
|
|
726
|
-
const [
|
|
727
|
-
let [
|
|
728
|
-
|
|
720
|
+
const { key: o, type: r, option: l = {}, value: a, dateType: d } = t;
|
|
721
|
+
if (o)
|
|
722
|
+
if (r == "input" && (l != null && l.multiple))
|
|
723
|
+
e[o] = at(a);
|
|
724
|
+
else if (r == "date")
|
|
725
|
+
if (d.includes("range")) {
|
|
726
|
+
const [c, w] = o;
|
|
727
|
+
let [C, b] = a || [];
|
|
728
|
+
C && d == "daterange" && (C = ve(C).format("YYYY-MM-DD 00:00:00"), b = ve(b).format("YYYY-MM-DD 23:59:59")), e[c] = C, e[w] = b;
|
|
729
729
|
} else
|
|
730
|
-
e[
|
|
730
|
+
e[o] = a;
|
|
731
731
|
else
|
|
732
|
-
e[
|
|
732
|
+
e[o] = a;
|
|
733
733
|
}), e;
|
|
734
734
|
}
|
|
735
|
-
const
|
|
735
|
+
const Jt = { key: 0 }, Qt = { class: "btns" }, Xt = { class: "left" }, en = { class: "right" }, tn = {
|
|
736
736
|
__name: "index",
|
|
737
737
|
props: {
|
|
738
738
|
form: {
|
|
@@ -742,84 +742,84 @@ const Kt = { key: 0 }, Zt = { class: "btns" }, Gt = { class: "left" }, Wt = { cl
|
|
|
742
742
|
},
|
|
743
743
|
emits: ["confirm", "reset", "visibleChange"],
|
|
744
744
|
setup(n, { expose: e, emit: t }) {
|
|
745
|
-
const
|
|
746
|
-
function
|
|
747
|
-
|
|
745
|
+
const o = n, r = t, l = q(!0), a = q(null), { t: d } = de(), c = se(() => l.value ? d("guan-bi") : d("zhan-kai"));
|
|
746
|
+
function w() {
|
|
747
|
+
r("confirm");
|
|
748
748
|
}
|
|
749
|
-
function
|
|
750
|
-
f.option.onClear && f.option.onClear(),
|
|
749
|
+
function C(f) {
|
|
750
|
+
f.option.onClear && f.option.onClear(), r("confirm");
|
|
751
751
|
}
|
|
752
|
-
function
|
|
753
|
-
|
|
752
|
+
function b() {
|
|
753
|
+
r("reset");
|
|
754
754
|
}
|
|
755
|
-
function
|
|
756
|
-
|
|
755
|
+
function m() {
|
|
756
|
+
r("confirm");
|
|
757
757
|
}
|
|
758
|
-
function
|
|
759
|
-
return
|
|
758
|
+
function x() {
|
|
759
|
+
return Oe(o.form.items);
|
|
760
760
|
}
|
|
761
|
-
const
|
|
762
|
-
function
|
|
763
|
-
|
|
764
|
-
const
|
|
765
|
-
|
|
761
|
+
const p = Xe(o.form.items);
|
|
762
|
+
function u() {
|
|
763
|
+
o.form.items.forEach((f) => {
|
|
764
|
+
const _ = p.find((h) => h.key == f.key);
|
|
765
|
+
_ && (f.value = _.value);
|
|
766
766
|
});
|
|
767
767
|
}
|
|
768
|
-
return e({ getPrm:
|
|
769
|
-
const h = O("el-input"),
|
|
770
|
-
return
|
|
768
|
+
return e({ getPrm: x, reset: u }), (f, _) => {
|
|
769
|
+
const h = O("el-input"), g = O("el-date-picker"), E = O("el-form-item"), $ = O("el-form"), B = O("el-link"), S = O("el-button");
|
|
770
|
+
return T(), re("div", {
|
|
771
771
|
class: "searchBar-container mgt10 mgb10",
|
|
772
|
-
onKeydown:
|
|
772
|
+
onKeydown: Ct(w, ["enter"])
|
|
773
773
|
}, [
|
|
774
|
-
|
|
774
|
+
ae("div", {
|
|
775
775
|
class: "searchBar",
|
|
776
|
-
style:
|
|
776
|
+
style: xt({ height: l.value ? "auto" : "42px" })
|
|
777
777
|
}, [
|
|
778
|
-
|
|
778
|
+
W($, {
|
|
779
779
|
inline: "",
|
|
780
780
|
model: n.form.data
|
|
781
781
|
}, {
|
|
782
782
|
default: R(() => [
|
|
783
|
-
(
|
|
784
|
-
key:
|
|
783
|
+
(T(!0), re(Ie, null, Ze(n.form.items.filter((v) => !v.hidden), (v) => (T(), re(Ie, {
|
|
784
|
+
key: v.key
|
|
785
785
|
}, [
|
|
786
|
-
|
|
786
|
+
v.type == "br" ? (T(), re("br", Jt)) : (T(), U(E, {
|
|
787
787
|
key: 1,
|
|
788
|
-
label:
|
|
788
|
+
label: v.name
|
|
789
789
|
}, {
|
|
790
790
|
default: R(() => {
|
|
791
|
-
var
|
|
791
|
+
var Y, H;
|
|
792
792
|
return [
|
|
793
|
-
|
|
793
|
+
v.type === "input" ? (T(), U(h, {
|
|
794
794
|
key: 0,
|
|
795
|
-
modelValue:
|
|
796
|
-
"onUpdate:modelValue": (z) =>
|
|
797
|
-
class:
|
|
795
|
+
modelValue: v.value,
|
|
796
|
+
"onUpdate:modelValue": (z) => v.value = z,
|
|
797
|
+
class: Le(((Y = v.option) == null ? void 0 : Y.class) || "w150"),
|
|
798
798
|
placeholder: f.$t("qing-shu-ru"),
|
|
799
799
|
clearable: ""
|
|
800
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) :
|
|
801
|
-
|
|
800
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) : v.type === "custom" ? (T(), U(Ge(v.render), { key: 1 })) : ce("", !0),
|
|
801
|
+
v.type === "select" ? (T(), U(Nt, me({
|
|
802
802
|
key: 2,
|
|
803
|
-
class: ((
|
|
804
|
-
modelValue:
|
|
805
|
-
"onUpdate:modelValue": (z) =>
|
|
806
|
-
}, { ref_for: !0 },
|
|
807
|
-
onChange:
|
|
808
|
-
onClear: (z) =>
|
|
809
|
-
}), null, 16, ["class", "modelValue", "onUpdate:modelValue", "onClear"])) :
|
|
810
|
-
|
|
803
|
+
class: ((H = v.option) == null ? void 0 : H.class) || "w150",
|
|
804
|
+
modelValue: v.value,
|
|
805
|
+
"onUpdate:modelValue": (z) => v.value = z
|
|
806
|
+
}, { ref_for: !0 }, v.option, {
|
|
807
|
+
onChange: w,
|
|
808
|
+
onClear: (z) => C(v)
|
|
809
|
+
}), null, 16, ["class", "modelValue", "onUpdate:modelValue", "onClear"])) : ce("", !0),
|
|
810
|
+
v.type === "date" ? (T(), U(g, {
|
|
811
811
|
key: 3,
|
|
812
|
-
class:
|
|
813
|
-
modelValue:
|
|
814
|
-
"onUpdate:modelValue": (z) =>
|
|
815
|
-
"value-format": { datetimerange: "YYYY-MM-DD HH:mm:ss", daterange: "YYYY-MM-DD" }[
|
|
816
|
-
type:
|
|
817
|
-
onFocus: (z) => a.value =
|
|
818
|
-
onChange: (z) =>
|
|
812
|
+
class: Le({ datetimerange: "w300", daterange: "w200" }[v.dateType] || "w100"),
|
|
813
|
+
modelValue: v.value,
|
|
814
|
+
"onUpdate:modelValue": (z) => v.value = z,
|
|
815
|
+
"value-format": { datetimerange: "YYYY-MM-DD HH:mm:ss", daterange: "YYYY-MM-DD" }[v.dateType] || "YYYY-MM-DD",
|
|
816
|
+
type: v.dateType || "date",
|
|
817
|
+
onFocus: (z) => a.value = v,
|
|
818
|
+
onChange: (z) => m(),
|
|
819
819
|
placeholder: f.$t("qing-xuan-ze"),
|
|
820
820
|
"start-placeholder": f.$t("kai-shi-shi-jian"),
|
|
821
821
|
"end-placeholder": f.$t("jie-shu-shi-jian")
|
|
822
|
-
}, null, 8, ["class", "modelValue", "onUpdate:modelValue", "value-format", "type", "onFocus", "onChange", "placeholder", "start-placeholder", "end-placeholder"])) :
|
|
822
|
+
}, null, 8, ["class", "modelValue", "onUpdate:modelValue", "value-format", "type", "onFocus", "onChange", "placeholder", "start-placeholder", "end-placeholder"])) : ce("", !0)
|
|
823
823
|
];
|
|
824
824
|
}),
|
|
825
825
|
_: 2
|
|
@@ -829,58 +829,58 @@ const Kt = { key: 0 }, Zt = { class: "btns" }, Gt = { class: "left" }, Wt = { cl
|
|
|
829
829
|
_: 1
|
|
830
830
|
}, 8, ["model"])
|
|
831
831
|
], 4),
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
832
|
+
ae("div", Qt, [
|
|
833
|
+
ae("div", Xt, [
|
|
834
|
+
ie(f.$slots, "table-header-left", {}, void 0, !0)
|
|
835
835
|
]),
|
|
836
|
-
|
|
837
|
-
|
|
836
|
+
ae("div", en, [
|
|
837
|
+
W(B, {
|
|
838
838
|
underline: "never",
|
|
839
839
|
class: "mgr10",
|
|
840
|
-
onClick:
|
|
841
|
-
|
|
840
|
+
onClick: _[0] || (_[0] = () => {
|
|
841
|
+
r("visibleChange", !l.value), l.value = !l.value;
|
|
842
842
|
})
|
|
843
843
|
}, {
|
|
844
844
|
default: R(() => [
|
|
845
|
-
|
|
846
|
-
name:
|
|
845
|
+
W(st, {
|
|
846
|
+
name: l.value ? "ArrowUp" : "ArrowDown"
|
|
847
847
|
}, null, 8, ["name"]),
|
|
848
|
-
|
|
848
|
+
te(" " + ne(c.value), 1)
|
|
849
849
|
]),
|
|
850
850
|
_: 1
|
|
851
851
|
}),
|
|
852
|
-
|
|
852
|
+
W(S, {
|
|
853
853
|
type: "primary",
|
|
854
|
-
onClick:
|
|
854
|
+
onClick: w
|
|
855
855
|
}, {
|
|
856
856
|
default: R(() => [
|
|
857
|
-
|
|
857
|
+
te(ne(f.$t("shai-xuan")), 1)
|
|
858
858
|
]),
|
|
859
859
|
_: 1
|
|
860
860
|
}),
|
|
861
|
-
|
|
861
|
+
W(S, {
|
|
862
862
|
type: "primary",
|
|
863
|
-
onClick:
|
|
863
|
+
onClick: b
|
|
864
864
|
}, {
|
|
865
865
|
default: R(() => [
|
|
866
|
-
|
|
866
|
+
te(ne(f.$t("chong-zhi")), 1)
|
|
867
867
|
]),
|
|
868
868
|
_: 1
|
|
869
869
|
}),
|
|
870
|
-
|
|
870
|
+
ie(f.$slots, "btn", {}, void 0, !0)
|
|
871
871
|
])
|
|
872
872
|
])
|
|
873
873
|
], 32);
|
|
874
874
|
};
|
|
875
875
|
}
|
|
876
|
-
},
|
|
877
|
-
const
|
|
876
|
+
}, nn = /* @__PURE__ */ ge(tn, [["__scopeId", "data-v-32ac9990"]]);
|
|
877
|
+
const on = { class: "center" }, ln = {
|
|
878
878
|
__name: "index",
|
|
879
879
|
props: {
|
|
880
|
-
// 表格id
|
|
880
|
+
// 表格id 本地存储列设置时使用,不传则使用路由路径自动生成
|
|
881
881
|
id: {
|
|
882
882
|
type: String,
|
|
883
|
-
required: !
|
|
883
|
+
required: !1
|
|
884
884
|
},
|
|
885
885
|
loading: {
|
|
886
886
|
type: Boolean,
|
|
@@ -916,87 +916,111 @@ const Xt = { class: "center" }, en = {
|
|
|
916
916
|
}
|
|
917
917
|
},
|
|
918
918
|
setup(n, { expose: e }) {
|
|
919
|
-
const { t, locale:
|
|
920
|
-
|
|
921
|
-
const
|
|
922
|
-
|
|
919
|
+
const { t, locale: o } = de(), r = St(), l = n, a = q(!1), d = q([]);
|
|
920
|
+
l.searchForm.selections = [];
|
|
921
|
+
const c = se(() => {
|
|
922
|
+
const i = r.path.replace(/\//g, "-").replace(/^-/, "") || "default-table";
|
|
923
|
+
return l.id ? `listPageId-${i}-${l.id}` : `listPageId-${i}`;
|
|
924
|
+
});
|
|
925
|
+
l.searchForm.enableCellCopy == null && (l.searchForm.enableCellCopy = !0);
|
|
926
|
+
const w = Xe(l.searchForm.items), C = l.searchForm.pageNoKey || "pageNo", b = pe({
|
|
927
|
+
[C]: 1,
|
|
923
928
|
pageSize: 10,
|
|
924
929
|
total: 0
|
|
925
|
-
}),
|
|
926
|
-
|
|
927
|
-
if (!
|
|
930
|
+
}), m = q(null), x = q(null), p = q(450), u = Qe(() => {
|
|
931
|
+
$e(() => {
|
|
932
|
+
if (!x.value)
|
|
928
933
|
return;
|
|
929
|
-
const s =
|
|
930
|
-
|
|
934
|
+
const s = x.value.getBoundingClientRect(), y = window.innerHeight, L = s.top, A = 100, G = y - L - A, V = 200;
|
|
935
|
+
p.value = Math.max(G, V);
|
|
931
936
|
});
|
|
932
|
-
}, 100),
|
|
933
|
-
|
|
934
|
-
},
|
|
935
|
-
if (!
|
|
937
|
+
}, 100), f = () => {
|
|
938
|
+
u();
|
|
939
|
+
}, _ = () => {
|
|
940
|
+
if (!l.searchForm.enableCellCopy)
|
|
936
941
|
return !1;
|
|
937
|
-
const
|
|
938
|
-
if (!
|
|
942
|
+
const i = m.value;
|
|
943
|
+
if (!i || !i.$el)
|
|
939
944
|
return !1;
|
|
940
|
-
const s =
|
|
941
|
-
return s.classList.add("cell-copy-enabled"), s.setAttribute("tabindex", "-1"), s.removeEventListener("mousedown",
|
|
945
|
+
const s = i.$el;
|
|
946
|
+
return s.classList.add("cell-copy-enabled"), s.setAttribute("tabindex", "-1"), s.removeEventListener("mousedown", be), s.removeEventListener("mousemove", ye), s.removeEventListener("mouseup", Ce), s.removeEventListener("keydown", we), s.addEventListener("mousedown", be), s.addEventListener("mousemove", ye), s.addEventListener("mouseup", Ce), s.addEventListener("keydown", we), !0;
|
|
942
947
|
};
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
948
|
+
Ke(() => {
|
|
949
|
+
u(), window.addEventListener("resize", f), l.searchForm.enableCellCopy && (document.addEventListener("mouseup", Ve), document.addEventListener("mousedown", Ue), setTimeout(() => {
|
|
950
|
+
_();
|
|
946
951
|
}, 500));
|
|
947
|
-
}),
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
952
|
+
}), wt(() => {
|
|
953
|
+
l.searchForm.enableCellCopy && setTimeout(() => {
|
|
954
|
+
_();
|
|
955
|
+
}, 500);
|
|
956
|
+
}), kt(() => {
|
|
957
|
+
if (window.removeEventListener("resize", f), l.searchForm.enableCellCopy) {
|
|
958
|
+
document.removeEventListener("mouseup", Ve), document.removeEventListener("mousedown", Ue);
|
|
959
|
+
const i = m.value;
|
|
960
|
+
if (i && i.$el) {
|
|
961
|
+
const s = i.$el;
|
|
962
|
+
s.removeEventListener("mousedown", be), s.removeEventListener("mousemove", ye), s.removeEventListener("mouseup", Ce), s.removeEventListener("keydown", we);
|
|
954
963
|
}
|
|
955
964
|
}
|
|
956
965
|
});
|
|
957
|
-
const
|
|
958
|
-
let
|
|
959
|
-
async function
|
|
960
|
-
const { dataFormat: s } =
|
|
961
|
-
|
|
962
|
-
const { code:
|
|
963
|
-
|
|
966
|
+
const h = se(() => z.value.height || p.value);
|
|
967
|
+
let g;
|
|
968
|
+
async function E(i) {
|
|
969
|
+
const { dataFormat: s } = l.tableConfig;
|
|
970
|
+
i.pageNo != 1 && (i.nextSearchAfter = g), a.value = !0;
|
|
971
|
+
const { code: y, data: L = {} } = await l.api(i).finally(() => {
|
|
972
|
+
a.value = !1, l.searchForm.selections = [];
|
|
964
973
|
});
|
|
965
|
-
if (
|
|
966
|
-
let A =
|
|
967
|
-
|
|
974
|
+
if (y == 200) {
|
|
975
|
+
let A = L.rows || L.records || [];
|
|
976
|
+
d.value = s ? s(A) : A, b.total = L.totalRows || L.total || 0, g = L.nextSearchAfter, l.searchForm.enableCellCopy && $e(() => {
|
|
968
977
|
setTimeout(() => {
|
|
969
|
-
|
|
978
|
+
_();
|
|
970
979
|
}, 100);
|
|
971
980
|
});
|
|
972
981
|
}
|
|
973
982
|
}
|
|
974
|
-
function
|
|
975
|
-
const { searchData: s = () => ({}) } =
|
|
976
|
-
|
|
983
|
+
function $(i = {}) {
|
|
984
|
+
const { searchData: s = () => ({}) } = l.tableConfig, y = s();
|
|
985
|
+
E({ ...b, ...Oe(l.searchForm.items), ...i, ...y });
|
|
977
986
|
}
|
|
978
|
-
function
|
|
979
|
-
const { reset:
|
|
980
|
-
|
|
981
|
-
const
|
|
982
|
-
|
|
983
|
-
}),
|
|
987
|
+
function B() {
|
|
988
|
+
const { reset: i } = l.tableConfig;
|
|
989
|
+
i && i(), l.searchForm.items.forEach((s) => {
|
|
990
|
+
const y = w.find((L) => Ye(s.key) && Ye(L.key) ? s.key.join(",") == L.key.join(",") : L.key == s.key);
|
|
991
|
+
y && (s.value = y.value);
|
|
992
|
+
}), $();
|
|
984
993
|
}
|
|
985
|
-
|
|
986
|
-
function
|
|
987
|
-
return { ...
|
|
994
|
+
l.api && l.immediate && $();
|
|
995
|
+
function S() {
|
|
996
|
+
return { ...b, ...Oe(l.searchForm.items) };
|
|
988
997
|
}
|
|
989
|
-
const
|
|
990
|
-
const
|
|
991
|
-
|
|
992
|
-
},
|
|
998
|
+
const v = () => {
|
|
999
|
+
const i = m.value;
|
|
1000
|
+
i && i.clearSort();
|
|
1001
|
+
}, Y = pe({
|
|
993
1002
|
storage: !0
|
|
994
|
-
}),
|
|
995
|
-
width: "auto",
|
|
1003
|
+
}), H = pe({
|
|
996
1004
|
drag: !0,
|
|
997
1005
|
resizable: !0,
|
|
998
1006
|
maxFixedSize: 0
|
|
999
|
-
}),
|
|
1007
|
+
}), z = se(() => {
|
|
1008
|
+
const { customConfig: i, columnConfig: s, ...y } = l.tableConfig;
|
|
1009
|
+
return {
|
|
1010
|
+
headerAlign: "left",
|
|
1011
|
+
align: "center",
|
|
1012
|
+
customConfig: { ...Y, ...i },
|
|
1013
|
+
columnConfig: { ...H, ...s },
|
|
1014
|
+
// 列过多时 自动宽度 虚拟滚动会闪屏 关闭虚拟滚动
|
|
1015
|
+
"virtual-x-config": {
|
|
1016
|
+
enabled: !1,
|
|
1017
|
+
scrollToLeftOnChange: !1
|
|
1018
|
+
},
|
|
1019
|
+
// 纵向虚拟滚动 大于100条开启
|
|
1020
|
+
"virtual-y-config": { enabled: !0, gt: 100 },
|
|
1021
|
+
...y
|
|
1022
|
+
};
|
|
1023
|
+
}), k = pe({
|
|
1000
1024
|
isSelecting: !1,
|
|
1001
1025
|
// 是否正在选择
|
|
1002
1026
|
startCell: null,
|
|
@@ -1005,71 +1029,71 @@ const Xt = { class: "center" }, en = {
|
|
|
1005
1029
|
// 结束单元格
|
|
1006
1030
|
selectedCells: []
|
|
1007
1031
|
// 选中的单元格列表 [{ rowIndex, colIndex }]
|
|
1008
|
-
}),
|
|
1009
|
-
const s =
|
|
1032
|
+
}), Me = (i) => {
|
|
1033
|
+
const s = i.closest(".vxe-body--column");
|
|
1010
1034
|
if (!s || s.classList.contains("col--checkbox") || s.classList.contains("col--seq"))
|
|
1011
1035
|
return null;
|
|
1012
|
-
const
|
|
1013
|
-
if (!
|
|
1036
|
+
const y = s.closest(".vxe-body--row");
|
|
1037
|
+
if (!y)
|
|
1014
1038
|
return null;
|
|
1015
|
-
const
|
|
1016
|
-
if (!
|
|
1039
|
+
const L = m.value;
|
|
1040
|
+
if (!L)
|
|
1017
1041
|
return null;
|
|
1018
1042
|
let A = -1;
|
|
1019
|
-
const
|
|
1020
|
-
if (
|
|
1021
|
-
A = parseInt(
|
|
1043
|
+
const G = y.getAttribute("data-rowid");
|
|
1044
|
+
if (G != null)
|
|
1045
|
+
A = parseInt(G, 10);
|
|
1022
1046
|
else {
|
|
1023
|
-
const F =
|
|
1024
|
-
A = Array.from(F.querySelectorAll(".vxe-body--row")).indexOf(
|
|
1047
|
+
const F = y.parentElement;
|
|
1048
|
+
A = Array.from(F.querySelectorAll(".vxe-body--row")).indexOf(y);
|
|
1025
1049
|
}
|
|
1026
1050
|
if (A < 0)
|
|
1027
1051
|
return null;
|
|
1028
1052
|
let V = -1;
|
|
1029
|
-
const
|
|
1030
|
-
if (
|
|
1031
|
-
const
|
|
1053
|
+
const ee = s.getAttribute("data-colid");
|
|
1054
|
+
if (ee && (V = L.getColumns().findIndex((I) => I.id === ee)), V < 0) {
|
|
1055
|
+
const I = Array.from(y.querySelectorAll(".vxe-body--column")).indexOf(s), j = !!s.closest(".vxe-table--fixed-left-wrapper"), N = !!s.closest(".vxe-table--fixed-right-wrapper"), M = L.getColumns();
|
|
1032
1056
|
if (j) {
|
|
1033
|
-
const
|
|
1034
|
-
|
|
1035
|
-
} else if (
|
|
1036
|
-
const
|
|
1037
|
-
|
|
1057
|
+
const K = M.filter((P) => P.fixed === "left");
|
|
1058
|
+
I < K.length && (V = M.indexOf(K[I]));
|
|
1059
|
+
} else if (N) {
|
|
1060
|
+
const K = M.filter((P) => P.fixed === "right");
|
|
1061
|
+
I < K.length && (V = M.indexOf(K[I]));
|
|
1038
1062
|
} else {
|
|
1039
|
-
const
|
|
1040
|
-
V = M.filter((
|
|
1063
|
+
const K = l.searchForm.showCheckBox ? 1 : 0;
|
|
1064
|
+
V = M.filter((J) => J.fixed === "left").length + I - K;
|
|
1041
1065
|
}
|
|
1042
1066
|
}
|
|
1043
1067
|
return V < 0 ? null : { rowIndex: A, colIndex: V, cell: s };
|
|
1044
|
-
},
|
|
1045
|
-
const s =
|
|
1068
|
+
}, be = (i) => {
|
|
1069
|
+
const s = Me(i.target);
|
|
1046
1070
|
if (!s) {
|
|
1047
|
-
|
|
1071
|
+
xe();
|
|
1048
1072
|
return;
|
|
1049
1073
|
}
|
|
1050
|
-
|
|
1074
|
+
k.isSelecting = !0, k.startCell = {
|
|
1051
1075
|
rowIndex: s.rowIndex,
|
|
1052
1076
|
colIndex: s.colIndex
|
|
1053
|
-
},
|
|
1054
|
-
},
|
|
1055
|
-
if (!
|
|
1077
|
+
}, k.endCell = { ...k.startCell }, Re(), Ae();
|
|
1078
|
+
}, ye = (i) => {
|
|
1079
|
+
if (!k.isSelecting)
|
|
1056
1080
|
return;
|
|
1057
|
-
const s =
|
|
1058
|
-
s && (
|
|
1081
|
+
const s = Me(i.target);
|
|
1082
|
+
s && (k.endCell = {
|
|
1059
1083
|
rowIndex: s.rowIndex,
|
|
1060
1084
|
colIndex: s.colIndex
|
|
1061
|
-
},
|
|
1062
|
-
},
|
|
1063
|
-
|
|
1064
|
-
},
|
|
1065
|
-
|
|
1066
|
-
const
|
|
1067
|
-
if (!
|
|
1085
|
+
}, Re(), Ae());
|
|
1086
|
+
}, Ce = () => {
|
|
1087
|
+
k.isSelecting = !1;
|
|
1088
|
+
}, xe = () => {
|
|
1089
|
+
k.selectedCells = [], k.startCell = null, k.endCell = null;
|
|
1090
|
+
const i = m.value;
|
|
1091
|
+
if (!i)
|
|
1068
1092
|
return;
|
|
1069
|
-
|
|
1093
|
+
i.$el.querySelectorAll(
|
|
1070
1094
|
".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left"
|
|
1071
|
-
).forEach((
|
|
1072
|
-
|
|
1095
|
+
).forEach((y) => {
|
|
1096
|
+
y.classList.remove(
|
|
1073
1097
|
"cell-selected",
|
|
1074
1098
|
"cell-border-top",
|
|
1075
1099
|
"cell-border-right",
|
|
@@ -1077,25 +1101,25 @@ const Xt = { class: "center" }, en = {
|
|
|
1077
1101
|
"cell-border-left"
|
|
1078
1102
|
);
|
|
1079
1103
|
});
|
|
1080
|
-
},
|
|
1081
|
-
if (!
|
|
1082
|
-
|
|
1104
|
+
}, Re = () => {
|
|
1105
|
+
if (!k.startCell || !k.endCell) {
|
|
1106
|
+
k.selectedCells = [];
|
|
1083
1107
|
return;
|
|
1084
1108
|
}
|
|
1085
|
-
const
|
|
1086
|
-
|
|
1087
|
-
for (let F = A; F <=
|
|
1088
|
-
for (let
|
|
1089
|
-
|
|
1109
|
+
const i = k.startCell.rowIndex, s = k.endCell.rowIndex, y = k.startCell.colIndex, L = k.endCell.colIndex, A = Math.min(i, s), G = Math.max(i, s), V = Math.min(y, L), ee = Math.max(y, L);
|
|
1110
|
+
k.selectedCells = [];
|
|
1111
|
+
for (let F = A; F <= G; F++)
|
|
1112
|
+
for (let I = V; I <= ee; I++)
|
|
1113
|
+
k.selectedCells.push({
|
|
1090
1114
|
rowIndex: F,
|
|
1091
|
-
colIndex:
|
|
1115
|
+
colIndex: I
|
|
1092
1116
|
});
|
|
1093
|
-
},
|
|
1094
|
-
|
|
1095
|
-
const
|
|
1096
|
-
if (!
|
|
1117
|
+
}, Ae = () => {
|
|
1118
|
+
$e(() => {
|
|
1119
|
+
const i = m.value;
|
|
1120
|
+
if (!i)
|
|
1097
1121
|
return;
|
|
1098
|
-
const s =
|
|
1122
|
+
const s = i.$el;
|
|
1099
1123
|
if (s.querySelectorAll(
|
|
1100
1124
|
".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left"
|
|
1101
1125
|
).forEach((j) => {
|
|
@@ -1106,242 +1130,226 @@ const Xt = { class: "center" }, en = {
|
|
|
1106
1130
|
"cell-border-bottom",
|
|
1107
1131
|
"cell-border-left"
|
|
1108
1132
|
);
|
|
1109
|
-
}),
|
|
1133
|
+
}), k.selectedCells.length === 0)
|
|
1110
1134
|
return;
|
|
1111
|
-
const
|
|
1135
|
+
const y = i.getColumns(), L = k.selectedCells.map((j) => j.rowIndex), A = k.selectedCells.map((j) => j.colIndex), G = Math.min(...L), V = Math.max(...L), ee = Math.min(...A), F = Math.max(...A), I = [
|
|
1112
1136
|
s.querySelector(".vxe-table--body-wrapper tbody"),
|
|
1113
1137
|
s.querySelector(".vxe-table--fixed-left-wrapper tbody"),
|
|
1114
1138
|
s.querySelector(".vxe-table--fixed-right-wrapper tbody")
|
|
1115
1139
|
].filter(Boolean);
|
|
1116
|
-
|
|
1117
|
-
const M =
|
|
1140
|
+
k.selectedCells.forEach(({ rowIndex: j, colIndex: N }) => {
|
|
1141
|
+
const M = y[N];
|
|
1118
1142
|
if (!M)
|
|
1119
1143
|
return;
|
|
1120
|
-
const
|
|
1121
|
-
for (const
|
|
1122
|
-
const fe =
|
|
1144
|
+
const K = M.fixed === "left", P = M.fixed === "right";
|
|
1145
|
+
for (const J of I) {
|
|
1146
|
+
const fe = J.querySelectorAll(".vxe-body--row")[j];
|
|
1123
1147
|
if (!fe)
|
|
1124
1148
|
continue;
|
|
1125
|
-
const
|
|
1149
|
+
const oe = Array.from(fe.querySelectorAll(".vxe-body--column"));
|
|
1126
1150
|
let D = null;
|
|
1127
|
-
if (
|
|
1128
|
-
const
|
|
1129
|
-
D =
|
|
1130
|
-
} else if (
|
|
1131
|
-
const
|
|
1132
|
-
D =
|
|
1133
|
-
} else if (!
|
|
1134
|
-
const
|
|
1135
|
-
D =
|
|
1151
|
+
if (K && J.closest(".vxe-table--fixed-left-wrapper")) {
|
|
1152
|
+
const Q = y.filter((X) => X.fixed === "left").indexOf(M);
|
|
1153
|
+
D = oe[Q];
|
|
1154
|
+
} else if (P && J.closest(".vxe-table--fixed-right-wrapper")) {
|
|
1155
|
+
const Q = y.filter((X) => X.fixed === "right").indexOf(M);
|
|
1156
|
+
D = oe[Q];
|
|
1157
|
+
} else if (!K && !P && J.closest(".vxe-table--body-wrapper")) {
|
|
1158
|
+
const le = l.searchForm.showCheckBox ? 1 : 0, Q = y.filter((ke) => ke.fixed === "left").length, X = N - Q;
|
|
1159
|
+
D = oe[X + le];
|
|
1136
1160
|
}
|
|
1137
1161
|
if (D && !D.classList.contains("col--checkbox") && !D.classList.contains("col--seq")) {
|
|
1138
|
-
D.classList.add("cell-selected"), j ===
|
|
1162
|
+
D.classList.add("cell-selected"), j === G && D.classList.add("cell-border-top"), j === V && D.classList.add("cell-border-bottom"), N === ee && D.classList.add("cell-border-left"), N === F && D.classList.add("cell-border-right");
|
|
1139
1163
|
break;
|
|
1140
1164
|
}
|
|
1141
1165
|
}
|
|
1142
1166
|
});
|
|
1143
1167
|
});
|
|
1144
|
-
},
|
|
1145
|
-
if (
|
|
1168
|
+
}, ct = async () => {
|
|
1169
|
+
if (k.selectedCells.length === 0)
|
|
1146
1170
|
return;
|
|
1147
|
-
const
|
|
1148
|
-
if (!
|
|
1171
|
+
const i = m.value;
|
|
1172
|
+
if (!i)
|
|
1149
1173
|
return;
|
|
1150
|
-
const s =
|
|
1151
|
-
(F,
|
|
1152
|
-
), A = [...new Set(
|
|
1153
|
-
(F,
|
|
1154
|
-
),
|
|
1174
|
+
const s = i.$el, y = i.getColumns(), L = [...new Set(k.selectedCells.map((F) => F.rowIndex))].sort(
|
|
1175
|
+
(F, I) => F - I
|
|
1176
|
+
), A = [...new Set(k.selectedCells.map((F) => F.colIndex))].sort(
|
|
1177
|
+
(F, I) => F - I
|
|
1178
|
+
), G = [
|
|
1155
1179
|
s.querySelector(".vxe-table--body-wrapper tbody"),
|
|
1156
1180
|
s.querySelector(".vxe-table--fixed-left-wrapper tbody"),
|
|
1157
1181
|
s.querySelector(".vxe-table--fixed-right-wrapper tbody")
|
|
1158
1182
|
].filter(Boolean), V = [];
|
|
1159
|
-
|
|
1160
|
-
const
|
|
1183
|
+
L.forEach((F) => {
|
|
1184
|
+
const I = [];
|
|
1161
1185
|
A.forEach((j) => {
|
|
1162
|
-
const
|
|
1163
|
-
if (!
|
|
1164
|
-
|
|
1186
|
+
const N = y[j];
|
|
1187
|
+
if (!N) {
|
|
1188
|
+
I.push("");
|
|
1165
1189
|
return;
|
|
1166
1190
|
}
|
|
1167
|
-
const M =
|
|
1168
|
-
let
|
|
1169
|
-
for (const
|
|
1170
|
-
const fe =
|
|
1191
|
+
const M = N.fixed === "left", K = N.fixed === "right";
|
|
1192
|
+
let P = "";
|
|
1193
|
+
for (const J of G) {
|
|
1194
|
+
const fe = J.querySelectorAll(".vxe-body--row")[F];
|
|
1171
1195
|
if (!fe)
|
|
1172
1196
|
continue;
|
|
1173
|
-
const
|
|
1197
|
+
const oe = Array.from(fe.querySelectorAll(".vxe-body--column"));
|
|
1174
1198
|
let D = null;
|
|
1175
|
-
if (M &&
|
|
1176
|
-
const
|
|
1177
|
-
D =
|
|
1178
|
-
} else if (
|
|
1179
|
-
const
|
|
1180
|
-
D =
|
|
1181
|
-
} else if (!M && !
|
|
1182
|
-
const
|
|
1183
|
-
D =
|
|
1199
|
+
if (M && J.closest(".vxe-table--fixed-left-wrapper")) {
|
|
1200
|
+
const Q = y.filter((X) => X.fixed === "left").indexOf(N);
|
|
1201
|
+
D = oe[Q];
|
|
1202
|
+
} else if (K && J.closest(".vxe-table--fixed-right-wrapper")) {
|
|
1203
|
+
const Q = y.filter((X) => X.fixed === "right").indexOf(N);
|
|
1204
|
+
D = oe[Q];
|
|
1205
|
+
} else if (!M && !K && J.closest(".vxe-table--body-wrapper")) {
|
|
1206
|
+
const le = l.searchForm.showCheckBox ? 1 : 0, Q = y.filter((ke) => ke.fixed === "left").length, X = j - Q;
|
|
1207
|
+
D = oe[X + le];
|
|
1184
1208
|
}
|
|
1185
1209
|
if (D && !D.classList.contains("col--checkbox") && !D.classList.contains("col--seq")) {
|
|
1186
|
-
|
|
1210
|
+
P = D.innerText || D.textContent || "", P = P.trim(), P = P.replace(/\n/g, " ").replace(/\s+/g, " ");
|
|
1187
1211
|
break;
|
|
1188
1212
|
}
|
|
1189
1213
|
}
|
|
1190
|
-
|
|
1191
|
-
}), V.push(
|
|
1214
|
+
I.push(P);
|
|
1215
|
+
}), V.push(I.join(" "));
|
|
1192
1216
|
});
|
|
1193
|
-
const
|
|
1217
|
+
const ee = V.join(`
|
|
1194
1218
|
`);
|
|
1195
1219
|
try {
|
|
1196
|
-
await navigator.clipboard.writeText(
|
|
1220
|
+
await navigator.clipboard.writeText(ee);
|
|
1197
1221
|
} catch (F) {
|
|
1198
1222
|
console.error("复制失败:", F);
|
|
1199
1223
|
}
|
|
1200
|
-
},
|
|
1201
|
-
|
|
1202
|
-
},
|
|
1203
|
-
|
|
1204
|
-
},
|
|
1205
|
-
const s =
|
|
1224
|
+
}, we = (i) => {
|
|
1225
|
+
l.searchForm.enableCellCopy && ((i.ctrlKey || i.metaKey) && i.key === "c" ? k.selectedCells.length > 0 && (i.preventDefault(), i.stopPropagation(), ct()) : i.key === "Escape" && xe());
|
|
1226
|
+
}, Ve = () => {
|
|
1227
|
+
k.isSelecting = !1;
|
|
1228
|
+
}, Ue = (i) => {
|
|
1229
|
+
const s = m.value;
|
|
1206
1230
|
if (!s || !s.$el)
|
|
1207
1231
|
return;
|
|
1208
|
-
s.$el.contains(
|
|
1209
|
-
},
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
align: "center",
|
|
1214
|
-
customConfig: { ..._, ...c },
|
|
1215
|
-
columnConfig: { ...y, ...s },
|
|
1216
|
-
// 列过多时 自动宽度 虚拟滚动会闪屏 关闭虚拟滚动
|
|
1217
|
-
"virtual-x-config": {
|
|
1218
|
-
enabled: !1,
|
|
1219
|
-
scrollToLeftOnChange: !1
|
|
1220
|
-
},
|
|
1221
|
-
// 纵向虚拟滚动 大于100条开启
|
|
1222
|
-
"virtual-y-config": { enabled: !0, gt: 100 },
|
|
1223
|
-
...C
|
|
1224
|
-
};
|
|
1225
|
-
}), it = (c) => {
|
|
1226
|
-
v.pageNo = c, m();
|
|
1227
|
-
}, ct = (c) => {
|
|
1228
|
-
v.pageSize = c, v[i] = 1, m();
|
|
1232
|
+
s.$el.contains(i.target) || xe();
|
|
1233
|
+
}, ut = (i) => {
|
|
1234
|
+
b.pageNo = i, $();
|
|
1235
|
+
}, dt = (i) => {
|
|
1236
|
+
b.pageSize = i, b[C] = 1, $();
|
|
1229
1237
|
};
|
|
1230
|
-
function
|
|
1231
|
-
const
|
|
1232
|
-
|
|
1238
|
+
function je() {
|
|
1239
|
+
const i = m.value.getCheckboxRecords();
|
|
1240
|
+
l.searchForm.selections = i;
|
|
1233
1241
|
}
|
|
1234
|
-
const
|
|
1235
|
-
const s =
|
|
1242
|
+
const qe = (i) => {
|
|
1243
|
+
const s = m.value;
|
|
1236
1244
|
if (s) {
|
|
1237
|
-
s.toggleCheckboxRow(
|
|
1238
|
-
const
|
|
1239
|
-
|
|
1245
|
+
s.toggleCheckboxRow(i);
|
|
1246
|
+
const y = m.value.getCheckboxRecords();
|
|
1247
|
+
l.searchForm.selections = y;
|
|
1240
1248
|
}
|
|
1241
1249
|
};
|
|
1242
|
-
return e({ tableRef:
|
|
1250
|
+
return e({ tableRef: m, getList: $, getPrm: S, clearSort: v, calculateTableHeight: u }), (i, s) => {
|
|
1243
1251
|
var F;
|
|
1244
|
-
const
|
|
1245
|
-
return
|
|
1246
|
-
class:
|
|
1252
|
+
const y = O("el-button"), L = O("el-checkbox"), A = O("el-text"), G = O("vxe-column"), V = O("VxeTable"), ee = O("el-pagination");
|
|
1253
|
+
return T(), re("div", {
|
|
1254
|
+
class: Le({ box: n.searchForm.showShadow })
|
|
1247
1255
|
}, [
|
|
1248
|
-
n.searchForm.showSearch ? (
|
|
1256
|
+
n.searchForm.showSearch ? (T(), U(nn, {
|
|
1249
1257
|
key: 0,
|
|
1250
1258
|
form: n.searchForm,
|
|
1251
|
-
onReset:
|
|
1252
|
-
onConfirm: s[1] || (s[1] = (
|
|
1253
|
-
onVisibleChange:
|
|
1259
|
+
onReset: B,
|
|
1260
|
+
onConfirm: s[1] || (s[1] = (I) => $()),
|
|
1261
|
+
onVisibleChange: Z(u)
|
|
1254
1262
|
}, {
|
|
1255
1263
|
btn: R(() => [
|
|
1256
|
-
|
|
1257
|
-
|
|
1264
|
+
ie(i.$slots, "search-bar-btn", {}, void 0, !0),
|
|
1265
|
+
W(y, {
|
|
1258
1266
|
round: "",
|
|
1259
|
-
onClick: s[0] || (s[0] = (
|
|
1267
|
+
onClick: s[0] || (s[0] = (I) => m.value.openCustom())
|
|
1260
1268
|
}, {
|
|
1261
1269
|
default: R(() => [
|
|
1262
|
-
|
|
1270
|
+
W(st, { name: "Tools" })
|
|
1263
1271
|
]),
|
|
1264
1272
|
_: 1
|
|
1265
1273
|
})
|
|
1266
1274
|
]),
|
|
1267
1275
|
_: 3
|
|
1268
|
-
}, 8, ["form", "onVisibleChange"])) :
|
|
1269
|
-
|
|
1270
|
-
|
|
1276
|
+
}, 8, ["form", "onVisibleChange"])) : ce("", !0),
|
|
1277
|
+
ie(i.$slots, "table-header-left", {}, void 0, !0),
|
|
1278
|
+
ae("div", {
|
|
1271
1279
|
ref_key: "tableContentRef",
|
|
1272
|
-
ref:
|
|
1280
|
+
ref: x
|
|
1273
1281
|
}, [
|
|
1274
|
-
|
|
1275
|
-
id:
|
|
1282
|
+
W(V, me({
|
|
1283
|
+
id: c.value,
|
|
1276
1284
|
ref_key: "tableRef",
|
|
1277
|
-
ref:
|
|
1278
|
-
loading: n.loading ||
|
|
1279
|
-
data: n.api ?
|
|
1285
|
+
ref: m,
|
|
1286
|
+
loading: n.loading || a.value,
|
|
1287
|
+
data: n.api ? d.value : n.data,
|
|
1280
1288
|
border: ""
|
|
1281
|
-
},
|
|
1282
|
-
height:
|
|
1283
|
-
onCheckboxChange:
|
|
1284
|
-
onCheckboxAll:
|
|
1285
|
-
onSortChange: (F =
|
|
1289
|
+
}, z.value, {
|
|
1290
|
+
height: h.value,
|
|
1291
|
+
onCheckboxChange: je,
|
|
1292
|
+
onCheckboxAll: je,
|
|
1293
|
+
onSortChange: (F = z.value["sort-config"]) == null ? void 0 : F.sortChange
|
|
1286
1294
|
}), {
|
|
1287
1295
|
default: R(() => [
|
|
1288
|
-
n.searchForm.showCheckBox == null || n.searchForm.showCheckBox ? (
|
|
1296
|
+
n.searchForm.showCheckBox == null || n.searchForm.showCheckBox ? (T(), U(G, {
|
|
1289
1297
|
key: 0,
|
|
1290
1298
|
type: "checkbox",
|
|
1291
|
-
width:
|
|
1292
|
-
title:
|
|
1299
|
+
width: Z(o) == "zh_cn" ? 80 : 150,
|
|
1300
|
+
title: i.$t("xu-hao"),
|
|
1293
1301
|
fixed: "left"
|
|
1294
1302
|
}, {
|
|
1295
|
-
checkbox: R(({ rowIndex:
|
|
1296
|
-
|
|
1297
|
-
|
|
1303
|
+
checkbox: R(({ rowIndex: I, row: j, checked: N, disabled: M, indeterminate: K }) => [
|
|
1304
|
+
ae("div", on, [
|
|
1305
|
+
N ? (T(), U(L, {
|
|
1298
1306
|
key: 0,
|
|
1299
1307
|
checked: !0,
|
|
1300
1308
|
disabled: M,
|
|
1301
1309
|
size: "default",
|
|
1302
|
-
onClick:
|
|
1303
|
-
}, null, 8, ["disabled", "onClick"])) : (
|
|
1310
|
+
onClick: Ee((P) => !M && qe(j), ["stop"])
|
|
1311
|
+
}, null, 8, ["disabled", "onClick"])) : (T(), U(L, {
|
|
1304
1312
|
key: 1,
|
|
1305
1313
|
disabled: M,
|
|
1306
1314
|
checked: !1,
|
|
1307
1315
|
size: "default",
|
|
1308
|
-
onClick:
|
|
1316
|
+
onClick: Ee((P) => !M && qe(j), ["stop"])
|
|
1309
1317
|
}, null, 8, ["disabled", "onClick"])),
|
|
1310
|
-
|
|
1318
|
+
W(A, {
|
|
1311
1319
|
type: "info",
|
|
1312
1320
|
class: "mgl5"
|
|
1313
1321
|
}, {
|
|
1314
1322
|
default: R(() => [
|
|
1315
|
-
|
|
1323
|
+
te(ne(I + 1), 1)
|
|
1316
1324
|
]),
|
|
1317
1325
|
_: 2
|
|
1318
1326
|
}, 1024)
|
|
1319
1327
|
])
|
|
1320
1328
|
]),
|
|
1321
1329
|
_: 1
|
|
1322
|
-
}, 8, ["width", "title"])) :
|
|
1323
|
-
|
|
1330
|
+
}, 8, ["width", "title"])) : ce("", !0),
|
|
1331
|
+
ie(i.$slots, "default", {}, void 0, !0)
|
|
1324
1332
|
]),
|
|
1325
1333
|
_: 3
|
|
1326
1334
|
}, 16, ["id", "loading", "data", "height", "onSortChange"])
|
|
1327
1335
|
], 512),
|
|
1328
|
-
n.searchForm.showPage ? (
|
|
1336
|
+
n.searchForm.showPage ? (T(), U(ee, {
|
|
1329
1337
|
key: 1,
|
|
1330
|
-
"current-page":
|
|
1331
|
-
"onUpdate:currentPage": s[2] || (s[2] = (
|
|
1338
|
+
"current-page": b[Z(C)],
|
|
1339
|
+
"onUpdate:currentPage": s[2] || (s[2] = (I) => b[Z(C)] = I),
|
|
1332
1340
|
class: "myPagination mgt10",
|
|
1333
1341
|
background: "",
|
|
1334
1342
|
layout: "total, sizes, prev, pager, next",
|
|
1335
|
-
total:
|
|
1336
|
-
"page-size":
|
|
1343
|
+
total: b.total,
|
|
1344
|
+
"page-size": b.pageSize,
|
|
1337
1345
|
"page-sizes": [10, 50, 100, 500],
|
|
1338
|
-
onCurrentChange:
|
|
1339
|
-
onSizeChange:
|
|
1340
|
-
}, null, 8, ["current-page", "total", "page-size"])) :
|
|
1346
|
+
onCurrentChange: ut,
|
|
1347
|
+
onSizeChange: dt
|
|
1348
|
+
}, null, 8, ["current-page", "total", "page-size"])) : ce("", !0)
|
|
1341
1349
|
], 2);
|
|
1342
1350
|
};
|
|
1343
1351
|
}
|
|
1344
|
-
},
|
|
1352
|
+
}, On = /* @__PURE__ */ ge(ln, [["__scopeId", "data-v-b945dd6e"]]), Dn = {
|
|
1345
1353
|
__name: "index",
|
|
1346
1354
|
props: {
|
|
1347
1355
|
sheetsConfig: {
|
|
@@ -1356,41 +1364,41 @@ const Xt = { class: "center" }, en = {
|
|
|
1356
1364
|
setup(n) {
|
|
1357
1365
|
const e = n;
|
|
1358
1366
|
function t() {
|
|
1359
|
-
|
|
1367
|
+
Vt(e.fileName, e.sheetsConfig);
|
|
1360
1368
|
}
|
|
1361
|
-
return (
|
|
1362
|
-
const
|
|
1363
|
-
return
|
|
1369
|
+
return (o, r) => {
|
|
1370
|
+
const l = O("el-link");
|
|
1371
|
+
return T(), U(l, me({
|
|
1364
1372
|
type: "primary",
|
|
1365
1373
|
underline: "never"
|
|
1366
|
-
},
|
|
1374
|
+
}, o.$attrs, { onClick: t }), {
|
|
1367
1375
|
default: R(() => [
|
|
1368
|
-
|
|
1376
|
+
te(ne(o.$t("xia-zai-dao-ru-mo-ban")), 1)
|
|
1369
1377
|
]),
|
|
1370
1378
|
_: 1
|
|
1371
1379
|
}, 16);
|
|
1372
1380
|
};
|
|
1373
1381
|
}
|
|
1374
1382
|
};
|
|
1375
|
-
function
|
|
1376
|
-
const t =
|
|
1383
|
+
function zn(n, e = {}) {
|
|
1384
|
+
const t = ze(), o = {
|
|
1377
1385
|
inForm: !0,
|
|
1378
1386
|
required: !0,
|
|
1379
1387
|
...e
|
|
1380
|
-
},
|
|
1388
|
+
}, r = {
|
|
1381
1389
|
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}$/,
|
|
1382
1390
|
password: /(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/,
|
|
1383
1391
|
email: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
|
|
1384
|
-
}[n], { inForm:
|
|
1385
|
-
return
|
|
1386
|
-
if (
|
|
1387
|
-
|
|
1392
|
+
}[n], { inForm: l, value: a, required: d, msg: c = t("validate.invalidInput") } = o;
|
|
1393
|
+
return l ? function(w, C, b) {
|
|
1394
|
+
if (d) {
|
|
1395
|
+
r.test(C) ? b() : b(new Error(c));
|
|
1388
1396
|
return;
|
|
1389
1397
|
}
|
|
1390
|
-
|
|
1391
|
-
} :
|
|
1398
|
+
C && !r.test(C) ? b(new Error(c)) : b();
|
|
1399
|
+
} : r.test(a);
|
|
1392
1400
|
}
|
|
1393
|
-
class
|
|
1401
|
+
class Mn {
|
|
1394
1402
|
constructor(e = {}) {
|
|
1395
1403
|
this.config = {
|
|
1396
1404
|
clientCode: e.clientCode || "one-portal",
|
|
@@ -1486,10 +1494,10 @@ class Fn {
|
|
|
1486
1494
|
});
|
|
1487
1495
|
if (!t.ok)
|
|
1488
1496
|
throw new Error(`HTTP ${t.status}: ${t.statusText}`);
|
|
1489
|
-
const
|
|
1490
|
-
if (
|
|
1491
|
-
return this.token =
|
|
1492
|
-
throw new Error(
|
|
1497
|
+
const o = await t.json();
|
|
1498
|
+
if (o.success && o.data)
|
|
1499
|
+
return this.token = o.data.token, this.user = o.data.user, this.saveToStorage(), this.clearTicketFromUrl(), this.log("ST票据验证成功,用户登录成功:", this.user), this.config.loginCallback && this.config.loginCallback(this.user, this.token), !0;
|
|
1500
|
+
throw new Error(o.message || "ST票据验证失败");
|
|
1493
1501
|
} catch (t) {
|
|
1494
1502
|
return this.log("ST票据验证失败:", t), this.handleError(t), !1;
|
|
1495
1503
|
}
|
|
@@ -1528,19 +1536,19 @@ class Fn {
|
|
|
1528
1536
|
* 发送带认证的HTTP请求
|
|
1529
1537
|
*/
|
|
1530
1538
|
async request(e, t = {}) {
|
|
1531
|
-
const
|
|
1539
|
+
const o = {
|
|
1532
1540
|
headers: {
|
|
1533
1541
|
"Content-Type": "application/json",
|
|
1534
1542
|
...t.headers
|
|
1535
1543
|
},
|
|
1536
1544
|
...t
|
|
1537
1545
|
};
|
|
1538
|
-
|
|
1546
|
+
o.headers.appId = this.config.clientCode, this.token && (o.headers.Authorization = `Bearer ${this.token}`);
|
|
1539
1547
|
try {
|
|
1540
|
-
const
|
|
1541
|
-
return
|
|
1542
|
-
} catch (
|
|
1543
|
-
throw this.log("请求失败:",
|
|
1548
|
+
const r = await fetch(e, o);
|
|
1549
|
+
return r.status === 401 ? (this.log("Token已过期,需要重新登录"), this.logout(), null) : r;
|
|
1550
|
+
} catch (r) {
|
|
1551
|
+
throw this.log("请求失败:", r), r;
|
|
1544
1552
|
}
|
|
1545
1553
|
}
|
|
1546
1554
|
/**
|
|
@@ -1596,100 +1604,100 @@ class Fn {
|
|
|
1596
1604
|
return this.config[e];
|
|
1597
1605
|
}
|
|
1598
1606
|
}
|
|
1599
|
-
function
|
|
1600
|
-
const
|
|
1607
|
+
function Rn(n, e = {}) {
|
|
1608
|
+
const o = Object.assign({
|
|
1601
1609
|
manual: !1,
|
|
1602
1610
|
// 手动执行
|
|
1603
1611
|
log: !1,
|
|
1604
1612
|
params: null,
|
|
1605
1613
|
format: null
|
|
1606
|
-
}, e), { manual:
|
|
1607
|
-
const
|
|
1608
|
-
|
|
1609
|
-
const { code:
|
|
1610
|
-
if (
|
|
1611
|
-
const { records: h, rows:
|
|
1612
|
-
|
|
1614
|
+
}, e), { manual: r, log: l, params: a = {}, cb: d, format: c } = o, w = q([]), C = q(!1), b = (m) => {
|
|
1615
|
+
const x = m || a;
|
|
1616
|
+
C.value = !0, n(x).then((p) => {
|
|
1617
|
+
const { code: u, data: f, msg: _ } = p;
|
|
1618
|
+
if (d) {
|
|
1619
|
+
const { records: h, rows: g } = f || {}, E = h || g ? h || g : f;
|
|
1620
|
+
w.value = Se(E, c), d(p);
|
|
1613
1621
|
}
|
|
1614
1622
|
if (f) {
|
|
1615
1623
|
if (f.records != null || f.rows != null) {
|
|
1616
|
-
const { records: h, rows:
|
|
1617
|
-
|
|
1624
|
+
const { records: h, rows: g, total: E = 0 } = f || {};
|
|
1625
|
+
x && x.total != null && (a.total = parseInt(E)), w.value = Se(h || g || [], c);
|
|
1618
1626
|
} else
|
|
1619
|
-
|
|
1620
|
-
|
|
1627
|
+
w.value = Se(f, c);
|
|
1628
|
+
l && console.log("useRequest-res", w.value);
|
|
1621
1629
|
}
|
|
1622
|
-
}).catch((
|
|
1623
|
-
|
|
1630
|
+
}).catch((p) => {
|
|
1631
|
+
d && (console.log("useRequestErr", p), d({ code: 500 }));
|
|
1624
1632
|
}).finally(() => {
|
|
1625
|
-
|
|
1633
|
+
C.value = !1;
|
|
1626
1634
|
});
|
|
1627
1635
|
};
|
|
1628
|
-
return
|
|
1636
|
+
return r || b(), [C, w, b];
|
|
1629
1637
|
}
|
|
1630
|
-
function
|
|
1631
|
-
const e = q(n), t = q(""),
|
|
1632
|
-
return
|
|
1633
|
-
const
|
|
1634
|
-
t.value =
|
|
1635
|
-
}), [e, t,
|
|
1638
|
+
function An(n) {
|
|
1639
|
+
const e = q(n), t = q(""), o = q("");
|
|
1640
|
+
return We(e, (r) => {
|
|
1641
|
+
const l = r || ["", ""];
|
|
1642
|
+
t.value = l[0], o.value = l[1];
|
|
1643
|
+
}), [e, t, o];
|
|
1636
1644
|
}
|
|
1637
|
-
function
|
|
1645
|
+
function Vn(n) {
|
|
1638
1646
|
return Object.prototype.toString.call(n).slice(8, -1).toLowerCase();
|
|
1639
1647
|
}
|
|
1640
|
-
function
|
|
1648
|
+
function Se(n, e) {
|
|
1641
1649
|
if (!e)
|
|
1642
1650
|
return n;
|
|
1643
1651
|
if (n instanceof Array)
|
|
1644
|
-
return n.map((
|
|
1645
|
-
let
|
|
1646
|
-
return e.forEach((
|
|
1652
|
+
return n.map((o) => {
|
|
1653
|
+
let r = {};
|
|
1654
|
+
return e.forEach((l) => r[l] = o[l]), r;
|
|
1647
1655
|
});
|
|
1648
1656
|
let t = {};
|
|
1649
|
-
return e.forEach((
|
|
1657
|
+
return e.forEach((o) => t[o] = n[o]), t;
|
|
1650
1658
|
}
|
|
1651
|
-
function
|
|
1652
|
-
const { locale: t } =
|
|
1653
|
-
return
|
|
1659
|
+
function Un(n, e = []) {
|
|
1660
|
+
const { locale: t } = de(), o = q(n());
|
|
1661
|
+
return We(
|
|
1654
1662
|
[t, ...e],
|
|
1655
1663
|
() => {
|
|
1656
|
-
|
|
1664
|
+
o.value = n();
|
|
1657
1665
|
},
|
|
1658
1666
|
{ immediate: !0 }
|
|
1659
|
-
),
|
|
1667
|
+
), o;
|
|
1660
1668
|
}
|
|
1661
|
-
function
|
|
1669
|
+
function jn(n, e = "zh_cn", t = "en_us") {
|
|
1662
1670
|
if (!n)
|
|
1663
1671
|
return "-";
|
|
1664
|
-
const
|
|
1665
|
-
return n[l
|
|
1672
|
+
const o = { en_us: t, zh_cn: e }, l = rt().global.locale.value;
|
|
1673
|
+
return n[o[l]] || n[e] || "-";
|
|
1666
1674
|
}
|
|
1667
|
-
function
|
|
1668
|
-
let t =
|
|
1669
|
-
return typeof n == "string" && n.length > 0 && (t =
|
|
1675
|
+
function qn(n, e) {
|
|
1676
|
+
let t = Et;
|
|
1677
|
+
return typeof n == "string" && n.length > 0 && (t = De(n).mapState), it(e, t);
|
|
1670
1678
|
}
|
|
1671
|
-
function
|
|
1672
|
-
let t =
|
|
1673
|
-
return typeof n == "string" && n.length > 0 && (t =
|
|
1679
|
+
function Pn(n, e) {
|
|
1680
|
+
let t = Lt;
|
|
1681
|
+
return typeof n == "string" && n.length > 0 && (t = De(n).mapGetters), it(e, t);
|
|
1674
1682
|
}
|
|
1675
|
-
function
|
|
1676
|
-
let t =
|
|
1677
|
-
return typeof n == "string" && n.length > 0 && (t =
|
|
1683
|
+
function Bn(n, e) {
|
|
1684
|
+
let t = Tt;
|
|
1685
|
+
return typeof n == "string" && n.length > 0 && (t = De(n).mapActions), rn(e, t);
|
|
1678
1686
|
}
|
|
1679
|
-
function
|
|
1680
|
-
const t =
|
|
1681
|
-
return Object.keys(
|
|
1682
|
-
const a = l
|
|
1683
|
-
|
|
1684
|
-
}),
|
|
1687
|
+
function it(n, e) {
|
|
1688
|
+
const t = et(), o = e(n), r = {};
|
|
1689
|
+
return Object.keys(o).forEach((l) => {
|
|
1690
|
+
const a = o[l].bind({ $store: t });
|
|
1691
|
+
r[l] = se(a);
|
|
1692
|
+
}), r;
|
|
1685
1693
|
}
|
|
1686
|
-
function
|
|
1687
|
-
const t =
|
|
1688
|
-
return Object.keys(
|
|
1689
|
-
|
|
1690
|
-
}),
|
|
1694
|
+
function rn(n, e) {
|
|
1695
|
+
const t = et(), o = e(n), r = {};
|
|
1696
|
+
return Object.keys(o).forEach((l) => {
|
|
1697
|
+
r[l] = o[l].bind({ $store: t });
|
|
1698
|
+
}), r;
|
|
1691
1699
|
}
|
|
1692
|
-
const
|
|
1700
|
+
const an = {
|
|
1693
1701
|
__name: "EnumRender",
|
|
1694
1702
|
props: {
|
|
1695
1703
|
renderOpts: {
|
|
@@ -1704,123 +1712,123 @@ const nn = {
|
|
|
1704
1712
|
},
|
|
1705
1713
|
setup(n) {
|
|
1706
1714
|
const e = n, t = e.params.row[e.params.column.field];
|
|
1707
|
-
return (
|
|
1708
|
-
const
|
|
1709
|
-
return n.renderOpts.text ? (
|
|
1715
|
+
return (o, r) => {
|
|
1716
|
+
const l = O("el-text");
|
|
1717
|
+
return n.renderOpts.text ? (T(), U(l, { key: 0 }, {
|
|
1710
1718
|
default: R(() => [
|
|
1711
|
-
|
|
1719
|
+
te(ne(n.renderOpts.enum.getName(Z(t))), 1)
|
|
1712
1720
|
]),
|
|
1713
1721
|
_: 1
|
|
1714
|
-
})) : (
|
|
1722
|
+
})) : (T(), U(l, {
|
|
1715
1723
|
key: 1,
|
|
1716
|
-
type: n.renderOpts.enum.getTag(
|
|
1724
|
+
type: n.renderOpts.enum.getTag(Z(t))
|
|
1717
1725
|
}, {
|
|
1718
1726
|
default: R(() => [
|
|
1719
|
-
|
|
1727
|
+
te(ne(n.renderOpts.enum.getName(Z(t))), 1)
|
|
1720
1728
|
]),
|
|
1721
1729
|
_: 1
|
|
1722
1730
|
}, 8, ["type"]));
|
|
1723
1731
|
};
|
|
1724
1732
|
}
|
|
1725
1733
|
};
|
|
1726
|
-
function
|
|
1734
|
+
function Yn() {
|
|
1727
1735
|
he.renderer.add("Enum", {
|
|
1728
1736
|
// 默认显示模板
|
|
1729
1737
|
renderTableDefault(n, e) {
|
|
1730
|
-
return [null, void 0].includes(e.row[e.column.field]) ? "-" : /* @__PURE__ */ React.createElement(
|
|
1738
|
+
return [null, void 0].includes(e.row[e.column.field]) ? "-" : /* @__PURE__ */ React.createElement(an, { renderOpts: n, params: e });
|
|
1731
1739
|
}
|
|
1732
1740
|
}), he.renderer.add("InputNumber", {
|
|
1733
1741
|
// 默认显示模板
|
|
1734
1742
|
renderTableDefault(n, e) {
|
|
1735
|
-
return /* @__PURE__ */ React.createElement(
|
|
1743
|
+
return /* @__PURE__ */ React.createElement(pt, { "v-model": e.row[e.column.field], ...n.props, "step-strictly": !0, "value-on-clear": 0 });
|
|
1736
1744
|
}
|
|
1737
1745
|
}), he.renderer.add("TrueFalse", {
|
|
1738
1746
|
// 默认显示模板
|
|
1739
1747
|
renderTableDefault(n, e) {
|
|
1740
|
-
const { locale: t } =
|
|
1741
|
-
let
|
|
1748
|
+
const { locale: t } = de();
|
|
1749
|
+
let o = t.value == "zh_cn";
|
|
1742
1750
|
return /* @__PURE__ */ React.createElement(
|
|
1743
|
-
|
|
1751
|
+
vt,
|
|
1744
1752
|
{
|
|
1745
1753
|
type: e.row[e.column.field] ? "success" : "danger"
|
|
1746
1754
|
},
|
|
1747
|
-
e.row[e.column.field] ?
|
|
1755
|
+
e.row[e.column.field] ? o ? "是" : "YES" : o ? "否" : "NO"
|
|
1748
1756
|
);
|
|
1749
1757
|
}
|
|
1750
1758
|
}), he.renderer.add("I18n", {
|
|
1751
1759
|
// 默认显示模板
|
|
1752
1760
|
renderTableDefault(n, e) {
|
|
1753
|
-
const { locale: t } =
|
|
1754
|
-
let
|
|
1755
|
-
return e.row[
|
|
1761
|
+
const { locale: t } = de();
|
|
1762
|
+
let o = t.value == "zh_cn" ? e.column.field : n.fieldEn;
|
|
1763
|
+
return e.row[o] || e.row[e.column.field];
|
|
1756
1764
|
}
|
|
1757
1765
|
}), he.renderer.add("Link", {
|
|
1758
1766
|
// 默认显示模板
|
|
1759
1767
|
renderTableDefault(n, e) {
|
|
1760
|
-
var
|
|
1768
|
+
var d;
|
|
1761
1769
|
let t = e.column.field;
|
|
1762
|
-
const
|
|
1763
|
-
if (!
|
|
1770
|
+
const o = It(), { multiple: r, to: l } = n;
|
|
1771
|
+
if (!r)
|
|
1764
1772
|
return /* @__PURE__ */ React.createElement(
|
|
1765
|
-
|
|
1773
|
+
Pe,
|
|
1766
1774
|
{
|
|
1767
1775
|
underline: "never",
|
|
1768
1776
|
type: "primary",
|
|
1769
|
-
onclick: () =>
|
|
1777
|
+
onclick: () => o.push({ path: l, query: { [t]: e.row[t] } })
|
|
1770
1778
|
},
|
|
1771
1779
|
e.row[t]
|
|
1772
1780
|
);
|
|
1773
|
-
const a = ((
|
|
1774
|
-
return a.map((
|
|
1775
|
-
|
|
1781
|
+
const a = ((d = e.row[t]) == null ? void 0 : d.split(",")) || [];
|
|
1782
|
+
return a.map((c, w) => /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement(
|
|
1783
|
+
Pe,
|
|
1776
1784
|
{
|
|
1777
1785
|
underline: "never",
|
|
1778
1786
|
type: "primary",
|
|
1779
|
-
onclick: () =>
|
|
1787
|
+
onclick: () => o.push({ path: l, query: { [t]: c } })
|
|
1780
1788
|
},
|
|
1781
|
-
|
|
1782
|
-
),
|
|
1789
|
+
c
|
|
1790
|
+
), w < a.length - 1 ? "," : ""));
|
|
1783
1791
|
}
|
|
1784
1792
|
});
|
|
1785
1793
|
}
|
|
1786
1794
|
export {
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1795
|
+
Nt as CmpDictionary,
|
|
1796
|
+
st as CmpIcon,
|
|
1797
|
+
Tn as ConfrimButton,
|
|
1798
|
+
Dn as DownExcelTemp,
|
|
1799
|
+
Fn as ImportButton,
|
|
1800
|
+
bn as LayOutForm,
|
|
1801
|
+
On as ListPage,
|
|
1802
|
+
Mn as OnePortalCasSDK,
|
|
1803
|
+
nn as SearchBar,
|
|
1804
|
+
He as StatusMap,
|
|
1805
|
+
xn as _toRaw,
|
|
1806
|
+
Vn as _typeOf,
|
|
1807
|
+
kn as arrToStatusMap,
|
|
1808
|
+
wn as arrayToTree,
|
|
1809
|
+
Sn as checkFileSize,
|
|
1810
|
+
zn as creatValidator,
|
|
1811
|
+
En as createImportFields,
|
|
1812
|
+
In as createListPageId,
|
|
1813
|
+
Fe as en,
|
|
1814
|
+
Vt as exportExcel,
|
|
1815
|
+
rt as getI18n,
|
|
1816
|
+
ze as getI18nT,
|
|
1817
|
+
jn as getLocaleValue,
|
|
1818
|
+
Ln as getValueBykey,
|
|
1819
|
+
yn as importExcel,
|
|
1820
|
+
Mt as messages,
|
|
1821
|
+
Yn as registerVxeRenderers,
|
|
1822
|
+
Rt as setupI18n,
|
|
1823
|
+
Cn as sleep,
|
|
1824
|
+
at as stringToArray,
|
|
1825
|
+
_n as stripHtmlTags,
|
|
1826
|
+
$n as unicode2Str,
|
|
1827
|
+
Bn as useActions,
|
|
1828
|
+
An as useDatePicker,
|
|
1829
|
+
Pn as useGetters,
|
|
1830
|
+
Un as useI18nReState,
|
|
1831
|
+
Rn as useRequest,
|
|
1832
|
+
qn as useState,
|
|
1833
|
+
Te as zhCn
|
|
1826
1834
|
};
|