joy-admin-components 0.1.50 → 0.1.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ElForm as bt, ElRow as yt, ElCol as Ct, ElInputNumber as xt, ElText as wt, ElLink as
|
|
2
|
-
import { defineComponent as
|
|
1
|
+
import { ElForm as bt, ElRow as yt, ElCol as Ct, ElInputNumber as xt, ElText as wt, ElLink as Ne } from "element-plus";
|
|
2
|
+
import { defineComponent as Je, ref as q, onMounted as Qe, h as Fe, mergeModels as Ze, useAttrs as kt, useModel as _t, computed as ne, watch as Pe, resolveComponent as V, unref as G, openBlock as D, createBlock as Y, mergeProps as he, createSlots as St, withCtx as j, renderSlot as le, createVNode as P, createTextVNode as ae, toDisplayString as re, createCommentVNode as fe, createElementBlock as ue, Fragment as De, renderList as Xe, withModifiers as ze, resolveDynamicComponent as et, createElementVNode as de, withKeys as $t, normalizeStyle as It, normalizeClass as Oe, reactive as ke, nextTick as Le, onUpdated as Ft, onUnmounted as Lt, isVNode as Tt } from "vue";
|
|
3
3
|
import { saveAs as Et } from "file-saver";
|
|
4
4
|
import tt from "exceljs";
|
|
5
5
|
import _e from "dayjs";
|
|
6
6
|
import { createI18n as Dt, useI18n as pe } from "vue-i18n";
|
|
7
|
-
import { debounce as nt, cloneDeep as ot, isArray as
|
|
7
|
+
import { debounce as nt, cloneDeep as ot, isArray as Ge } from "lodash";
|
|
8
8
|
import { useRoute as zt, useRouter as Ot } from "vue-router";
|
|
9
|
-
import { createNamespacedHelpers as
|
|
9
|
+
import { createNamespacedHelpers as Ue, useStore as lt, mapState as Vt, mapGetters as Mt, mapActions as At } from "vuex";
|
|
10
10
|
import { VxeUI as Ce } from "vxe-pc-ui";
|
|
11
|
-
const Sn =
|
|
11
|
+
const Sn = Je({
|
|
12
12
|
name: "LayOutForm",
|
|
13
13
|
setup(n, { slots: e, attrs: t, emit: o }) {
|
|
14
14
|
const a = q(null), r = () => e.default ? e.default().filter((u) => u.type !== Symbol.for("v-cmt")).map((u) => u.type === Symbol.for("v-fgt") ? u.children : u).flat().map(
|
|
@@ -23,7 +23,7 @@ const Sn = We({
|
|
|
23
23
|
);
|
|
24
24
|
}
|
|
25
25
|
) : null;
|
|
26
|
-
|
|
26
|
+
Qe(() => {
|
|
27
27
|
o("ref", a.value);
|
|
28
28
|
});
|
|
29
29
|
function l() {
|
|
@@ -268,7 +268,7 @@ function Bt(n = null) {
|
|
|
268
268
|
function ct() {
|
|
269
269
|
return me || Bt();
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function Re() {
|
|
272
272
|
return ct().global.t;
|
|
273
273
|
}
|
|
274
274
|
_e.extend(Ut);
|
|
@@ -276,7 +276,7 @@ _e.extend(jt);
|
|
|
276
276
|
async function $n(n, e) {
|
|
277
277
|
const { fields: t, range: o = 1 } = e;
|
|
278
278
|
if (!t) {
|
|
279
|
-
const l =
|
|
279
|
+
const l = Re();
|
|
280
280
|
throw new Error(l("excel.fieldsMappingRequired"));
|
|
281
281
|
}
|
|
282
282
|
let a = new tt.Workbook();
|
|
@@ -414,7 +414,7 @@ function Ln(n) {
|
|
|
414
414
|
function ut(n, e = " ") {
|
|
415
415
|
return n ? n.split(e).filter((t) => t.trim()) : [];
|
|
416
416
|
}
|
|
417
|
-
class
|
|
417
|
+
class We {
|
|
418
418
|
constructor(e, t = ["label", "value", "labelEn"]) {
|
|
419
419
|
this.list = e, this.map = new Map(
|
|
420
420
|
e.map((o) => {
|
|
@@ -454,9 +454,9 @@ class Ge {
|
|
|
454
454
|
}
|
|
455
455
|
function Tn(n, e = [], t = "i18nName") {
|
|
456
456
|
if (n.length == 0)
|
|
457
|
-
return new
|
|
457
|
+
return new We([]);
|
|
458
458
|
if (e.length < 2) {
|
|
459
|
-
const a =
|
|
459
|
+
const a = Re();
|
|
460
460
|
throw new Error(a("tools.keysLengthError"));
|
|
461
461
|
}
|
|
462
462
|
let o = n.map((a) => {
|
|
@@ -465,7 +465,7 @@ function Tn(n, e = [], t = "i18nName") {
|
|
|
465
465
|
u === 0 ? r.label = a[l] : u === 1 ? r.value = a[l] : r[l] = a[l];
|
|
466
466
|
}), r;
|
|
467
467
|
});
|
|
468
|
-
return new
|
|
468
|
+
return new We(o);
|
|
469
469
|
}
|
|
470
470
|
function En(n) {
|
|
471
471
|
return n ? n.replace(/<[^>]+>/g, "") : "";
|
|
@@ -497,7 +497,7 @@ const we = (n, e) => {
|
|
|
497
497
|
return t;
|
|
498
498
|
}, Qt = {
|
|
499
499
|
__name: "index",
|
|
500
|
-
props: /* @__PURE__ */
|
|
500
|
+
props: /* @__PURE__ */ Ze({
|
|
501
501
|
api: {
|
|
502
502
|
type: Function
|
|
503
503
|
},
|
|
@@ -533,7 +533,7 @@ const we = (n, e) => {
|
|
|
533
533
|
modelValue: {},
|
|
534
534
|
modelModifiers: {}
|
|
535
535
|
}),
|
|
536
|
-
emits: /* @__PURE__ */
|
|
536
|
+
emits: /* @__PURE__ */ Ze(["success", "change"], ["update:modelValue"]),
|
|
537
537
|
setup(n, { emit: e }) {
|
|
538
538
|
const t = n, o = kt(), { t: a, locale: r } = pe(), l = _t(n, "modelValue"), u = ne(() => o["value-key"] != null), d = q(""), w = ne(() => {
|
|
539
539
|
if (o.remote !== void 0)
|
|
@@ -598,7 +598,7 @@ const we = (n, e) => {
|
|
|
598
598
|
}));
|
|
599
599
|
}
|
|
600
600
|
const I = q([]), W = t.data ? t.data : v.value;
|
|
601
|
-
I.value = z(W),
|
|
601
|
+
I.value = z(W), Pe(
|
|
602
602
|
() => t.data ? t.data : v.value,
|
|
603
603
|
(i) => {
|
|
604
604
|
var L;
|
|
@@ -676,7 +676,7 @@ const we = (n, e) => {
|
|
|
676
676
|
_: 1
|
|
677
677
|
}, 8, ["modelValue"])
|
|
678
678
|
], !0) : fe("", !0),
|
|
679
|
-
(D(!0), ue(De, null,
|
|
679
|
+
(D(!0), ue(De, null, Xe(w.value, (m, ve) => (D(), Y(ee, {
|
|
680
680
|
key: ve,
|
|
681
681
|
label: h(m),
|
|
682
682
|
disabled: G(o).multiple != null && n.maxLimit > 0 ? S(m) : !1,
|
|
@@ -688,8 +688,8 @@ const we = (n, e) => {
|
|
|
688
688
|
}, 16, ["modelValue", "filter-method", "onClear"]));
|
|
689
689
|
};
|
|
690
690
|
}
|
|
691
|
-
}, Xt = /* @__PURE__ */ we(Qt, [["__scopeId", "data-v-
|
|
692
|
-
const en =
|
|
691
|
+
}, Xt = /* @__PURE__ */ we(Qt, [["__scopeId", "data-v-a1cc31cd"]]);
|
|
692
|
+
const en = Je({
|
|
693
693
|
props: {
|
|
694
694
|
name: {
|
|
695
695
|
tyepe: String,
|
|
@@ -701,7 +701,7 @@ function tn(n, e, t, o, a, r) {
|
|
|
701
701
|
const l = V("el-icon");
|
|
702
702
|
return D(), Y(l, { class: "cmp-icon" }, {
|
|
703
703
|
default: j(() => [
|
|
704
|
-
(D(), Y(
|
|
704
|
+
(D(), Y(et(n.name)))
|
|
705
705
|
]),
|
|
706
706
|
_: 1
|
|
707
707
|
});
|
|
@@ -848,7 +848,7 @@ const ln = { key: 0 }, an = { class: "btns" }, rn = { class: "left" }, sn = { cl
|
|
|
848
848
|
model: n.form.data
|
|
849
849
|
}, {
|
|
850
850
|
default: j(() => [
|
|
851
|
-
(D(!0), ue(De, null,
|
|
851
|
+
(D(!0), ue(De, null, Xe(n.form.items.filter((i) => !i.hidden), (i) => (D(), ue(De, {
|
|
852
852
|
key: i.key
|
|
853
853
|
}, [
|
|
854
854
|
i.type == "br" ? (D(), ue("br", ln)) : (D(), Y(z, {
|
|
@@ -865,7 +865,7 @@ const ln = { key: 0 }, an = { class: "btns" }, rn = { class: "left" }, sn = { cl
|
|
|
865
865
|
class: Oe(((p = i.option) == null ? void 0 : p.class) || "w150"),
|
|
866
866
|
placeholder: h.$t("qing-shu-ru"),
|
|
867
867
|
clearable: ""
|
|
868
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) : i.type === "custom" ? (D(), Y(
|
|
868
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) : i.type === "custom" ? (D(), Y(et(i.render), { key: 1 })) : fe("", !0),
|
|
869
869
|
i.type === "select" ? (D(), Y(Xt, he({
|
|
870
870
|
key: 2,
|
|
871
871
|
class: ((L = i.option) == null ? void 0 : L.class) || "w150",
|
|
@@ -1052,8 +1052,8 @@ const fn = { class: "center" }, hn = {
|
|
|
1052
1052
|
const s = c.$el;
|
|
1053
1053
|
return s.classList.add("cell-copy-enabled"), s.setAttribute("tabindex", "-1"), s.removeEventListener("mousedown", oe), s.removeEventListener("mousemove", ge), s.removeEventListener("mouseup", be), s.removeEventListener("keydown", $e), s.addEventListener("mousedown", oe), s.addEventListener("mousemove", ge), s.addEventListener("mouseup", be), s.addEventListener("keydown", $e), !0;
|
|
1054
1054
|
};
|
|
1055
|
-
|
|
1056
|
-
k(), window.addEventListener("resize", _), l.searchForm.enableCellCopy && (document.addEventListener("mouseup",
|
|
1055
|
+
Qe(() => {
|
|
1056
|
+
k(), window.addEventListener("resize", _), l.searchForm.enableCellCopy && (document.addEventListener("mouseup", Be), document.addEventListener("mousedown", Ye), setTimeout(() => {
|
|
1057
1057
|
S();
|
|
1058
1058
|
}, 500));
|
|
1059
1059
|
}), Ft(() => {
|
|
@@ -1062,7 +1062,7 @@ const fn = { class: "center" }, hn = {
|
|
|
1062
1062
|
}, 500);
|
|
1063
1063
|
}), Lt(() => {
|
|
1064
1064
|
if (window.removeEventListener("resize", _), l.searchForm.enableCellCopy) {
|
|
1065
|
-
document.removeEventListener("mouseup",
|
|
1065
|
+
document.removeEventListener("mouseup", Be), document.removeEventListener("mousedown", Ye);
|
|
1066
1066
|
const c = g.value;
|
|
1067
1067
|
if (c && c.$el) {
|
|
1068
1068
|
const s = c.$el;
|
|
@@ -1105,7 +1105,7 @@ const fn = { class: "center" }, hn = {
|
|
|
1105
1105
|
function i() {
|
|
1106
1106
|
const { reset: c } = l.tableConfig;
|
|
1107
1107
|
c && c(), l.searchForm.items.forEach((s) => {
|
|
1108
|
-
const y = x.find((F) =>
|
|
1108
|
+
const y = x.find((F) => Ge(s.key) && Ge(F.key) ? s.key.join(",") == F.key.join(",") : F.key == s.key);
|
|
1109
1109
|
y && (s.value = y.value);
|
|
1110
1110
|
}), M();
|
|
1111
1111
|
}
|
|
@@ -1192,7 +1192,7 @@ const fn = { class: "center" }, hn = {
|
|
|
1192
1192
|
m.isSelecting = !0, m.startCell = {
|
|
1193
1193
|
rowIndex: s.rowIndex,
|
|
1194
1194
|
colIndex: s.colIndex
|
|
1195
|
-
}, m.endCell = { ...m.startCell },
|
|
1195
|
+
}, m.endCell = { ...m.startCell }, je(), qe();
|
|
1196
1196
|
}, ge = (c) => {
|
|
1197
1197
|
if (!m.isSelecting)
|
|
1198
1198
|
return;
|
|
@@ -1200,7 +1200,7 @@ const fn = { class: "center" }, hn = {
|
|
|
1200
1200
|
s && (m.endCell = {
|
|
1201
1201
|
rowIndex: s.rowIndex,
|
|
1202
1202
|
colIndex: s.colIndex
|
|
1203
|
-
},
|
|
1203
|
+
}, je(), qe());
|
|
1204
1204
|
}, be = () => {
|
|
1205
1205
|
m.isSelecting = !1;
|
|
1206
1206
|
}, Se = () => {
|
|
@@ -1219,7 +1219,7 @@ const fn = { class: "center" }, hn = {
|
|
|
1219
1219
|
"cell-border-left"
|
|
1220
1220
|
);
|
|
1221
1221
|
});
|
|
1222
|
-
},
|
|
1222
|
+
}, je = () => {
|
|
1223
1223
|
if (!m.startCell || !m.endCell) {
|
|
1224
1224
|
m.selectedCells = [];
|
|
1225
1225
|
return;
|
|
@@ -1232,7 +1232,7 @@ const fn = { class: "center" }, hn = {
|
|
|
1232
1232
|
rowIndex: E,
|
|
1233
1233
|
colIndex: $
|
|
1234
1234
|
});
|
|
1235
|
-
},
|
|
1235
|
+
}, qe = () => {
|
|
1236
1236
|
Le(() => {
|
|
1237
1237
|
const c = g.value;
|
|
1238
1238
|
if (!c)
|
|
@@ -1341,9 +1341,9 @@ const fn = { class: "center" }, hn = {
|
|
|
1341
1341
|
}
|
|
1342
1342
|
}, $e = (c) => {
|
|
1343
1343
|
l.searchForm.enableCellCopy && ((c.ctrlKey || c.metaKey) && c.key === "c" ? m.selectedCells.length > 0 && (c.preventDefault(), c.stopPropagation(), gt()) : c.key === "Escape" && Se());
|
|
1344
|
-
},
|
|
1344
|
+
}, Be = () => {
|
|
1345
1345
|
m.isSelecting = !1;
|
|
1346
|
-
},
|
|
1346
|
+
}, Ye = (c) => {
|
|
1347
1347
|
const s = g.value;
|
|
1348
1348
|
if (!s || !s.$el)
|
|
1349
1349
|
return;
|
|
@@ -1353,11 +1353,11 @@ const fn = { class: "center" }, hn = {
|
|
|
1353
1353
|
}, pt = (c) => {
|
|
1354
1354
|
b[v] = c, b[C] = 1, M();
|
|
1355
1355
|
};
|
|
1356
|
-
function
|
|
1356
|
+
function Ke() {
|
|
1357
1357
|
const c = g.value.getCheckboxRecords();
|
|
1358
1358
|
l.searchForm.selections = c;
|
|
1359
1359
|
}
|
|
1360
|
-
const
|
|
1360
|
+
const He = (c) => {
|
|
1361
1361
|
const s = g.value;
|
|
1362
1362
|
if (s) {
|
|
1363
1363
|
s.toggleCheckboxRow(c);
|
|
@@ -1406,8 +1406,8 @@ const fn = { class: "center" }, hn = {
|
|
|
1406
1406
|
border: ""
|
|
1407
1407
|
}, se.value, {
|
|
1408
1408
|
height: z.value,
|
|
1409
|
-
onCheckboxChange:
|
|
1410
|
-
onCheckboxAll:
|
|
1409
|
+
onCheckboxChange: Ke,
|
|
1410
|
+
onCheckboxAll: Ke,
|
|
1411
1411
|
onSortChange: (E = se.value["sort-config"]) == null ? void 0 : E.sortChange
|
|
1412
1412
|
}), {
|
|
1413
1413
|
default: j(() => [
|
|
@@ -1425,13 +1425,13 @@ const fn = { class: "center" }, hn = {
|
|
|
1425
1425
|
checked: !0,
|
|
1426
1426
|
disabled: R,
|
|
1427
1427
|
size: "default",
|
|
1428
|
-
onClick: ze((K) => !R &&
|
|
1428
|
+
onClick: ze((K) => !R && He(B), ["stop"])
|
|
1429
1429
|
}, null, 8, ["disabled", "onClick"])) : (D(), Y(F, {
|
|
1430
1430
|
key: 1,
|
|
1431
1431
|
disabled: R,
|
|
1432
1432
|
checked: !1,
|
|
1433
1433
|
size: "default",
|
|
1434
|
-
onClick: ze((K) => !R &&
|
|
1434
|
+
onClick: ze((K) => !R && He(B), ["stop"])
|
|
1435
1435
|
}, null, 8, ["disabled", "onClick"])),
|
|
1436
1436
|
P(U, {
|
|
1437
1437
|
type: "info",
|
|
@@ -1499,7 +1499,7 @@ const fn = { class: "center" }, hn = {
|
|
|
1499
1499
|
}
|
|
1500
1500
|
};
|
|
1501
1501
|
function Bn(n, e = {}) {
|
|
1502
|
-
const t =
|
|
1502
|
+
const t = Re(), o = {
|
|
1503
1503
|
inForm: !0,
|
|
1504
1504
|
required: !0,
|
|
1505
1505
|
...e
|
|
@@ -1755,7 +1755,7 @@ function Kn(n, e = {}) {
|
|
|
1755
1755
|
}
|
|
1756
1756
|
function Hn(n) {
|
|
1757
1757
|
const e = q(n), t = q(""), o = q("");
|
|
1758
|
-
return
|
|
1758
|
+
return Pe(e, (a) => {
|
|
1759
1759
|
const r = a || ["", ""];
|
|
1760
1760
|
t.value = r[0], o.value = r[1];
|
|
1761
1761
|
}), [e, t, o];
|
|
@@ -1776,7 +1776,7 @@ function Te(n, e) {
|
|
|
1776
1776
|
}
|
|
1777
1777
|
function Zn(n, e = []) {
|
|
1778
1778
|
const { locale: t } = pe(), o = q(n());
|
|
1779
|
-
return
|
|
1779
|
+
return Pe(
|
|
1780
1780
|
[t, ...e],
|
|
1781
1781
|
() => {
|
|
1782
1782
|
o.value = n();
|
|
@@ -1792,15 +1792,15 @@ function Gn(n, e = "zh_cn", t = "en_us") {
|
|
|
1792
1792
|
}
|
|
1793
1793
|
function Wn(n, e) {
|
|
1794
1794
|
let t = Vt;
|
|
1795
|
-
return typeof n == "string" && n.length > 0 && (t =
|
|
1795
|
+
return typeof n == "string" && n.length > 0 && (t = Ue(n).mapState), ht(e, t);
|
|
1796
1796
|
}
|
|
1797
1797
|
function Jn(n, e) {
|
|
1798
1798
|
let t = Mt;
|
|
1799
|
-
return typeof n == "string" && n.length > 0 && (t =
|
|
1799
|
+
return typeof n == "string" && n.length > 0 && (t = Ue(n).mapGetters), ht(e, t);
|
|
1800
1800
|
}
|
|
1801
1801
|
function Qn(n, e) {
|
|
1802
1802
|
let t = At;
|
|
1803
|
-
return typeof n == "string" && n.length > 0 && (t =
|
|
1803
|
+
return typeof n == "string" && n.length > 0 && (t = Ue(n).mapActions), gn(e, t);
|
|
1804
1804
|
}
|
|
1805
1805
|
function ht(n, e) {
|
|
1806
1806
|
const t = lt(), o = e(n), a = {};
|
|
@@ -1881,7 +1881,7 @@ function Xn() {
|
|
|
1881
1881
|
to: r
|
|
1882
1882
|
} = n;
|
|
1883
1883
|
if (!a)
|
|
1884
|
-
return P(
|
|
1884
|
+
return P(Ne, {
|
|
1885
1885
|
underline: "never",
|
|
1886
1886
|
type: "primary",
|
|
1887
1887
|
onclick: () => o.push({
|
|
@@ -1894,7 +1894,7 @@ function Xn() {
|
|
|
1894
1894
|
default: () => [e.row[t]]
|
|
1895
1895
|
});
|
|
1896
1896
|
const l = ((u = e.row[t]) == null ? void 0 : u.split(",")) || [];
|
|
1897
|
-
return l.map((d, w) => P("span", null, [P(
|
|
1897
|
+
return l.map((d, w) => P("span", null, [P(Ne, {
|
|
1898
1898
|
underline: "never",
|
|
1899
1899
|
type: "primary",
|
|
1900
1900
|
onclick: () => o.push({
|
|
@@ -1919,7 +1919,7 @@ export {
|
|
|
1919
1919
|
jn as ListPage,
|
|
1920
1920
|
Yn as OnePortalCasSDK,
|
|
1921
1921
|
un as SearchBar,
|
|
1922
|
-
|
|
1922
|
+
We as StatusMap,
|
|
1923
1923
|
Fn as _toRaw,
|
|
1924
1924
|
Nn as _typeOf,
|
|
1925
1925
|
Tn as arrToStatusMap,
|
|
@@ -1931,7 +1931,7 @@ export {
|
|
|
1931
1931
|
Me as en,
|
|
1932
1932
|
Kt as exportExcel,
|
|
1933
1933
|
ct as getI18n,
|
|
1934
|
-
|
|
1934
|
+
Re as getI18nT,
|
|
1935
1935
|
dn as getListPageConfig,
|
|
1936
1936
|
Gn as getLocaleValue,
|
|
1937
1937
|
Mn as getValueBykey,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(m,K){typeof exports=="object"&&typeof module<"u"?K(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"],K):(m=typeof globalThis<"u"?globalThis:m||self,K(m.JoyAdminComponents={},m.ElementPlus,m.Vue,m.fileSaver,m.ExcelJS,m.dayjs,m.VueI18n,m._,m.VueRouter,m.Vuex,m.VxeUI))})(this,function(m,K,e,He,Ie,he,ee,le,ve,Q,se){"use strict";const Ze=e.defineComponent({name:"LayOutForm",setup(o,{slots:t,attrs:n,emit:l}){const a=e.ref(null),s=()=>t.default?t.default().filter(d=>d.type!==Symbol.for("v-cmt")).map(d=>d.type===Symbol.for("v-fgt")?d.children:d).flat().map(d=>{var f;return e.h(K.ElCol,{span:((f=d.props)==null?void 0:f.span)||24},{default:()=>d})}):null;e.onMounted(()=>{l("ref",a.value)});function r(){return e.h(K.ElForm,{...n,ref:a},()=>e.h(K.ElRow,{gutter:n.gutter??20},{default:()=>s()}))}return r}});var Te=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ee(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Le={exports:{}};(function(o,t){(function(n,l){o.exports=l()})(Te,function(){var n="minute",l=/[+-]\d\d(?::?\d\d)?/g,a=/([+-]|\d\d)/g;return function(s,r,d){var f=r.prototype;d.utc=function(h){var g={date:h,utc:!0,args:arguments};return new r(g)},f.utc=function(h){var g=d(this.toDate(),{locale:this.$L,utc:!0});return h?g.add(this.utcOffset(),n):g},f.local=function(){return d(this.toDate(),{locale:this.$L,utc:!1})};var _=f.parse;f.parse=function(h){h.utc&&(this.$u=!0),this.$utils().u(h.$offset)||(this.$offset=h.$offset),_.call(this,h)};var S=f.init;f.init=function(){if(this.$u){var h=this.$d;this.$y=h.getUTCFullYear(),this.$M=h.getUTCMonth(),this.$D=h.getUTCDate(),this.$W=h.getUTCDay(),this.$H=h.getUTCHours(),this.$m=h.getUTCMinutes(),this.$s=h.getUTCSeconds(),this.$ms=h.getUTCMilliseconds()}else S.call(this)};var x=f.utcOffset;f.utcOffset=function(h,g){var $=this.$utils().u;if($(h))return this.$u?0:$(this.$offset)?x.call(this):this.$offset;if(typeof h=="string"&&(h=function(T){T===void 0&&(T="");var Y=T.match(l);if(!Y)return null;var O=(""+Y[0]).match(a)||["-",0,0],c=O[0],y=60*+O[1]+ +O[2];return y===0?0:c==="+"?y:-y}(h),h===null))return this;var V=Math.abs(h)<=16?60*h:h;if(V===0)return this.utc(g);var I=this.clone();if(g)return I.$offset=V,I.$u=!1,I;var B=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(I=this.local().add(V+B,n)).$offset=V,I.$x.$localOffset=B,I};var b=f.format;f.format=function(h){var g=h||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return b.call(this,g)},f.valueOf=function(){var h=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*h},f.isUTC=function(){return!!this.$u},f.toISOString=function(){return this.toDate().toISOString()},f.toString=function(){return this.toDate().toUTCString()};var w=f.toDate;f.toDate=function(h){return h==="s"&&this.$offset?d(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():w.call(this)};var p=f.diff;f.diff=function(h,g,$){if(h&&this.$u===h.$u)return p.call(this,h,g,$);var V=this.local(),I=d(h).local();return p.call(V,I,g,$)}}})})(Le);var Ge=Le.exports;const We=Ee(Ge);var Fe={exports:{}};(function(o,t){(function(n,l){o.exports=l()})(Te,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},l={};return function(a,s,r){var d,f=function(b,w,p){p===void 0&&(p={});var h=new Date(b),g=function($,V){V===void 0&&(V={});var I=V.timeZoneName||"short",B=$+"|"+I,T=l[B];return T||(T=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:$,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:I}),l[B]=T),T}(w,p);return g.formatToParts(h)},_=function(b,w){for(var p=f(b,w),h=[],g=0;g<p.length;g+=1){var $=p[g],V=$.type,I=$.value,B=n[V];B>=0&&(h[B]=parseInt(I,10))}var T=h[3],Y=T===24?0:T,O=h[0]+"-"+h[1]+"-"+h[2]+" "+Y+":"+h[4]+":"+h[5]+":000",c=+b;return(r.utc(O).valueOf()-(c-=c%1e3))/6e4},S=s.prototype;S.tz=function(b,w){b===void 0&&(b=d);var p,h=this.utcOffset(),g=this.toDate(),$=g.toLocaleString("en-US",{timeZone:b}),V=Math.round((g-new Date($))/1e3/60),I=15*-Math.round(g.getTimezoneOffset()/15)-V;if(!Number(I))p=this.utcOffset(0,w);else if(p=r($,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(I,!0),w){var B=p.utcOffset();p=p.add(h-B,"minute")}return p.$x.$timezone=b,p},S.offsetName=function(b){var w=this.$x.$timezone||r.tz.guess(),p=f(this.valueOf(),w,{timeZoneName:b}).find(function(h){return h.type.toLowerCase()==="timezonename"});return p&&p.value};var x=S.startOf;S.startOf=function(b,w){if(!this.$x||!this.$x.$timezone)return x.call(this,b,w);var p=r(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return x.call(p,b,w).tz(this.$x.$timezone,!0)},r.tz=function(b,w,p){var h=p&&w,g=p||w||d,$=_(+r(),g);if(typeof b!="string")return r(b).tz(g);var V=function(Y,O,c){var y=Y-60*O*1e3,L=_(y,c);if(O===L)return[y,O];var z=_(y-=60*(L-O)*1e3,c);return L===z?[y,L]:[Y-60*Math.min(L,z)*1e3,Math.max(L,z)]}(r.utc(b,h).valueOf(),$,g),I=V[0],B=V[1],T=r(I).utcOffset(B);return T.$x.$timezone=g,T},r.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},r.tz.setDefault=function(b){d=b}}})})(Fe);var Je=Fe.exports;const Qe=Ee(Je),me={"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":"展开",excel:{fieldsMappingRequired:"请输入列字段映射",invalidInput:"非法输入",invalidOption:"请输入有效选项!",copyFailed:"复制失败",sheetNameTooLong:'Sheet名称 "{0}" 长度超过31个字符,已自动截断为 "{1}"'},validate:{invalidInput:"请输入正确内容"},tools:{keysLengthError:"keys 长度必须大于2 默认前两位为 label value"}},ge={"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",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"}},De={zh_cn:me,en:ge};let re=null;function Be(o=null){if(o){const{global:t}=o;return t.messages.value.zh_cn?t.mergeLocaleMessage("zh_cn",me):t.setLocaleMessage("zh_cn",me),t.messages.value.en?t.mergeLocaleMessage("en",ge):t.setLocaleMessage("en",ge),re=o,o}return re||(re=ee.createI18n({legacy:!1,locale:"zh_cn",fallbackLocale:"zh_cn",messages:De})),re}function Ce(){return re||Be()}function pe(){return Ce().global.t}he.extend(We),he.extend(Qe);async function Xe(o,t){const{fields:n,range:l=1}=t;if(!n){const r=pe();throw new Error(r("excel.fieldsMappingRequired"))}let a=new Ie.Workbook;await a.xlsx.load(o);const s={};return a.eachSheet(function(r,d){const f=[];r.eachRow(function(_,S){if(S>l){let x={},b=!0;Object.keys(n).forEach(w=>{const p=_.getCell(n[w]).value;x[w]=p,p&&(b=!1)}),b||f.push(x)}}),s[r._name]=f}),a=null,s}const et={columnWidth:30};async function ze(o,t,n=[],l={}){if(!o||!t)return;const{columnStyle:a}=l,{columnWidth:s}=et;t.forEach(f=>{f.width=f.width?f.width:s});const{workbook:r,worksheet:d}=tt();d.columns=t,d.addRows(n),a&&await nt(r,d,a);try{const f=await r.xlsx.writeBuffer(),_=new File([f],o,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});He.saveAs(_)}catch(f){console.log(f)}}function tt(){const o=new Ie.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 nt(o,t,n){const l=Object.keys(n);for(const a of l){const s=n[a],{type:r}=s;switch(r){case"IMG":await ot(o,t,a);break}}}async function ot(o,t,n,l){const a=t.getColumn(n),s=a.values;t.getColumn(n).width=20,t.eachRow((r,d)=>{d>1&&(r.height=40)});for(let r=0,d=s.length;r<d;r++){if(r<2)continue;let f=s[r];f&&(t.getCell(a.letter+r).value="",await lt(o,t,f,{width:100,height:50,col:a._number-1,row:r-1}))}}async function lt(o,t,n,l){const{col:a,row:s,width:r,height:d}=l,{success:f,base64:_}=await rt(n,.3);if(f){const S=o.addImage({base64:_,extension:"jpeg"});t.addImage(S,{tl:{col:a,row:s},ext:{width:r,height:d}})}}function rt(o,t=1){const n=new Image;return n.setAttribute("crossOrigin","anonymous"),n.crossOrigin="anonymous",n.src=o,new Promise((l,a)=>{n.onload=()=>{const s=document.createElement("canvas");s.width=n.width,s.height=n.height,s.getContext("2d").drawImage(n,0,0,s.width,s.height),l({success:!0,base64:s.toDataURL("image/jpeg",t)})},n.onerror=()=>{l({success:!1})}})}function at(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 st(o){return new Promise(t=>{setTimeout(()=>{t()},o)})}function it(o){return JSON.parse(JSON.stringify(o))}function ct(o){let t=[],n={},l=(a,s)=>Object.prototype.hasOwnProperty.call(a,s);for(const a of o){n[a.id]={...a,children:l(n,a.id)?n[a.id].children:[]};const s=n[a.id];a.pid==-1?t.push(s):(l(n,a.pid)||(n[a.pid]={children:[]}),n[a.pid].children.push(s))}return t}function ye(o,t=" "){return o?o.split(t).filter(n=>n.trim()):[]}class be{constructor(t,n=["label","value","labelEn"]){this.list=t,this.map=new Map(t.map(l=>{let a={...l,label:l[n[0]],value:l[n[1]]};return n[2]&&(a.labelEn=l[n[2]]),[l[n[1]],a]}))}getName(t,n){if(!this.has(t))return"-";const{label:l,labelEn:a}=this.map.get(t);return(n=="zh_cn"?l:a)||l||"-"}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 ut(o,t=[],n="i18nName"){if(o.length==0)return new be([]);if(t.length<2){const a=pe();throw new Error(a("tools.keysLengthError"))}let l=o.map(a=>{let s={};return n&&(s.labelEn=a[n]),t.forEach((r,d)=>{d===0?s.label=a[r]:d===1?s.value=a[r]:s[r]=a[r]}),s});return new be(l)}function dt(o){return o?o.replace(/<[^>]+>/g,""):""}function ft(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 ht(o,t=10){let n=1048576*t;return!(o.size>n)}function mt(o){return Array.from(10).fill(0).map((n,l)=>o+"_"+l)}function gt(o){let t={};return o.map((n,l)=>{let{key:a,option:s,type:r}=n,d=at(l);s?t[a]=`${d}---option`:r==="image"?t[a]=`${d}---image`:t[a]=d}),t}function pt(o,t){return t.split(".").reduce((n,l)=>n&&n[l],o)}const Ht="",ie=(o,t)=>{const n=o.__vccOpts||o;for(const[l,a]of t)n[l]=a;return n},Oe=ie({__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"],["update:modelValue"]),setup(o,{emit:t}){const n=o,l=e.useAttrs(),{t:a,locale:s}=ee.useI18n(),r=e.useModel(o,"modelValue"),d=e.computed(()=>l["value-key"]!=null),f=e.ref(""),_=e.computed(()=>{if(l.remote!==void 0)return n.data;const c=ye(f.value),{data:y,labelValue:L}=n,z=y||b.value;if(c.length==0)return z;const{label:W,labelEn:te}=L;let C=s.value=="en_us"?te||"i18nName":W;return c.length==1?z.filter(X=>X[C].toLowerCase().includes(c[0].toLowerCase())):z.filter(X=>{let ae=!1;return ae=c.some(de=>X[C].toLowerCase()==de.toLowerCase()),ae})}),S=e.computed({get(){return l.multiple==null||r.value==null?!1:r.value.length==_.value.length},set(c){return c}}),x=t,b=e.ref([]),w=async()=>{const{data:c}=await n.api();b.value=[...c],x("success",b)};n.api&&w();function p(c){x("change",c)}const h=n.labelValue.label.split("-"),g=c=>{if(h.length==1){if(n.changeLocal)return a(c[n.labelValue.label]);let y=s.value=="en_us"?c[n.labelValue.labelEn||"i18nName"]:c[n.labelValue.label];return y=y||c[n.labelValue.label],y}else{let y=[];return h.forEach(L=>{y.push(c[L])}),y.join("-")}};function $(c){let y=n.data?n.data:b.value;r.value=c?y.map(L=>d.value?L:L[n.labelValue.value]):[],x("change",r.value)}function V(c){n.optionClick&&n.optionClick(c),x("change",d.value?c:c[n.labelValue.value])}function I(c){return r.value.length>=n.maxLimit&&!r.value.includes(c[n.labelValue.value])}function B(c){return c.map(y=>({label:g(y),value:d.value?y:y[n.labelValue.value]}))}const T=e.ref([]),Y=n.data?n.data:b.value;T.value=B(Y),watch(()=>n.data?n.data:b.value,c=>{var L;const y=B(c);if(y.length!==T.value.length)T.value=y;else{let z=!1;for(let W=0;W<y.length;W++)if(y[W].value!==((L=T.value[W])==null?void 0:L.value)){z=!0;break}z&&(T.value=y)}},{deep:!0});const O=e.computed(()=>T.value);return(c,y)=>{const L=e.resolveComponent("el-checkbox"),z=e.resolveComponent("el-select-v2"),W=e.resolveComponent("el-option"),te=e.resolveComponent("el-select");return e.unref(l).v2!=null?(e.openBlock(),e.createBlock(z,e.mergeProps({key:0,options:O.value,modelValue:r.value,"onUpdate:modelValue":y[1]||(y[1]=C=>r.value=C)},e.unref(l),{filterable:"","collapse-tags":"","collapse-tags-tooltip":"",clearable:"",onChange:p,onClear:p}),e.createSlots({_:2},[e.unref(l).multiple!=null?{name:"header",fn:e.withCtx(()=>[e.renderSlot(c.$slots,"header",{},()=>[e.createVNode(L,{class:"mgl20",modelValue:S.value,"onUpdate:modelValue":y[0]||(y[0]=C=>S.value=C),onChange:$},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0)]),key:"0"}:void 0]),1040,["options","modelValue"])):(e.openBlock(),e.createBlock(te,e.mergeProps({key:1,modelValue:r.value,"onUpdate:modelValue":y[3]||(y[3]=C=>r.value=C),filterable:"","collapse-tags":"","collapse-tags-tooltip":"","filter-method":e.unref(l).remote!=null?void 0:C=>f.value=C,clearable:""},e.unref(l),{onClear:o.optionClick}),{default:e.withCtx(()=>[e.unref(l).multiple!=null&&o.showCheckAll&&o.maxLimit==null?e.renderSlot(c.$slots,"header",{key:0},()=>[e.createVNode(L,{class:"mgl20",modelValue:S.value,"onUpdate:modelValue":y[2]||(y[2]=C=>S.value=C),onChange:$},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(C,ue)=>(e.openBlock(),e.createBlock(W,{key:ue,label:g(C),disabled:e.unref(l).multiple!=null&&o.maxLimit>0?I(C):!1,onClick:e.withModifiers(X=>V(C),["stop"]),value:d.value?C:C[o.labelValue.value]},null,8,["label","disabled","onClick","value"]))),128))]),_:3},16,["modelValue","filter-method","onClear"]))}}},[["__scopeId","data-v-6c1bbad1"]]),Gt="",Ct=e.defineComponent({props:{name:{tyepe:String,required:!0}}});function yt(o,t,n,l,a,s){const r=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(r,{class:"cmp-icon"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.name)))]),_:1})}const we=ie(Ct,[["render",yt],["__scopeId","data-v-733f9daa"]]),bt={__name:"index",emits:["ok","no"],setup(o,{emit:t}){const n=t,l=le.debounce(()=>{n("ok")},500);function a(){n("no")}return(s,r)=>{const d=e.resolveComponent("el-link"),f=e.resolveComponent("el-popconfirm");return e.openBlock(),e.createBlock(f,e.mergeProps(s.$attrs,{onConfirm:e.unref(l),onCancel:a}),{reference:e.withCtx(()=>[e.createVNode(d,{underline:"never",type:s.$attrs.type},{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},8,["type"])]),_:3},16,["onConfirm"])}}},Wt="",wt=["accept"],kt=ie({__name:"index",props:{accept:{type:String,default:".xlsx,.xls"},loading:{type:Boolean,default:!1}},emits:["fileChange"],setup(o,{emit:t}){const n=t,l=e.ref(null);function a(s){let r=s.target.files[0];n("fileChange",r),l.value.value=null}return(s,r)=>{const d=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("span",null,[e.createVNode(d,{loading:o.loading,class:"mgr10",onClick:r[0]||(r[0]=f=>l.value.click())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.$t("dao-ru")),1)]),_:1},8,["loading"]),e.createElementVNode("input",{onChange:a,ref_key:"input",ref:l,accept:o.accept,style:{position:"absolute",width:"0px",height:"0px",opacity:"0"},type:"file"},null,40,wt)])}}},[["__scopeId","data-v-5f1449ad"]]);function ke(o){let t={};return o.forEach(n=>{const{key:l,type:a,option:s={},value:r,dateType:d}=n;if(l)if(a=="input"&&(s!=null&&s.multiple))t[l]=ye(r);else if(a=="date")if(d.includes("range")){const[f,_]=l;let[S,x]=r||[];S&&d=="daterange"&&(S=he(S).format("YYYY-MM-DD 00:00:00"),x=he(x).format("YYYY-MM-DD 23:59:59")),t[f]=S,t[_]=x}else t[l]=r;else t[l]=r}),t}const Qt="",xt={key:0},St={class:"btns"},_t={class:"left"},$t={class:"right"},Me=ie({__name:"index",props:{form:{type:Object,required:!0}},emits:["confirm","reset","visibleChange"],setup(o,{expose:t,emit:n}){const l=o,a=n,s=e.ref(!0),r=e.ref(null),{t:d}=ee.useI18n(),f=e.computed(()=>s.value?d("guan-bi"):d("zhan-kai"));function _(){a("confirm")}function S(g){g.option.onClear&&g.option.onClear(),a("confirm")}function x(){a("reset")}function b(){a("confirm")}function w(){return ke(l.form.items)}const p=le.cloneDeep(l.form.items);function h(){l.form.items.forEach(g=>{const $=p.find(V=>V.key==g.key);$&&(g.value=$.value)})}return t({getPrm:w,reset:h}),(g,$)=>{const V=e.resolveComponent("el-input"),I=e.resolveComponent("el-date-picker"),B=e.resolveComponent("el-form-item"),T=e.resolveComponent("el-form"),Y=e.resolveComponent("el-link"),O=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",{class:"searchBar-container mgt10 mgb10",onKeydown:e.withKeys(_,["enter"])},[e.createElementVNode("div",{class:"searchBar",style:e.normalizeStyle({height:s.value?"auto":"42px"})},[e.createVNode(T,{inline:"",model:o.form.data},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.form.items.filter(c=>!c.hidden),c=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c.key},[c.type=="br"?(e.openBlock(),e.createElementBlock("br",xt)):(e.openBlock(),e.createBlock(B,{key:1,label:c.name},{default:e.withCtx(()=>{var y,L;return[c.type==="input"?(e.openBlock(),e.createBlock(V,{key:0,modelValue:c.value,"onUpdate:modelValue":z=>c.value=z,class:e.normalizeClass(((y=c.option)==null?void 0:y.class)||"w150"),placeholder:g.$t("qing-shu-ru"),clearable:""},null,8,["modelValue","onUpdate:modelValue","class","placeholder"])):c.type==="custom"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.render),{key:1})):e.createCommentVNode("",!0),c.type==="select"?(e.openBlock(),e.createBlock(Oe,e.mergeProps({key:2,class:((L=c.option)==null?void 0:L.class)||"w150",modelValue:c.value,"onUpdate:modelValue":z=>c.value=z},{ref_for:!0},c.option,{onChange:_,onClear:z=>S(c)}),null,16,["class","modelValue","onUpdate:modelValue","onClear"])):e.createCommentVNode("",!0),c.type==="date"?(e.openBlock(),e.createBlock(I,{key:3,class:e.normalizeClass({datetimerange:"w300",daterange:"w200"}[c.dateType]||"w100"),modelValue:c.value,"onUpdate:modelValue":z=>c.value=z,"value-format":{datetimerange:"YYYY-MM-DD HH:mm:ss",daterange:"YYYY-MM-DD"}[c.dateType]||"YYYY-MM-DD",type:c.dateType||"date",onFocus:z=>r.value=c,onChange:z=>b(),placeholder:g.$t("qing-xuan-ze"),"start-placeholder":g.$t("kai-shi-shi-jian"),"end-placeholder":g.$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",St,[e.createElementVNode("div",_t,[e.renderSlot(g.$slots,"table-header-left",{},void 0,!0)]),e.createElementVNode("div",$t,[e.createVNode(Y,{underline:"never",class:"mgr10",onClick:$[0]||($[0]=()=>{a("visibleChange",!s.value),s.value=!s.value})},{default:e.withCtx(()=>[e.createVNode(we,{name:s.value?"ArrowUp":"ArrowDown"},null,8,["name"]),e.createTextVNode(" "+e.toDisplayString(f.value),1)]),_:1}),e.createVNode(O,{type:"primary",onClick:_},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.$t("shai-xuan")),1)]),_:1}),e.createVNode(O,{type:"primary",onClick:x},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.$t("chong-zhi")),1)]),_:1}),e.renderSlot(g.$slots,"btn",{},void 0,!0)])])],32)}}},[["__scopeId","data-v-32ac9990"]]),Ne={pageNoKey:"pageNo",pageSizeKey:"pageSize",totalKey:"total",defaultPageSize:10,pageSizes:[10,50,100,500],responseDataKeys:{rows:["rows","records"],total:["totalRows","total"]},showSearch:!1,showPage:!1,showShadow:!1,showCheckBox:!1,enableCellCopy:!0};let ce={...Ne};function Vt(o){ce={...ce,...o,responseDataKeys:{...ce.responseDataKeys,...o.responseDataKeys||{}}}}function Ae(){return ce}function It(){ce={...Ne}}const en="",vt={class:"center"},Tt=ie({__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:l}=ee.useI18n(),a=ve.useRoute(),s=Ae(),r=o,d=e.ref(!1),f=e.ref([]);r.searchForm.showSearch===void 0&&(r.searchForm.showSearch=s.showSearch),r.searchForm.showPage===void 0&&(r.searchForm.showPage=s.showPage),r.searchForm.showShadow===void 0&&(r.searchForm.showShadow=s.showShadow),r.searchForm.showCheckBox===void 0&&(r.searchForm.showCheckBox=s.showCheckBox),r.searchForm.enableCellCopy===void 0&&(r.searchForm.enableCellCopy=s.enableCellCopy),r.searchForm.selections||(r.searchForm.selections=[]);const _=e.computed(()=>{const u=a.path.replace(/\//g,"-").replace(/^-/,"")||"default-table";return r.id?`listPageId-${u}-${r.id}`:`listPageId-${u}`}),S=le.cloneDeep(r.searchForm.items),x=r.searchForm.pageNoKey||s.pageNoKey,b=r.searchForm.pageSizeKey||s.pageSizeKey,w=e.reactive({[x]:1,[b]:r.searchForm.defaultPageSize||s.defaultPageSize,total:0}),p=e.ref(null),h=e.ref(null),g=e.ref(450),$=le.debounce(()=>{e.nextTick(()=>{if(!h.value)return;const i=h.value.getBoundingClientRect(),k=window.innerHeight,E=i.top,N=100,R=k-E-N,F=200;g.value=Math.max(R,F)})},100),V=()=>{$()},I=()=>{if(!r.searchForm.enableCellCopy)return!1;const u=p.value;if(!u||!u.$el)return!1;const i=u.$el;return i.classList.add("cell-copy-enabled"),i.setAttribute("tabindex","-1"),i.removeEventListener("mousedown",X),i.removeEventListener("mousemove",ae),i.removeEventListener("mouseup",de),i.removeEventListener("keydown",$e),i.addEventListener("mousedown",X),i.addEventListener("mousemove",ae),i.addEventListener("mouseup",de),i.addEventListener("keydown",$e),!0};e.onMounted(()=>{$(),window.addEventListener("resize",V),r.searchForm.enableCellCopy&&(document.addEventListener("mouseup",Ue),document.addEventListener("mousedown",je),setTimeout(()=>{I()},500))}),e.onUpdated(()=>{r.searchForm.enableCellCopy&&setTimeout(()=>{I()},500)}),e.onUnmounted(()=>{if(window.removeEventListener("resize",V),r.searchForm.enableCellCopy){document.removeEventListener("mouseup",Ue),document.removeEventListener("mousedown",je);const u=p.value;if(u&&u.$el){const i=u.$el;i.removeEventListener("mousedown",X),i.removeEventListener("mousemove",ae),i.removeEventListener("mouseup",de),i.removeEventListener("keydown",$e)}}});const B=e.computed(()=>te.value.height||g.value);let T;async function Y(u){const{dataFormat:i}=r.tableConfig;u[x]!=1&&(u.nextSearchAfter=T),d.value=!0;const{code:k,data:E={}}=await r.api(u).finally(()=>{d.value=!1,r.searchForm.selections=[]});if(k==200){let N=[];for(const F of s.responseDataKeys.rows)if(E[F]){N=E[F];break}let R=0;for(const F of s.responseDataKeys.total)if(E[F]!==void 0){R=E[F];break}f.value=i?i(N):N,w.total=R,T=E.nextSearchAfter,r.searchForm.enableCellCopy&&e.nextTick(()=>{setTimeout(()=>{I()},100)})}}function O(u={}){const{searchData:i=()=>({})}=r.tableConfig,k=i();Y({...w,...ke(r.searchForm.items),...u,...k})}function c(){const{reset:u}=r.tableConfig;u&&u(),r.searchForm.items.forEach(i=>{const k=S.find(E=>le.isArray(i.key)&&le.isArray(E.key)?i.key.join(",")==E.key.join(","):E.key==i.key);k&&(i.value=k.value)}),O()}r.api&&r.immediate&&O();function y(){return{...w,...ke(r.searchForm.items)}}const L=()=>{const u=p.value;u&&u.clearSort()},z=e.reactive({storage:!0}),W=e.reactive({drag:!0,resizable:!0,maxFixedSize:0}),te=e.computed(()=>{const{customConfig:u,columnConfig:i,...k}=r.tableConfig;return{headerAlign:"left",align:"center",customConfig:{...z,...u},columnConfig:{...W,...i},"virtual-x-config":{enabled:!1,scrollToLeftOnChange:!1},"virtual-y-config":{enabled:!0,gt:100},...k}}),C=e.reactive({isSelecting:!1,startCell:null,endCell:null,selectedCells:[]}),ue=u=>{const i=u.closest(".vxe-body--column");if(!i||i.classList.contains("col--checkbox")||i.classList.contains("col--seq"))return null;const k=i.closest(".vxe-body--row");if(!k)return null;const E=p.value;if(!E)return null;let N=-1;const R=k.getAttribute("data-rowid");if(R!=null)N=parseInt(R,10);else{const D=k.parentElement;N=Array.from(D.querySelectorAll(".vxe-body--row")).indexOf(k)}if(N<0)return null;let F=-1;const J=i.getAttribute("data-colid");if(J&&(F=E.getColumns().findIndex(v=>v.id===J)),F<0){const v=Array.from(k.querySelectorAll(".vxe-body--column")).indexOf(i),q=!!i.closest(".vxe-table--fixed-left-wrapper"),U=!!i.closest(".vxe-table--fixed-right-wrapper"),A=E.getColumns();if(q){const j=A.filter(P=>P.fixed==="left");v<j.length&&(F=A.indexOf(j[v]))}else if(U){const j=A.filter(P=>P.fixed==="right");v<j.length&&(F=A.indexOf(j[v]))}else{const j=r.searchForm.showCheckBox?1:0;F=A.filter(H=>H.fixed==="left").length+v-j}}return F<0?null:{rowIndex:N,colIndex:F,cell:i}},X=u=>{const i=ue(u.target);if(!i){_e();return}C.isSelecting=!0,C.startCell={rowIndex:i.rowIndex,colIndex:i.colIndex},C.endCell={...C.startCell},Pe(),Re()},ae=u=>{if(!C.isSelecting)return;const i=ue(u.target);i&&(C.endCell={rowIndex:i.rowIndex,colIndex:i.colIndex},Pe(),Re())},de=()=>{C.isSelecting=!1},_e=()=>{C.selectedCells=[],C.startCell=null,C.endCell=null;const u=p.value;if(!u)return;u.$el.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(k=>{k.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")})},Pe=()=>{if(!C.startCell||!C.endCell){C.selectedCells=[];return}const u=C.startCell.rowIndex,i=C.endCell.rowIndex,k=C.startCell.colIndex,E=C.endCell.colIndex,N=Math.min(u,i),R=Math.max(u,i),F=Math.min(k,E),J=Math.max(k,E);C.selectedCells=[];for(let D=N;D<=R;D++)for(let v=F;v<=J;v++)C.selectedCells.push({rowIndex:D,colIndex:v})},Re=()=>{e.nextTick(()=>{const u=p.value;if(!u)return;const i=u.$el;if(i.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(q=>{q.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")}),C.selectedCells.length===0)return;const k=u.getColumns(),E=C.selectedCells.map(q=>q.rowIndex),N=C.selectedCells.map(q=>q.colIndex),R=Math.min(...E),F=Math.max(...E),J=Math.min(...N),D=Math.max(...N),v=[i.querySelector(".vxe-table--body-wrapper tbody"),i.querySelector(".vxe-table--fixed-left-wrapper tbody"),i.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean);C.selectedCells.forEach(({rowIndex:q,colIndex:U})=>{const A=k[U];if(!A)return;const j=A.fixed==="left",P=A.fixed==="right";for(const H of v){const fe=H.querySelectorAll(".vxe-body--row")[q];if(!fe)continue;const ne=Array.from(fe.querySelectorAll(".vxe-body--column"));let M=null;if(j&&H.closest(".vxe-table--fixed-left-wrapper")){const Z=k.filter(G=>G.fixed==="left").indexOf(A);M=ne[Z]}else if(P&&H.closest(".vxe-table--fixed-right-wrapper")){const Z=k.filter(G=>G.fixed==="right").indexOf(A);M=ne[Z]}else if(!j&&!P&&H.closest(".vxe-table--body-wrapper")){const oe=r.searchForm.showCheckBox?1:0,Z=k.filter(Ve=>Ve.fixed==="left").length,G=U-Z;M=ne[G+oe]}if(M&&!M.classList.contains("col--checkbox")&&!M.classList.contains("col--seq")){M.classList.add("cell-selected"),q===R&&M.classList.add("cell-border-top"),q===F&&M.classList.add("cell-border-bottom"),U===J&&M.classList.add("cell-border-left"),U===D&&M.classList.add("cell-border-right");break}}})})},Ut=async()=>{if(C.selectedCells.length===0)return;const u=p.value;if(!u)return;const i=u.$el,k=u.getColumns(),E=[...new Set(C.selectedCells.map(D=>D.rowIndex))].sort((D,v)=>D-v),N=[...new Set(C.selectedCells.map(D=>D.colIndex))].sort((D,v)=>D-v),R=[i.querySelector(".vxe-table--body-wrapper tbody"),i.querySelector(".vxe-table--fixed-left-wrapper tbody"),i.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean),F=[];E.forEach(D=>{const v=[];N.forEach(q=>{const U=k[q];if(!U){v.push("");return}const A=U.fixed==="left",j=U.fixed==="right";let P="";for(const H of R){const fe=H.querySelectorAll(".vxe-body--row")[D];if(!fe)continue;const ne=Array.from(fe.querySelectorAll(".vxe-body--column"));let M=null;if(A&&H.closest(".vxe-table--fixed-left-wrapper")){const Z=k.filter(G=>G.fixed==="left").indexOf(U);M=ne[Z]}else if(j&&H.closest(".vxe-table--fixed-right-wrapper")){const Z=k.filter(G=>G.fixed==="right").indexOf(U);M=ne[Z]}else if(!A&&!j&&H.closest(".vxe-table--body-wrapper")){const oe=r.searchForm.showCheckBox?1:0,Z=k.filter(Ve=>Ve.fixed==="left").length,G=q-Z;M=ne[G+oe]}if(M&&!M.classList.contains("col--checkbox")&&!M.classList.contains("col--seq")){P=M.innerText||M.textContent||"",P=P.trim(),P=P.replace(/\n/g," ").replace(/\s+/g," ");break}}v.push(P)}),F.push(v.join(" "))});const J=F.join(`
|
|
2
|
-
`);try{await navigator.clipboard.writeText(J)}catch(D){console.error("复制失败:",D)}},$e=u=>{r.searchForm.enableCellCopy&&((u.ctrlKey||u.metaKey)&&u.key==="c"?C.selectedCells.length>0&&(u.preventDefault(),u.stopPropagation(),Ut()):u.key==="Escape"&&_e())},Ue=()=>{C.isSelecting=!1},je=u=>{const i=p.value;if(!i||!i.$el)return;i.$el.contains(u.target)||_e()},jt=u=>{w[x]=u,O()},Yt=u=>{w[b]=u,w[x]=1,O()};function Ye(){const u=p.value.getCheckboxRecords();r.searchForm.selections=u}const Ke=u=>{const i=p.value;if(i){i.toggleCheckboxRow(u);const k=p.value.getCheckboxRecords();r.searchForm.selections=k}};return t({tableRef:p,getList:O,getPrm:y,clearSort:L,calculateTableHeight:$}),(u,i)=>{var D;const k=e.resolveComponent("el-button"),E=e.resolveComponent("el-checkbox"),N=e.resolveComponent("el-text"),R=e.resolveComponent("vxe-column"),F=e.resolveComponent("VxeTable"),J=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({box:o.searchForm.showShadow})},[o.searchForm.showSearch?(e.openBlock(),e.createBlock(Me,{key:0,form:o.searchForm,onReset:c,onConfirm:i[1]||(i[1]=v=>O()),onVisibleChange:e.unref($)},{btn:e.withCtx(()=>[e.renderSlot(u.$slots,"search-bar-btn",{},void 0,!0),e.createVNode(k,{round:"",onClick:i[0]||(i[0]=v=>p.value.openCustom())},{default:e.withCtx(()=>[e.createVNode(we,{name:"Tools"})]),_:1})]),_:3},8,["form","onVisibleChange"])):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"table-header-left",{},void 0,!0),e.createElementVNode("div",{ref_key:"tableContentRef",ref:h},[e.createVNode(F,e.mergeProps({id:_.value,ref_key:"tableRef",ref:p,loading:o.loading||d.value,data:o.api?f.value:o.data,border:""},te.value,{height:B.value,onCheckboxChange:Ye,onCheckboxAll:Ye,onSortChange:(D=te.value["sort-config"])==null?void 0:D.sortChange}),{default:e.withCtx(()=>[o.searchForm.showCheckBox==null||o.searchForm.showCheckBox?(e.openBlock(),e.createBlock(R,{key:0,type:"checkbox",width:e.unref(l)=="zh_cn"?80:150,title:u.$t("xu-hao"),fixed:"left"},{checkbox:e.withCtx(({rowIndex:v,row:q,checked:U,disabled:A,indeterminate:j})=>[e.createElementVNode("div",vt,[U?(e.openBlock(),e.createBlock(E,{key:0,checked:!0,disabled:A,size:"default",onClick:e.withModifiers(P=>!A&&Ke(q),["stop"])},null,8,["disabled","onClick"])):(e.openBlock(),e.createBlock(E,{key:1,disabled:A,checked:!1,size:"default",onClick:e.withModifiers(P=>!A&&Ke(q),["stop"])},null,8,["disabled","onClick"])),e.createVNode(N,{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(u.$slots,"default",{},void 0,!0)]),_:3},16,["id","loading","data","height","onSortChange"])],512),o.searchForm.showPage?(e.openBlock(),e.createBlock(J,{key:1,"current-page":w[e.unref(x)],"onUpdate:currentPage":i[2]||(i[2]=v=>w[e.unref(x)]=v),class:"myPagination mgt10",background:"",layout:"total, sizes, prev, pager, next",total:w.total,"page-size":w[e.unref(b)],"page-sizes":o.searchForm.pageSizes||e.unref(s).pageSizes,onCurrentChange:jt,onSizeChange:Yt},null,8,["current-page","total","page-size","page-sizes"])):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-de0d59d6"]]),Et={__name:"index",props:{sheetsConfig:{type:Object,required:!0},fileName:{type:String,required:!0}},setup(o){const t=o;function n(){ze(t.fileName,t.sheetsConfig)}return(l,a)=>{const s=e.resolveComponent("el-link");return e.openBlock(),e.createBlock(s,e.mergeProps({type:"primary",underline:"never"},l.$attrs,{onClick:n}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.$t("xia-zai-dao-ru-mo-ban")),1)]),_:1},16)}}};function Lt(o,t={}){const n=pe(),l={inForm:!0,required:!0,...t},a={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:s,value:r,required:d,msg:f=n("validate.invalidInput")}=l;return s?function(_,S,x){if(d){a.test(S)?x():x(new Error(f));return}S&&!a.test(S)?x(new Error(f)):x()}:a.test(r)}class Ft{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 l=await n.json();if(l.success&&l.data)return this.token=l.data.token,this.user=l.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(l.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 l={headers:{"Content-Type":"application/json",...n.headers},...n};l.headers.appId=this.config.clientCode,this.token&&(l.headers.Authorization=`Bearer ${this.token}`);try{const a=await fetch(t,l);return a.status===401?(this.log("Token已过期,需要重新登录"),this.logout(),null):a}catch(a){throw this.log("请求失败:",a),a}}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 Dt(o,t={}){const l=Object.assign({manual:!1,log:!1,params:null,format:null},t),{manual:a,log:s,params:r={},cb:d,format:f}=l,_=e.ref([]),S=e.ref(!1),x=b=>{const w=b||r;S.value=!0,o(w).then(p=>{const{code:h,data:g,msg:$}=p;if(d){const{records:V,rows:I}=g||{},B=V||I?V||I:g;_.value=xe(B,f),d(p)}if(g){if(g.records!=null||g.rows!=null){const{records:V,rows:I,total:B=0}=g||{};w&&w.total!=null&&(r.total=parseInt(B)),_.value=xe(V||I||[],f)}else _.value=xe(g,f);s&&console.log("useRequest-res",_.value)}}).catch(p=>{d&&(console.log("useRequestErr",p),d({code:500}))}).finally(()=>{S.value=!1})};return a||x(),[S,_,x]}function Bt(o){const t=e.ref(o),n=e.ref(""),l=e.ref("");return e.watch(t,a=>{const s=a||["",""];n.value=s[0],l.value=s[1]}),[t,n,l]}function zt(o){return Object.prototype.toString.call(o).slice(8,-1).toLowerCase()}function xe(o,t){if(!t)return o;if(o instanceof Array)return o.map(l=>{let a={};return t.forEach(s=>a[s]=l[s]),a});let n={};return t.forEach(l=>n[l]=o[l]),n}function Ot(o,t=[]){const{locale:n}=ee.useI18n(),l=e.ref(o());return e.watch([n,...t],()=>{l.value=o()},{immediate:!0}),l}function Mt(o,t="zh_cn",n="en_us"){if(!o)return"-";const l={en_us:n,zh_cn:t},s=Ce().global.locale.value;return o[l[s]]||o[t]||"-"}function Nt(o,t){let n=Q.mapState;return typeof o=="string"&&o.length>0&&(n=Q.createNamespacedHelpers(o).mapState),qe(t,n)}function At(o,t){let n=Q.mapGetters;return typeof o=="string"&&o.length>0&&(n=Q.createNamespacedHelpers(o).mapGetters),qe(t,n)}function qt(o,t){let n=Q.mapActions;return typeof o=="string"&&o.length>0&&(n=Q.createNamespacedHelpers(o).mapActions),Pt(t,n)}function qe(o,t){const n=Q.useStore(),l=t(o),a={};return Object.keys(l).forEach(s=>{const r=l[s].bind({$store:n});a[s]=e.computed(r)}),a}function Pt(o,t){const n=Q.useStore(),l=t(o),a={};return Object.keys(l).forEach(s=>{a[s]=l[s].bind({$store:n})}),a}function Se(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!e.isVNode(o)}function Rt(){se.VxeUI.renderer.add("Enum",{renderTableDefault(o,t){let n;if([null,void 0].includes(t.row[t.column.field]))return"-";const l=t.row[t.column.field];if(o.type=="tag"){let a;return e.createVNode(e.resolveComponent("el-text"),{type:o.enum.getTag(l)},Se(a=o.enum.getName(l))?a:{default:()=>[a]})}return e.createVNode(e.resolveComponent("el-text"),null,Se(n=o.enum.getName(l))?n:{default:()=>[n]})}}),se.VxeUI.renderer.add("InputNumber",{renderTableDefault(o,t){return e.createVNode(K.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)}}),se.VxeUI.renderer.add("TrueFalse",{renderTableDefault(o,t){const{locale:n}=ee.useI18n();let l=n.value=="zh_cn";return e.createVNode(K.ElText,{type:t.row[t.column.field]?"success":"danger"},{default:()=>[t.row[t.column.field]?l?"是":"YES":l?"否":"NO"]})}}),se.VxeUI.renderer.add("I18n",{renderTableDefault(o,t){const{locale:n}=ee.useI18n();let l=n.value=="zh_cn"?t.column.field:o.fieldEn;return t.row[l]||t.row[t.column.field]}}),se.VxeUI.renderer.add("Link",{renderTableDefault(o,t){var d;let n=t.column.field;const l=ve.useRouter(),{multiple:a,to:s}=o;if(!a)return e.createVNode(K.ElLink,{underline:"never",type:"primary",onclick:()=>l.push({path:s,query:{[n]:t.row[n]}})},{default:()=>[t.row[n]]});const r=((d=t.row[n])==null?void 0:d.split(","))||[];return r.map((f,_)=>e.createVNode("span",null,[e.createVNode(K.ElLink,{underline:"never",type:"primary",onclick:()=>l.push({path:s,query:{[n]:f}})},Se(f)?f:{default:()=>[f]}),_<r.length-1?",":""]))}})}m.CmpDictionary=Oe,m.CmpIcon=we,m.ConfrimButton=bt,m.DownExcelTemp=Et,m.ImportButton=kt,m.LayOutForm=Ze,m.ListPage=Tt,m.OnePortalCasSDK=Ft,m.SearchBar=Me,m.StatusMap=be,m._toRaw=it,m._typeOf=zt,m.arrToStatusMap=ut,m.arrayToTree=ct,m.checkFileSize=ht,m.creatValidator=Lt,m.createImportFields=gt,m.createListPageId=mt,m.en=ge,m.exportExcel=ze,m.getI18n=Ce,m.getI18nT=pe,m.getListPageConfig=Ae,m.getLocaleValue=Mt,m.getValueBykey=pt,m.importExcel=Xe,m.messages=De,m.registerVxeRenderers=Rt,m.resetListPageConfig=It,m.setListPageConfig=Vt,m.setupI18n=Be,m.sleep=st,m.stringToArray=ye,m.stripHtmlTags=dt,m.unicode2Str=ft,m.useActions=qt,m.useDatePicker=Bt,m.useGetters=At,m.useI18nReState=Ot,m.useRequest=Dt,m.useState=Nt,m.zhCn=me,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(m,K){typeof exports=="object"&&typeof module<"u"?K(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"],K):(m=typeof globalThis<"u"?globalThis:m||self,K(m.JoyAdminComponents={},m.ElementPlus,m.Vue,m.fileSaver,m.ExcelJS,m.dayjs,m.VueI18n,m._,m.VueRouter,m.Vuex,m.VxeUI))})(this,function(m,K,e,He,Ie,he,ee,le,Te,Q,se){"use strict";const Ze=e.defineComponent({name:"LayOutForm",setup(o,{slots:t,attrs:n,emit:l}){const a=e.ref(null),s=()=>t.default?t.default().filter(d=>d.type!==Symbol.for("v-cmt")).map(d=>d.type===Symbol.for("v-fgt")?d.children:d).flat().map(d=>{var f;return e.h(K.ElCol,{span:((f=d.props)==null?void 0:f.span)||24},{default:()=>d})}):null;e.onMounted(()=>{l("ref",a.value)});function r(){return e.h(K.ElForm,{...n,ref:a},()=>e.h(K.ElRow,{gutter:n.gutter??20},{default:()=>s()}))}return r}});var ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ee(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Le={exports:{}};(function(o,t){(function(n,l){o.exports=l()})(ve,function(){var n="minute",l=/[+-]\d\d(?::?\d\d)?/g,a=/([+-]|\d\d)/g;return function(s,r,d){var f=r.prototype;d.utc=function(h){var g={date:h,utc:!0,args:arguments};return new r(g)},f.utc=function(h){var g=d(this.toDate(),{locale:this.$L,utc:!0});return h?g.add(this.utcOffset(),n):g},f.local=function(){return d(this.toDate(),{locale:this.$L,utc:!1})};var _=f.parse;f.parse=function(h){h.utc&&(this.$u=!0),this.$utils().u(h.$offset)||(this.$offset=h.$offset),_.call(this,h)};var S=f.init;f.init=function(){if(this.$u){var h=this.$d;this.$y=h.getUTCFullYear(),this.$M=h.getUTCMonth(),this.$D=h.getUTCDate(),this.$W=h.getUTCDay(),this.$H=h.getUTCHours(),this.$m=h.getUTCMinutes(),this.$s=h.getUTCSeconds(),this.$ms=h.getUTCMilliseconds()}else S.call(this)};var x=f.utcOffset;f.utcOffset=function(h,g){var $=this.$utils().u;if($(h))return this.$u?0:$(this.$offset)?x.call(this):this.$offset;if(typeof h=="string"&&(h=function(v){v===void 0&&(v="");var Y=v.match(l);if(!Y)return null;var O=(""+Y[0]).match(a)||["-",0,0],c=O[0],y=60*+O[1]+ +O[2];return y===0?0:c==="+"?y:-y}(h),h===null))return this;var V=Math.abs(h)<=16?60*h:h;if(V===0)return this.utc(g);var I=this.clone();if(g)return I.$offset=V,I.$u=!1,I;var B=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(I=this.local().add(V+B,n)).$offset=V,I.$x.$localOffset=B,I};var b=f.format;f.format=function(h){var g=h||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return b.call(this,g)},f.valueOf=function(){var h=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*h},f.isUTC=function(){return!!this.$u},f.toISOString=function(){return this.toDate().toISOString()},f.toString=function(){return this.toDate().toUTCString()};var w=f.toDate;f.toDate=function(h){return h==="s"&&this.$offset?d(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():w.call(this)};var p=f.diff;f.diff=function(h,g,$){if(h&&this.$u===h.$u)return p.call(this,h,g,$);var V=this.local(),I=d(h).local();return p.call(V,I,g,$)}}})})(Le);var Ge=Le.exports;const We=Ee(Ge);var Fe={exports:{}};(function(o,t){(function(n,l){o.exports=l()})(ve,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},l={};return function(a,s,r){var d,f=function(b,w,p){p===void 0&&(p={});var h=new Date(b),g=function($,V){V===void 0&&(V={});var I=V.timeZoneName||"short",B=$+"|"+I,v=l[B];return v||(v=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:$,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:I}),l[B]=v),v}(w,p);return g.formatToParts(h)},_=function(b,w){for(var p=f(b,w),h=[],g=0;g<p.length;g+=1){var $=p[g],V=$.type,I=$.value,B=n[V];B>=0&&(h[B]=parseInt(I,10))}var v=h[3],Y=v===24?0:v,O=h[0]+"-"+h[1]+"-"+h[2]+" "+Y+":"+h[4]+":"+h[5]+":000",c=+b;return(r.utc(O).valueOf()-(c-=c%1e3))/6e4},S=s.prototype;S.tz=function(b,w){b===void 0&&(b=d);var p,h=this.utcOffset(),g=this.toDate(),$=g.toLocaleString("en-US",{timeZone:b}),V=Math.round((g-new Date($))/1e3/60),I=15*-Math.round(g.getTimezoneOffset()/15)-V;if(!Number(I))p=this.utcOffset(0,w);else if(p=r($,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(I,!0),w){var B=p.utcOffset();p=p.add(h-B,"minute")}return p.$x.$timezone=b,p},S.offsetName=function(b){var w=this.$x.$timezone||r.tz.guess(),p=f(this.valueOf(),w,{timeZoneName:b}).find(function(h){return h.type.toLowerCase()==="timezonename"});return p&&p.value};var x=S.startOf;S.startOf=function(b,w){if(!this.$x||!this.$x.$timezone)return x.call(this,b,w);var p=r(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return x.call(p,b,w).tz(this.$x.$timezone,!0)},r.tz=function(b,w,p){var h=p&&w,g=p||w||d,$=_(+r(),g);if(typeof b!="string")return r(b).tz(g);var V=function(Y,O,c){var y=Y-60*O*1e3,L=_(y,c);if(O===L)return[y,O];var z=_(y-=60*(L-O)*1e3,c);return L===z?[y,L]:[Y-60*Math.min(L,z)*1e3,Math.max(L,z)]}(r.utc(b,h).valueOf(),$,g),I=V[0],B=V[1],v=r(I).utcOffset(B);return v.$x.$timezone=g,v},r.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},r.tz.setDefault=function(b){d=b}}})})(Fe);var Je=Fe.exports;const Qe=Ee(Je),me={"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":"展开",excel:{fieldsMappingRequired:"请输入列字段映射",invalidInput:"非法输入",invalidOption:"请输入有效选项!",copyFailed:"复制失败",sheetNameTooLong:'Sheet名称 "{0}" 长度超过31个字符,已自动截断为 "{1}"'},validate:{invalidInput:"请输入正确内容"},tools:{keysLengthError:"keys 长度必须大于2 默认前两位为 label value"}},ge={"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",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"}},De={zh_cn:me,en:ge};let re=null;function Be(o=null){if(o){const{global:t}=o;return t.messages.value.zh_cn?t.mergeLocaleMessage("zh_cn",me):t.setLocaleMessage("zh_cn",me),t.messages.value.en?t.mergeLocaleMessage("en",ge):t.setLocaleMessage("en",ge),re=o,o}return re||(re=ee.createI18n({legacy:!1,locale:"zh_cn",fallbackLocale:"zh_cn",messages:De})),re}function Ce(){return re||Be()}function pe(){return Ce().global.t}he.extend(We),he.extend(Qe);async function Xe(o,t){const{fields:n,range:l=1}=t;if(!n){const r=pe();throw new Error(r("excel.fieldsMappingRequired"))}let a=new Ie.Workbook;await a.xlsx.load(o);const s={};return a.eachSheet(function(r,d){const f=[];r.eachRow(function(_,S){if(S>l){let x={},b=!0;Object.keys(n).forEach(w=>{const p=_.getCell(n[w]).value;x[w]=p,p&&(b=!1)}),b||f.push(x)}}),s[r._name]=f}),a=null,s}const et={columnWidth:30};async function ze(o,t,n=[],l={}){if(!o||!t)return;const{columnStyle:a}=l,{columnWidth:s}=et;t.forEach(f=>{f.width=f.width?f.width:s});const{workbook:r,worksheet:d}=tt();d.columns=t,d.addRows(n),a&&await nt(r,d,a);try{const f=await r.xlsx.writeBuffer(),_=new File([f],o,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});He.saveAs(_)}catch(f){console.log(f)}}function tt(){const o=new Ie.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 nt(o,t,n){const l=Object.keys(n);for(const a of l){const s=n[a],{type:r}=s;switch(r){case"IMG":await ot(o,t,a);break}}}async function ot(o,t,n,l){const a=t.getColumn(n),s=a.values;t.getColumn(n).width=20,t.eachRow((r,d)=>{d>1&&(r.height=40)});for(let r=0,d=s.length;r<d;r++){if(r<2)continue;let f=s[r];f&&(t.getCell(a.letter+r).value="",await lt(o,t,f,{width:100,height:50,col:a._number-1,row:r-1}))}}async function lt(o,t,n,l){const{col:a,row:s,width:r,height:d}=l,{success:f,base64:_}=await rt(n,.3);if(f){const S=o.addImage({base64:_,extension:"jpeg"});t.addImage(S,{tl:{col:a,row:s},ext:{width:r,height:d}})}}function rt(o,t=1){const n=new Image;return n.setAttribute("crossOrigin","anonymous"),n.crossOrigin="anonymous",n.src=o,new Promise((l,a)=>{n.onload=()=>{const s=document.createElement("canvas");s.width=n.width,s.height=n.height,s.getContext("2d").drawImage(n,0,0,s.width,s.height),l({success:!0,base64:s.toDataURL("image/jpeg",t)})},n.onerror=()=>{l({success:!1})}})}function at(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 st(o){return new Promise(t=>{setTimeout(()=>{t()},o)})}function it(o){return JSON.parse(JSON.stringify(o))}function ct(o){let t=[],n={},l=(a,s)=>Object.prototype.hasOwnProperty.call(a,s);for(const a of o){n[a.id]={...a,children:l(n,a.id)?n[a.id].children:[]};const s=n[a.id];a.pid==-1?t.push(s):(l(n,a.pid)||(n[a.pid]={children:[]}),n[a.pid].children.push(s))}return t}function ye(o,t=" "){return o?o.split(t).filter(n=>n.trim()):[]}class be{constructor(t,n=["label","value","labelEn"]){this.list=t,this.map=new Map(t.map(l=>{let a={...l,label:l[n[0]],value:l[n[1]]};return n[2]&&(a.labelEn=l[n[2]]),[l[n[1]],a]}))}getName(t,n){if(!this.has(t))return"-";const{label:l,labelEn:a}=this.map.get(t);return(n=="zh_cn"?l:a)||l||"-"}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 ut(o,t=[],n="i18nName"){if(o.length==0)return new be([]);if(t.length<2){const a=pe();throw new Error(a("tools.keysLengthError"))}let l=o.map(a=>{let s={};return n&&(s.labelEn=a[n]),t.forEach((r,d)=>{d===0?s.label=a[r]:d===1?s.value=a[r]:s[r]=a[r]}),s});return new be(l)}function dt(o){return o?o.replace(/<[^>]+>/g,""):""}function ft(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 ht(o,t=10){let n=1048576*t;return!(o.size>n)}function mt(o){return Array.from(10).fill(0).map((n,l)=>o+"_"+l)}function gt(o){let t={};return o.map((n,l)=>{let{key:a,option:s,type:r}=n,d=at(l);s?t[a]=`${d}---option`:r==="image"?t[a]=`${d}---image`:t[a]=d}),t}function pt(o,t){return t.split(".").reduce((n,l)=>n&&n[l],o)}const Ht="",ie=(o,t)=>{const n=o.__vccOpts||o;for(const[l,a]of t)n[l]=a;return n},Oe=ie({__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"],["update:modelValue"]),setup(o,{emit:t}){const n=o,l=e.useAttrs(),{t:a,locale:s}=ee.useI18n(),r=e.useModel(o,"modelValue"),d=e.computed(()=>l["value-key"]!=null),f=e.ref(""),_=e.computed(()=>{if(l.remote!==void 0)return n.data;const c=ye(f.value),{data:y,labelValue:L}=n,z=y||b.value;if(c.length==0)return z;const{label:W,labelEn:te}=L;let C=s.value=="en_us"?te||"i18nName":W;return c.length==1?z.filter(X=>X[C].toLowerCase().includes(c[0].toLowerCase())):z.filter(X=>{let ae=!1;return ae=c.some(de=>X[C].toLowerCase()==de.toLowerCase()),ae})}),S=e.computed({get(){return l.multiple==null||r.value==null?!1:r.value.length==_.value.length},set(c){return c}}),x=t,b=e.ref([]),w=async()=>{const{data:c}=await n.api();b.value=[...c],x("success",b)};n.api&&w();function p(c){x("change",c)}const h=n.labelValue.label.split("-"),g=c=>{if(h.length==1){if(n.changeLocal)return a(c[n.labelValue.label]);let y=s.value=="en_us"?c[n.labelValue.labelEn||"i18nName"]:c[n.labelValue.label];return y=y||c[n.labelValue.label],y}else{let y=[];return h.forEach(L=>{y.push(c[L])}),y.join("-")}};function $(c){let y=n.data?n.data:b.value;r.value=c?y.map(L=>d.value?L:L[n.labelValue.value]):[],x("change",r.value)}function V(c){n.optionClick&&n.optionClick(c),x("change",d.value?c:c[n.labelValue.value])}function I(c){return r.value.length>=n.maxLimit&&!r.value.includes(c[n.labelValue.value])}function B(c){return c.map(y=>({label:g(y),value:d.value?y:y[n.labelValue.value]}))}const v=e.ref([]),Y=n.data?n.data:b.value;v.value=B(Y),e.watch(()=>n.data?n.data:b.value,c=>{var L;const y=B(c);if(y.length!==v.value.length)v.value=y;else{let z=!1;for(let W=0;W<y.length;W++)if(y[W].value!==((L=v.value[W])==null?void 0:L.value)){z=!0;break}z&&(v.value=y)}},{deep:!0});const O=e.computed(()=>v.value);return(c,y)=>{const L=e.resolveComponent("el-checkbox"),z=e.resolveComponent("el-select-v2"),W=e.resolveComponent("el-option"),te=e.resolveComponent("el-select");return e.unref(l).v2!=null?(e.openBlock(),e.createBlock(z,e.mergeProps({key:0,options:O.value,modelValue:r.value,"onUpdate:modelValue":y[1]||(y[1]=C=>r.value=C)},e.unref(l),{filterable:"","collapse-tags":"","collapse-tags-tooltip":"",clearable:"",onChange:p,onClear:p}),e.createSlots({_:2},[e.unref(l).multiple!=null?{name:"header",fn:e.withCtx(()=>[e.renderSlot(c.$slots,"header",{},()=>[e.createVNode(L,{class:"mgl20",modelValue:S.value,"onUpdate:modelValue":y[0]||(y[0]=C=>S.value=C),onChange:$},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0)]),key:"0"}:void 0]),1040,["options","modelValue"])):(e.openBlock(),e.createBlock(te,e.mergeProps({key:1,modelValue:r.value,"onUpdate:modelValue":y[3]||(y[3]=C=>r.value=C),filterable:"","collapse-tags":"","collapse-tags-tooltip":"","filter-method":e.unref(l).remote!=null?void 0:C=>f.value=C,clearable:""},e.unref(l),{onClear:o.optionClick}),{default:e.withCtx(()=>[e.unref(l).multiple!=null&&o.showCheckAll&&o.maxLimit==null?e.renderSlot(c.$slots,"header",{key:0},()=>[e.createVNode(L,{class:"mgl20",modelValue:S.value,"onUpdate:modelValue":y[2]||(y[2]=C=>S.value=C),onChange:$},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(C,ue)=>(e.openBlock(),e.createBlock(W,{key:ue,label:g(C),disabled:e.unref(l).multiple!=null&&o.maxLimit>0?I(C):!1,onClick:e.withModifiers(X=>V(C),["stop"]),value:d.value?C:C[o.labelValue.value]},null,8,["label","disabled","onClick","value"]))),128))]),_:3},16,["modelValue","filter-method","onClear"]))}}},[["__scopeId","data-v-a1cc31cd"]]),Gt="",Ct=e.defineComponent({props:{name:{tyepe:String,required:!0}}});function yt(o,t,n,l,a,s){const r=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(r,{class:"cmp-icon"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.name)))]),_:1})}const we=ie(Ct,[["render",yt],["__scopeId","data-v-733f9daa"]]),bt={__name:"index",emits:["ok","no"],setup(o,{emit:t}){const n=t,l=le.debounce(()=>{n("ok")},500);function a(){n("no")}return(s,r)=>{const d=e.resolveComponent("el-link"),f=e.resolveComponent("el-popconfirm");return e.openBlock(),e.createBlock(f,e.mergeProps(s.$attrs,{onConfirm:e.unref(l),onCancel:a}),{reference:e.withCtx(()=>[e.createVNode(d,{underline:"never",type:s.$attrs.type},{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},8,["type"])]),_:3},16,["onConfirm"])}}},Wt="",wt=["accept"],kt=ie({__name:"index",props:{accept:{type:String,default:".xlsx,.xls"},loading:{type:Boolean,default:!1}},emits:["fileChange"],setup(o,{emit:t}){const n=t,l=e.ref(null);function a(s){let r=s.target.files[0];n("fileChange",r),l.value.value=null}return(s,r)=>{const d=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("span",null,[e.createVNode(d,{loading:o.loading,class:"mgr10",onClick:r[0]||(r[0]=f=>l.value.click())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.$t("dao-ru")),1)]),_:1},8,["loading"]),e.createElementVNode("input",{onChange:a,ref_key:"input",ref:l,accept:o.accept,style:{position:"absolute",width:"0px",height:"0px",opacity:"0"},type:"file"},null,40,wt)])}}},[["__scopeId","data-v-5f1449ad"]]);function ke(o){let t={};return o.forEach(n=>{const{key:l,type:a,option:s={},value:r,dateType:d}=n;if(l)if(a=="input"&&(s!=null&&s.multiple))t[l]=ye(r);else if(a=="date")if(d.includes("range")){const[f,_]=l;let[S,x]=r||[];S&&d=="daterange"&&(S=he(S).format("YYYY-MM-DD 00:00:00"),x=he(x).format("YYYY-MM-DD 23:59:59")),t[f]=S,t[_]=x}else t[l]=r;else t[l]=r}),t}const Qt="",xt={key:0},St={class:"btns"},_t={class:"left"},$t={class:"right"},Me=ie({__name:"index",props:{form:{type:Object,required:!0}},emits:["confirm","reset","visibleChange"],setup(o,{expose:t,emit:n}){const l=o,a=n,s=e.ref(!0),r=e.ref(null),{t:d}=ee.useI18n(),f=e.computed(()=>s.value?d("guan-bi"):d("zhan-kai"));function _(){a("confirm")}function S(g){g.option.onClear&&g.option.onClear(),a("confirm")}function x(){a("reset")}function b(){a("confirm")}function w(){return ke(l.form.items)}const p=le.cloneDeep(l.form.items);function h(){l.form.items.forEach(g=>{const $=p.find(V=>V.key==g.key);$&&(g.value=$.value)})}return t({getPrm:w,reset:h}),(g,$)=>{const V=e.resolveComponent("el-input"),I=e.resolveComponent("el-date-picker"),B=e.resolveComponent("el-form-item"),v=e.resolveComponent("el-form"),Y=e.resolveComponent("el-link"),O=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",{class:"searchBar-container mgt10 mgb10",onKeydown:e.withKeys(_,["enter"])},[e.createElementVNode("div",{class:"searchBar",style:e.normalizeStyle({height:s.value?"auto":"42px"})},[e.createVNode(v,{inline:"",model:o.form.data},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.form.items.filter(c=>!c.hidden),c=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c.key},[c.type=="br"?(e.openBlock(),e.createElementBlock("br",xt)):(e.openBlock(),e.createBlock(B,{key:1,label:c.name},{default:e.withCtx(()=>{var y,L;return[c.type==="input"?(e.openBlock(),e.createBlock(V,{key:0,modelValue:c.value,"onUpdate:modelValue":z=>c.value=z,class:e.normalizeClass(((y=c.option)==null?void 0:y.class)||"w150"),placeholder:g.$t("qing-shu-ru"),clearable:""},null,8,["modelValue","onUpdate:modelValue","class","placeholder"])):c.type==="custom"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.render),{key:1})):e.createCommentVNode("",!0),c.type==="select"?(e.openBlock(),e.createBlock(Oe,e.mergeProps({key:2,class:((L=c.option)==null?void 0:L.class)||"w150",modelValue:c.value,"onUpdate:modelValue":z=>c.value=z},{ref_for:!0},c.option,{onChange:_,onClear:z=>S(c)}),null,16,["class","modelValue","onUpdate:modelValue","onClear"])):e.createCommentVNode("",!0),c.type==="date"?(e.openBlock(),e.createBlock(I,{key:3,class:e.normalizeClass({datetimerange:"w300",daterange:"w200"}[c.dateType]||"w100"),modelValue:c.value,"onUpdate:modelValue":z=>c.value=z,"value-format":{datetimerange:"YYYY-MM-DD HH:mm:ss",daterange:"YYYY-MM-DD"}[c.dateType]||"YYYY-MM-DD",type:c.dateType||"date",onFocus:z=>r.value=c,onChange:z=>b(),placeholder:g.$t("qing-xuan-ze"),"start-placeholder":g.$t("kai-shi-shi-jian"),"end-placeholder":g.$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",St,[e.createElementVNode("div",_t,[e.renderSlot(g.$slots,"table-header-left",{},void 0,!0)]),e.createElementVNode("div",$t,[e.createVNode(Y,{underline:"never",class:"mgr10",onClick:$[0]||($[0]=()=>{a("visibleChange",!s.value),s.value=!s.value})},{default:e.withCtx(()=>[e.createVNode(we,{name:s.value?"ArrowUp":"ArrowDown"},null,8,["name"]),e.createTextVNode(" "+e.toDisplayString(f.value),1)]),_:1}),e.createVNode(O,{type:"primary",onClick:_},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.$t("shai-xuan")),1)]),_:1}),e.createVNode(O,{type:"primary",onClick:x},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.$t("chong-zhi")),1)]),_:1}),e.renderSlot(g.$slots,"btn",{},void 0,!0)])])],32)}}},[["__scopeId","data-v-32ac9990"]]),Ne={pageNoKey:"pageNo",pageSizeKey:"pageSize",totalKey:"total",defaultPageSize:10,pageSizes:[10,50,100,500],responseDataKeys:{rows:["rows","records"],total:["totalRows","total"]},showSearch:!1,showPage:!1,showShadow:!1,showCheckBox:!1,enableCellCopy:!0};let ce={...Ne};function Vt(o){ce={...ce,...o,responseDataKeys:{...ce.responseDataKeys,...o.responseDataKeys||{}}}}function Ae(){return ce}function It(){ce={...Ne}}const en="",Tt={class:"center"},vt=ie({__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:l}=ee.useI18n(),a=Te.useRoute(),s=Ae(),r=o,d=e.ref(!1),f=e.ref([]);r.searchForm.showSearch===void 0&&(r.searchForm.showSearch=s.showSearch),r.searchForm.showPage===void 0&&(r.searchForm.showPage=s.showPage),r.searchForm.showShadow===void 0&&(r.searchForm.showShadow=s.showShadow),r.searchForm.showCheckBox===void 0&&(r.searchForm.showCheckBox=s.showCheckBox),r.searchForm.enableCellCopy===void 0&&(r.searchForm.enableCellCopy=s.enableCellCopy),r.searchForm.selections||(r.searchForm.selections=[]);const _=e.computed(()=>{const u=a.path.replace(/\//g,"-").replace(/^-/,"")||"default-table";return r.id?`listPageId-${u}-${r.id}`:`listPageId-${u}`}),S=le.cloneDeep(r.searchForm.items),x=r.searchForm.pageNoKey||s.pageNoKey,b=r.searchForm.pageSizeKey||s.pageSizeKey,w=e.reactive({[x]:1,[b]:r.searchForm.defaultPageSize||s.defaultPageSize,total:0}),p=e.ref(null),h=e.ref(null),g=e.ref(450),$=le.debounce(()=>{e.nextTick(()=>{if(!h.value)return;const i=h.value.getBoundingClientRect(),k=window.innerHeight,E=i.top,N=100,R=k-E-N,F=200;g.value=Math.max(R,F)})},100),V=()=>{$()},I=()=>{if(!r.searchForm.enableCellCopy)return!1;const u=p.value;if(!u||!u.$el)return!1;const i=u.$el;return i.classList.add("cell-copy-enabled"),i.setAttribute("tabindex","-1"),i.removeEventListener("mousedown",X),i.removeEventListener("mousemove",ae),i.removeEventListener("mouseup",de),i.removeEventListener("keydown",$e),i.addEventListener("mousedown",X),i.addEventListener("mousemove",ae),i.addEventListener("mouseup",de),i.addEventListener("keydown",$e),!0};e.onMounted(()=>{$(),window.addEventListener("resize",V),r.searchForm.enableCellCopy&&(document.addEventListener("mouseup",Ue),document.addEventListener("mousedown",je),setTimeout(()=>{I()},500))}),e.onUpdated(()=>{r.searchForm.enableCellCopy&&setTimeout(()=>{I()},500)}),e.onUnmounted(()=>{if(window.removeEventListener("resize",V),r.searchForm.enableCellCopy){document.removeEventListener("mouseup",Ue),document.removeEventListener("mousedown",je);const u=p.value;if(u&&u.$el){const i=u.$el;i.removeEventListener("mousedown",X),i.removeEventListener("mousemove",ae),i.removeEventListener("mouseup",de),i.removeEventListener("keydown",$e)}}});const B=e.computed(()=>te.value.height||g.value);let v;async function Y(u){const{dataFormat:i}=r.tableConfig;u[x]!=1&&(u.nextSearchAfter=v),d.value=!0;const{code:k,data:E={}}=await r.api(u).finally(()=>{d.value=!1,r.searchForm.selections=[]});if(k==200){let N=[];for(const F of s.responseDataKeys.rows)if(E[F]){N=E[F];break}let R=0;for(const F of s.responseDataKeys.total)if(E[F]!==void 0){R=E[F];break}f.value=i?i(N):N,w.total=R,v=E.nextSearchAfter,r.searchForm.enableCellCopy&&e.nextTick(()=>{setTimeout(()=>{I()},100)})}}function O(u={}){const{searchData:i=()=>({})}=r.tableConfig,k=i();Y({...w,...ke(r.searchForm.items),...u,...k})}function c(){const{reset:u}=r.tableConfig;u&&u(),r.searchForm.items.forEach(i=>{const k=S.find(E=>le.isArray(i.key)&&le.isArray(E.key)?i.key.join(",")==E.key.join(","):E.key==i.key);k&&(i.value=k.value)}),O()}r.api&&r.immediate&&O();function y(){return{...w,...ke(r.searchForm.items)}}const L=()=>{const u=p.value;u&&u.clearSort()},z=e.reactive({storage:!0}),W=e.reactive({drag:!0,resizable:!0,maxFixedSize:0}),te=e.computed(()=>{const{customConfig:u,columnConfig:i,...k}=r.tableConfig;return{headerAlign:"left",align:"center",customConfig:{...z,...u},columnConfig:{...W,...i},"virtual-x-config":{enabled:!1,scrollToLeftOnChange:!1},"virtual-y-config":{enabled:!0,gt:100},...k}}),C=e.reactive({isSelecting:!1,startCell:null,endCell:null,selectedCells:[]}),ue=u=>{const i=u.closest(".vxe-body--column");if(!i||i.classList.contains("col--checkbox")||i.classList.contains("col--seq"))return null;const k=i.closest(".vxe-body--row");if(!k)return null;const E=p.value;if(!E)return null;let N=-1;const R=k.getAttribute("data-rowid");if(R!=null)N=parseInt(R,10);else{const D=k.parentElement;N=Array.from(D.querySelectorAll(".vxe-body--row")).indexOf(k)}if(N<0)return null;let F=-1;const J=i.getAttribute("data-colid");if(J&&(F=E.getColumns().findIndex(T=>T.id===J)),F<0){const T=Array.from(k.querySelectorAll(".vxe-body--column")).indexOf(i),q=!!i.closest(".vxe-table--fixed-left-wrapper"),U=!!i.closest(".vxe-table--fixed-right-wrapper"),A=E.getColumns();if(q){const j=A.filter(P=>P.fixed==="left");T<j.length&&(F=A.indexOf(j[T]))}else if(U){const j=A.filter(P=>P.fixed==="right");T<j.length&&(F=A.indexOf(j[T]))}else{const j=r.searchForm.showCheckBox?1:0;F=A.filter(H=>H.fixed==="left").length+T-j}}return F<0?null:{rowIndex:N,colIndex:F,cell:i}},X=u=>{const i=ue(u.target);if(!i){_e();return}C.isSelecting=!0,C.startCell={rowIndex:i.rowIndex,colIndex:i.colIndex},C.endCell={...C.startCell},Pe(),Re()},ae=u=>{if(!C.isSelecting)return;const i=ue(u.target);i&&(C.endCell={rowIndex:i.rowIndex,colIndex:i.colIndex},Pe(),Re())},de=()=>{C.isSelecting=!1},_e=()=>{C.selectedCells=[],C.startCell=null,C.endCell=null;const u=p.value;if(!u)return;u.$el.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(k=>{k.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")})},Pe=()=>{if(!C.startCell||!C.endCell){C.selectedCells=[];return}const u=C.startCell.rowIndex,i=C.endCell.rowIndex,k=C.startCell.colIndex,E=C.endCell.colIndex,N=Math.min(u,i),R=Math.max(u,i),F=Math.min(k,E),J=Math.max(k,E);C.selectedCells=[];for(let D=N;D<=R;D++)for(let T=F;T<=J;T++)C.selectedCells.push({rowIndex:D,colIndex:T})},Re=()=>{e.nextTick(()=>{const u=p.value;if(!u)return;const i=u.$el;if(i.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(q=>{q.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")}),C.selectedCells.length===0)return;const k=u.getColumns(),E=C.selectedCells.map(q=>q.rowIndex),N=C.selectedCells.map(q=>q.colIndex),R=Math.min(...E),F=Math.max(...E),J=Math.min(...N),D=Math.max(...N),T=[i.querySelector(".vxe-table--body-wrapper tbody"),i.querySelector(".vxe-table--fixed-left-wrapper tbody"),i.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean);C.selectedCells.forEach(({rowIndex:q,colIndex:U})=>{const A=k[U];if(!A)return;const j=A.fixed==="left",P=A.fixed==="right";for(const H of T){const fe=H.querySelectorAll(".vxe-body--row")[q];if(!fe)continue;const ne=Array.from(fe.querySelectorAll(".vxe-body--column"));let M=null;if(j&&H.closest(".vxe-table--fixed-left-wrapper")){const Z=k.filter(G=>G.fixed==="left").indexOf(A);M=ne[Z]}else if(P&&H.closest(".vxe-table--fixed-right-wrapper")){const Z=k.filter(G=>G.fixed==="right").indexOf(A);M=ne[Z]}else if(!j&&!P&&H.closest(".vxe-table--body-wrapper")){const oe=r.searchForm.showCheckBox?1:0,Z=k.filter(Ve=>Ve.fixed==="left").length,G=U-Z;M=ne[G+oe]}if(M&&!M.classList.contains("col--checkbox")&&!M.classList.contains("col--seq")){M.classList.add("cell-selected"),q===R&&M.classList.add("cell-border-top"),q===F&&M.classList.add("cell-border-bottom"),U===J&&M.classList.add("cell-border-left"),U===D&&M.classList.add("cell-border-right");break}}})})},Ut=async()=>{if(C.selectedCells.length===0)return;const u=p.value;if(!u)return;const i=u.$el,k=u.getColumns(),E=[...new Set(C.selectedCells.map(D=>D.rowIndex))].sort((D,T)=>D-T),N=[...new Set(C.selectedCells.map(D=>D.colIndex))].sort((D,T)=>D-T),R=[i.querySelector(".vxe-table--body-wrapper tbody"),i.querySelector(".vxe-table--fixed-left-wrapper tbody"),i.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean),F=[];E.forEach(D=>{const T=[];N.forEach(q=>{const U=k[q];if(!U){T.push("");return}const A=U.fixed==="left",j=U.fixed==="right";let P="";for(const H of R){const fe=H.querySelectorAll(".vxe-body--row")[D];if(!fe)continue;const ne=Array.from(fe.querySelectorAll(".vxe-body--column"));let M=null;if(A&&H.closest(".vxe-table--fixed-left-wrapper")){const Z=k.filter(G=>G.fixed==="left").indexOf(U);M=ne[Z]}else if(j&&H.closest(".vxe-table--fixed-right-wrapper")){const Z=k.filter(G=>G.fixed==="right").indexOf(U);M=ne[Z]}else if(!A&&!j&&H.closest(".vxe-table--body-wrapper")){const oe=r.searchForm.showCheckBox?1:0,Z=k.filter(Ve=>Ve.fixed==="left").length,G=q-Z;M=ne[G+oe]}if(M&&!M.classList.contains("col--checkbox")&&!M.classList.contains("col--seq")){P=M.innerText||M.textContent||"",P=P.trim(),P=P.replace(/\n/g," ").replace(/\s+/g," ");break}}T.push(P)}),F.push(T.join(" "))});const J=F.join(`
|
|
2
|
+
`);try{await navigator.clipboard.writeText(J)}catch(D){console.error("复制失败:",D)}},$e=u=>{r.searchForm.enableCellCopy&&((u.ctrlKey||u.metaKey)&&u.key==="c"?C.selectedCells.length>0&&(u.preventDefault(),u.stopPropagation(),Ut()):u.key==="Escape"&&_e())},Ue=()=>{C.isSelecting=!1},je=u=>{const i=p.value;if(!i||!i.$el)return;i.$el.contains(u.target)||_e()},jt=u=>{w[x]=u,O()},Yt=u=>{w[b]=u,w[x]=1,O()};function Ye(){const u=p.value.getCheckboxRecords();r.searchForm.selections=u}const Ke=u=>{const i=p.value;if(i){i.toggleCheckboxRow(u);const k=p.value.getCheckboxRecords();r.searchForm.selections=k}};return t({tableRef:p,getList:O,getPrm:y,clearSort:L,calculateTableHeight:$}),(u,i)=>{var D;const k=e.resolveComponent("el-button"),E=e.resolveComponent("el-checkbox"),N=e.resolveComponent("el-text"),R=e.resolveComponent("vxe-column"),F=e.resolveComponent("VxeTable"),J=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({box:o.searchForm.showShadow})},[o.searchForm.showSearch?(e.openBlock(),e.createBlock(Me,{key:0,form:o.searchForm,onReset:c,onConfirm:i[1]||(i[1]=T=>O()),onVisibleChange:e.unref($)},{btn:e.withCtx(()=>[e.renderSlot(u.$slots,"search-bar-btn",{},void 0,!0),e.createVNode(k,{round:"",onClick:i[0]||(i[0]=T=>p.value.openCustom())},{default:e.withCtx(()=>[e.createVNode(we,{name:"Tools"})]),_:1})]),_:3},8,["form","onVisibleChange"])):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"table-header-left",{},void 0,!0),e.createElementVNode("div",{ref_key:"tableContentRef",ref:h},[e.createVNode(F,e.mergeProps({id:_.value,ref_key:"tableRef",ref:p,loading:o.loading||d.value,data:o.api?f.value:o.data,border:""},te.value,{height:B.value,onCheckboxChange:Ye,onCheckboxAll:Ye,onSortChange:(D=te.value["sort-config"])==null?void 0:D.sortChange}),{default:e.withCtx(()=>[o.searchForm.showCheckBox==null||o.searchForm.showCheckBox?(e.openBlock(),e.createBlock(R,{key:0,type:"checkbox",width:e.unref(l)=="zh_cn"?80:150,title:u.$t("xu-hao"),fixed:"left"},{checkbox:e.withCtx(({rowIndex:T,row:q,checked:U,disabled:A,indeterminate:j})=>[e.createElementVNode("div",Tt,[U?(e.openBlock(),e.createBlock(E,{key:0,checked:!0,disabled:A,size:"default",onClick:e.withModifiers(P=>!A&&Ke(q),["stop"])},null,8,["disabled","onClick"])):(e.openBlock(),e.createBlock(E,{key:1,disabled:A,checked:!1,size:"default",onClick:e.withModifiers(P=>!A&&Ke(q),["stop"])},null,8,["disabled","onClick"])),e.createVNode(N,{type:"info",class:"mgl5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(T+1),1)]),_:2},1024)])]),_:1},8,["width","title"])):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"default",{},void 0,!0)]),_:3},16,["id","loading","data","height","onSortChange"])],512),o.searchForm.showPage?(e.openBlock(),e.createBlock(J,{key:1,"current-page":w[e.unref(x)],"onUpdate:currentPage":i[2]||(i[2]=T=>w[e.unref(x)]=T),class:"myPagination mgt10",background:"",layout:"total, sizes, prev, pager, next",total:w.total,"page-size":w[e.unref(b)],"page-sizes":o.searchForm.pageSizes||e.unref(s).pageSizes,onCurrentChange:jt,onSizeChange:Yt},null,8,["current-page","total","page-size","page-sizes"])):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-de0d59d6"]]),Et={__name:"index",props:{sheetsConfig:{type:Object,required:!0},fileName:{type:String,required:!0}},setup(o){const t=o;function n(){ze(t.fileName,t.sheetsConfig)}return(l,a)=>{const s=e.resolveComponent("el-link");return e.openBlock(),e.createBlock(s,e.mergeProps({type:"primary",underline:"never"},l.$attrs,{onClick:n}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.$t("xia-zai-dao-ru-mo-ban")),1)]),_:1},16)}}};function Lt(o,t={}){const n=pe(),l={inForm:!0,required:!0,...t},a={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:s,value:r,required:d,msg:f=n("validate.invalidInput")}=l;return s?function(_,S,x){if(d){a.test(S)?x():x(new Error(f));return}S&&!a.test(S)?x(new Error(f)):x()}:a.test(r)}class Ft{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 l=await n.json();if(l.success&&l.data)return this.token=l.data.token,this.user=l.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(l.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 l={headers:{"Content-Type":"application/json",...n.headers},...n};l.headers.appId=this.config.clientCode,this.token&&(l.headers.Authorization=`Bearer ${this.token}`);try{const a=await fetch(t,l);return a.status===401?(this.log("Token已过期,需要重新登录"),this.logout(),null):a}catch(a){throw this.log("请求失败:",a),a}}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 Dt(o,t={}){const l=Object.assign({manual:!1,log:!1,params:null,format:null},t),{manual:a,log:s,params:r={},cb:d,format:f}=l,_=e.ref([]),S=e.ref(!1),x=b=>{const w=b||r;S.value=!0,o(w).then(p=>{const{code:h,data:g,msg:$}=p;if(d){const{records:V,rows:I}=g||{},B=V||I?V||I:g;_.value=xe(B,f),d(p)}if(g){if(g.records!=null||g.rows!=null){const{records:V,rows:I,total:B=0}=g||{};w&&w.total!=null&&(r.total=parseInt(B)),_.value=xe(V||I||[],f)}else _.value=xe(g,f);s&&console.log("useRequest-res",_.value)}}).catch(p=>{d&&(console.log("useRequestErr",p),d({code:500}))}).finally(()=>{S.value=!1})};return a||x(),[S,_,x]}function Bt(o){const t=e.ref(o),n=e.ref(""),l=e.ref("");return e.watch(t,a=>{const s=a||["",""];n.value=s[0],l.value=s[1]}),[t,n,l]}function zt(o){return Object.prototype.toString.call(o).slice(8,-1).toLowerCase()}function xe(o,t){if(!t)return o;if(o instanceof Array)return o.map(l=>{let a={};return t.forEach(s=>a[s]=l[s]),a});let n={};return t.forEach(l=>n[l]=o[l]),n}function Ot(o,t=[]){const{locale:n}=ee.useI18n(),l=e.ref(o());return e.watch([n,...t],()=>{l.value=o()},{immediate:!0}),l}function Mt(o,t="zh_cn",n="en_us"){if(!o)return"-";const l={en_us:n,zh_cn:t},s=Ce().global.locale.value;return o[l[s]]||o[t]||"-"}function Nt(o,t){let n=Q.mapState;return typeof o=="string"&&o.length>0&&(n=Q.createNamespacedHelpers(o).mapState),qe(t,n)}function At(o,t){let n=Q.mapGetters;return typeof o=="string"&&o.length>0&&(n=Q.createNamespacedHelpers(o).mapGetters),qe(t,n)}function qt(o,t){let n=Q.mapActions;return typeof o=="string"&&o.length>0&&(n=Q.createNamespacedHelpers(o).mapActions),Pt(t,n)}function qe(o,t){const n=Q.useStore(),l=t(o),a={};return Object.keys(l).forEach(s=>{const r=l[s].bind({$store:n});a[s]=e.computed(r)}),a}function Pt(o,t){const n=Q.useStore(),l=t(o),a={};return Object.keys(l).forEach(s=>{a[s]=l[s].bind({$store:n})}),a}function Se(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!e.isVNode(o)}function Rt(){se.VxeUI.renderer.add("Enum",{renderTableDefault(o,t){let n;if([null,void 0].includes(t.row[t.column.field]))return"-";const l=t.row[t.column.field];if(o.type=="tag"){let a;return e.createVNode(e.resolveComponent("el-text"),{type:o.enum.getTag(l)},Se(a=o.enum.getName(l))?a:{default:()=>[a]})}return e.createVNode(e.resolveComponent("el-text"),null,Se(n=o.enum.getName(l))?n:{default:()=>[n]})}}),se.VxeUI.renderer.add("InputNumber",{renderTableDefault(o,t){return e.createVNode(K.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)}}),se.VxeUI.renderer.add("TrueFalse",{renderTableDefault(o,t){const{locale:n}=ee.useI18n();let l=n.value=="zh_cn";return e.createVNode(K.ElText,{type:t.row[t.column.field]?"success":"danger"},{default:()=>[t.row[t.column.field]?l?"是":"YES":l?"否":"NO"]})}}),se.VxeUI.renderer.add("I18n",{renderTableDefault(o,t){const{locale:n}=ee.useI18n();let l=n.value=="zh_cn"?t.column.field:o.fieldEn;return t.row[l]||t.row[t.column.field]}}),se.VxeUI.renderer.add("Link",{renderTableDefault(o,t){var d;let n=t.column.field;const l=Te.useRouter(),{multiple:a,to:s}=o;if(!a)return e.createVNode(K.ElLink,{underline:"never",type:"primary",onclick:()=>l.push({path:s,query:{[n]:t.row[n]}})},{default:()=>[t.row[n]]});const r=((d=t.row[n])==null?void 0:d.split(","))||[];return r.map((f,_)=>e.createVNode("span",null,[e.createVNode(K.ElLink,{underline:"never",type:"primary",onclick:()=>l.push({path:s,query:{[n]:f}})},Se(f)?f:{default:()=>[f]}),_<r.length-1?",":""]))}})}m.CmpDictionary=Oe,m.CmpIcon=we,m.ConfrimButton=bt,m.DownExcelTemp=Et,m.ImportButton=kt,m.LayOutForm=Ze,m.ListPage=vt,m.OnePortalCasSDK=Ft,m.SearchBar=Me,m.StatusMap=be,m._toRaw=it,m._typeOf=zt,m.arrToStatusMap=ut,m.arrayToTree=ct,m.checkFileSize=ht,m.creatValidator=Lt,m.createImportFields=gt,m.createListPageId=mt,m.en=ge,m.exportExcel=ze,m.getI18n=Ce,m.getI18nT=pe,m.getListPageConfig=Ae,m.getLocaleValue=Mt,m.getValueBykey=pt,m.importExcel=Xe,m.messages=De,m.registerVxeRenderers=Rt,m.resetListPageConfig=It,m.setListPageConfig=Vt,m.setupI18n=Be,m.sleep=st,m.stringToArray=ye,m.stripHtmlTags=dt,m.unicode2Str=ft,m.useActions=qt,m.useDatePicker=Bt,m.useGetters=At,m.useI18nReState=Ot,m.useRequest=Dt,m.useState=Nt,m.zhCn=me,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.cmp-icon[data-v-
|
|
1
|
+
.cmp-icon[data-v-a1cc31cd],.cmp-icon[data-v-733f9daa],.cmp-icon[data-v-5f1449ad]{padding:0!important}.searchBar-container .searchBar[data-v-32ac9990]{overflow:hidden;transition:all .3s}.searchBar-container .btns[data-v-32ac9990]{display:flex;justify-content:space-between;align-items:center}.searchBar-container .btns .left[data-v-32ac9990]{display:flex;align-items:center}.searchBar-container .btns .left[data-v-32ac9990] .el-tabs__header{margin:0}.searchBar-container .btns .right[data-v-32ac9990]{text-align:right}[data-v-de0d59d6] .vxe-table-custom-wrapper.placement--top-right.is--active{max-height:400px!important}[data-v-de0d59d6] .vxe-table.cell-copy-enabled .vxe-body--column{-webkit-user-select:none;user-select:none}[data-v-de0d59d6] .vxe-table.cell-copy-enabled .vxe-body--column.cell-selected{background-color:#409eff26!important;position:relative}[data-v-de0d59d6] .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-de0d59d6] .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-de0d59d6] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-left{border-left:1px solid #409eff!important}[data-v-de0d59d6] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-right{border-right:1px solid #409eff!important}
|