joy-admin-components 0.2.21 → 0.2.22
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,20 +1,20 @@
|
|
|
1
1
|
import { ElForm as _t, ElRow as $t, ElCol as St, ElMessageBox as Et, ElInputNumber as It, ElText as Lt, ElLink as Je } from "element-plus";
|
|
2
|
-
import { defineComponent as ot, ref as R, onMounted as lt, h as
|
|
2
|
+
import { defineComponent as ot, ref as R, onMounted as lt, h as Te, mergeModels as Xe, useAttrs as Ft, useModel as Tt, computed as re, watch as Pe, resolveComponent as O, unref as K, openBlock as L, createBlock as H, mergeProps as he, createSlots as at, withCtx as D, createElementVNode as ae, toDisplayString as J, renderSlot as X, createVNode as z, createTextVNode as Q, createCommentVNode as ce, createElementBlock as se, Fragment as Oe, renderList as st, withModifiers as Me, nextTick as Se, resolveDynamicComponent as rt, withKeys as Dt, normalizeStyle as zt, normalizeClass as Ve, reactive as $e, onUpdated as Ot, onUnmounted as Mt, withDirectives as Vt, isVNode as qt } from "vue";
|
|
3
3
|
import { saveAs as it } from "file-saver";
|
|
4
|
-
import
|
|
4
|
+
import Ee from "exceljs";
|
|
5
5
|
import ke from "dayjs";
|
|
6
6
|
import { createI18n as At, useI18n as me } from "vue-i18n";
|
|
7
7
|
import { debounce as Re, cloneDeep as ct, isArray as Qe } from "lodash";
|
|
8
8
|
import { useRoute as jt, useRouter as Ut } from "vue-router";
|
|
9
9
|
import { createNamespacedHelpers as Be, useStore as ut, mapState as Pt, mapGetters as Rt, mapActions as Bt } from "vuex";
|
|
10
|
-
import { VxeUI as
|
|
10
|
+
import { VxeUI as xe } from "vxe-pc-ui";
|
|
11
11
|
const Vn = ot({
|
|
12
12
|
name: "LayOutForm",
|
|
13
13
|
setup(t, { slots: e, attrs: n, emit: a }) {
|
|
14
14
|
const s = R(null), o = () => e.default ? e.default().filter((r) => r.type !== Symbol.for("v-cmt")).map((r) => r.type === Symbol.for("v-fgt") ? r.children : r).flat().map(
|
|
15
15
|
(r) => {
|
|
16
16
|
var i;
|
|
17
|
-
return
|
|
17
|
+
return Te(
|
|
18
18
|
St,
|
|
19
19
|
{ span: ((i = r.props) == null ? void 0 : i.span) || 24 },
|
|
20
20
|
{
|
|
@@ -27,10 +27,10 @@ const Vn = ot({
|
|
|
27
27
|
a("ref", s.value);
|
|
28
28
|
});
|
|
29
29
|
function l() {
|
|
30
|
-
return
|
|
30
|
+
return Te(
|
|
31
31
|
_t,
|
|
32
32
|
{ ...n, ref: s },
|
|
33
|
-
() =>
|
|
33
|
+
() => Te($t, { gutter: n.gutter ?? 20 }, { default: () => o() })
|
|
34
34
|
);
|
|
35
35
|
}
|
|
36
36
|
return l;
|
|
@@ -79,18 +79,18 @@ var ht = { exports: {} };
|
|
|
79
79
|
var B = E.match(a);
|
|
80
80
|
if (!B)
|
|
81
81
|
return null;
|
|
82
|
-
var F = ("" + B[0]).match(s) || ["-", 0, 0], d = F[0],
|
|
83
|
-
return
|
|
82
|
+
var F = ("" + B[0]).match(s) || ["-", 0, 0], d = F[0], x = 60 * +F[1] + +F[2];
|
|
83
|
+
return x === 0 ? 0 : d === "+" ? x : -x;
|
|
84
84
|
}(u), u === null))
|
|
85
85
|
return this;
|
|
86
86
|
var _ = Math.abs(u) <= 16 ? 60 * u : u;
|
|
87
87
|
if (_ === 0)
|
|
88
88
|
return this.utc(h);
|
|
89
|
-
var
|
|
89
|
+
var C = this.clone();
|
|
90
90
|
if (h)
|
|
91
|
-
return
|
|
91
|
+
return C.$offset = _, C.$u = !1, C;
|
|
92
92
|
var S = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
|
|
93
|
-
return (
|
|
93
|
+
return (C = this.local().add(_ + S, n)).$offset = _, C.$x.$localOffset = S, C;
|
|
94
94
|
};
|
|
95
95
|
var p = i.format;
|
|
96
96
|
i.format = function(u) {
|
|
@@ -114,8 +114,8 @@ var ht = { exports: {} };
|
|
|
114
114
|
i.diff = function(u, h, k) {
|
|
115
115
|
if (u && this.$u === u.$u)
|
|
116
116
|
return m.call(this, u, h, k);
|
|
117
|
-
var _ = this.local(),
|
|
118
|
-
return m.call(_,
|
|
117
|
+
var _ = this.local(), C = r(u).local();
|
|
118
|
+
return m.call(_, C, h, k);
|
|
119
119
|
};
|
|
120
120
|
};
|
|
121
121
|
});
|
|
@@ -133,24 +133,24 @@ var mt = { exports: {} };
|
|
|
133
133
|
m === void 0 && (m = {});
|
|
134
134
|
var u = new Date(p), h = function(k, _) {
|
|
135
135
|
_ === void 0 && (_ = {});
|
|
136
|
-
var
|
|
137
|
-
return E || (E = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: k, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName:
|
|
136
|
+
var C = _.timeZoneName || "short", S = k + "|" + C, E = a[S];
|
|
137
|
+
return E || (E = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: k, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: C }), a[S] = E), E;
|
|
138
138
|
}(g, m);
|
|
139
139
|
return h.formatToParts(u);
|
|
140
140
|
}, v = function(p, g) {
|
|
141
141
|
for (var m = i(p, g), u = [], h = 0; h < m.length; h += 1) {
|
|
142
|
-
var k = m[h], _ = k.type,
|
|
143
|
-
S >= 0 && (u[S] = parseInt(
|
|
142
|
+
var k = m[h], _ = k.type, C = k.value, S = n[_];
|
|
143
|
+
S >= 0 && (u[S] = parseInt(C, 10));
|
|
144
144
|
}
|
|
145
145
|
var E = u[3], B = E === 24 ? 0 : E, F = u[0] + "-" + u[1] + "-" + u[2] + " " + B + ":" + u[4] + ":" + u[5] + ":000", d = +p;
|
|
146
146
|
return (l.utc(F).valueOf() - (d -= d % 1e3)) / 6e4;
|
|
147
147
|
}, w = o.prototype;
|
|
148
148
|
w.tz = function(p, g) {
|
|
149
149
|
p === void 0 && (p = r);
|
|
150
|
-
var m, u = this.utcOffset(), h = this.toDate(), k = h.toLocaleString("en-US", { timeZone: p }), _ = Math.round((h - new Date(k)) / 1e3 / 60),
|
|
151
|
-
if (!Number(
|
|
150
|
+
var m, u = this.utcOffset(), h = this.toDate(), k = h.toLocaleString("en-US", { timeZone: p }), _ = Math.round((h - new Date(k)) / 1e3 / 60), C = 15 * -Math.round(h.getTimezoneOffset() / 15) - _;
|
|
151
|
+
if (!Number(C))
|
|
152
152
|
m = this.utcOffset(0, g);
|
|
153
|
-
else if (m = l(k, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(
|
|
153
|
+
else if (m = l(k, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(C, !0), g) {
|
|
154
154
|
var S = m.utcOffset();
|
|
155
155
|
m = m.add(u - S, "minute");
|
|
156
156
|
}
|
|
@@ -172,12 +172,12 @@ var mt = { exports: {} };
|
|
|
172
172
|
if (typeof p != "string")
|
|
173
173
|
return l(p).tz(h);
|
|
174
174
|
var _ = function(B, F, d) {
|
|
175
|
-
var
|
|
175
|
+
var x = B - 60 * F * 1e3, M = v(x, d);
|
|
176
176
|
if (F === M)
|
|
177
|
-
return [
|
|
178
|
-
var A = v(
|
|
179
|
-
return M === A ? [
|
|
180
|
-
}(l.utc(p, u).valueOf(), k, h),
|
|
177
|
+
return [x, F];
|
|
178
|
+
var A = v(x -= 60 * (M - F) * 1e3, d);
|
|
179
|
+
return M === A ? [x, M] : [B - 60 * Math.min(M, A) * 1e3, Math.max(M, A)];
|
|
180
|
+
}(l.utc(p, u).valueOf(), k, h), C = _[0], S = _[1], E = l(C).utcOffset(S);
|
|
181
181
|
return E.$x.$timezone = h, E;
|
|
182
182
|
}, l.tz.guess = function() {
|
|
183
183
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
@@ -289,7 +289,7 @@ async function qn(t, e) {
|
|
|
289
289
|
const l = ve();
|
|
290
290
|
throw new Error(l("excel.fieldsMappingRequired"));
|
|
291
291
|
}
|
|
292
|
-
let s = new
|
|
292
|
+
let s = new Ee.Workbook();
|
|
293
293
|
await s.xlsx.load(t);
|
|
294
294
|
const o = {};
|
|
295
295
|
return s.eachSheet(function(l, r) {
|
|
@@ -327,7 +327,7 @@ async function An(t, e, n = [], a = {}) {
|
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
function Gt() {
|
|
330
|
-
const t = new
|
|
330
|
+
const t = new Ee.Workbook();
|
|
331
331
|
t.creator = "distributor System", t.lastModifiedBy = "distributor System", t.created = /* @__PURE__ */ new Date(), t.modified = /* @__PURE__ */ new Date(), t.lastPrinted = /* @__PURE__ */ new Date();
|
|
332
332
|
const e = t.addWorksheet("Sheet1");
|
|
333
333
|
return { workbook: t, worksheet: e };
|
|
@@ -395,7 +395,7 @@ async function tn(t, e) {
|
|
|
395
395
|
const l = ve();
|
|
396
396
|
throw new Error(l("excel.fieldsMappingRequired"));
|
|
397
397
|
}
|
|
398
|
-
let s = new
|
|
398
|
+
let s = new Ee.Workbook();
|
|
399
399
|
await s.xlsx.load(t);
|
|
400
400
|
const o = {};
|
|
401
401
|
return s.eachSheet(function(l, r) {
|
|
@@ -415,13 +415,13 @@ async function tn(t, e) {
|
|
|
415
415
|
Object.keys(v).forEach((h) => {
|
|
416
416
|
var E;
|
|
417
417
|
let [k, _] = v[h].split(je);
|
|
418
|
-
const
|
|
418
|
+
const C = p.getCell(k);
|
|
419
419
|
let S;
|
|
420
420
|
if (_ == "image" && w) {
|
|
421
|
-
const B =
|
|
421
|
+
const B = C._column._number, F = `${g}_${B}`;
|
|
422
422
|
S = b[F] || "";
|
|
423
423
|
} else
|
|
424
|
-
|
|
424
|
+
C.result != null ? S = C.result : (E = C.value) != null && E.richText ? S = C.value.richText.reduce((B, F) => B + F.text, "") : C.type == 4 && C.value ? S = ke(C.value).utc().format("YYYY-MM-DD HH:mm:ss") : S = C.value;
|
|
425
425
|
S && _ == "option" && (S = S.split(je)[1]), m[h] = S, S && (u = !1);
|
|
426
426
|
}), u || i.push(m);
|
|
427
427
|
}
|
|
@@ -479,7 +479,7 @@ async function nn(t, e) {
|
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
481
|
function on(t) {
|
|
482
|
-
const e = ve(), n = new
|
|
482
|
+
const e = ve(), n = new Ee.Workbook();
|
|
483
483
|
return n.creator = "distributor System", n.lastModifiedBy = "distributor System", n.created = /* @__PURE__ */ new Date(), n.modified = /* @__PURE__ */ new Date(), n.lastPrinted = /* @__PURE__ */ new Date(), Object.keys(t).sort((s, o) => {
|
|
484
484
|
const l = t[s].sort ?? 0, r = t[o].sort ?? 0;
|
|
485
485
|
return l - r;
|
|
@@ -644,7 +644,7 @@ const _e = (t, e) => {
|
|
|
644
644
|
const n = t, a = Ft(), { t: s, locale: o } = me(), l = Tt(t, "modelValue"), r = re(() => a["value-key"] != null), i = R(""), v = re(() => {
|
|
645
645
|
if (a.remote !== void 0)
|
|
646
646
|
return n.data;
|
|
647
|
-
const d = pt(i.value), { data:
|
|
647
|
+
const d = pt(i.value), { data: x, labelValue: M } = n, A = x || p.value;
|
|
648
648
|
if (d.length == 0)
|
|
649
649
|
return A;
|
|
650
650
|
const { label: oe, labelEn: ue } = M;
|
|
@@ -676,34 +676,34 @@ const _e = (t, e) => {
|
|
|
676
676
|
if (u.length == 1) {
|
|
677
677
|
if (n.changeLocal)
|
|
678
678
|
return s(d[n.labelValue.label]);
|
|
679
|
-
let
|
|
680
|
-
return
|
|
679
|
+
let x = o.value == "en_us" ? d[n.labelValue.labelEn || "i18nName"] : d[n.labelValue.label];
|
|
680
|
+
return x = x || d[n.labelValue.label], x;
|
|
681
681
|
} else {
|
|
682
|
-
let
|
|
682
|
+
let x = [];
|
|
683
683
|
return u.forEach((M) => {
|
|
684
|
-
|
|
685
|
-
}),
|
|
684
|
+
x.push(d[M]);
|
|
685
|
+
}), x.join("-");
|
|
686
686
|
}
|
|
687
687
|
};
|
|
688
688
|
function k(d) {
|
|
689
|
-
let
|
|
690
|
-
l.value = d ?
|
|
689
|
+
let x = n.data ? n.data : p.value;
|
|
690
|
+
l.value = d ? x.map(
|
|
691
691
|
(M) => r.value ? M : M[n.labelValue.value]
|
|
692
692
|
) : [], Se(() => {
|
|
693
|
-
b("change", l.value), b("changeAll", l.value,
|
|
693
|
+
b("change", l.value), b("changeAll", l.value, x);
|
|
694
694
|
});
|
|
695
695
|
}
|
|
696
696
|
function _(d) {
|
|
697
697
|
n.optionClick && n.optionClick(d), b("change", r.value ? d : d[n.labelValue.value]);
|
|
698
698
|
}
|
|
699
|
-
function
|
|
699
|
+
function C(d) {
|
|
700
700
|
return l.value.length >= n.maxLimit && !l.value.includes(d[n.labelValue.value]);
|
|
701
701
|
}
|
|
702
702
|
function S(d) {
|
|
703
|
-
return d.map((
|
|
704
|
-
...
|
|
705
|
-
label: h(
|
|
706
|
-
value: r.value ?
|
|
703
|
+
return d.map((x) => ({
|
|
704
|
+
...x,
|
|
705
|
+
label: h(x),
|
|
706
|
+
value: r.value ? x : x[n.labelValue.value]
|
|
707
707
|
}));
|
|
708
708
|
}
|
|
709
709
|
const E = R([]), B = n.data ? n.data : p.value;
|
|
@@ -711,29 +711,29 @@ const _e = (t, e) => {
|
|
|
711
711
|
() => n.data ? n.data : p.value,
|
|
712
712
|
(d) => {
|
|
713
713
|
var M;
|
|
714
|
-
const
|
|
715
|
-
if (
|
|
716
|
-
E.value =
|
|
714
|
+
const x = S(d);
|
|
715
|
+
if (x.length !== E.value.length)
|
|
716
|
+
E.value = x;
|
|
717
717
|
else {
|
|
718
718
|
let A = !1;
|
|
719
|
-
for (let oe = 0; oe <
|
|
720
|
-
if (
|
|
719
|
+
for (let oe = 0; oe < x.length; oe++)
|
|
720
|
+
if (x[oe].value !== ((M = E.value[oe]) == null ? void 0 : M.value)) {
|
|
721
721
|
A = !0;
|
|
722
722
|
break;
|
|
723
723
|
}
|
|
724
|
-
A && (E.value =
|
|
724
|
+
A && (E.value = x);
|
|
725
725
|
}
|
|
726
726
|
},
|
|
727
727
|
{ deep: !0 }
|
|
728
728
|
);
|
|
729
729
|
const F = re(() => E.value);
|
|
730
|
-
return (d,
|
|
730
|
+
return (d, x) => {
|
|
731
731
|
const M = O("el-checkbox"), A = O("el-select-v2"), oe = O("el-option"), ue = O("el-select");
|
|
732
732
|
return K(a).v2 != null ? (L(), H(A, he({
|
|
733
733
|
key: 0,
|
|
734
734
|
options: F.value,
|
|
735
735
|
modelValue: l.value,
|
|
736
|
-
"onUpdate:modelValue":
|
|
736
|
+
"onUpdate:modelValue": x[1] || (x[1] = (y) => l.value = y)
|
|
737
737
|
}, K(a), {
|
|
738
738
|
filterable: "",
|
|
739
739
|
"collapse-tags": "",
|
|
@@ -756,7 +756,7 @@ const _e = (t, e) => {
|
|
|
756
756
|
z(M, {
|
|
757
757
|
class: "mgl20",
|
|
758
758
|
modelValue: w.value,
|
|
759
|
-
"onUpdate:modelValue":
|
|
759
|
+
"onUpdate:modelValue": x[0] || (x[0] = (y) => w.value = y),
|
|
760
760
|
onChange: k
|
|
761
761
|
}, {
|
|
762
762
|
default: D(() => [
|
|
@@ -771,7 +771,7 @@ const _e = (t, e) => {
|
|
|
771
771
|
]), 1040, ["options", "modelValue"])) : (L(), H(ue, he({
|
|
772
772
|
key: 1,
|
|
773
773
|
modelValue: l.value,
|
|
774
|
-
"onUpdate:modelValue":
|
|
774
|
+
"onUpdate:modelValue": x[3] || (x[3] = (y) => l.value = y),
|
|
775
775
|
filterable: "",
|
|
776
776
|
"collapse-tags": "",
|
|
777
777
|
"collapse-tags-tooltip": "",
|
|
@@ -783,7 +783,7 @@ const _e = (t, e) => {
|
|
|
783
783
|
z(M, {
|
|
784
784
|
class: "mgl20",
|
|
785
785
|
modelValue: w.value,
|
|
786
|
-
"onUpdate:modelValue":
|
|
786
|
+
"onUpdate:modelValue": x[2] || (x[2] = (y) => w.value = y),
|
|
787
787
|
onChange: k
|
|
788
788
|
}, {
|
|
789
789
|
default: D(() => [
|
|
@@ -792,11 +792,11 @@ const _e = (t, e) => {
|
|
|
792
792
|
_: 1
|
|
793
793
|
}, 8, ["modelValue"])
|
|
794
794
|
], !0) : ce("", !0),
|
|
795
|
-
(L(!0), se(
|
|
795
|
+
(L(!0), se(Oe, null, st(v.value, (y, ge) => (L(), H(oe, {
|
|
796
796
|
key: ge,
|
|
797
797
|
label: h(y),
|
|
798
|
-
disabled: K(a).multiple != null && t.maxLimit > 0 ?
|
|
799
|
-
onClick:
|
|
798
|
+
disabled: K(a).multiple != null && t.maxLimit > 0 ? C(y) : !1,
|
|
799
|
+
onClick: Me((ie) => _(y), ["stop"]),
|
|
800
800
|
value: r.value ? y : y[t.labelValue.value]
|
|
801
801
|
}, null, 8, ["label", "disabled", "onClick", "value"]))), 128))
|
|
802
802
|
]),
|
|
@@ -834,9 +834,7 @@ const yt = /* @__PURE__ */ _e(cn, [["render", un], ["__scopeId", "data-v-733f9da
|
|
|
834
834
|
}
|
|
835
835
|
return (o, l) => {
|
|
836
836
|
const r = O("el-popconfirm");
|
|
837
|
-
return L(), se("span",
|
|
838
|
-
class: Ee(o.$attrs.class)
|
|
839
|
-
}, [
|
|
837
|
+
return L(), se("span", null, [
|
|
840
838
|
z(r, he(o.$attrs, {
|
|
841
839
|
onConfirm: K(a),
|
|
842
840
|
onCancel: s
|
|
@@ -846,7 +844,7 @@ const yt = /* @__PURE__ */ _e(cn, [["render", un], ["__scopeId", "data-v-733f9da
|
|
|
846
844
|
]),
|
|
847
845
|
_: 3
|
|
848
846
|
}, 16, ["onConfirm"])
|
|
849
|
-
]
|
|
847
|
+
]);
|
|
850
848
|
};
|
|
851
849
|
}
|
|
852
850
|
};
|
|
@@ -958,7 +956,7 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
958
956
|
});
|
|
959
957
|
}
|
|
960
958
|
return e({ getPrm: g, reset: u }), (h, k) => {
|
|
961
|
-
const _ = O("el-input"),
|
|
959
|
+
const _ = O("el-input"), C = O("el-date-picker"), S = O("el-form-item"), E = O("el-form"), B = O("el-link"), F = O("el-button");
|
|
962
960
|
return L(), se("div", {
|
|
963
961
|
class: "searchBar-container mgt10 mgb10",
|
|
964
962
|
onKeydown: Dt(v, ["enter"])
|
|
@@ -972,7 +970,7 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
972
970
|
model: t.form.data
|
|
973
971
|
}, {
|
|
974
972
|
default: D(() => [
|
|
975
|
-
(L(!0), se(
|
|
973
|
+
(L(!0), se(Oe, null, st(t.form.items.filter((d) => !d.hidden), (d) => (L(), se(Oe, {
|
|
976
974
|
key: d.key
|
|
977
975
|
}, [
|
|
978
976
|
d.type == "br" ? (L(), se("br", hn)) : (L(), H(S, {
|
|
@@ -980,13 +978,13 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
980
978
|
label: d.name
|
|
981
979
|
}, {
|
|
982
980
|
default: D(() => {
|
|
983
|
-
var
|
|
981
|
+
var x, M;
|
|
984
982
|
return [
|
|
985
983
|
d.type === "input" ? (L(), H(_, {
|
|
986
984
|
key: 0,
|
|
987
985
|
modelValue: d.value,
|
|
988
986
|
"onUpdate:modelValue": (A) => d.value = A,
|
|
989
|
-
class:
|
|
987
|
+
class: Ve(((x = d.option) == null ? void 0 : x.class) || "w150"),
|
|
990
988
|
placeholder: h.$t("qing-shu-ru"),
|
|
991
989
|
clearable: ""
|
|
992
990
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) : d.type === "custom" ? (L(), H(rt(d.render), { key: 1 })) : ce("", !0),
|
|
@@ -999,9 +997,9 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
999
997
|
onChange: v,
|
|
1000
998
|
onClear: (A) => w(d)
|
|
1001
999
|
}), null, 16, ["class", "modelValue", "onUpdate:modelValue", "onClear"])) : ce("", !0),
|
|
1002
|
-
d.type === "date" ? (L(), H(
|
|
1000
|
+
d.type === "date" ? (L(), H(C, {
|
|
1003
1001
|
key: 3,
|
|
1004
|
-
class:
|
|
1002
|
+
class: Ve({ datetimerange: "w300", daterange: "w200" }[d.dateType] || "w100"),
|
|
1005
1003
|
modelValue: d.value,
|
|
1006
1004
|
"onUpdate:modelValue": (A) => d.value = A,
|
|
1007
1005
|
"value-format": { datetimerange: "YYYY-MM-DD HH:mm:ss", daterange: "YYYY-MM-DD" }[d.dateType] || "YYYY-MM-DD",
|
|
@@ -1095,24 +1093,24 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
1095
1093
|
enableCellCopy: !0
|
|
1096
1094
|
// 是否启用单元格选区复制功能
|
|
1097
1095
|
};
|
|
1098
|
-
let
|
|
1096
|
+
let Ce = { ...vt };
|
|
1099
1097
|
function Jn(t) {
|
|
1100
|
-
|
|
1101
|
-
...
|
|
1098
|
+
Ce = {
|
|
1099
|
+
...Ce,
|
|
1102
1100
|
...t,
|
|
1103
1101
|
responseDataKeys: {
|
|
1104
|
-
...
|
|
1102
|
+
...Ce.responseDataKeys,
|
|
1105
1103
|
...t.responseDataKeys || {}
|
|
1106
1104
|
}
|
|
1107
1105
|
};
|
|
1108
1106
|
}
|
|
1109
1107
|
function bn() {
|
|
1110
|
-
return
|
|
1108
|
+
return Ce;
|
|
1111
1109
|
}
|
|
1112
1110
|
function Xn() {
|
|
1113
|
-
|
|
1111
|
+
Ce = { ...vt };
|
|
1114
1112
|
}
|
|
1115
|
-
const wn = { class: "center" },
|
|
1113
|
+
const wn = { class: "center" }, xn = {
|
|
1116
1114
|
__name: "index",
|
|
1117
1115
|
props: {
|
|
1118
1116
|
// 表格id 本地存储列设置时使用,不传则使用路由路径自动生成
|
|
@@ -1167,22 +1165,22 @@ const wn = { class: "center" }, Cn = {
|
|
|
1167
1165
|
});
|
|
1168
1166
|
}, 100), _ = () => {
|
|
1169
1167
|
k();
|
|
1170
|
-
},
|
|
1168
|
+
}, C = () => {
|
|
1171
1169
|
if (!l.searchForm.enableCellCopy)
|
|
1172
1170
|
return !1;
|
|
1173
1171
|
const f = m.value;
|
|
1174
1172
|
if (!f || !f.$el)
|
|
1175
1173
|
return !1;
|
|
1176
1174
|
const c = f.$el;
|
|
1177
|
-
return c.classList.add("cell-copy-enabled"), c.setAttribute("tabindex", "-1"), c.removeEventListener("mousedown", ie), c.removeEventListener("mousemove", pe), c.removeEventListener("mouseup", be), c.removeEventListener("keydown",
|
|
1175
|
+
return c.classList.add("cell-copy-enabled"), c.setAttribute("tabindex", "-1"), c.removeEventListener("mousedown", ie), c.removeEventListener("mousemove", pe), c.removeEventListener("mouseup", be), c.removeEventListener("keydown", Le), c.addEventListener("mousedown", ie), c.addEventListener("mousemove", pe), c.addEventListener("mouseup", be), c.addEventListener("keydown", Le), !0;
|
|
1178
1176
|
};
|
|
1179
1177
|
lt(() => {
|
|
1180
1178
|
k(), window.addEventListener("resize", _), l.searchForm.enableCellCopy && (document.addEventListener("mouseup", Ne), document.addEventListener("mousedown", We), setTimeout(() => {
|
|
1181
|
-
|
|
1179
|
+
C();
|
|
1182
1180
|
}, 500));
|
|
1183
1181
|
}), Ot(() => {
|
|
1184
1182
|
l.searchForm.enableCellCopy && setTimeout(() => {
|
|
1185
|
-
|
|
1183
|
+
C();
|
|
1186
1184
|
}, 500);
|
|
1187
1185
|
}), Mt(() => {
|
|
1188
1186
|
if (window.removeEventListener("resize", _), l.searchForm.enableCellCopy) {
|
|
@@ -1190,7 +1188,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1190
1188
|
const f = m.value;
|
|
1191
1189
|
if (f && f.$el) {
|
|
1192
1190
|
const c = f.$el;
|
|
1193
|
-
c.removeEventListener("mousedown", ie), c.removeEventListener("mousemove", pe), c.removeEventListener("mouseup", be), c.removeEventListener("keydown",
|
|
1191
|
+
c.removeEventListener("mousedown", ie), c.removeEventListener("mousemove", pe), c.removeEventListener("mouseup", be), c.removeEventListener("keydown", Le);
|
|
1194
1192
|
}
|
|
1195
1193
|
}
|
|
1196
1194
|
});
|
|
@@ -1217,7 +1215,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1217
1215
|
}
|
|
1218
1216
|
i.value = c ? c(U) : U, g.total = W, E = T.nextSearchAfter, l.searchForm.enableCellCopy && Se(() => {
|
|
1219
1217
|
setTimeout(() => {
|
|
1220
|
-
|
|
1218
|
+
C();
|
|
1221
1219
|
}, 100);
|
|
1222
1220
|
});
|
|
1223
1221
|
}
|
|
@@ -1234,7 +1232,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1234
1232
|
}), F();
|
|
1235
1233
|
}
|
|
1236
1234
|
l.api && l.immediate && F();
|
|
1237
|
-
function
|
|
1235
|
+
function x() {
|
|
1238
1236
|
return { ...g, ...Ue(l.searchForm.items) };
|
|
1239
1237
|
}
|
|
1240
1238
|
const M = () => {
|
|
@@ -1310,7 +1308,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1310
1308
|
}, ie = (f) => {
|
|
1311
1309
|
const c = ge(f.target);
|
|
1312
1310
|
if (!c) {
|
|
1313
|
-
|
|
1311
|
+
Ie();
|
|
1314
1312
|
return;
|
|
1315
1313
|
}
|
|
1316
1314
|
y.isSelecting = !0, y.startCell = {
|
|
@@ -1327,7 +1325,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1327
1325
|
}, Ke(), He());
|
|
1328
1326
|
}, be = () => {
|
|
1329
1327
|
y.isSelecting = !1;
|
|
1330
|
-
},
|
|
1328
|
+
}, Ie = () => {
|
|
1331
1329
|
y.selectedCells = [], y.startCell = null, y.endCell = null;
|
|
1332
1330
|
const f = m.value;
|
|
1333
1331
|
if (!f)
|
|
@@ -1397,7 +1395,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1397
1395
|
const te = $.filter((ne) => ne.fixed === "right").indexOf(P);
|
|
1398
1396
|
j = de[te];
|
|
1399
1397
|
} else if (!G && !N && ee.closest(".vxe-table--body-wrapper")) {
|
|
1400
|
-
const fe = l.searchForm.showCheckBox ? 1 : 0, te = $.filter((
|
|
1398
|
+
const fe = l.searchForm.showCheckBox ? 1 : 0, te = $.filter((Fe) => Fe.fixed === "left").length, ne = Z - te;
|
|
1401
1399
|
j = de[ne + fe];
|
|
1402
1400
|
}
|
|
1403
1401
|
if (j && !j.classList.contains("col--checkbox") && !j.classList.contains("col--seq")) {
|
|
@@ -1445,7 +1443,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1445
1443
|
const te = $.filter((ne) => ne.fixed === "right").indexOf(Z);
|
|
1446
1444
|
j = de[te];
|
|
1447
1445
|
} else if (!P && !G && ee.closest(".vxe-table--body-wrapper")) {
|
|
1448
|
-
const fe = l.searchForm.showCheckBox ? 1 : 0, te = $.filter((
|
|
1446
|
+
const fe = l.searchForm.showCheckBox ? 1 : 0, te = $.filter((Fe) => Fe.fixed === "left").length, ne = Y - te;
|
|
1449
1447
|
j = de[ne + fe];
|
|
1450
1448
|
}
|
|
1451
1449
|
if (j && !j.classList.contains("col--checkbox") && !j.classList.contains("col--seq")) {
|
|
@@ -1463,18 +1461,18 @@ const wn = { class: "center" }, Cn = {
|
|
|
1463
1461
|
} catch (q) {
|
|
1464
1462
|
console.error("复制失败:", q);
|
|
1465
1463
|
}
|
|
1466
|
-
},
|
|
1467
|
-
l.searchForm.enableCellCopy && ((f.ctrlKey || f.metaKey) && f.key === "c" ? y.selectedCells.length > 0 && (f.preventDefault(), f.stopPropagation(), wt()) : f.key === "Escape" &&
|
|
1464
|
+
}, Le = (f) => {
|
|
1465
|
+
l.searchForm.enableCellCopy && ((f.ctrlKey || f.metaKey) && f.key === "c" ? y.selectedCells.length > 0 && (f.preventDefault(), f.stopPropagation(), wt()) : f.key === "Escape" && Ie());
|
|
1468
1466
|
}, Ne = () => {
|
|
1469
1467
|
y.isSelecting = !1;
|
|
1470
1468
|
}, We = (f) => {
|
|
1471
1469
|
const c = m.value;
|
|
1472
1470
|
if (!c || !c.$el)
|
|
1473
1471
|
return;
|
|
1474
|
-
c.$el.contains(f.target) ||
|
|
1475
|
-
}, Ct = (f) => {
|
|
1476
|
-
g[b] = f, F();
|
|
1472
|
+
c.$el.contains(f.target) || Ie();
|
|
1477
1473
|
}, xt = (f) => {
|
|
1474
|
+
g[b] = f, F();
|
|
1475
|
+
}, Ct = (f) => {
|
|
1478
1476
|
g[p] = f, g[b] = 1, F();
|
|
1479
1477
|
};
|
|
1480
1478
|
function Ze() {
|
|
@@ -1489,11 +1487,11 @@ const wn = { class: "center" }, Cn = {
|
|
|
1489
1487
|
l.searchForm.selections = $;
|
|
1490
1488
|
}
|
|
1491
1489
|
};
|
|
1492
|
-
return e({ tableRef: m, getList: F, getPrm:
|
|
1490
|
+
return e({ tableRef: m, getList: F, getPrm: x, clearSort: M, calculateTableHeight: k }), (f, c) => {
|
|
1493
1491
|
var q;
|
|
1494
1492
|
const $ = O("el-button"), T = O("el-checkbox"), U = O("el-text"), W = O("vxe-column"), V = O("VxeTable"), le = O("el-pagination");
|
|
1495
1493
|
return L(), se("div", {
|
|
1496
|
-
class:
|
|
1494
|
+
class: Ve({ box: t.searchForm.showShadow })
|
|
1497
1495
|
}, [
|
|
1498
1496
|
t.searchForm.showSearch ? (L(), H(vn, {
|
|
1499
1497
|
key: 0,
|
|
@@ -1551,13 +1549,13 @@ const wn = { class: "center" }, Cn = {
|
|
|
1551
1549
|
checked: !0,
|
|
1552
1550
|
disabled: P,
|
|
1553
1551
|
size: "default",
|
|
1554
|
-
onClick:
|
|
1552
|
+
onClick: Me((N) => !P && Ge(Y), ["stop"])
|
|
1555
1553
|
}, null, 8, ["disabled", "onClick"])) : (L(), H(T, {
|
|
1556
1554
|
key: 1,
|
|
1557
1555
|
disabled: P,
|
|
1558
1556
|
checked: !1,
|
|
1559
1557
|
size: "default",
|
|
1560
|
-
onClick:
|
|
1558
|
+
onClick: Me((N) => !P && Ge(Y), ["stop"])
|
|
1561
1559
|
}, null, 8, ["disabled", "onClick"])),
|
|
1562
1560
|
z(U, {
|
|
1563
1561
|
type: "info",
|
|
@@ -1587,13 +1585,13 @@ const wn = { class: "center" }, Cn = {
|
|
|
1587
1585
|
total: g.total,
|
|
1588
1586
|
"page-size": g[K(p)],
|
|
1589
1587
|
"page-sizes": t.searchForm.pageSizes || K(o).pageSizes,
|
|
1590
|
-
onCurrentChange:
|
|
1591
|
-
onSizeChange:
|
|
1588
|
+
onCurrentChange: xt,
|
|
1589
|
+
onSizeChange: Ct
|
|
1592
1590
|
}, null, 8, ["current-page", "total", "page-size", "page-sizes"])) : ce("", !0)
|
|
1593
1591
|
], 2);
|
|
1594
1592
|
};
|
|
1595
1593
|
}
|
|
1596
|
-
}, Qn = /* @__PURE__ */ _e(
|
|
1594
|
+
}, Qn = /* @__PURE__ */ _e(xn, [["__scopeId", "data-v-d93cad32"]]), eo = {
|
|
1597
1595
|
__name: "index",
|
|
1598
1596
|
props: {
|
|
1599
1597
|
sheetsConfig: {
|
|
@@ -1623,7 +1621,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1623
1621
|
}, 16);
|
|
1624
1622
|
};
|
|
1625
1623
|
}
|
|
1626
|
-
},
|
|
1624
|
+
}, Cn = {
|
|
1627
1625
|
mounted(t, e) {
|
|
1628
1626
|
e.value && tt(t);
|
|
1629
1627
|
},
|
|
@@ -1818,7 +1816,7 @@ const kn = {
|
|
|
1818
1816
|
} : void 0
|
|
1819
1817
|
]), 1032, ["modelValue", "title", "width"])
|
|
1820
1818
|
])), [
|
|
1821
|
-
[K(
|
|
1819
|
+
[K(Cn), t.layer.show]
|
|
1822
1820
|
]);
|
|
1823
1821
|
};
|
|
1824
1822
|
}
|
|
@@ -2059,15 +2057,15 @@ function lo(t, e = {}) {
|
|
|
2059
2057
|
w.value = !0, t(g).then((m) => {
|
|
2060
2058
|
const { code: u, data: h, msg: k } = m;
|
|
2061
2059
|
if (r) {
|
|
2062
|
-
const { records: _, rows:
|
|
2063
|
-
v.value =
|
|
2060
|
+
const { records: _, rows: C } = h || {}, S = _ || C ? _ || C : h;
|
|
2061
|
+
v.value = De(S, i), r(m);
|
|
2064
2062
|
}
|
|
2065
2063
|
if (h) {
|
|
2066
2064
|
if (h.records != null || h.rows != null) {
|
|
2067
|
-
const { records: _, rows:
|
|
2068
|
-
g && g.total != null && (l.total = parseInt(S)), v.value =
|
|
2065
|
+
const { records: _, rows: C, total: S = 0 } = h || {};
|
|
2066
|
+
g && g.total != null && (l.total = parseInt(S)), v.value = De(_ || C || [], i);
|
|
2069
2067
|
} else
|
|
2070
|
-
v.value =
|
|
2068
|
+
v.value = De(h, i);
|
|
2071
2069
|
o && console.log("useRequest-res", v.value);
|
|
2072
2070
|
}
|
|
2073
2071
|
}).catch((m) => {
|
|
@@ -2088,7 +2086,7 @@ function ao(t) {
|
|
|
2088
2086
|
function so(t) {
|
|
2089
2087
|
return Object.prototype.toString.call(t).slice(8, -1).toLowerCase();
|
|
2090
2088
|
}
|
|
2091
|
-
function
|
|
2089
|
+
function De(t, e) {
|
|
2092
2090
|
if (!e)
|
|
2093
2091
|
return t;
|
|
2094
2092
|
if (t instanceof Array)
|
|
@@ -2140,11 +2138,11 @@ function $n(t, e) {
|
|
|
2140
2138
|
s[o] = a[o].bind({ $store: n });
|
|
2141
2139
|
}), s;
|
|
2142
2140
|
}
|
|
2143
|
-
function
|
|
2141
|
+
function ze(t) {
|
|
2144
2142
|
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !qt(t);
|
|
2145
2143
|
}
|
|
2146
2144
|
function ho() {
|
|
2147
|
-
|
|
2145
|
+
xe.renderer.add("Enum", {
|
|
2148
2146
|
// 默认显示模板
|
|
2149
2147
|
renderTableDefault(t, e) {
|
|
2150
2148
|
let n;
|
|
@@ -2155,15 +2153,15 @@ function ho() {
|
|
|
2155
2153
|
let s;
|
|
2156
2154
|
return z(O("el-text"), {
|
|
2157
2155
|
type: t.enum.getTag(a)
|
|
2158
|
-
},
|
|
2156
|
+
}, ze(s = t.enum.getName(a)) ? s : {
|
|
2159
2157
|
default: () => [s]
|
|
2160
2158
|
});
|
|
2161
2159
|
}
|
|
2162
|
-
return z(O("el-text"), null,
|
|
2160
|
+
return z(O("el-text"), null, ze(n = t.enum.getName(a)) ? n : {
|
|
2163
2161
|
default: () => [n]
|
|
2164
2162
|
});
|
|
2165
2163
|
}
|
|
2166
|
-
}),
|
|
2164
|
+
}), xe.renderer.add("InputNumber", {
|
|
2167
2165
|
// 默认显示模板
|
|
2168
2166
|
renderTableDefault(t, e) {
|
|
2169
2167
|
return z(It, he({
|
|
@@ -2174,7 +2172,7 @@ function ho() {
|
|
|
2174
2172
|
"value-on-clear": 0
|
|
2175
2173
|
}), null);
|
|
2176
2174
|
}
|
|
2177
|
-
}),
|
|
2175
|
+
}), xe.renderer.add("TrueFalse", {
|
|
2178
2176
|
// 默认显示模板
|
|
2179
2177
|
renderTableDefault(t, e) {
|
|
2180
2178
|
const {
|
|
@@ -2187,7 +2185,7 @@ function ho() {
|
|
|
2187
2185
|
default: () => [e.row[e.column.field] ? a ? "是" : "YES" : a ? "否" : "NO"]
|
|
2188
2186
|
});
|
|
2189
2187
|
}
|
|
2190
|
-
}),
|
|
2188
|
+
}), xe.renderer.add("I18n", {
|
|
2191
2189
|
// 默认显示模板
|
|
2192
2190
|
renderTableDefault(t, e) {
|
|
2193
2191
|
const {
|
|
@@ -2196,7 +2194,7 @@ function ho() {
|
|
|
2196
2194
|
let a = n.value == "zh_cn" ? e.column.field : t.fieldEn;
|
|
2197
2195
|
return e.row[a] || e.row[e.column.field];
|
|
2198
2196
|
}
|
|
2199
|
-
}),
|
|
2197
|
+
}), xe.renderer.add("Link", {
|
|
2200
2198
|
// 默认显示模板
|
|
2201
2199
|
renderTableDefault(t, e) {
|
|
2202
2200
|
var r;
|
|
@@ -2228,7 +2226,7 @@ function ho() {
|
|
|
2228
2226
|
[n]: i
|
|
2229
2227
|
}
|
|
2230
2228
|
})
|
|
2231
|
-
},
|
|
2229
|
+
}, ze(i) ? i : {
|
|
2232
2230
|
default: () => [i]
|
|
2233
2231
|
}), v < l.length - 1 ? "," : ""]));
|
|
2234
2232
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(y,H){typeof exports=="object"&&typeof module<"u"?H(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"],H):(y=typeof globalThis<"u"?globalThis:y||self,H(y.JoyAdminComponents={},y.ElementPlus,y.Vue,y.fileSaver,y.ExcelJS,y.dayjs,y.VueI18n,y._,y.VueRouter,y.Vuex,y.VxeUI))})(this,function(y,H,e,Ie,ge,ce,X,te,Le,Q,de){"use strict";const Je=e.defineComponent({name:"LayOutForm",setup(o,{slots:t,attrs:n,emit:r}){const s=e.ref(null),l=()=>t.default?t.default().filter(i=>i.type!==Symbol.for("v-cmt")).map(i=>i.type===Symbol.for("v-fgt")?i.children:i).flat().map(i=>{var c;return e.h(H.ElCol,{span:((c=i.props)==null?void 0:c.span)||24},{default:()=>i})}):null;e.onMounted(()=>{r("ref",s.value)});function a(){return e.h(H.ElForm,{...n,ref:s},()=>e.h(H.ElRow,{gutter:n.gutter??20},{default:()=>l()}))}return a}});var ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fe(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var De={exports:{}};(function(o,t){(function(n,r){o.exports=r()})(ve,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(l,a,i){var c=a.prototype;i.utc=function(u){var m={date:u,utc:!0,args:arguments};return new a(m)},c.utc=function(u){var m=i(this.toDate(),{locale:this.$L,utc:!0});return u?m.add(this.utcOffset(),n):m},c.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var b=c.parse;c.parse=function(u){u.utc&&(this.$u=!0),this.$utils().u(u.$offset)||(this.$offset=u.$offset),b.call(this,u)};var k=c.init;c.init=function(){if(this.$u){var u=this.$d;this.$y=u.getUTCFullYear(),this.$M=u.getUTCMonth(),this.$D=u.getUTCDate(),this.$W=u.getUTCDay(),this.$H=u.getUTCHours(),this.$m=u.getUTCMinutes(),this.$s=u.getUTCSeconds(),this.$ms=u.getUTCMilliseconds()}else k.call(this)};var x=c.utcOffset;c.utcOffset=function(u,m){var $=this.$utils().u;if($(u))return this.$u?0:$(this.$offset)?x.call(this):this.$offset;if(typeof u=="string"&&(u=function(I){I===void 0&&(I="");var A=I.match(r);if(!A)return null;var v=(""+A[0]).match(s)||["-",0,0],f=v[0],_=60*+v[1]+ +v[2];return _===0?0:f==="+"?_:-_}(u),u===null))return this;var V=Math.abs(u)<=16?60*u:u;if(V===0)return this.utc(m);var S=this.clone();if(m)return S.$offset=V,S.$u=!1,S;var T=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(S=this.local().add(V+T,n)).$offset=V,S.$x.$localOffset=T,S};var C=c.format;c.format=function(u){var m=u||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return C.call(this,m)},c.valueOf=function(){var u=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*u},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var p=c.toDate;c.toDate=function(u){return u==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():p.call(this)};var g=c.diff;c.diff=function(u,m,$){if(u&&this.$u===u.$u)return g.call(this,u,m,$);var V=this.local(),S=i(u).local();return g.call(V,S,m,$)}}})})(De);var Xe=De.exports;const Qe=Fe(Xe);var Be={exports:{}};(function(o,t){(function(n,r){o.exports=r()})(ve,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(s,l,a){var i,c=function(C,p,g){g===void 0&&(g={});var u=new Date(C),m=function($,V){V===void 0&&(V={});var S=V.timeZoneName||"short",T=$+"|"+S,I=r[T];return I||(I=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:S}),r[T]=I),I}(p,g);return m.formatToParts(u)},b=function(C,p){for(var g=c(C,p),u=[],m=0;m<g.length;m+=1){var $=g[m],V=$.type,S=$.value,T=n[V];T>=0&&(u[T]=parseInt(S,10))}var I=u[3],A=I===24?0:I,v=u[0]+"-"+u[1]+"-"+u[2]+" "+A+":"+u[4]+":"+u[5]+":000",f=+C;return(a.utc(v).valueOf()-(f-=f%1e3))/6e4},k=l.prototype;k.tz=function(C,p){C===void 0&&(C=i);var g,u=this.utcOffset(),m=this.toDate(),$=m.toLocaleString("en-US",{timeZone:C}),V=Math.round((m-new Date($))/1e3/60),S=15*-Math.round(m.getTimezoneOffset()/15)-V;if(!Number(S))g=this.utcOffset(0,p);else if(g=a($,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(S,!0),p){var T=g.utcOffset();g=g.add(u-T,"minute")}return g.$x.$timezone=C,g},k.offsetName=function(C){var p=this.$x.$timezone||a.tz.guess(),g=c(this.valueOf(),p,{timeZoneName:C}).find(function(u){return u.type.toLowerCase()==="timezonename"});return g&&g.value};var x=k.startOf;k.startOf=function(C,p){if(!this.$x||!this.$x.$timezone)return x.call(this,C,p);var g=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return x.call(g,C,p).tz(this.$x.$timezone,!0)},a.tz=function(C,p,g){var u=g&&p,m=g||p||i,$=b(+a(),m);if(typeof C!="string")return a(C).tz(m);var V=function(A,v,f){var _=A-60*v*1e3,D=b(_,f);if(v===D)return[_,v];var M=b(_-=60*(D-v)*1e3,f);return D===M?[_,D]:[A-60*Math.min(D,M)*1e3,Math.max(D,M)]}(a.utc(C,u).valueOf(),$,m),S=V[0],T=V[1],I=a(S).utcOffset(T);return I.$x.$timezone=m,I},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(C){i=C}}})})(Be);var et=Be.exports;const tt=Fe(et),pe={"dao-ru":"导入","quan-xuan":"全选","xia-zai-dao-ru-mo-ban":"下载导入模板","xu-hao":"序号","qing-shu-ru":"请输入","qing-xuan-ze":"请选择","kai-shi-shi-jian":"开始时间","jie-shu-shi-jian":"结束时间","shai-xuan":"筛选","chong-zhi":"重置","guan-bi":"关闭","zhan-kai":"展开","qu-xiao":"取消","ti-jiao":"提交","que-ding":"确定","que-ding-guan-bi-ma":"确定关闭吗","xia-zai-dao-ru-mo-ban":"下载导入模板",excel:{fieldsMappingRequired:"请输入列字段映射",invalidInput:"非法输入",invalidOption:"请输入有效选项!",copyFailed:"复制失败",sheetNameTooLong:'Sheet名称 "{0}" 长度超过31个字符,已自动截断为 "{1}"'},validate:{invalidInput:"请输入正确内容"},tools:{keysLengthError:"keys 长度必须大于2 默认前两位为 label value"}},ye={"dao-ru":"Import","quan-xuan":"Select All","xia-zai-dao-ru-mo-ban":"Download Import Template","xu-hao":"No.","qing-shu-ru":"Please enter","qing-xuan-ze":"Please select","kai-shi-shi-jian":"Start Time","jie-shu-shi-jian":"End Time","shai-xuan":"Filter","chong-zhi":"Reset","guan-bi":"Collapse","zhan-kai":"Expand","qu-xiao":"Cancel","ti-jiao":"Submit","que-ding":"Confirm","que-ding-guan-bi-ma":"Are you sure to close?","xia-zai-dao-ru-mo-ban":"Download Import Template",excel:{fieldsMappingRequired:"Please enter column field mapping",invalidInput:"Invalid input",invalidOption:"Please enter a valid option!",copyFailed:"Copy failed",sheetNameTooLong:'Sheet name "{0}" exceeds 31 characters, automatically truncated to "{1}"'},validate:{invalidInput:"Please enter valid content"},tools:{keysLengthError:"Keys length must be greater than 2, default first two are label and value"}},ze={zh_cn:pe,en_us:ye};let re=null;function Me(o=null){if(o){const{global:t}=o;return t.messages.value.zh_cn?t.mergeLocaleMessage("zh_cn",pe):t.setLocaleMessage("zh_cn",pe),t.messages.value.en_us?t.mergeLocaleMessage("en_us",ye):t.setLocaleMessage("en_us",ye),re=o,o}return re||(re=X.createI18n({legacy:!1,locale:"zh_cn",fallbackLocale:"zh_cn",messages:ze})),re}function Ce(){return re||Me()}function oe(){return Ce().global.t}ce.extend(Qe),ce.extend(tt);async function ot(o,t){const{fields:n,range:r=1}=t;if(!n){const a=oe();throw new Error(a("excel.fieldsMappingRequired"))}let s=new ge.Workbook;await s.xlsx.load(o);const l={};return s.eachSheet(function(a,i){const c=[];a.eachRow(function(b,k){if(k>r){let x={},C=!0;Object.keys(n).forEach(p=>{const g=b.getCell(n[p]).value;x[p]=g,g&&(C=!1)}),C||c.push(x)}}),l[a._name]=c}),s=null,l}const Oe={columnWidth:30};async function nt(o,t,n=[],r={}){if(!o||!t)return;const{columnStyle:s}=r,{columnWidth:l}=Oe;t.forEach(c=>{c.width=c.width?c.width:l});const{workbook:a,worksheet:i}=lt();i.columns=t,i.addRows(n),s&&await at(a,i,s);try{const c=await a.xlsx.writeBuffer(),b=new File([c],o,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Ie.saveAs(b)}catch(c){console.log(c)}}function lt(){const o=new ge.Workbook;o.creator="distributor System",o.lastModifiedBy="distributor System",o.created=new Date,o.modified=new Date,o.lastPrinted=new Date;const t=o.addWorksheet("Sheet1");return{workbook:o,worksheet:t}}async function at(o,t,n){const r=Object.keys(n);for(const s of r){const l=n[s],{type:a}=l;switch(a){case"IMG":await rt(o,t,s);break}}}async function rt(o,t,n,r){const s=t.getColumn(n),l=s.values;t.getColumn(n).width=20,t.eachRow((a,i)=>{i>1&&(a.height=40)});for(let a=0,i=l.length;a<i;a++){if(a<2)continue;let c=l[a];c&&(t.getCell(s.letter+a).value="",await st(o,t,c,{width:100,height:50,col:s._number-1,row:a-1}))}}async function st(o,t,n,r){const{col:s,row:l,width:a,height:i}=r,{success:c,base64:b}=await it(n,.3);if(c){const k=o.addImage({base64:b,extension:"jpeg"});t.addImage(k,{tl:{col:s,row:l},ext:{width:a,height:i}})}}function it(o,t=1){const n=new Image;return n.setAttribute("crossOrigin","anonymous"),n.crossOrigin="anonymous",n.src=o,new Promise((r,s)=>{n.onload=()=>{const l=document.createElement("canvas");l.width=n.width,l.height=n.height,l.getContext("2d").drawImage(n,0,0,l.width,l.height),r({success:!0,base64:l.toDataURL("image/jpeg",t)})},n.onerror=()=>{r({success:!1})}})}const we="---";async function ct(o,t){const{fields:n,range:r=1}=t;if(!n){const a=oe();throw new Error(a("excel.fieldsMappingRequired"))}let s=new ge.Workbook;await s.xlsx.load(o);const l={};return s.eachSheet(function(a,i){if(a.state=="visible"){const c=[],b=n[a._name];if(b){let k=Object.values(b).some(C=>C.includes("image")),x={};k&&(a.getImages().forEach(p=>{const{tl:g}=p.range,u=s.model.media.find(m=>m.index===p.imageId);if(u){const m=u.buffer.toString("base64"),$=`data:image/${u.extension};base64,${m}`,V=`${Math.ceil(g.row)}_${Math.ceil(g.col)}`;x[V]?x[V].push($):x[V]=[$]}}),console.log("withImages-imageMap",x)),a.eachRow(function(C,p){if(p>r){let g={},u=!0;Object.keys(b).forEach(m=>{var I;let[$,V]=b[m].split(we);const S=C.getCell($);let T;if(V=="image"&&k){const A=S._column._number,v=`${p}_${A}`;T=x[v]||""}else S.result!=null?T=S.result:(I=S.value)!=null&&I.richText?T=S.value.richText.reduce((A,v)=>A+v.text,""):S.type==4&&S.value?T=ce(S.value).utc().format("YYYY-MM-DD HH:mm:ss"):T=S.value;T&&V=="option"&&(T=T.split(we)[1]),g[m]=T,T&&(u=!1)}),u||c.push(g)}}),l[a._name]=c}}}),s=null,l}async function dt(o,t){if(!o||t.length==0)return;const n=ut(t);n.eachSheet(function(r,s){const{columnWidth:l}=Oe,{tableHeader:a,tableData:i}=t[r._name];a.forEach(c=>{if(c.required){const b=c.style||{},{font:k={}}=b;c.style={...b,font:{...k,color:{argb:"FFFF0000"}}}}}),r.columns=a,r.addRows(i),a.forEach(c=>{const{header:b,key:k,width:x,option:C}=c,p=r.getColumn(k);if(p.width=x||l,C){const g=n.addWorksheet(k);g.state="hidden",g.getColumn(1).values=C.map(u=>`${u.label}${we}${u.value}`),Array(100).fill("").forEach((u,m)=>{if(m>0){const $=oe();r.getCell(`${p.letter}${m}`).dataValidation={type:"list",formulae:[`${k}!$A$1:$A$${C.length}`],showErrorMessage:!0,error:$("excel.invalidInput"),errorStyle:"stop",errorMessage:$("excel.invalidOption")}}})}})});try{const r=await n.xlsx.writeBuffer(),s=new File([r],o,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Ie.saveAs(s)}catch(r){console.log(r)}}function ut(o){const t=oe(),n=new ge.Workbook;return n.creator="distributor System",n.lastModifiedBy="distributor System",n.created=new Date,n.modified=new Date,n.lastPrinted=new Date,Object.keys(o).sort((s,l)=>{const a=o[s].sort??0,i=o[l].sort??0;return a-i}).forEach(s=>{let l=s,a=!1;/[\\/:*?\[\]]/g.test(s)&&(s=s.replace(/[\\/:*?\[\]]/g,""),a=!0),s.length>31&&(s=s.substring(0,31).trim(),a=!0,console.warn(t("excel.sheetNameTooLong",[l,s]))),a&&(o[s]=o[l],delete o[l]),n.addWorksheet(s)}),n}function ft(o){if(o<26)return String.fromCharCode(65+o);{const t=String.fromCharCode(65+Math.floor((o-26)/26)),n=String.fromCharCode(65+(o-26)%26);return t+n}}function ht(o){return new Promise(t=>{setTimeout(()=>{t()},o)})}function mt(o){return JSON.parse(JSON.stringify(o))}function gt(o){let t=[],n={},r=(s,l)=>Object.prototype.hasOwnProperty.call(s,l);for(const s of o){n[s.id]={...s,children:r(n,s.id)?n[s.id].children:[]};const l=n[s.id];s.pid==-1?t.push(l):(r(n,s.pid)||(n[s.pid]={children:[]}),n[s.pid].children.push(l))}return t}function be(o,t=" "){return o?o.split(t).filter(n=>n.trim()):[]}class xe{constructor(t,n=["label","value","labelEn"]){this.list=t.map(r=>({...r,label:r[n[0]],labelEn:r[n[2]]||r[n[0]]||"",value:r[n[1]]})),this.map=new Map(this.list.map(r=>[r[n[1]],r]))}getName(t){if(!this.has(t))return"-";const n=Ce().global.locale,{label:r,labelEn:s}=this.map.get(t);return(n.value=="zh_cn"?r:s)||r||"-"}getTag(t){if(!this.has(t))return"info";const{tag:n="info"}=this.map.get(t);return n}getItem(t){return this.has(t)?this.map.get(t):null}getColor(t){if(!this.has(t))return null;const{color:n}=this.map.get(t);return n}has(t){return this.map.has(t)}}function pt(o,t=[],n="i18nName"){if(o.length==0)return new xe([]);if(t.length<2){const s=oe();throw new Error(s("tools.keysLengthError"))}let r=o.map(s=>{let l={};return n&&(l.labelEn=s[n]),t.forEach((a,i)=>{i===0?l.label=s[a]:i===1?l.value=s[a]:l[a]=s[a]}),l});return new xe(r)}function yt(o){return o?o.replace(/<[^>]+>/g,""):""}function Ct(o){return o?(o.includes("\\\\u")&&(o=o.replace(/\\/g,"")),o.replace(/\\u[\dA-F]{4}/gi,t=>String.fromCharCode(parseInt(t.replace(/\\u/g,""),16)))):""}function wt(o,t=10){let n=1048576*t;return!(o.size>n)}function bt(o){return Array.from(10).fill(0).map((n,r)=>o+"_"+r)}function xt(o){let t={};return o.map((n,r)=>{let{key:s,option:l,type:a}=n,i=ft(r);l?t[s]=`${i}---option`:a==="image"?t[s]=`${i}---image`:t[s]=i}),t}function kt(o,t){return t.split(".").reduce((n,r)=>n&&n[r],o)}const lo="",ue=(o,t)=>{const n=o.__vccOpts||o;for(const[r,s]of t)n[r]=s;return n},_t=["onClick"],qe=ue({__name:"index",props:e.mergeModels({api:{type:Function},showCheckAll:{type:Boolean,default:!0},maxLimit:{type:Number,default:void 0},optionClick:{type:Function,default:()=>{}},data:{type:Array},labelValue:{type:Object,default:()=>({label:"label",labelEn:"labelEn",value:"value"})},changeLocal:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["success","change","changeAll"],["update:modelValue"]),setup(o,{emit:t}){const n=o,r=e.useAttrs(),{t:s,locale:l}=X.useI18n(),a=e.useModel(o,"modelValue"),i=e.computed(()=>r["value-key"]!=null),c=e.ref(""),b=e.computed(()=>{if(r.remote!==void 0)return n.data;const f=be(c.value),{data:_,labelValue:D}=n,M=_||C.value;if(f.length==0)return M;const{label:G,labelEn:ne}=D;let w=l.value=="en_us"?ne||"i18nName":G;return f.length==1?M.filter(ee=>ee[w].toLowerCase().includes(f[0].toLowerCase())):M.filter(ee=>{let ie=!1;return ie=f.some(he=>ee[w].toLowerCase()==he.toLowerCase()),ie})}),k=e.computed({get(){return r.multiple==null||a.value==null?!1:a.value.length==b.value.length},set(f){return f}}),x=t,C=e.ref([]),p=async()=>{const{data:f}=await n.api();C.value=[...f],x("success",C)};n.api&&p();function g(f){x("change",f)}const u=n.labelValue.label.split("-"),m=f=>{if(u.length==1){if(n.changeLocal)return s(f[n.labelValue.label]);let _=l.value=="en_us"?f[n.labelValue.labelEn||"i18nName"]:f[n.labelValue.label];return _=_||f[n.labelValue.label],_}else{let _=[];return u.forEach(D=>{_.push(f[D])}),_.join("-")}};function $(f){let _=n.data?n.data:C.value;a.value=f?_.map(D=>i.value?D:D[n.labelValue.value]):[],e.nextTick(()=>{x("change",a.value),x("changeAll",a.value,_)})}function V(f){n.optionClick&&n.optionClick(f),x("change",i.value?f:f[n.labelValue.value])}function S(f){return a.value.length>=n.maxLimit&&!a.value.includes(f[n.labelValue.value])}function T(f){return f.map(_=>({..._,label:m(_),value:i.value?_:_[n.labelValue.value]}))}const I=e.ref([]),A=n.data?n.data:C.value;I.value=T(A),e.watch(()=>n.data?n.data:C.value,f=>{var D;const _=T(f);if(_.length!==I.value.length)I.value=_;else{let M=!1;for(let G=0;G<_.length;G++)if(_[G].value!==((D=I.value[G])==null?void 0:D.value)){M=!0;break}M&&(I.value=_)}},{deep:!0});const v=e.computed(()=>I.value);return(f,_)=>{const D=e.resolveComponent("el-checkbox"),M=e.resolveComponent("el-select-v2"),G=e.resolveComponent("el-option"),ne=e.resolveComponent("el-select");return e.unref(r).v2!=null?(e.openBlock(),e.createBlock(M,e.mergeProps({key:0,options:v.value,modelValue:a.value,"onUpdate:modelValue":_[1]||(_[1]=w=>a.value=w)},e.unref(r),{filterable:"","collapse-tags":"","collapse-tags-tooltip":"",clearable:"",onChange:g,onClear:g}),e.createSlots({default:e.withCtx(({item:w})=>[e.createElementVNode("div",{onClick:se=>V(w)},e.toDisplayString(w.label),9,_t)]),_:2},[e.unref(r).multiple!=null?{name:"header",fn:e.withCtx(()=>[e.renderSlot(f.$slots,"header",{},()=>[e.createVNode(D,{class:"mgl20",modelValue:k.value,"onUpdate:modelValue":_[0]||(_[0]=w=>k.value=w),onChange:$},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0)]),key:"0"}:void 0]),1040,["options","modelValue"])):(e.openBlock(),e.createBlock(ne,e.mergeProps({key:1,modelValue:a.value,"onUpdate:modelValue":_[3]||(_[3]=w=>a.value=w),filterable:"","collapse-tags":"","collapse-tags-tooltip":"","filter-method":e.unref(r).remote!=null?void 0:w=>c.value=w,clearable:""},e.unref(r),{onClear:o.optionClick}),{default:e.withCtx(()=>[e.unref(r).multiple!=null&&o.showCheckAll&&o.maxLimit==null?e.renderSlot(f.$slots,"header",{key:0},()=>[e.createVNode(D,{class:"mgl20",modelValue:k.value,"onUpdate:modelValue":_[2]||(_[2]=w=>k.value=w),onChange:$},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(w,se)=>(e.openBlock(),e.createBlock(G,{key:se,label:m(w),disabled:e.unref(r).multiple!=null&&o.maxLimit>0?S(w):!1,onClick:e.withModifiers(ee=>V(w),["stop"]),value:i.value?w:w[o.labelValue.value]},null,8,["label","disabled","onClick","value"]))),128))]),_:3},16,["modelValue","filter-method","onClear"]))}}},[["__scopeId","data-v-d12f3c20"]]),ro="",St=e.defineComponent({props:{name:{tyepe:String,required:!0}}});function $t(o,t,n,r,s,l){const a=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(a,{class:"cmp-icon"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.name)))]),_:1})}const ke=ue(St,[["render",$t],["__scopeId","data-v-733f9daa"]]),Vt={__name:"index",emits:["ok","no"],setup(o,{emit:t}){const n=t,r=te.debounce(()=>{n("ok")},500);function s(){n("no")}return(l,a)=>{const i=e.resolveComponent("el-popconfirm");return e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(l.$attrs.class)},[e.createVNode(i,e.mergeProps(l.$attrs,{onConfirm:e.unref(r),onCancel:s}),{reference:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16,["onConfirm"])],2)}}},so="",Et=["accept"],Tt=ue({__name:"index",props:{accept:{type:String,default:".xlsx,.xls"},fields:{type:Object,default:()=>({})},fileChange:{type:Function,required:!0}},emits:["fileChange"],setup(o,{emit:t}){const n=o,r=e.ref(null),s=e.ref(!1);async function l(a){s.value=!0;let i=a.target.files[0];const c=await ct(i,n.fields).catch(()=>{s.value=!1}).finally(()=>{r.value.value=null});await n.fileChange(c).finally(()=>{s.value=!1})}return(a,i)=>{const c=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("span",null,[e.createVNode(c,{loading:s.value,class:"mgr10",onClick:i[0]||(i[0]=b=>r.value.click())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("dao-ru")),1)]),_:1},8,["loading"]),e.createElementVNode("input",{onChange:l,ref_key:"input",ref:r,accept:o.accept,style:{position:"absolute",width:"0px",height:"0px",opacity:"0"},type:"file"},null,40,Et)])}}},[["__scopeId","data-v-6f9ede29"]]);function _e(o){let t={};return o.forEach(n=>{const{key:r,type:s,option:l={},value:a,dateType:i="date"}=n;if(r)if(s=="input"&&(l!=null&&l.multiple))t[r]=be(a);else if(s=="date")if(i.includes("range")){const[c,b]=r;let[k,x]=a||[];k&&i=="daterange"&&(k=ce(k).format("YYYY-MM-DD 00:00:00"),x=ce(x).format("YYYY-MM-DD 23:59:59")),t[c]=k,t[b]=x}else t[r]=a;else t[r]=a}),t}const co="",It={key:0},Lt={class:"btns"},vt={class:"left"},Ft={class:"right"},Ne=ue({__name:"index",props:{form:{type:Object,required:!0}},emits:["confirm","reset","visibleChange"],setup(o,{expose:t,emit:n}){const r=o,s=n,l=e.ref(!0),a=e.ref(null),{t:i}=X.useI18n(),c=e.computed(()=>l.value?i("guan-bi"):i("zhan-kai"));function b(){s("confirm")}function k(m){m.option.onClear&&m.option.onClear(),s("confirm")}function x(){s("reset")}function C(){s("confirm")}function p(){return _e(r.form.items)}const g=te.cloneDeep(r.form.items);function u(){r.form.items.forEach(m=>{const $=g.find(V=>V.key==m.key);$&&(m.value=$.value)})}return t({getPrm:p,reset:u}),(m,$)=>{const V=e.resolveComponent("el-input"),S=e.resolveComponent("el-date-picker"),T=e.resolveComponent("el-form-item"),I=e.resolveComponent("el-form"),A=e.resolveComponent("el-link"),v=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",{class:"searchBar-container mgt10 mgb10",onKeydown:e.withKeys(b,["enter"])},[e.createElementVNode("div",{class:"searchBar",style:e.normalizeStyle({height:l.value?"auto":"42px"})},[e.createVNode(I,{inline:"",model:o.form.data},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.form.items.filter(f=>!f.hidden),f=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:f.key},[f.type=="br"?(e.openBlock(),e.createElementBlock("br",It)):(e.openBlock(),e.createBlock(T,{key:1,label:f.name},{default:e.withCtx(()=>{var _,D;return[f.type==="input"?(e.openBlock(),e.createBlock(V,{key:0,modelValue:f.value,"onUpdate:modelValue":M=>f.value=M,class:e.normalizeClass(((_=f.option)==null?void 0:_.class)||"w150"),placeholder:m.$t("qing-shu-ru"),clearable:""},null,8,["modelValue","onUpdate:modelValue","class","placeholder"])):f.type==="custom"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f.render),{key:1})):e.createCommentVNode("",!0),f.type==="select"?(e.openBlock(),e.createBlock(qe,e.mergeProps({key:2,class:((D=f.option)==null?void 0:D.class)||"w150",modelValue:f.value,"onUpdate:modelValue":M=>f.value=M},{ref_for:!0},f.option,{onChange:b,onClear:M=>k(f)}),null,16,["class","modelValue","onUpdate:modelValue","onClear"])):e.createCommentVNode("",!0),f.type==="date"?(e.openBlock(),e.createBlock(S,{key:3,class:e.normalizeClass({datetimerange:"w300",daterange:"w200"}[f.dateType]||"w100"),modelValue:f.value,"onUpdate:modelValue":M=>f.value=M,"value-format":{datetimerange:"YYYY-MM-DD HH:mm:ss",daterange:"YYYY-MM-DD"}[f.dateType]||"YYYY-MM-DD",type:f.dateType||"date",onFocus:M=>a.value=f,onChange:M=>C(),placeholder:m.$t("qing-xuan-ze"),"start-placeholder":m.$t("kai-shi-shi-jian"),"end-placeholder":m.$t("jie-shu-shi-jian")},null,8,["class","modelValue","onUpdate:modelValue","value-format","type","onFocus","onChange","placeholder","start-placeholder","end-placeholder"])):e.createCommentVNode("",!0)]}),_:2},1032,["label"]))],64))),128))]),_:1},8,["model"])],4),e.createElementVNode("div",Lt,[e.createElementVNode("div",vt,[e.renderSlot(m.$slots,"table-header-left",{},void 0,!0)]),e.createElementVNode("div",Ft,[e.createVNode(A,{underline:"never",class:"mgr10",onClick:$[0]||($[0]=()=>{s("visibleChange",!l.value),l.value=!l.value})},{default:e.withCtx(()=>[e.createVNode(ke,{name:l.value?"ArrowUp":"ArrowDown"},null,8,["name"]),e.createTextVNode(" "+e.toDisplayString(c.value),1)]),_:1}),e.createVNode(v,{type:"primary",onClick:b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.$t("shai-xuan")),1)]),_:1}),e.createVNode(v,{type:"primary",onClick:x},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.$t("chong-zhi")),1)]),_:1}),e.renderSlot(m.$slots,"btn",{},void 0,!0)])])],32)}}},[["__scopeId","data-v-3c0a6716"]]),Ae={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 fe={...Ae};function Dt(o){fe={...fe,...o,responseDataKeys:{...fe.responseDataKeys,...o.responseDataKeys||{}}}}function je(){return fe}function Bt(){fe={...Ae}}const fo="",zt={class:"center"},Mt=ue({__name:"index",props:{id:{type:String,required:!1},loading:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0},searchForm:{type:Object,default:()=>({items:[],selections:[]})},api:{type:Function},data:{type:Array},tableConfig:{type:Object,default:()=>({})}},setup(o,{expose:t}){const{t:n,locale:r}=X.useI18n(),s=Le.useRoute(),l=je(),a=o,i=e.ref(!1),c=e.ref([]);a.searchForm.showSearch===void 0&&(a.searchForm.showSearch=l.showSearch),a.searchForm.showPage===void 0&&(a.searchForm.showPage=l.showPage),a.searchForm.showShadow===void 0&&(a.searchForm.showShadow=l.showShadow),a.searchForm.showCheckBox===void 0&&(a.searchForm.showCheckBox=l.showCheckBox),a.searchForm.enableCellCopy===void 0&&(a.searchForm.enableCellCopy=l.enableCellCopy),a.searchForm.selections||(a.searchForm.selections=[]);const b=e.computed(()=>{const h=s.path.replace(/\//g,"-").replace(/^-/,"")||"default-table";return a.id?`listPageId-${h}-${a.id}`:`listPageId-${h}`}),k=te.cloneDeep(a.searchForm.items),x=a.searchForm.pageNoKey||l.pageNoKey,C=a.searchForm.pageSizeKey||l.pageSizeKey,p=e.reactive({[x]:1,[C]:a.searchForm.defaultPageSize||l.defaultPageSize,total:0}),g=e.ref(null),u=e.ref(null),m=e.ref(450),$=te.debounce(()=>{e.nextTick(()=>{if(!u.value)return;const d=u.value.getBoundingClientRect(),E=window.innerHeight,F=d.top,q=100,U=E-F-q,B=200;m.value=Math.max(U,B)})},100),V=()=>{$()},S=()=>{if(!a.searchForm.enableCellCopy)return!1;const h=g.value;if(!h||!h.$el)return!1;const d=h.$el;return d.classList.add("cell-copy-enabled"),d.setAttribute("tabindex","-1"),d.removeEventListener("mousedown",ee),d.removeEventListener("mousemove",ie),d.removeEventListener("mouseup",he),d.removeEventListener("keydown",Ee),d.addEventListener("mousedown",ee),d.addEventListener("mousemove",ie),d.addEventListener("mouseup",he),d.addEventListener("keydown",Ee),!0};e.onMounted(()=>{$(),window.addEventListener("resize",V),a.searchForm.enableCellCopy&&(document.addEventListener("mouseup",Ke),document.addEventListener("mousedown",We),setTimeout(()=>{S()},500))}),e.onUpdated(()=>{a.searchForm.enableCellCopy&&setTimeout(()=>{S()},500)}),e.onUnmounted(()=>{if(window.removeEventListener("resize",V),a.searchForm.enableCellCopy){document.removeEventListener("mouseup",Ke),document.removeEventListener("mousedown",We);const h=g.value;if(h&&h.$el){const d=h.$el;d.removeEventListener("mousedown",ee),d.removeEventListener("mousemove",ie),d.removeEventListener("mouseup",he),d.removeEventListener("keydown",Ee)}}});const T=e.computed(()=>ne.value.height||m.value);let I;async function A(h){const{dataFormat:d}=a.tableConfig;h[x]!=1&&(h.nextSearchAfter=I),i.value=!0;const{code:E,data:F={}}=await a.api(h).finally(()=>{i.value=!1,a.searchForm.selections=[]});if(E==200){let q=[];for(const B of l.responseDataKeys.rows)if(F[B]){q=F[B];break}let U=0;for(const B of l.responseDataKeys.total)if(F[B]!==void 0){U=F[B];break}c.value=d?d(q):q,p.total=U,I=F.nextSearchAfter,a.searchForm.enableCellCopy&&e.nextTick(()=>{setTimeout(()=>{S()},100)})}}function v(h={}){const{searchData:d=()=>({})}=a.tableConfig,E=d();A({...p,..._e(a.searchForm.items),...h,...E})}function f(){const{reset:h}=a.tableConfig;h&&h(),a.searchForm.items.forEach(d=>{const E=k.find(F=>te.isArray(d.key)&&te.isArray(F.key)?d.key.join(",")==F.key.join(","):F.key==d.key);E&&(d.value=E.value)}),v()}a.api&&a.immediate&&v();function _(){return{...p,..._e(a.searchForm.items)}}const D=()=>{const h=g.value;h&&h.clearSort()},M=e.reactive({storage:!0}),G=e.reactive({drag:!0,resizable:!0,maxFixedSize:0}),ne=e.computed(()=>{const{customConfig:h,columnConfig:d,...E}=a.tableConfig;return{headerAlign:"left",align:"center",customConfig:{...M,...h},columnConfig:{...G,...d},"virtual-x-config":{enabled:!1,scrollToLeftOnChange:!1},"virtual-y-config":{enabled:!0,gt:100},...E}}),w=e.reactive({isSelecting:!1,startCell:null,endCell:null,selectedCells:[]}),se=h=>{const d=h.closest(".vxe-body--column");if(!d||d.classList.contains("col--checkbox")||d.classList.contains("col--seq"))return null;const E=d.closest(".vxe-body--row");if(!E)return null;const F=g.value;if(!F)return null;let q=-1;const U=E.getAttribute("data-rowid");if(U!=null)q=parseInt(U,10);else{const z=E.parentElement;q=Array.from(z.querySelectorAll(".vxe-body--row")).indexOf(E)}if(q<0)return null;let B=-1;const J=d.getAttribute("data-colid");if(J&&(B=F.getColumns().findIndex(L=>L.id===J)),B<0){const L=Array.from(E.querySelectorAll(".vxe-body--column")).indexOf(d),j=!!d.closest(".vxe-table--fixed-left-wrapper"),P=!!d.closest(".vxe-table--fixed-right-wrapper"),N=F.getColumns();if(j){const Y=N.filter(R=>R.fixed==="left");L<Y.length&&(B=N.indexOf(Y[L]))}else if(P){const Y=N.filter(R=>R.fixed==="right");L<Y.length&&(B=N.indexOf(Y[L]))}else{const Y=a.searchForm.showCheckBox?1:0;B=N.filter(K=>K.fixed==="left").length+L-Y}}return B<0?null:{rowIndex:q,colIndex:B,cell:d}},ee=h=>{const d=se(h.target);if(!d){Ve();return}w.isSelecting=!0,w.startCell={rowIndex:d.rowIndex,colIndex:d.colIndex},w.endCell={...w.startCell},Ye(),He()},ie=h=>{if(!w.isSelecting)return;const d=se(h.target);d&&(w.endCell={rowIndex:d.rowIndex,colIndex:d.colIndex},Ye(),He())},he=()=>{w.isSelecting=!1},Ve=()=>{w.selectedCells=[],w.startCell=null,w.endCell=null;const h=g.value;if(!h)return;h.$el.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(E=>{E.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")})},Ye=()=>{if(!w.startCell||!w.endCell){w.selectedCells=[];return}const h=w.startCell.rowIndex,d=w.endCell.rowIndex,E=w.startCell.colIndex,F=w.endCell.colIndex,q=Math.min(h,d),U=Math.max(h,d),B=Math.min(E,F),J=Math.max(E,F);w.selectedCells=[];for(let z=q;z<=U;z++)for(let L=B;L<=J;L++)w.selectedCells.push({rowIndex:z,colIndex:L})},He=()=>{e.nextTick(()=>{const h=g.value;if(!h)return;const d=h.$el;if(d.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(j=>{j.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")}),w.selectedCells.length===0)return;const E=h.getColumns(),F=w.selectedCells.map(j=>j.rowIndex),q=w.selectedCells.map(j=>j.colIndex),U=Math.min(...F),B=Math.max(...F),J=Math.min(...q),z=Math.max(...q),L=[d.querySelector(".vxe-table--body-wrapper tbody"),d.querySelector(".vxe-table--fixed-left-wrapper tbody"),d.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean);w.selectedCells.forEach(({rowIndex:j,colIndex:P})=>{const N=E[P];if(!N)return;const Y=N.fixed==="left",R=N.fixed==="right";for(const K of L){const me=K.querySelectorAll(".vxe-body--row")[j];if(!me)continue;const le=Array.from(me.querySelectorAll(".vxe-body--column"));let O=null;if(Y&&K.closest(".vxe-table--fixed-left-wrapper")){const W=E.filter(Z=>Z.fixed==="left").indexOf(N);O=le[W]}else if(R&&K.closest(".vxe-table--fixed-right-wrapper")){const W=E.filter(Z=>Z.fixed==="right").indexOf(N);O=le[W]}else if(!Y&&!R&&K.closest(".vxe-table--body-wrapper")){const ae=a.searchForm.showCheckBox?1:0,W=E.filter(Te=>Te.fixed==="left").length,Z=P-W;O=le[Z+ae]}if(O&&!O.classList.contains("col--checkbox")&&!O.classList.contains("col--seq")){O.classList.add("cell-selected"),j===U&&O.classList.add("cell-border-top"),j===B&&O.classList.add("cell-border-bottom"),P===J&&O.classList.add("cell-border-left"),P===z&&O.classList.add("cell-border-right");break}}})})},eo=async()=>{if(w.selectedCells.length===0)return;const h=g.value;if(!h)return;const d=h.$el,E=h.getColumns(),F=[...new Set(w.selectedCells.map(z=>z.rowIndex))].sort((z,L)=>z-L),q=[...new Set(w.selectedCells.map(z=>z.colIndex))].sort((z,L)=>z-L),U=[d.querySelector(".vxe-table--body-wrapper tbody"),d.querySelector(".vxe-table--fixed-left-wrapper tbody"),d.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean),B=[];F.forEach(z=>{const L=[];q.forEach(j=>{const P=E[j];if(!P){L.push("");return}const N=P.fixed==="left",Y=P.fixed==="right";let R="";for(const K of U){const me=K.querySelectorAll(".vxe-body--row")[z];if(!me)continue;const le=Array.from(me.querySelectorAll(".vxe-body--column"));let O=null;if(N&&K.closest(".vxe-table--fixed-left-wrapper")){const W=E.filter(Z=>Z.fixed==="left").indexOf(P);O=le[W]}else if(Y&&K.closest(".vxe-table--fixed-right-wrapper")){const W=E.filter(Z=>Z.fixed==="right").indexOf(P);O=le[W]}else if(!N&&!Y&&K.closest(".vxe-table--body-wrapper")){const ae=a.searchForm.showCheckBox?1:0,W=E.filter(Te=>Te.fixed==="left").length,Z=j-W;O=le[Z+ae]}if(O&&!O.classList.contains("col--checkbox")&&!O.classList.contains("col--seq")){R=O.innerText||O.textContent||"",R=R.trim(),R=R.replace(/\n/g," ").replace(/\s+/g," ");break}}L.push(R)}),B.push(L.join(" "))});const J=B.join(`
|
|
1
|
+
(function(y,H){typeof exports=="object"&&typeof module<"u"?H(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"],H):(y=typeof globalThis<"u"?globalThis:y||self,H(y.JoyAdminComponents={},y.ElementPlus,y.Vue,y.fileSaver,y.ExcelJS,y.dayjs,y.VueI18n,y._,y.VueRouter,y.Vuex,y.VxeUI))})(this,function(y,H,e,Ie,ge,ce,X,te,Le,Q,de){"use strict";const Je=e.defineComponent({name:"LayOutForm",setup(o,{slots:t,attrs:n,emit:r}){const s=e.ref(null),l=()=>t.default?t.default().filter(i=>i.type!==Symbol.for("v-cmt")).map(i=>i.type===Symbol.for("v-fgt")?i.children:i).flat().map(i=>{var c;return e.h(H.ElCol,{span:((c=i.props)==null?void 0:c.span)||24},{default:()=>i})}):null;e.onMounted(()=>{r("ref",s.value)});function a(){return e.h(H.ElForm,{...n,ref:s},()=>e.h(H.ElRow,{gutter:n.gutter??20},{default:()=>l()}))}return a}});var ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fe(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var De={exports:{}};(function(o,t){(function(n,r){o.exports=r()})(ve,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(l,a,i){var c=a.prototype;i.utc=function(u){var m={date:u,utc:!0,args:arguments};return new a(m)},c.utc=function(u){var m=i(this.toDate(),{locale:this.$L,utc:!0});return u?m.add(this.utcOffset(),n):m},c.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var b=c.parse;c.parse=function(u){u.utc&&(this.$u=!0),this.$utils().u(u.$offset)||(this.$offset=u.$offset),b.call(this,u)};var k=c.init;c.init=function(){if(this.$u){var u=this.$d;this.$y=u.getUTCFullYear(),this.$M=u.getUTCMonth(),this.$D=u.getUTCDate(),this.$W=u.getUTCDay(),this.$H=u.getUTCHours(),this.$m=u.getUTCMinutes(),this.$s=u.getUTCSeconds(),this.$ms=u.getUTCMilliseconds()}else k.call(this)};var x=c.utcOffset;c.utcOffset=function(u,m){var $=this.$utils().u;if($(u))return this.$u?0:$(this.$offset)?x.call(this):this.$offset;if(typeof u=="string"&&(u=function(I){I===void 0&&(I="");var A=I.match(r);if(!A)return null;var v=(""+A[0]).match(s)||["-",0,0],f=v[0],_=60*+v[1]+ +v[2];return _===0?0:f==="+"?_:-_}(u),u===null))return this;var V=Math.abs(u)<=16?60*u:u;if(V===0)return this.utc(m);var S=this.clone();if(m)return S.$offset=V,S.$u=!1,S;var T=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(S=this.local().add(V+T,n)).$offset=V,S.$x.$localOffset=T,S};var C=c.format;c.format=function(u){var m=u||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return C.call(this,m)},c.valueOf=function(){var u=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*u},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var p=c.toDate;c.toDate=function(u){return u==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():p.call(this)};var g=c.diff;c.diff=function(u,m,$){if(u&&this.$u===u.$u)return g.call(this,u,m,$);var V=this.local(),S=i(u).local();return g.call(V,S,m,$)}}})})(De);var Xe=De.exports;const Qe=Fe(Xe);var Be={exports:{}};(function(o,t){(function(n,r){o.exports=r()})(ve,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(s,l,a){var i,c=function(C,p,g){g===void 0&&(g={});var u=new Date(C),m=function($,V){V===void 0&&(V={});var S=V.timeZoneName||"short",T=$+"|"+S,I=r[T];return I||(I=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:S}),r[T]=I),I}(p,g);return m.formatToParts(u)},b=function(C,p){for(var g=c(C,p),u=[],m=0;m<g.length;m+=1){var $=g[m],V=$.type,S=$.value,T=n[V];T>=0&&(u[T]=parseInt(S,10))}var I=u[3],A=I===24?0:I,v=u[0]+"-"+u[1]+"-"+u[2]+" "+A+":"+u[4]+":"+u[5]+":000",f=+C;return(a.utc(v).valueOf()-(f-=f%1e3))/6e4},k=l.prototype;k.tz=function(C,p){C===void 0&&(C=i);var g,u=this.utcOffset(),m=this.toDate(),$=m.toLocaleString("en-US",{timeZone:C}),V=Math.round((m-new Date($))/1e3/60),S=15*-Math.round(m.getTimezoneOffset()/15)-V;if(!Number(S))g=this.utcOffset(0,p);else if(g=a($,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(S,!0),p){var T=g.utcOffset();g=g.add(u-T,"minute")}return g.$x.$timezone=C,g},k.offsetName=function(C){var p=this.$x.$timezone||a.tz.guess(),g=c(this.valueOf(),p,{timeZoneName:C}).find(function(u){return u.type.toLowerCase()==="timezonename"});return g&&g.value};var x=k.startOf;k.startOf=function(C,p){if(!this.$x||!this.$x.$timezone)return x.call(this,C,p);var g=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return x.call(g,C,p).tz(this.$x.$timezone,!0)},a.tz=function(C,p,g){var u=g&&p,m=g||p||i,$=b(+a(),m);if(typeof C!="string")return a(C).tz(m);var V=function(A,v,f){var _=A-60*v*1e3,D=b(_,f);if(v===D)return[_,v];var M=b(_-=60*(D-v)*1e3,f);return D===M?[_,D]:[A-60*Math.min(D,M)*1e3,Math.max(D,M)]}(a.utc(C,u).valueOf(),$,m),S=V[0],T=V[1],I=a(S).utcOffset(T);return I.$x.$timezone=m,I},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(C){i=C}}})})(Be);var et=Be.exports;const tt=Fe(et),pe={"dao-ru":"导入","quan-xuan":"全选","xia-zai-dao-ru-mo-ban":"下载导入模板","xu-hao":"序号","qing-shu-ru":"请输入","qing-xuan-ze":"请选择","kai-shi-shi-jian":"开始时间","jie-shu-shi-jian":"结束时间","shai-xuan":"筛选","chong-zhi":"重置","guan-bi":"关闭","zhan-kai":"展开","qu-xiao":"取消","ti-jiao":"提交","que-ding":"确定","que-ding-guan-bi-ma":"确定关闭吗","xia-zai-dao-ru-mo-ban":"下载导入模板",excel:{fieldsMappingRequired:"请输入列字段映射",invalidInput:"非法输入",invalidOption:"请输入有效选项!",copyFailed:"复制失败",sheetNameTooLong:'Sheet名称 "{0}" 长度超过31个字符,已自动截断为 "{1}"'},validate:{invalidInput:"请输入正确内容"},tools:{keysLengthError:"keys 长度必须大于2 默认前两位为 label value"}},ye={"dao-ru":"Import","quan-xuan":"Select All","xia-zai-dao-ru-mo-ban":"Download Import Template","xu-hao":"No.","qing-shu-ru":"Please enter","qing-xuan-ze":"Please select","kai-shi-shi-jian":"Start Time","jie-shu-shi-jian":"End Time","shai-xuan":"Filter","chong-zhi":"Reset","guan-bi":"Collapse","zhan-kai":"Expand","qu-xiao":"Cancel","ti-jiao":"Submit","que-ding":"Confirm","que-ding-guan-bi-ma":"Are you sure to close?","xia-zai-dao-ru-mo-ban":"Download Import Template",excel:{fieldsMappingRequired:"Please enter column field mapping",invalidInput:"Invalid input",invalidOption:"Please enter a valid option!",copyFailed:"Copy failed",sheetNameTooLong:'Sheet name "{0}" exceeds 31 characters, automatically truncated to "{1}"'},validate:{invalidInput:"Please enter valid content"},tools:{keysLengthError:"Keys length must be greater than 2, default first two are label and value"}},ze={zh_cn:pe,en_us:ye};let re=null;function Me(o=null){if(o){const{global:t}=o;return t.messages.value.zh_cn?t.mergeLocaleMessage("zh_cn",pe):t.setLocaleMessage("zh_cn",pe),t.messages.value.en_us?t.mergeLocaleMessage("en_us",ye):t.setLocaleMessage("en_us",ye),re=o,o}return re||(re=X.createI18n({legacy:!1,locale:"zh_cn",fallbackLocale:"zh_cn",messages:ze})),re}function Ce(){return re||Me()}function oe(){return Ce().global.t}ce.extend(Qe),ce.extend(tt);async function ot(o,t){const{fields:n,range:r=1}=t;if(!n){const a=oe();throw new Error(a("excel.fieldsMappingRequired"))}let s=new ge.Workbook;await s.xlsx.load(o);const l={};return s.eachSheet(function(a,i){const c=[];a.eachRow(function(b,k){if(k>r){let x={},C=!0;Object.keys(n).forEach(p=>{const g=b.getCell(n[p]).value;x[p]=g,g&&(C=!1)}),C||c.push(x)}}),l[a._name]=c}),s=null,l}const Oe={columnWidth:30};async function nt(o,t,n=[],r={}){if(!o||!t)return;const{columnStyle:s}=r,{columnWidth:l}=Oe;t.forEach(c=>{c.width=c.width?c.width:l});const{workbook:a,worksheet:i}=lt();i.columns=t,i.addRows(n),s&&await at(a,i,s);try{const c=await a.xlsx.writeBuffer(),b=new File([c],o,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Ie.saveAs(b)}catch(c){console.log(c)}}function lt(){const o=new ge.Workbook;o.creator="distributor System",o.lastModifiedBy="distributor System",o.created=new Date,o.modified=new Date,o.lastPrinted=new Date;const t=o.addWorksheet("Sheet1");return{workbook:o,worksheet:t}}async function at(o,t,n){const r=Object.keys(n);for(const s of r){const l=n[s],{type:a}=l;switch(a){case"IMG":await rt(o,t,s);break}}}async function rt(o,t,n,r){const s=t.getColumn(n),l=s.values;t.getColumn(n).width=20,t.eachRow((a,i)=>{i>1&&(a.height=40)});for(let a=0,i=l.length;a<i;a++){if(a<2)continue;let c=l[a];c&&(t.getCell(s.letter+a).value="",await st(o,t,c,{width:100,height:50,col:s._number-1,row:a-1}))}}async function st(o,t,n,r){const{col:s,row:l,width:a,height:i}=r,{success:c,base64:b}=await it(n,.3);if(c){const k=o.addImage({base64:b,extension:"jpeg"});t.addImage(k,{tl:{col:s,row:l},ext:{width:a,height:i}})}}function it(o,t=1){const n=new Image;return n.setAttribute("crossOrigin","anonymous"),n.crossOrigin="anonymous",n.src=o,new Promise((r,s)=>{n.onload=()=>{const l=document.createElement("canvas");l.width=n.width,l.height=n.height,l.getContext("2d").drawImage(n,0,0,l.width,l.height),r({success:!0,base64:l.toDataURL("image/jpeg",t)})},n.onerror=()=>{r({success:!1})}})}const we="---";async function ct(o,t){const{fields:n,range:r=1}=t;if(!n){const a=oe();throw new Error(a("excel.fieldsMappingRequired"))}let s=new ge.Workbook;await s.xlsx.load(o);const l={};return s.eachSheet(function(a,i){if(a.state=="visible"){const c=[],b=n[a._name];if(b){let k=Object.values(b).some(C=>C.includes("image")),x={};k&&(a.getImages().forEach(p=>{const{tl:g}=p.range,u=s.model.media.find(m=>m.index===p.imageId);if(u){const m=u.buffer.toString("base64"),$=`data:image/${u.extension};base64,${m}`,V=`${Math.ceil(g.row)}_${Math.ceil(g.col)}`;x[V]?x[V].push($):x[V]=[$]}}),console.log("withImages-imageMap",x)),a.eachRow(function(C,p){if(p>r){let g={},u=!0;Object.keys(b).forEach(m=>{var I;let[$,V]=b[m].split(we);const S=C.getCell($);let T;if(V=="image"&&k){const A=S._column._number,v=`${p}_${A}`;T=x[v]||""}else S.result!=null?T=S.result:(I=S.value)!=null&&I.richText?T=S.value.richText.reduce((A,v)=>A+v.text,""):S.type==4&&S.value?T=ce(S.value).utc().format("YYYY-MM-DD HH:mm:ss"):T=S.value;T&&V=="option"&&(T=T.split(we)[1]),g[m]=T,T&&(u=!1)}),u||c.push(g)}}),l[a._name]=c}}}),s=null,l}async function dt(o,t){if(!o||t.length==0)return;const n=ut(t);n.eachSheet(function(r,s){const{columnWidth:l}=Oe,{tableHeader:a,tableData:i}=t[r._name];a.forEach(c=>{if(c.required){const b=c.style||{},{font:k={}}=b;c.style={...b,font:{...k,color:{argb:"FFFF0000"}}}}}),r.columns=a,r.addRows(i),a.forEach(c=>{const{header:b,key:k,width:x,option:C}=c,p=r.getColumn(k);if(p.width=x||l,C){const g=n.addWorksheet(k);g.state="hidden",g.getColumn(1).values=C.map(u=>`${u.label}${we}${u.value}`),Array(100).fill("").forEach((u,m)=>{if(m>0){const $=oe();r.getCell(`${p.letter}${m}`).dataValidation={type:"list",formulae:[`${k}!$A$1:$A$${C.length}`],showErrorMessage:!0,error:$("excel.invalidInput"),errorStyle:"stop",errorMessage:$("excel.invalidOption")}}})}})});try{const r=await n.xlsx.writeBuffer(),s=new File([r],o,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Ie.saveAs(s)}catch(r){console.log(r)}}function ut(o){const t=oe(),n=new ge.Workbook;return n.creator="distributor System",n.lastModifiedBy="distributor System",n.created=new Date,n.modified=new Date,n.lastPrinted=new Date,Object.keys(o).sort((s,l)=>{const a=o[s].sort??0,i=o[l].sort??0;return a-i}).forEach(s=>{let l=s,a=!1;/[\\/:*?\[\]]/g.test(s)&&(s=s.replace(/[\\/:*?\[\]]/g,""),a=!0),s.length>31&&(s=s.substring(0,31).trim(),a=!0,console.warn(t("excel.sheetNameTooLong",[l,s]))),a&&(o[s]=o[l],delete o[l]),n.addWorksheet(s)}),n}function ft(o){if(o<26)return String.fromCharCode(65+o);{const t=String.fromCharCode(65+Math.floor((o-26)/26)),n=String.fromCharCode(65+(o-26)%26);return t+n}}function ht(o){return new Promise(t=>{setTimeout(()=>{t()},o)})}function mt(o){return JSON.parse(JSON.stringify(o))}function gt(o){let t=[],n={},r=(s,l)=>Object.prototype.hasOwnProperty.call(s,l);for(const s of o){n[s.id]={...s,children:r(n,s.id)?n[s.id].children:[]};const l=n[s.id];s.pid==-1?t.push(l):(r(n,s.pid)||(n[s.pid]={children:[]}),n[s.pid].children.push(l))}return t}function be(o,t=" "){return o?o.split(t).filter(n=>n.trim()):[]}class xe{constructor(t,n=["label","value","labelEn"]){this.list=t.map(r=>({...r,label:r[n[0]],labelEn:r[n[2]]||r[n[0]]||"",value:r[n[1]]})),this.map=new Map(this.list.map(r=>[r[n[1]],r]))}getName(t){if(!this.has(t))return"-";const n=Ce().global.locale,{label:r,labelEn:s}=this.map.get(t);return(n.value=="zh_cn"?r:s)||r||"-"}getTag(t){if(!this.has(t))return"info";const{tag:n="info"}=this.map.get(t);return n}getItem(t){return this.has(t)?this.map.get(t):null}getColor(t){if(!this.has(t))return null;const{color:n}=this.map.get(t);return n}has(t){return this.map.has(t)}}function pt(o,t=[],n="i18nName"){if(o.length==0)return new xe([]);if(t.length<2){const s=oe();throw new Error(s("tools.keysLengthError"))}let r=o.map(s=>{let l={};return n&&(l.labelEn=s[n]),t.forEach((a,i)=>{i===0?l.label=s[a]:i===1?l.value=s[a]:l[a]=s[a]}),l});return new xe(r)}function yt(o){return o?o.replace(/<[^>]+>/g,""):""}function Ct(o){return o?(o.includes("\\\\u")&&(o=o.replace(/\\/g,"")),o.replace(/\\u[\dA-F]{4}/gi,t=>String.fromCharCode(parseInt(t.replace(/\\u/g,""),16)))):""}function wt(o,t=10){let n=1048576*t;return!(o.size>n)}function bt(o){return Array.from(10).fill(0).map((n,r)=>o+"_"+r)}function xt(o){let t={};return o.map((n,r)=>{let{key:s,option:l,type:a}=n,i=ft(r);l?t[s]=`${i}---option`:a==="image"?t[s]=`${i}---image`:t[s]=i}),t}function kt(o,t){return t.split(".").reduce((n,r)=>n&&n[r],o)}const lo="",ue=(o,t)=>{const n=o.__vccOpts||o;for(const[r,s]of t)n[r]=s;return n},_t=["onClick"],qe=ue({__name:"index",props:e.mergeModels({api:{type:Function},showCheckAll:{type:Boolean,default:!0},maxLimit:{type:Number,default:void 0},optionClick:{type:Function,default:()=>{}},data:{type:Array},labelValue:{type:Object,default:()=>({label:"label",labelEn:"labelEn",value:"value"})},changeLocal:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["success","change","changeAll"],["update:modelValue"]),setup(o,{emit:t}){const n=o,r=e.useAttrs(),{t:s,locale:l}=X.useI18n(),a=e.useModel(o,"modelValue"),i=e.computed(()=>r["value-key"]!=null),c=e.ref(""),b=e.computed(()=>{if(r.remote!==void 0)return n.data;const f=be(c.value),{data:_,labelValue:D}=n,M=_||C.value;if(f.length==0)return M;const{label:G,labelEn:ne}=D;let w=l.value=="en_us"?ne||"i18nName":G;return f.length==1?M.filter(ee=>ee[w].toLowerCase().includes(f[0].toLowerCase())):M.filter(ee=>{let ie=!1;return ie=f.some(he=>ee[w].toLowerCase()==he.toLowerCase()),ie})}),k=e.computed({get(){return r.multiple==null||a.value==null?!1:a.value.length==b.value.length},set(f){return f}}),x=t,C=e.ref([]),p=async()=>{const{data:f}=await n.api();C.value=[...f],x("success",C)};n.api&&p();function g(f){x("change",f)}const u=n.labelValue.label.split("-"),m=f=>{if(u.length==1){if(n.changeLocal)return s(f[n.labelValue.label]);let _=l.value=="en_us"?f[n.labelValue.labelEn||"i18nName"]:f[n.labelValue.label];return _=_||f[n.labelValue.label],_}else{let _=[];return u.forEach(D=>{_.push(f[D])}),_.join("-")}};function $(f){let _=n.data?n.data:C.value;a.value=f?_.map(D=>i.value?D:D[n.labelValue.value]):[],e.nextTick(()=>{x("change",a.value),x("changeAll",a.value,_)})}function V(f){n.optionClick&&n.optionClick(f),x("change",i.value?f:f[n.labelValue.value])}function S(f){return a.value.length>=n.maxLimit&&!a.value.includes(f[n.labelValue.value])}function T(f){return f.map(_=>({..._,label:m(_),value:i.value?_:_[n.labelValue.value]}))}const I=e.ref([]),A=n.data?n.data:C.value;I.value=T(A),e.watch(()=>n.data?n.data:C.value,f=>{var D;const _=T(f);if(_.length!==I.value.length)I.value=_;else{let M=!1;for(let G=0;G<_.length;G++)if(_[G].value!==((D=I.value[G])==null?void 0:D.value)){M=!0;break}M&&(I.value=_)}},{deep:!0});const v=e.computed(()=>I.value);return(f,_)=>{const D=e.resolveComponent("el-checkbox"),M=e.resolveComponent("el-select-v2"),G=e.resolveComponent("el-option"),ne=e.resolveComponent("el-select");return e.unref(r).v2!=null?(e.openBlock(),e.createBlock(M,e.mergeProps({key:0,options:v.value,modelValue:a.value,"onUpdate:modelValue":_[1]||(_[1]=w=>a.value=w)},e.unref(r),{filterable:"","collapse-tags":"","collapse-tags-tooltip":"",clearable:"",onChange:g,onClear:g}),e.createSlots({default:e.withCtx(({item:w})=>[e.createElementVNode("div",{onClick:se=>V(w)},e.toDisplayString(w.label),9,_t)]),_:2},[e.unref(r).multiple!=null?{name:"header",fn:e.withCtx(()=>[e.renderSlot(f.$slots,"header",{},()=>[e.createVNode(D,{class:"mgl20",modelValue:k.value,"onUpdate:modelValue":_[0]||(_[0]=w=>k.value=w),onChange:$},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0)]),key:"0"}:void 0]),1040,["options","modelValue"])):(e.openBlock(),e.createBlock(ne,e.mergeProps({key:1,modelValue:a.value,"onUpdate:modelValue":_[3]||(_[3]=w=>a.value=w),filterable:"","collapse-tags":"","collapse-tags-tooltip":"","filter-method":e.unref(r).remote!=null?void 0:w=>c.value=w,clearable:""},e.unref(r),{onClear:o.optionClick}),{default:e.withCtx(()=>[e.unref(r).multiple!=null&&o.showCheckAll&&o.maxLimit==null?e.renderSlot(f.$slots,"header",{key:0},()=>[e.createVNode(D,{class:"mgl20",modelValue:k.value,"onUpdate:modelValue":_[2]||(_[2]=w=>k.value=w),onChange:$},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(w,se)=>(e.openBlock(),e.createBlock(G,{key:se,label:m(w),disabled:e.unref(r).multiple!=null&&o.maxLimit>0?S(w):!1,onClick:e.withModifiers(ee=>V(w),["stop"]),value:i.value?w:w[o.labelValue.value]},null,8,["label","disabled","onClick","value"]))),128))]),_:3},16,["modelValue","filter-method","onClear"]))}}},[["__scopeId","data-v-d12f3c20"]]),ro="",St=e.defineComponent({props:{name:{tyepe:String,required:!0}}});function $t(o,t,n,r,s,l){const a=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(a,{class:"cmp-icon"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.name)))]),_:1})}const ke=ue(St,[["render",$t],["__scopeId","data-v-733f9daa"]]),Vt={__name:"index",emits:["ok","no"],setup(o,{emit:t}){const n=t,r=te.debounce(()=>{n("ok")},500);function s(){n("no")}return(l,a)=>{const i=e.resolveComponent("el-popconfirm");return e.openBlock(),e.createElementBlock("span",null,[e.createVNode(i,e.mergeProps(l.$attrs,{onConfirm:e.unref(r),onCancel:s}),{reference:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16,["onConfirm"])])}}},so="",Et=["accept"],Tt=ue({__name:"index",props:{accept:{type:String,default:".xlsx,.xls"},fields:{type:Object,default:()=>({})},fileChange:{type:Function,required:!0}},emits:["fileChange"],setup(o,{emit:t}){const n=o,r=e.ref(null),s=e.ref(!1);async function l(a){s.value=!0;let i=a.target.files[0];const c=await ct(i,n.fields).catch(()=>{s.value=!1}).finally(()=>{r.value.value=null});await n.fileChange(c).finally(()=>{s.value=!1})}return(a,i)=>{const c=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("span",null,[e.createVNode(c,{loading:s.value,class:"mgr10",onClick:i[0]||(i[0]=b=>r.value.click())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("dao-ru")),1)]),_:1},8,["loading"]),e.createElementVNode("input",{onChange:l,ref_key:"input",ref:r,accept:o.accept,style:{position:"absolute",width:"0px",height:"0px",opacity:"0"},type:"file"},null,40,Et)])}}},[["__scopeId","data-v-6f9ede29"]]);function _e(o){let t={};return o.forEach(n=>{const{key:r,type:s,option:l={},value:a,dateType:i="date"}=n;if(r)if(s=="input"&&(l!=null&&l.multiple))t[r]=be(a);else if(s=="date")if(i.includes("range")){const[c,b]=r;let[k,x]=a||[];k&&i=="daterange"&&(k=ce(k).format("YYYY-MM-DD 00:00:00"),x=ce(x).format("YYYY-MM-DD 23:59:59")),t[c]=k,t[b]=x}else t[r]=a;else t[r]=a}),t}const co="",It={key:0},Lt={class:"btns"},vt={class:"left"},Ft={class:"right"},Ne=ue({__name:"index",props:{form:{type:Object,required:!0}},emits:["confirm","reset","visibleChange"],setup(o,{expose:t,emit:n}){const r=o,s=n,l=e.ref(!0),a=e.ref(null),{t:i}=X.useI18n(),c=e.computed(()=>l.value?i("guan-bi"):i("zhan-kai"));function b(){s("confirm")}function k(m){m.option.onClear&&m.option.onClear(),s("confirm")}function x(){s("reset")}function C(){s("confirm")}function p(){return _e(r.form.items)}const g=te.cloneDeep(r.form.items);function u(){r.form.items.forEach(m=>{const $=g.find(V=>V.key==m.key);$&&(m.value=$.value)})}return t({getPrm:p,reset:u}),(m,$)=>{const V=e.resolveComponent("el-input"),S=e.resolveComponent("el-date-picker"),T=e.resolveComponent("el-form-item"),I=e.resolveComponent("el-form"),A=e.resolveComponent("el-link"),v=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",{class:"searchBar-container mgt10 mgb10",onKeydown:e.withKeys(b,["enter"])},[e.createElementVNode("div",{class:"searchBar",style:e.normalizeStyle({height:l.value?"auto":"42px"})},[e.createVNode(I,{inline:"",model:o.form.data},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.form.items.filter(f=>!f.hidden),f=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:f.key},[f.type=="br"?(e.openBlock(),e.createElementBlock("br",It)):(e.openBlock(),e.createBlock(T,{key:1,label:f.name},{default:e.withCtx(()=>{var _,D;return[f.type==="input"?(e.openBlock(),e.createBlock(V,{key:0,modelValue:f.value,"onUpdate:modelValue":M=>f.value=M,class:e.normalizeClass(((_=f.option)==null?void 0:_.class)||"w150"),placeholder:m.$t("qing-shu-ru"),clearable:""},null,8,["modelValue","onUpdate:modelValue","class","placeholder"])):f.type==="custom"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f.render),{key:1})):e.createCommentVNode("",!0),f.type==="select"?(e.openBlock(),e.createBlock(qe,e.mergeProps({key:2,class:((D=f.option)==null?void 0:D.class)||"w150",modelValue:f.value,"onUpdate:modelValue":M=>f.value=M},{ref_for:!0},f.option,{onChange:b,onClear:M=>k(f)}),null,16,["class","modelValue","onUpdate:modelValue","onClear"])):e.createCommentVNode("",!0),f.type==="date"?(e.openBlock(),e.createBlock(S,{key:3,class:e.normalizeClass({datetimerange:"w300",daterange:"w200"}[f.dateType]||"w100"),modelValue:f.value,"onUpdate:modelValue":M=>f.value=M,"value-format":{datetimerange:"YYYY-MM-DD HH:mm:ss",daterange:"YYYY-MM-DD"}[f.dateType]||"YYYY-MM-DD",type:f.dateType||"date",onFocus:M=>a.value=f,onChange:M=>C(),placeholder:m.$t("qing-xuan-ze"),"start-placeholder":m.$t("kai-shi-shi-jian"),"end-placeholder":m.$t("jie-shu-shi-jian")},null,8,["class","modelValue","onUpdate:modelValue","value-format","type","onFocus","onChange","placeholder","start-placeholder","end-placeholder"])):e.createCommentVNode("",!0)]}),_:2},1032,["label"]))],64))),128))]),_:1},8,["model"])],4),e.createElementVNode("div",Lt,[e.createElementVNode("div",vt,[e.renderSlot(m.$slots,"table-header-left",{},void 0,!0)]),e.createElementVNode("div",Ft,[e.createVNode(A,{underline:"never",class:"mgr10",onClick:$[0]||($[0]=()=>{s("visibleChange",!l.value),l.value=!l.value})},{default:e.withCtx(()=>[e.createVNode(ke,{name:l.value?"ArrowUp":"ArrowDown"},null,8,["name"]),e.createTextVNode(" "+e.toDisplayString(c.value),1)]),_:1}),e.createVNode(v,{type:"primary",onClick:b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.$t("shai-xuan")),1)]),_:1}),e.createVNode(v,{type:"primary",onClick:x},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.$t("chong-zhi")),1)]),_:1}),e.renderSlot(m.$slots,"btn",{},void 0,!0)])])],32)}}},[["__scopeId","data-v-3c0a6716"]]),Ae={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 fe={...Ae};function Dt(o){fe={...fe,...o,responseDataKeys:{...fe.responseDataKeys,...o.responseDataKeys||{}}}}function je(){return fe}function Bt(){fe={...Ae}}const fo="",zt={class:"center"},Mt=ue({__name:"index",props:{id:{type:String,required:!1},loading:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0},searchForm:{type:Object,default:()=>({items:[],selections:[]})},api:{type:Function},data:{type:Array},tableConfig:{type:Object,default:()=>({})}},setup(o,{expose:t}){const{t:n,locale:r}=X.useI18n(),s=Le.useRoute(),l=je(),a=o,i=e.ref(!1),c=e.ref([]);a.searchForm.showSearch===void 0&&(a.searchForm.showSearch=l.showSearch),a.searchForm.showPage===void 0&&(a.searchForm.showPage=l.showPage),a.searchForm.showShadow===void 0&&(a.searchForm.showShadow=l.showShadow),a.searchForm.showCheckBox===void 0&&(a.searchForm.showCheckBox=l.showCheckBox),a.searchForm.enableCellCopy===void 0&&(a.searchForm.enableCellCopy=l.enableCellCopy),a.searchForm.selections||(a.searchForm.selections=[]);const b=e.computed(()=>{const h=s.path.replace(/\//g,"-").replace(/^-/,"")||"default-table";return a.id?`listPageId-${h}-${a.id}`:`listPageId-${h}`}),k=te.cloneDeep(a.searchForm.items),x=a.searchForm.pageNoKey||l.pageNoKey,C=a.searchForm.pageSizeKey||l.pageSizeKey,p=e.reactive({[x]:1,[C]:a.searchForm.defaultPageSize||l.defaultPageSize,total:0}),g=e.ref(null),u=e.ref(null),m=e.ref(450),$=te.debounce(()=>{e.nextTick(()=>{if(!u.value)return;const d=u.value.getBoundingClientRect(),E=window.innerHeight,F=d.top,q=100,U=E-F-q,B=200;m.value=Math.max(U,B)})},100),V=()=>{$()},S=()=>{if(!a.searchForm.enableCellCopy)return!1;const h=g.value;if(!h||!h.$el)return!1;const d=h.$el;return d.classList.add("cell-copy-enabled"),d.setAttribute("tabindex","-1"),d.removeEventListener("mousedown",ee),d.removeEventListener("mousemove",ie),d.removeEventListener("mouseup",he),d.removeEventListener("keydown",Ee),d.addEventListener("mousedown",ee),d.addEventListener("mousemove",ie),d.addEventListener("mouseup",he),d.addEventListener("keydown",Ee),!0};e.onMounted(()=>{$(),window.addEventListener("resize",V),a.searchForm.enableCellCopy&&(document.addEventListener("mouseup",Ke),document.addEventListener("mousedown",We),setTimeout(()=>{S()},500))}),e.onUpdated(()=>{a.searchForm.enableCellCopy&&setTimeout(()=>{S()},500)}),e.onUnmounted(()=>{if(window.removeEventListener("resize",V),a.searchForm.enableCellCopy){document.removeEventListener("mouseup",Ke),document.removeEventListener("mousedown",We);const h=g.value;if(h&&h.$el){const d=h.$el;d.removeEventListener("mousedown",ee),d.removeEventListener("mousemove",ie),d.removeEventListener("mouseup",he),d.removeEventListener("keydown",Ee)}}});const T=e.computed(()=>ne.value.height||m.value);let I;async function A(h){const{dataFormat:d}=a.tableConfig;h[x]!=1&&(h.nextSearchAfter=I),i.value=!0;const{code:E,data:F={}}=await a.api(h).finally(()=>{i.value=!1,a.searchForm.selections=[]});if(E==200){let q=[];for(const B of l.responseDataKeys.rows)if(F[B]){q=F[B];break}let U=0;for(const B of l.responseDataKeys.total)if(F[B]!==void 0){U=F[B];break}c.value=d?d(q):q,p.total=U,I=F.nextSearchAfter,a.searchForm.enableCellCopy&&e.nextTick(()=>{setTimeout(()=>{S()},100)})}}function v(h={}){const{searchData:d=()=>({})}=a.tableConfig,E=d();A({...p,..._e(a.searchForm.items),...h,...E})}function f(){const{reset:h}=a.tableConfig;h&&h(),a.searchForm.items.forEach(d=>{const E=k.find(F=>te.isArray(d.key)&&te.isArray(F.key)?d.key.join(",")==F.key.join(","):F.key==d.key);E&&(d.value=E.value)}),v()}a.api&&a.immediate&&v();function _(){return{...p,..._e(a.searchForm.items)}}const D=()=>{const h=g.value;h&&h.clearSort()},M=e.reactive({storage:!0}),G=e.reactive({drag:!0,resizable:!0,maxFixedSize:0}),ne=e.computed(()=>{const{customConfig:h,columnConfig:d,...E}=a.tableConfig;return{headerAlign:"left",align:"center",customConfig:{...M,...h},columnConfig:{...G,...d},"virtual-x-config":{enabled:!1,scrollToLeftOnChange:!1},"virtual-y-config":{enabled:!0,gt:100},...E}}),w=e.reactive({isSelecting:!1,startCell:null,endCell:null,selectedCells:[]}),se=h=>{const d=h.closest(".vxe-body--column");if(!d||d.classList.contains("col--checkbox")||d.classList.contains("col--seq"))return null;const E=d.closest(".vxe-body--row");if(!E)return null;const F=g.value;if(!F)return null;let q=-1;const U=E.getAttribute("data-rowid");if(U!=null)q=parseInt(U,10);else{const z=E.parentElement;q=Array.from(z.querySelectorAll(".vxe-body--row")).indexOf(E)}if(q<0)return null;let B=-1;const J=d.getAttribute("data-colid");if(J&&(B=F.getColumns().findIndex(L=>L.id===J)),B<0){const L=Array.from(E.querySelectorAll(".vxe-body--column")).indexOf(d),j=!!d.closest(".vxe-table--fixed-left-wrapper"),P=!!d.closest(".vxe-table--fixed-right-wrapper"),N=F.getColumns();if(j){const Y=N.filter(R=>R.fixed==="left");L<Y.length&&(B=N.indexOf(Y[L]))}else if(P){const Y=N.filter(R=>R.fixed==="right");L<Y.length&&(B=N.indexOf(Y[L]))}else{const Y=a.searchForm.showCheckBox?1:0;B=N.filter(K=>K.fixed==="left").length+L-Y}}return B<0?null:{rowIndex:q,colIndex:B,cell:d}},ee=h=>{const d=se(h.target);if(!d){Ve();return}w.isSelecting=!0,w.startCell={rowIndex:d.rowIndex,colIndex:d.colIndex},w.endCell={...w.startCell},Ye(),He()},ie=h=>{if(!w.isSelecting)return;const d=se(h.target);d&&(w.endCell={rowIndex:d.rowIndex,colIndex:d.colIndex},Ye(),He())},he=()=>{w.isSelecting=!1},Ve=()=>{w.selectedCells=[],w.startCell=null,w.endCell=null;const h=g.value;if(!h)return;h.$el.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(E=>{E.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")})},Ye=()=>{if(!w.startCell||!w.endCell){w.selectedCells=[];return}const h=w.startCell.rowIndex,d=w.endCell.rowIndex,E=w.startCell.colIndex,F=w.endCell.colIndex,q=Math.min(h,d),U=Math.max(h,d),B=Math.min(E,F),J=Math.max(E,F);w.selectedCells=[];for(let z=q;z<=U;z++)for(let L=B;L<=J;L++)w.selectedCells.push({rowIndex:z,colIndex:L})},He=()=>{e.nextTick(()=>{const h=g.value;if(!h)return;const d=h.$el;if(d.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(j=>{j.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")}),w.selectedCells.length===0)return;const E=h.getColumns(),F=w.selectedCells.map(j=>j.rowIndex),q=w.selectedCells.map(j=>j.colIndex),U=Math.min(...F),B=Math.max(...F),J=Math.min(...q),z=Math.max(...q),L=[d.querySelector(".vxe-table--body-wrapper tbody"),d.querySelector(".vxe-table--fixed-left-wrapper tbody"),d.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean);w.selectedCells.forEach(({rowIndex:j,colIndex:P})=>{const N=E[P];if(!N)return;const Y=N.fixed==="left",R=N.fixed==="right";for(const K of L){const me=K.querySelectorAll(".vxe-body--row")[j];if(!me)continue;const le=Array.from(me.querySelectorAll(".vxe-body--column"));let O=null;if(Y&&K.closest(".vxe-table--fixed-left-wrapper")){const W=E.filter(Z=>Z.fixed==="left").indexOf(N);O=le[W]}else if(R&&K.closest(".vxe-table--fixed-right-wrapper")){const W=E.filter(Z=>Z.fixed==="right").indexOf(N);O=le[W]}else if(!Y&&!R&&K.closest(".vxe-table--body-wrapper")){const ae=a.searchForm.showCheckBox?1:0,W=E.filter(Te=>Te.fixed==="left").length,Z=P-W;O=le[Z+ae]}if(O&&!O.classList.contains("col--checkbox")&&!O.classList.contains("col--seq")){O.classList.add("cell-selected"),j===U&&O.classList.add("cell-border-top"),j===B&&O.classList.add("cell-border-bottom"),P===J&&O.classList.add("cell-border-left"),P===z&&O.classList.add("cell-border-right");break}}})})},eo=async()=>{if(w.selectedCells.length===0)return;const h=g.value;if(!h)return;const d=h.$el,E=h.getColumns(),F=[...new Set(w.selectedCells.map(z=>z.rowIndex))].sort((z,L)=>z-L),q=[...new Set(w.selectedCells.map(z=>z.colIndex))].sort((z,L)=>z-L),U=[d.querySelector(".vxe-table--body-wrapper tbody"),d.querySelector(".vxe-table--fixed-left-wrapper tbody"),d.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean),B=[];F.forEach(z=>{const L=[];q.forEach(j=>{const P=E[j];if(!P){L.push("");return}const N=P.fixed==="left",Y=P.fixed==="right";let R="";for(const K of U){const me=K.querySelectorAll(".vxe-body--row")[z];if(!me)continue;const le=Array.from(me.querySelectorAll(".vxe-body--column"));let O=null;if(N&&K.closest(".vxe-table--fixed-left-wrapper")){const W=E.filter(Z=>Z.fixed==="left").indexOf(P);O=le[W]}else if(Y&&K.closest(".vxe-table--fixed-right-wrapper")){const W=E.filter(Z=>Z.fixed==="right").indexOf(P);O=le[W]}else if(!N&&!Y&&K.closest(".vxe-table--body-wrapper")){const ae=a.searchForm.showCheckBox?1:0,W=E.filter(Te=>Te.fixed==="left").length,Z=j-W;O=le[Z+ae]}if(O&&!O.classList.contains("col--checkbox")&&!O.classList.contains("col--seq")){R=O.innerText||O.textContent||"",R=R.trim(),R=R.replace(/\n/g," ").replace(/\s+/g," ");break}}L.push(R)}),B.push(L.join(" "))});const J=B.join(`
|
|
2
2
|
`);try{await navigator.clipboard.writeText(J)}catch(z){console.error("复制失败:",z)}},Ee=h=>{a.searchForm.enableCellCopy&&((h.ctrlKey||h.metaKey)&&h.key==="c"?w.selectedCells.length>0&&(h.preventDefault(),h.stopPropagation(),eo()):h.key==="Escape"&&Ve())},Ke=()=>{w.isSelecting=!1},We=h=>{const d=g.value;if(!d||!d.$el)return;d.$el.contains(h.target)||Ve()},to=h=>{p[x]=h,v()},oo=h=>{p[C]=h,p[x]=1,v()};function Ze(){const h=g.value.getCheckboxRecords();a.searchForm.selections=h}const Ge=h=>{const d=g.value;if(d){d.toggleCheckboxRow(h);const E=g.value.getCheckboxRecords();a.searchForm.selections=E}};return t({tableRef:g,getList:v,getPrm:_,clearSort:D,calculateTableHeight:$}),(h,d)=>{var z;const E=e.resolveComponent("el-button"),F=e.resolveComponent("el-checkbox"),q=e.resolveComponent("el-text"),U=e.resolveComponent("vxe-column"),B=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(Ne,{key:0,form:o.searchForm,onReset:f,onConfirm:d[1]||(d[1]=L=>v()),onVisibleChange:e.unref($)},{btn:e.withCtx(()=>[d[3]||(d[3]=e.createElementVNode("span",{class:"mgr10"},null,-1)),e.renderSlot(h.$slots,"search-bar-btn",{},void 0,!0),e.createVNode(E,{class:"mgl10",round:"",onClick:d[0]||(d[0]=L=>g.value.openCustom())},{default:e.withCtx(()=>[e.createVNode(ke,{name:"Tools"})]),_:1})]),_:3},8,["form","onVisibleChange"])):e.createCommentVNode("",!0),e.renderSlot(h.$slots,"table-header-left",{},void 0,!0),e.createElementVNode("div",{ref_key:"tableContentRef",ref:u},[e.createVNode(B,e.mergeProps({id:b.value,ref_key:"tableRef",ref:g,loading:o.loading||i.value,data:o.api?c.value:o.data,border:""},ne.value,{height:T.value,onCheckboxChange:Ze,onCheckboxAll:Ze,onSortChange:(z=ne.value["sort-config"])==null?void 0:z.sortChange}),{default:e.withCtx(()=>[o.searchForm.showCheckBox==null||o.searchForm.showCheckBox?(e.openBlock(),e.createBlock(U,{key:0,type:"checkbox",width:e.unref(r)=="zh_cn"?80:150,title:h.$t("xu-hao"),fixed:"left"},{checkbox:e.withCtx(({rowIndex:L,row:j,checked:P,disabled:N,indeterminate:Y})=>[e.createElementVNode("div",zt,[P?(e.openBlock(),e.createBlock(F,{key:0,checked:!0,disabled:N,size:"default",onClick:e.withModifiers(R=>!N&&Ge(j),["stop"])},null,8,["disabled","onClick"])):(e.openBlock(),e.createBlock(F,{key:1,disabled:N,checked:!1,size:"default",onClick:e.withModifiers(R=>!N&&Ge(j),["stop"])},null,8,["disabled","onClick"])),e.createVNode(q,{type:"info",class:"mgl5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(L+1),1)]),_:2},1024)])]),_:1},8,["width","title"])):e.createCommentVNode("",!0),e.renderSlot(h.$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":p[e.unref(x)],"onUpdate:currentPage":d[2]||(d[2]=L=>p[e.unref(x)]=L),class:"myPagination mgt10",background:"",layout:"total, sizes, prev, pager, next",total:p.total,"page-size":p[e.unref(C)],"page-sizes":o.searchForm.pageSizes||e.unref(l).pageSizes,onCurrentChange:to,onSizeChange:oo},null,8,["current-page","total","page-size","page-sizes"])):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-d93cad32"]]),Ot={__name:"index",props:{sheetsConfig:{type:Object,required:!0},fileName:{type:String,required:!0}},setup(o){const t=o;function n(){dt(t.fileName,t.sheetsConfig)}return(r,s)=>{const l=e.resolveComponent("el-link");return e.openBlock(),e.createBlock(l,e.mergeProps({type:"primary",underline:"never"},r.$attrs,{onClick:n}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.$t("xia-zai-dao-ru-mo-ban")),1)]),_:1},16)}}},qt={mounted(o,t){t.value&&Re(o)},updated(o,t){t.value?Re(o):Ue(o)},beforeUnmount(o){Ue(o)}};async function Re(o){await C();const t=o.querySelector(".el-dialog");if(!t)return;const n=o.querySelector(".el-dialog__header"),r=o.querySelector(".el-overlay");r.style.cssText+="overflow: hidden;",n.style.cursor="move";let s=!1,l={window:{width:0,height:0},dialog:{x:0,y:0,width:0,height:0,marginTop:""},mouse:{x:0,y:0},drag:{x:0,y:0}};n.addEventListener("mousedown",c),document.addEventListener("mousemove",b),document.addEventListener("mouseup",k),window.addEventListener("resize",x);function a(){l.mouse.x-l.drag.x>=l.dialog.x&&(l.drag.x=l.mouse.x-l.dialog.x),l.drag.x-l.mouse.x>=l.window.width-(l.dialog.x+l.dialog.width)&&(l.drag.x=l.mouse.x+l.window.width-l.dialog.x-l.dialog.width),l.mouse.y-l.drag.y>=l.dialog.y&&(l.drag.y=l.mouse.y-l.dialog.y),l.drag.y-l.mouse.y>=l.window.height-(l.dialog.y+l.dialog.height)&&(l.drag.y=l.mouse.y+l.window.height-l.dialog.y-l.dialog.height),i()}function i(){let p=l.drag.y-l.mouse.y+l.dialog.y,g=l.drag.x-l.mouse.x+l.dialog.x;t.style.cssText+=`position: absolute; top: calc(${p}px - ${l.dialog.marginTop}); left: ${g}px;`}function c(p){p.button===0&&(l.window={width:document.body.clientWidth,height:document.body.clientHeight},l.dialog=t.getBoundingClientRect(),l.dialog.marginTop=window.getComputedStyle(t).marginTop,l.mouse={x:p.clientX,y:p.clientY},s=!0)}function b(p){s&&(l.drag={x:p.clientX,y:p.clientY},r.style.userSelect="none",a())}function k(p){r.style.userSelect="auto",s=!1}function x(p){}function C(){return new Promise((p,g)=>{setTimeout(()=>{p()},500)})}o.__mouseDown__=c,o.__mouseUp__=k,o.__mouseMove__=b,o.__sizeChange__=x}function Ue(o){document.removeEventListener("mousedown",o.__mouseDown__),document.removeEventListener("mousemove",o.__mouseMove__),document.removeEventListener("mouseup",o.__mouseUp__),window.removeEventListener("resize",o.__sizeChange__)}const mo="",Nt={key:0,class:"drawer-btn"},At={key:1},jt={__name:"index",props:{layer:{type:Object,default:()=>({show:!1,type:"layer",title:"",showButton:!1}),required:!0},loading:{type:Boolean,default:!1}},emits:["confirm"],setup(o,{emit:t}){const n=o,r=t,{t:s}=X.useI18n(),l=te.debounce(()=>{r("confirm")},300);async function a(){n.layer.type=="drawer"?n.layer.onClose?n.layer.onClose():await H.ElMessageBox.confirm(s("que-ding-guan-bi-ma"),{confirmButtonText:s("que-ding"),cancelButtonText:s("qu-xiao"),type:"warning"}).catch(()=>{})=="confirm"&&(n.layer.show=!1):n.layer.show=!1}return(i,c)=>{const b=e.resolveComponent("el-button"),k=e.resolveComponent("el-drawer"),x=e.resolveComponent("el-dialog");return o.layer.type?(e.openBlock(),e.createBlock(k,{key:0,modelValue:o.layer.show,"onUpdate:modelValue":c[0]||(c[0]=C=>o.layer.show=C),size:o.layer.width||"100%",title:o.layer.title,direction:"rtl","append-to-body":"","before-close":a,class:"drawer-content"},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default"),c[2]||(c[2]=e.createElementVNode("p",{class:"mgt50"},null,-1)),o.layer.showButton?(e.openBlock(),e.createElementBlock("div",Nt,[e.renderSlot(i.$slots,"btn",{},()=>[e.createVNode(b,{onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("qu-xiao")),1)]),_:1}),e.createVNode(b,{type:"primary",loading:o.loading,onClick:e.unref(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("ti-jiao")),1)]),_:1},8,["loading","onClick"])])])):e.createCommentVNode("",!0)]),_:3},8,["modelValue","size","title"])):e.withDirectives((e.openBlock(),e.createElementBlock("div",At,[e.createVNode(x,{"close-on-click-modal":!1,modelValue:o.layer.show,"onUpdate:modelValue":c[1]||(c[1]=C=>o.layer.show=C),title:o.layer.title,width:o.layer.width||500,center:""},e.createSlots({default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:2},[o.layer.showButton?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(i.$slots,"btn",{},()=>[e.createVNode(b,{onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("qu-xiao")),1)]),_:1}),e.createVNode(b,{type:"primary",onClick:e.unref(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("ti-jiao")),1)]),_:1},8,["onClick"])])]),key:"0"}:void 0]),1032,["modelValue","title","width"])])),[[e.unref(qt),o.layer.show]])}}};function Rt(o,t={}){const n=oe(),r={inForm:!0,required:!0,...t},s={phone:/^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/,password:/(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/,email:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/}[o],{inForm:l,value:a,required:i,msg:c=n("validate.invalidInput")}=r;return l?function(b,k,x){if(i){s.test(k)?x():x(new Error(c));return}k&&!s.test(k)?x(new Error(c)):x()}:s.test(a)}class Ut{constructor(t={}){this.config={clientCode:t.clientCode||"one-portal",casServerUrl:`https://one-portal${t.isTest?"-test":""}.joy-group.com/api`,casPortalUrl:`https://one-portal${t.isTest?"-test":""}.joy-group.com`,serviceUrl:t.serviceUrl||window.location.origin+"/cas/callback",tokenKey:t.tokenKey||"one_portal_token",userKey:t.userKey||"one_portal_user",debug:t.debug||!1,autoLogin:t.autoLogin!==!1,loginCallback:t.loginCallback||null,logoutCallback:t.logoutCallback||null,errorCallback:t.errorCallback||null},this.token=null,this.user=null,this.init()}init(){this.log("OnePortal CAS SDK 初始化中..."),this.loadFromStorage();const n=new URLSearchParams(window.location.search).get("ticket");this.isLoggedIn()&&this.config.loginCallback?this.config.loginCallback(this.user,this.token):n?(this.log("检测到ST票据:",n),this.validateTicket(n)):this.config.autoLogin&&!this.isLoggedIn()&&(this.log("用户未登录,准备跳转到CAS登录页面"),this.login())}loadFromStorage(){try{this.token=localStorage.getItem(this.config.tokenKey);const t=localStorage.getItem(this.config.userKey);t&&(this.user=JSON.parse(t)),this.log("从本地存储加载数据:",{token:!!this.token,user:!!this.user})}catch(t){this.log("加载本地存储数据失败:",t)}}saveToStorage(){try{this.token&&localStorage.setItem(this.config.tokenKey,this.token),this.user&&localStorage.setItem(this.config.userKey,JSON.stringify(this.user)),this.log("数据已保存到本地存储")}catch(t){this.log("保存到本地存储失败:",t)}}clearStorage(){try{localStorage.removeItem(this.config.tokenKey),localStorage.removeItem(this.config.userKey),this.log("本地存储已清除")}catch(t){this.log("清除本地存储失败:",t)}}isLoggedIn(){return!!(this.token&&this.user)}getUser(){return this.user}getToken(){return this.token}login(){const t=`${this.config.casPortalUrl}?appCode=${this.config.clientCode}&redirectUrl=${encodeURIComponent(this.config.serviceUrl)}`;this.log("跳转到CAS登录页面:",t),window.location.href=t}async validateTicket(t){try{this.log("验证ST票据:",t);const n=await fetch(`${this.config.casServerUrl}/auth/validateST?ticket=${t}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);const r=await n.json();if(r.success&&r.data)return this.token=r.data.token,this.user=r.data.user,this.saveToStorage(),this.clearTicketFromUrl(),this.log("ST票据验证成功,用户登录成功:",this.user),this.config.loginCallback&&this.config.loginCallback(this.user,this.token),!0;throw new Error(r.message||"ST票据验证失败")}catch(n){return this.log("ST票据验证失败:",n),this.handleError(n),!1}}clearTicketFromUrl(){const t=new URL(window.location);t.searchParams.delete("ticket"),window.history.replaceState({},document.title,t.toString())}async logout(t=!0){try{if(this.log("用户登出"),this.token)try{await fetch(`${this.config.casServerUrl}/auth/logout`,{method:"POST",headers:{AppId:this.config.clientCode,Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"}})}catch(n){this.log("调用服务端登出接口失败:",n)}this.token=null,this.user=null,this.clearStorage(),this.config.logoutCallback&&this.config.logoutCallback(),t&&this.login()}catch(n){this.log("登出失败:",n),this.handleError(n)}}async request(t,n={}){const r={headers:{"Content-Type":"application/json",...n.headers},...n};r.headers.appId=this.config.clientCode,this.token&&(r.headers.Authorization=`Bearer ${this.token}`);try{const s=await fetch(t,r);return s.status===401?(this.log("Token已过期,需要重新登录"),this.logout(),null):s}catch(s){throw this.log("请求失败:",s),s}}async fetchUserInfo(){try{const t=await this.request(`${this.config.casServerUrl}/auth/user`);if(t&&t.ok){const n=await t.json();if(n.success&&n.data)return this.user=n.data,this.saveToStorage(),this.user}return null}catch(t){return this.log("获取用户信息失败:",t),null}}async refreshToken(){this.log("Token刷新功能暂未实现")}handleError(t){this.log("发生错误:",t),this.config.errorCallback&&this.config.errorCallback(t)}log(...t){this.config.debug&&console.log("[OnePortal CAS SDK]",...t)}checkLoginStatus(){return!this.isLoggedIn()&&this.config.autoLogin?(this.login(),!1):this.isLoggedIn()}setConfig(t,n){this.config[t]=n}getConfig(t){return this.config[t]}}function Pt(o,t={}){const r=Object.assign({manual:!1,log:!1,params:null,format:null},t),{manual:s,log:l,params:a={},cb:i,format:c}=r,b=e.ref([]),k=e.ref(!1),x=C=>{const p=C||a;k.value=!0,o(p).then(g=>{const{code:u,data:m,msg:$}=g;if(i){const{records:V,rows:S}=m||{},T=V||S?V||S:m;b.value=Se(T,c),i(g)}if(m){if(m.records!=null||m.rows!=null){const{records:V,rows:S,total:T=0}=m||{};p&&p.total!=null&&(a.total=parseInt(T)),b.value=Se(V||S||[],c)}else b.value=Se(m,c);l&&console.log("useRequest-res",b.value)}}).catch(g=>{i&&(console.log("useRequestErr",g),i({code:500}))}).finally(()=>{k.value=!1})};return s||x(),[k,b,x]}function Yt(o){const t=e.ref(o),n=e.ref(""),r=e.ref("");return e.watch(t,s=>{const l=s||["",""];n.value=l[0],r.value=l[1]}),[t,n,r]}function Ht(o){return Object.prototype.toString.call(o).slice(8,-1).toLowerCase()}function Se(o,t){if(!t)return o;if(o instanceof Array)return o.map(r=>{let s={};return t.forEach(l=>s[l]=r[l]),s});let n={};return t.forEach(r=>n[r]=o[r]),n}function Kt(o,t=[]){const{locale:n}=X.useI18n(),r=e.ref(o());return e.watch([n,...t],()=>{r.value=o()},{immediate:!0}),r}function Wt(o,t="zh_cn",n="en_us"){if(!o)return"-";const r={en_us:n,zh_cn:t},l=Ce().global.locale.value;return o[r[l]]||o[t]||"-"}function Zt(o,t){let n=Q.mapState;return typeof o=="string"&&o.length>0&&(n=Q.createNamespacedHelpers(o).mapState),Pe(t,n)}function Gt(o,t){let n=Q.mapGetters;return typeof o=="string"&&o.length>0&&(n=Q.createNamespacedHelpers(o).mapGetters),Pe(t,n)}function Jt(o,t){let n=Q.mapActions;return typeof o=="string"&&o.length>0&&(n=Q.createNamespacedHelpers(o).mapActions),Xt(t,n)}function Pe(o,t){const n=Q.useStore(),r=t(o),s={};return Object.keys(r).forEach(l=>{const a=r[l].bind({$store:n});s[l]=e.computed(a)}),s}function Xt(o,t){const n=Q.useStore(),r=t(o),s={};return Object.keys(r).forEach(l=>{s[l]=r[l].bind({$store:n})}),s}function $e(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!e.isVNode(o)}function Qt(){de.VxeUI.renderer.add("Enum",{renderTableDefault(o,t){let n;if([null,void 0].includes(t.row[t.column.field]))return"-";const r=t.row[t.column.field];if(o.type=="tag"){let s;return e.createVNode(e.resolveComponent("el-text"),{type:o.enum.getTag(r)},$e(s=o.enum.getName(r))?s:{default:()=>[s]})}return e.createVNode(e.resolveComponent("el-text"),null,$e(n=o.enum.getName(r))?n:{default:()=>[n]})}}),de.VxeUI.renderer.add("InputNumber",{renderTableDefault(o,t){return e.createVNode(H.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)}}),de.VxeUI.renderer.add("TrueFalse",{renderTableDefault(o,t){const{locale:n}=X.useI18n();let r=n.value=="zh_cn";return e.createVNode(H.ElText,{type:t.row[t.column.field]?"success":"danger"},{default:()=>[t.row[t.column.field]?r?"是":"YES":r?"否":"NO"]})}}),de.VxeUI.renderer.add("I18n",{renderTableDefault(o,t){const{locale:n}=X.useI18n();let r=n.value=="zh_cn"?t.column.field:o.fieldEn;return t.row[r]||t.row[t.column.field]}}),de.VxeUI.renderer.add("Link",{renderTableDefault(o,t){var i;let n=t.column.field;const r=Le.useRouter(),{multiple:s,to:l}=o;if(!s)return e.createVNode(H.ElLink,{underline:"never",type:"primary",onclick:()=>r.push({path:l,query:{[n]:t.row[n]}})},{default:()=>[t.row[n]]});const a=((i=t.row[n])==null?void 0:i.split(","))||[];return a.map((c,b)=>e.createVNode("span",null,[e.createVNode(H.ElLink,{underline:"never",type:"primary",onclick:()=>r.push({path:l,query:{[n]:c}})},$e(c)?c:{default:()=>[c]}),b<a.length-1?",":""]))}})}y.CmpDictionary=qe,y.CmpIcon=ke,y.ConfrimButton=Vt,y.DownExcelTemp=Ot,y.ImportButton=Tt,y.LayOutForm=Je,y.Layer=jt,y.ListPage=Mt,y.OnePortalCasSDK=Ut,y.SearchBar=Ne,y.StatusMap=xe,y._toRaw=mt,y._typeOf=Ht,y.arrToStatusMap=pt,y.arrayToTree=gt,y.checkFileSize=wt,y.creatValidator=Rt,y.createImportFields=xt,y.createListPageId=bt,y.en_us=ye,y.exportExcel=nt,y.getI18n=Ce,y.getI18nT=oe,y.getListPageConfig=je,y.getLocaleValue=Wt,y.getValueBykey=kt,y.importExcel=ot,y.messages=ze,y.registerVxeRenderers=Qt,y.resetListPageConfig=Bt,y.setListPageConfig=Dt,y.setupI18n=Me,y.sleep=ht,y.stringToArray=be,y.stripHtmlTags=yt,y.unicode2Str=Ct,y.useActions=Jt,y.useDatePicker=Yt,y.useGetters=Gt,y.useI18nReState=Kt,y.useRequest=Pt,y.useState=Zt,y.zh_cn=pe,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})});
|