joy-admin-components 0.2.17 → 0.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/joy-admin-components.es.js +367 -359
- package/dist/joy-admin-components.umd.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
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
|
|
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 re, 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 se, Fragment as Oe, renderList as rt, withModifiers as Me, nextTick as Se, resolveDynamicComponent as st, 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
3
|
import { saveAs as it } from "file-saver";
|
|
4
4
|
import Ee from "exceljs";
|
|
5
5
|
import ke from "dayjs";
|
|
@@ -11,25 +11,25 @@ import { VxeUI as xe } from "vxe-pc-ui";
|
|
|
11
11
|
const Vn = ot({
|
|
12
12
|
name: "LayOutForm",
|
|
13
13
|
setup(t, { slots: e, attrs: n, emit: a }) {
|
|
14
|
-
const
|
|
15
|
-
(
|
|
16
|
-
var
|
|
14
|
+
const r = R(null), o = () => e.default ? e.default().filter((s) => s.type !== Symbol.for("v-cmt")).map((s) => s.type === Symbol.for("v-fgt") ? s.children : s).flat().map(
|
|
15
|
+
(s) => {
|
|
16
|
+
var i;
|
|
17
17
|
return Te(
|
|
18
18
|
St,
|
|
19
|
-
{ span: ((
|
|
19
|
+
{ span: ((i = s.props) == null ? void 0 : i.span) || 24 },
|
|
20
20
|
{
|
|
21
|
-
default: () =>
|
|
21
|
+
default: () => s
|
|
22
22
|
}
|
|
23
23
|
);
|
|
24
24
|
}
|
|
25
25
|
) : null;
|
|
26
26
|
lt(() => {
|
|
27
|
-
a("ref",
|
|
27
|
+
a("ref", r.value);
|
|
28
28
|
});
|
|
29
29
|
function l() {
|
|
30
30
|
return Te(
|
|
31
31
|
_t,
|
|
32
|
-
{ ...n, ref:
|
|
32
|
+
{ ...n, ref: r },
|
|
33
33
|
() => Te($t, { gutter: n.gutter ?? 20 }, { default: () => o() })
|
|
34
34
|
);
|
|
35
35
|
}
|
|
@@ -45,41 +45,41 @@ var ht = { exports: {} };
|
|
|
45
45
|
(function(n, a) {
|
|
46
46
|
t.exports = a();
|
|
47
47
|
})(dt, function() {
|
|
48
|
-
var n = "minute", a = /[+-]\d\d(?::?\d\d)?/g,
|
|
49
|
-
return function(o, l,
|
|
50
|
-
var
|
|
51
|
-
|
|
48
|
+
var n = "minute", a = /[+-]\d\d(?::?\d\d)?/g, r = /([+-]|\d\d)/g;
|
|
49
|
+
return function(o, l, s) {
|
|
50
|
+
var i = l.prototype;
|
|
51
|
+
s.utc = function(u) {
|
|
52
52
|
var h = { date: u, utc: !0, args: arguments };
|
|
53
53
|
return new l(h);
|
|
54
|
-
},
|
|
55
|
-
var h =
|
|
54
|
+
}, i.utc = function(u) {
|
|
55
|
+
var h = s(this.toDate(), { locale: this.$L, utc: !0 });
|
|
56
56
|
return u ? h.add(this.utcOffset(), n) : h;
|
|
57
|
-
},
|
|
58
|
-
return
|
|
57
|
+
}, i.local = function() {
|
|
58
|
+
return s(this.toDate(), { locale: this.$L, utc: !1 });
|
|
59
59
|
};
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
u.utc && (this.$u = !0), this.$utils().u(u.$offset) || (this.$offset = u.$offset),
|
|
60
|
+
var v = i.parse;
|
|
61
|
+
i.parse = function(u) {
|
|
62
|
+
u.utc && (this.$u = !0), this.$utils().u(u.$offset) || (this.$offset = u.$offset), v.call(this, u);
|
|
63
63
|
};
|
|
64
|
-
var
|
|
65
|
-
|
|
64
|
+
var w = i.init;
|
|
65
|
+
i.init = function() {
|
|
66
66
|
if (this.$u) {
|
|
67
67
|
var u = this.$d;
|
|
68
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
|
+
w.call(this);
|
|
71
71
|
};
|
|
72
|
-
var
|
|
73
|
-
|
|
72
|
+
var b = i.utcOffset;
|
|
73
|
+
i.utcOffset = function(u, h) {
|
|
74
74
|
var k = this.$utils().u;
|
|
75
75
|
if (k(u))
|
|
76
|
-
return this.$u ? 0 : k(this.$offset) ?
|
|
76
|
+
return this.$u ? 0 : k(this.$offset) ? b.call(this) : this.$offset;
|
|
77
77
|
if (typeof u == "string" && (u = function(E) {
|
|
78
78
|
E === void 0 && (E = "");
|
|
79
79
|
var Y = E.match(a);
|
|
80
80
|
if (!Y)
|
|
81
81
|
return null;
|
|
82
|
-
var F = ("" + Y[0]).match(
|
|
82
|
+
var F = ("" + Y[0]).match(r) || ["-", 0, 0], d = F[0], x = 60 * +F[1] + +F[2];
|
|
83
83
|
return x === 0 ? 0 : d === "+" ? x : -x;
|
|
84
84
|
}(u), u === null))
|
|
85
85
|
return this;
|
|
@@ -92,29 +92,29 @@ var ht = { exports: {} };
|
|
|
92
92
|
var S = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
|
|
93
93
|
return (C = this.local().add(_ + S, n)).$offset = _, C.$x.$localOffset = S, C;
|
|
94
94
|
};
|
|
95
|
-
var p =
|
|
96
|
-
|
|
95
|
+
var p = i.format;
|
|
96
|
+
i.format = function(u) {
|
|
97
97
|
var h = u || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
|
|
98
98
|
return p.call(this, h);
|
|
99
|
-
},
|
|
99
|
+
}, i.valueOf = function() {
|
|
100
100
|
var u = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
|
|
101
101
|
return this.$d.valueOf() - 6e4 * u;
|
|
102
|
-
},
|
|
102
|
+
}, i.isUTC = function() {
|
|
103
103
|
return !!this.$u;
|
|
104
|
-
},
|
|
104
|
+
}, i.toISOString = function() {
|
|
105
105
|
return this.toDate().toISOString();
|
|
106
|
-
},
|
|
106
|
+
}, i.toString = function() {
|
|
107
107
|
return this.toDate().toUTCString();
|
|
108
108
|
};
|
|
109
|
-
var g =
|
|
110
|
-
|
|
111
|
-
return u === "s" && this.$offset ?
|
|
109
|
+
var g = i.toDate;
|
|
110
|
+
i.toDate = function(u) {
|
|
111
|
+
return u === "s" && this.$offset ? s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : g.call(this);
|
|
112
112
|
};
|
|
113
|
-
var m =
|
|
114
|
-
|
|
113
|
+
var m = i.diff;
|
|
114
|
+
i.diff = function(u, h, k) {
|
|
115
115
|
if (u && this.$u === u.$u)
|
|
116
116
|
return m.call(this, u, h, k);
|
|
117
|
-
var _ = this.local(), C =
|
|
117
|
+
var _ = this.local(), C = s(u).local();
|
|
118
118
|
return m.call(_, C, h, k);
|
|
119
119
|
};
|
|
120
120
|
};
|
|
@@ -128,8 +128,8 @@ var mt = { exports: {} };
|
|
|
128
128
|
t.exports = a();
|
|
129
129
|
})(dt, function() {
|
|
130
130
|
var n = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, a = {};
|
|
131
|
-
return function(
|
|
132
|
-
var
|
|
131
|
+
return function(r, o, l) {
|
|
132
|
+
var s, i = function(p, g, m) {
|
|
133
133
|
m === void 0 && (m = {});
|
|
134
134
|
var u = new Date(p), h = function(k, _) {
|
|
135
135
|
_ === void 0 && (_ = {});
|
|
@@ -137,16 +137,16 @@ var mt = { exports: {} };
|
|
|
137
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
138
|
}(g, m);
|
|
139
139
|
return h.formatToParts(u);
|
|
140
|
-
},
|
|
141
|
-
for (var m =
|
|
140
|
+
}, v = function(p, g) {
|
|
141
|
+
for (var m = i(p, g), u = [], h = 0; h < m.length; h += 1) {
|
|
142
142
|
var k = m[h], _ = k.type, C = k.value, S = n[_];
|
|
143
143
|
S >= 0 && (u[S] = parseInt(C, 10));
|
|
144
144
|
}
|
|
145
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
146
|
return (l.utc(F).valueOf() - (d -= d % 1e3)) / 6e4;
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
p === void 0 && (p =
|
|
147
|
+
}, w = o.prototype;
|
|
148
|
+
w.tz = function(p, g) {
|
|
149
|
+
p === void 0 && (p = s);
|
|
150
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
151
|
if (!Number(C))
|
|
152
152
|
m = this.utcOffset(0, g);
|
|
@@ -155,34 +155,34 @@ var mt = { exports: {} };
|
|
|
155
155
|
m = m.add(u - S, "minute");
|
|
156
156
|
}
|
|
157
157
|
return m.$x.$timezone = p, m;
|
|
158
|
-
},
|
|
159
|
-
var g = this.$x.$timezone || l.tz.guess(), m =
|
|
158
|
+
}, w.offsetName = function(p) {
|
|
159
|
+
var g = this.$x.$timezone || l.tz.guess(), m = i(this.valueOf(), g, { timeZoneName: p }).find(function(u) {
|
|
160
160
|
return u.type.toLowerCase() === "timezonename";
|
|
161
161
|
});
|
|
162
162
|
return m && m.value;
|
|
163
163
|
};
|
|
164
|
-
var
|
|
165
|
-
|
|
164
|
+
var b = w.startOf;
|
|
165
|
+
w.startOf = function(p, g) {
|
|
166
166
|
if (!this.$x || !this.$x.$timezone)
|
|
167
|
-
return
|
|
167
|
+
return b.call(this, p, g);
|
|
168
168
|
var m = l(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
|
|
169
|
-
return
|
|
169
|
+
return b.call(m, p, g).tz(this.$x.$timezone, !0);
|
|
170
170
|
}, l.tz = function(p, g, m) {
|
|
171
|
-
var u = m && g, h = m || g ||
|
|
171
|
+
var u = m && g, h = m || g || s, k = v(+l(), h);
|
|
172
172
|
if (typeof p != "string")
|
|
173
173
|
return l(p).tz(h);
|
|
174
174
|
var _ = function(Y, F, d) {
|
|
175
|
-
var x = Y - 60 * F * 1e3, O =
|
|
175
|
+
var x = Y - 60 * F * 1e3, O = v(x, d);
|
|
176
176
|
if (F === O)
|
|
177
177
|
return [x, F];
|
|
178
|
-
var A =
|
|
178
|
+
var A = v(x -= 60 * (O - F) * 1e3, d);
|
|
179
179
|
return O === A ? [x, O] : [Y - 60 * Math.min(O, A) * 1e3, Math.max(O, A)];
|
|
180
180
|
}(l.utc(p, u).valueOf(), k, h), C = _[0], S = _[1], E = l(C).utcOffset(S);
|
|
181
181
|
return E.$x.$timezone = h, E;
|
|
182
182
|
}, l.tz.guess = function() {
|
|
183
183
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
184
184
|
}, l.tz.setDefault = function(p) {
|
|
185
|
-
|
|
185
|
+
s = p;
|
|
186
186
|
};
|
|
187
187
|
};
|
|
188
188
|
});
|
|
@@ -289,21 +289,21 @@ async function qn(t, e) {
|
|
|
289
289
|
const l = ve();
|
|
290
290
|
throw new Error(l("excel.fieldsMappingRequired"));
|
|
291
291
|
}
|
|
292
|
-
let
|
|
293
|
-
await
|
|
292
|
+
let r = new Ee.Workbook();
|
|
293
|
+
await r.xlsx.load(t);
|
|
294
294
|
const o = {};
|
|
295
|
-
return
|
|
296
|
-
const
|
|
297
|
-
l.eachRow(function(
|
|
298
|
-
if (
|
|
299
|
-
let
|
|
295
|
+
return r.eachSheet(function(l, s) {
|
|
296
|
+
const i = [];
|
|
297
|
+
l.eachRow(function(v, w) {
|
|
298
|
+
if (w > a) {
|
|
299
|
+
let b = {}, p = !0;
|
|
300
300
|
Object.keys(n).forEach((g) => {
|
|
301
|
-
const m =
|
|
302
|
-
|
|
303
|
-
}), p ||
|
|
301
|
+
const m = v.getCell(n[g]).value;
|
|
302
|
+
b[g] = m, m && (p = !1);
|
|
303
|
+
}), p || i.push(b);
|
|
304
304
|
}
|
|
305
|
-
}), o[l._name] =
|
|
306
|
-
}),
|
|
305
|
+
}), o[l._name] = i;
|
|
306
|
+
}), r = null, o;
|
|
307
307
|
}
|
|
308
308
|
const gt = {
|
|
309
309
|
columnWidth: 30
|
|
@@ -311,19 +311,19 @@ const gt = {
|
|
|
311
311
|
async function An(t, e, n = [], a = {}) {
|
|
312
312
|
if (!t || !e)
|
|
313
313
|
return;
|
|
314
|
-
const { columnStyle:
|
|
315
|
-
e.forEach((
|
|
316
|
-
|
|
314
|
+
const { columnStyle: r } = a, { columnWidth: o } = gt;
|
|
315
|
+
e.forEach((i) => {
|
|
316
|
+
i.width = i.width ? i.width : o;
|
|
317
317
|
});
|
|
318
|
-
const { workbook: l, worksheet:
|
|
319
|
-
|
|
318
|
+
const { workbook: l, worksheet: s } = Gt();
|
|
319
|
+
s.columns = e, s.addRows(n), r && await Jt(l, s, r);
|
|
320
320
|
try {
|
|
321
|
-
const
|
|
321
|
+
const i = await l.xlsx.writeBuffer(), v = new File([i], t, {
|
|
322
322
|
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
323
323
|
});
|
|
324
|
-
it(
|
|
325
|
-
} catch (
|
|
326
|
-
console.log(
|
|
324
|
+
it(v);
|
|
325
|
+
} catch (i) {
|
|
326
|
+
console.log(i);
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
function Gt() {
|
|
@@ -334,48 +334,48 @@ function Gt() {
|
|
|
334
334
|
}
|
|
335
335
|
async function Jt(t, e, n) {
|
|
336
336
|
const a = Object.keys(n);
|
|
337
|
-
for (const
|
|
338
|
-
const o = n[
|
|
337
|
+
for (const r of a) {
|
|
338
|
+
const o = n[r], { type: l } = o;
|
|
339
339
|
switch (l) {
|
|
340
340
|
case "IMG":
|
|
341
|
-
await Xt(t, e,
|
|
341
|
+
await Xt(t, e, r);
|
|
342
342
|
break;
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
async function Xt(t, e, n, a) {
|
|
347
|
-
const
|
|
348
|
-
e.getColumn(n).width = 20, e.eachRow((l,
|
|
349
|
-
|
|
347
|
+
const r = e.getColumn(n), o = r.values;
|
|
348
|
+
e.getColumn(n).width = 20, e.eachRow((l, s) => {
|
|
349
|
+
s > 1 && (l.height = 40);
|
|
350
350
|
});
|
|
351
|
-
for (let l = 0,
|
|
351
|
+
for (let l = 0, s = o.length; l < s; l++) {
|
|
352
352
|
if (l < 2)
|
|
353
353
|
continue;
|
|
354
|
-
let
|
|
355
|
-
|
|
354
|
+
let i = o[l];
|
|
355
|
+
i && (e.getCell(r.letter + l).value = "", await Qt(t, e, i, {
|
|
356
356
|
width: 100,
|
|
357
357
|
height: 50,
|
|
358
|
-
col:
|
|
358
|
+
col: r._number - 1,
|
|
359
359
|
row: l - 1
|
|
360
360
|
}));
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
363
|
async function Qt(t, e, n, a) {
|
|
364
|
-
const { col:
|
|
365
|
-
if (
|
|
366
|
-
const
|
|
367
|
-
base64:
|
|
364
|
+
const { col: r, row: o, width: l, height: s } = a, { success: i, base64: v } = await en(n, 0.3);
|
|
365
|
+
if (i) {
|
|
366
|
+
const w = t.addImage({
|
|
367
|
+
base64: v,
|
|
368
368
|
extension: "jpeg"
|
|
369
369
|
});
|
|
370
|
-
e.addImage(
|
|
371
|
-
tl: { col:
|
|
372
|
-
ext: { width: l, height:
|
|
370
|
+
e.addImage(w, {
|
|
371
|
+
tl: { col: r, row: o },
|
|
372
|
+
ext: { width: l, height: s }
|
|
373
373
|
});
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
function en(t, e = 1) {
|
|
377
377
|
const n = new Image();
|
|
378
|
-
return n.setAttribute("crossOrigin", "anonymous"), n.crossOrigin = "anonymous", n.src = t, new Promise((a,
|
|
378
|
+
return n.setAttribute("crossOrigin", "anonymous"), n.crossOrigin = "anonymous", n.src = t, new Promise((a, r) => {
|
|
379
379
|
n.onload = () => {
|
|
380
380
|
const o = document.createElement("canvas");
|
|
381
381
|
o.width = n.width, o.height = n.height, o.getContext("2d").drawImage(n, 0, 0, o.width, o.height), a({
|
|
@@ -395,70 +395,70 @@ async function tn(t, e) {
|
|
|
395
395
|
const l = ve();
|
|
396
396
|
throw new Error(l("excel.fieldsMappingRequired"));
|
|
397
397
|
}
|
|
398
|
-
let
|
|
399
|
-
await
|
|
398
|
+
let r = new Ee.Workbook();
|
|
399
|
+
await r.xlsx.load(t);
|
|
400
400
|
const o = {};
|
|
401
|
-
return
|
|
401
|
+
return r.eachSheet(function(l, s) {
|
|
402
402
|
if (l.state == "visible") {
|
|
403
|
-
const
|
|
404
|
-
if (
|
|
405
|
-
let
|
|
406
|
-
|
|
407
|
-
const { tl: m } = g.range, u =
|
|
403
|
+
const i = [], v = n[l._name];
|
|
404
|
+
if (v) {
|
|
405
|
+
let w = Object.values(v).some((p) => p.includes("image")), b = {};
|
|
406
|
+
w && (l.getImages().forEach((g) => {
|
|
407
|
+
const { tl: m } = g.range, u = r.model.media.find((h) => h.index === g.imageId);
|
|
408
408
|
if (u) {
|
|
409
409
|
const h = u.buffer.toString("base64"), k = `data:image/${u.extension};base64,${h}`, _ = `${Math.ceil(m.row)}_${Math.ceil(m.col)}`;
|
|
410
|
-
|
|
410
|
+
b[_] ? b[_].push(k) : b[_] = [k];
|
|
411
411
|
}
|
|
412
|
-
}), console.log("withImages-imageMap",
|
|
412
|
+
}), console.log("withImages-imageMap", b)), l.eachRow(function(p, g) {
|
|
413
413
|
if (g > a) {
|
|
414
414
|
let m = {}, u = !0;
|
|
415
|
-
Object.keys(
|
|
415
|
+
Object.keys(v).forEach((h) => {
|
|
416
416
|
var E;
|
|
417
|
-
let [k, _] =
|
|
417
|
+
let [k, _] = v[h].split(je);
|
|
418
418
|
const C = p.getCell(k);
|
|
419
419
|
let S;
|
|
420
|
-
if (_ == "image" &&
|
|
420
|
+
if (_ == "image" && w) {
|
|
421
421
|
const Y = C._column._number, F = `${g}_${Y}`;
|
|
422
|
-
S =
|
|
422
|
+
S = b[F] || "";
|
|
423
423
|
} else
|
|
424
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
425
|
S && _ == "option" && (S = S.split(je)[1]), m[h] = S, S && (u = !1);
|
|
426
|
-
}), u ||
|
|
426
|
+
}), u || i.push(m);
|
|
427
427
|
}
|
|
428
|
-
}), o[l._name] =
|
|
428
|
+
}), o[l._name] = i;
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
|
-
}),
|
|
431
|
+
}), r = null, o;
|
|
432
432
|
}
|
|
433
433
|
async function nn(t, e) {
|
|
434
434
|
if (!t || e.length == 0)
|
|
435
435
|
return;
|
|
436
436
|
const n = on(e);
|
|
437
|
-
n.eachSheet(function(a,
|
|
438
|
-
const { columnWidth: o } = gt, { tableHeader: l, tableData:
|
|
439
|
-
l.forEach((
|
|
440
|
-
if (
|
|
441
|
-
const
|
|
442
|
-
|
|
443
|
-
...
|
|
437
|
+
n.eachSheet(function(a, r) {
|
|
438
|
+
const { columnWidth: o } = gt, { tableHeader: l, tableData: s } = e[a._name];
|
|
439
|
+
l.forEach((i) => {
|
|
440
|
+
if (i.required) {
|
|
441
|
+
const v = i.style || {}, { font: w = {} } = v;
|
|
442
|
+
i.style = {
|
|
443
|
+
...v,
|
|
444
444
|
font: {
|
|
445
|
-
...
|
|
445
|
+
...w,
|
|
446
446
|
color: {
|
|
447
447
|
argb: "FFFF0000"
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
};
|
|
451
451
|
}
|
|
452
|
-
}), a.columns = l, a.addRows(
|
|
453
|
-
const { header:
|
|
454
|
-
if (g.width =
|
|
455
|
-
const m = n.addWorksheet(
|
|
452
|
+
}), a.columns = l, a.addRows(s), l.forEach((i) => {
|
|
453
|
+
const { header: v, key: w, width: b, option: p } = i, g = a.getColumn(w);
|
|
454
|
+
if (g.width = b || o, p) {
|
|
455
|
+
const m = n.addWorksheet(w);
|
|
456
456
|
m.state = "hidden", m.getColumn(1).values = p.map((u) => `${u.label}${je}${u.value}`), Array(100).fill("").forEach((u, h) => {
|
|
457
457
|
if (h > 0) {
|
|
458
458
|
const k = ve();
|
|
459
459
|
a.getCell(`${g.letter}${h}`).dataValidation = {
|
|
460
460
|
type: "list",
|
|
461
|
-
formulae: [`${
|
|
461
|
+
formulae: [`${w}!$A$1:$A$${p.length}`],
|
|
462
462
|
showErrorMessage: !0,
|
|
463
463
|
error: k("excel.invalidInput"),
|
|
464
464
|
errorStyle: "stop",
|
|
@@ -470,22 +470,22 @@ async function nn(t, e) {
|
|
|
470
470
|
});
|
|
471
471
|
});
|
|
472
472
|
try {
|
|
473
|
-
const a = await n.xlsx.writeBuffer(),
|
|
473
|
+
const a = await n.xlsx.writeBuffer(), r = new File([a], t, {
|
|
474
474
|
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
475
475
|
});
|
|
476
|
-
it(
|
|
476
|
+
it(r);
|
|
477
477
|
} catch (a) {
|
|
478
478
|
console.log(a);
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
481
|
function on(t) {
|
|
482
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((
|
|
484
|
-
const l = t[
|
|
485
|
-
return l -
|
|
486
|
-
}).forEach((
|
|
487
|
-
let o =
|
|
488
|
-
/[\\/:*?\[\]]/g.test(
|
|
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((r, o) => {
|
|
484
|
+
const l = t[r].sort ?? 0, s = t[o].sort ?? 0;
|
|
485
|
+
return l - s;
|
|
486
|
+
}).forEach((r) => {
|
|
487
|
+
let o = r, l = !1;
|
|
488
|
+
/[\\/:*?\[\]]/g.test(r) && (r = r.replace(/[\\/:*?\[\]]/g, ""), l = !0), r.length > 31 && (r = r.substring(0, 31).trim(), l = !0, console.warn(e("excel.sheetNameTooLong", [o, r]))), l && (t[r] = t[o], delete t[o]), n.addWorksheet(r);
|
|
489
489
|
}), n;
|
|
490
490
|
}
|
|
491
491
|
function ln(t) {
|
|
@@ -507,17 +507,17 @@ function Un(t) {
|
|
|
507
507
|
return JSON.parse(JSON.stringify(t));
|
|
508
508
|
}
|
|
509
509
|
function Pn(t) {
|
|
510
|
-
let e = [], n = {}, a = (
|
|
511
|
-
for (const
|
|
512
|
-
n[
|
|
513
|
-
...
|
|
510
|
+
let e = [], n = {}, a = (r, o) => Object.prototype.hasOwnProperty.call(r, o);
|
|
511
|
+
for (const r of t) {
|
|
512
|
+
n[r.id] = {
|
|
513
|
+
...r,
|
|
514
514
|
// 判断当前项的子项 如果map有存储就用存储的子项 否则初始化
|
|
515
|
-
children: a(n,
|
|
515
|
+
children: a(n, r.id) ? n[r.id].children : []
|
|
516
516
|
};
|
|
517
|
-
const o = n[
|
|
518
|
-
|
|
517
|
+
const o = n[r.id];
|
|
518
|
+
r.pid == -1 ? e.push(o) : (a(n, r.pid) || (n[r.pid] = {
|
|
519
519
|
children: []
|
|
520
|
-
}), n[
|
|
520
|
+
}), n[r.pid].children.push(o));
|
|
521
521
|
}
|
|
522
522
|
return e;
|
|
523
523
|
}
|
|
@@ -536,8 +536,8 @@ class et {
|
|
|
536
536
|
getName(e) {
|
|
537
537
|
if (!this.has(e))
|
|
538
538
|
return "-";
|
|
539
|
-
const n = Ye().global.locale, { label: a, labelEn:
|
|
540
|
-
return (n.value == "zh_cn" ? a :
|
|
539
|
+
const n = Ye().global.locale, { label: a, labelEn: r } = this.map.get(e);
|
|
540
|
+
return (n.value == "zh_cn" ? a : r) || a || "-";
|
|
541
541
|
}
|
|
542
542
|
getTag(e) {
|
|
543
543
|
if (!this.has(e))
|
|
@@ -562,13 +562,13 @@ function Rn(t, e = [], n = "i18nName") {
|
|
|
562
562
|
if (t.length == 0)
|
|
563
563
|
return new et([]);
|
|
564
564
|
if (e.length < 2) {
|
|
565
|
-
const
|
|
566
|
-
throw new Error(
|
|
565
|
+
const r = ve();
|
|
566
|
+
throw new Error(r("tools.keysLengthError"));
|
|
567
567
|
}
|
|
568
|
-
let a = t.map((
|
|
568
|
+
let a = t.map((r) => {
|
|
569
569
|
let o = {};
|
|
570
|
-
return n && (o.labelEn =
|
|
571
|
-
|
|
570
|
+
return n && (o.labelEn = r[n]), e.forEach((l, s) => {
|
|
571
|
+
s === 0 ? o.label = r[l] : s === 1 ? o.value = r[l] : o[l] = r[l];
|
|
572
572
|
}), o;
|
|
573
573
|
});
|
|
574
574
|
return new et(a);
|
|
@@ -589,8 +589,8 @@ function Hn(t) {
|
|
|
589
589
|
function Nn(t) {
|
|
590
590
|
let e = {};
|
|
591
591
|
return t.map((n, a) => {
|
|
592
|
-
let { key:
|
|
593
|
-
o ? e[
|
|
592
|
+
let { key: r, option: o, type: l } = n, s = ln(a);
|
|
593
|
+
o ? e[r] = `${s}---option` : l === "image" ? e[r] = `${s}---image` : e[r] = s;
|
|
594
594
|
}), e;
|
|
595
595
|
}
|
|
596
596
|
function Wn(t, e) {
|
|
@@ -598,10 +598,10 @@ function Wn(t, e) {
|
|
|
598
598
|
}
|
|
599
599
|
const _e = (t, e) => {
|
|
600
600
|
const n = t.__vccOpts || t;
|
|
601
|
-
for (const [a,
|
|
602
|
-
n[a] =
|
|
601
|
+
for (const [a, r] of e)
|
|
602
|
+
n[a] = r;
|
|
603
603
|
return n;
|
|
604
|
-
}, an = ["onClick"],
|
|
604
|
+
}, an = ["onClick"], rn = {
|
|
605
605
|
__name: "index",
|
|
606
606
|
props: /* @__PURE__ */ Xe({
|
|
607
607
|
api: {
|
|
@@ -641,41 +641,41 @@ const _e = (t, e) => {
|
|
|
641
641
|
}),
|
|
642
642
|
emits: /* @__PURE__ */ Xe(["success", "change", "changeAll"], ["update:modelValue"]),
|
|
643
643
|
setup(t, { emit: e }) {
|
|
644
|
-
const n = t, a = Ft(), { t:
|
|
644
|
+
const n = t, a = Ft(), { t: r, locale: o } = me(), l = Tt(t, "modelValue"), s = re(() => a["value-key"] != null), i = R(""), v = re(() => {
|
|
645
645
|
if (a.remote !== void 0)
|
|
646
646
|
return n.data;
|
|
647
|
-
const d = pt(
|
|
647
|
+
const d = pt(i.value), { data: x, labelValue: O } = n, A = x || p.value;
|
|
648
648
|
if (d.length == 0)
|
|
649
649
|
return A;
|
|
650
650
|
const { label: oe, labelEn: ue } = O;
|
|
651
|
-
let
|
|
651
|
+
let y = o.value == "en_us" ? ue || "i18nName" : oe;
|
|
652
652
|
return d.length == 1 ? A.filter(
|
|
653
|
-
(ie) => ie[
|
|
653
|
+
(ie) => ie[y].toLowerCase().includes(d[0].toLowerCase())
|
|
654
654
|
) : A.filter((ie) => {
|
|
655
655
|
let pe = !1;
|
|
656
656
|
return pe = d.some(
|
|
657
|
-
(be) => ie[
|
|
657
|
+
(be) => ie[y].toLowerCase() == be.toLowerCase()
|
|
658
658
|
), pe;
|
|
659
659
|
});
|
|
660
|
-
}),
|
|
660
|
+
}), w = re({
|
|
661
661
|
get() {
|
|
662
|
-
return a.multiple == null || l.value == null ? !1 : l.value.length ==
|
|
662
|
+
return a.multiple == null || l.value == null ? !1 : l.value.length == v.value.length;
|
|
663
663
|
},
|
|
664
664
|
set(d) {
|
|
665
665
|
return d;
|
|
666
666
|
}
|
|
667
|
-
}),
|
|
667
|
+
}), b = e, p = R([]), g = async () => {
|
|
668
668
|
const { data: d } = await n.api();
|
|
669
|
-
p.value = [...d],
|
|
669
|
+
p.value = [...d], b("success", p);
|
|
670
670
|
};
|
|
671
671
|
n.api && g();
|
|
672
672
|
function m(d) {
|
|
673
|
-
|
|
673
|
+
b("change", d);
|
|
674
674
|
}
|
|
675
675
|
const u = n.labelValue.label.split("-"), h = (d) => {
|
|
676
676
|
if (u.length == 1) {
|
|
677
677
|
if (n.changeLocal)
|
|
678
|
-
return
|
|
678
|
+
return r(d[n.labelValue.label]);
|
|
679
679
|
let x = o.value == "en_us" ? d[n.labelValue.labelEn || "i18nName"] : d[n.labelValue.label];
|
|
680
680
|
return x = x || d[n.labelValue.label], x;
|
|
681
681
|
} else {
|
|
@@ -688,13 +688,13 @@ const _e = (t, e) => {
|
|
|
688
688
|
function k(d) {
|
|
689
689
|
let x = n.data ? n.data : p.value;
|
|
690
690
|
l.value = d ? x.map(
|
|
691
|
-
(O) =>
|
|
691
|
+
(O) => s.value ? O : O[n.labelValue.value]
|
|
692
692
|
) : [], Se(() => {
|
|
693
|
-
|
|
693
|
+
b("change", l.value), b("changeAll", l.value, x);
|
|
694
694
|
});
|
|
695
695
|
}
|
|
696
696
|
function _(d) {
|
|
697
|
-
n.optionClick && n.optionClick(d),
|
|
697
|
+
n.optionClick && n.optionClick(d), b("change", s.value ? d : d[n.labelValue.value]);
|
|
698
698
|
}
|
|
699
699
|
function C(d) {
|
|
700
700
|
return l.value.length >= n.maxLimit && !l.value.includes(d[n.labelValue.value]);
|
|
@@ -703,7 +703,7 @@ const _e = (t, e) => {
|
|
|
703
703
|
return d.map((x) => ({
|
|
704
704
|
...x,
|
|
705
705
|
label: h(x),
|
|
706
|
-
value:
|
|
706
|
+
value: s.value ? x : x[n.labelValue.value]
|
|
707
707
|
}));
|
|
708
708
|
}
|
|
709
709
|
const E = R([]), Y = n.data ? n.data : p.value;
|
|
@@ -726,14 +726,14 @@ const _e = (t, e) => {
|
|
|
726
726
|
},
|
|
727
727
|
{ deep: !0 }
|
|
728
728
|
);
|
|
729
|
-
const F =
|
|
729
|
+
const F = re(() => E.value);
|
|
730
730
|
return (d, x) => {
|
|
731
731
|
const O = z("el-checkbox"), A = z("el-select-v2"), oe = z("el-option"), ue = z("el-select");
|
|
732
732
|
return H(a).v2 != null ? (L(), B(A, he({
|
|
733
733
|
key: 0,
|
|
734
734
|
options: F.value,
|
|
735
735
|
modelValue: l.value,
|
|
736
|
-
"onUpdate:modelValue": x[1] || (x[1] = (
|
|
736
|
+
"onUpdate:modelValue": x[1] || (x[1] = (y) => l.value = y)
|
|
737
737
|
}, H(a), {
|
|
738
738
|
filterable: "",
|
|
739
739
|
"collapse-tags": "",
|
|
@@ -742,10 +742,10 @@ const _e = (t, e) => {
|
|
|
742
742
|
onChange: m,
|
|
743
743
|
onClear: m
|
|
744
744
|
}), at({
|
|
745
|
-
default: D(({ item:
|
|
745
|
+
default: D(({ item: y }) => [
|
|
746
746
|
ae("div", {
|
|
747
|
-
onClick: (ge) => _(
|
|
748
|
-
}, J(
|
|
747
|
+
onClick: (ge) => _(y)
|
|
748
|
+
}, J(y.label), 9, an)
|
|
749
749
|
]),
|
|
750
750
|
_: 2
|
|
751
751
|
}, [
|
|
@@ -755,8 +755,8 @@ const _e = (t, e) => {
|
|
|
755
755
|
X(d.$slots, "header", {}, () => [
|
|
756
756
|
q(O, {
|
|
757
757
|
class: "mgl20",
|
|
758
|
-
modelValue:
|
|
759
|
-
"onUpdate:modelValue": x[0] || (x[0] = (
|
|
758
|
+
modelValue: w.value,
|
|
759
|
+
"onUpdate:modelValue": x[0] || (x[0] = (y) => w.value = y),
|
|
760
760
|
onChange: k
|
|
761
761
|
}, {
|
|
762
762
|
default: D(() => [
|
|
@@ -771,19 +771,19 @@ const _e = (t, e) => {
|
|
|
771
771
|
]), 1040, ["options", "modelValue"])) : (L(), B(ue, he({
|
|
772
772
|
key: 1,
|
|
773
773
|
modelValue: l.value,
|
|
774
|
-
"onUpdate:modelValue": x[3] || (x[3] = (
|
|
774
|
+
"onUpdate:modelValue": x[3] || (x[3] = (y) => l.value = y),
|
|
775
775
|
filterable: "",
|
|
776
776
|
"collapse-tags": "",
|
|
777
777
|
"collapse-tags-tooltip": "",
|
|
778
|
-
"filter-method": H(a).remote != null ? void 0 : (
|
|
778
|
+
"filter-method": H(a).remote != null ? void 0 : (y) => i.value = y,
|
|
779
779
|
clearable: ""
|
|
780
780
|
}, H(a), { onClear: t.optionClick }), {
|
|
781
781
|
default: D(() => [
|
|
782
782
|
H(a).multiple != null && t.showCheckAll && t.maxLimit == null ? X(d.$slots, "header", { key: 0 }, () => [
|
|
783
783
|
q(O, {
|
|
784
784
|
class: "mgl20",
|
|
785
|
-
modelValue:
|
|
786
|
-
"onUpdate:modelValue": x[2] || (x[2] = (
|
|
785
|
+
modelValue: w.value,
|
|
786
|
+
"onUpdate:modelValue": x[2] || (x[2] = (y) => w.value = y),
|
|
787
787
|
onChange: k
|
|
788
788
|
}, {
|
|
789
789
|
default: D(() => [
|
|
@@ -792,19 +792,19 @@ const _e = (t, e) => {
|
|
|
792
792
|
_: 1
|
|
793
793
|
}, 8, ["modelValue"])
|
|
794
794
|
], !0) : ce("", !0),
|
|
795
|
-
(L(!0),
|
|
795
|
+
(L(!0), se(Oe, null, rt(v.value, (y, ge) => (L(), B(oe, {
|
|
796
796
|
key: ge,
|
|
797
|
-
label: h(
|
|
798
|
-
disabled: H(a).multiple != null && t.maxLimit > 0 ? C(
|
|
799
|
-
onClick: Me((ie) => _(
|
|
800
|
-
value:
|
|
797
|
+
label: h(y),
|
|
798
|
+
disabled: H(a).multiple != null && t.maxLimit > 0 ? C(y) : !1,
|
|
799
|
+
onClick: Me((ie) => _(y), ["stop"]),
|
|
800
|
+
value: s.value ? y : y[t.labelValue.value]
|
|
801
801
|
}, null, 8, ["label", "disabled", "onClick", "value"]))), 128))
|
|
802
802
|
]),
|
|
803
803
|
_: 3
|
|
804
804
|
}, 16, ["modelValue", "filter-method", "onClear"]));
|
|
805
805
|
};
|
|
806
806
|
}
|
|
807
|
-
},
|
|
807
|
+
}, sn = /* @__PURE__ */ _e(rn, [["__scopeId", "data-v-d12f3c20"]]);
|
|
808
808
|
const cn = ot({
|
|
809
809
|
props: {
|
|
810
810
|
name: {
|
|
@@ -813,11 +813,11 @@ const cn = ot({
|
|
|
813
813
|
}
|
|
814
814
|
}
|
|
815
815
|
});
|
|
816
|
-
function un(t, e, n, a,
|
|
816
|
+
function un(t, e, n, a, r, o) {
|
|
817
817
|
const l = z("el-icon");
|
|
818
818
|
return L(), B(l, { class: "cmp-icon" }, {
|
|
819
819
|
default: D(() => [
|
|
820
|
-
(L(), B(
|
|
820
|
+
(L(), B(st(t.name)))
|
|
821
821
|
]),
|
|
822
822
|
_: 1
|
|
823
823
|
});
|
|
@@ -829,14 +829,14 @@ const yt = /* @__PURE__ */ _e(cn, [["render", un], ["__scopeId", "data-v-733f9da
|
|
|
829
829
|
const n = e, a = Re(() => {
|
|
830
830
|
n("ok");
|
|
831
831
|
}, 500);
|
|
832
|
-
function
|
|
832
|
+
function r() {
|
|
833
833
|
n("no");
|
|
834
834
|
}
|
|
835
835
|
return (o, l) => {
|
|
836
|
-
const
|
|
837
|
-
return L(), B(
|
|
836
|
+
const s = z("el-popconfirm");
|
|
837
|
+
return L(), B(s, he(o.$attrs, {
|
|
838
838
|
onConfirm: H(a),
|
|
839
|
-
onCancel:
|
|
839
|
+
onCancel: r
|
|
840
840
|
}), {
|
|
841
841
|
reference: D(() => [
|
|
842
842
|
X(o.$slots, "default")
|
|
@@ -856,36 +856,44 @@ const dn = ["accept"], fn = {
|
|
|
856
856
|
fields: {
|
|
857
857
|
type: Object,
|
|
858
858
|
default: () => ({})
|
|
859
|
+
},
|
|
860
|
+
fileChange: {
|
|
861
|
+
type: Function,
|
|
862
|
+
required: !0
|
|
859
863
|
}
|
|
860
864
|
},
|
|
861
865
|
emits: ["fileChange"],
|
|
862
866
|
setup(t, { emit: e }) {
|
|
863
|
-
const n = t, a =
|
|
864
|
-
async function l
|
|
865
|
-
|
|
866
|
-
let
|
|
867
|
-
const
|
|
868
|
-
|
|
867
|
+
const n = t, a = R(null), r = R(!1);
|
|
868
|
+
async function o(l) {
|
|
869
|
+
r.value = !0;
|
|
870
|
+
let s = l.target.files[0];
|
|
871
|
+
const i = await tn(s, n.fields).catch(() => {
|
|
872
|
+
r.value = !1;
|
|
873
|
+
}).finally(() => {
|
|
874
|
+
a.value.value = null;
|
|
875
|
+
});
|
|
876
|
+
await n.fileChange(i).finally(() => {
|
|
877
|
+
r.value = !1;
|
|
869
878
|
});
|
|
870
|
-
a("fileChange", y);
|
|
871
879
|
}
|
|
872
|
-
return (
|
|
873
|
-
const
|
|
874
|
-
return L(),
|
|
875
|
-
q(
|
|
876
|
-
loading:
|
|
880
|
+
return (l, s) => {
|
|
881
|
+
const i = z("el-button");
|
|
882
|
+
return L(), se("span", null, [
|
|
883
|
+
q(i, {
|
|
884
|
+
loading: r.value,
|
|
877
885
|
class: "mgr10",
|
|
878
|
-
onClick:
|
|
886
|
+
onClick: s[0] || (s[0] = (v) => a.value.click())
|
|
879
887
|
}, {
|
|
880
888
|
default: D(() => [
|
|
881
|
-
Q(J(
|
|
889
|
+
Q(J(l.$t("dao-ru")), 1)
|
|
882
890
|
]),
|
|
883
891
|
_: 1
|
|
884
892
|
}, 8, ["loading"]),
|
|
885
893
|
ae("input", {
|
|
886
|
-
onChange:
|
|
894
|
+
onChange: o,
|
|
887
895
|
ref_key: "input",
|
|
888
|
-
ref:
|
|
896
|
+
ref: a,
|
|
889
897
|
accept: t.accept,
|
|
890
898
|
style: { position: "absolute", width: "0px", height: "0px", opacity: "0" },
|
|
891
899
|
type: "file"
|
|
@@ -893,19 +901,19 @@ const dn = ["accept"], fn = {
|
|
|
893
901
|
]);
|
|
894
902
|
};
|
|
895
903
|
}
|
|
896
|
-
}, Gn = /* @__PURE__ */ _e(fn, [["__scopeId", "data-v-
|
|
904
|
+
}, Gn = /* @__PURE__ */ _e(fn, [["__scopeId", "data-v-6f9ede29"]]);
|
|
897
905
|
function Ue(t) {
|
|
898
906
|
let e = {};
|
|
899
907
|
return t.forEach((n) => {
|
|
900
|
-
const { key: a, type:
|
|
908
|
+
const { key: a, type: r, option: o = {}, value: l, dateType: s = "date" } = n;
|
|
901
909
|
if (a)
|
|
902
|
-
if (
|
|
910
|
+
if (r == "input" && (o != null && o.multiple))
|
|
903
911
|
e[a] = pt(l);
|
|
904
|
-
else if (
|
|
905
|
-
if (
|
|
906
|
-
const [
|
|
907
|
-
let [
|
|
908
|
-
|
|
912
|
+
else if (r == "date")
|
|
913
|
+
if (s.includes("range")) {
|
|
914
|
+
const [i, v] = a;
|
|
915
|
+
let [w, b] = l || [];
|
|
916
|
+
w && s == "daterange" && (w = ke(w).format("YYYY-MM-DD 00:00:00"), b = ke(b).format("YYYY-MM-DD 23:59:59")), e[i] = w, e[v] = b;
|
|
909
917
|
} else
|
|
910
918
|
e[a] = l;
|
|
911
919
|
else
|
|
@@ -922,18 +930,18 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
922
930
|
},
|
|
923
931
|
emits: ["confirm", "reset", "visibleChange"],
|
|
924
932
|
setup(t, { expose: e, emit: n }) {
|
|
925
|
-
const a = t,
|
|
926
|
-
function
|
|
927
|
-
|
|
933
|
+
const a = t, r = n, o = R(!0), l = R(null), { t: s } = me(), i = re(() => o.value ? s("guan-bi") : s("zhan-kai"));
|
|
934
|
+
function v() {
|
|
935
|
+
r("confirm");
|
|
928
936
|
}
|
|
929
|
-
function
|
|
930
|
-
h.option.onClear && h.option.onClear(),
|
|
937
|
+
function w(h) {
|
|
938
|
+
h.option.onClear && h.option.onClear(), r("confirm");
|
|
931
939
|
}
|
|
932
|
-
function
|
|
933
|
-
|
|
940
|
+
function b() {
|
|
941
|
+
r("reset");
|
|
934
942
|
}
|
|
935
943
|
function p() {
|
|
936
|
-
|
|
944
|
+
r("confirm");
|
|
937
945
|
}
|
|
938
946
|
function g() {
|
|
939
947
|
return Ue(a.form.items);
|
|
@@ -947,9 +955,9 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
947
955
|
}
|
|
948
956
|
return e({ getPrm: g, reset: u }), (h, k) => {
|
|
949
957
|
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(),
|
|
958
|
+
return L(), se("div", {
|
|
951
959
|
class: "searchBar-container mgt10 mgb10",
|
|
952
|
-
onKeydown: Dt(
|
|
960
|
+
onKeydown: Dt(v, ["enter"])
|
|
953
961
|
}, [
|
|
954
962
|
ae("div", {
|
|
955
963
|
class: "searchBar",
|
|
@@ -960,10 +968,10 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
960
968
|
model: t.form.data
|
|
961
969
|
}, {
|
|
962
970
|
default: D(() => [
|
|
963
|
-
(L(!0),
|
|
971
|
+
(L(!0), se(Oe, null, rt(t.form.items.filter((d) => !d.hidden), (d) => (L(), se(Oe, {
|
|
964
972
|
key: d.key
|
|
965
973
|
}, [
|
|
966
|
-
d.type == "br" ? (L(),
|
|
974
|
+
d.type == "br" ? (L(), se("br", hn)) : (L(), B(S, {
|
|
967
975
|
key: 1,
|
|
968
976
|
label: d.name
|
|
969
977
|
}, {
|
|
@@ -977,15 +985,15 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
977
985
|
class: Ve(((x = d.option) == null ? void 0 : x.class) || "w150"),
|
|
978
986
|
placeholder: h.$t("qing-shu-ru"),
|
|
979
987
|
clearable: ""
|
|
980
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) : d.type === "custom" ? (L(), B(
|
|
981
|
-
d.type === "select" ? (L(), B(
|
|
988
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) : d.type === "custom" ? (L(), B(st(d.render), { key: 1 })) : ce("", !0),
|
|
989
|
+
d.type === "select" ? (L(), B(sn, he({
|
|
982
990
|
key: 2,
|
|
983
991
|
class: ((O = d.option) == null ? void 0 : O.class) || "w150",
|
|
984
992
|
modelValue: d.value,
|
|
985
993
|
"onUpdate:modelValue": (A) => d.value = A
|
|
986
994
|
}, { ref_for: !0 }, d.option, {
|
|
987
|
-
onChange:
|
|
988
|
-
onClear: (A) =>
|
|
995
|
+
onChange: v,
|
|
996
|
+
onClear: (A) => w(d)
|
|
989
997
|
}), null, 16, ["class", "modelValue", "onUpdate:modelValue", "onClear"])) : ce("", !0),
|
|
990
998
|
d.type === "date" ? (L(), B(C, {
|
|
991
999
|
key: 3,
|
|
@@ -1018,20 +1026,20 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
1018
1026
|
underline: "never",
|
|
1019
1027
|
class: "mgr10",
|
|
1020
1028
|
onClick: k[0] || (k[0] = () => {
|
|
1021
|
-
|
|
1029
|
+
r("visibleChange", !o.value), o.value = !o.value;
|
|
1022
1030
|
})
|
|
1023
1031
|
}, {
|
|
1024
1032
|
default: D(() => [
|
|
1025
1033
|
q(yt, {
|
|
1026
1034
|
name: o.value ? "ArrowUp" : "ArrowDown"
|
|
1027
1035
|
}, null, 8, ["name"]),
|
|
1028
|
-
Q(" " + J(
|
|
1036
|
+
Q(" " + J(i.value), 1)
|
|
1029
1037
|
]),
|
|
1030
1038
|
_: 1
|
|
1031
1039
|
}),
|
|
1032
1040
|
q(F, {
|
|
1033
1041
|
type: "primary",
|
|
1034
|
-
onClick:
|
|
1042
|
+
onClick: v
|
|
1035
1043
|
}, {
|
|
1036
1044
|
default: D(() => [
|
|
1037
1045
|
Q(J(h.$t("shai-xuan")), 1)
|
|
@@ -1040,7 +1048,7 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
1040
1048
|
}),
|
|
1041
1049
|
q(F, {
|
|
1042
1050
|
type: "primary",
|
|
1043
|
-
onClick:
|
|
1051
|
+
onClick: b
|
|
1044
1052
|
}, {
|
|
1045
1053
|
default: D(() => [
|
|
1046
1054
|
Q(J(h.$t("chong-zhi")), 1)
|
|
@@ -1137,13 +1145,13 @@ const wn = { class: "center" }, xn = {
|
|
|
1137
1145
|
}
|
|
1138
1146
|
},
|
|
1139
1147
|
setup(t, { expose: e }) {
|
|
1140
|
-
const { t: n, locale: a } = me(),
|
|
1148
|
+
const { t: n, locale: a } = me(), r = jt(), o = bn(), l = t, s = R(!1), i = R([]);
|
|
1141
1149
|
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
|
|
1143
|
-
const f =
|
|
1150
|
+
const v = re(() => {
|
|
1151
|
+
const f = r.path.replace(/\//g, "-").replace(/^-/, "") || "default-table";
|
|
1144
1152
|
return l.id ? `listPageId-${f}-${l.id}` : `listPageId-${f}`;
|
|
1145
|
-
}),
|
|
1146
|
-
[
|
|
1153
|
+
}), w = ct(l.searchForm.items), b = l.searchForm.pageNoKey || o.pageNoKey, p = l.searchForm.pageSizeKey || o.pageSizeKey, g = $e({
|
|
1154
|
+
[b]: 1,
|
|
1147
1155
|
[p]: l.searchForm.defaultPageSize || o.defaultPageSize,
|
|
1148
1156
|
total: 0
|
|
1149
1157
|
}), m = R(null), u = R(null), h = R(450), k = Re(() => {
|
|
@@ -1182,13 +1190,13 @@ const wn = { class: "center" }, xn = {
|
|
|
1182
1190
|
}
|
|
1183
1191
|
}
|
|
1184
1192
|
});
|
|
1185
|
-
const S =
|
|
1193
|
+
const S = re(() => ue.value.height || h.value);
|
|
1186
1194
|
let E;
|
|
1187
1195
|
async function Y(f) {
|
|
1188
1196
|
const { dataFormat: c } = l.tableConfig;
|
|
1189
|
-
f[
|
|
1197
|
+
f[b] != 1 && (f.nextSearchAfter = E), s.value = !0;
|
|
1190
1198
|
const { code: $, data: T = {} } = await l.api(f).finally(() => {
|
|
1191
|
-
|
|
1199
|
+
s.value = !1, l.searchForm.selections = [];
|
|
1192
1200
|
});
|
|
1193
1201
|
if ($ == 200) {
|
|
1194
1202
|
let U = [];
|
|
@@ -1203,7 +1211,7 @@ const wn = { class: "center" }, xn = {
|
|
|
1203
1211
|
W = T[M];
|
|
1204
1212
|
break;
|
|
1205
1213
|
}
|
|
1206
|
-
|
|
1214
|
+
i.value = c ? c(U) : U, g.total = W, E = T.nextSearchAfter, l.searchForm.enableCellCopy && Se(() => {
|
|
1207
1215
|
setTimeout(() => {
|
|
1208
1216
|
C();
|
|
1209
1217
|
}, 100);
|
|
@@ -1217,7 +1225,7 @@ const wn = { class: "center" }, xn = {
|
|
|
1217
1225
|
function d() {
|
|
1218
1226
|
const { reset: f } = l.tableConfig;
|
|
1219
1227
|
f && f(), l.searchForm.items.forEach((c) => {
|
|
1220
|
-
const $ =
|
|
1228
|
+
const $ = w.find((T) => Qe(c.key) && Qe(T.key) ? c.key.join(",") == T.key.join(",") : T.key == c.key);
|
|
1221
1229
|
$ && (c.value = $.value);
|
|
1222
1230
|
}), F();
|
|
1223
1231
|
}
|
|
@@ -1234,7 +1242,7 @@ const wn = { class: "center" }, xn = {
|
|
|
1234
1242
|
drag: !0,
|
|
1235
1243
|
resizable: !0,
|
|
1236
1244
|
maxFixedSize: 0
|
|
1237
|
-
}), ue =
|
|
1245
|
+
}), ue = re(() => {
|
|
1238
1246
|
const { customConfig: f, columnConfig: c, ...$ } = l.tableConfig;
|
|
1239
1247
|
return {
|
|
1240
1248
|
headerAlign: "left",
|
|
@@ -1250,7 +1258,7 @@ const wn = { class: "center" }, xn = {
|
|
|
1250
1258
|
"virtual-y-config": { enabled: !0, gt: 100 },
|
|
1251
1259
|
...$
|
|
1252
1260
|
};
|
|
1253
|
-
}),
|
|
1261
|
+
}), y = $e({
|
|
1254
1262
|
isSelecting: !1,
|
|
1255
1263
|
// 是否正在选择
|
|
1256
1264
|
startCell: null,
|
|
@@ -1301,22 +1309,22 @@ const wn = { class: "center" }, xn = {
|
|
|
1301
1309
|
Ie();
|
|
1302
1310
|
return;
|
|
1303
1311
|
}
|
|
1304
|
-
|
|
1312
|
+
y.isSelecting = !0, y.startCell = {
|
|
1305
1313
|
rowIndex: c.rowIndex,
|
|
1306
1314
|
colIndex: c.colIndex
|
|
1307
|
-
},
|
|
1315
|
+
}, y.endCell = { ...y.startCell }, Ke(), He();
|
|
1308
1316
|
}, pe = (f) => {
|
|
1309
|
-
if (!
|
|
1317
|
+
if (!y.isSelecting)
|
|
1310
1318
|
return;
|
|
1311
1319
|
const c = ge(f.target);
|
|
1312
|
-
c && (
|
|
1320
|
+
c && (y.endCell = {
|
|
1313
1321
|
rowIndex: c.rowIndex,
|
|
1314
1322
|
colIndex: c.colIndex
|
|
1315
1323
|
}, Ke(), He());
|
|
1316
1324
|
}, be = () => {
|
|
1317
|
-
|
|
1325
|
+
y.isSelecting = !1;
|
|
1318
1326
|
}, Ie = () => {
|
|
1319
|
-
|
|
1327
|
+
y.selectedCells = [], y.startCell = null, y.endCell = null;
|
|
1320
1328
|
const f = m.value;
|
|
1321
1329
|
if (!f)
|
|
1322
1330
|
return;
|
|
@@ -1332,15 +1340,15 @@ const wn = { class: "center" }, xn = {
|
|
|
1332
1340
|
);
|
|
1333
1341
|
});
|
|
1334
1342
|
}, Ke = () => {
|
|
1335
|
-
if (!
|
|
1336
|
-
|
|
1343
|
+
if (!y.startCell || !y.endCell) {
|
|
1344
|
+
y.selectedCells = [];
|
|
1337
1345
|
return;
|
|
1338
1346
|
}
|
|
1339
|
-
const f =
|
|
1340
|
-
|
|
1347
|
+
const f = y.startCell.rowIndex, c = y.endCell.rowIndex, $ = y.startCell.colIndex, T = y.endCell.colIndex, U = Math.min(f, c), W = Math.max(f, c), M = Math.min($, T), le = Math.max($, T);
|
|
1348
|
+
y.selectedCells = [];
|
|
1341
1349
|
for (let V = U; V <= W; V++)
|
|
1342
1350
|
for (let I = M; I <= le; I++)
|
|
1343
|
-
|
|
1351
|
+
y.selectedCells.push({
|
|
1344
1352
|
rowIndex: V,
|
|
1345
1353
|
colIndex: I
|
|
1346
1354
|
});
|
|
@@ -1360,14 +1368,14 @@ const wn = { class: "center" }, xn = {
|
|
|
1360
1368
|
"cell-border-bottom",
|
|
1361
1369
|
"cell-border-left"
|
|
1362
1370
|
);
|
|
1363
|
-
}),
|
|
1371
|
+
}), y.selectedCells.length === 0)
|
|
1364
1372
|
return;
|
|
1365
|
-
const $ = f.getColumns(), T =
|
|
1373
|
+
const $ = f.getColumns(), T = y.selectedCells.map((K) => K.rowIndex), U = y.selectedCells.map((K) => K.colIndex), W = Math.min(...T), M = Math.max(...T), le = Math.min(...U), V = Math.max(...U), I = [
|
|
1366
1374
|
c.querySelector(".vxe-table--body-wrapper tbody"),
|
|
1367
1375
|
c.querySelector(".vxe-table--fixed-left-wrapper tbody"),
|
|
1368
1376
|
c.querySelector(".vxe-table--fixed-right-wrapper tbody")
|
|
1369
1377
|
].filter(Boolean);
|
|
1370
|
-
|
|
1378
|
+
y.selectedCells.forEach(({ rowIndex: K, colIndex: Z }) => {
|
|
1371
1379
|
const P = $[Z];
|
|
1372
1380
|
if (!P)
|
|
1373
1381
|
return;
|
|
@@ -1396,14 +1404,14 @@ const wn = { class: "center" }, xn = {
|
|
|
1396
1404
|
});
|
|
1397
1405
|
});
|
|
1398
1406
|
}, wt = async () => {
|
|
1399
|
-
if (
|
|
1407
|
+
if (y.selectedCells.length === 0)
|
|
1400
1408
|
return;
|
|
1401
1409
|
const f = m.value;
|
|
1402
1410
|
if (!f)
|
|
1403
1411
|
return;
|
|
1404
|
-
const c = f.$el, $ = f.getColumns(), T = [...new Set(
|
|
1412
|
+
const c = f.$el, $ = f.getColumns(), T = [...new Set(y.selectedCells.map((V) => V.rowIndex))].sort(
|
|
1405
1413
|
(V, I) => V - I
|
|
1406
|
-
), U = [...new Set(
|
|
1414
|
+
), U = [...new Set(y.selectedCells.map((V) => V.colIndex))].sort(
|
|
1407
1415
|
(V, I) => V - I
|
|
1408
1416
|
), W = [
|
|
1409
1417
|
c.querySelector(".vxe-table--body-wrapper tbody"),
|
|
@@ -1452,18 +1460,18 @@ const wn = { class: "center" }, xn = {
|
|
|
1452
1460
|
console.error("复制失败:", V);
|
|
1453
1461
|
}
|
|
1454
1462
|
}, Le = (f) => {
|
|
1455
|
-
l.searchForm.enableCellCopy && ((f.ctrlKey || f.metaKey) && f.key === "c" ?
|
|
1463
|
+
l.searchForm.enableCellCopy && ((f.ctrlKey || f.metaKey) && f.key === "c" ? y.selectedCells.length > 0 && (f.preventDefault(), f.stopPropagation(), wt()) : f.key === "Escape" && Ie());
|
|
1456
1464
|
}, Ne = () => {
|
|
1457
|
-
|
|
1465
|
+
y.isSelecting = !1;
|
|
1458
1466
|
}, We = (f) => {
|
|
1459
1467
|
const c = m.value;
|
|
1460
1468
|
if (!c || !c.$el)
|
|
1461
1469
|
return;
|
|
1462
1470
|
c.$el.contains(f.target) || Ie();
|
|
1463
1471
|
}, xt = (f) => {
|
|
1464
|
-
g[
|
|
1472
|
+
g[b] = f, F();
|
|
1465
1473
|
}, Ct = (f) => {
|
|
1466
|
-
g[p] = f, g[
|
|
1474
|
+
g[p] = f, g[b] = 1, F();
|
|
1467
1475
|
};
|
|
1468
1476
|
function Ze() {
|
|
1469
1477
|
const f = m.value.getCheckboxRecords();
|
|
@@ -1480,7 +1488,7 @@ const wn = { class: "center" }, xn = {
|
|
|
1480
1488
|
return e({ tableRef: m, getList: F, getPrm: x, clearSort: O, calculateTableHeight: k }), (f, c) => {
|
|
1481
1489
|
var V;
|
|
1482
1490
|
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(),
|
|
1491
|
+
return L(), se("div", {
|
|
1484
1492
|
class: Ve({ box: t.searchForm.showShadow })
|
|
1485
1493
|
}, [
|
|
1486
1494
|
t.searchForm.showSearch ? (L(), B(vn, {
|
|
@@ -1512,11 +1520,11 @@ const wn = { class: "center" }, xn = {
|
|
|
1512
1520
|
ref: u
|
|
1513
1521
|
}, [
|
|
1514
1522
|
q(M, he({
|
|
1515
|
-
id:
|
|
1523
|
+
id: v.value,
|
|
1516
1524
|
ref_key: "tableRef",
|
|
1517
1525
|
ref: m,
|
|
1518
|
-
loading: t.loading ||
|
|
1519
|
-
data: t.api ?
|
|
1526
|
+
loading: t.loading || s.value,
|
|
1527
|
+
data: t.api ? i.value : t.data,
|
|
1520
1528
|
border: ""
|
|
1521
1529
|
}, ue.value, {
|
|
1522
1530
|
height: S.value,
|
|
@@ -1567,8 +1575,8 @@ const wn = { class: "center" }, xn = {
|
|
|
1567
1575
|
], 512),
|
|
1568
1576
|
t.searchForm.showPage ? (L(), B(le, {
|
|
1569
1577
|
key: 1,
|
|
1570
|
-
"current-page": g[H(
|
|
1571
|
-
"onUpdate:currentPage": c[2] || (c[2] = (I) => g[H(
|
|
1578
|
+
"current-page": g[H(b)],
|
|
1579
|
+
"onUpdate:currentPage": c[2] || (c[2] = (I) => g[H(b)] = I),
|
|
1572
1580
|
class: "myPagination mgt10",
|
|
1573
1581
|
background: "",
|
|
1574
1582
|
layout: "total, sizes, prev, pager, next",
|
|
@@ -1598,7 +1606,7 @@ const wn = { class: "center" }, xn = {
|
|
|
1598
1606
|
function n() {
|
|
1599
1607
|
nn(e.fileName, e.sheetsConfig);
|
|
1600
1608
|
}
|
|
1601
|
-
return (a,
|
|
1609
|
+
return (a, r) => {
|
|
1602
1610
|
const o = z("el-link");
|
|
1603
1611
|
return L(), B(o, he({
|
|
1604
1612
|
type: "primary",
|
|
@@ -1629,7 +1637,7 @@ async function tt(t) {
|
|
|
1629
1637
|
return;
|
|
1630
1638
|
const n = t.querySelector(".el-dialog__header"), a = t.querySelector(".el-overlay");
|
|
1631
1639
|
a.style.cssText += "overflow: hidden;", n.style.cursor = "move";
|
|
1632
|
-
let
|
|
1640
|
+
let r = !1, o = {
|
|
1633
1641
|
// 数据源,不变部分为:window信息、dialog信息、mouse初始值信息,可变部分为:拖拽坐标位移
|
|
1634
1642
|
window: {
|
|
1635
1643
|
// window信息
|
|
@@ -1655,33 +1663,33 @@ async function tt(t) {
|
|
|
1655
1663
|
y: 0
|
|
1656
1664
|
}
|
|
1657
1665
|
};
|
|
1658
|
-
n.addEventListener("mousedown",
|
|
1666
|
+
n.addEventListener("mousedown", i), document.addEventListener("mousemove", v), document.addEventListener("mouseup", w), window.addEventListener("resize", b);
|
|
1659
1667
|
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),
|
|
1668
|
+
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), s();
|
|
1661
1669
|
}
|
|
1662
|
-
function
|
|
1670
|
+
function s() {
|
|
1663
1671
|
let g = o.drag.y - o.mouse.y + o.dialog.y, m = o.drag.x - o.mouse.x + o.dialog.x;
|
|
1664
1672
|
e.style.cssText += `position: absolute; top: calc(${g}px - ${o.dialog.marginTop}); left: ${m}px;`;
|
|
1665
1673
|
}
|
|
1666
|
-
function
|
|
1674
|
+
function i(g) {
|
|
1667
1675
|
g.button === 0 && (o.window = {
|
|
1668
1676
|
width: document.body.clientWidth,
|
|
1669
1677
|
height: document.body.clientHeight
|
|
1670
1678
|
}, o.dialog = e.getBoundingClientRect(), o.dialog.marginTop = window.getComputedStyle(e).marginTop, o.mouse = {
|
|
1671
1679
|
x: g.clientX,
|
|
1672
1680
|
y: g.clientY
|
|
1673
|
-
},
|
|
1681
|
+
}, r = !0);
|
|
1674
1682
|
}
|
|
1675
|
-
function
|
|
1676
|
-
|
|
1683
|
+
function v(g) {
|
|
1684
|
+
r && (o.drag = {
|
|
1677
1685
|
x: g.clientX,
|
|
1678
1686
|
y: g.clientY
|
|
1679
1687
|
}, a.style.userSelect = "none", l());
|
|
1680
1688
|
}
|
|
1681
|
-
function b(g) {
|
|
1682
|
-
a.style.userSelect = "auto", s = !1;
|
|
1683
|
-
}
|
|
1684
1689
|
function w(g) {
|
|
1690
|
+
a.style.userSelect = "auto", r = !1;
|
|
1691
|
+
}
|
|
1692
|
+
function b(g) {
|
|
1685
1693
|
}
|
|
1686
1694
|
function p() {
|
|
1687
1695
|
return new Promise((g, m) => {
|
|
@@ -1690,7 +1698,7 @@ async function tt(t) {
|
|
|
1690
1698
|
}, 500);
|
|
1691
1699
|
});
|
|
1692
1700
|
}
|
|
1693
|
-
t.__mouseDown__ =
|
|
1701
|
+
t.__mouseDown__ = i, t.__mouseUp__ = w, t.__mouseMove__ = v, t.__sizeChange__ = b;
|
|
1694
1702
|
}
|
|
1695
1703
|
function nt(t) {
|
|
1696
1704
|
document.removeEventListener("mousedown", t.__mouseDown__), document.removeEventListener("mousemove", t.__mouseMove__), document.removeEventListener("mouseup", t.__mouseUp__), window.removeEventListener("resize", t.__sizeChange__);
|
|
@@ -1718,23 +1726,23 @@ const kn = {
|
|
|
1718
1726
|
},
|
|
1719
1727
|
emits: ["confirm"],
|
|
1720
1728
|
setup(t, { emit: e }) {
|
|
1721
|
-
const n = t, a = e, { t:
|
|
1729
|
+
const n = t, a = e, { t: r } = me(), o = Re(() => {
|
|
1722
1730
|
a("confirm");
|
|
1723
1731
|
}, 300);
|
|
1724
1732
|
async function l() {
|
|
1725
|
-
n.layer.type == "drawer" ? n.layer.onClose ? n.layer.onClose() : await Et.confirm(
|
|
1726
|
-
confirmButtonText:
|
|
1727
|
-
cancelButtonText:
|
|
1733
|
+
n.layer.type == "drawer" ? n.layer.onClose ? n.layer.onClose() : await Et.confirm(r("que-ding-guan-bi-ma"), {
|
|
1734
|
+
confirmButtonText: r("que-ding"),
|
|
1735
|
+
cancelButtonText: r("qu-xiao"),
|
|
1728
1736
|
type: "warning"
|
|
1729
1737
|
}).catch(() => {
|
|
1730
1738
|
}) == "confirm" && (n.layer.show = !1) : n.layer.show = !1;
|
|
1731
1739
|
}
|
|
1732
|
-
return (
|
|
1733
|
-
const
|
|
1734
|
-
return t.layer.type ? (L(), B(
|
|
1740
|
+
return (s, i) => {
|
|
1741
|
+
const v = z("el-button"), w = z("el-drawer"), b = z("el-dialog");
|
|
1742
|
+
return t.layer.type ? (L(), B(w, {
|
|
1735
1743
|
key: 0,
|
|
1736
1744
|
modelValue: t.layer.show,
|
|
1737
|
-
"onUpdate:modelValue":
|
|
1745
|
+
"onUpdate:modelValue": i[0] || (i[0] = (p) => t.layer.show = p),
|
|
1738
1746
|
size: t.layer.width || "100%",
|
|
1739
1747
|
title: t.layer.title,
|
|
1740
1748
|
direction: "rtl",
|
|
@@ -1743,23 +1751,23 @@ const kn = {
|
|
|
1743
1751
|
class: "drawer-content"
|
|
1744
1752
|
}, {
|
|
1745
1753
|
default: D(() => [
|
|
1746
|
-
X(
|
|
1747
|
-
|
|
1748
|
-
t.layer.showButton ? (L(),
|
|
1749
|
-
X(
|
|
1750
|
-
q(
|
|
1754
|
+
X(s.$slots, "default"),
|
|
1755
|
+
i[2] || (i[2] = ae("p", { class: "mgt50" }, null, -1)),
|
|
1756
|
+
t.layer.showButton ? (L(), se("div", kn, [
|
|
1757
|
+
X(s.$slots, "btn", {}, () => [
|
|
1758
|
+
q(v, { onClick: l }, {
|
|
1751
1759
|
default: D(() => [
|
|
1752
|
-
Q(J(
|
|
1760
|
+
Q(J(s.$t("qu-xiao")), 1)
|
|
1753
1761
|
]),
|
|
1754
1762
|
_: 1
|
|
1755
1763
|
}),
|
|
1756
|
-
q(
|
|
1764
|
+
q(v, {
|
|
1757
1765
|
type: "primary",
|
|
1758
1766
|
loading: t.loading,
|
|
1759
1767
|
onClick: H(o)
|
|
1760
1768
|
}, {
|
|
1761
1769
|
default: D(() => [
|
|
1762
|
-
Q(J(
|
|
1770
|
+
Q(J(s.$t("ti-jiao")), 1)
|
|
1763
1771
|
]),
|
|
1764
1772
|
_: 1
|
|
1765
1773
|
}, 8, ["loading", "onClick"])
|
|
@@ -1767,36 +1775,36 @@ const kn = {
|
|
|
1767
1775
|
])) : ce("", !0)
|
|
1768
1776
|
]),
|
|
1769
1777
|
_: 3
|
|
1770
|
-
}, 8, ["modelValue", "size", "title"])) : Vt((L(),
|
|
1771
|
-
q(
|
|
1778
|
+
}, 8, ["modelValue", "size", "title"])) : Vt((L(), se("div", _n, [
|
|
1779
|
+
q(b, {
|
|
1772
1780
|
"close-on-click-modal": !1,
|
|
1773
1781
|
modelValue: t.layer.show,
|
|
1774
|
-
"onUpdate:modelValue":
|
|
1782
|
+
"onUpdate:modelValue": i[1] || (i[1] = (p) => t.layer.show = p),
|
|
1775
1783
|
title: t.layer.title,
|
|
1776
1784
|
width: t.layer.width || 500,
|
|
1777
1785
|
center: ""
|
|
1778
1786
|
}, at({
|
|
1779
1787
|
default: D(() => [
|
|
1780
|
-
X(
|
|
1788
|
+
X(s.$slots, "default")
|
|
1781
1789
|
]),
|
|
1782
1790
|
_: 2
|
|
1783
1791
|
}, [
|
|
1784
1792
|
t.layer.showButton ? {
|
|
1785
1793
|
name: "footer",
|
|
1786
1794
|
fn: D(() => [
|
|
1787
|
-
X(
|
|
1788
|
-
q(
|
|
1795
|
+
X(s.$slots, "btn", {}, () => [
|
|
1796
|
+
q(v, { onClick: l }, {
|
|
1789
1797
|
default: D(() => [
|
|
1790
|
-
Q(J(
|
|
1798
|
+
Q(J(s.$t("qu-xiao")), 1)
|
|
1791
1799
|
]),
|
|
1792
1800
|
_: 1
|
|
1793
1801
|
}),
|
|
1794
|
-
q(
|
|
1802
|
+
q(v, {
|
|
1795
1803
|
type: "primary",
|
|
1796
1804
|
onClick: H(o)
|
|
1797
1805
|
}, {
|
|
1798
1806
|
default: D(() => [
|
|
1799
|
-
Q(J(
|
|
1807
|
+
Q(J(s.$t("ti-jiao")), 1)
|
|
1800
1808
|
]),
|
|
1801
1809
|
_: 1
|
|
1802
1810
|
}, 8, ["onClick"])
|
|
@@ -1816,18 +1824,18 @@ function no(t, e = {}) {
|
|
|
1816
1824
|
inForm: !0,
|
|
1817
1825
|
required: !0,
|
|
1818
1826
|
...e
|
|
1819
|
-
},
|
|
1827
|
+
}, r = {
|
|
1820
1828
|
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}$/,
|
|
1821
1829
|
password: /(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/,
|
|
1822
1830
|
email: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
|
|
1823
|
-
}[t], { inForm: o, value: l, required:
|
|
1824
|
-
return o ? function(
|
|
1825
|
-
if (
|
|
1826
|
-
|
|
1831
|
+
}[t], { inForm: o, value: l, required: s, msg: i = n("validate.invalidInput") } = a;
|
|
1832
|
+
return o ? function(v, w, b) {
|
|
1833
|
+
if (s) {
|
|
1834
|
+
r.test(w) ? b() : b(new Error(i));
|
|
1827
1835
|
return;
|
|
1828
1836
|
}
|
|
1829
|
-
|
|
1830
|
-
} :
|
|
1837
|
+
w && !r.test(w) ? b(new Error(i)) : b();
|
|
1838
|
+
} : r.test(l);
|
|
1831
1839
|
}
|
|
1832
1840
|
class oo {
|
|
1833
1841
|
constructor(e = {}) {
|
|
@@ -1976,10 +1984,10 @@ class oo {
|
|
|
1976
1984
|
};
|
|
1977
1985
|
a.headers.appId = this.config.clientCode, this.token && (a.headers.Authorization = `Bearer ${this.token}`);
|
|
1978
1986
|
try {
|
|
1979
|
-
const
|
|
1980
|
-
return
|
|
1981
|
-
} catch (
|
|
1982
|
-
throw this.log("请求失败:",
|
|
1987
|
+
const r = await fetch(e, a);
|
|
1988
|
+
return r.status === 401 ? (this.log("Token已过期,需要重新登录"), this.logout(), null) : r;
|
|
1989
|
+
} catch (r) {
|
|
1990
|
+
throw this.log("请求失败:", r), r;
|
|
1983
1991
|
}
|
|
1984
1992
|
}
|
|
1985
1993
|
/**
|
|
@@ -2042,38 +2050,38 @@ function lo(t, e = {}) {
|
|
|
2042
2050
|
log: !1,
|
|
2043
2051
|
params: null,
|
|
2044
2052
|
format: null
|
|
2045
|
-
}, e), { manual:
|
|
2053
|
+
}, e), { manual: r, log: o, params: l = {}, cb: s, format: i } = a, v = R([]), w = R(!1), b = (p) => {
|
|
2046
2054
|
const g = p || l;
|
|
2047
|
-
|
|
2055
|
+
w.value = !0, t(g).then((m) => {
|
|
2048
2056
|
const { code: u, data: h, msg: k } = m;
|
|
2049
|
-
if (
|
|
2057
|
+
if (s) {
|
|
2050
2058
|
const { records: _, rows: C } = h || {}, S = _ || C ? _ || C : h;
|
|
2051
|
-
|
|
2059
|
+
v.value = De(S, i), s(m);
|
|
2052
2060
|
}
|
|
2053
2061
|
if (h) {
|
|
2054
2062
|
if (h.records != null || h.rows != null) {
|
|
2055
2063
|
const { records: _, rows: C, total: S = 0 } = h || {};
|
|
2056
|
-
g && g.total != null && (l.total = parseInt(S)),
|
|
2064
|
+
g && g.total != null && (l.total = parseInt(S)), v.value = De(_ || C || [], i);
|
|
2057
2065
|
} else
|
|
2058
|
-
|
|
2059
|
-
o && console.log("useRequest-res",
|
|
2066
|
+
v.value = De(h, i);
|
|
2067
|
+
o && console.log("useRequest-res", v.value);
|
|
2060
2068
|
}
|
|
2061
2069
|
}).catch((m) => {
|
|
2062
|
-
|
|
2070
|
+
s && (console.log("useRequestErr", m), s({ code: 500 }));
|
|
2063
2071
|
}).finally(() => {
|
|
2064
|
-
|
|
2072
|
+
w.value = !1;
|
|
2065
2073
|
});
|
|
2066
2074
|
};
|
|
2067
|
-
return
|
|
2075
|
+
return r || b(), [w, v, b];
|
|
2068
2076
|
}
|
|
2069
2077
|
function ao(t) {
|
|
2070
2078
|
const e = R(t), n = R(""), a = R("");
|
|
2071
|
-
return Pe(e, (
|
|
2072
|
-
const o =
|
|
2079
|
+
return Pe(e, (r) => {
|
|
2080
|
+
const o = r || ["", ""];
|
|
2073
2081
|
n.value = o[0], a.value = o[1];
|
|
2074
2082
|
}), [e, n, a];
|
|
2075
2083
|
}
|
|
2076
|
-
function
|
|
2084
|
+
function ro(t) {
|
|
2077
2085
|
return Object.prototype.toString.call(t).slice(8, -1).toLowerCase();
|
|
2078
2086
|
}
|
|
2079
2087
|
function De(t, e) {
|
|
@@ -2081,13 +2089,13 @@ function De(t, e) {
|
|
|
2081
2089
|
return t;
|
|
2082
2090
|
if (t instanceof Array)
|
|
2083
2091
|
return t.map((a) => {
|
|
2084
|
-
let
|
|
2085
|
-
return e.forEach((o) =>
|
|
2092
|
+
let r = {};
|
|
2093
|
+
return e.forEach((o) => r[o] = a[o]), r;
|
|
2086
2094
|
});
|
|
2087
2095
|
let n = {};
|
|
2088
2096
|
return e.forEach((a) => n[a] = t[a]), n;
|
|
2089
2097
|
}
|
|
2090
|
-
function
|
|
2098
|
+
function so(t, e = []) {
|
|
2091
2099
|
const { locale: n } = me(), a = R(t());
|
|
2092
2100
|
return Pe(
|
|
2093
2101
|
[n, ...e],
|
|
@@ -2116,17 +2124,17 @@ function fo(t, e) {
|
|
|
2116
2124
|
return typeof t == "string" && t.length > 0 && (n = Be(t).mapActions), $n(e, n);
|
|
2117
2125
|
}
|
|
2118
2126
|
function bt(t, e) {
|
|
2119
|
-
const n = ut(), a = e(t),
|
|
2127
|
+
const n = ut(), a = e(t), r = {};
|
|
2120
2128
|
return Object.keys(a).forEach((o) => {
|
|
2121
2129
|
const l = a[o].bind({ $store: n });
|
|
2122
|
-
|
|
2123
|
-
}),
|
|
2130
|
+
r[o] = re(l);
|
|
2131
|
+
}), r;
|
|
2124
2132
|
}
|
|
2125
2133
|
function $n(t, e) {
|
|
2126
|
-
const n = ut(), a = e(t),
|
|
2134
|
+
const n = ut(), a = e(t), r = {};
|
|
2127
2135
|
return Object.keys(a).forEach((o) => {
|
|
2128
|
-
|
|
2129
|
-
}),
|
|
2136
|
+
r[o] = a[o].bind({ $store: n });
|
|
2137
|
+
}), r;
|
|
2130
2138
|
}
|
|
2131
2139
|
function ze(t) {
|
|
2132
2140
|
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !qt(t);
|
|
@@ -2140,11 +2148,11 @@ function ho() {
|
|
|
2140
2148
|
return "-";
|
|
2141
2149
|
const a = e.row[e.column.field];
|
|
2142
2150
|
if (t.type == "tag") {
|
|
2143
|
-
let
|
|
2151
|
+
let r;
|
|
2144
2152
|
return q(z("el-text"), {
|
|
2145
2153
|
type: t.enum.getTag(a)
|
|
2146
|
-
}, ze(
|
|
2147
|
-
default: () => [
|
|
2154
|
+
}, ze(r = t.enum.getName(a)) ? r : {
|
|
2155
|
+
default: () => [r]
|
|
2148
2156
|
});
|
|
2149
2157
|
}
|
|
2150
2158
|
return q(z("el-text"), null, ze(n = t.enum.getName(a)) ? n : {
|
|
@@ -2187,13 +2195,13 @@ function ho() {
|
|
|
2187
2195
|
}), xe.renderer.add("Link", {
|
|
2188
2196
|
// 默认显示模板
|
|
2189
2197
|
renderTableDefault(t, e) {
|
|
2190
|
-
var
|
|
2198
|
+
var s;
|
|
2191
2199
|
let n = e.column.field;
|
|
2192
2200
|
const a = Ut(), {
|
|
2193
|
-
multiple:
|
|
2201
|
+
multiple: r,
|
|
2194
2202
|
to: o
|
|
2195
2203
|
} = t;
|
|
2196
|
-
if (!
|
|
2204
|
+
if (!r)
|
|
2197
2205
|
return q(Je, {
|
|
2198
2206
|
underline: "never",
|
|
2199
2207
|
type: "primary",
|
|
@@ -2206,24 +2214,24 @@ function ho() {
|
|
|
2206
2214
|
}, {
|
|
2207
2215
|
default: () => [e.row[n]]
|
|
2208
2216
|
});
|
|
2209
|
-
const l = ((
|
|
2210
|
-
return l.map((
|
|
2217
|
+
const l = ((s = e.row[n]) == null ? void 0 : s.split(",")) || [];
|
|
2218
|
+
return l.map((i, v) => q("span", null, [q(Je, {
|
|
2211
2219
|
underline: "never",
|
|
2212
2220
|
type: "primary",
|
|
2213
2221
|
onclick: () => a.push({
|
|
2214
2222
|
path: o,
|
|
2215
2223
|
query: {
|
|
2216
|
-
[n]:
|
|
2224
|
+
[n]: i
|
|
2217
2225
|
}
|
|
2218
2226
|
})
|
|
2219
|
-
}, ze(
|
|
2220
|
-
default: () => [
|
|
2221
|
-
}),
|
|
2227
|
+
}, ze(i) ? i : {
|
|
2228
|
+
default: () => [i]
|
|
2229
|
+
}), v < l.length - 1 ? "," : ""]));
|
|
2222
2230
|
}
|
|
2223
2231
|
});
|
|
2224
2232
|
}
|
|
2225
2233
|
export {
|
|
2226
|
-
|
|
2234
|
+
sn as CmpDictionary,
|
|
2227
2235
|
yt as CmpIcon,
|
|
2228
2236
|
Zn as ConfrimButton,
|
|
2229
2237
|
eo as DownExcelTemp,
|
|
@@ -2235,7 +2243,7 @@ export {
|
|
|
2235
2243
|
vn as SearchBar,
|
|
2236
2244
|
et as StatusMap,
|
|
2237
2245
|
Un as _toRaw,
|
|
2238
|
-
|
|
2246
|
+
ro as _typeOf,
|
|
2239
2247
|
Rn as arrToStatusMap,
|
|
2240
2248
|
Pn as arrayToTree,
|
|
2241
2249
|
Kn as checkFileSize,
|
|
@@ -2262,7 +2270,7 @@ export {
|
|
|
2262
2270
|
fo as useActions,
|
|
2263
2271
|
ao as useDatePicker,
|
|
2264
2272
|
uo as useGetters,
|
|
2265
|
-
|
|
2273
|
+
so as useI18nReState,
|
|
2266
2274
|
lo as useRequest,
|
|
2267
2275
|
co as useState,
|
|
2268
2276
|
qe as zh_cn
|