joy-admin-components 0.2.34 → 0.2.36
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 +132 -132
- package/dist/joy-admin-components.umd.js +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -61,19 +61,19 @@ var ht = { exports: {} };
|
|
|
61
61
|
i.parse = function(c) {
|
|
62
62
|
c.utc && (this.$u = !0), this.$utils().u(c.$offset) || (this.$offset = c.$offset), p.call(this, c);
|
|
63
63
|
};
|
|
64
|
-
var
|
|
64
|
+
var b = i.init;
|
|
65
65
|
i.init = function() {
|
|
66
66
|
if (this.$u) {
|
|
67
67
|
var c = this.$d;
|
|
68
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
|
+
b.call(this);
|
|
71
71
|
};
|
|
72
|
-
var
|
|
72
|
+
var y = i.utcOffset;
|
|
73
73
|
i.utcOffset = function(c, h) {
|
|
74
74
|
var x = this.$utils().u;
|
|
75
75
|
if (x(c))
|
|
76
|
-
return this.$u ? 0 : x(this.$offset) ?
|
|
76
|
+
return this.$u ? 0 : x(this.$offset) ? y.call(this) : this.$offset;
|
|
77
77
|
if (typeof c == "string" && (c = function(V) {
|
|
78
78
|
V === void 0 && (V = "");
|
|
79
79
|
var B = V.match(a);
|
|
@@ -144,8 +144,8 @@ var mt = { exports: {} };
|
|
|
144
144
|
}
|
|
145
145
|
var V = c[3], B = V === 24 ? 0 : V, I = c[0] + "-" + c[1] + "-" + c[2] + " " + B + ":" + c[4] + ":" + c[5] + ":000", $ = +g;
|
|
146
146
|
return (l.utc(I).valueOf() - ($ -= $ % 1e3)) / 6e4;
|
|
147
|
-
},
|
|
148
|
-
|
|
147
|
+
}, b = o.prototype;
|
|
148
|
+
b.tz = function(g, m) {
|
|
149
149
|
g === void 0 && (g = r);
|
|
150
150
|
var f, c = this.utcOffset(), h = this.toDate(), x = h.toLocaleString("en-US", { timeZone: g }), k = Math.round((h - new Date(x)) / 1e3 / 60), C = 15 * -Math.round(h.getTimezoneOffset() / 15) - k;
|
|
151
151
|
if (!Number(C))
|
|
@@ -155,28 +155,28 @@ var mt = { exports: {} };
|
|
|
155
155
|
f = f.add(c - E, "minute");
|
|
156
156
|
}
|
|
157
157
|
return f.$x.$timezone = g, f;
|
|
158
|
-
},
|
|
158
|
+
}, b.offsetName = function(g) {
|
|
159
159
|
var m = this.$x.$timezone || l.tz.guess(), f = i(this.valueOf(), m, { timeZoneName: g }).find(function(c) {
|
|
160
160
|
return c.type.toLowerCase() === "timezonename";
|
|
161
161
|
});
|
|
162
162
|
return f && f.value;
|
|
163
163
|
};
|
|
164
|
-
var
|
|
165
|
-
|
|
164
|
+
var y = b.startOf;
|
|
165
|
+
b.startOf = function(g, m) {
|
|
166
166
|
if (!this.$x || !this.$x.$timezone)
|
|
167
|
-
return
|
|
167
|
+
return y.call(this, g, m);
|
|
168
168
|
var f = l(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
|
|
169
|
-
return
|
|
169
|
+
return y.call(f, g, m).tz(this.$x.$timezone, !0);
|
|
170
170
|
}, l.tz = function(g, m, f) {
|
|
171
171
|
var c = f && m, h = f || m || r, x = p(+l(), h);
|
|
172
172
|
if (typeof g != "string")
|
|
173
173
|
return l(g).tz(h);
|
|
174
174
|
var k = function(B, I, $) {
|
|
175
|
-
var W = B - 60 * I * 1e3,
|
|
176
|
-
if (I ===
|
|
175
|
+
var W = B - 60 * I * 1e3, v = p(W, $);
|
|
176
|
+
if (I === v)
|
|
177
177
|
return [W, I];
|
|
178
|
-
var
|
|
179
|
-
return
|
|
178
|
+
var w = p(W -= 60 * (v - I) * 1e3, $);
|
|
179
|
+
return v === w ? [W, v] : [B - 60 * Math.min(v, w) * 1e3, Math.max(v, w)];
|
|
180
180
|
}(l.utc(g, c).valueOf(), x, h), C = k[0], E = k[1], V = l(C).utcOffset(E);
|
|
181
181
|
return V.$x.$timezone = h, V;
|
|
182
182
|
}, l.tz.guess = function() {
|
|
@@ -294,13 +294,13 @@ async function qn(t, e) {
|
|
|
294
294
|
const o = {};
|
|
295
295
|
return s.eachSheet(function(l, r) {
|
|
296
296
|
const i = [];
|
|
297
|
-
l.eachRow(function(p,
|
|
298
|
-
if (
|
|
299
|
-
let
|
|
297
|
+
l.eachRow(function(p, b) {
|
|
298
|
+
if (b > a) {
|
|
299
|
+
let y = {}, g = !0;
|
|
300
300
|
Object.keys(n).forEach((m) => {
|
|
301
301
|
const f = p.getCell(n[m]).value;
|
|
302
|
-
|
|
303
|
-
}), g || i.push(
|
|
302
|
+
y[m] = f, f && (g = !1);
|
|
303
|
+
}), g || i.push(y);
|
|
304
304
|
}
|
|
305
305
|
}), o[l._name] = i;
|
|
306
306
|
}), s = null, o;
|
|
@@ -363,11 +363,11 @@ async function Xt(t, e, n, a) {
|
|
|
363
363
|
async function Qt(t, e, n, a) {
|
|
364
364
|
const { col: s, row: o, width: l, height: r } = a, { success: i, base64: p } = await en(n, 0.3);
|
|
365
365
|
if (i) {
|
|
366
|
-
const
|
|
366
|
+
const b = t.addImage({
|
|
367
367
|
base64: p,
|
|
368
368
|
extension: "jpeg"
|
|
369
369
|
});
|
|
370
|
-
e.addImage(
|
|
370
|
+
e.addImage(b, {
|
|
371
371
|
tl: { col: s, row: o },
|
|
372
372
|
ext: { width: l, height: r }
|
|
373
373
|
});
|
|
@@ -402,14 +402,14 @@ async function tn(t, e) {
|
|
|
402
402
|
if (l.state == "visible") {
|
|
403
403
|
const i = [], p = n[l._name];
|
|
404
404
|
if (p) {
|
|
405
|
-
let
|
|
406
|
-
|
|
405
|
+
let b = Object.values(p).some((g) => g.includes("image")), y = {};
|
|
406
|
+
b && (l.getImages().forEach((m) => {
|
|
407
407
|
const { tl: f } = m.range, c = s.model.media.find((h) => h.index === m.imageId);
|
|
408
408
|
if (c) {
|
|
409
409
|
const h = c.buffer.toString("base64"), x = `data:image/${c.extension};base64,${h}`, k = `${Math.ceil(f.row)}_${Math.ceil(f.col)}`;
|
|
410
|
-
|
|
410
|
+
y[k] ? y[k].push(x) : y[k] = [x];
|
|
411
411
|
}
|
|
412
|
-
}), console.log("withImages-imageMap",
|
|
412
|
+
}), console.log("withImages-imageMap", y)), l.eachRow(function(g, m) {
|
|
413
413
|
if (m > a) {
|
|
414
414
|
let f = {}, c = !0;
|
|
415
415
|
Object.keys(p).forEach((h) => {
|
|
@@ -417,9 +417,9 @@ async function tn(t, e) {
|
|
|
417
417
|
let [x, k] = p[h].split(Ue);
|
|
418
418
|
const C = g.getCell(x);
|
|
419
419
|
let E;
|
|
420
|
-
if (k == "image" &&
|
|
420
|
+
if (k == "image" && b) {
|
|
421
421
|
const B = C._column._number, I = `${m}_${B}`;
|
|
422
|
-
E =
|
|
422
|
+
E = y[I] || "";
|
|
423
423
|
} else
|
|
424
424
|
C.result != null ? E = C.result : (V = C.value) != null && V.richText ? E = C.value.richText.reduce((B, I) => B + I.text, "") : C.type == 4 && C.value ? E = $e(C.value).utc().format("YYYY-MM-DD HH:mm:ss") : E = C.value;
|
|
425
425
|
E && k == "option" && (E = E.split(Ue)[1]), f[h] = E, E && (c = !1);
|
|
@@ -438,11 +438,11 @@ async function nn(t, e) {
|
|
|
438
438
|
const { columnWidth: o } = gt, { tableHeader: l, tableData: r } = e[a._name];
|
|
439
439
|
l.forEach((i) => {
|
|
440
440
|
if (i.required) {
|
|
441
|
-
const p = i.style || {}, { font:
|
|
441
|
+
const p = i.style || {}, { font: b = {} } = p;
|
|
442
442
|
i.style = {
|
|
443
443
|
...p,
|
|
444
444
|
font: {
|
|
445
|
-
...
|
|
445
|
+
...b,
|
|
446
446
|
color: {
|
|
447
447
|
argb: "FFFF0000"
|
|
448
448
|
}
|
|
@@ -450,15 +450,15 @@ async function nn(t, e) {
|
|
|
450
450
|
};
|
|
451
451
|
}
|
|
452
452
|
}), a.columns = l, a.addRows(r), l.forEach((i) => {
|
|
453
|
-
const { header: p, key:
|
|
454
|
-
if (m.width =
|
|
455
|
-
const f = n.addWorksheet(
|
|
453
|
+
const { header: p, key: b, width: y, option: g } = i, m = a.getColumn(b);
|
|
454
|
+
if (m.width = y || o, g) {
|
|
455
|
+
const f = n.addWorksheet(b);
|
|
456
456
|
f.state = "hidden", f.getColumn(1).values = g.map((c) => `${c.label}${Ue}${c.value}`), Array(100).fill("").forEach((c, h) => {
|
|
457
457
|
if (h > 0) {
|
|
458
458
|
const x = Ce();
|
|
459
459
|
a.getCell(`${m.letter}${h}`).dataValidation = {
|
|
460
460
|
type: "list",
|
|
461
|
-
formulae: [`${
|
|
461
|
+
formulae: [`${b}!$A$1:$A$${g.length}`],
|
|
462
462
|
showErrorMessage: !0,
|
|
463
463
|
error: x("excel.invalidInput"),
|
|
464
464
|
errorStyle: "stop",
|
|
@@ -644,100 +644,100 @@ const Se = (t, e) => {
|
|
|
644
644
|
const n = t, a = Ft(), { t: s, locale: o } = pe(), l = Tt(t, "modelValue"), r = ce(() => a["value-key"] != null), i = U(""), p = ce(() => {
|
|
645
645
|
if (a.remote !== void 0)
|
|
646
646
|
return n.data;
|
|
647
|
-
const
|
|
648
|
-
if (
|
|
647
|
+
const v = pt(i.value), { data: w, labelValue: G } = n, ee = w || g.value;
|
|
648
|
+
if (v.length == 0)
|
|
649
649
|
return ee;
|
|
650
650
|
const { label: _, labelEn: ye } = G;
|
|
651
651
|
let z = o.value == "en_us" ? ye || "i18nName" : _;
|
|
652
|
-
return
|
|
653
|
-
(ue) => ue[z].toLowerCase().includes(
|
|
652
|
+
return v.length == 1 ? ee.filter(
|
|
653
|
+
(ue) => ue[z].toLowerCase().includes(v[0].toLowerCase())
|
|
654
654
|
) : ee.filter((ue) => {
|
|
655
655
|
let ve = !1;
|
|
656
|
-
return ve =
|
|
656
|
+
return ve = v.some((Ee) => ue[z].toLowerCase() == Ee.toLowerCase()), ve;
|
|
657
657
|
});
|
|
658
|
-
}),
|
|
658
|
+
}), b = ce({
|
|
659
659
|
get() {
|
|
660
660
|
return a.multiple == null || l.value == null ? !1 : l.value.length == p.value.length;
|
|
661
661
|
},
|
|
662
|
-
set(
|
|
663
|
-
return
|
|
662
|
+
set(v) {
|
|
663
|
+
return v;
|
|
664
664
|
}
|
|
665
|
-
}),
|
|
666
|
-
const { data:
|
|
667
|
-
g.value = [...
|
|
665
|
+
}), y = e, g = U([]), m = async () => {
|
|
666
|
+
const { data: v } = await n.api();
|
|
667
|
+
g.value = [...v], y("success", g);
|
|
668
668
|
};
|
|
669
669
|
n.api && m();
|
|
670
|
-
function f(
|
|
671
|
-
|
|
670
|
+
function f(v) {
|
|
671
|
+
y("change", v), c.value && we(() => {
|
|
672
672
|
n.optionClick && n.optionClick(c.value), c.value = null;
|
|
673
673
|
});
|
|
674
674
|
}
|
|
675
675
|
const c = U(null);
|
|
676
|
-
function h(
|
|
677
|
-
c.value =
|
|
676
|
+
function h(v) {
|
|
677
|
+
c.value = v;
|
|
678
678
|
}
|
|
679
|
-
const x = n.labelValue.label.split("-"), k = (
|
|
679
|
+
const x = n.labelValue.label.split("-"), k = (v) => {
|
|
680
680
|
if (x.length == 1) {
|
|
681
681
|
if (n.changeLocal)
|
|
682
|
-
return s(
|
|
683
|
-
let
|
|
684
|
-
return
|
|
682
|
+
return s(v[n.labelValue.label]);
|
|
683
|
+
let w = o.value == "en_us" ? v[n.labelValue.labelEn || "i18nName"] : v[n.labelValue.label];
|
|
684
|
+
return w = w || v[n.labelValue.label], w + "";
|
|
685
685
|
} else {
|
|
686
|
-
let
|
|
686
|
+
let w = [];
|
|
687
687
|
return x.forEach((G) => {
|
|
688
|
-
|
|
689
|
-
}),
|
|
688
|
+
w.push(v[G]);
|
|
689
|
+
}), w.join("-");
|
|
690
690
|
}
|
|
691
691
|
};
|
|
692
|
-
function C(
|
|
693
|
-
let
|
|
694
|
-
l.value =
|
|
695
|
-
|
|
692
|
+
function C(v) {
|
|
693
|
+
let w = n.data ? n.data : g.value;
|
|
694
|
+
l.value = v ? w.map((G) => r.value ? G : G[n.labelValue.value]) : [], we(() => {
|
|
695
|
+
y("change", l.value), y("changeAll", l.value, w);
|
|
696
696
|
});
|
|
697
697
|
}
|
|
698
|
-
function E(
|
|
699
|
-
|
|
700
|
-
n.optionClick && n.optionClick(
|
|
698
|
+
function E(v) {
|
|
699
|
+
y("change", r.value ? v : v[n.labelValue.value]), we(() => {
|
|
700
|
+
n.optionClick && n.optionClick(v);
|
|
701
701
|
});
|
|
702
702
|
}
|
|
703
|
-
function V(
|
|
704
|
-
return l.value.length >= n.maxLimit && !l.value.includes(
|
|
703
|
+
function V(v) {
|
|
704
|
+
return l.value.length >= n.maxLimit && !l.value.includes(v[n.labelValue.value]);
|
|
705
705
|
}
|
|
706
|
-
function B(
|
|
707
|
-
return
|
|
708
|
-
...
|
|
709
|
-
label: k(
|
|
710
|
-
value: r.value ?
|
|
706
|
+
function B(v) {
|
|
707
|
+
return v.map((w) => ({
|
|
708
|
+
...w,
|
|
709
|
+
label: k(w),
|
|
710
|
+
value: r.value ? w : w[n.labelValue.value]
|
|
711
711
|
}));
|
|
712
712
|
}
|
|
713
713
|
const I = U([]), $ = n.data ? n.data : g.value;
|
|
714
714
|
I.value = B($), Re(
|
|
715
715
|
() => n.data ? n.data : g.value,
|
|
716
|
-
(
|
|
716
|
+
(v) => {
|
|
717
717
|
var G;
|
|
718
|
-
const
|
|
719
|
-
if (
|
|
720
|
-
I.value =
|
|
718
|
+
const w = B(v);
|
|
719
|
+
if (w.length !== I.value.length)
|
|
720
|
+
I.value = w;
|
|
721
721
|
else {
|
|
722
722
|
let ee = !1;
|
|
723
|
-
for (let _ = 0; _ <
|
|
724
|
-
if (
|
|
723
|
+
for (let _ = 0; _ < w.length; _++)
|
|
724
|
+
if (w[_].value !== ((G = I.value[_]) == null ? void 0 : G.value)) {
|
|
725
725
|
ee = !0;
|
|
726
726
|
break;
|
|
727
727
|
}
|
|
728
|
-
ee && (I.value =
|
|
728
|
+
ee && (I.value = w);
|
|
729
729
|
}
|
|
730
730
|
},
|
|
731
731
|
{ deep: !0 }
|
|
732
732
|
);
|
|
733
733
|
const W = ce(() => I.value);
|
|
734
|
-
return (
|
|
734
|
+
return (v, w) => {
|
|
735
735
|
const G = M("el-checkbox"), ee = M("el-select-v2"), _ = M("el-option"), ye = M("el-select");
|
|
736
736
|
return K(a).v2 != null ? (F(), H(ee, ge({
|
|
737
737
|
key: 0,
|
|
738
738
|
options: W.value,
|
|
739
739
|
modelValue: l.value,
|
|
740
|
-
"onUpdate:modelValue":
|
|
740
|
+
"onUpdate:modelValue": w[1] || (w[1] = (z) => l.value = z)
|
|
741
741
|
}, K(a), {
|
|
742
742
|
filterable: "",
|
|
743
743
|
"collapse-tags": "",
|
|
@@ -756,15 +756,15 @@ const Se = (t, e) => {
|
|
|
756
756
|
K(a).multiple != null ? {
|
|
757
757
|
name: "header",
|
|
758
758
|
fn: D(() => [
|
|
759
|
-
te(
|
|
759
|
+
te(v.$slots, "header", {}, () => [
|
|
760
760
|
O(G, {
|
|
761
761
|
class: "mgl20",
|
|
762
|
-
modelValue:
|
|
763
|
-
"onUpdate:modelValue":
|
|
762
|
+
modelValue: b.value,
|
|
763
|
+
"onUpdate:modelValue": w[0] || (w[0] = (z) => b.value = z),
|
|
764
764
|
onChange: C
|
|
765
765
|
}, {
|
|
766
766
|
default: D(() => [
|
|
767
|
-
ne(Q(
|
|
767
|
+
ne(Q(v.$t("quan-xuan")), 1)
|
|
768
768
|
]),
|
|
769
769
|
_: 1
|
|
770
770
|
}, 8, ["modelValue"])
|
|
@@ -775,7 +775,7 @@ const Se = (t, e) => {
|
|
|
775
775
|
]), 1040, ["options", "modelValue"])) : (F(), H(ye, ge({
|
|
776
776
|
key: 1,
|
|
777
777
|
modelValue: l.value,
|
|
778
|
-
"onUpdate:modelValue":
|
|
778
|
+
"onUpdate:modelValue": w[3] || (w[3] = (z) => l.value = z),
|
|
779
779
|
filterable: "",
|
|
780
780
|
"collapse-tags": "",
|
|
781
781
|
"collapse-tags-tooltip": "",
|
|
@@ -783,15 +783,15 @@ const Se = (t, e) => {
|
|
|
783
783
|
clearable: ""
|
|
784
784
|
}, K(a), { onClear: t.optionClick }), {
|
|
785
785
|
default: D(() => [
|
|
786
|
-
K(a).multiple != null && t.showCheckAll && t.maxLimit == null ? te(
|
|
786
|
+
K(a).multiple != null && t.showCheckAll && t.maxLimit == null ? te(v.$slots, "header", { key: 0 }, () => [
|
|
787
787
|
O(G, {
|
|
788
788
|
class: "mgl20",
|
|
789
|
-
modelValue:
|
|
790
|
-
"onUpdate:modelValue":
|
|
789
|
+
modelValue: b.value,
|
|
790
|
+
"onUpdate:modelValue": w[2] || (w[2] = (z) => b.value = z),
|
|
791
791
|
onChange: C
|
|
792
792
|
}, {
|
|
793
793
|
default: D(() => [
|
|
794
|
-
ne(Q(
|
|
794
|
+
ne(Q(v.$t("quan-xuan")), 1)
|
|
795
795
|
]),
|
|
796
796
|
_: 1
|
|
797
797
|
}, 8, ["modelValue"])
|
|
@@ -808,7 +808,7 @@ const Se = (t, e) => {
|
|
|
808
808
|
}, 16, ["modelValue", "filter-method", "onClear"]));
|
|
809
809
|
};
|
|
810
810
|
}
|
|
811
|
-
}, rn = /* @__PURE__ */ Se(sn, [["__scopeId", "data-v-
|
|
811
|
+
}, rn = /* @__PURE__ */ Se(sn, [["__scopeId", "data-v-51bd1467"]]);
|
|
812
812
|
const cn = ot({
|
|
813
813
|
props: {
|
|
814
814
|
name: {
|
|
@@ -918,8 +918,8 @@ function Pe(t) {
|
|
|
918
918
|
else if (s == "date")
|
|
919
919
|
if (r.includes("range")) {
|
|
920
920
|
const [i, p] = a;
|
|
921
|
-
let [
|
|
922
|
-
|
|
921
|
+
let [b, y] = l || [];
|
|
922
|
+
b && r == "daterange" && (b = $e(b).format("YYYY-MM-DD 00:00:00"), y = $e(y).format("YYYY-MM-DD 23:59:59")), e[i] = b, e[p] = y;
|
|
923
923
|
} else
|
|
924
924
|
e[a] = l;
|
|
925
925
|
else
|
|
@@ -940,10 +940,10 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
940
940
|
function p() {
|
|
941
941
|
s("confirm");
|
|
942
942
|
}
|
|
943
|
-
function
|
|
943
|
+
function b(h) {
|
|
944
944
|
h.option.onClear && h.option.onClear(), s("confirm");
|
|
945
945
|
}
|
|
946
|
-
function
|
|
946
|
+
function y() {
|
|
947
947
|
s("reset");
|
|
948
948
|
}
|
|
949
949
|
function g() {
|
|
@@ -982,34 +982,34 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
982
982
|
label: $.name
|
|
983
983
|
}, {
|
|
984
984
|
default: D(() => {
|
|
985
|
-
var W,
|
|
985
|
+
var W, v;
|
|
986
986
|
return [
|
|
987
987
|
$.type === "input" ? (F(), H(k, {
|
|
988
988
|
key: 0,
|
|
989
989
|
modelValue: $.value,
|
|
990
|
-
"onUpdate:modelValue": (
|
|
990
|
+
"onUpdate:modelValue": (w) => $.value = w,
|
|
991
991
|
class: qe(((W = $.option) == null ? void 0 : W.class) || "w150"),
|
|
992
992
|
placeholder: h.$t("qing-shu-ru"),
|
|
993
993
|
clearable: ""
|
|
994
994
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) : $.type === "custom" ? (F(), H(rt($.render), { key: 1 })) : de("", !0),
|
|
995
995
|
$.type === "select" ? (F(), H(rn, ge({
|
|
996
996
|
key: 2,
|
|
997
|
-
class: ((
|
|
997
|
+
class: ((v = $.option) == null ? void 0 : v.class) || "w150",
|
|
998
998
|
modelValue: $.value,
|
|
999
|
-
"onUpdate:modelValue": (
|
|
999
|
+
"onUpdate:modelValue": (w) => $.value = w
|
|
1000
1000
|
}, { ref_for: !0 }, $.option, {
|
|
1001
1001
|
onChange: p,
|
|
1002
|
-
onClear: (
|
|
1002
|
+
onClear: (w) => b($)
|
|
1003
1003
|
}), null, 16, ["class", "modelValue", "onUpdate:modelValue", "onClear"])) : de("", !0),
|
|
1004
1004
|
$.type === "date" ? (F(), H(C, {
|
|
1005
1005
|
key: 3,
|
|
1006
1006
|
class: qe({ datetimerange: "w300", daterange: "w200" }[$.dateType] || "w100"),
|
|
1007
1007
|
modelValue: $.value,
|
|
1008
|
-
"onUpdate:modelValue": (
|
|
1008
|
+
"onUpdate:modelValue": (w) => $.value = w,
|
|
1009
1009
|
"value-format": { datetimerange: "YYYY-MM-DD HH:mm:ss", daterange: "YYYY-MM-DD" }[$.dateType] || "YYYY-MM-DD",
|
|
1010
1010
|
type: $.dateType || "date",
|
|
1011
|
-
onFocus: (
|
|
1012
|
-
onChange: (
|
|
1011
|
+
onFocus: (w) => l.value = $,
|
|
1012
|
+
onChange: (w) => g(),
|
|
1013
1013
|
placeholder: h.$t("qing-xuan-ze"),
|
|
1014
1014
|
"start-placeholder": h.$t("kai-shi-shi-jian"),
|
|
1015
1015
|
"end-placeholder": h.$t("jie-shu-shi-jian")
|
|
@@ -1054,7 +1054,7 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
1054
1054
|
}),
|
|
1055
1055
|
O(I, {
|
|
1056
1056
|
type: "primary",
|
|
1057
|
-
onClick:
|
|
1057
|
+
onClick: y
|
|
1058
1058
|
}, {
|
|
1059
1059
|
default: D(() => [
|
|
1060
1060
|
ne(Q(h.$t("chong-zhi")), 1)
|
|
@@ -1156,8 +1156,8 @@ const wn = { class: "center" }, Cn = {
|
|
|
1156
1156
|
const p = ce(() => {
|
|
1157
1157
|
const d = s.path.replace(/\//g, "-").replace(/^-/, "") || "default-table";
|
|
1158
1158
|
return l.id ? `listPageId-${d}-${l.id}` : `listPageId-${d}`;
|
|
1159
|
-
}),
|
|
1160
|
-
[
|
|
1159
|
+
}), b = ct(l.searchForm.items), y = l.searchForm.pageNoKey || o.pageNoKey, g = l.searchForm.pageSizeKey || o.pageSizeKey, m = Ie({
|
|
1160
|
+
[y]: 1,
|
|
1161
1161
|
[g]: l.searchForm.defaultPageSize || o.defaultPageSize,
|
|
1162
1162
|
total: 0
|
|
1163
1163
|
}), f = U(null), c = U(null), h = U(450), x = Be(() => {
|
|
@@ -1179,7 +1179,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1179
1179
|
return u.classList.add("cell-copy-enabled"), u.setAttribute("tabindex", "-1"), u.removeEventListener("mousedown", z), u.removeEventListener("mousemove", fe), u.removeEventListener("mouseup", ue), u.removeEventListener("keydown", Fe), u.addEventListener("mousedown", z), u.addEventListener("mousemove", fe), u.addEventListener("mouseup", ue), u.addEventListener("keydown", Fe), !0;
|
|
1180
1180
|
};
|
|
1181
1181
|
lt(() => {
|
|
1182
|
-
x(), window.addEventListener("resize", k), l.searchForm.enableCellCopy && (document.addEventListener("mouseup", Ne), document.addEventListener("mousedown", We), setTimeout(() => {
|
|
1182
|
+
x(), window.addEventListener("resize", k), (l.searchForm.enableCellCopy || o.enableCellCopy) && (document.addEventListener("mouseup", Ne), document.addEventListener("mousedown", We), setTimeout(() => {
|
|
1183
1183
|
C();
|
|
1184
1184
|
}, 500));
|
|
1185
1185
|
}), Ot(() => {
|
|
@@ -1200,7 +1200,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1200
1200
|
let V;
|
|
1201
1201
|
async function B(d) {
|
|
1202
1202
|
const { dataFormat: u } = l.tableConfig;
|
|
1203
|
-
d[
|
|
1203
|
+
d[y] != 1 && (d.nextSearchAfter = V), r.value = !0;
|
|
1204
1204
|
const { code: S, data: T = {} } = await l.api(d).finally(() => {
|
|
1205
1205
|
r.value = !1, l.searchForm.selections = [];
|
|
1206
1206
|
});
|
|
@@ -1217,7 +1217,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1217
1217
|
Z = T[q];
|
|
1218
1218
|
break;
|
|
1219
1219
|
}
|
|
1220
|
-
i.value = u ? u(P) : P, m.total = Z, V = T.nextSearchAfter, l.searchForm.enableCellCopy && we(() => {
|
|
1220
|
+
i.value = u ? u(P) : P, m.total = Z, V = T.nextSearchAfter, (l.searchForm.enableCellCopy || o.enableCellCopy) && we(() => {
|
|
1221
1221
|
setTimeout(() => {
|
|
1222
1222
|
C();
|
|
1223
1223
|
}, 100);
|
|
@@ -1236,7 +1236,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1236
1236
|
function $() {
|
|
1237
1237
|
const { reset: d } = l.tableConfig;
|
|
1238
1238
|
d && d(), l.searchForm.items.forEach((u) => {
|
|
1239
|
-
const S =
|
|
1239
|
+
const S = b.find((T) => Qe(u.key) && Qe(T.key) ? u.key.join(",") == T.key.join(",") : T.key == u.key);
|
|
1240
1240
|
S && (u.value = S.value);
|
|
1241
1241
|
}), I();
|
|
1242
1242
|
}
|
|
@@ -1244,10 +1244,10 @@ const wn = { class: "center" }, Cn = {
|
|
|
1244
1244
|
function W() {
|
|
1245
1245
|
return { ...m, ...Pe(l.searchForm.items) };
|
|
1246
1246
|
}
|
|
1247
|
-
const
|
|
1247
|
+
const v = () => {
|
|
1248
1248
|
const d = f.value;
|
|
1249
1249
|
d && d.clearSort();
|
|
1250
|
-
},
|
|
1250
|
+
}, w = Ie({
|
|
1251
1251
|
storage: !0
|
|
1252
1252
|
}), G = Ie({
|
|
1253
1253
|
drag: !0,
|
|
@@ -1258,7 +1258,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1258
1258
|
return {
|
|
1259
1259
|
headerAlign: "left",
|
|
1260
1260
|
align: "center",
|
|
1261
|
-
customConfig: { ...
|
|
1261
|
+
customConfig: { ...w, ...d },
|
|
1262
1262
|
columnConfig: { ...G, ...u },
|
|
1263
1263
|
// 列过多时 自动宽度 虚拟滚动会闪屏 关闭虚拟滚动
|
|
1264
1264
|
"virtual-x-config": {
|
|
@@ -1471,7 +1471,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1471
1471
|
console.error("复制失败:", A);
|
|
1472
1472
|
}
|
|
1473
1473
|
}, Fe = (d) => {
|
|
1474
|
-
l.searchForm.enableCellCopy && ((d.ctrlKey || d.metaKey) && d.key === "c" ? _.selectedCells.length > 0 && (d.preventDefault(), d.stopPropagation(), wt()) : d.key === "Escape" && ve());
|
|
1474
|
+
!l.searchForm.enableCellCopy && !o.enableCellCopy || ((d.ctrlKey || d.metaKey) && d.key === "c" ? _.selectedCells.length > 0 && (d.preventDefault(), d.stopPropagation(), wt()) : d.key === "Escape" && ve());
|
|
1475
1475
|
}, Ne = () => {
|
|
1476
1476
|
_.isSelecting = !1;
|
|
1477
1477
|
}, We = (d) => {
|
|
@@ -1480,9 +1480,9 @@ const wn = { class: "center" }, Cn = {
|
|
|
1480
1480
|
return;
|
|
1481
1481
|
u.$el.contains(d.target) || ve();
|
|
1482
1482
|
}, Ct = (d) => {
|
|
1483
|
-
m[
|
|
1483
|
+
m[y] = d, I();
|
|
1484
1484
|
}, xt = (d) => {
|
|
1485
|
-
m[g] = d, m[
|
|
1485
|
+
m[g] = d, m[y] = 1, I();
|
|
1486
1486
|
};
|
|
1487
1487
|
function Ze() {
|
|
1488
1488
|
const d = f.value.getCheckboxRecords();
|
|
@@ -1496,7 +1496,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1496
1496
|
l.searchForm.selections = S;
|
|
1497
1497
|
}
|
|
1498
1498
|
};
|
|
1499
|
-
return e({ tableRef: f, getList: I, getPrm: W, clearSort:
|
|
1499
|
+
return e({ tableRef: f, getList: I, getPrm: W, clearSort: v, calculateTableHeight: x }), (d, u) => {
|
|
1500
1500
|
var A;
|
|
1501
1501
|
const S = M("el-button"), T = M("el-checkbox"), P = M("el-text"), Z = M("vxe-column"), q = M("VxeTable"), se = M("el-pagination");
|
|
1502
1502
|
return F(), ie("div", {
|
|
@@ -1586,8 +1586,8 @@ const wn = { class: "center" }, Cn = {
|
|
|
1586
1586
|
], 512),
|
|
1587
1587
|
t.searchForm.showPage ? (F(), H(se, {
|
|
1588
1588
|
key: 1,
|
|
1589
|
-
"current-page": m[K(
|
|
1590
|
-
"onUpdate:currentPage": u[2] || (u[2] = (L) => m[K(
|
|
1589
|
+
"current-page": m[K(y)],
|
|
1590
|
+
"onUpdate:currentPage": u[2] || (u[2] = (L) => m[K(y)] = L),
|
|
1591
1591
|
class: "myPagination mgt10",
|
|
1592
1592
|
background: "",
|
|
1593
1593
|
layout: "total, sizes, prev, pager, next",
|
|
@@ -1600,7 +1600,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1600
1600
|
], 2);
|
|
1601
1601
|
};
|
|
1602
1602
|
}
|
|
1603
|
-
}, Qn = /* @__PURE__ */ Se(Cn, [["__scopeId", "data-v-
|
|
1603
|
+
}, Qn = /* @__PURE__ */ Se(Cn, [["__scopeId", "data-v-c022c16d"]]), eo = {
|
|
1604
1604
|
__name: "index",
|
|
1605
1605
|
props: {
|
|
1606
1606
|
sheetsConfig: {
|
|
@@ -1674,7 +1674,7 @@ async function tt(t) {
|
|
|
1674
1674
|
y: 0
|
|
1675
1675
|
}
|
|
1676
1676
|
};
|
|
1677
|
-
n.addEventListener("mousedown", i), document.addEventListener("mousemove", p), document.addEventListener("mouseup",
|
|
1677
|
+
n.addEventListener("mousedown", i), document.addEventListener("mousemove", p), document.addEventListener("mouseup", b), window.addEventListener("resize", y);
|
|
1678
1678
|
function l() {
|
|
1679
1679
|
o.mouse.x - o.drag.x >= o.dialog.x && (o.drag.x = o.mouse.x - o.dialog.x), o.drag.x - o.mouse.x >= o.window.width - (o.dialog.x + o.dialog.width) && (o.drag.x = o.mouse.x + o.window.width - o.dialog.x - o.dialog.width), o.mouse.y - o.drag.y >= o.dialog.y && (o.drag.y = o.mouse.y - o.dialog.y), o.drag.y - o.mouse.y >= o.window.height - (o.dialog.y + o.dialog.height) && (o.drag.y = o.mouse.y + o.window.height - o.dialog.y - o.dialog.height), r();
|
|
1680
1680
|
}
|
|
@@ -1697,10 +1697,10 @@ async function tt(t) {
|
|
|
1697
1697
|
y: m.clientY
|
|
1698
1698
|
}, a.style.userSelect = "none", l());
|
|
1699
1699
|
}
|
|
1700
|
-
function
|
|
1700
|
+
function b(m) {
|
|
1701
1701
|
a.style.userSelect = "auto", s = !1;
|
|
1702
1702
|
}
|
|
1703
|
-
function
|
|
1703
|
+
function y(m) {
|
|
1704
1704
|
}
|
|
1705
1705
|
function g() {
|
|
1706
1706
|
return new Promise((m, f) => {
|
|
@@ -1709,7 +1709,7 @@ async function tt(t) {
|
|
|
1709
1709
|
}, 500);
|
|
1710
1710
|
});
|
|
1711
1711
|
}
|
|
1712
|
-
t.__mouseDown__ = i, t.__mouseUp__ =
|
|
1712
|
+
t.__mouseDown__ = i, t.__mouseUp__ = b, t.__mouseMove__ = p, t.__sizeChange__ = y;
|
|
1713
1713
|
}
|
|
1714
1714
|
function nt(t) {
|
|
1715
1715
|
document.removeEventListener("mousedown", t.__mouseDown__), document.removeEventListener("mousemove", t.__mouseMove__), document.removeEventListener("mouseup", t.__mouseUp__), window.removeEventListener("resize", t.__sizeChange__);
|
|
@@ -1749,8 +1749,8 @@ const kn = {
|
|
|
1749
1749
|
}) == "confirm" && (n.layer.show = !1) : n.layer.show = !1;
|
|
1750
1750
|
}
|
|
1751
1751
|
return (r, i) => {
|
|
1752
|
-
const p = M("el-button"),
|
|
1753
|
-
return t.layer.type ? (F(), H(
|
|
1752
|
+
const p = M("el-button"), b = M("el-drawer"), y = M("el-dialog");
|
|
1753
|
+
return t.layer.type ? (F(), H(b, {
|
|
1754
1754
|
key: 0,
|
|
1755
1755
|
modelValue: t.layer.show,
|
|
1756
1756
|
"onUpdate:modelValue": i[0] || (i[0] = (g) => t.layer.show = g),
|
|
@@ -1787,7 +1787,7 @@ const kn = {
|
|
|
1787
1787
|
]),
|
|
1788
1788
|
_: 3
|
|
1789
1789
|
}, 8, ["modelValue", "size", "title"])) : Vt((F(), ie("div", _n, [
|
|
1790
|
-
O(
|
|
1790
|
+
O(y, {
|
|
1791
1791
|
"close-on-click-modal": !1,
|
|
1792
1792
|
modelValue: t.layer.show,
|
|
1793
1793
|
"onUpdate:modelValue": i[1] || (i[1] = (g) => t.layer.show = g),
|
|
@@ -1840,12 +1840,12 @@ function no(t, e = {}) {
|
|
|
1840
1840
|
password: /(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/,
|
|
1841
1841
|
email: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
|
|
1842
1842
|
}[t], { inForm: o, value: l, required: r, msg: i = n("validate.invalidInput") } = a;
|
|
1843
|
-
return o ? function(p,
|
|
1843
|
+
return o ? function(p, b, y) {
|
|
1844
1844
|
if (r) {
|
|
1845
|
-
s.test(
|
|
1845
|
+
s.test(b) ? y() : y(new Error(i));
|
|
1846
1846
|
return;
|
|
1847
1847
|
}
|
|
1848
|
-
|
|
1848
|
+
b && !s.test(b) ? y(new Error(i)) : y();
|
|
1849
1849
|
} : s.test(l);
|
|
1850
1850
|
}
|
|
1851
1851
|
class oo {
|
|
@@ -2061,9 +2061,9 @@ function lo(t, e = {}) {
|
|
|
2061
2061
|
log: !1,
|
|
2062
2062
|
params: null,
|
|
2063
2063
|
format: null
|
|
2064
|
-
}, e), { manual: s, log: o, params: l = {}, cb: r, format: i } = a, p = U([]),
|
|
2064
|
+
}, e), { manual: s, log: o, params: l = {}, cb: r, format: i } = a, p = U([]), b = U(!1), y = (g) => {
|
|
2065
2065
|
const m = g || l;
|
|
2066
|
-
|
|
2066
|
+
b.value = !0, t(m).then((f) => {
|
|
2067
2067
|
const { code: c, data: h, msg: x } = f;
|
|
2068
2068
|
if (r) {
|
|
2069
2069
|
const { records: k, rows: C } = h || {}, E = k || C ? k || C : h;
|
|
@@ -2080,10 +2080,10 @@ function lo(t, e = {}) {
|
|
|
2080
2080
|
}).catch((f) => {
|
|
2081
2081
|
r && (console.log("useRequestErr", f), r({ code: 500 }));
|
|
2082
2082
|
}).finally(() => {
|
|
2083
|
-
|
|
2083
|
+
b.value = !1;
|
|
2084
2084
|
});
|
|
2085
2085
|
};
|
|
2086
|
-
return s ||
|
|
2086
|
+
return s || y(), [b, p, y];
|
|
2087
2087
|
}
|
|
2088
2088
|
function ao(t) {
|
|
2089
2089
|
const e = U(t), n = U(""), a = U("");
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(p,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("element-plus"),require("vue"),require("file-saver"),require("exceljs"),require("dayjs"),require("vue-i18n"),require("lodash"),require("vue-router"),require("vuex"),require("vxe-pc-ui")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue","file-saver","exceljs","dayjs","vue-i18n","lodash","vue-router","vuex","vxe-pc-ui"],W):(p=typeof globalThis<"u"?globalThis:p||self,W(p.JoyAdminComponents={},p.ElementPlus,p.Vue,p.fileSaver,p.ExcelJS,p.dayjs,p.VueI18n,p._,p.VueRouter,p.Vuex,p.VxeUI))})(this,function(p,W,e,Le,pe,ue,ee,ne,ve,te,fe){"use strict";const Je=e.defineComponent({name:"LayOutForm",setup(o,{slots:t,attrs:n,emit:r}){const s=e.ref(null),l=()=>t.default?t.default().filter(i=>i.type!==Symbol.for("v-cmt")).map(i=>i.type===Symbol.for("v-fgt")?i.children:i).flat().map(i=>{var c;return e.h(W.ElCol,{span:((c=i.props)==null?void 0:c.span)||24},{default:()=>i})}):null;e.onMounted(()=>{r("ref",s.value)});function a(){return e.h(W.ElForm,{...n,ref:s},()=>e.h(W.ElRow,{gutter:n.gutter??20},{default:()=>l()}))}return a}});var Fe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function De(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Be={exports:{}};(function(o,t){(function(n,r){o.exports=r()})(Fe,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(l,a,i){var c=a.prototype;i.utc=function(d){var m={date:d,utc:!0,args:arguments};return new a(m)},c.utc=function(d){var m=i(this.toDate(),{locale:this.$L,utc:!0});return d?m.add(this.utcOffset(),n):m},c.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var C=c.parse;c.parse=function(d){d.utc&&(this.$u=!0),this.$utils().u(d.$offset)||(this.$offset=d.$offset),C.call(this,d)};var k=c.init;c.init=function(){if(this.$u){var d=this.$d;this.$y=d.getUTCFullYear(),this.$M=d.getUTCMonth(),this.$D=d.getUTCDate(),this.$W=d.getUTCDay(),this.$H=d.getUTCHours(),this.$m=d.getUTCMinutes(),this.$s=d.getUTCSeconds(),this.$ms=d.getUTCMilliseconds()}else k.call(this)};var w=c.utcOffset;c.utcOffset=function(d,m){var S=this.$utils().u;if(S(d))return this.$u?0:S(this.$offset)?w.call(this):this.$offset;if(typeof d=="string"&&(d=function(B){B===void 0&&(B="");var A=B.match(r);if(!A)return null;var L=(""+A[0]).match(s)||["-",0,0],E=L[0],U=60*+L[1]+ +L[2];return U===0?0:E==="+"?U:-U}(d),d===null))return this;var $=Math.abs(d)<=16?60*d:d;if($===0)return this.utc(m);var _=this.clone();if(m)return _.$offset=$,_.$u=!1,_;var I=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(_=this.local().add($+I,n)).$offset=$,_.$x.$localOffset=I,_};var y=c.format;c.format=function(d){var m=d||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return y.call(this,m)},c.valueOf=function(){var d=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*d},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var g=c.toDate;c.toDate=function(d){return d==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var h=c.diff;c.diff=function(d,m,S){if(d&&this.$u===d.$u)return h.call(this,d,m,S);var $=this.local(),_=i(d).local();return h.call($,_,m,S)}}})})(Be);var Xe=Be.exports;const Qe=De(Xe);var ze={exports:{}};(function(o,t){(function(n,r){o.exports=r()})(Fe,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(s,l,a){var i,c=function(y,g,h){h===void 0&&(h={});var d=new Date(y),m=function(S,$){$===void 0&&($={});var _=$.timeZoneName||"short",I=S+"|"+_,B=r[I];return B||(B=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:S,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:_}),r[I]=B),B}(g,h);return m.formatToParts(d)},C=function(y,g){for(var h=c(y,g),d=[],m=0;m<h.length;m+=1){var S=h[m],$=S.type,_=S.value,I=n[$];I>=0&&(d[I]=parseInt(_,10))}var B=d[3],A=B===24?0:B,L=d[0]+"-"+d[1]+"-"+d[2]+" "+A+":"+d[4]+":"+d[5]+":000",E=+y;return(a.utc(L).valueOf()-(E-=E%1e3))/6e4},k=l.prototype;k.tz=function(y,g){y===void 0&&(y=i);var h,d=this.utcOffset(),m=this.toDate(),S=m.toLocaleString("en-US",{timeZone:y}),$=Math.round((m-new Date(S))/1e3/60),_=15*-Math.round(m.getTimezoneOffset()/15)-$;if(!Number(_))h=this.utcOffset(0,g);else if(h=a(S,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(_,!0),g){var I=h.utcOffset();h=h.add(d-I,"minute")}return h.$x.$timezone=y,h},k.offsetName=function(y){var g=this.$x.$timezone||a.tz.guess(),h=c(this.valueOf(),g,{timeZoneName:y}).find(function(d){return d.type.toLowerCase()==="timezonename"});return h&&h.value};var w=k.startOf;k.startOf=function(y,g){if(!this.$x||!this.$x.$timezone)return w.call(this,y,g);var h=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return w.call(h,y,g).tz(this.$x.$timezone,!0)},a.tz=function(y,g,h){var d=h&&g,m=h||g||i,S=C(+a(),m);if(typeof y!="string")return a(y).tz(m);var $=function(A,L,E){var U=A-60*L*1e3,b=C(U,E);if(L===b)return[U,L];var x=C(U-=60*(b-L)*1e3,E);return b===x?[U,b]:[A-60*Math.min(b,x)*1e3,Math.max(b,x)]}(a.utc(y,d).valueOf(),S,m),_=$[0],I=$[1],B=a(_).utcOffset(I);return B.$x.$timezone=m,B},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(y){i=y}}})})(ze);var et=ze.exports;const tt=De(et),ye={"dao-ru":"导入","quan-xuan":"全选","xia-zai-dao-ru-mo-ban":"下载导入模板","xu-hao":"序号","qing-shu-ru":"请输入","qing-xuan-ze":"请选择","kai-shi-shi-jian":"开始时间","jie-shu-shi-jian":"结束时间","shai-xuan":"筛选","chong-zhi":"重置","guan-bi":"关闭","zhan-kai":"展开","qu-xiao":"取消","ti-jiao":"提交","que-ding":"确定","que-ding-guan-bi-ma":"确定关闭吗","xia-zai-dao-ru-mo-ban":"下载导入模板",excel:{fieldsMappingRequired:"请输入列字段映射",invalidInput:"非法输入",invalidOption:"请输入有效选项!",copyFailed:"复制失败",sheetNameTooLong:'Sheet名称 "{0}" 长度超过31个字符,已自动截断为 "{1}"'},validate:{invalidInput:"请输入正确内容"},tools:{keysLengthError:"keys 长度必须大于2 默认前两位为 label value"}},Ce={"dao-ru":"Import","quan-xuan":"Select All","xia-zai-dao-ru-mo-ban":"Download Import Template","xu-hao":"No.","qing-shu-ru":"Please enter","qing-xuan-ze":"Please select","kai-shi-shi-jian":"Start Time","jie-shu-shi-jian":"End Time","shai-xuan":"Filter","chong-zhi":"Reset","guan-bi":"Collapse","zhan-kai":"Expand","qu-xiao":"Cancel","ti-jiao":"Submit","que-ding":"Confirm","que-ding-guan-bi-ma":"Are you sure to close?","xia-zai-dao-ru-mo-ban":"Download Import Template",excel:{fieldsMappingRequired:"Please enter column field mapping",invalidInput:"Invalid input",invalidOption:"Please enter a valid option!",copyFailed:"Copy failed",sheetNameTooLong:'Sheet name "{0}" exceeds 31 characters, automatically truncated to "{1}"'},validate:{invalidInput:"Please enter valid content"},tools:{keysLengthError:"Keys length must be greater than 2, default first two are label and value"}},Me={zh_cn:ye,en_us:Ce};let ie=null;function Oe(o=null){if(o){const{global:t}=o;return t.messages.value.zh_cn?t.mergeLocaleMessage("zh_cn",ye):t.setLocaleMessage("zh_cn",ye),t.messages.value.en_us?t.mergeLocaleMessage("en_us",Ce):t.setLocaleMessage("en_us",Ce),ie=o,o}return ie||(ie=ee.createI18n({legacy:!1,locale:"zh_cn",fallbackLocale:"zh_cn",messages:Me})),ie}function be(){return ie||Oe()}function le(){return be().global.t}ue.extend(Qe),ue.extend(tt);async function ot(o,t){const{fields:n,range:r=1}=t;if(!n){const a=le();throw new Error(a("excel.fieldsMappingRequired"))}let s=new pe.Workbook;await s.xlsx.load(o);const l={};return s.eachSheet(function(a,i){const c=[];a.eachRow(function(C,k){if(k>r){let w={},y=!0;Object.keys(n).forEach(g=>{const h=C.getCell(n[g]).value;w[g]=h,h&&(y=!1)}),y||c.push(w)}}),l[a._name]=c}),s=null,l}const qe={columnWidth:30};async function nt(o,t,n=[],r={}){if(!o||!t)return;const{columnStyle:s}=r,{columnWidth:l}=qe;t.forEach(c=>{c.width=c.width?c.width:l});const{workbook:a,worksheet:i}=lt();i.columns=t,i.addRows(n),s&&await at(a,i,s);try{const c=await a.xlsx.writeBuffer(),C=new File([c],o,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Le.saveAs(C)}catch(c){console.log(c)}}function lt(){const o=new pe.Workbook;o.creator="distributor System",o.lastModifiedBy="distributor System",o.created=new Date,o.modified=new Date,o.lastPrinted=new Date;const t=o.addWorksheet("Sheet1");return{workbook:o,worksheet:t}}async function at(o,t,n){const r=Object.keys(n);for(const s of r){const l=n[s],{type:a}=l;switch(a){case"IMG":await rt(o,t,s);break}}}async function rt(o,t,n,r){const s=t.getColumn(n),l=s.values;t.getColumn(n).width=20,t.eachRow((a,i)=>{i>1&&(a.height=40)});for(let a=0,i=l.length;a<i;a++){if(a<2)continue;let c=l[a];c&&(t.getCell(s.letter+a).value="",await st(o,t,c,{width:100,height:50,col:s._number-1,row:a-1}))}}async function st(o,t,n,r){const{col:s,row:l,width:a,height:i}=r,{success:c,base64:C}=await it(n,.3);if(c){const k=o.addImage({base64:C,extension:"jpeg"});t.addImage(k,{tl:{col:s,row:l},ext:{width:a,height:i}})}}function it(o,t=1){const n=new Image;return n.setAttribute("crossOrigin","anonymous"),n.crossOrigin="anonymous",n.src=o,new Promise((r,s)=>{n.onload=()=>{const l=document.createElement("canvas");l.width=n.width,l.height=n.height,l.getContext("2d").drawImage(n,0,0,l.width,l.height),r({success:!0,base64:l.toDataURL("image/jpeg",t)})},n.onerror=()=>{r({success:!1})}})}const xe="---";async function ct(o,t){const{fields:n,range:r=1}=t;if(!n){const a=le();throw new Error(a("excel.fieldsMappingRequired"))}let s=new pe.Workbook;await s.xlsx.load(o);const l={};return s.eachSheet(function(a,i){if(a.state=="visible"){const c=[],C=n[a._name];if(C){let k=Object.values(C).some(y=>y.includes("image")),w={};k&&(a.getImages().forEach(g=>{const{tl:h}=g.range,d=s.model.media.find(m=>m.index===g.imageId);if(d){const m=d.buffer.toString("base64"),S=`data:image/${d.extension};base64,${m}`,$=`${Math.ceil(h.row)}_${Math.ceil(h.col)}`;w[$]?w[$].push(S):w[$]=[S]}}),console.log("withImages-imageMap",w)),a.eachRow(function(y,g){if(g>r){let h={},d=!0;Object.keys(C).forEach(m=>{var B;let[S,$]=C[m].split(xe);const _=y.getCell(S);let I;if($=="image"&&k){const A=_._column._number,L=`${g}_${A}`;I=w[L]||""}else _.result!=null?I=_.result:(B=_.value)!=null&&B.richText?I=_.value.richText.reduce((A,L)=>A+L.text,""):_.type==4&&_.value?I=ue(_.value).utc().format("YYYY-MM-DD HH:mm:ss"):I=_.value;I&&$=="option"&&(I=I.split(xe)[1]),h[m]=I,I&&(d=!1)}),d||c.push(h)}}),l[a._name]=c}}}),s=null,l}async function dt(o,t){if(!o||t.length==0)return;const n=ut(t);n.eachSheet(function(r,s){const{columnWidth:l}=qe,{tableHeader:a,tableData:i}=t[r._name];a.forEach(c=>{if(c.required){const C=c.style||{},{font:k={}}=C;c.style={...C,font:{...k,color:{argb:"FFFF0000"}}}}}),r.columns=a,r.addRows(i),a.forEach(c=>{const{header:C,key:k,width:w,option:y}=c,g=r.getColumn(k);if(g.width=w||l,y){const h=n.addWorksheet(k);h.state="hidden",h.getColumn(1).values=y.map(d=>`${d.label}${xe}${d.value}`),Array(100).fill("").forEach((d,m)=>{if(m>0){const S=le();r.getCell(`${g.letter}${m}`).dataValidation={type:"list",formulae:[`${k}!$A$1:$A$${y.length}`],showErrorMessage:!0,error:S("excel.invalidInput"),errorStyle:"stop",errorMessage:S("excel.invalidOption")}}})}})});try{const r=await n.xlsx.writeBuffer(),s=new File([r],o,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Le.saveAs(s)}catch(r){console.log(r)}}function ut(o){const t=le(),n=new pe.Workbook;return n.creator="distributor System",n.lastModifiedBy="distributor System",n.created=new Date,n.modified=new Date,n.lastPrinted=new Date,Object.keys(o).sort((s,l)=>{const a=o[s].sort??0,i=o[l].sort??0;return a-i}).forEach(s=>{let l=s,a=!1;/[\\/:*?\[\]]/g.test(s)&&(s=s.replace(/[\\/:*?\[\]]/g,""),a=!0),s.length>31&&(s=s.substring(0,31).trim(),a=!0,console.warn(t("excel.sheetNameTooLong",[l,s]))),a&&(o[s]=o[l],delete o[l]),n.addWorksheet(s)}),n}function ft(o){if(o<26)return String.fromCharCode(65+o);{const t=String.fromCharCode(65+Math.floor((o-26)/26)),n=String.fromCharCode(65+(o-26)%26);return t+n}}function ht(o){return new Promise(t=>{setTimeout(()=>{t()},o)})}function mt(o){return JSON.parse(JSON.stringify(o))}function gt(o){let t=[],n={},r=(s,l)=>Object.prototype.hasOwnProperty.call(s,l);for(const s of o){n[s.id]={...s,children:r(n,s.id)?n[s.id].children:[]};const l=n[s.id];s.pid==-1?t.push(l):(r(n,s.pid)||(n[s.pid]={children:[]}),n[s.pid].children.push(l))}return t}function ke(o,t=" "){return o?o.split(t).filter(n=>n.trim()):[]}class _e{constructor(t,n=["label","value","labelEn"]){this.list=t.map(r=>({...r,label:r[n[0]],labelEn:r[n[2]]??r[n[0]]??"",value:r[n[1]]})),this.map=new Map(this.list.map(r=>[r[n[1]],r]))}getName(t){if(!this.has(t))return"-";const n=be().global.locale,{label:r,labelEn:s}=this.map.get(t);return(n.value=="zh_cn"?r:s)??r??"-"}getTag(t){if(!this.has(t))return"info";const{tag:n="info"}=this.map.get(t);return n}getItem(t){return this.has(t)?this.map.get(t):null}getColor(t){if(!this.has(t))return null;const{color:n}=this.map.get(t);return n}has(t){return this.map.has(t)}}function pt(o,t=[],n="i18nName"){if(o.length==0)return new _e([]);if(t.length<2){const s=le();throw new Error(s("tools.keysLengthError"))}let r=o.map(s=>{let l={};return n&&(l.labelEn=s[n]),t.forEach((a,i)=>{i===0?l.label=s[a]:i===1?l.value=s[a]:l[a]=s[a]}),l});return new _e(r)}function yt(o){return o?o.replace(/<[^>]+>/g,""):""}function Ct(o){return o?(o.includes("\\\\u")&&(o=o.replace(/\\/g,"")),o.replace(/\\u[\dA-F]{4}/gi,t=>String.fromCharCode(parseInt(t.replace(/\\u/g,""),16)))):""}function bt(o,t=10){let n=1048576*t;return!(o.size>n)}function wt(o){return Array.from(10).fill(0).map((n,r)=>o+"_"+r)}function xt(o){let t={};return o.map((n,r)=>{let{key:s,option:l,type:a}=n,i=ft(r);l?t[s]=`${i}---option`:a==="image"?t[s]=`${i}---image`:t[s]=i}),t}function kt(o,t){return t.split(".").reduce((n,r)=>n&&n[r],o)}const lo="",he=(o,t)=>{const n=o.__vccOpts||o;for(const[r,s]of t)n[r]=s;return n},_t=["onClick"],Ne=he({__name:"index",props:e.mergeModels({api:{type:Function},showCheckAll:{type:Boolean,default:!0},maxLimit:{type:Number,default:void 0},optionClick:{type:Function,default:()=>{}},data:{type:Array},labelValue:{type:Object,default:()=>({label:"label",labelEn:"labelEn",value:"value"})},changeLocal:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["success","change","changeAll"],["update:modelValue"]),setup(o,{emit:t}){const n=o,r=e.useAttrs(),{t:s,locale:l}=ee.useI18n(),a=e.useModel(o,"modelValue"),i=e.computed(()=>r["value-key"]!=null),c=e.ref(""),C=e.computed(()=>{if(r.remote!==void 0)return n.data;const b=ke(c.value),{data:x,labelValue:Y}=n,Z=x||y.value;if(b.length==0)return Z;const{label:V,labelEn:ce}=Y;let D=l.value=="en_us"?ce||"i18nName":V;return b.length==1?Z.filter(oe=>oe[D].toLowerCase().includes(b[0].toLowerCase())):Z.filter(oe=>{let de=!1;return de=b.some(we=>oe[D].toLowerCase()==we.toLowerCase()),de})}),k=e.computed({get(){return r.multiple==null||a.value==null?!1:a.value.length==C.value.length},set(b){return b}}),w=t,y=e.ref([]),g=async()=>{const{data:b}=await n.api();y.value=[...b],w("success",y)};n.api&&g();function h(b){w("change",b),d.value&&e.nextTick(()=>{n.optionClick&&n.optionClick(d.value),d.value=null})}const d=e.ref(null);function m(b){d.value=b}const S=n.labelValue.label.split("-"),$=b=>{if(S.length==1){if(n.changeLocal)return s(b[n.labelValue.label]);let x=l.value=="en_us"?b[n.labelValue.labelEn||"i18nName"]:b[n.labelValue.label];return x=x||b[n.labelValue.label],console.log("label",x,b,l,n),x+""}else{let x=[];return S.forEach(Y=>{x.push(b[Y])}),x.join("-")}};function _(b){let x=n.data?n.data:y.value;a.value=b?x.map(Y=>i.value?Y:Y[n.labelValue.value]):[],e.nextTick(()=>{w("change",a.value),w("changeAll",a.value,x)})}function I(b){w("change",i.value?b:b[n.labelValue.value]),e.nextTick(()=>{n.optionClick&&n.optionClick(b)})}function B(b){return a.value.length>=n.maxLimit&&!a.value.includes(b[n.labelValue.value])}function A(b){return b.map(x=>({...x,label:$(x),value:i.value?x:x[n.labelValue.value]}))}const L=e.ref([]),E=n.data?n.data:y.value;L.value=A(E),e.watch(()=>n.data?n.data:y.value,b=>{var Y;const x=A(b);if(x.length!==L.value.length)L.value=x;else{let Z=!1;for(let V=0;V<x.length;V++)if(x[V].value!==((Y=L.value[V])==null?void 0:Y.value)){Z=!0;break}Z&&(L.value=x)}},{deep:!0});const U=e.computed(()=>L.value);return(b,x)=>{const Y=e.resolveComponent("el-checkbox"),Z=e.resolveComponent("el-select-v2"),V=e.resolveComponent("el-option"),ce=e.resolveComponent("el-select");return e.unref(r).v2!=null?(e.openBlock(),e.createBlock(Z,e.mergeProps({key:0,options:U.value,modelValue:a.value,"onUpdate:modelValue":x[1]||(x[1]=D=>a.value=D)},e.unref(r),{filterable:"","collapse-tags":"","collapse-tags-tooltip":"",clearable:"",onChange:h,onClear:h}),e.createSlots({default:e.withCtx(({item:D})=>[e.createElementVNode("div",{onClick:ae=>m(D)},e.toDisplayString(D.label),9,_t)]),_:2},[e.unref(r).multiple!=null?{name:"header",fn:e.withCtx(()=>[e.renderSlot(b.$slots,"header",{},()=>[e.createVNode(Y,{class:"mgl20",modelValue:k.value,"onUpdate:modelValue":x[0]||(x[0]=D=>k.value=D),onChange:_},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0)]),key:"0"}:void 0]),1040,["options","modelValue"])):(e.openBlock(),e.createBlock(ce,e.mergeProps({key:1,modelValue:a.value,"onUpdate:modelValue":x[3]||(x[3]=D=>a.value=D),filterable:"","collapse-tags":"","collapse-tags-tooltip":"","filter-method":e.unref(r).remote!=null?void 0:D=>c.value=D,clearable:""},e.unref(r),{onClear:o.optionClick}),{default:e.withCtx(()=>[e.unref(r).multiple!=null&&o.showCheckAll&&o.maxLimit==null?e.renderSlot(b.$slots,"header",{key:0},()=>[e.createVNode(Y,{class:"mgl20",modelValue:k.value,"onUpdate:modelValue":x[2]||(x[2]=D=>k.value=D),onChange:_},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(b.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(D,ae)=>(e.openBlock(),e.createBlock(V,{key:ae,label:$(D),disabled:e.unref(r).multiple!=null&&o.maxLimit>0?B(D):!1,onClick:e.withModifiers(oe=>I(D),["stop"]),value:i.value?D:D[o.labelValue.value]},null,8,["label","disabled","onClick","value"]))),128))]),_:3},16,["modelValue","filter-method","onClear"]))}}},[["__scopeId","data-v-4ba6367f"]]),ro="",St=e.defineComponent({props:{name:{tyepe:String,required:!0}}});function $t(o,t,n,r,s,l){const a=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(a,{class:"cmp-icon"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.name)))]),_:1})}const Se=he(St,[["render",$t],["__scopeId","data-v-733f9daa"]]),Vt={__name:"index",emits:["ok","no"],setup(o,{emit:t}){const n=t,r=ne.debounce(()=>{n("ok")},500);function s(){n("no")}return(l,a)=>{const i=e.resolveComponent("el-popconfirm");return e.openBlock(),e.createElementBlock("span",null,[e.createVNode(i,e.mergeProps(l.$attrs,{onConfirm:e.unref(r),onCancel:s}),{reference:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16,["onConfirm"])])}}},so="",Et=["accept"],Tt=he({__name:"index",props:{accept:{type:String,default:".xlsx,.xls"},fields:{type:Object,default:()=>({})},fileChange:{type:Function,required:!0}},emits:["fileChange"],setup(o,{emit:t}){const n=o,r=e.ref(null),s=e.ref(!1);async function l(a){s.value=!0;let i=a.target.files[0];const c=await ct(i,n.fields).catch(()=>{s.value=!1}).finally(()=>{r.value.value=null});await n.fileChange(c).finally(()=>{s.value=!1})}return(a,i)=>{const c=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("span",null,[e.createVNode(c,{loading:s.value,class:"mgr10",onClick:i[0]||(i[0]=C=>r.value.click())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("dao-ru")),1)]),_:1},8,["loading"]),e.createElementVNode("input",{onChange:l,ref_key:"input",ref:r,accept:o.accept,style:{position:"absolute",width:"0px",height:"0px",opacity:"0"},type:"file"},null,40,Et)])}}},[["__scopeId","data-v-6f9ede29"]]);function $e(o){let t={};return o.forEach(n=>{const{key:r,type:s,option:l={},value:a,dateType:i="date"}=n;if(r)if(s=="input"&&(l!=null&&l.multiple))t[r]=ke(a);else if(s=="date")if(i.includes("range")){const[c,C]=r;let[k,w]=a||[];k&&i=="daterange"&&(k=ue(k).format("YYYY-MM-DD 00:00:00"),w=ue(w).format("YYYY-MM-DD 23:59:59")),t[c]=k,t[C]=w}else t[r]=a;else t[r]=a}),t}const co="",It={key:0},Lt={class:"btns"},vt={class:"left"},Ft={class:"right"},Ae=he({__name:"index",props:{form:{type:Object,required:!0}},emits:["confirm","reset","visibleChange"],setup(o,{expose:t,emit:n}){const r=o,s=n,l=e.ref(!0),a=e.ref(null),{t:i}=ee.useI18n(),c=e.computed(()=>l.value?i("guan-bi"):i("zhan-kai"));function C(){s("confirm")}function k(m){m.option.onClear&&m.option.onClear(),s("confirm")}function w(){s("reset")}function y(){s("confirm")}function g(){return $e(r.form.items)}const h=ne.cloneDeep(r.form.items);function d(){r.form.items.forEach(m=>{const S=h.find($=>$.key==m.key);S&&(m.value=S.value)})}return t({getPrm:g,reset:d}),(m,S)=>{const $=e.resolveComponent("el-input"),_=e.resolveComponent("el-date-picker"),I=e.resolveComponent("el-form-item"),B=e.resolveComponent("el-form"),A=e.resolveComponent("el-link"),L=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",{class:"searchBar-container mgt10 mgb10",onKeydown:e.withKeys(C,["enter"])},[e.createElementVNode("div",{class:"searchBar",style:e.normalizeStyle({height:l.value?"auto":"42px"})},[e.createVNode(B,{inline:"",model:o.form.data},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.form.items.filter(E=>!E.hidden),E=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:E.key},[E.type=="br"?(e.openBlock(),e.createElementBlock("br",It)):(e.openBlock(),e.createBlock(I,{key:1,label:E.name},{default:e.withCtx(()=>{var U,b;return[E.type==="input"?(e.openBlock(),e.createBlock($,{key:0,modelValue:E.value,"onUpdate:modelValue":x=>E.value=x,class:e.normalizeClass(((U=E.option)==null?void 0:U.class)||"w150"),placeholder:m.$t("qing-shu-ru"),clearable:""},null,8,["modelValue","onUpdate:modelValue","class","placeholder"])):E.type==="custom"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(E.render),{key:1})):e.createCommentVNode("",!0),E.type==="select"?(e.openBlock(),e.createBlock(Ne,e.mergeProps({key:2,class:((b=E.option)==null?void 0:b.class)||"w150",modelValue:E.value,"onUpdate:modelValue":x=>E.value=x},{ref_for:!0},E.option,{onChange:C,onClear:x=>k(E)}),null,16,["class","modelValue","onUpdate:modelValue","onClear"])):e.createCommentVNode("",!0),E.type==="date"?(e.openBlock(),e.createBlock(_,{key:3,class:e.normalizeClass({datetimerange:"w300",daterange:"w200"}[E.dateType]||"w100"),modelValue:E.value,"onUpdate:modelValue":x=>E.value=x,"value-format":{datetimerange:"YYYY-MM-DD HH:mm:ss",daterange:"YYYY-MM-DD"}[E.dateType]||"YYYY-MM-DD",type:E.dateType||"date",onFocus:x=>a.value=E,onChange:x=>y(),placeholder:m.$t("qing-xuan-ze"),"start-placeholder":m.$t("kai-shi-shi-jian"),"end-placeholder":m.$t("jie-shu-shi-jian")},null,8,["class","modelValue","onUpdate:modelValue","value-format","type","onFocus","onChange","placeholder","start-placeholder","end-placeholder"])):e.createCommentVNode("",!0)]}),_:2},1032,["label"]))],64))),128))]),_:1},8,["model"])],4),e.createElementVNode("div",Lt,[e.createElementVNode("div",vt,[e.renderSlot(m.$slots,"table-header-left",{},void 0,!0)]),e.createElementVNode("div",Ft,[e.createVNode(A,{underline:"never",class:"mgr10",onClick:S[0]||(S[0]=()=>{s("visibleChange",!l.value),l.value=!l.value})},{default:e.withCtx(()=>[e.createVNode(Se,{name:l.value?"ArrowUp":"ArrowDown"},null,8,["name"]),e.createTextVNode(" "+e.toDisplayString(c.value),1)]),_:1}),e.createVNode(L,{type:"primary",onClick:C},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.$t("shai-xuan")),1)]),_:1}),e.createVNode(L,{type:"primary",onClick:w},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.$t("chong-zhi")),1)]),_:1}),e.renderSlot(m.$slots,"btn",{},void 0,!0)])])],32)}}},[["__scopeId","data-v-3c0a6716"]]),je={pageNoKey:"pageNo",pageSizeKey:"pageSize",totalKey:"total",defaultPageSize:10,pageSizes:[10,50,100,500],responseDataKeys:{rows:["rows","records","list"],total:["totalRows","total"]},showSearch:!1,showPage:!1,showShadow:!1,showCheckBox:!1,enableCellCopy:!0};let me={...je};function Dt(o){me={...me,...o,responseDataKeys:{...me.responseDataKeys,...o.responseDataKeys||{}}}}function Re(){return me}function Bt(){me={...je}}const fo="",zt={class:"center"},Mt=he({__name:"index",props:{id:{type:String,required:!1},loading:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0},searchForm:{type:Object,default:()=>({items:[],selections:[]})},api:{type:Function},data:{type:Array},tableConfig:{type:Object,default:()=>({})}},setup(o,{expose:t}){const{t:n,locale:r}=ee.useI18n(),s=ve.useRoute(),l=Re(),a=o,i=e.ref(!1),c=e.ref([]);a.searchForm.showSearch===void 0&&(a.searchForm.showSearch=l.showSearch),a.searchForm.showPage===void 0&&(a.searchForm.showPage=l.showPage),a.searchForm.showShadow===void 0&&(a.searchForm.showShadow=l.showShadow),a.searchForm.showCheckBox===void 0&&(a.searchForm.showCheckBox=l.showCheckBox),a.searchForm.enableCellCopy===void 0&&(a.searchForm.enableCellCopy=l.enableCellCopy),a.searchForm.selections||(a.searchForm.selections=[]);const C=e.computed(()=>{const f=s.path.replace(/\//g,"-").replace(/^-/,"")||"default-table";return a.id?`listPageId-${f}-${a.id}`:`listPageId-${f}`}),k=ne.cloneDeep(a.searchForm.items),w=a.searchForm.pageNoKey||l.pageNoKey,y=a.searchForm.pageSizeKey||l.pageSizeKey,g=e.reactive({[w]:1,[y]:a.searchForm.defaultPageSize||l.defaultPageSize,total:0}),h=e.ref(null),d=e.ref(null),m=e.ref(450),S=ne.debounce(()=>{e.nextTick(()=>{if(!d.value)return;const u=d.value.getBoundingClientRect(),T=window.innerHeight,F=u.top,q=100,P=T-F-q,z=200;m.value=Math.max(P,z)})},100),$=()=>{S()},_=()=>{if(!a.searchForm.enableCellCopy&&!l.enableCellCopy)return!1;const f=h.value;if(!f||!f.$el)return!1;const u=f.$el;return u.classList.add("cell-copy-enabled"),u.setAttribute("tabindex","-1"),u.removeEventListener("mousedown",D),u.removeEventListener("mousemove",ae),u.removeEventListener("mouseup",oe),u.removeEventListener("keydown",Te),u.addEventListener("mousedown",D),u.addEventListener("mousemove",ae),u.addEventListener("mouseup",oe),u.addEventListener("keydown",Te),!0};e.onMounted(()=>{S(),window.addEventListener("resize",$),a.searchForm.enableCellCopy&&(document.addEventListener("mouseup",Ke),document.addEventListener("mousedown",We),setTimeout(()=>{_()},500))}),e.onUpdated(()=>{(a.searchForm.enableCellCopy||l.enableCellCopy)&&setTimeout(()=>{_()},500)}),e.onUnmounted(()=>{if(window.removeEventListener("resize",$),a.searchForm.enableCellCopy||l.enableCellCopy){document.removeEventListener("mouseup",Ke),document.removeEventListener("mousedown",We);const f=h.value;if(f&&f.$el){const u=f.$el;u.removeEventListener("mousedown",D),u.removeEventListener("mousemove",ae),u.removeEventListener("mouseup",oe),u.removeEventListener("keydown",Te)}}});const I=e.computed(()=>Z.value.height||m.value);let B;async function A(f){const{dataFormat:u}=a.tableConfig;f[w]!=1&&(f.nextSearchAfter=B),i.value=!0;const{code:T,data:F={}}=await a.api(f).finally(()=>{i.value=!1,a.searchForm.selections=[]});if(T==200){let q=[];for(const z of l.responseDataKeys.rows)if(F[z]){q=F[z];break}let P=0;for(const z of l.responseDataKeys.total)if(F[z]!==void 0){P=F[z];break}c.value=u?u(q):q,g.total=P,B=F.nextSearchAfter,a.searchForm.enableCellCopy&&e.nextTick(()=>{setTimeout(()=>{_()},100)})}}function L(f={}){const{searchData:u=()=>({})}=a.tableConfig,T=u();A({...g,...$e(a.searchForm.items),...f,...T})}function E(){const{reset:f}=a.tableConfig;f&&f(),a.searchForm.items.forEach(u=>{const T=k.find(F=>ne.isArray(u.key)&&ne.isArray(F.key)?u.key.join(",")==F.key.join(","):F.key==u.key);T&&(u.value=T.value)}),L()}a.api&&a.immediate&&L();function U(){return{...g,...$e(a.searchForm.items)}}const b=()=>{const f=h.value;f&&f.clearSort()},x=e.reactive({storage:!0}),Y=e.reactive({drag:!0,resizable:!0,maxFixedSize:0}),Z=e.computed(()=>{const{customConfig:f,columnConfig:u,...T}=a.tableConfig;return{headerAlign:"left",align:"center",customConfig:{...x,...f},columnConfig:{...Y,...u},"virtual-x-config":{enabled:!1,scrollToLeftOnChange:!1},"virtual-y-config":{enabled:!0,gt:100},...T}}),V=e.reactive({isSelecting:!1,startCell:null,endCell:null,selectedCells:[]}),ce=f=>{const u=f.closest(".vxe-body--column");if(!u||u.classList.contains("col--checkbox")||u.classList.contains("col--seq"))return null;const T=u.closest(".vxe-body--row");if(!T)return null;const F=h.value;if(!F)return null;let q=-1;const P=T.getAttribute("data-rowid");if(P!=null)q=parseInt(P,10);else{const M=T.parentElement;q=Array.from(M.querySelectorAll(".vxe-body--row")).indexOf(T)}if(q<0)return null;let z=-1;const Q=u.getAttribute("data-colid");if(Q&&(z=F.getColumns().findIndex(v=>v.id===Q)),z<0){const v=Array.from(T.querySelectorAll(".vxe-body--column")).indexOf(u),j=!!u.closest(".vxe-table--fixed-left-wrapper"),H=!!u.closest(".vxe-table--fixed-right-wrapper"),N=F.getColumns();if(j){const K=N.filter(R=>R.fixed==="left");v<K.length&&(z=N.indexOf(K[v]))}else if(H){const K=N.filter(R=>R.fixed==="right");v<K.length&&(z=N.indexOf(K[v]))}else{const K=a.searchForm.showCheckBox?1:0;z=N.filter(G=>G.fixed==="left").length+v-K}}return z<0?null:{rowIndex:q,colIndex:z,cell:u}},D=f=>{const u=ce(f.target);if(!u){de();return}V.isSelecting=!0,V.startCell={rowIndex:u.rowIndex,colIndex:u.colIndex},V.endCell={...V.startCell},we(),He()},ae=f=>{if(!V.isSelecting)return;const u=ce(f.target);u&&(V.endCell={rowIndex:u.rowIndex,colIndex:u.colIndex},we(),He())},oe=()=>{V.isSelecting=!1},de=()=>{V.selectedCells=[],V.startCell=null,V.endCell=null;const f=h.value;if(!f)return;f.$el.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(T=>{T.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")})},we=()=>{if(!V.startCell||!V.endCell){V.selectedCells=[];return}const f=V.startCell.rowIndex,u=V.endCell.rowIndex,T=V.startCell.colIndex,F=V.endCell.colIndex,q=Math.min(f,u),P=Math.max(f,u),z=Math.min(T,F),Q=Math.max(T,F);V.selectedCells=[];for(let M=q;M<=P;M++)for(let v=z;v<=Q;v++)V.selectedCells.push({rowIndex:M,colIndex:v})},He=()=>{e.nextTick(()=>{const f=h.value;if(!f)return;const u=f.$el;if(u.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(j=>{j.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")}),V.selectedCells.length===0)return;const T=f.getColumns(),F=V.selectedCells.map(j=>j.rowIndex),q=V.selectedCells.map(j=>j.colIndex),P=Math.min(...F),z=Math.max(...F),Q=Math.min(...q),M=Math.max(...q),v=[u.querySelector(".vxe-table--body-wrapper tbody"),u.querySelector(".vxe-table--fixed-left-wrapper tbody"),u.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean);V.selectedCells.forEach(({rowIndex:j,colIndex:H})=>{const N=T[H];if(!N)return;const K=N.fixed==="left",R=N.fixed==="right";for(const G of v){const ge=G.querySelectorAll(".vxe-body--row")[j];if(!ge)continue;const re=Array.from(ge.querySelectorAll(".vxe-body--column"));let O=null;if(K&&G.closest(".vxe-table--fixed-left-wrapper")){const J=T.filter(X=>X.fixed==="left").indexOf(N);O=re[J]}else if(R&&G.closest(".vxe-table--fixed-right-wrapper")){const J=T.filter(X=>X.fixed==="right").indexOf(N);O=re[J]}else if(!K&&!R&&G.closest(".vxe-table--body-wrapper")){const se=a.searchForm.showCheckBox?1:0,J=T.filter(Ie=>Ie.fixed==="left").length,X=H-J;O=re[X+se]}if(O&&!O.classList.contains("col--checkbox")&&!O.classList.contains("col--seq")){O.classList.add("cell-selected"),j===P&&O.classList.add("cell-border-top"),j===z&&O.classList.add("cell-border-bottom"),H===Q&&O.classList.add("cell-border-left"),H===M&&O.classList.add("cell-border-right");break}}})})},eo=async()=>{if(V.selectedCells.length===0)return;const f=h.value;if(!f)return;const u=f.$el,T=f.getColumns(),F=[...new Set(V.selectedCells.map(M=>M.rowIndex))].sort((M,v)=>M-v),q=[...new Set(V.selectedCells.map(M=>M.colIndex))].sort((M,v)=>M-v),P=[u.querySelector(".vxe-table--body-wrapper tbody"),u.querySelector(".vxe-table--fixed-left-wrapper tbody"),u.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean),z=[];F.forEach(M=>{const v=[];q.forEach(j=>{const H=T[j];if(!H){v.push("");return}const N=H.fixed==="left",K=H.fixed==="right";let R="";for(const G of P){const ge=G.querySelectorAll(".vxe-body--row")[M];if(!ge)continue;const re=Array.from(ge.querySelectorAll(".vxe-body--column"));let O=null;if(N&&G.closest(".vxe-table--fixed-left-wrapper")){const J=T.filter(X=>X.fixed==="left").indexOf(H);O=re[J]}else if(K&&G.closest(".vxe-table--fixed-right-wrapper")){const J=T.filter(X=>X.fixed==="right").indexOf(H);O=re[J]}else if(!N&&!K&&G.closest(".vxe-table--body-wrapper")){const se=a.searchForm.showCheckBox?1:0,J=T.filter(Ie=>Ie.fixed==="left").length,X=j-J;O=re[X+se]}if(O&&!O.classList.contains("col--checkbox")&&!O.classList.contains("col--seq")){R=O.innerText||O.textContent||"",R=R.trim(),R=R.replace(/\n/g," ").replace(/\s+/g," ");break}}v.push(R)}),z.push(v.join(" "))});const Q=z.join(`
|
|
2
|
-
`);try{await navigator.clipboard.writeText(Q)}catch(M){console.error("复制失败:",M)}},Te=f=>{a.searchForm.enableCellCopy&&((f.ctrlKey||f.metaKey)&&f.key==="c"?V.selectedCells.length>0&&(f.preventDefault(),f.stopPropagation(),eo()):f.key==="Escape"&&de())},Ke=()=>{V.isSelecting=!1},We=f=>{const u=h.value;if(!u||!u.$el)return;u.$el.contains(f.target)||de()},to=f=>{g[w]=f,L()},oo=f=>{g[y]=f,g[w]=1,L()};function Ze(){const f=h.value.getCheckboxRecords();a.searchForm.selections=f}const Ge=f=>{const u=h.value;if(u){u.toggleCheckboxRow(f);const T=h.value.getCheckboxRecords();a.searchForm.selections=T}};return t({tableRef:h,getList:L,getPrm:U,clearSort:b,calculateTableHeight:S}),(f,u)=>{var M;const T=e.resolveComponent("el-button"),F=e.resolveComponent("el-checkbox"),q=e.resolveComponent("el-text"),P=e.resolveComponent("vxe-column"),z=e.resolveComponent("VxeTable"),Q=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({box:o.searchForm.showShadow})},[o.searchForm.showSearch?(e.openBlock(),e.createBlock(Ae,{key:0,form:o.searchForm,onReset:E,onConfirm:u[1]||(u[1]=v=>L()),onVisibleChange:e.unref(S)},{btn:e.withCtx(()=>[u[3]||(u[3]=e.createElementVNode("span",{class:"mgr10"},null,-1)),e.renderSlot(f.$slots,"search-bar-btn",{},void 0,!0),e.createVNode(T,{class:"mgl10",round:"",onClick:u[0]||(u[0]=v=>h.value.openCustom())},{default:e.withCtx(()=>[e.createVNode(Se,{name:"Tools"})]),_:1})]),_:3},8,["form","onVisibleChange"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"table-header-left",{},void 0,!0),e.createElementVNode("div",{ref_key:"tableContentRef",ref:d},[e.createVNode(z,e.mergeProps({id:C.value,ref_key:"tableRef",ref:h,loading:o.loading||i.value,data:o.api?c.value:o.data,border:""},Z.value,{height:I.value,onCheckboxChange:Ze,onCheckboxAll:Ze,onSortChange:(M=Z.value["sort-config"])==null?void 0:M.sortChange}),{default:e.withCtx(()=>[o.searchForm.showCheckBox==null||o.searchForm.showCheckBox?(e.openBlock(),e.createBlock(P,{key:0,type:"checkbox",width:e.unref(r)=="zh_cn"?80:150,title:f.$t("xu-hao"),fixed:"left"},{checkbox:e.withCtx(({rowIndex:v,row:j,checked:H,disabled:N,indeterminate:K})=>[e.createElementVNode("div",zt,[H?(e.openBlock(),e.createBlock(F,{key:0,checked:!0,disabled:N,size:"default",onClick:e.withModifiers(R=>!N&&Ge(j),["stop"])},null,8,["disabled","onClick"])):(e.openBlock(),e.createBlock(F,{key:1,disabled:N,checked:!1,size:"default",onClick:e.withModifiers(R=>!N&&Ge(j),["stop"])},null,8,["disabled","onClick"])),e.createVNode(q,{type:"info",class:"mgl5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(v+1),1)]),_:2},1024)])]),_:1},8,["width","title"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"default",{},void 0,!0)]),_:3},16,["id","loading","data","height","onSortChange"])],512),o.searchForm.showPage?(e.openBlock(),e.createBlock(Q,{key:1,"current-page":g[e.unref(w)],"onUpdate:currentPage":u[2]||(u[2]=v=>g[e.unref(w)]=v),class:"myPagination mgt10",background:"",layout:"total, sizes, prev, pager, next",total:g.total,"page-size":g[e.unref(y)],"page-sizes":o.searchForm.pageSizes||e.unref(l).pageSizes,onCurrentChange:to,onSizeChange:oo},null,8,["current-page","total","page-size","page-sizes"])):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-5496c3dc"]]),Ot={__name:"index",props:{sheetsConfig:{type:Object,required:!0},fileName:{type:String,required:!0}},setup(o){const t=o;function n(){dt(t.fileName,t.sheetsConfig)}return(r,s)=>{const l=e.resolveComponent("el-link");return e.openBlock(),e.createBlock(l,e.mergeProps({type:"primary",underline:"never"},r.$attrs,{onClick:n}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.$t("xia-zai-dao-ru-mo-ban")),1)]),_:1},16)}}},qt={mounted(o,t){t.value&&Ue(o)},updated(o,t){t.value?Ue(o):Pe(o)},beforeUnmount(o){Pe(o)}};async function Ue(o){await y();const t=o.querySelector(".el-dialog");if(!t)return;const n=o.querySelector(".el-dialog__header"),r=o.querySelector(".el-overlay");r.style.cssText+="overflow: hidden;",n.style.cursor="move";let s=!1,l={window:{width:0,height:0},dialog:{x:0,y:0,width:0,height:0,marginTop:""},mouse:{x:0,y:0},drag:{x:0,y:0}};n.addEventListener("mousedown",c),document.addEventListener("mousemove",C),document.addEventListener("mouseup",k),window.addEventListener("resize",w);function a(){l.mouse.x-l.drag.x>=l.dialog.x&&(l.drag.x=l.mouse.x-l.dialog.x),l.drag.x-l.mouse.x>=l.window.width-(l.dialog.x+l.dialog.width)&&(l.drag.x=l.mouse.x+l.window.width-l.dialog.x-l.dialog.width),l.mouse.y-l.drag.y>=l.dialog.y&&(l.drag.y=l.mouse.y-l.dialog.y),l.drag.y-l.mouse.y>=l.window.height-(l.dialog.y+l.dialog.height)&&(l.drag.y=l.mouse.y+l.window.height-l.dialog.y-l.dialog.height),i()}function i(){let g=l.drag.y-l.mouse.y+l.dialog.y,h=l.drag.x-l.mouse.x+l.dialog.x;t.style.cssText+=`position: absolute; top: calc(${g}px - ${l.dialog.marginTop}); left: ${h}px;`}function c(g){g.button===0&&(l.window={width:document.body.clientWidth,height:document.body.clientHeight},l.dialog=t.getBoundingClientRect(),l.dialog.marginTop=window.getComputedStyle(t).marginTop,l.mouse={x:g.clientX,y:g.clientY},s=!0)}function C(g){s&&(l.drag={x:g.clientX,y:g.clientY},r.style.userSelect="none",a())}function k(g){r.style.userSelect="auto",s=!1}function w(g){}function y(){return new Promise((g,h)=>{setTimeout(()=>{g()},500)})}o.__mouseDown__=c,o.__mouseUp__=k,o.__mouseMove__=C,o.__sizeChange__=w}function Pe(o){document.removeEventListener("mousedown",o.__mouseDown__),document.removeEventListener("mousemove",o.__mouseMove__),document.removeEventListener("mouseup",o.__mouseUp__),window.removeEventListener("resize",o.__sizeChange__)}const mo="",Nt={key:0,class:"drawer-btn"},At={key:1},jt={__name:"index",props:{layer:{type:Object,default:()=>({show:!1,type:"layer",title:"",showButton:!1}),required:!0},loading:{type:Boolean,default:!1}},emits:["confirm"],setup(o,{emit:t}){const n=o,r=t,{t:s}=ee.useI18n(),l=ne.debounce(()=>{r("confirm")},300);async function a(){n.layer.type=="drawer"?n.layer.onClose?n.layer.onClose():await W.ElMessageBox.confirm(s("que-ding-guan-bi-ma"),{confirmButtonText:s("que-ding"),cancelButtonText:s("qu-xiao"),type:"warning"}).catch(()=>{})=="confirm"&&(n.layer.show=!1):n.layer.show=!1}return(i,c)=>{const C=e.resolveComponent("el-button"),k=e.resolveComponent("el-drawer"),w=e.resolveComponent("el-dialog");return o.layer.type?(e.openBlock(),e.createBlock(k,{key:0,modelValue:o.layer.show,"onUpdate:modelValue":c[0]||(c[0]=y=>o.layer.show=y),size:o.layer.width||"100%",title:o.layer.title,direction:"rtl","append-to-body":"","before-close":a,class:"drawer-content"},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default"),c[2]||(c[2]=e.createElementVNode("p",{class:"mgt50"},null,-1)),o.layer.showButton?(e.openBlock(),e.createElementBlock("div",Nt,[e.renderSlot(i.$slots,"btn",{},()=>[e.createVNode(C,{onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("qu-xiao")),1)]),_:1}),e.createVNode(C,{type:"primary",loading:o.loading,onClick:e.unref(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("ti-jiao")),1)]),_:1},8,["loading","onClick"])])])):e.createCommentVNode("",!0)]),_:3},8,["modelValue","size","title"])):e.withDirectives((e.openBlock(),e.createElementBlock("div",At,[e.createVNode(w,{"close-on-click-modal":!1,modelValue:o.layer.show,"onUpdate:modelValue":c[1]||(c[1]=y=>o.layer.show=y),title:o.layer.title,width:o.layer.width||500,center:""},e.createSlots({default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:2},[o.layer.showButton?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(i.$slots,"btn",{},()=>[e.createVNode(C,{onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("qu-xiao")),1)]),_:1}),e.createVNode(C,{type:"primary",onClick:e.unref(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("ti-jiao")),1)]),_:1},8,["onClick"])])]),key:"0"}:void 0]),1032,["modelValue","title","width"])])),[[e.unref(qt),o.layer.show]])}}};function Rt(o,t={}){const n=le(),r={inForm:!0,required:!0,...t},s={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}$/,password:/(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/,email:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/}[o],{inForm:l,value:a,required:i,msg:c=n("validate.invalidInput")}=r;return l?function(C,k,w){if(i){s.test(k)?w():w(new Error(c));return}k&&!s.test(k)?w(new Error(c)):w()}:s.test(a)}class Ut{constructor(t={}){this.config={clientCode:t.clientCode||"one-portal",casServerUrl:`https://one-portal${t.isTest?"-test":""}.joy-group.com/api`,casPortalUrl:`https://one-portal${t.isTest?"-test":""}.joy-group.com`,serviceUrl:t.serviceUrl||window.location.origin+"/cas/callback",tokenKey:t.tokenKey||"one_portal_token",userKey:t.userKey||"one_portal_user",debug:t.debug||!1,autoLogin:t.autoLogin!==!1,loginCallback:t.loginCallback||null,logoutCallback:t.logoutCallback||null,errorCallback:t.errorCallback||null},this.token=null,this.user=null,this.init()}init(){this.log("OnePortal CAS SDK 初始化中..."),this.loadFromStorage();const n=new URLSearchParams(window.location.search).get("ticket");this.isLoggedIn()&&this.config.loginCallback?this.config.loginCallback(this.user,this.token):n?(this.log("检测到ST票据:",n),this.validateTicket(n)):this.config.autoLogin&&!this.isLoggedIn()&&(this.log("用户未登录,准备跳转到CAS登录页面"),this.login())}loadFromStorage(){try{this.token=localStorage.getItem(this.config.tokenKey);const t=localStorage.getItem(this.config.userKey);t&&(this.user=JSON.parse(t)),this.log("从本地存储加载数据:",{token:!!this.token,user:!!this.user})}catch(t){this.log("加载本地存储数据失败:",t)}}saveToStorage(){try{this.token&&localStorage.setItem(this.config.tokenKey,this.token),this.user&&localStorage.setItem(this.config.userKey,JSON.stringify(this.user)),this.log("数据已保存到本地存储")}catch(t){this.log("保存到本地存储失败:",t)}}clearStorage(){try{localStorage.removeItem(this.config.tokenKey),localStorage.removeItem(this.config.userKey),this.log("本地存储已清除")}catch(t){this.log("清除本地存储失败:",t)}}isLoggedIn(){return!!(this.token&&this.user)}getUser(){return this.user}getToken(){return this.token}login(){const t=`${this.config.casPortalUrl}?appCode=${this.config.clientCode}&redirectUrl=${encodeURIComponent(this.config.serviceUrl)}`;this.log("跳转到CAS登录页面:",t),window.location.href=t}async validateTicket(t){try{this.log("验证ST票据:",t);const n=await fetch(`${this.config.casServerUrl}/auth/validateST?ticket=${t}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);const r=await n.json();if(r.success&&r.data)return this.token=r.data.token,this.user=r.data.user,this.saveToStorage(),this.clearTicketFromUrl(),this.log("ST票据验证成功,用户登录成功:",this.user),this.config.loginCallback&&this.config.loginCallback(this.user,this.token),!0;throw new Error(r.message||"ST票据验证失败")}catch(n){return this.log("ST票据验证失败:",n),this.handleError(n),!1}}clearTicketFromUrl(){const t=new URL(window.location);t.searchParams.delete("ticket"),window.history.replaceState({},document.title,t.toString())}async logout(t=!0){try{if(this.log("用户登出"),this.token)try{await fetch(`${this.config.casServerUrl}/auth/logout`,{method:"POST",headers:{AppId:this.config.clientCode,Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"}})}catch(n){this.log("调用服务端登出接口失败:",n)}this.token=null,this.user=null,this.clearStorage(),this.config.logoutCallback&&this.config.logoutCallback(),t&&this.login()}catch(n){this.log("登出失败:",n),this.handleError(n)}}async request(t,n={}){const r={headers:{"Content-Type":"application/json",...n.headers},...n};r.headers.appId=this.config.clientCode,this.token&&(r.headers.Authorization=`Bearer ${this.token}`);try{const s=await fetch(t,r);return s.status===401?(this.log("Token已过期,需要重新登录"),this.logout(),null):s}catch(s){throw this.log("请求失败:",s),s}}async fetchUserInfo(){try{const t=await this.request(`${this.config.casServerUrl}/auth/user`);if(t&&t.ok){const n=await t.json();if(n.success&&n.data)return this.user=n.data,this.saveToStorage(),this.user}return null}catch(t){return this.log("获取用户信息失败:",t),null}}async refreshToken(){this.log("Token刷新功能暂未实现")}handleError(t){this.log("发生错误:",t),this.config.errorCallback&&this.config.errorCallback(t)}log(...t){this.config.debug&&console.log("[OnePortal CAS SDK]",...t)}checkLoginStatus(){return!this.isLoggedIn()&&this.config.autoLogin?(this.login(),!1):this.isLoggedIn()}setConfig(t,n){this.config[t]=n}getConfig(t){return this.config[t]}}function Pt(o,t={}){const r=Object.assign({manual:!1,log:!1,params:null,format:null},t),{manual:s,log:l,params:a={},cb:i,format:c}=r,C=e.ref([]),k=e.ref(!1),w=y=>{const g=y||a;k.value=!0,o(g).then(h=>{const{code:d,data:m,msg:S}=h;if(i){const{records:$,rows:_}=m||{},I=$||_?$||_:m;C.value=Ve(I,c),i(h)}if(m){if(m.records!=null||m.rows!=null){const{records:$,rows:_,total:I=0}=m||{};g&&g.total!=null&&(a.total=parseInt(I)),C.value=Ve($||_||[],c)}else C.value=Ve(m,c);l&&console.log("useRequest-res",C.value)}}).catch(h=>{i&&(console.log("useRequestErr",h),i({code:500}))}).finally(()=>{k.value=!1})};return s||w(),[k,C,w]}function Yt(o){const t=e.ref(o),n=e.ref(""),r=e.ref("");return e.watch(t,s=>{const l=s||["",""];n.value=l[0],r.value=l[1]}),[t,n,r]}function Ht(o){return Object.prototype.toString.call(o).slice(8,-1).toLowerCase()}function Ve(o,t){if(!t)return o;if(o instanceof Array)return o.map(r=>{let s={};return t.forEach(l=>s[l]=r[l]),s});let n={};return t.forEach(r=>n[r]=o[r]),n}function Kt(o,t=[]){const{locale:n}=ee.useI18n(),r=e.ref(o());return e.watch([n,...t],()=>{r.value=o()},{immediate:!0}),r}function Wt(o,t="zh_cn",n="en_us"){if(!o)return"-";const r={en_us:n,zh_cn:t},l=be().global.locale.value;return o[r[l]]||o[t]||"-"}function Zt(o,t){let n=te.mapState;return typeof o=="string"&&o.length>0&&(n=te.createNamespacedHelpers(o).mapState),Ye(t,n)}function Gt(o,t){let n=te.mapGetters;return typeof o=="string"&&o.length>0&&(n=te.createNamespacedHelpers(o).mapGetters),Ye(t,n)}function Jt(o,t){let n=te.mapActions;return typeof o=="string"&&o.length>0&&(n=te.createNamespacedHelpers(o).mapActions),Xt(t,n)}function Ye(o,t){const n=te.useStore(),r=t(o),s={};return Object.keys(r).forEach(l=>{const a=r[l].bind({$store:n});s[l]=e.computed(a)}),s}function Xt(o,t){const n=te.useStore(),r=t(o),s={};return Object.keys(r).forEach(l=>{s[l]=r[l].bind({$store:n})}),s}function Ee(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!e.isVNode(o)}function Qt(){fe.VxeUI.renderer.add("Enum",{renderTableDefault(o,t){let n;if([null,void 0].includes(t.row[t.column.field]))return"-";const r=t.row[t.column.field];if(o.type=="tag"){let s;return e.createVNode(e.resolveComponent("el-text"),{type:o.enum.getTag(r)},Ee(s=o.enum.getName(r))?s:{default:()=>[s]})}return e.createVNode(e.resolveComponent("el-text"),null,Ee(n=o.enum.getName(r))?n:{default:()=>[n]})}}),fe.VxeUI.renderer.add("InputNumber",{renderTableDefault(o,t){return e.createVNode(W.ElInputNumber,e.mergeProps({modelValue:t.row[t.column.field],"onUpdate:modelValue":n=>t.row[t.column.field]=n},o.props,{"step-strictly":!0,"value-on-clear":0}),null)}}),fe.VxeUI.renderer.add("TrueFalse",{renderTableDefault(o,t){const{locale:n}=ee.useI18n();let r=n.value=="zh_cn";return e.createVNode(W.ElText,{type:t.row[t.column.field]?"success":"danger"},{default:()=>[t.row[t.column.field]?r?"是":"YES":r?"否":"NO"]})}}),fe.VxeUI.renderer.add("I18n",{renderTableDefault(o,t){const{locale:n}=ee.useI18n();let r=n.value=="zh_cn"?t.column.field:o.fieldEn;return t.row[r]||t.row[t.column.field]}}),fe.VxeUI.renderer.add("Link",{renderTableDefault(o,t){var i;let n=t.column.field;const r=ve.useRouter(),{multiple:s,to:l}=o;if(!s)return e.createVNode(W.ElLink,{underline:"never",type:"primary",onclick:()=>r.push({path:l,query:{[n]:t.row[n]}})},{default:()=>[t.row[n]]});const a=((i=t.row[n])==null?void 0:i.split(","))||[];return a.map((c,C)=>e.createVNode("span",null,[e.createVNode(W.ElLink,{underline:"never",type:"primary",onclick:()=>r.push({path:l,query:{[n]:c}})},Ee(c)?c:{default:()=>[c]}),C<a.length-1?",":""]))}})}p.CmpDictionary=Ne,p.CmpIcon=Se,p.ConfrimButton=Vt,p.DownExcelTemp=Ot,p.ImportButton=Tt,p.LayOutForm=Je,p.Layer=jt,p.ListPage=Mt,p.OnePortalCasSDK=Ut,p.SearchBar=Ae,p.StatusMap=_e,p._toRaw=mt,p._typeOf=Ht,p.arrToStatusMap=pt,p.arrayToTree=gt,p.checkFileSize=bt,p.creatValidator=Rt,p.createImportFields=xt,p.createListPageId=wt,p.en_us=Ce,p.exportExcel=nt,p.getI18n=be,p.getI18nT=le,p.getListPageConfig=Re,p.getLocaleValue=Wt,p.getValueBykey=kt,p.importExcel=ot,p.messages=Me,p.registerVxeRenderers=Qt,p.resetListPageConfig=Bt,p.setListPageConfig=Dt,p.setupI18n=Oe,p.sleep=ht,p.stringToArray=ke,p.stripHtmlTags=yt,p.unicode2Str=Ct,p.useActions=Jt,p.useDatePicker=Yt,p.useGetters=Gt,p.useI18nReState=Kt,p.useRequest=Pt,p.useState=Zt,p.zh_cn=ye,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(p,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("element-plus"),require("vue"),require("file-saver"),require("exceljs"),require("dayjs"),require("vue-i18n"),require("lodash"),require("vue-router"),require("vuex"),require("vxe-pc-ui")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue","file-saver","exceljs","dayjs","vue-i18n","lodash","vue-router","vuex","vxe-pc-ui"],W):(p=typeof globalThis<"u"?globalThis:p||self,W(p.JoyAdminComponents={},p.ElementPlus,p.Vue,p.fileSaver,p.ExcelJS,p.dayjs,p.VueI18n,p._,p.VueRouter,p.Vuex,p.VxeUI))})(this,function(p,W,e,Le,pe,ue,ee,ne,ve,te,fe){"use strict";const Je=e.defineComponent({name:"LayOutForm",setup(o,{slots:t,attrs:n,emit:r}){const s=e.ref(null),l=()=>t.default?t.default().filter(i=>i.type!==Symbol.for("v-cmt")).map(i=>i.type===Symbol.for("v-fgt")?i.children:i).flat().map(i=>{var c;return e.h(W.ElCol,{span:((c=i.props)==null?void 0:c.span)||24},{default:()=>i})}):null;e.onMounted(()=>{r("ref",s.value)});function a(){return e.h(W.ElForm,{...n,ref:s},()=>e.h(W.ElRow,{gutter:n.gutter??20},{default:()=>l()}))}return a}});var Fe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function De(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Be={exports:{}};(function(o,t){(function(n,r){o.exports=r()})(Fe,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(l,a,i){var c=a.prototype;i.utc=function(d){var m={date:d,utc:!0,args:arguments};return new a(m)},c.utc=function(d){var m=i(this.toDate(),{locale:this.$L,utc:!0});return d?m.add(this.utcOffset(),n):m},c.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var C=c.parse;c.parse=function(d){d.utc&&(this.$u=!0),this.$utils().u(d.$offset)||(this.$offset=d.$offset),C.call(this,d)};var x=c.init;c.init=function(){if(this.$u){var d=this.$d;this.$y=d.getUTCFullYear(),this.$M=d.getUTCMonth(),this.$D=d.getUTCDate(),this.$W=d.getUTCDay(),this.$H=d.getUTCHours(),this.$m=d.getUTCMinutes(),this.$s=d.getUTCSeconds(),this.$ms=d.getUTCMilliseconds()}else x.call(this)};var b=c.utcOffset;c.utcOffset=function(d,m){var S=this.$utils().u;if(S(d))return this.$u?0:S(this.$offset)?b.call(this):this.$offset;if(typeof d=="string"&&(d=function(B){B===void 0&&(B="");var A=B.match(r);if(!A)return null;var L=(""+A[0]).match(s)||["-",0,0],E=L[0],U=60*+L[1]+ +L[2];return U===0?0:E==="+"?U:-U}(d),d===null))return this;var $=Math.abs(d)<=16?60*d:d;if($===0)return this.utc(m);var _=this.clone();if(m)return _.$offset=$,_.$u=!1,_;var I=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(_=this.local().add($+I,n)).$offset=$,_.$x.$localOffset=I,_};var y=c.format;c.format=function(d){var m=d||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return y.call(this,m)},c.valueOf=function(){var d=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*d},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var g=c.toDate;c.toDate=function(d){return d==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var h=c.diff;c.diff=function(d,m,S){if(d&&this.$u===d.$u)return h.call(this,d,m,S);var $=this.local(),_=i(d).local();return h.call($,_,m,S)}}})})(Be);var Xe=Be.exports;const Qe=De(Xe);var ze={exports:{}};(function(o,t){(function(n,r){o.exports=r()})(Fe,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(s,l,a){var i,c=function(y,g,h){h===void 0&&(h={});var d=new Date(y),m=function(S,$){$===void 0&&($={});var _=$.timeZoneName||"short",I=S+"|"+_,B=r[I];return B||(B=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:S,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:_}),r[I]=B),B}(g,h);return m.formatToParts(d)},C=function(y,g){for(var h=c(y,g),d=[],m=0;m<h.length;m+=1){var S=h[m],$=S.type,_=S.value,I=n[$];I>=0&&(d[I]=parseInt(_,10))}var B=d[3],A=B===24?0:B,L=d[0]+"-"+d[1]+"-"+d[2]+" "+A+":"+d[4]+":"+d[5]+":000",E=+y;return(a.utc(L).valueOf()-(E-=E%1e3))/6e4},x=l.prototype;x.tz=function(y,g){y===void 0&&(y=i);var h,d=this.utcOffset(),m=this.toDate(),S=m.toLocaleString("en-US",{timeZone:y}),$=Math.round((m-new Date(S))/1e3/60),_=15*-Math.round(m.getTimezoneOffset()/15)-$;if(!Number(_))h=this.utcOffset(0,g);else if(h=a(S,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(_,!0),g){var I=h.utcOffset();h=h.add(d-I,"minute")}return h.$x.$timezone=y,h},x.offsetName=function(y){var g=this.$x.$timezone||a.tz.guess(),h=c(this.valueOf(),g,{timeZoneName:y}).find(function(d){return d.type.toLowerCase()==="timezonename"});return h&&h.value};var b=x.startOf;x.startOf=function(y,g){if(!this.$x||!this.$x.$timezone)return b.call(this,y,g);var h=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return b.call(h,y,g).tz(this.$x.$timezone,!0)},a.tz=function(y,g,h){var d=h&&g,m=h||g||i,S=C(+a(),m);if(typeof y!="string")return a(y).tz(m);var $=function(A,L,E){var U=A-60*L*1e3,w=C(U,E);if(L===w)return[U,L];var k=C(U-=60*(w-L)*1e3,E);return w===k?[U,w]:[A-60*Math.min(w,k)*1e3,Math.max(w,k)]}(a.utc(y,d).valueOf(),S,m),_=$[0],I=$[1],B=a(_).utcOffset(I);return B.$x.$timezone=m,B},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(y){i=y}}})})(ze);var et=ze.exports;const tt=De(et),ye={"dao-ru":"导入","quan-xuan":"全选","xia-zai-dao-ru-mo-ban":"下载导入模板","xu-hao":"序号","qing-shu-ru":"请输入","qing-xuan-ze":"请选择","kai-shi-shi-jian":"开始时间","jie-shu-shi-jian":"结束时间","shai-xuan":"筛选","chong-zhi":"重置","guan-bi":"关闭","zhan-kai":"展开","qu-xiao":"取消","ti-jiao":"提交","que-ding":"确定","que-ding-guan-bi-ma":"确定关闭吗","xia-zai-dao-ru-mo-ban":"下载导入模板",excel:{fieldsMappingRequired:"请输入列字段映射",invalidInput:"非法输入",invalidOption:"请输入有效选项!",copyFailed:"复制失败",sheetNameTooLong:'Sheet名称 "{0}" 长度超过31个字符,已自动截断为 "{1}"'},validate:{invalidInput:"请输入正确内容"},tools:{keysLengthError:"keys 长度必须大于2 默认前两位为 label value"}},Ce={"dao-ru":"Import","quan-xuan":"Select All","xia-zai-dao-ru-mo-ban":"Download Import Template","xu-hao":"No.","qing-shu-ru":"Please enter","qing-xuan-ze":"Please select","kai-shi-shi-jian":"Start Time","jie-shu-shi-jian":"End Time","shai-xuan":"Filter","chong-zhi":"Reset","guan-bi":"Collapse","zhan-kai":"Expand","qu-xiao":"Cancel","ti-jiao":"Submit","que-ding":"Confirm","que-ding-guan-bi-ma":"Are you sure to close?","xia-zai-dao-ru-mo-ban":"Download Import Template",excel:{fieldsMappingRequired:"Please enter column field mapping",invalidInput:"Invalid input",invalidOption:"Please enter a valid option!",copyFailed:"Copy failed",sheetNameTooLong:'Sheet name "{0}" exceeds 31 characters, automatically truncated to "{1}"'},validate:{invalidInput:"Please enter valid content"},tools:{keysLengthError:"Keys length must be greater than 2, default first two are label and value"}},Me={zh_cn:ye,en_us:Ce};let ie=null;function Oe(o=null){if(o){const{global:t}=o;return t.messages.value.zh_cn?t.mergeLocaleMessage("zh_cn",ye):t.setLocaleMessage("zh_cn",ye),t.messages.value.en_us?t.mergeLocaleMessage("en_us",Ce):t.setLocaleMessage("en_us",Ce),ie=o,o}return ie||(ie=ee.createI18n({legacy:!1,locale:"zh_cn",fallbackLocale:"zh_cn",messages:Me})),ie}function be(){return ie||Oe()}function le(){return be().global.t}ue.extend(Qe),ue.extend(tt);async function ot(o,t){const{fields:n,range:r=1}=t;if(!n){const a=le();throw new Error(a("excel.fieldsMappingRequired"))}let s=new pe.Workbook;await s.xlsx.load(o);const l={};return s.eachSheet(function(a,i){const c=[];a.eachRow(function(C,x){if(x>r){let b={},y=!0;Object.keys(n).forEach(g=>{const h=C.getCell(n[g]).value;b[g]=h,h&&(y=!1)}),y||c.push(b)}}),l[a._name]=c}),s=null,l}const qe={columnWidth:30};async function nt(o,t,n=[],r={}){if(!o||!t)return;const{columnStyle:s}=r,{columnWidth:l}=qe;t.forEach(c=>{c.width=c.width?c.width:l});const{workbook:a,worksheet:i}=lt();i.columns=t,i.addRows(n),s&&await at(a,i,s);try{const c=await a.xlsx.writeBuffer(),C=new File([c],o,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Le.saveAs(C)}catch(c){console.log(c)}}function lt(){const o=new pe.Workbook;o.creator="distributor System",o.lastModifiedBy="distributor System",o.created=new Date,o.modified=new Date,o.lastPrinted=new Date;const t=o.addWorksheet("Sheet1");return{workbook:o,worksheet:t}}async function at(o,t,n){const r=Object.keys(n);for(const s of r){const l=n[s],{type:a}=l;switch(a){case"IMG":await rt(o,t,s);break}}}async function rt(o,t,n,r){const s=t.getColumn(n),l=s.values;t.getColumn(n).width=20,t.eachRow((a,i)=>{i>1&&(a.height=40)});for(let a=0,i=l.length;a<i;a++){if(a<2)continue;let c=l[a];c&&(t.getCell(s.letter+a).value="",await st(o,t,c,{width:100,height:50,col:s._number-1,row:a-1}))}}async function st(o,t,n,r){const{col:s,row:l,width:a,height:i}=r,{success:c,base64:C}=await it(n,.3);if(c){const x=o.addImage({base64:C,extension:"jpeg"});t.addImage(x,{tl:{col:s,row:l},ext:{width:a,height:i}})}}function it(o,t=1){const n=new Image;return n.setAttribute("crossOrigin","anonymous"),n.crossOrigin="anonymous",n.src=o,new Promise((r,s)=>{n.onload=()=>{const l=document.createElement("canvas");l.width=n.width,l.height=n.height,l.getContext("2d").drawImage(n,0,0,l.width,l.height),r({success:!0,base64:l.toDataURL("image/jpeg",t)})},n.onerror=()=>{r({success:!1})}})}const xe="---";async function ct(o,t){const{fields:n,range:r=1}=t;if(!n){const a=le();throw new Error(a("excel.fieldsMappingRequired"))}let s=new pe.Workbook;await s.xlsx.load(o);const l={};return s.eachSheet(function(a,i){if(a.state=="visible"){const c=[],C=n[a._name];if(C){let x=Object.values(C).some(y=>y.includes("image")),b={};x&&(a.getImages().forEach(g=>{const{tl:h}=g.range,d=s.model.media.find(m=>m.index===g.imageId);if(d){const m=d.buffer.toString("base64"),S=`data:image/${d.extension};base64,${m}`,$=`${Math.ceil(h.row)}_${Math.ceil(h.col)}`;b[$]?b[$].push(S):b[$]=[S]}}),console.log("withImages-imageMap",b)),a.eachRow(function(y,g){if(g>r){let h={},d=!0;Object.keys(C).forEach(m=>{var B;let[S,$]=C[m].split(xe);const _=y.getCell(S);let I;if($=="image"&&x){const A=_._column._number,L=`${g}_${A}`;I=b[L]||""}else _.result!=null?I=_.result:(B=_.value)!=null&&B.richText?I=_.value.richText.reduce((A,L)=>A+L.text,""):_.type==4&&_.value?I=ue(_.value).utc().format("YYYY-MM-DD HH:mm:ss"):I=_.value;I&&$=="option"&&(I=I.split(xe)[1]),h[m]=I,I&&(d=!1)}),d||c.push(h)}}),l[a._name]=c}}}),s=null,l}async function dt(o,t){if(!o||t.length==0)return;const n=ut(t);n.eachSheet(function(r,s){const{columnWidth:l}=qe,{tableHeader:a,tableData:i}=t[r._name];a.forEach(c=>{if(c.required){const C=c.style||{},{font:x={}}=C;c.style={...C,font:{...x,color:{argb:"FFFF0000"}}}}}),r.columns=a,r.addRows(i),a.forEach(c=>{const{header:C,key:x,width:b,option:y}=c,g=r.getColumn(x);if(g.width=b||l,y){const h=n.addWorksheet(x);h.state="hidden",h.getColumn(1).values=y.map(d=>`${d.label}${xe}${d.value}`),Array(100).fill("").forEach((d,m)=>{if(m>0){const S=le();r.getCell(`${g.letter}${m}`).dataValidation={type:"list",formulae:[`${x}!$A$1:$A$${y.length}`],showErrorMessage:!0,error:S("excel.invalidInput"),errorStyle:"stop",errorMessage:S("excel.invalidOption")}}})}})});try{const r=await n.xlsx.writeBuffer(),s=new File([r],o,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Le.saveAs(s)}catch(r){console.log(r)}}function ut(o){const t=le(),n=new pe.Workbook;return n.creator="distributor System",n.lastModifiedBy="distributor System",n.created=new Date,n.modified=new Date,n.lastPrinted=new Date,Object.keys(o).sort((s,l)=>{const a=o[s].sort??0,i=o[l].sort??0;return a-i}).forEach(s=>{let l=s,a=!1;/[\\/:*?\[\]]/g.test(s)&&(s=s.replace(/[\\/:*?\[\]]/g,""),a=!0),s.length>31&&(s=s.substring(0,31).trim(),a=!0,console.warn(t("excel.sheetNameTooLong",[l,s]))),a&&(o[s]=o[l],delete o[l]),n.addWorksheet(s)}),n}function ft(o){if(o<26)return String.fromCharCode(65+o);{const t=String.fromCharCode(65+Math.floor((o-26)/26)),n=String.fromCharCode(65+(o-26)%26);return t+n}}function ht(o){return new Promise(t=>{setTimeout(()=>{t()},o)})}function mt(o){return JSON.parse(JSON.stringify(o))}function gt(o){let t=[],n={},r=(s,l)=>Object.prototype.hasOwnProperty.call(s,l);for(const s of o){n[s.id]={...s,children:r(n,s.id)?n[s.id].children:[]};const l=n[s.id];s.pid==-1?t.push(l):(r(n,s.pid)||(n[s.pid]={children:[]}),n[s.pid].children.push(l))}return t}function ke(o,t=" "){return o?o.split(t).filter(n=>n.trim()):[]}class _e{constructor(t,n=["label","value","labelEn"]){this.list=t.map(r=>({...r,label:r[n[0]],labelEn:r[n[2]]??r[n[0]]??"",value:r[n[1]]})),this.map=new Map(this.list.map(r=>[r[n[1]],r]))}getName(t){if(!this.has(t))return"-";const n=be().global.locale,{label:r,labelEn:s}=this.map.get(t);return(n.value=="zh_cn"?r:s)??r??"-"}getTag(t){if(!this.has(t))return"info";const{tag:n="info"}=this.map.get(t);return n}getItem(t){return this.has(t)?this.map.get(t):null}getColor(t){if(!this.has(t))return null;const{color:n}=this.map.get(t);return n}has(t){return this.map.has(t)}}function pt(o,t=[],n="i18nName"){if(o.length==0)return new _e([]);if(t.length<2){const s=le();throw new Error(s("tools.keysLengthError"))}let r=o.map(s=>{let l={};return n&&(l.labelEn=s[n]),t.forEach((a,i)=>{i===0?l.label=s[a]:i===1?l.value=s[a]:l[a]=s[a]}),l});return new _e(r)}function yt(o){return o?o.replace(/<[^>]+>/g,""):""}function Ct(o){return o?(o.includes("\\\\u")&&(o=o.replace(/\\/g,"")),o.replace(/\\u[\dA-F]{4}/gi,t=>String.fromCharCode(parseInt(t.replace(/\\u/g,""),16)))):""}function bt(o,t=10){let n=1048576*t;return!(o.size>n)}function wt(o){return Array.from(10).fill(0).map((n,r)=>o+"_"+r)}function xt(o){let t={};return o.map((n,r)=>{let{key:s,option:l,type:a}=n,i=ft(r);l?t[s]=`${i}---option`:a==="image"?t[s]=`${i}---image`:t[s]=i}),t}function kt(o,t){return t.split(".").reduce((n,r)=>n&&n[r],o)}const lo="",he=(o,t)=>{const n=o.__vccOpts||o;for(const[r,s]of t)n[r]=s;return n},_t=["onClick"],Ne=he({__name:"index",props:e.mergeModels({api:{type:Function},showCheckAll:{type:Boolean,default:!0},maxLimit:{type:Number,default:void 0},optionClick:{type:Function,default:()=>{}},data:{type:Array},labelValue:{type:Object,default:()=>({label:"label",labelEn:"labelEn",value:"value"})},changeLocal:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["success","change","changeAll"],["update:modelValue"]),setup(o,{emit:t}){const n=o,r=e.useAttrs(),{t:s,locale:l}=ee.useI18n(),a=e.useModel(o,"modelValue"),i=e.computed(()=>r["value-key"]!=null),c=e.ref(""),C=e.computed(()=>{if(r.remote!==void 0)return n.data;const w=ke(c.value),{data:k,labelValue:Y}=n,Z=k||y.value;if(w.length==0)return Z;const{label:V,labelEn:ce}=Y;let D=l.value=="en_us"?ce||"i18nName":V;return w.length==1?Z.filter(oe=>oe[D].toLowerCase().includes(w[0].toLowerCase())):Z.filter(oe=>{let de=!1;return de=w.some(we=>oe[D].toLowerCase()==we.toLowerCase()),de})}),x=e.computed({get(){return r.multiple==null||a.value==null?!1:a.value.length==C.value.length},set(w){return w}}),b=t,y=e.ref([]),g=async()=>{const{data:w}=await n.api();y.value=[...w],b("success",y)};n.api&&g();function h(w){b("change",w),d.value&&e.nextTick(()=>{n.optionClick&&n.optionClick(d.value),d.value=null})}const d=e.ref(null);function m(w){d.value=w}const S=n.labelValue.label.split("-"),$=w=>{if(S.length==1){if(n.changeLocal)return s(w[n.labelValue.label]);let k=l.value=="en_us"?w[n.labelValue.labelEn||"i18nName"]:w[n.labelValue.label];return k=k||w[n.labelValue.label],k+""}else{let k=[];return S.forEach(Y=>{k.push(w[Y])}),k.join("-")}};function _(w){let k=n.data?n.data:y.value;a.value=w?k.map(Y=>i.value?Y:Y[n.labelValue.value]):[],e.nextTick(()=>{b("change",a.value),b("changeAll",a.value,k)})}function I(w){b("change",i.value?w:w[n.labelValue.value]),e.nextTick(()=>{n.optionClick&&n.optionClick(w)})}function B(w){return a.value.length>=n.maxLimit&&!a.value.includes(w[n.labelValue.value])}function A(w){return w.map(k=>({...k,label:$(k),value:i.value?k:k[n.labelValue.value]}))}const L=e.ref([]),E=n.data?n.data:y.value;L.value=A(E),e.watch(()=>n.data?n.data:y.value,w=>{var Y;const k=A(w);if(k.length!==L.value.length)L.value=k;else{let Z=!1;for(let V=0;V<k.length;V++)if(k[V].value!==((Y=L.value[V])==null?void 0:Y.value)){Z=!0;break}Z&&(L.value=k)}},{deep:!0});const U=e.computed(()=>L.value);return(w,k)=>{const Y=e.resolveComponent("el-checkbox"),Z=e.resolveComponent("el-select-v2"),V=e.resolveComponent("el-option"),ce=e.resolveComponent("el-select");return e.unref(r).v2!=null?(e.openBlock(),e.createBlock(Z,e.mergeProps({key:0,options:U.value,modelValue:a.value,"onUpdate:modelValue":k[1]||(k[1]=D=>a.value=D)},e.unref(r),{filterable:"","collapse-tags":"","collapse-tags-tooltip":"",clearable:"",onChange:h,onClear:h}),e.createSlots({default:e.withCtx(({item:D})=>[e.createElementVNode("div",{onClick:ae=>m(D)},e.toDisplayString(D.label),9,_t)]),_:2},[e.unref(r).multiple!=null?{name:"header",fn:e.withCtx(()=>[e.renderSlot(w.$slots,"header",{},()=>[e.createVNode(Y,{class:"mgl20",modelValue:x.value,"onUpdate:modelValue":k[0]||(k[0]=D=>x.value=D),onChange:_},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0)]),key:"0"}:void 0]),1040,["options","modelValue"])):(e.openBlock(),e.createBlock(ce,e.mergeProps({key:1,modelValue:a.value,"onUpdate:modelValue":k[3]||(k[3]=D=>a.value=D),filterable:"","collapse-tags":"","collapse-tags-tooltip":"","filter-method":e.unref(r).remote!=null?void 0:D=>c.value=D,clearable:""},e.unref(r),{onClear:o.optionClick}),{default:e.withCtx(()=>[e.unref(r).multiple!=null&&o.showCheckAll&&o.maxLimit==null?e.renderSlot(w.$slots,"header",{key:0},()=>[e.createVNode(Y,{class:"mgl20",modelValue:x.value,"onUpdate:modelValue":k[2]||(k[2]=D=>x.value=D),onChange:_},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(D,ae)=>(e.openBlock(),e.createBlock(V,{key:ae,label:$(D),disabled:e.unref(r).multiple!=null&&o.maxLimit>0?B(D):!1,onClick:e.withModifiers(oe=>I(D),["stop"]),value:i.value?D:D[o.labelValue.value]},null,8,["label","disabled","onClick","value"]))),128))]),_:3},16,["modelValue","filter-method","onClear"]))}}},[["__scopeId","data-v-51bd1467"]]),ro="",St=e.defineComponent({props:{name:{tyepe:String,required:!0}}});function $t(o,t,n,r,s,l){const a=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(a,{class:"cmp-icon"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.name)))]),_:1})}const Se=he(St,[["render",$t],["__scopeId","data-v-733f9daa"]]),Vt={__name:"index",emits:["ok","no"],setup(o,{emit:t}){const n=t,r=ne.debounce(()=>{n("ok")},500);function s(){n("no")}return(l,a)=>{const i=e.resolveComponent("el-popconfirm");return e.openBlock(),e.createElementBlock("span",null,[e.createVNode(i,e.mergeProps(l.$attrs,{onConfirm:e.unref(r),onCancel:s}),{reference:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16,["onConfirm"])])}}},so="",Et=["accept"],Tt=he({__name:"index",props:{accept:{type:String,default:".xlsx,.xls"},fields:{type:Object,default:()=>({})},fileChange:{type:Function,required:!0}},emits:["fileChange"],setup(o,{emit:t}){const n=o,r=e.ref(null),s=e.ref(!1);async function l(a){s.value=!0;let i=a.target.files[0];const c=await ct(i,n.fields).catch(()=>{s.value=!1}).finally(()=>{r.value.value=null});await n.fileChange(c).finally(()=>{s.value=!1})}return(a,i)=>{const c=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("span",null,[e.createVNode(c,{loading:s.value,class:"mgr10",onClick:i[0]||(i[0]=C=>r.value.click())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("dao-ru")),1)]),_:1},8,["loading"]),e.createElementVNode("input",{onChange:l,ref_key:"input",ref:r,accept:o.accept,style:{position:"absolute",width:"0px",height:"0px",opacity:"0"},type:"file"},null,40,Et)])}}},[["__scopeId","data-v-6f9ede29"]]);function $e(o){let t={};return o.forEach(n=>{const{key:r,type:s,option:l={},value:a,dateType:i="date"}=n;if(r)if(s=="input"&&(l!=null&&l.multiple))t[r]=ke(a);else if(s=="date")if(i.includes("range")){const[c,C]=r;let[x,b]=a||[];x&&i=="daterange"&&(x=ue(x).format("YYYY-MM-DD 00:00:00"),b=ue(b).format("YYYY-MM-DD 23:59:59")),t[c]=x,t[C]=b}else t[r]=a;else t[r]=a}),t}const co="",It={key:0},Lt={class:"btns"},vt={class:"left"},Ft={class:"right"},Ae=he({__name:"index",props:{form:{type:Object,required:!0}},emits:["confirm","reset","visibleChange"],setup(o,{expose:t,emit:n}){const r=o,s=n,l=e.ref(!0),a=e.ref(null),{t:i}=ee.useI18n(),c=e.computed(()=>l.value?i("guan-bi"):i("zhan-kai"));function C(){s("confirm")}function x(m){m.option.onClear&&m.option.onClear(),s("confirm")}function b(){s("reset")}function y(){s("confirm")}function g(){return $e(r.form.items)}const h=ne.cloneDeep(r.form.items);function d(){r.form.items.forEach(m=>{const S=h.find($=>$.key==m.key);S&&(m.value=S.value)})}return t({getPrm:g,reset:d}),(m,S)=>{const $=e.resolveComponent("el-input"),_=e.resolveComponent("el-date-picker"),I=e.resolveComponent("el-form-item"),B=e.resolveComponent("el-form"),A=e.resolveComponent("el-link"),L=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",{class:"searchBar-container mgt10 mgb10",onKeydown:e.withKeys(C,["enter"])},[e.createElementVNode("div",{class:"searchBar",style:e.normalizeStyle({height:l.value?"auto":"42px"})},[e.createVNode(B,{inline:"",model:o.form.data},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.form.items.filter(E=>!E.hidden),E=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:E.key},[E.type=="br"?(e.openBlock(),e.createElementBlock("br",It)):(e.openBlock(),e.createBlock(I,{key:1,label:E.name},{default:e.withCtx(()=>{var U,w;return[E.type==="input"?(e.openBlock(),e.createBlock($,{key:0,modelValue:E.value,"onUpdate:modelValue":k=>E.value=k,class:e.normalizeClass(((U=E.option)==null?void 0:U.class)||"w150"),placeholder:m.$t("qing-shu-ru"),clearable:""},null,8,["modelValue","onUpdate:modelValue","class","placeholder"])):E.type==="custom"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(E.render),{key:1})):e.createCommentVNode("",!0),E.type==="select"?(e.openBlock(),e.createBlock(Ne,e.mergeProps({key:2,class:((w=E.option)==null?void 0:w.class)||"w150",modelValue:E.value,"onUpdate:modelValue":k=>E.value=k},{ref_for:!0},E.option,{onChange:C,onClear:k=>x(E)}),null,16,["class","modelValue","onUpdate:modelValue","onClear"])):e.createCommentVNode("",!0),E.type==="date"?(e.openBlock(),e.createBlock(_,{key:3,class:e.normalizeClass({datetimerange:"w300",daterange:"w200"}[E.dateType]||"w100"),modelValue:E.value,"onUpdate:modelValue":k=>E.value=k,"value-format":{datetimerange:"YYYY-MM-DD HH:mm:ss",daterange:"YYYY-MM-DD"}[E.dateType]||"YYYY-MM-DD",type:E.dateType||"date",onFocus:k=>a.value=E,onChange:k=>y(),placeholder:m.$t("qing-xuan-ze"),"start-placeholder":m.$t("kai-shi-shi-jian"),"end-placeholder":m.$t("jie-shu-shi-jian")},null,8,["class","modelValue","onUpdate:modelValue","value-format","type","onFocus","onChange","placeholder","start-placeholder","end-placeholder"])):e.createCommentVNode("",!0)]}),_:2},1032,["label"]))],64))),128))]),_:1},8,["model"])],4),e.createElementVNode("div",Lt,[e.createElementVNode("div",vt,[e.renderSlot(m.$slots,"table-header-left",{},void 0,!0)]),e.createElementVNode("div",Ft,[e.createVNode(A,{underline:"never",class:"mgr10",onClick:S[0]||(S[0]=()=>{s("visibleChange",!l.value),l.value=!l.value})},{default:e.withCtx(()=>[e.createVNode(Se,{name:l.value?"ArrowUp":"ArrowDown"},null,8,["name"]),e.createTextVNode(" "+e.toDisplayString(c.value),1)]),_:1}),e.createVNode(L,{type:"primary",onClick:C},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.$t("shai-xuan")),1)]),_:1}),e.createVNode(L,{type:"primary",onClick:b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.$t("chong-zhi")),1)]),_:1}),e.renderSlot(m.$slots,"btn",{},void 0,!0)])])],32)}}},[["__scopeId","data-v-3c0a6716"]]),je={pageNoKey:"pageNo",pageSizeKey:"pageSize",totalKey:"total",defaultPageSize:10,pageSizes:[10,50,100,500],responseDataKeys:{rows:["rows","records","list"],total:["totalRows","total"]},showSearch:!1,showPage:!1,showShadow:!1,showCheckBox:!1,enableCellCopy:!0};let me={...je};function Dt(o){me={...me,...o,responseDataKeys:{...me.responseDataKeys,...o.responseDataKeys||{}}}}function Re(){return me}function Bt(){me={...je}}const fo="",zt={class:"center"},Mt=he({__name:"index",props:{id:{type:String,required:!1},loading:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0},searchForm:{type:Object,default:()=>({items:[],selections:[]})},api:{type:Function},data:{type:Array},tableConfig:{type:Object,default:()=>({})}},setup(o,{expose:t}){const{t:n,locale:r}=ee.useI18n(),s=ve.useRoute(),l=Re(),a=o,i=e.ref(!1),c=e.ref([]);a.searchForm.showSearch===void 0&&(a.searchForm.showSearch=l.showSearch),a.searchForm.showPage===void 0&&(a.searchForm.showPage=l.showPage),a.searchForm.showShadow===void 0&&(a.searchForm.showShadow=l.showShadow),a.searchForm.showCheckBox===void 0&&(a.searchForm.showCheckBox=l.showCheckBox),a.searchForm.enableCellCopy===void 0&&(a.searchForm.enableCellCopy=l.enableCellCopy),a.searchForm.selections||(a.searchForm.selections=[]);const C=e.computed(()=>{const f=s.path.replace(/\//g,"-").replace(/^-/,"")||"default-table";return a.id?`listPageId-${f}-${a.id}`:`listPageId-${f}`}),x=ne.cloneDeep(a.searchForm.items),b=a.searchForm.pageNoKey||l.pageNoKey,y=a.searchForm.pageSizeKey||l.pageSizeKey,g=e.reactive({[b]:1,[y]:a.searchForm.defaultPageSize||l.defaultPageSize,total:0}),h=e.ref(null),d=e.ref(null),m=e.ref(450),S=ne.debounce(()=>{e.nextTick(()=>{if(!d.value)return;const u=d.value.getBoundingClientRect(),T=window.innerHeight,F=u.top,q=100,P=T-F-q,z=200;m.value=Math.max(P,z)})},100),$=()=>{S()},_=()=>{if(!a.searchForm.enableCellCopy&&!l.enableCellCopy)return!1;const f=h.value;if(!f||!f.$el)return!1;const u=f.$el;return u.classList.add("cell-copy-enabled"),u.setAttribute("tabindex","-1"),u.removeEventListener("mousedown",D),u.removeEventListener("mousemove",ae),u.removeEventListener("mouseup",oe),u.removeEventListener("keydown",Te),u.addEventListener("mousedown",D),u.addEventListener("mousemove",ae),u.addEventListener("mouseup",oe),u.addEventListener("keydown",Te),!0};e.onMounted(()=>{S(),window.addEventListener("resize",$),(a.searchForm.enableCellCopy||l.enableCellCopy)&&(document.addEventListener("mouseup",Ke),document.addEventListener("mousedown",We),setTimeout(()=>{_()},500))}),e.onUpdated(()=>{(a.searchForm.enableCellCopy||l.enableCellCopy)&&setTimeout(()=>{_()},500)}),e.onUnmounted(()=>{if(window.removeEventListener("resize",$),a.searchForm.enableCellCopy||l.enableCellCopy){document.removeEventListener("mouseup",Ke),document.removeEventListener("mousedown",We);const f=h.value;if(f&&f.$el){const u=f.$el;u.removeEventListener("mousedown",D),u.removeEventListener("mousemove",ae),u.removeEventListener("mouseup",oe),u.removeEventListener("keydown",Te)}}});const I=e.computed(()=>Z.value.height||m.value);let B;async function A(f){const{dataFormat:u}=a.tableConfig;f[b]!=1&&(f.nextSearchAfter=B),i.value=!0;const{code:T,data:F={}}=await a.api(f).finally(()=>{i.value=!1,a.searchForm.selections=[]});if(T==200){let q=[];for(const z of l.responseDataKeys.rows)if(F[z]){q=F[z];break}let P=0;for(const z of l.responseDataKeys.total)if(F[z]!==void 0){P=F[z];break}c.value=u?u(q):q,g.total=P,B=F.nextSearchAfter,(a.searchForm.enableCellCopy||l.enableCellCopy)&&e.nextTick(()=>{setTimeout(()=>{_()},100)})}}function L(f={}){const{searchData:u=()=>({})}=a.tableConfig,T=u();A({...g,...$e(a.searchForm.items),...f,...T})}function E(){const{reset:f}=a.tableConfig;f&&f(),a.searchForm.items.forEach(u=>{const T=x.find(F=>ne.isArray(u.key)&&ne.isArray(F.key)?u.key.join(",")==F.key.join(","):F.key==u.key);T&&(u.value=T.value)}),L()}a.api&&a.immediate&&L();function U(){return{...g,...$e(a.searchForm.items)}}const w=()=>{const f=h.value;f&&f.clearSort()},k=e.reactive({storage:!0}),Y=e.reactive({drag:!0,resizable:!0,maxFixedSize:0}),Z=e.computed(()=>{const{customConfig:f,columnConfig:u,...T}=a.tableConfig;return{headerAlign:"left",align:"center",customConfig:{...k,...f},columnConfig:{...Y,...u},"virtual-x-config":{enabled:!1,scrollToLeftOnChange:!1},"virtual-y-config":{enabled:!0,gt:100},...T}}),V=e.reactive({isSelecting:!1,startCell:null,endCell:null,selectedCells:[]}),ce=f=>{const u=f.closest(".vxe-body--column");if(!u||u.classList.contains("col--checkbox")||u.classList.contains("col--seq"))return null;const T=u.closest(".vxe-body--row");if(!T)return null;const F=h.value;if(!F)return null;let q=-1;const P=T.getAttribute("data-rowid");if(P!=null)q=parseInt(P,10);else{const M=T.parentElement;q=Array.from(M.querySelectorAll(".vxe-body--row")).indexOf(T)}if(q<0)return null;let z=-1;const Q=u.getAttribute("data-colid");if(Q&&(z=F.getColumns().findIndex(v=>v.id===Q)),z<0){const v=Array.from(T.querySelectorAll(".vxe-body--column")).indexOf(u),j=!!u.closest(".vxe-table--fixed-left-wrapper"),H=!!u.closest(".vxe-table--fixed-right-wrapper"),N=F.getColumns();if(j){const K=N.filter(R=>R.fixed==="left");v<K.length&&(z=N.indexOf(K[v]))}else if(H){const K=N.filter(R=>R.fixed==="right");v<K.length&&(z=N.indexOf(K[v]))}else{const K=a.searchForm.showCheckBox?1:0;z=N.filter(G=>G.fixed==="left").length+v-K}}return z<0?null:{rowIndex:q,colIndex:z,cell:u}},D=f=>{const u=ce(f.target);if(!u){de();return}V.isSelecting=!0,V.startCell={rowIndex:u.rowIndex,colIndex:u.colIndex},V.endCell={...V.startCell},we(),He()},ae=f=>{if(!V.isSelecting)return;const u=ce(f.target);u&&(V.endCell={rowIndex:u.rowIndex,colIndex:u.colIndex},we(),He())},oe=()=>{V.isSelecting=!1},de=()=>{V.selectedCells=[],V.startCell=null,V.endCell=null;const f=h.value;if(!f)return;f.$el.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(T=>{T.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")})},we=()=>{if(!V.startCell||!V.endCell){V.selectedCells=[];return}const f=V.startCell.rowIndex,u=V.endCell.rowIndex,T=V.startCell.colIndex,F=V.endCell.colIndex,q=Math.min(f,u),P=Math.max(f,u),z=Math.min(T,F),Q=Math.max(T,F);V.selectedCells=[];for(let M=q;M<=P;M++)for(let v=z;v<=Q;v++)V.selectedCells.push({rowIndex:M,colIndex:v})},He=()=>{e.nextTick(()=>{const f=h.value;if(!f)return;const u=f.$el;if(u.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(j=>{j.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")}),V.selectedCells.length===0)return;const T=f.getColumns(),F=V.selectedCells.map(j=>j.rowIndex),q=V.selectedCells.map(j=>j.colIndex),P=Math.min(...F),z=Math.max(...F),Q=Math.min(...q),M=Math.max(...q),v=[u.querySelector(".vxe-table--body-wrapper tbody"),u.querySelector(".vxe-table--fixed-left-wrapper tbody"),u.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean);V.selectedCells.forEach(({rowIndex:j,colIndex:H})=>{const N=T[H];if(!N)return;const K=N.fixed==="left",R=N.fixed==="right";for(const G of v){const ge=G.querySelectorAll(".vxe-body--row")[j];if(!ge)continue;const re=Array.from(ge.querySelectorAll(".vxe-body--column"));let O=null;if(K&&G.closest(".vxe-table--fixed-left-wrapper")){const J=T.filter(X=>X.fixed==="left").indexOf(N);O=re[J]}else if(R&&G.closest(".vxe-table--fixed-right-wrapper")){const J=T.filter(X=>X.fixed==="right").indexOf(N);O=re[J]}else if(!K&&!R&&G.closest(".vxe-table--body-wrapper")){const se=a.searchForm.showCheckBox?1:0,J=T.filter(Ie=>Ie.fixed==="left").length,X=H-J;O=re[X+se]}if(O&&!O.classList.contains("col--checkbox")&&!O.classList.contains("col--seq")){O.classList.add("cell-selected"),j===P&&O.classList.add("cell-border-top"),j===z&&O.classList.add("cell-border-bottom"),H===Q&&O.classList.add("cell-border-left"),H===M&&O.classList.add("cell-border-right");break}}})})},eo=async()=>{if(V.selectedCells.length===0)return;const f=h.value;if(!f)return;const u=f.$el,T=f.getColumns(),F=[...new Set(V.selectedCells.map(M=>M.rowIndex))].sort((M,v)=>M-v),q=[...new Set(V.selectedCells.map(M=>M.colIndex))].sort((M,v)=>M-v),P=[u.querySelector(".vxe-table--body-wrapper tbody"),u.querySelector(".vxe-table--fixed-left-wrapper tbody"),u.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean),z=[];F.forEach(M=>{const v=[];q.forEach(j=>{const H=T[j];if(!H){v.push("");return}const N=H.fixed==="left",K=H.fixed==="right";let R="";for(const G of P){const ge=G.querySelectorAll(".vxe-body--row")[M];if(!ge)continue;const re=Array.from(ge.querySelectorAll(".vxe-body--column"));let O=null;if(N&&G.closest(".vxe-table--fixed-left-wrapper")){const J=T.filter(X=>X.fixed==="left").indexOf(H);O=re[J]}else if(K&&G.closest(".vxe-table--fixed-right-wrapper")){const J=T.filter(X=>X.fixed==="right").indexOf(H);O=re[J]}else if(!N&&!K&&G.closest(".vxe-table--body-wrapper")){const se=a.searchForm.showCheckBox?1:0,J=T.filter(Ie=>Ie.fixed==="left").length,X=j-J;O=re[X+se]}if(O&&!O.classList.contains("col--checkbox")&&!O.classList.contains("col--seq")){R=O.innerText||O.textContent||"",R=R.trim(),R=R.replace(/\n/g," ").replace(/\s+/g," ");break}}v.push(R)}),z.push(v.join(" "))});const Q=z.join(`
|
|
2
|
+
`);try{await navigator.clipboard.writeText(Q)}catch(M){console.error("复制失败:",M)}},Te=f=>{!a.searchForm.enableCellCopy&&!l.enableCellCopy||((f.ctrlKey||f.metaKey)&&f.key==="c"?V.selectedCells.length>0&&(f.preventDefault(),f.stopPropagation(),eo()):f.key==="Escape"&&de())},Ke=()=>{V.isSelecting=!1},We=f=>{const u=h.value;if(!u||!u.$el)return;u.$el.contains(f.target)||de()},to=f=>{g[b]=f,L()},oo=f=>{g[y]=f,g[b]=1,L()};function Ze(){const f=h.value.getCheckboxRecords();a.searchForm.selections=f}const Ge=f=>{const u=h.value;if(u){u.toggleCheckboxRow(f);const T=h.value.getCheckboxRecords();a.searchForm.selections=T}};return t({tableRef:h,getList:L,getPrm:U,clearSort:w,calculateTableHeight:S}),(f,u)=>{var M;const T=e.resolveComponent("el-button"),F=e.resolveComponent("el-checkbox"),q=e.resolveComponent("el-text"),P=e.resolveComponent("vxe-column"),z=e.resolveComponent("VxeTable"),Q=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({box:o.searchForm.showShadow})},[o.searchForm.showSearch?(e.openBlock(),e.createBlock(Ae,{key:0,form:o.searchForm,onReset:E,onConfirm:u[1]||(u[1]=v=>L()),onVisibleChange:e.unref(S)},{btn:e.withCtx(()=>[u[3]||(u[3]=e.createElementVNode("span",{class:"mgr10"},null,-1)),e.renderSlot(f.$slots,"search-bar-btn",{},void 0,!0),e.createVNode(T,{class:"mgl10",round:"",onClick:u[0]||(u[0]=v=>h.value.openCustom())},{default:e.withCtx(()=>[e.createVNode(Se,{name:"Tools"})]),_:1})]),_:3},8,["form","onVisibleChange"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"table-header-left",{},void 0,!0),e.createElementVNode("div",{ref_key:"tableContentRef",ref:d},[e.createVNode(z,e.mergeProps({id:C.value,ref_key:"tableRef",ref:h,loading:o.loading||i.value,data:o.api?c.value:o.data,border:""},Z.value,{height:I.value,onCheckboxChange:Ze,onCheckboxAll:Ze,onSortChange:(M=Z.value["sort-config"])==null?void 0:M.sortChange}),{default:e.withCtx(()=>[o.searchForm.showCheckBox==null||o.searchForm.showCheckBox?(e.openBlock(),e.createBlock(P,{key:0,type:"checkbox",width:e.unref(r)=="zh_cn"?80:150,title:f.$t("xu-hao"),fixed:"left"},{checkbox:e.withCtx(({rowIndex:v,row:j,checked:H,disabled:N,indeterminate:K})=>[e.createElementVNode("div",zt,[H?(e.openBlock(),e.createBlock(F,{key:0,checked:!0,disabled:N,size:"default",onClick:e.withModifiers(R=>!N&&Ge(j),["stop"])},null,8,["disabled","onClick"])):(e.openBlock(),e.createBlock(F,{key:1,disabled:N,checked:!1,size:"default",onClick:e.withModifiers(R=>!N&&Ge(j),["stop"])},null,8,["disabled","onClick"])),e.createVNode(q,{type:"info",class:"mgl5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(v+1),1)]),_:2},1024)])]),_:1},8,["width","title"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"default",{},void 0,!0)]),_:3},16,["id","loading","data","height","onSortChange"])],512),o.searchForm.showPage?(e.openBlock(),e.createBlock(Q,{key:1,"current-page":g[e.unref(b)],"onUpdate:currentPage":u[2]||(u[2]=v=>g[e.unref(b)]=v),class:"myPagination mgt10",background:"",layout:"total, sizes, prev, pager, next",total:g.total,"page-size":g[e.unref(y)],"page-sizes":o.searchForm.pageSizes||e.unref(l).pageSizes,onCurrentChange:to,onSizeChange:oo},null,8,["current-page","total","page-size","page-sizes"])):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-c022c16d"]]),Ot={__name:"index",props:{sheetsConfig:{type:Object,required:!0},fileName:{type:String,required:!0}},setup(o){const t=o;function n(){dt(t.fileName,t.sheetsConfig)}return(r,s)=>{const l=e.resolveComponent("el-link");return e.openBlock(),e.createBlock(l,e.mergeProps({type:"primary",underline:"never"},r.$attrs,{onClick:n}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.$t("xia-zai-dao-ru-mo-ban")),1)]),_:1},16)}}},qt={mounted(o,t){t.value&&Ue(o)},updated(o,t){t.value?Ue(o):Pe(o)},beforeUnmount(o){Pe(o)}};async function Ue(o){await y();const t=o.querySelector(".el-dialog");if(!t)return;const n=o.querySelector(".el-dialog__header"),r=o.querySelector(".el-overlay");r.style.cssText+="overflow: hidden;",n.style.cursor="move";let s=!1,l={window:{width:0,height:0},dialog:{x:0,y:0,width:0,height:0,marginTop:""},mouse:{x:0,y:0},drag:{x:0,y:0}};n.addEventListener("mousedown",c),document.addEventListener("mousemove",C),document.addEventListener("mouseup",x),window.addEventListener("resize",b);function a(){l.mouse.x-l.drag.x>=l.dialog.x&&(l.drag.x=l.mouse.x-l.dialog.x),l.drag.x-l.mouse.x>=l.window.width-(l.dialog.x+l.dialog.width)&&(l.drag.x=l.mouse.x+l.window.width-l.dialog.x-l.dialog.width),l.mouse.y-l.drag.y>=l.dialog.y&&(l.drag.y=l.mouse.y-l.dialog.y),l.drag.y-l.mouse.y>=l.window.height-(l.dialog.y+l.dialog.height)&&(l.drag.y=l.mouse.y+l.window.height-l.dialog.y-l.dialog.height),i()}function i(){let g=l.drag.y-l.mouse.y+l.dialog.y,h=l.drag.x-l.mouse.x+l.dialog.x;t.style.cssText+=`position: absolute; top: calc(${g}px - ${l.dialog.marginTop}); left: ${h}px;`}function c(g){g.button===0&&(l.window={width:document.body.clientWidth,height:document.body.clientHeight},l.dialog=t.getBoundingClientRect(),l.dialog.marginTop=window.getComputedStyle(t).marginTop,l.mouse={x:g.clientX,y:g.clientY},s=!0)}function C(g){s&&(l.drag={x:g.clientX,y:g.clientY},r.style.userSelect="none",a())}function x(g){r.style.userSelect="auto",s=!1}function b(g){}function y(){return new Promise((g,h)=>{setTimeout(()=>{g()},500)})}o.__mouseDown__=c,o.__mouseUp__=x,o.__mouseMove__=C,o.__sizeChange__=b}function Pe(o){document.removeEventListener("mousedown",o.__mouseDown__),document.removeEventListener("mousemove",o.__mouseMove__),document.removeEventListener("mouseup",o.__mouseUp__),window.removeEventListener("resize",o.__sizeChange__)}const mo="",Nt={key:0,class:"drawer-btn"},At={key:1},jt={__name:"index",props:{layer:{type:Object,default:()=>({show:!1,type:"layer",title:"",showButton:!1}),required:!0},loading:{type:Boolean,default:!1}},emits:["confirm"],setup(o,{emit:t}){const n=o,r=t,{t:s}=ee.useI18n(),l=ne.debounce(()=>{r("confirm")},300);async function a(){n.layer.type=="drawer"?n.layer.onClose?n.layer.onClose():await W.ElMessageBox.confirm(s("que-ding-guan-bi-ma"),{confirmButtonText:s("que-ding"),cancelButtonText:s("qu-xiao"),type:"warning"}).catch(()=>{})=="confirm"&&(n.layer.show=!1):n.layer.show=!1}return(i,c)=>{const C=e.resolveComponent("el-button"),x=e.resolveComponent("el-drawer"),b=e.resolveComponent("el-dialog");return o.layer.type?(e.openBlock(),e.createBlock(x,{key:0,modelValue:o.layer.show,"onUpdate:modelValue":c[0]||(c[0]=y=>o.layer.show=y),size:o.layer.width||"100%",title:o.layer.title,direction:"rtl","append-to-body":"","before-close":a,class:"drawer-content"},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default"),c[2]||(c[2]=e.createElementVNode("p",{class:"mgt50"},null,-1)),o.layer.showButton?(e.openBlock(),e.createElementBlock("div",Nt,[e.renderSlot(i.$slots,"btn",{},()=>[e.createVNode(C,{onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("qu-xiao")),1)]),_:1}),e.createVNode(C,{type:"primary",loading:o.loading,onClick:e.unref(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("ti-jiao")),1)]),_:1},8,["loading","onClick"])])])):e.createCommentVNode("",!0)]),_:3},8,["modelValue","size","title"])):e.withDirectives((e.openBlock(),e.createElementBlock("div",At,[e.createVNode(b,{"close-on-click-modal":!1,modelValue:o.layer.show,"onUpdate:modelValue":c[1]||(c[1]=y=>o.layer.show=y),title:o.layer.title,width:o.layer.width||500,center:""},e.createSlots({default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:2},[o.layer.showButton?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(i.$slots,"btn",{},()=>[e.createVNode(C,{onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("qu-xiao")),1)]),_:1}),e.createVNode(C,{type:"primary",onClick:e.unref(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("ti-jiao")),1)]),_:1},8,["onClick"])])]),key:"0"}:void 0]),1032,["modelValue","title","width"])])),[[e.unref(qt),o.layer.show]])}}};function Rt(o,t={}){const n=le(),r={inForm:!0,required:!0,...t},s={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}$/,password:/(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/,email:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/}[o],{inForm:l,value:a,required:i,msg:c=n("validate.invalidInput")}=r;return l?function(C,x,b){if(i){s.test(x)?b():b(new Error(c));return}x&&!s.test(x)?b(new Error(c)):b()}:s.test(a)}class Ut{constructor(t={}){this.config={clientCode:t.clientCode||"one-portal",casServerUrl:`https://one-portal${t.isTest?"-test":""}.joy-group.com/api`,casPortalUrl:`https://one-portal${t.isTest?"-test":""}.joy-group.com`,serviceUrl:t.serviceUrl||window.location.origin+"/cas/callback",tokenKey:t.tokenKey||"one_portal_token",userKey:t.userKey||"one_portal_user",debug:t.debug||!1,autoLogin:t.autoLogin!==!1,loginCallback:t.loginCallback||null,logoutCallback:t.logoutCallback||null,errorCallback:t.errorCallback||null},this.token=null,this.user=null,this.init()}init(){this.log("OnePortal CAS SDK 初始化中..."),this.loadFromStorage();const n=new URLSearchParams(window.location.search).get("ticket");this.isLoggedIn()&&this.config.loginCallback?this.config.loginCallback(this.user,this.token):n?(this.log("检测到ST票据:",n),this.validateTicket(n)):this.config.autoLogin&&!this.isLoggedIn()&&(this.log("用户未登录,准备跳转到CAS登录页面"),this.login())}loadFromStorage(){try{this.token=localStorage.getItem(this.config.tokenKey);const t=localStorage.getItem(this.config.userKey);t&&(this.user=JSON.parse(t)),this.log("从本地存储加载数据:",{token:!!this.token,user:!!this.user})}catch(t){this.log("加载本地存储数据失败:",t)}}saveToStorage(){try{this.token&&localStorage.setItem(this.config.tokenKey,this.token),this.user&&localStorage.setItem(this.config.userKey,JSON.stringify(this.user)),this.log("数据已保存到本地存储")}catch(t){this.log("保存到本地存储失败:",t)}}clearStorage(){try{localStorage.removeItem(this.config.tokenKey),localStorage.removeItem(this.config.userKey),this.log("本地存储已清除")}catch(t){this.log("清除本地存储失败:",t)}}isLoggedIn(){return!!(this.token&&this.user)}getUser(){return this.user}getToken(){return this.token}login(){const t=`${this.config.casPortalUrl}?appCode=${this.config.clientCode}&redirectUrl=${encodeURIComponent(this.config.serviceUrl)}`;this.log("跳转到CAS登录页面:",t),window.location.href=t}async validateTicket(t){try{this.log("验证ST票据:",t);const n=await fetch(`${this.config.casServerUrl}/auth/validateST?ticket=${t}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);const r=await n.json();if(r.success&&r.data)return this.token=r.data.token,this.user=r.data.user,this.saveToStorage(),this.clearTicketFromUrl(),this.log("ST票据验证成功,用户登录成功:",this.user),this.config.loginCallback&&this.config.loginCallback(this.user,this.token),!0;throw new Error(r.message||"ST票据验证失败")}catch(n){return this.log("ST票据验证失败:",n),this.handleError(n),!1}}clearTicketFromUrl(){const t=new URL(window.location);t.searchParams.delete("ticket"),window.history.replaceState({},document.title,t.toString())}async logout(t=!0){try{if(this.log("用户登出"),this.token)try{await fetch(`${this.config.casServerUrl}/auth/logout`,{method:"POST",headers:{AppId:this.config.clientCode,Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"}})}catch(n){this.log("调用服务端登出接口失败:",n)}this.token=null,this.user=null,this.clearStorage(),this.config.logoutCallback&&this.config.logoutCallback(),t&&this.login()}catch(n){this.log("登出失败:",n),this.handleError(n)}}async request(t,n={}){const r={headers:{"Content-Type":"application/json",...n.headers},...n};r.headers.appId=this.config.clientCode,this.token&&(r.headers.Authorization=`Bearer ${this.token}`);try{const s=await fetch(t,r);return s.status===401?(this.log("Token已过期,需要重新登录"),this.logout(),null):s}catch(s){throw this.log("请求失败:",s),s}}async fetchUserInfo(){try{const t=await this.request(`${this.config.casServerUrl}/auth/user`);if(t&&t.ok){const n=await t.json();if(n.success&&n.data)return this.user=n.data,this.saveToStorage(),this.user}return null}catch(t){return this.log("获取用户信息失败:",t),null}}async refreshToken(){this.log("Token刷新功能暂未实现")}handleError(t){this.log("发生错误:",t),this.config.errorCallback&&this.config.errorCallback(t)}log(...t){this.config.debug&&console.log("[OnePortal CAS SDK]",...t)}checkLoginStatus(){return!this.isLoggedIn()&&this.config.autoLogin?(this.login(),!1):this.isLoggedIn()}setConfig(t,n){this.config[t]=n}getConfig(t){return this.config[t]}}function Pt(o,t={}){const r=Object.assign({manual:!1,log:!1,params:null,format:null},t),{manual:s,log:l,params:a={},cb:i,format:c}=r,C=e.ref([]),x=e.ref(!1),b=y=>{const g=y||a;x.value=!0,o(g).then(h=>{const{code:d,data:m,msg:S}=h;if(i){const{records:$,rows:_}=m||{},I=$||_?$||_:m;C.value=Ve(I,c),i(h)}if(m){if(m.records!=null||m.rows!=null){const{records:$,rows:_,total:I=0}=m||{};g&&g.total!=null&&(a.total=parseInt(I)),C.value=Ve($||_||[],c)}else C.value=Ve(m,c);l&&console.log("useRequest-res",C.value)}}).catch(h=>{i&&(console.log("useRequestErr",h),i({code:500}))}).finally(()=>{x.value=!1})};return s||b(),[x,C,b]}function Yt(o){const t=e.ref(o),n=e.ref(""),r=e.ref("");return e.watch(t,s=>{const l=s||["",""];n.value=l[0],r.value=l[1]}),[t,n,r]}function Ht(o){return Object.prototype.toString.call(o).slice(8,-1).toLowerCase()}function Ve(o,t){if(!t)return o;if(o instanceof Array)return o.map(r=>{let s={};return t.forEach(l=>s[l]=r[l]),s});let n={};return t.forEach(r=>n[r]=o[r]),n}function Kt(o,t=[]){const{locale:n}=ee.useI18n(),r=e.ref(o());return e.watch([n,...t],()=>{r.value=o()},{immediate:!0}),r}function Wt(o,t="zh_cn",n="en_us"){if(!o)return"-";const r={en_us:n,zh_cn:t},l=be().global.locale.value;return o[r[l]]||o[t]||"-"}function Zt(o,t){let n=te.mapState;return typeof o=="string"&&o.length>0&&(n=te.createNamespacedHelpers(o).mapState),Ye(t,n)}function Gt(o,t){let n=te.mapGetters;return typeof o=="string"&&o.length>0&&(n=te.createNamespacedHelpers(o).mapGetters),Ye(t,n)}function Jt(o,t){let n=te.mapActions;return typeof o=="string"&&o.length>0&&(n=te.createNamespacedHelpers(o).mapActions),Xt(t,n)}function Ye(o,t){const n=te.useStore(),r=t(o),s={};return Object.keys(r).forEach(l=>{const a=r[l].bind({$store:n});s[l]=e.computed(a)}),s}function Xt(o,t){const n=te.useStore(),r=t(o),s={};return Object.keys(r).forEach(l=>{s[l]=r[l].bind({$store:n})}),s}function Ee(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!e.isVNode(o)}function Qt(){fe.VxeUI.renderer.add("Enum",{renderTableDefault(o,t){let n;if([null,void 0].includes(t.row[t.column.field]))return"-";const r=t.row[t.column.field];if(o.type=="tag"){let s;return e.createVNode(e.resolveComponent("el-text"),{type:o.enum.getTag(r)},Ee(s=o.enum.getName(r))?s:{default:()=>[s]})}return e.createVNode(e.resolveComponent("el-text"),null,Ee(n=o.enum.getName(r))?n:{default:()=>[n]})}}),fe.VxeUI.renderer.add("InputNumber",{renderTableDefault(o,t){return e.createVNode(W.ElInputNumber,e.mergeProps({modelValue:t.row[t.column.field],"onUpdate:modelValue":n=>t.row[t.column.field]=n},o.props,{"step-strictly":!0,"value-on-clear":0}),null)}}),fe.VxeUI.renderer.add("TrueFalse",{renderTableDefault(o,t){const{locale:n}=ee.useI18n();let r=n.value=="zh_cn";return e.createVNode(W.ElText,{type:t.row[t.column.field]?"success":"danger"},{default:()=>[t.row[t.column.field]?r?"是":"YES":r?"否":"NO"]})}}),fe.VxeUI.renderer.add("I18n",{renderTableDefault(o,t){const{locale:n}=ee.useI18n();let r=n.value=="zh_cn"?t.column.field:o.fieldEn;return t.row[r]||t.row[t.column.field]}}),fe.VxeUI.renderer.add("Link",{renderTableDefault(o,t){var i;let n=t.column.field;const r=ve.useRouter(),{multiple:s,to:l}=o;if(!s)return e.createVNode(W.ElLink,{underline:"never",type:"primary",onclick:()=>r.push({path:l,query:{[n]:t.row[n]}})},{default:()=>[t.row[n]]});const a=((i=t.row[n])==null?void 0:i.split(","))||[];return a.map((c,C)=>e.createVNode("span",null,[e.createVNode(W.ElLink,{underline:"never",type:"primary",onclick:()=>r.push({path:l,query:{[n]:c}})},Ee(c)?c:{default:()=>[c]}),C<a.length-1?",":""]))}})}p.CmpDictionary=Ne,p.CmpIcon=Se,p.ConfrimButton=Vt,p.DownExcelTemp=Ot,p.ImportButton=Tt,p.LayOutForm=Je,p.Layer=jt,p.ListPage=Mt,p.OnePortalCasSDK=Ut,p.SearchBar=Ae,p.StatusMap=_e,p._toRaw=mt,p._typeOf=Ht,p.arrToStatusMap=pt,p.arrayToTree=gt,p.checkFileSize=bt,p.creatValidator=Rt,p.createImportFields=xt,p.createListPageId=wt,p.en_us=Ce,p.exportExcel=nt,p.getI18n=be,p.getI18nT=le,p.getListPageConfig=Re,p.getLocaleValue=Wt,p.getValueBykey=kt,p.importExcel=ot,p.messages=Me,p.registerVxeRenderers=Qt,p.resetListPageConfig=Bt,p.setListPageConfig=Dt,p.setupI18n=Oe,p.sleep=ht,p.stringToArray=ke,p.stripHtmlTags=yt,p.unicode2Str=Ct,p.useActions=Jt,p.useDatePicker=Yt,p.useGetters=Gt,p.useI18nReState=Kt,p.useRequest=Pt,p.useState=Zt,p.zh_cn=ye,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.cmp-icon[data-v-
|
|
1
|
+
.cmp-icon[data-v-51bd1467],.cmp-icon[data-v-733f9daa],.cmp-icon[data-v-6f9ede29]{padding:0!important}.searchBar-container .searchBar[data-v-3c0a6716]{overflow:hidden;transition:all .3s}.searchBar-container[data-v-3c0a6716] .el-form-item{margin-bottom:8px!important}.searchBar-container .btns[data-v-3c0a6716]{display:flex;justify-content:space-between;align-items:center}.searchBar-container .btns .left[data-v-3c0a6716]{display:flex;align-items:center}.searchBar-container .btns .left[data-v-3c0a6716] .el-tabs__header{margin:0}.searchBar-container .btns .right[data-v-3c0a6716]{text-align:right}[data-v-c022c16d] .vxe-table-custom-wrapper.placement--top-right.is--active{max-height:400px!important}[data-v-c022c16d] .vxe-table.cell-copy-enabled .vxe-body--column{-webkit-user-select:none;user-select:none}[data-v-c022c16d] .vxe-table.cell-copy-enabled .vxe-body--column.cell-selected{background-color:#409eff26!important;position:relative}[data-v-c022c16d] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-top:before{content:"";position:absolute;top:0;left:0;right:0;height:1px;background-color:#409eff;pointer-events:none;z-index:10}[data-v-c022c16d] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-bottom:after{content:"";position:absolute;bottom:0;left:0;right:0;height:1px;background-color:#409eff;pointer-events:none;z-index:10}[data-v-c022c16d] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-left{border-left:1px solid #409eff!important}[data-v-c022c16d] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-right{border-right:1px solid #409eff!important}.drawer-content .drawer-btn{position:absolute;box-sizing:border-box;bottom:0;width:100%;text-align:right;padding:10px 60px 20px 20px;background-color:#fff;z-index:10}
|