joy-admin-components 0.2.47 → 0.2.49
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,11 +1,11 @@
|
|
|
1
|
-
import { ElForm as _t, ElRow as $t, ElCol as St, ElMessageBox as Et, ElInputNumber as
|
|
2
|
-
import { defineComponent as nt, ref as P, onMounted as ot, h as ze, mergeModels as Je, useAttrs as Lt, useModel as Tt, computed as ce, watch as Pe, resolveComponent as O, unref as H, openBlock as L, createBlock as N, mergeProps as ue, createSlots as lt, withCtx as D, createElementVNode as re, toDisplayString as ee, renderSlot as Q, createVNode as M, createTextVNode as ne, createCommentVNode as fe, createElementBlock as ie, Fragment as Oe, renderList as at, withModifiers as Ve, nextTick as we, resolveDynamicComponent as st, withKeys as Dt, normalizeStyle as zt, normalizeClass as rt, reactive as
|
|
1
|
+
import { ElForm as _t, ElRow as $t, ElCol as St, ElMessageBox as Et, ElInputNumber as Ft, ElText as It, ElLink as Ge } from "element-plus";
|
|
2
|
+
import { defineComponent as nt, ref as P, onMounted as ot, h as ze, mergeModels as Je, useAttrs as Lt, useModel as Tt, computed as ce, watch as Pe, resolveComponent as O, unref as H, openBlock as L, createBlock as N, mergeProps as ue, createSlots as lt, withCtx as D, createElementVNode as re, toDisplayString as ee, renderSlot as Q, createVNode as M, createTextVNode as ne, createCommentVNode as fe, createElementBlock as ie, Fragment as Oe, renderList as at, withModifiers as Ve, nextTick as we, resolveDynamicComponent as st, withKeys as Dt, normalizeStyle as zt, normalizeClass as rt, reactive as Fe, onUpdated as Mt, onUnmounted as Ot, withDirectives as Vt, isVNode as qt } from "vue";
|
|
3
3
|
import { saveAs as it } from "file-saver";
|
|
4
4
|
import Le from "exceljs";
|
|
5
5
|
import $e from "dayjs";
|
|
6
6
|
import { createI18n as At, useI18n as pe } from "vue-i18n";
|
|
7
7
|
import { debounce as Re, cloneDeep as ct, isArray as Xe } from "lodash";
|
|
8
|
-
import { useRoute as
|
|
8
|
+
import { useRoute as Ut, useRouter as jt } from "vue-router";
|
|
9
9
|
import { createNamespacedHelpers as Be, useStore as ut, mapState as Pt, mapGetters as Rt, mapActions as Bt } from "vuex";
|
|
10
10
|
import { VxeUI as ke } from "vxe-pc-ui";
|
|
11
11
|
const qn = nt({
|
|
@@ -48,57 +48,57 @@ var ht = { exports: {} };
|
|
|
48
48
|
var n = "minute", a = /[+-]\d\d(?::?\d\d)?/g, s = /([+-]|\d\d)/g;
|
|
49
49
|
return function(o, l, r) {
|
|
50
50
|
var i = l.prototype;
|
|
51
|
-
r.utc = function(
|
|
52
|
-
var p = { date:
|
|
51
|
+
r.utc = function(c) {
|
|
52
|
+
var p = { date: c, utc: !0, args: arguments };
|
|
53
53
|
return new l(p);
|
|
54
|
-
}, i.utc = function(
|
|
54
|
+
}, i.utc = function(c) {
|
|
55
55
|
var p = r(this.toDate(), { locale: this.$L, utc: !0 });
|
|
56
|
-
return
|
|
56
|
+
return c ? p.add(this.utcOffset(), n) : p;
|
|
57
57
|
}, i.local = function() {
|
|
58
58
|
return r(this.toDate(), { locale: this.$L, utc: !1 });
|
|
59
59
|
};
|
|
60
60
|
var y = i.parse;
|
|
61
|
-
i.parse = function(
|
|
62
|
-
|
|
61
|
+
i.parse = function(c) {
|
|
62
|
+
c.utc && (this.$u = !0), this.$utils().u(c.$offset) || (this.$offset = c.$offset), y.call(this, c);
|
|
63
63
|
};
|
|
64
64
|
var m = i.init;
|
|
65
65
|
i.init = function() {
|
|
66
66
|
if (this.$u) {
|
|
67
|
-
var
|
|
68
|
-
this.$y =
|
|
67
|
+
var c = this.$d;
|
|
68
|
+
this.$y = c.getUTCFullYear(), this.$M = c.getUTCMonth(), this.$D = c.getUTCDate(), this.$W = c.getUTCDay(), this.$H = c.getUTCHours(), this.$m = c.getUTCMinutes(), this.$s = c.getUTCSeconds(), this.$ms = c.getUTCMilliseconds();
|
|
69
69
|
} else
|
|
70
70
|
m.call(this);
|
|
71
71
|
};
|
|
72
72
|
var v = i.utcOffset;
|
|
73
|
-
i.utcOffset = function(
|
|
73
|
+
i.utcOffset = function(c, p) {
|
|
74
74
|
var b = this.$utils().u;
|
|
75
|
-
if (b(
|
|
75
|
+
if (b(c))
|
|
76
76
|
return this.$u ? 0 : b(this.$offset) ? v.call(this) : this.$offset;
|
|
77
|
-
if (typeof
|
|
77
|
+
if (typeof c == "string" && (c = function(V) {
|
|
78
78
|
V === void 0 && (V = "");
|
|
79
79
|
var Y = V.match(a);
|
|
80
80
|
if (!Y)
|
|
81
81
|
return null;
|
|
82
|
-
var
|
|
82
|
+
var F = ("" + Y[0]).match(s) || ["-", 0, 0], G = F[0], _ = 60 * +F[1] + +F[2];
|
|
83
83
|
return _ === 0 ? 0 : G === "+" ? _ : -_;
|
|
84
|
-
}(
|
|
84
|
+
}(c), c === null))
|
|
85
85
|
return this;
|
|
86
|
-
var
|
|
87
|
-
if (
|
|
86
|
+
var x = Math.abs(c) <= 16 ? 60 * c : c;
|
|
87
|
+
if (x === 0)
|
|
88
88
|
return this.utc(p);
|
|
89
|
-
var
|
|
89
|
+
var w = this.clone();
|
|
90
90
|
if (p)
|
|
91
|
-
return
|
|
91
|
+
return w.$offset = x, w.$u = !1, w;
|
|
92
92
|
var E = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
|
|
93
|
-
return (
|
|
93
|
+
return (w = this.local().add(x + E, n)).$offset = x, w.$x.$localOffset = E, w;
|
|
94
94
|
};
|
|
95
95
|
var g = i.format;
|
|
96
|
-
i.format = function(
|
|
97
|
-
var p =
|
|
96
|
+
i.format = function(c) {
|
|
97
|
+
var p = c || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
|
|
98
98
|
return g.call(this, p);
|
|
99
99
|
}, i.valueOf = function() {
|
|
100
|
-
var
|
|
101
|
-
return this.$d.valueOf() - 6e4 *
|
|
100
|
+
var c = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
|
|
101
|
+
return this.$d.valueOf() - 6e4 * c;
|
|
102
102
|
}, i.isUTC = function() {
|
|
103
103
|
return !!this.$u;
|
|
104
104
|
}, i.toISOString = function() {
|
|
@@ -107,15 +107,15 @@ var ht = { exports: {} };
|
|
|
107
107
|
return this.toDate().toUTCString();
|
|
108
108
|
};
|
|
109
109
|
var h = i.toDate;
|
|
110
|
-
i.toDate = function(
|
|
111
|
-
return
|
|
110
|
+
i.toDate = function(c) {
|
|
111
|
+
return c === "s" && this.$offset ? r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : h.call(this);
|
|
112
112
|
};
|
|
113
113
|
var f = i.diff;
|
|
114
|
-
i.diff = function(
|
|
115
|
-
if (
|
|
116
|
-
return f.call(this,
|
|
117
|
-
var
|
|
118
|
-
return f.call(
|
|
114
|
+
i.diff = function(c, p, b) {
|
|
115
|
+
if (c && this.$u === c.$u)
|
|
116
|
+
return f.call(this, c, p, b);
|
|
117
|
+
var x = this.local(), w = r(c).local();
|
|
118
|
+
return f.call(x, w, p, b);
|
|
119
119
|
};
|
|
120
120
|
};
|
|
121
121
|
});
|
|
@@ -131,33 +131,33 @@ var mt = { exports: {} };
|
|
|
131
131
|
return function(s, o, l) {
|
|
132
132
|
var r, i = function(g, h, f) {
|
|
133
133
|
f === void 0 && (f = {});
|
|
134
|
-
var
|
|
135
|
-
|
|
136
|
-
var
|
|
137
|
-
return V || (V = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: b, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName:
|
|
134
|
+
var c = new Date(g), p = function(b, x) {
|
|
135
|
+
x === void 0 && (x = {});
|
|
136
|
+
var w = x.timeZoneName || "short", E = b + "|" + w, V = a[E];
|
|
137
|
+
return V || (V = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: b, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: w }), a[E] = V), V;
|
|
138
138
|
}(h, f);
|
|
139
|
-
return p.formatToParts(
|
|
139
|
+
return p.formatToParts(c);
|
|
140
140
|
}, y = function(g, h) {
|
|
141
|
-
for (var f = i(g, h),
|
|
142
|
-
var b = f[p],
|
|
143
|
-
E >= 0 && (
|
|
141
|
+
for (var f = i(g, h), c = [], p = 0; p < f.length; p += 1) {
|
|
142
|
+
var b = f[p], x = b.type, w = b.value, E = n[x];
|
|
143
|
+
E >= 0 && (c[E] = parseInt(w, 10));
|
|
144
144
|
}
|
|
145
|
-
var V =
|
|
146
|
-
return (l.utc(
|
|
145
|
+
var V = c[3], Y = V === 24 ? 0 : V, F = c[0] + "-" + c[1] + "-" + c[2] + " " + Y + ":" + c[4] + ":" + c[5] + ":000", G = +g;
|
|
146
|
+
return (l.utc(F).valueOf() - (G -= G % 1e3)) / 6e4;
|
|
147
147
|
}, m = o.prototype;
|
|
148
148
|
m.tz = function(g, h) {
|
|
149
149
|
g === void 0 && (g = r);
|
|
150
|
-
var f,
|
|
151
|
-
if (!Number(
|
|
150
|
+
var f, c = this.utcOffset(), p = this.toDate(), b = p.toLocaleString("en-US", { timeZone: g }), x = Math.round((p - new Date(b)) / 1e3 / 60), w = 15 * -Math.round(p.getTimezoneOffset() / 15) - x;
|
|
151
|
+
if (!Number(w))
|
|
152
152
|
f = this.utcOffset(0, h);
|
|
153
|
-
else if (f = l(b, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(
|
|
153
|
+
else if (f = l(b, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(w, !0), h) {
|
|
154
154
|
var E = f.utcOffset();
|
|
155
|
-
f = f.add(
|
|
155
|
+
f = f.add(c - E, "minute");
|
|
156
156
|
}
|
|
157
157
|
return f.$x.$timezone = g, f;
|
|
158
158
|
}, m.offsetName = function(g) {
|
|
159
|
-
var h = this.$x.$timezone || l.tz.guess(), f = i(this.valueOf(), h, { timeZoneName: g }).find(function(
|
|
160
|
-
return
|
|
159
|
+
var h = this.$x.$timezone || l.tz.guess(), f = i(this.valueOf(), h, { timeZoneName: g }).find(function(c) {
|
|
160
|
+
return c.type.toLowerCase() === "timezonename";
|
|
161
161
|
});
|
|
162
162
|
return f && f.value;
|
|
163
163
|
};
|
|
@@ -168,16 +168,16 @@ var mt = { exports: {} };
|
|
|
168
168
|
var f = l(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
|
|
169
169
|
return v.call(f, g, h).tz(this.$x.$timezone, !0);
|
|
170
170
|
}, l.tz = function(g, h, f) {
|
|
171
|
-
var
|
|
171
|
+
var c = f && h, p = f || h || r, b = y(+l(), p);
|
|
172
172
|
if (typeof g != "string")
|
|
173
173
|
return l(g).tz(p);
|
|
174
|
-
var
|
|
175
|
-
var _ = Y - 60 *
|
|
176
|
-
if (
|
|
177
|
-
return [_,
|
|
178
|
-
var k = y(_ -= 60 * (
|
|
179
|
-
return
|
|
180
|
-
}(l.utc(g,
|
|
174
|
+
var x = function(Y, F, G) {
|
|
175
|
+
var _ = Y - 60 * F * 1e3, C = y(_, G);
|
|
176
|
+
if (F === C)
|
|
177
|
+
return [_, F];
|
|
178
|
+
var k = y(_ -= 60 * (C - F) * 1e3, G);
|
|
179
|
+
return C === k ? [_, C] : [Y - 60 * Math.min(C, k) * 1e3, Math.max(C, k)];
|
|
180
|
+
}(l.utc(g, c).valueOf(), b, p), w = x[0], E = x[1], V = l(w).utcOffset(E);
|
|
181
181
|
return V.$x.$timezone = p, V;
|
|
182
182
|
}, l.tz.guess = function() {
|
|
183
183
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
@@ -308,7 +308,7 @@ async function An(e, t) {
|
|
|
308
308
|
const gt = {
|
|
309
309
|
columnWidth: 30
|
|
310
310
|
};
|
|
311
|
-
async function
|
|
311
|
+
async function Un(e, t, n = [], a = {}) {
|
|
312
312
|
if (!e || !t)
|
|
313
313
|
return;
|
|
314
314
|
const { columnStyle: s } = a, { columnWidth: o } = gt;
|
|
@@ -388,7 +388,7 @@ function en(e, t = 1) {
|
|
|
388
388
|
};
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
|
-
const
|
|
391
|
+
const Ue = "---";
|
|
392
392
|
async function tn(e, t) {
|
|
393
393
|
const { fields: n, range: a = 1 } = t;
|
|
394
394
|
if (!n) {
|
|
@@ -404,26 +404,26 @@ async function tn(e, t) {
|
|
|
404
404
|
if (y) {
|
|
405
405
|
let m = Object.values(y).some((g) => g.includes("image")), v = {};
|
|
406
406
|
m && (l.getImages().forEach((h) => {
|
|
407
|
-
const { tl: f } = h.range,
|
|
408
|
-
if (
|
|
409
|
-
const p =
|
|
410
|
-
v[
|
|
407
|
+
const { tl: f } = h.range, c = s.model.media.find((p) => p.index === h.imageId);
|
|
408
|
+
if (c) {
|
|
409
|
+
const p = c.buffer.toString("base64"), b = `data:image/${c.extension};base64,${p}`, x = `${Math.ceil(f.row)}_${Math.ceil(f.col)}`;
|
|
410
|
+
v[x] ? v[x].push(b) : v[x] = [b];
|
|
411
411
|
}
|
|
412
412
|
}), console.log("withImages-imageMap", v)), l.eachRow(function(g, h) {
|
|
413
413
|
if (h > a) {
|
|
414
|
-
let f = {},
|
|
414
|
+
let f = {}, c = !0;
|
|
415
415
|
Object.keys(y).forEach((p) => {
|
|
416
416
|
var V;
|
|
417
|
-
let [b,
|
|
418
|
-
const
|
|
417
|
+
let [b, x] = y[p].split(Ue);
|
|
418
|
+
const w = g.getCell(b);
|
|
419
419
|
let E;
|
|
420
|
-
if (
|
|
421
|
-
const Y =
|
|
422
|
-
E = v[
|
|
420
|
+
if (x == "image" && m) {
|
|
421
|
+
const Y = w._column._number, F = `${h}_${Y}`;
|
|
422
|
+
E = v[F] || "";
|
|
423
423
|
} else
|
|
424
|
-
|
|
425
|
-
E &&
|
|
426
|
-
}),
|
|
424
|
+
w.result != null ? E = w.result : (V = w.value) != null && V.richText ? E = w.value.richText.reduce((Y, F) => Y + F.text, "") : w.type == 4 && w.value ? E = $e(w.value).utc().format("YYYY-MM-DD HH:mm:ss") : E = w.value;
|
|
425
|
+
E && x == "option" && (E = E.split(Ue)[1]), f[p] = E, E && (c = !1);
|
|
426
|
+
}), c || i.push(f);
|
|
427
427
|
}
|
|
428
428
|
}), o[l._name] = i;
|
|
429
429
|
}
|
|
@@ -439,8 +439,11 @@ async function on(e, t) {
|
|
|
439
439
|
if (!e || t.length == 0)
|
|
440
440
|
return;
|
|
441
441
|
const n = ln(t);
|
|
442
|
-
|
|
443
|
-
const { columnWidth:
|
|
442
|
+
for (const a of n.worksheets) {
|
|
443
|
+
const { columnWidth: s } = gt, o = t[a.name];
|
|
444
|
+
if (!o)
|
|
445
|
+
continue;
|
|
446
|
+
const { tableHeader: l, tableData: r } = o;
|
|
444
447
|
l.forEach((i) => {
|
|
445
448
|
const { style: y = {}, required: m } = i, { font: v = {} } = y;
|
|
446
449
|
i.style = {
|
|
@@ -453,25 +456,28 @@ async function on(e, t) {
|
|
|
453
456
|
}
|
|
454
457
|
};
|
|
455
458
|
}), a.columns = l, a.addRows(r), l.forEach((i) => {
|
|
456
|
-
const { header: y, key: m, width: v, option: g, numFmt: h } = i,
|
|
457
|
-
if (
|
|
458
|
-
const
|
|
459
|
-
|
|
460
|
-
if (
|
|
461
|
-
const
|
|
462
|
-
a.getCell(`${
|
|
459
|
+
const { header: y, key: m, width: v, option: g, numFmt: h, locked: f } = i, c = a.getColumn(m);
|
|
460
|
+
if (c.numFmt = nn[h] || h, c.width = v || s, c.protection = { locked: f }, g) {
|
|
461
|
+
const p = n.addWorksheet(m);
|
|
462
|
+
p.state = "hidden", p.getColumn(1).values = g.map((b) => `${b.label}${Ue}${b.value}`), Array(100).fill("").forEach((b, x) => {
|
|
463
|
+
if (x > 0) {
|
|
464
|
+
const w = Ce();
|
|
465
|
+
a.getCell(`${c.letter}${x}`).dataValidation = {
|
|
463
466
|
type: "list",
|
|
464
467
|
formulae: [`${m}!$A$1:$A$${g.length}`],
|
|
465
468
|
showErrorMessage: !0,
|
|
466
|
-
error:
|
|
469
|
+
error: w("excel.invalidInput"),
|
|
467
470
|
errorStyle: "stop",
|
|
468
|
-
errorMessage:
|
|
471
|
+
errorMessage: w("excel.invalidOption")
|
|
469
472
|
};
|
|
470
473
|
}
|
|
471
474
|
});
|
|
472
475
|
}
|
|
476
|
+
}), l.some((i) => i.locked) && await a.protect("6737187214", {
|
|
477
|
+
selectLockedCells: !0,
|
|
478
|
+
selectUnlockedCells: !0
|
|
473
479
|
});
|
|
474
|
-
}
|
|
480
|
+
}
|
|
475
481
|
try {
|
|
476
482
|
const a = await n.xlsx.writeBuffer(), s = new File([a], e, {
|
|
477
483
|
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
@@ -499,7 +505,7 @@ function an(e) {
|
|
|
499
505
|
return t + n;
|
|
500
506
|
}
|
|
501
507
|
}
|
|
502
|
-
function
|
|
508
|
+
function jn(e) {
|
|
503
509
|
return new Promise((t) => {
|
|
504
510
|
setTimeout(() => {
|
|
505
511
|
t();
|
|
@@ -647,95 +653,95 @@ const Se = (e, t) => {
|
|
|
647
653
|
const n = e, a = Lt(), { t: s, locale: o } = pe(), l = Tt(e, "modelValue"), r = ce(() => a["value-key"] != null), i = P(""), y = ce(() => {
|
|
648
654
|
if (a.remote !== void 0)
|
|
649
655
|
return n.data;
|
|
650
|
-
const
|
|
651
|
-
if (
|
|
656
|
+
const C = pt(i.value), { data: k, labelValue: U } = n, te = k || g.value;
|
|
657
|
+
if (C.length == 0)
|
|
652
658
|
return te;
|
|
653
|
-
const { label: $, labelEn: ye } =
|
|
659
|
+
const { label: $, labelEn: ye } = U;
|
|
654
660
|
let z = o.value == "en_us" ? ye || "i18nName" : $;
|
|
655
|
-
return
|
|
656
|
-
(de) => de[z].toLowerCase().includes(
|
|
661
|
+
return C.length == 1 ? te.filter(
|
|
662
|
+
(de) => de[z].toLowerCase().includes(C[0].toLowerCase())
|
|
657
663
|
) : te.filter((de) => {
|
|
658
664
|
let ve = !1;
|
|
659
|
-
return ve =
|
|
665
|
+
return ve = C.some((Ee) => de[z].toLowerCase() == Ee.toLowerCase()), ve;
|
|
660
666
|
});
|
|
661
667
|
}), m = ce({
|
|
662
668
|
get() {
|
|
663
669
|
return a.multiple == null || l.value == null ? !1 : l.value.length == y.value.length;
|
|
664
670
|
},
|
|
665
|
-
set(
|
|
666
|
-
return
|
|
671
|
+
set(C) {
|
|
672
|
+
return C;
|
|
667
673
|
}
|
|
668
674
|
}), v = t, g = P([]), h = async () => {
|
|
669
|
-
const { data:
|
|
670
|
-
g.value = [...
|
|
675
|
+
const { data: C } = await n.api();
|
|
676
|
+
g.value = [...C], v("success", g);
|
|
671
677
|
};
|
|
672
678
|
n.api && h();
|
|
673
|
-
function f(
|
|
674
|
-
v("change",
|
|
675
|
-
n.optionClick && n.optionClick(
|
|
679
|
+
function f(C) {
|
|
680
|
+
v("change", C), c.value && we(() => {
|
|
681
|
+
n.optionClick && n.optionClick(c.value), c.value = null;
|
|
676
682
|
});
|
|
677
683
|
}
|
|
678
|
-
const
|
|
679
|
-
function p(
|
|
680
|
-
|
|
684
|
+
const c = P(null);
|
|
685
|
+
function p(C) {
|
|
686
|
+
c.value = C;
|
|
681
687
|
}
|
|
682
|
-
const b = n.labelValue.label.split("-"),
|
|
688
|
+
const b = n.labelValue.label.split("-"), x = (C) => {
|
|
683
689
|
if (b.length == 1) {
|
|
684
690
|
if (n.changeLocal)
|
|
685
|
-
return s(
|
|
686
|
-
let k = o.value == "en_us" ?
|
|
687
|
-
return k = k ||
|
|
691
|
+
return s(C[n.labelValue.label]);
|
|
692
|
+
let k = o.value == "en_us" ? C[n.labelValue.labelEn || "i18nName"] : C[n.labelValue.label];
|
|
693
|
+
return k = k || C[n.labelValue.label], k + "";
|
|
688
694
|
} else {
|
|
689
695
|
let k = [];
|
|
690
|
-
return b.forEach((
|
|
691
|
-
k.push(
|
|
696
|
+
return b.forEach((U) => {
|
|
697
|
+
k.push(C[U]);
|
|
692
698
|
}), k.join("-");
|
|
693
699
|
}
|
|
694
700
|
};
|
|
695
|
-
function
|
|
701
|
+
function w(C) {
|
|
696
702
|
let k = n.data ? n.data : g.value;
|
|
697
|
-
l.value =
|
|
703
|
+
l.value = C ? k.map((U) => r.value ? U : U[n.labelValue.value]) : [], we(() => {
|
|
698
704
|
v("change", l.value), v("changeAll", l.value, k);
|
|
699
705
|
});
|
|
700
706
|
}
|
|
701
|
-
function E(
|
|
702
|
-
v("change", r.value ?
|
|
703
|
-
n.optionClick && n.optionClick(
|
|
707
|
+
function E(C) {
|
|
708
|
+
v("change", r.value ? C : C[n.labelValue.value]), we(() => {
|
|
709
|
+
n.optionClick && n.optionClick(C);
|
|
704
710
|
});
|
|
705
711
|
}
|
|
706
|
-
function V(
|
|
707
|
-
return l.value.length >= n.maxLimit && !l.value.includes(
|
|
712
|
+
function V(C) {
|
|
713
|
+
return l.value.length >= n.maxLimit && !l.value.includes(C[n.labelValue.value]);
|
|
708
714
|
}
|
|
709
|
-
function Y(
|
|
710
|
-
return
|
|
715
|
+
function Y(C) {
|
|
716
|
+
return C.map((k) => ({
|
|
711
717
|
...k,
|
|
712
|
-
label:
|
|
718
|
+
label: x(k),
|
|
713
719
|
value: r.value ? k : k[n.labelValue.value]
|
|
714
720
|
}));
|
|
715
721
|
}
|
|
716
|
-
const
|
|
717
|
-
|
|
722
|
+
const F = P([]), G = n.data ? n.data : g.value;
|
|
723
|
+
F.value = Y(G), Pe(
|
|
718
724
|
() => n.data ? n.data : g.value,
|
|
719
|
-
(
|
|
720
|
-
var
|
|
721
|
-
const k = Y(
|
|
722
|
-
if (k.length !==
|
|
723
|
-
|
|
725
|
+
(C) => {
|
|
726
|
+
var U;
|
|
727
|
+
const k = Y(C);
|
|
728
|
+
if (k.length !== F.value.length)
|
|
729
|
+
F.value = k;
|
|
724
730
|
else {
|
|
725
731
|
let te = !1;
|
|
726
732
|
for (let $ = 0; $ < k.length; $++)
|
|
727
|
-
if (k[$].value !== ((
|
|
733
|
+
if (k[$].value !== ((U = F.value[$]) == null ? void 0 : U.value)) {
|
|
728
734
|
te = !0;
|
|
729
735
|
break;
|
|
730
736
|
}
|
|
731
|
-
te && (
|
|
737
|
+
te && (F.value = k);
|
|
732
738
|
}
|
|
733
739
|
},
|
|
734
740
|
{ deep: !0 }
|
|
735
741
|
);
|
|
736
|
-
const _ = ce(() =>
|
|
737
|
-
return (
|
|
738
|
-
const
|
|
742
|
+
const _ = ce(() => F.value);
|
|
743
|
+
return (C, k) => {
|
|
744
|
+
const U = O("el-checkbox"), te = O("el-select-v2"), $ = O("el-option"), ye = O("el-select");
|
|
739
745
|
return H(a).v2 != null ? (L(), N(te, ue({
|
|
740
746
|
key: 0,
|
|
741
747
|
options: _.value,
|
|
@@ -759,15 +765,15 @@ const Se = (e, t) => {
|
|
|
759
765
|
H(a).multiple != null ? {
|
|
760
766
|
name: "header",
|
|
761
767
|
fn: D(() => [
|
|
762
|
-
Q(
|
|
763
|
-
M(
|
|
768
|
+
Q(C.$slots, "header", {}, () => [
|
|
769
|
+
M(U, {
|
|
764
770
|
class: "mgl20",
|
|
765
771
|
modelValue: m.value,
|
|
766
772
|
"onUpdate:modelValue": k[0] || (k[0] = (z) => m.value = z),
|
|
767
|
-
onChange:
|
|
773
|
+
onChange: w
|
|
768
774
|
}, {
|
|
769
775
|
default: D(() => [
|
|
770
|
-
ne(ee(
|
|
776
|
+
ne(ee(C.$t("quan-xuan")), 1)
|
|
771
777
|
]),
|
|
772
778
|
_: 1
|
|
773
779
|
}, 8, ["modelValue"])
|
|
@@ -786,22 +792,22 @@ const Se = (e, t) => {
|
|
|
786
792
|
clearable: ""
|
|
787
793
|
}, H(a), { onClear: e.optionClick }), {
|
|
788
794
|
default: D(() => [
|
|
789
|
-
H(a).multiple != null && e.showCheckAll && e.maxLimit == null ? Q(
|
|
790
|
-
M(
|
|
795
|
+
H(a).multiple != null && e.showCheckAll && e.maxLimit == null ? Q(C.$slots, "header", { key: 0 }, () => [
|
|
796
|
+
M(U, {
|
|
791
797
|
class: "mgl20",
|
|
792
798
|
modelValue: m.value,
|
|
793
799
|
"onUpdate:modelValue": k[2] || (k[2] = (z) => m.value = z),
|
|
794
|
-
onChange:
|
|
800
|
+
onChange: w
|
|
795
801
|
}, {
|
|
796
802
|
default: D(() => [
|
|
797
|
-
ne(ee(
|
|
803
|
+
ne(ee(C.$t("quan-xuan")), 1)
|
|
798
804
|
]),
|
|
799
805
|
_: 1
|
|
800
806
|
}, 8, ["modelValue"])
|
|
801
807
|
], !0) : fe("", !0),
|
|
802
808
|
(L(!0), ie(Oe, null, at(y.value, (z, he) => (L(), N($, {
|
|
803
809
|
key: he,
|
|
804
|
-
label:
|
|
810
|
+
label: x(z),
|
|
805
811
|
disabled: H(a).multiple != null && e.maxLimit > 0 ? V(z) : !1,
|
|
806
812
|
onClick: Ve((de) => E(z), ["stop"]),
|
|
807
813
|
value: r.value ? z : z[e.labelValue.value]
|
|
@@ -914,7 +920,7 @@ const fn = ["accept"], hn = {
|
|
|
914
920
|
};
|
|
915
921
|
}
|
|
916
922
|
}, Jn = /* @__PURE__ */ Se(hn, [["__scopeId", "data-v-f5e86876"]]);
|
|
917
|
-
function
|
|
923
|
+
function je(e) {
|
|
918
924
|
let t = {};
|
|
919
925
|
return e.forEach((n) => {
|
|
920
926
|
const { key: a, type: s, option: o = {}, value: l, dateType: r = "date" } = n;
|
|
@@ -960,17 +966,17 @@ const mn = { key: 0 }, gn = { class: "btns" }, pn = { class: "left" }, yn = { cl
|
|
|
960
966
|
s("confirm");
|
|
961
967
|
}
|
|
962
968
|
function f() {
|
|
963
|
-
return
|
|
969
|
+
return je(a.form.items);
|
|
964
970
|
}
|
|
965
|
-
const
|
|
971
|
+
const c = ct(a.form.items);
|
|
966
972
|
function p() {
|
|
967
973
|
a.form.items.forEach((b) => {
|
|
968
|
-
const
|
|
969
|
-
|
|
974
|
+
const x = c.find((w) => w.key == b.key);
|
|
975
|
+
x && (b.value = x.value);
|
|
970
976
|
});
|
|
971
977
|
}
|
|
972
|
-
return t({ getPrm: f, reset: p }), (b,
|
|
973
|
-
const
|
|
978
|
+
return t({ getPrm: f, reset: p }), (b, x) => {
|
|
979
|
+
const w = O("el-input"), E = O("el-date-picker"), V = O("el-form-item"), Y = O("el-form"), F = O("el-link"), G = O("el-button");
|
|
974
980
|
return L(), ie("div", {
|
|
975
981
|
class: "searchBar-container mgt10 mgb10",
|
|
976
982
|
onKeydown: Dt(m, ["enter"])
|
|
@@ -992,13 +998,13 @@ const mn = { key: 0 }, gn = { class: "btns" }, pn = { class: "left" }, yn = { cl
|
|
|
992
998
|
label: _.name
|
|
993
999
|
}, {
|
|
994
1000
|
default: D(() => {
|
|
995
|
-
var
|
|
1001
|
+
var C, k;
|
|
996
1002
|
return [
|
|
997
|
-
_.type === "input" ? (L(), N(
|
|
1003
|
+
_.type === "input" ? (L(), N(w, {
|
|
998
1004
|
key: 0,
|
|
999
1005
|
modelValue: _.value,
|
|
1000
|
-
"onUpdate:modelValue": (
|
|
1001
|
-
class: rt(((
|
|
1006
|
+
"onUpdate:modelValue": (U) => _.value = U,
|
|
1007
|
+
class: rt(((C = _.option) == null ? void 0 : C.class) || "w150"),
|
|
1002
1008
|
placeholder: b.$t("qing-shu-ru"),
|
|
1003
1009
|
clearable: ""
|
|
1004
1010
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) : _.type === "custom" ? (L(), N(st(_.render), { key: 1 })) : fe("", !0),
|
|
@@ -1006,20 +1012,20 @@ const mn = { key: 0 }, gn = { class: "btns" }, pn = { class: "left" }, yn = { cl
|
|
|
1006
1012
|
key: 2,
|
|
1007
1013
|
class: ((k = _.option) == null ? void 0 : k.class) || "w150",
|
|
1008
1014
|
modelValue: _.value,
|
|
1009
|
-
"onUpdate:modelValue": (
|
|
1015
|
+
"onUpdate:modelValue": (U) => _.value = U
|
|
1010
1016
|
}, { ref_for: !0 }, _.option, {
|
|
1011
1017
|
onChange: m,
|
|
1012
|
-
onClear: (
|
|
1018
|
+
onClear: (U) => v(_)
|
|
1013
1019
|
}), null, 16, ["class", "modelValue", "onUpdate:modelValue", "onClear"])) : fe("", !0),
|
|
1014
1020
|
_.type === "date" ? (L(), N(E, ue({
|
|
1015
1021
|
key: 3,
|
|
1016
1022
|
class: { datetimerange: "w300", daterange: "w200" }[_.dateType] || "w100",
|
|
1017
1023
|
modelValue: _.value,
|
|
1018
|
-
"onUpdate:modelValue": (
|
|
1024
|
+
"onUpdate:modelValue": (U) => _.value = U,
|
|
1019
1025
|
"value-format": i[_.dateType] || "YYYY-MM-DD",
|
|
1020
1026
|
type: _.dateType || "date",
|
|
1021
|
-
onFocus: (
|
|
1022
|
-
onChange: (
|
|
1027
|
+
onFocus: (U) => l.value = _,
|
|
1028
|
+
onChange: (U) => h(),
|
|
1023
1029
|
placeholder: b.$t("qing-xuan-ze"),
|
|
1024
1030
|
"start-placeholder": b.$t("kai-shi-shi-jian"),
|
|
1025
1031
|
"end-placeholder": b.$t("jie-shu-shi-jian")
|
|
@@ -1038,10 +1044,10 @@ const mn = { key: 0 }, gn = { class: "btns" }, pn = { class: "left" }, yn = { cl
|
|
|
1038
1044
|
Q(b.$slots, "table-header-left", {}, void 0, !0)
|
|
1039
1045
|
]),
|
|
1040
1046
|
re("div", yn, [
|
|
1041
|
-
M(
|
|
1047
|
+
M(F, {
|
|
1042
1048
|
underline: "never",
|
|
1043
1049
|
class: "mgr10",
|
|
1044
|
-
onClick:
|
|
1050
|
+
onClick: x[0] || (x[0] = () => {
|
|
1045
1051
|
s("visibleChange", !o.value), o.value = !o.value;
|
|
1046
1052
|
})
|
|
1047
1053
|
}, {
|
|
@@ -1161,55 +1167,55 @@ const Cn = { class: "center" }, xn = {
|
|
|
1161
1167
|
}
|
|
1162
1168
|
},
|
|
1163
1169
|
setup(e, { expose: t }) {
|
|
1164
|
-
const { t: n, locale: a } = pe(), s =
|
|
1170
|
+
const { t: n, locale: a } = pe(), s = Ut(), o = wn(), l = e, r = P(!1), i = P([]);
|
|
1165
1171
|
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 = []);
|
|
1166
1172
|
const y = ce(() => {
|
|
1167
1173
|
const d = s.path.replace(/\//g, "-").replace(/^-/, "") || "default-table";
|
|
1168
1174
|
return l.id ? `listPageId-${d}-${l.id}` : `listPageId-${d}`;
|
|
1169
|
-
}), m = ct(l.searchForm.items), v = l.searchForm.pageNoKey || o.pageNoKey, g = l.searchForm.pageSizeKey || o.pageSizeKey, h =
|
|
1175
|
+
}), m = ct(l.searchForm.items), v = l.searchForm.pageNoKey || o.pageNoKey, g = l.searchForm.pageSizeKey || o.pageSizeKey, h = Fe({
|
|
1170
1176
|
[v]: 1,
|
|
1171
1177
|
[g]: l.searchForm.defaultPageSize || o.defaultPageSize,
|
|
1172
1178
|
total: 0
|
|
1173
|
-
}), f = P(null),
|
|
1179
|
+
}), f = P(null), c = P(null), p = P(450), b = Re(() => {
|
|
1174
1180
|
we(() => {
|
|
1175
|
-
if (!
|
|
1181
|
+
if (!c.value)
|
|
1176
1182
|
return;
|
|
1177
|
-
const
|
|
1183
|
+
const u = c.value.getBoundingClientRect(), S = window.innerHeight, T = u.top, R = 100, Z = S - T - R, q = 200;
|
|
1178
1184
|
p.value = Math.max(Z, q);
|
|
1179
1185
|
});
|
|
1180
|
-
}, 100),
|
|
1186
|
+
}, 100), x = () => {
|
|
1181
1187
|
b();
|
|
1182
|
-
},
|
|
1188
|
+
}, w = () => {
|
|
1183
1189
|
if (!l.searchForm.enableCellCopy && !o.enableCellCopy)
|
|
1184
1190
|
return !1;
|
|
1185
1191
|
const d = f.value;
|
|
1186
1192
|
if (!d || !d.$el)
|
|
1187
1193
|
return !1;
|
|
1188
|
-
const
|
|
1189
|
-
return
|
|
1194
|
+
const u = d.$el;
|
|
1195
|
+
return u.classList.add("cell-copy-enabled"), u.setAttribute("tabindex", "-1"), u.removeEventListener("mousedown", z), u.removeEventListener("mousemove", he), u.removeEventListener("mouseup", de), u.removeEventListener("keydown", Te), u.addEventListener("mousedown", z), u.addEventListener("mousemove", he), u.addEventListener("mouseup", de), u.addEventListener("keydown", Te), !0;
|
|
1190
1196
|
};
|
|
1191
1197
|
ot(() => {
|
|
1192
|
-
b(), window.addEventListener("resize",
|
|
1193
|
-
|
|
1198
|
+
b(), window.addEventListener("resize", x), (l.searchForm.enableCellCopy || o.enableCellCopy) && (document.addEventListener("mouseup", He), document.addEventListener("mousedown", Ne), setTimeout(() => {
|
|
1199
|
+
w();
|
|
1194
1200
|
}, 500));
|
|
1195
1201
|
}), Mt(() => {
|
|
1196
1202
|
(l.searchForm.enableCellCopy || o.enableCellCopy) && setTimeout(() => {
|
|
1197
|
-
|
|
1203
|
+
w();
|
|
1198
1204
|
}, 500);
|
|
1199
1205
|
}), Ot(() => {
|
|
1200
|
-
if (window.removeEventListener("resize",
|
|
1206
|
+
if (window.removeEventListener("resize", x), l.searchForm.enableCellCopy || o.enableCellCopy) {
|
|
1201
1207
|
document.removeEventListener("mouseup", He), document.removeEventListener("mousedown", Ne);
|
|
1202
1208
|
const d = f.value;
|
|
1203
1209
|
if (d && d.$el) {
|
|
1204
|
-
const
|
|
1205
|
-
|
|
1210
|
+
const u = d.$el;
|
|
1211
|
+
u.removeEventListener("mousedown", z), u.removeEventListener("mousemove", he), u.removeEventListener("mouseup", de), u.removeEventListener("keydown", Te);
|
|
1206
1212
|
}
|
|
1207
1213
|
}
|
|
1208
1214
|
});
|
|
1209
1215
|
const E = ce(() => te.value.height || p.value);
|
|
1210
1216
|
let V;
|
|
1211
1217
|
async function Y(d) {
|
|
1212
|
-
const { dataFormat:
|
|
1218
|
+
const { dataFormat: u } = l.tableConfig;
|
|
1213
1219
|
d[v] != 1 && (d.nextSearchAfter = V), r.value = !0;
|
|
1214
1220
|
const { code: S, data: T = {} } = await l.api(d).finally(() => {
|
|
1215
1221
|
r.value = !1, l.searchForm.selections = [];
|
|
@@ -1227,49 +1233,49 @@ const Cn = { class: "center" }, xn = {
|
|
|
1227
1233
|
Z = T[q];
|
|
1228
1234
|
break;
|
|
1229
1235
|
}
|
|
1230
|
-
i.value =
|
|
1236
|
+
i.value = u ? u(R) : R, h.total = Z, V = T.nextSearchAfter, (l.searchForm.enableCellCopy || o.enableCellCopy) && we(() => {
|
|
1231
1237
|
setTimeout(() => {
|
|
1232
|
-
|
|
1238
|
+
w();
|
|
1233
1239
|
}, 100);
|
|
1234
1240
|
});
|
|
1235
1241
|
}
|
|
1236
1242
|
}
|
|
1237
|
-
function
|
|
1238
|
-
const { searchData:
|
|
1243
|
+
function F(d = {}) {
|
|
1244
|
+
const { searchData: u = () => ({}) } = l.tableConfig, S = u();
|
|
1239
1245
|
Y({
|
|
1240
1246
|
...h,
|
|
1241
|
-
...
|
|
1247
|
+
...je(l.searchForm.items),
|
|
1242
1248
|
...d,
|
|
1243
1249
|
...S
|
|
1244
1250
|
});
|
|
1245
1251
|
}
|
|
1246
1252
|
function G() {
|
|
1247
1253
|
const { reset: d } = l.tableConfig;
|
|
1248
|
-
d && d(), l.searchForm.items.forEach((
|
|
1249
|
-
const S = m.find((T) => Xe(
|
|
1250
|
-
S && (
|
|
1251
|
-
}),
|
|
1254
|
+
d && d(), l.searchForm.items.forEach((u) => {
|
|
1255
|
+
const S = m.find((T) => Xe(u.key) && Xe(T.key) ? u.key.join(",") == T.key.join(",") : T.key == u.key);
|
|
1256
|
+
S && (u.value = S.value);
|
|
1257
|
+
}), F();
|
|
1252
1258
|
}
|
|
1253
|
-
l.api && l.immediate &&
|
|
1259
|
+
l.api && l.immediate && F();
|
|
1254
1260
|
function _() {
|
|
1255
|
-
return { ...h, ...
|
|
1261
|
+
return { ...h, ...je(l.searchForm.items) };
|
|
1256
1262
|
}
|
|
1257
|
-
const
|
|
1263
|
+
const C = () => {
|
|
1258
1264
|
const d = f.value;
|
|
1259
1265
|
d && d.clearSort();
|
|
1260
|
-
}, k =
|
|
1266
|
+
}, k = Fe({
|
|
1261
1267
|
storage: !0
|
|
1262
|
-
}),
|
|
1268
|
+
}), U = Fe({
|
|
1263
1269
|
drag: !0,
|
|
1264
1270
|
resizable: !0,
|
|
1265
1271
|
maxFixedSize: 0
|
|
1266
1272
|
}), te = ce(() => {
|
|
1267
|
-
const { customConfig: d, columnConfig:
|
|
1273
|
+
const { customConfig: d, columnConfig: u, ...S } = l.tableConfig;
|
|
1268
1274
|
return {
|
|
1269
1275
|
headerAlign: "left",
|
|
1270
1276
|
align: "center",
|
|
1271
1277
|
customConfig: { ...k, ...d },
|
|
1272
|
-
columnConfig: { ...
|
|
1278
|
+
columnConfig: { ...U, ...u },
|
|
1273
1279
|
// 列过多时 自动宽度 虚拟滚动会闪屏 关闭虚拟滚动
|
|
1274
1280
|
"virtual-x-config": {
|
|
1275
1281
|
enabled: !1,
|
|
@@ -1279,7 +1285,7 @@ const Cn = { class: "center" }, xn = {
|
|
|
1279
1285
|
"virtual-y-config": { enabled: !0, gt: 100 },
|
|
1280
1286
|
...S
|
|
1281
1287
|
};
|
|
1282
|
-
}), $ =
|
|
1288
|
+
}), $ = Fe({
|
|
1283
1289
|
isSelecting: !1,
|
|
1284
1290
|
// 是否正在选择
|
|
1285
1291
|
startCell: null,
|
|
@@ -1289,10 +1295,10 @@ const Cn = { class: "center" }, xn = {
|
|
|
1289
1295
|
selectedCells: []
|
|
1290
1296
|
// 选中的单元格列表 [{ rowIndex, colIndex }]
|
|
1291
1297
|
}), ye = (d) => {
|
|
1292
|
-
const
|
|
1293
|
-
if (!
|
|
1298
|
+
const u = d.closest(".vxe-body--column");
|
|
1299
|
+
if (!u || u.classList.contains("col--checkbox") || u.classList.contains("col--seq"))
|
|
1294
1300
|
return null;
|
|
1295
|
-
const S =
|
|
1301
|
+
const S = u.closest(".vxe-body--row");
|
|
1296
1302
|
if (!S)
|
|
1297
1303
|
return null;
|
|
1298
1304
|
const T = f.value;
|
|
@@ -1309,38 +1315,38 @@ const Cn = { class: "center" }, xn = {
|
|
|
1309
1315
|
if (R < 0)
|
|
1310
1316
|
return null;
|
|
1311
1317
|
let q = -1;
|
|
1312
|
-
const se =
|
|
1313
|
-
if (se && (q = T.getColumns().findIndex((
|
|
1314
|
-
const
|
|
1318
|
+
const se = u.getAttribute("data-colid");
|
|
1319
|
+
if (se && (q = T.getColumns().findIndex((I) => I.id === se)), q < 0) {
|
|
1320
|
+
const I = Array.from(S.querySelectorAll(".vxe-body--column")).indexOf(u), K = !!u.closest(".vxe-table--fixed-left-wrapper"), J = !!u.closest(".vxe-table--fixed-right-wrapper"), B = T.getColumns();
|
|
1315
1321
|
if (K) {
|
|
1316
1322
|
const X = B.filter((W) => W.fixed === "left");
|
|
1317
|
-
|
|
1323
|
+
I < X.length && (q = B.indexOf(X[I]));
|
|
1318
1324
|
} else if (J) {
|
|
1319
1325
|
const X = B.filter((W) => W.fixed === "right");
|
|
1320
|
-
|
|
1326
|
+
I < X.length && (q = B.indexOf(X[I]));
|
|
1321
1327
|
} else {
|
|
1322
1328
|
const X = l.searchForm.showCheckBox ? 1 : 0;
|
|
1323
|
-
q = B.filter((oe) => oe.fixed === "left").length +
|
|
1329
|
+
q = B.filter((oe) => oe.fixed === "left").length + I - X;
|
|
1324
1330
|
}
|
|
1325
1331
|
}
|
|
1326
|
-
return q < 0 ? null : { rowIndex: R, colIndex: q, cell:
|
|
1332
|
+
return q < 0 ? null : { rowIndex: R, colIndex: q, cell: u };
|
|
1327
1333
|
}, z = (d) => {
|
|
1328
|
-
const
|
|
1329
|
-
if (!
|
|
1334
|
+
const u = ye(d.target);
|
|
1335
|
+
if (!u) {
|
|
1330
1336
|
ve();
|
|
1331
1337
|
return;
|
|
1332
1338
|
}
|
|
1333
1339
|
$.isSelecting = !0, $.startCell = {
|
|
1334
|
-
rowIndex:
|
|
1335
|
-
colIndex:
|
|
1340
|
+
rowIndex: u.rowIndex,
|
|
1341
|
+
colIndex: u.colIndex
|
|
1336
1342
|
}, $.endCell = { ...$.startCell }, Ee(), Ke();
|
|
1337
1343
|
}, he = (d) => {
|
|
1338
1344
|
if (!$.isSelecting)
|
|
1339
1345
|
return;
|
|
1340
|
-
const
|
|
1341
|
-
|
|
1342
|
-
rowIndex:
|
|
1343
|
-
colIndex:
|
|
1346
|
+
const u = ye(d.target);
|
|
1347
|
+
u && ($.endCell = {
|
|
1348
|
+
rowIndex: u.rowIndex,
|
|
1349
|
+
colIndex: u.colIndex
|
|
1344
1350
|
}, Ee(), Ke());
|
|
1345
1351
|
}, de = () => {
|
|
1346
1352
|
$.isSelecting = !1;
|
|
@@ -1365,21 +1371,21 @@ const Cn = { class: "center" }, xn = {
|
|
|
1365
1371
|
$.selectedCells = [];
|
|
1366
1372
|
return;
|
|
1367
1373
|
}
|
|
1368
|
-
const d = $.startCell.rowIndex,
|
|
1374
|
+
const d = $.startCell.rowIndex, u = $.endCell.rowIndex, S = $.startCell.colIndex, T = $.endCell.colIndex, R = Math.min(d, u), Z = Math.max(d, u), q = Math.min(S, T), se = Math.max(S, T);
|
|
1369
1375
|
$.selectedCells = [];
|
|
1370
1376
|
for (let A = R; A <= Z; A++)
|
|
1371
|
-
for (let
|
|
1377
|
+
for (let I = q; I <= se; I++)
|
|
1372
1378
|
$.selectedCells.push({
|
|
1373
1379
|
rowIndex: A,
|
|
1374
|
-
colIndex:
|
|
1380
|
+
colIndex: I
|
|
1375
1381
|
});
|
|
1376
1382
|
}, Ke = () => {
|
|
1377
1383
|
we(() => {
|
|
1378
1384
|
const d = f.value;
|
|
1379
1385
|
if (!d)
|
|
1380
1386
|
return;
|
|
1381
|
-
const
|
|
1382
|
-
if (
|
|
1387
|
+
const u = d.$el;
|
|
1388
|
+
if (u.querySelectorAll(
|
|
1383
1389
|
".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left"
|
|
1384
1390
|
).forEach((K) => {
|
|
1385
1391
|
K.classList.remove(
|
|
@@ -1391,34 +1397,34 @@ const Cn = { class: "center" }, xn = {
|
|
|
1391
1397
|
);
|
|
1392
1398
|
}), $.selectedCells.length === 0)
|
|
1393
1399
|
return;
|
|
1394
|
-
const S = d.getColumns(), T = $.selectedCells.map((K) => K.rowIndex), R = $.selectedCells.map((K) => K.colIndex), Z = Math.min(...T), q = Math.max(...T), se = Math.min(...R), A = Math.max(...R),
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1400
|
+
const S = d.getColumns(), T = $.selectedCells.map((K) => K.rowIndex), R = $.selectedCells.map((K) => K.colIndex), Z = Math.min(...T), q = Math.max(...T), se = Math.min(...R), A = Math.max(...R), I = [
|
|
1401
|
+
u.querySelector(".vxe-table--body-wrapper tbody"),
|
|
1402
|
+
u.querySelector(".vxe-table--fixed-left-wrapper tbody"),
|
|
1403
|
+
u.querySelector(".vxe-table--fixed-right-wrapper tbody")
|
|
1398
1404
|
].filter(Boolean);
|
|
1399
1405
|
$.selectedCells.forEach(({ rowIndex: K, colIndex: J }) => {
|
|
1400
1406
|
const B = S[J];
|
|
1401
1407
|
if (!B)
|
|
1402
1408
|
return;
|
|
1403
1409
|
const X = B.fixed === "left", W = B.fixed === "right";
|
|
1404
|
-
for (const oe of
|
|
1410
|
+
for (const oe of I) {
|
|
1405
1411
|
const xe = oe.querySelectorAll(".vxe-body--row")[K];
|
|
1406
1412
|
if (!xe)
|
|
1407
1413
|
continue;
|
|
1408
1414
|
const me = Array.from(xe.querySelectorAll(".vxe-body--column"));
|
|
1409
|
-
let
|
|
1415
|
+
let j = null;
|
|
1410
1416
|
if (X && oe.closest(".vxe-table--fixed-left-wrapper")) {
|
|
1411
1417
|
const le = S.filter((ae) => ae.fixed === "left").indexOf(B);
|
|
1412
|
-
|
|
1418
|
+
j = me[le];
|
|
1413
1419
|
} else if (W && oe.closest(".vxe-table--fixed-right-wrapper")) {
|
|
1414
1420
|
const le = S.filter((ae) => ae.fixed === "right").indexOf(B);
|
|
1415
|
-
|
|
1421
|
+
j = me[le];
|
|
1416
1422
|
} else if (!X && !W && oe.closest(".vxe-table--body-wrapper")) {
|
|
1417
1423
|
const ge = l.searchForm.showCheckBox ? 1 : 0, le = S.filter((De) => De.fixed === "left").length, ae = J - le;
|
|
1418
|
-
|
|
1424
|
+
j = me[ae + ge];
|
|
1419
1425
|
}
|
|
1420
|
-
if (
|
|
1421
|
-
|
|
1426
|
+
if (j && !j.classList.contains("col--checkbox") && !j.classList.contains("col--seq")) {
|
|
1427
|
+
j.classList.add("cell-selected"), K === Z && j.classList.add("cell-border-top"), K === q && j.classList.add("cell-border-bottom"), J === se && j.classList.add("cell-border-left"), J === A && j.classList.add("cell-border-right");
|
|
1422
1428
|
break;
|
|
1423
1429
|
}
|
|
1424
1430
|
}
|
|
@@ -1430,21 +1436,21 @@ const Cn = { class: "center" }, xn = {
|
|
|
1430
1436
|
const d = f.value;
|
|
1431
1437
|
if (!d)
|
|
1432
1438
|
return;
|
|
1433
|
-
const
|
|
1434
|
-
(A,
|
|
1439
|
+
const u = d.$el, S = d.getColumns(), T = [...new Set($.selectedCells.map((A) => A.rowIndex))].sort(
|
|
1440
|
+
(A, I) => A - I
|
|
1435
1441
|
), R = [...new Set($.selectedCells.map((A) => A.colIndex))].sort(
|
|
1436
|
-
(A,
|
|
1442
|
+
(A, I) => A - I
|
|
1437
1443
|
), Z = [
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1444
|
+
u.querySelector(".vxe-table--body-wrapper tbody"),
|
|
1445
|
+
u.querySelector(".vxe-table--fixed-left-wrapper tbody"),
|
|
1446
|
+
u.querySelector(".vxe-table--fixed-right-wrapper tbody")
|
|
1441
1447
|
].filter(Boolean), q = [];
|
|
1442
1448
|
T.forEach((A) => {
|
|
1443
|
-
const
|
|
1449
|
+
const I = [];
|
|
1444
1450
|
R.forEach((K) => {
|
|
1445
1451
|
const J = S[K];
|
|
1446
1452
|
if (!J) {
|
|
1447
|
-
|
|
1453
|
+
I.push("");
|
|
1448
1454
|
return;
|
|
1449
1455
|
}
|
|
1450
1456
|
const B = J.fixed === "left", X = J.fixed === "right";
|
|
@@ -1454,24 +1460,24 @@ const Cn = { class: "center" }, xn = {
|
|
|
1454
1460
|
if (!xe)
|
|
1455
1461
|
continue;
|
|
1456
1462
|
const me = Array.from(xe.querySelectorAll(".vxe-body--column"));
|
|
1457
|
-
let
|
|
1463
|
+
let j = null;
|
|
1458
1464
|
if (B && oe.closest(".vxe-table--fixed-left-wrapper")) {
|
|
1459
1465
|
const le = S.filter((ae) => ae.fixed === "left").indexOf(J);
|
|
1460
|
-
|
|
1466
|
+
j = me[le];
|
|
1461
1467
|
} else if (X && oe.closest(".vxe-table--fixed-right-wrapper")) {
|
|
1462
1468
|
const le = S.filter((ae) => ae.fixed === "right").indexOf(J);
|
|
1463
|
-
|
|
1469
|
+
j = me[le];
|
|
1464
1470
|
} else if (!B && !X && oe.closest(".vxe-table--body-wrapper")) {
|
|
1465
1471
|
const ge = l.searchForm.showCheckBox ? 1 : 0, le = S.filter((De) => De.fixed === "left").length, ae = K - le;
|
|
1466
|
-
|
|
1472
|
+
j = me[ae + ge];
|
|
1467
1473
|
}
|
|
1468
|
-
if (
|
|
1469
|
-
W =
|
|
1474
|
+
if (j && !j.classList.contains("col--checkbox") && !j.classList.contains("col--seq")) {
|
|
1475
|
+
W = j.innerText || j.textContent || "", W = W.trim(), W = W.replace(/\n/g, " ").replace(/\s+/g, " ");
|
|
1470
1476
|
break;
|
|
1471
1477
|
}
|
|
1472
1478
|
}
|
|
1473
|
-
|
|
1474
|
-
}), q.push(
|
|
1479
|
+
I.push(W);
|
|
1480
|
+
}), q.push(I.join(" "));
|
|
1475
1481
|
});
|
|
1476
1482
|
const se = q.join(`
|
|
1477
1483
|
`);
|
|
@@ -1485,28 +1491,28 @@ const Cn = { class: "center" }, xn = {
|
|
|
1485
1491
|
}, He = () => {
|
|
1486
1492
|
$.isSelecting = !1;
|
|
1487
1493
|
}, Ne = (d) => {
|
|
1488
|
-
const
|
|
1489
|
-
if (!
|
|
1494
|
+
const u = f.value;
|
|
1495
|
+
if (!u || !u.$el)
|
|
1490
1496
|
return;
|
|
1491
|
-
|
|
1497
|
+
u.$el.contains(d.target) || ve();
|
|
1492
1498
|
}, Ct = (d) => {
|
|
1493
|
-
h[v] = d,
|
|
1499
|
+
h[v] = d, F();
|
|
1494
1500
|
}, xt = (d) => {
|
|
1495
|
-
h[g] = d, h[v] = 1,
|
|
1501
|
+
h[g] = d, h[v] = 1, F();
|
|
1496
1502
|
};
|
|
1497
1503
|
function We() {
|
|
1498
1504
|
const d = f.value.getCheckboxRecords();
|
|
1499
1505
|
l.searchForm.selections = d;
|
|
1500
1506
|
}
|
|
1501
1507
|
const Ze = (d) => {
|
|
1502
|
-
const
|
|
1503
|
-
if (
|
|
1504
|
-
|
|
1508
|
+
const u = f.value;
|
|
1509
|
+
if (u) {
|
|
1510
|
+
u.toggleCheckboxRow(d);
|
|
1505
1511
|
const S = f.value.getCheckboxRecords();
|
|
1506
1512
|
l.searchForm.selections = S;
|
|
1507
1513
|
}
|
|
1508
1514
|
};
|
|
1509
|
-
return t({ tableRef: f, getList:
|
|
1515
|
+
return t({ tableRef: f, getList: F, getPrm: _, clearSort: C, calculateTableHeight: b }), (d, u) => {
|
|
1510
1516
|
var A;
|
|
1511
1517
|
const S = O("el-button"), T = O("el-checkbox"), R = O("el-text"), Z = O("vxe-column"), q = O("VxeTable"), se = O("el-pagination");
|
|
1512
1518
|
return L(), ie("div", {
|
|
@@ -1516,16 +1522,16 @@ const Cn = { class: "center" }, xn = {
|
|
|
1516
1522
|
key: 0,
|
|
1517
1523
|
form: e.searchForm,
|
|
1518
1524
|
onReset: G,
|
|
1519
|
-
onConfirm:
|
|
1525
|
+
onConfirm: u[1] || (u[1] = (I) => F()),
|
|
1520
1526
|
onVisibleChange: H(b)
|
|
1521
1527
|
}, {
|
|
1522
1528
|
btn: D(() => [
|
|
1523
|
-
|
|
1529
|
+
u[3] || (u[3] = re("span", { class: "mgr10" }, null, -1)),
|
|
1524
1530
|
Q(d.$slots, "search-bar-btn", {}, void 0, !0),
|
|
1525
1531
|
M(S, {
|
|
1526
1532
|
class: "mgl10",
|
|
1527
1533
|
round: "",
|
|
1528
|
-
onClick:
|
|
1534
|
+
onClick: u[0] || (u[0] = (I) => f.value.openCustom())
|
|
1529
1535
|
}, {
|
|
1530
1536
|
default: D(() => [
|
|
1531
1537
|
M(yt, { name: "Tools" })
|
|
@@ -1538,7 +1544,7 @@ const Cn = { class: "center" }, xn = {
|
|
|
1538
1544
|
Q(d.$slots, "table-header-left", {}, void 0, !0),
|
|
1539
1545
|
re("div", {
|
|
1540
1546
|
ref_key: "tableContentRef",
|
|
1541
|
-
ref:
|
|
1547
|
+
ref: c
|
|
1542
1548
|
}, [
|
|
1543
1549
|
M(q, ue({
|
|
1544
1550
|
id: y.value,
|
|
@@ -1561,7 +1567,7 @@ const Cn = { class: "center" }, xn = {
|
|
|
1561
1567
|
title: d.$t("xu-hao"),
|
|
1562
1568
|
fixed: "left"
|
|
1563
1569
|
}, {
|
|
1564
|
-
checkbox: D(({ rowIndex:
|
|
1570
|
+
checkbox: D(({ rowIndex: I, row: K, checked: J, disabled: B, indeterminate: X }) => [
|
|
1565
1571
|
re("div", Cn, [
|
|
1566
1572
|
J ? (L(), N(T, {
|
|
1567
1573
|
key: 0,
|
|
@@ -1581,7 +1587,7 @@ const Cn = { class: "center" }, xn = {
|
|
|
1581
1587
|
class: "mgl5"
|
|
1582
1588
|
}, {
|
|
1583
1589
|
default: D(() => [
|
|
1584
|
-
ne(ee(
|
|
1590
|
+
ne(ee(I + 1), 1)
|
|
1585
1591
|
]),
|
|
1586
1592
|
_: 2
|
|
1587
1593
|
}, 1024)
|
|
@@ -1597,7 +1603,7 @@ const Cn = { class: "center" }, xn = {
|
|
|
1597
1603
|
e.searchForm.showPage ? (L(), N(se, {
|
|
1598
1604
|
key: 1,
|
|
1599
1605
|
"current-page": h[H(v)],
|
|
1600
|
-
"onUpdate:currentPage":
|
|
1606
|
+
"onUpdate:currentPage": u[2] || (u[2] = (I) => h[H(v)] = I),
|
|
1601
1607
|
class: "myPagination mgt10",
|
|
1602
1608
|
background: "",
|
|
1603
1609
|
layout: "total, sizes, prev, pager, next",
|
|
@@ -2076,15 +2082,15 @@ function ao(e, t = {}) {
|
|
|
2076
2082
|
}, t), { manual: s, log: o, params: l = {}, cb: r, format: i } = a, y = P([]), m = P(!1), v = (g) => {
|
|
2077
2083
|
const h = g || l;
|
|
2078
2084
|
m.value = !0, e(h).then((f) => {
|
|
2079
|
-
const { code:
|
|
2085
|
+
const { code: c, data: p, msg: b } = f;
|
|
2080
2086
|
if (r) {
|
|
2081
|
-
const { records:
|
|
2087
|
+
const { records: x, rows: w } = p || {}, E = x || w ? x || w : p;
|
|
2082
2088
|
y.value = Me(E, i), r(f);
|
|
2083
2089
|
}
|
|
2084
2090
|
if (p) {
|
|
2085
2091
|
if (p.records != null || p.rows != null) {
|
|
2086
|
-
const { records:
|
|
2087
|
-
h && h.total != null && (l.total = parseInt(E)), y.value = Me(
|
|
2092
|
+
const { records: x, rows: w, total: E = 0 } = p || {};
|
|
2093
|
+
h && h.total != null && (l.total = parseInt(E)), y.value = Me(x || w || [], i);
|
|
2088
2094
|
} else
|
|
2089
2095
|
y.value = Me(p, i);
|
|
2090
2096
|
o && console.log("useRequest-res", y.value);
|
|
@@ -2159,7 +2165,7 @@ function Sn(e, t) {
|
|
|
2159
2165
|
s[o] = a[o].bind({ $store: n });
|
|
2160
2166
|
}), s;
|
|
2161
2167
|
}
|
|
2162
|
-
function
|
|
2168
|
+
function Ie(e) {
|
|
2163
2169
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !qt(e);
|
|
2164
2170
|
}
|
|
2165
2171
|
function mo() {
|
|
@@ -2174,18 +2180,18 @@ function mo() {
|
|
|
2174
2180
|
let s;
|
|
2175
2181
|
return M(O("el-text"), {
|
|
2176
2182
|
type: e.enum.getTag(a)
|
|
2177
|
-
},
|
|
2183
|
+
}, Ie(s = e.enum.getName(a)) ? s : {
|
|
2178
2184
|
default: () => [s]
|
|
2179
2185
|
});
|
|
2180
2186
|
}
|
|
2181
|
-
return M(O("el-text"), null,
|
|
2187
|
+
return M(O("el-text"), null, Ie(n = e.enum.getName(a)) ? n : {
|
|
2182
2188
|
default: () => [n]
|
|
2183
2189
|
});
|
|
2184
2190
|
}
|
|
2185
2191
|
}), ke.renderer.add("InputNumber", {
|
|
2186
2192
|
// 默认显示模板
|
|
2187
2193
|
renderTableDefault(e, t) {
|
|
2188
|
-
return M(
|
|
2194
|
+
return M(Ft, ue({
|
|
2189
2195
|
modelValue: t.row[t.column.field],
|
|
2190
2196
|
"onUpdate:modelValue": (n) => t.row[t.column.field] = n
|
|
2191
2197
|
}, e.props, {
|
|
@@ -2200,7 +2206,7 @@ function mo() {
|
|
|
2200
2206
|
locale: n
|
|
2201
2207
|
} = pe();
|
|
2202
2208
|
let a = n.value == "zh_cn";
|
|
2203
|
-
return M(
|
|
2209
|
+
return M(It, {
|
|
2204
2210
|
type: t.row[t.column.field] ? "success" : "danger"
|
|
2205
2211
|
}, {
|
|
2206
2212
|
default: () => [t.row[t.column.field] ? a ? "是" : "YES" : a ? "否" : "NO"]
|
|
@@ -2219,7 +2225,7 @@ function mo() {
|
|
|
2219
2225
|
// 默认显示模板
|
|
2220
2226
|
renderTableDefault(e, t) {
|
|
2221
2227
|
let n = t.column.field;
|
|
2222
|
-
const a =
|
|
2228
|
+
const a = jt(), {
|
|
2223
2229
|
multiple: s,
|
|
2224
2230
|
to: o,
|
|
2225
2231
|
openType: l = "system"
|
|
@@ -2238,7 +2244,7 @@ function mo() {
|
|
|
2238
2244
|
underline: "never",
|
|
2239
2245
|
type: "primary",
|
|
2240
2246
|
onclick: () => i(l == "stystem" ? o : m, m)
|
|
2241
|
-
},
|
|
2247
|
+
}, Ie(m) ? m : {
|
|
2242
2248
|
default: () => [m]
|
|
2243
2249
|
}), v < y.length - 1 ? "," : ""]));
|
|
2244
2250
|
}
|
|
@@ -2246,7 +2252,7 @@ function mo() {
|
|
|
2246
2252
|
underline: "never",
|
|
2247
2253
|
type: "primary",
|
|
2248
2254
|
onclick: () => i(l == "stystem" ? o : r, r)
|
|
2249
|
-
},
|
|
2255
|
+
}, Ie(r) ? r : {
|
|
2250
2256
|
default: () => [r]
|
|
2251
2257
|
});
|
|
2252
2258
|
}
|
|
@@ -2273,7 +2279,7 @@ export {
|
|
|
2273
2279
|
Wn as createImportFields,
|
|
2274
2280
|
Nn as createListPageId,
|
|
2275
2281
|
Ae as en_us,
|
|
2276
|
-
|
|
2282
|
+
Un as exportExcel,
|
|
2277
2283
|
on as exportExcelMuilti,
|
|
2278
2284
|
Ye as getI18n,
|
|
2279
2285
|
Ce as getI18nT,
|
|
@@ -2287,7 +2293,7 @@ export {
|
|
|
2287
2293
|
Qn as resetListPageConfig,
|
|
2288
2294
|
Xn as setListPageConfig,
|
|
2289
2295
|
Zt as setupI18n,
|
|
2290
|
-
|
|
2296
|
+
jn as sleep,
|
|
2291
2297
|
pt as stringToArray,
|
|
2292
2298
|
Yn as stripHtmlTags,
|
|
2293
2299
|
Kn as unicode2Str,
|