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