joy-admin-components 0.2.39 → 0.2.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ElForm as _t, ElRow as $t, ElCol as St, ElMessageBox as Et, ElInputNumber as It, ElText as
|
|
2
|
-
import { defineComponent as ot, ref as U, onMounted as lt, h as ze, mergeModels as Xe, useAttrs as
|
|
1
|
+
import { ElForm as _t, ElRow as $t, ElCol as St, ElMessageBox as Et, ElInputNumber as It, ElText as Ft, ElLink as Je } from "element-plus";
|
|
2
|
+
import { defineComponent as ot, ref as U, onMounted as lt, h as ze, mergeModels as Xe, useAttrs as Lt, useModel as Tt, computed as ce, watch as Re, resolveComponent as M, unref as K, openBlock as L, createBlock as H, mergeProps as ge, createSlots as at, withCtx as D, createElementVNode as re, toDisplayString as Q, renderSlot as ee, createVNode as O, createTextVNode as ne, createCommentVNode as de, createElementBlock as ie, Fragment as Me, renderList as st, withModifiers as Ve, nextTick as we, resolveDynamicComponent as rt, withKeys as Dt, normalizeStyle as zt, normalizeClass as qe, reactive as Ie, 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 Le from "exceljs";
|
|
5
5
|
import $e from "dayjs";
|
|
6
6
|
import { createI18n as At, useI18n as pe } from "vue-i18n";
|
|
7
7
|
import { debounce as Be, 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 Ye, useStore as ut, mapState as Pt, mapGetters as Rt, mapActions as Bt } from "vuex";
|
|
10
10
|
import { VxeUI as ke } from "vxe-pc-ui";
|
|
11
|
-
const
|
|
11
|
+
const qn = ot({
|
|
12
12
|
name: "LayOutForm",
|
|
13
13
|
setup(e, { slots: t, attrs: n, emit: a }) {
|
|
14
14
|
const s = U(null), o = () => t.default ? t.default().filter((r) => r.type !== Symbol.for("v-cmt")).map((r) => r.type === Symbol.for("v-fgt") ? r.children : r).flat().map(
|
|
@@ -283,13 +283,13 @@ function Ce() {
|
|
|
283
283
|
}
|
|
284
284
|
$e.extend(Kt);
|
|
285
285
|
$e.extend(Nt);
|
|
286
|
-
async function
|
|
286
|
+
async function An(e, t) {
|
|
287
287
|
const { fields: n, range: a = 1 } = t;
|
|
288
288
|
if (!n) {
|
|
289
289
|
const l = Ce();
|
|
290
290
|
throw new Error(l("excel.fieldsMappingRequired"));
|
|
291
291
|
}
|
|
292
|
-
let s = new
|
|
292
|
+
let s = new Le.Workbook();
|
|
293
293
|
await s.xlsx.load(e);
|
|
294
294
|
const o = {};
|
|
295
295
|
return s.eachSheet(function(l, r) {
|
|
@@ -308,7 +308,7 @@ async function qn(e, t) {
|
|
|
308
308
|
const gt = {
|
|
309
309
|
columnWidth: 30
|
|
310
310
|
};
|
|
311
|
-
async function
|
|
311
|
+
async function jn(e, t, n = [], a = {}) {
|
|
312
312
|
if (!e || !t)
|
|
313
313
|
return;
|
|
314
314
|
const { columnStyle: s } = a, { columnWidth: o } = gt;
|
|
@@ -327,7 +327,7 @@ async function An(e, t, n = [], a = {}) {
|
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
function Gt() {
|
|
330
|
-
const e = new
|
|
330
|
+
const e = new Le.Workbook();
|
|
331
331
|
e.creator = "distributor System", e.lastModifiedBy = "distributor System", e.created = /* @__PURE__ */ new Date(), e.modified = /* @__PURE__ */ new Date(), e.lastPrinted = /* @__PURE__ */ new Date();
|
|
332
332
|
const t = e.addWorksheet("Sheet1");
|
|
333
333
|
return { workbook: e, worksheet: t };
|
|
@@ -395,7 +395,7 @@ async function tn(e, t) {
|
|
|
395
395
|
const l = Ce();
|
|
396
396
|
throw new Error(l("excel.fieldsMappingRequired"));
|
|
397
397
|
}
|
|
398
|
-
let s = new
|
|
398
|
+
let s = new Le.Workbook();
|
|
399
399
|
await s.xlsx.load(e);
|
|
400
400
|
const o = {};
|
|
401
401
|
return s.eachSheet(function(l, r) {
|
|
@@ -430,10 +430,15 @@ async function tn(e, t) {
|
|
|
430
430
|
}
|
|
431
431
|
}), s = null, o;
|
|
432
432
|
}
|
|
433
|
-
|
|
433
|
+
const nn = {
|
|
434
|
+
date: "yyyy-mm-dd",
|
|
435
|
+
number: "0",
|
|
436
|
+
string: "@"
|
|
437
|
+
};
|
|
438
|
+
async function on(e, t) {
|
|
434
439
|
if (!e || t.length == 0)
|
|
435
440
|
return;
|
|
436
|
-
const n =
|
|
441
|
+
const n = ln(t);
|
|
437
442
|
n.eachSheet(function(a, s) {
|
|
438
443
|
const { columnWidth: o } = gt, { tableHeader: l, tableData: r } = t[a._name];
|
|
439
444
|
l.forEach((i) => {
|
|
@@ -446,7 +451,8 @@ async function nn(e, t) {
|
|
|
446
451
|
color: {
|
|
447
452
|
argb: "FFFF0000"
|
|
448
453
|
}
|
|
449
|
-
}
|
|
454
|
+
},
|
|
455
|
+
numFmt: nn[i.numFmt]
|
|
450
456
|
};
|
|
451
457
|
}
|
|
452
458
|
}), a.columns = l, a.addRows(r), l.forEach((i) => {
|
|
@@ -478,8 +484,8 @@ async function nn(e, t) {
|
|
|
478
484
|
console.log(a);
|
|
479
485
|
}
|
|
480
486
|
}
|
|
481
|
-
function
|
|
482
|
-
const t = Ce(), n = new
|
|
487
|
+
function ln(e) {
|
|
488
|
+
const t = Ce(), n = new Le.Workbook();
|
|
483
489
|
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(e).sort((s, o) => {
|
|
484
490
|
const l = e[s].sort ?? 0, r = e[o].sort ?? 0;
|
|
485
491
|
return l - r;
|
|
@@ -488,7 +494,7 @@ function on(e) {
|
|
|
488
494
|
/[\\/:*?\[\]]/g.test(s) && (s = s.replace(/[\\/:*?\[\]]/g, ""), l = !0), s.length > 31 && (s = s.substring(0, 31).trim(), l = !0, console.warn(t("excel.sheetNameTooLong", [o, s]))), l && (e[s] = e[o], delete e[o]), n.addWorksheet(s);
|
|
489
495
|
}), n;
|
|
490
496
|
}
|
|
491
|
-
function
|
|
497
|
+
function an(e) {
|
|
492
498
|
if (e < 26)
|
|
493
499
|
return String.fromCharCode(65 + e);
|
|
494
500
|
{
|
|
@@ -496,17 +502,17 @@ function ln(e) {
|
|
|
496
502
|
return t + n;
|
|
497
503
|
}
|
|
498
504
|
}
|
|
499
|
-
function
|
|
505
|
+
function Un(e) {
|
|
500
506
|
return new Promise((t) => {
|
|
501
507
|
setTimeout(() => {
|
|
502
508
|
t();
|
|
503
509
|
}, e);
|
|
504
510
|
});
|
|
505
511
|
}
|
|
506
|
-
function
|
|
512
|
+
function Pn(e) {
|
|
507
513
|
return JSON.parse(JSON.stringify(e));
|
|
508
514
|
}
|
|
509
|
-
function
|
|
515
|
+
function Rn(e) {
|
|
510
516
|
let t = [], n = {}, a = (s, o) => Object.prototype.hasOwnProperty.call(s, o);
|
|
511
517
|
for (const s of e) {
|
|
512
518
|
n[s.id] = {
|
|
@@ -558,7 +564,7 @@ class et {
|
|
|
558
564
|
return this.map.has(t);
|
|
559
565
|
}
|
|
560
566
|
}
|
|
561
|
-
function
|
|
567
|
+
function Bn(e, t = [], n = "i18nName") {
|
|
562
568
|
if (e.length == 0)
|
|
563
569
|
return new et([]);
|
|
564
570
|
if (t.length < 2) {
|
|
@@ -573,27 +579,27 @@ function Rn(e, t = [], n = "i18nName") {
|
|
|
573
579
|
});
|
|
574
580
|
return new et(a);
|
|
575
581
|
}
|
|
576
|
-
function
|
|
582
|
+
function Yn(e) {
|
|
577
583
|
return e ? e.replace(/<[^>]+>/g, "") : "";
|
|
578
584
|
}
|
|
579
|
-
function
|
|
585
|
+
function Kn(e) {
|
|
580
586
|
return e ? (e.includes("\\\\u") && (e = e.replace(/\\/g, "")), e.replace(/\\u[\dA-F]{4}/gi, (t) => String.fromCharCode(parseInt(t.replace(/\\u/g, ""), 16)))) : "";
|
|
581
587
|
}
|
|
582
|
-
function
|
|
588
|
+
function Hn(e, t = 10) {
|
|
583
589
|
let n = 1048576 * t;
|
|
584
590
|
return !(e.size > n);
|
|
585
591
|
}
|
|
586
|
-
function
|
|
592
|
+
function Nn(e) {
|
|
587
593
|
return Array.from(10).fill(0).map((n, a) => e + "_" + a);
|
|
588
594
|
}
|
|
589
|
-
function
|
|
595
|
+
function Wn(e) {
|
|
590
596
|
let t = {};
|
|
591
597
|
return e.map((n, a) => {
|
|
592
|
-
let { key: s, option: o, type: l } = n, r =
|
|
598
|
+
let { key: s, option: o, type: l } = n, r = an(a);
|
|
593
599
|
o ? t[s] = `${r}---option` : l === "image" ? t[s] = `${r}---image` : t[s] = r;
|
|
594
600
|
}), t;
|
|
595
601
|
}
|
|
596
|
-
function
|
|
602
|
+
function Zn(e, t) {
|
|
597
603
|
return t.split(".").reduce((n, a) => n && n[a], e);
|
|
598
604
|
}
|
|
599
605
|
const Se = (e, t) => {
|
|
@@ -601,7 +607,7 @@ const Se = (e, t) => {
|
|
|
601
607
|
for (const [a, s] of t)
|
|
602
608
|
n[a] = s;
|
|
603
609
|
return n;
|
|
604
|
-
},
|
|
610
|
+
}, sn = ["onClick"], rn = {
|
|
605
611
|
__name: "index",
|
|
606
612
|
props: /* @__PURE__ */ Xe({
|
|
607
613
|
api: {
|
|
@@ -641,7 +647,7 @@ const Se = (e, t) => {
|
|
|
641
647
|
}),
|
|
642
648
|
emits: /* @__PURE__ */ Xe(["success", "change", "changeAll"], ["update:modelValue"]),
|
|
643
649
|
setup(e, { emit: t }) {
|
|
644
|
-
const n = e, a =
|
|
650
|
+
const n = e, a = Lt(), { t: s, locale: o } = pe(), l = Tt(e, "modelValue"), r = ce(() => a["value-key"] != null), i = U(""), y = ce(() => {
|
|
645
651
|
if (a.remote !== void 0)
|
|
646
652
|
return n.data;
|
|
647
653
|
const b = pt(i.value), { data: w, labelValue: G } = n, te = w || g.value;
|
|
@@ -733,7 +739,7 @@ const Se = (e, t) => {
|
|
|
733
739
|
const W = ce(() => I.value);
|
|
734
740
|
return (b, w) => {
|
|
735
741
|
const G = M("el-checkbox"), te = M("el-select-v2"), _ = M("el-option"), ye = M("el-select");
|
|
736
|
-
return K(a).v2 != null ? (
|
|
742
|
+
return K(a).v2 != null ? (L(), H(te, ge({
|
|
737
743
|
key: 0,
|
|
738
744
|
options: W.value,
|
|
739
745
|
modelValue: l.value,
|
|
@@ -749,7 +755,7 @@ const Se = (e, t) => {
|
|
|
749
755
|
default: D(({ item: z }) => [
|
|
750
756
|
re("div", {
|
|
751
757
|
onClick: (fe) => h(z)
|
|
752
|
-
}, Q(z.label), 9,
|
|
758
|
+
}, Q(z.label), 9, sn)
|
|
753
759
|
]),
|
|
754
760
|
_: 2
|
|
755
761
|
}, [
|
|
@@ -772,7 +778,7 @@ const Se = (e, t) => {
|
|
|
772
778
|
]),
|
|
773
779
|
key: "0"
|
|
774
780
|
} : void 0
|
|
775
|
-
]), 1040, ["options", "modelValue"])) : (
|
|
781
|
+
]), 1040, ["options", "modelValue"])) : (L(), H(ye, ge({
|
|
776
782
|
key: 1,
|
|
777
783
|
modelValue: l.value,
|
|
778
784
|
"onUpdate:modelValue": w[3] || (w[3] = (z) => l.value = z),
|
|
@@ -796,7 +802,7 @@ const Se = (e, t) => {
|
|
|
796
802
|
_: 1
|
|
797
803
|
}, 8, ["modelValue"])
|
|
798
804
|
], !0) : de("", !0),
|
|
799
|
-
(
|
|
805
|
+
(L(!0), ie(Me, null, st(y.value, (z, fe) => (L(), H(_, {
|
|
800
806
|
key: fe,
|
|
801
807
|
label: k(z),
|
|
802
808
|
disabled: K(a).multiple != null && e.maxLimit > 0 ? V(z) : !1,
|
|
@@ -808,8 +814,8 @@ const Se = (e, t) => {
|
|
|
808
814
|
}, 16, ["modelValue", "filter-method", "onClear"]));
|
|
809
815
|
};
|
|
810
816
|
}
|
|
811
|
-
},
|
|
812
|
-
const
|
|
817
|
+
}, cn = /* @__PURE__ */ Se(rn, [["__scopeId", "data-v-51bd1467"]]);
|
|
818
|
+
const un = ot({
|
|
813
819
|
props: {
|
|
814
820
|
name: {
|
|
815
821
|
tyepe: String,
|
|
@@ -817,16 +823,16 @@ const cn = ot({
|
|
|
817
823
|
}
|
|
818
824
|
}
|
|
819
825
|
});
|
|
820
|
-
function
|
|
826
|
+
function dn(e, t, n, a, s, o) {
|
|
821
827
|
const l = M("el-icon");
|
|
822
|
-
return
|
|
828
|
+
return L(), H(l, { class: "cmp-icon" }, {
|
|
823
829
|
default: D(() => [
|
|
824
|
-
(
|
|
830
|
+
(L(), H(rt(e.name)))
|
|
825
831
|
]),
|
|
826
832
|
_: 1
|
|
827
833
|
});
|
|
828
834
|
}
|
|
829
|
-
const yt = /* @__PURE__ */ Se(
|
|
835
|
+
const yt = /* @__PURE__ */ Se(un, [["render", dn], ["__scopeId", "data-v-733f9daa"]]), Gn = {
|
|
830
836
|
__name: "index",
|
|
831
837
|
emits: ["ok", "no"],
|
|
832
838
|
setup(e, { emit: t }) {
|
|
@@ -838,7 +844,7 @@ const yt = /* @__PURE__ */ Se(cn, [["render", un], ["__scopeId", "data-v-733f9da
|
|
|
838
844
|
}
|
|
839
845
|
return (o, l) => {
|
|
840
846
|
const r = M("el-popconfirm");
|
|
841
|
-
return
|
|
847
|
+
return L(), ie("span", null, [
|
|
842
848
|
O(r, ge(o.$attrs, {
|
|
843
849
|
onConfirm: K(a),
|
|
844
850
|
onCancel: s
|
|
@@ -852,7 +858,7 @@ const yt = /* @__PURE__ */ Se(cn, [["render", un], ["__scopeId", "data-v-733f9da
|
|
|
852
858
|
};
|
|
853
859
|
}
|
|
854
860
|
};
|
|
855
|
-
const
|
|
861
|
+
const fn = ["accept"], hn = {
|
|
856
862
|
__name: "index",
|
|
857
863
|
props: {
|
|
858
864
|
accept: {
|
|
@@ -885,7 +891,7 @@ const dn = ["accept"], fn = {
|
|
|
885
891
|
}
|
|
886
892
|
return (l, r) => {
|
|
887
893
|
const i = M("el-button");
|
|
888
|
-
return
|
|
894
|
+
return L(), ie("span", null, [
|
|
889
895
|
O(i, {
|
|
890
896
|
type: "primary",
|
|
891
897
|
loading: s.value,
|
|
@@ -904,11 +910,11 @@ const dn = ["accept"], fn = {
|
|
|
904
910
|
accept: e.accept,
|
|
905
911
|
style: { position: "absolute", width: "0px", height: "0px", opacity: "0" },
|
|
906
912
|
type: "file"
|
|
907
|
-
}, null, 40,
|
|
913
|
+
}, null, 40, fn)
|
|
908
914
|
]);
|
|
909
915
|
};
|
|
910
916
|
}
|
|
911
|
-
},
|
|
917
|
+
}, Jn = /* @__PURE__ */ Se(hn, [["__scopeId", "data-v-cf92fafe"]]);
|
|
912
918
|
function Pe(e) {
|
|
913
919
|
let t = {};
|
|
914
920
|
return e.forEach((n) => {
|
|
@@ -927,7 +933,7 @@ function Pe(e) {
|
|
|
927
933
|
t[a] = l;
|
|
928
934
|
}), t;
|
|
929
935
|
}
|
|
930
|
-
const
|
|
936
|
+
const mn = { key: 0 }, gn = { class: "btns" }, pn = { class: "left" }, yn = { class: "right" }, vn = {
|
|
931
937
|
__name: "index",
|
|
932
938
|
props: {
|
|
933
939
|
form: {
|
|
@@ -962,7 +968,7 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
962
968
|
}
|
|
963
969
|
return t({ getPrm: m, reset: c }), (h, x) => {
|
|
964
970
|
const k = M("el-input"), C = M("el-date-picker"), E = M("el-form-item"), V = M("el-form"), B = M("el-link"), I = M("el-button");
|
|
965
|
-
return
|
|
971
|
+
return L(), ie("div", {
|
|
966
972
|
class: "searchBar-container mgt10 mgb10",
|
|
967
973
|
onKeydown: Dt(y, ["enter"])
|
|
968
974
|
}, [
|
|
@@ -975,25 +981,25 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
975
981
|
model: e.form.data
|
|
976
982
|
}, {
|
|
977
983
|
default: D(() => [
|
|
978
|
-
(
|
|
984
|
+
(L(!0), ie(Me, null, st(e.form.items.filter(($) => !$.hidden), ($) => (L(), ie(Me, {
|
|
979
985
|
key: $.key
|
|
980
986
|
}, [
|
|
981
|
-
$.type == "br" ? (
|
|
987
|
+
$.type == "br" ? (L(), ie("br", mn)) : (L(), H(E, {
|
|
982
988
|
key: 1,
|
|
983
989
|
label: $.name
|
|
984
990
|
}, {
|
|
985
991
|
default: D(() => {
|
|
986
992
|
var W, b;
|
|
987
993
|
return [
|
|
988
|
-
$.type === "input" ? (
|
|
994
|
+
$.type === "input" ? (L(), H(k, {
|
|
989
995
|
key: 0,
|
|
990
996
|
modelValue: $.value,
|
|
991
997
|
"onUpdate:modelValue": (w) => $.value = w,
|
|
992
998
|
class: qe(((W = $.option) == null ? void 0 : W.class) || "w150"),
|
|
993
999
|
placeholder: h.$t("qing-shu-ru"),
|
|
994
1000
|
clearable: ""
|
|
995
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) : $.type === "custom" ? (
|
|
996
|
-
$.type === "select" ? (
|
|
1001
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) : $.type === "custom" ? (L(), H(rt($.render), { key: 1 })) : de("", !0),
|
|
1002
|
+
$.type === "select" ? (L(), H(cn, ge({
|
|
997
1003
|
key: 2,
|
|
998
1004
|
class: ((b = $.option) == null ? void 0 : b.class) || "w150",
|
|
999
1005
|
modelValue: $.value,
|
|
@@ -1002,7 +1008,7 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
1002
1008
|
onChange: y,
|
|
1003
1009
|
onClear: (w) => p($)
|
|
1004
1010
|
}), null, 16, ["class", "modelValue", "onUpdate:modelValue", "onClear"])) : de("", !0),
|
|
1005
|
-
$.type === "date" ? (
|
|
1011
|
+
$.type === "date" ? (L(), H(C, {
|
|
1006
1012
|
key: 3,
|
|
1007
1013
|
class: qe({ datetimerange: "w300", daterange: "w200" }[$.dateType] || "w100"),
|
|
1008
1014
|
modelValue: $.value,
|
|
@@ -1024,11 +1030,11 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
1024
1030
|
_: 1
|
|
1025
1031
|
}, 8, ["model"])
|
|
1026
1032
|
], 4),
|
|
1027
|
-
re("div",
|
|
1028
|
-
re("div",
|
|
1033
|
+
re("div", gn, [
|
|
1034
|
+
re("div", pn, [
|
|
1029
1035
|
ee(h.$slots, "table-header-left", {}, void 0, !0)
|
|
1030
1036
|
]),
|
|
1031
|
-
re("div",
|
|
1037
|
+
re("div", yn, [
|
|
1032
1038
|
O(B, {
|
|
1033
1039
|
underline: "never",
|
|
1034
1040
|
class: "mgr10",
|
|
@@ -1068,7 +1074,7 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
1068
1074
|
], 32);
|
|
1069
1075
|
};
|
|
1070
1076
|
}
|
|
1071
|
-
},
|
|
1077
|
+
}, bn = /* @__PURE__ */ Se(vn, [["__scopeId", "data-v-3c0a6716"]]), vt = {
|
|
1072
1078
|
// 分页参数名
|
|
1073
1079
|
pageNoKey: "pageNo",
|
|
1074
1080
|
// 页码参数名
|
|
@@ -1099,7 +1105,7 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
1099
1105
|
// 是否启用单元格选区复制功能
|
|
1100
1106
|
};
|
|
1101
1107
|
let _e = { ...vt };
|
|
1102
|
-
function
|
|
1108
|
+
function Xn(e) {
|
|
1103
1109
|
_e = {
|
|
1104
1110
|
..._e,
|
|
1105
1111
|
...e,
|
|
@@ -1109,13 +1115,13 @@ function Jn(e) {
|
|
|
1109
1115
|
}
|
|
1110
1116
|
};
|
|
1111
1117
|
}
|
|
1112
|
-
function
|
|
1118
|
+
function wn() {
|
|
1113
1119
|
return _e;
|
|
1114
1120
|
}
|
|
1115
|
-
function
|
|
1121
|
+
function Qn() {
|
|
1116
1122
|
_e = { ...vt };
|
|
1117
1123
|
}
|
|
1118
|
-
const
|
|
1124
|
+
const Cn = { class: "center" }, xn = {
|
|
1119
1125
|
__name: "index",
|
|
1120
1126
|
props: {
|
|
1121
1127
|
// 表格id 本地存储列设置时使用,不传则使用路由路径自动生成
|
|
@@ -1152,7 +1158,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1152
1158
|
}
|
|
1153
1159
|
},
|
|
1154
1160
|
setup(e, { expose: t }) {
|
|
1155
|
-
const { t: n, locale: a } = pe(), s = jt(), o =
|
|
1161
|
+
const { t: n, locale: a } = pe(), s = jt(), o = wn(), l = e, r = U(!1), i = U([]);
|
|
1156
1162
|
l.searchForm.showSearch === void 0 && (l.searchForm.showSearch = o.showSearch), l.searchForm.showPage === void 0 && (l.searchForm.showPage = o.showPage), l.searchForm.showShadow === void 0 && (l.searchForm.showShadow = o.showShadow), l.searchForm.showCheckBox === void 0 && (l.searchForm.showCheckBox = o.showCheckBox), l.searchForm.enableCellCopy === void 0 && (l.searchForm.enableCellCopy = o.enableCellCopy), l.searchForm.selections || (l.searchForm.selections = []);
|
|
1157
1163
|
const y = ce(() => {
|
|
1158
1164
|
const d = s.path.replace(/\//g, "-").replace(/^-/, "") || "default-table";
|
|
@@ -1301,17 +1307,17 @@ const wn = { class: "center" }, Cn = {
|
|
|
1301
1307
|
return null;
|
|
1302
1308
|
let q = -1;
|
|
1303
1309
|
const se = u.getAttribute("data-colid");
|
|
1304
|
-
if (se && (q = T.getColumns().findIndex((
|
|
1305
|
-
const
|
|
1310
|
+
if (se && (q = T.getColumns().findIndex((F) => F.id === se)), q < 0) {
|
|
1311
|
+
const F = Array.from(S.querySelectorAll(".vxe-body--column")).indexOf(u), Y = !!u.closest(".vxe-table--fixed-left-wrapper"), J = !!u.closest(".vxe-table--fixed-right-wrapper"), R = T.getColumns();
|
|
1306
1312
|
if (Y) {
|
|
1307
1313
|
const X = R.filter((N) => N.fixed === "left");
|
|
1308
|
-
|
|
1314
|
+
F < X.length && (q = R.indexOf(X[F]));
|
|
1309
1315
|
} else if (J) {
|
|
1310
1316
|
const X = R.filter((N) => N.fixed === "right");
|
|
1311
|
-
|
|
1317
|
+
F < X.length && (q = R.indexOf(X[F]));
|
|
1312
1318
|
} else {
|
|
1313
1319
|
const X = l.searchForm.showCheckBox ? 1 : 0;
|
|
1314
|
-
q = R.filter((oe) => oe.fixed === "left").length +
|
|
1320
|
+
q = R.filter((oe) => oe.fixed === "left").length + F - X;
|
|
1315
1321
|
}
|
|
1316
1322
|
}
|
|
1317
1323
|
return q < 0 ? null : { rowIndex: P, colIndex: q, cell: u };
|
|
@@ -1359,10 +1365,10 @@ const wn = { class: "center" }, Cn = {
|
|
|
1359
1365
|
const d = _.startCell.rowIndex, u = _.endCell.rowIndex, S = _.startCell.colIndex, T = _.endCell.colIndex, P = Math.min(d, u), Z = Math.max(d, u), q = Math.min(S, T), se = Math.max(S, T);
|
|
1360
1366
|
_.selectedCells = [];
|
|
1361
1367
|
for (let A = P; A <= Z; A++)
|
|
1362
|
-
for (let
|
|
1368
|
+
for (let F = q; F <= se; F++)
|
|
1363
1369
|
_.selectedCells.push({
|
|
1364
1370
|
rowIndex: A,
|
|
1365
|
-
colIndex:
|
|
1371
|
+
colIndex: F
|
|
1366
1372
|
});
|
|
1367
1373
|
}, He = () => {
|
|
1368
1374
|
we(() => {
|
|
@@ -1382,7 +1388,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1382
1388
|
);
|
|
1383
1389
|
}), _.selectedCells.length === 0)
|
|
1384
1390
|
return;
|
|
1385
|
-
const S = d.getColumns(), T = _.selectedCells.map((Y) => Y.rowIndex), P = _.selectedCells.map((Y) => Y.colIndex), Z = Math.min(...T), q = Math.max(...T), se = Math.min(...P), A = Math.max(...P),
|
|
1391
|
+
const S = d.getColumns(), T = _.selectedCells.map((Y) => Y.rowIndex), P = _.selectedCells.map((Y) => Y.colIndex), Z = Math.min(...T), q = Math.max(...T), se = Math.min(...P), A = Math.max(...P), F = [
|
|
1386
1392
|
u.querySelector(".vxe-table--body-wrapper tbody"),
|
|
1387
1393
|
u.querySelector(".vxe-table--fixed-left-wrapper tbody"),
|
|
1388
1394
|
u.querySelector(".vxe-table--fixed-right-wrapper tbody")
|
|
@@ -1392,7 +1398,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1392
1398
|
if (!R)
|
|
1393
1399
|
return;
|
|
1394
1400
|
const X = R.fixed === "left", N = R.fixed === "right";
|
|
1395
|
-
for (const oe of
|
|
1401
|
+
for (const oe of F) {
|
|
1396
1402
|
const xe = oe.querySelectorAll(".vxe-body--row")[Y];
|
|
1397
1403
|
if (!xe)
|
|
1398
1404
|
continue;
|
|
@@ -1422,20 +1428,20 @@ const wn = { class: "center" }, Cn = {
|
|
|
1422
1428
|
if (!d)
|
|
1423
1429
|
return;
|
|
1424
1430
|
const u = d.$el, S = d.getColumns(), T = [...new Set(_.selectedCells.map((A) => A.rowIndex))].sort(
|
|
1425
|
-
(A,
|
|
1431
|
+
(A, F) => A - F
|
|
1426
1432
|
), P = [...new Set(_.selectedCells.map((A) => A.colIndex))].sort(
|
|
1427
|
-
(A,
|
|
1433
|
+
(A, F) => A - F
|
|
1428
1434
|
), Z = [
|
|
1429
1435
|
u.querySelector(".vxe-table--body-wrapper tbody"),
|
|
1430
1436
|
u.querySelector(".vxe-table--fixed-left-wrapper tbody"),
|
|
1431
1437
|
u.querySelector(".vxe-table--fixed-right-wrapper tbody")
|
|
1432
1438
|
].filter(Boolean), q = [];
|
|
1433
1439
|
T.forEach((A) => {
|
|
1434
|
-
const
|
|
1440
|
+
const F = [];
|
|
1435
1441
|
P.forEach((Y) => {
|
|
1436
1442
|
const J = S[Y];
|
|
1437
1443
|
if (!J) {
|
|
1438
|
-
|
|
1444
|
+
F.push("");
|
|
1439
1445
|
return;
|
|
1440
1446
|
}
|
|
1441
1447
|
const R = J.fixed === "left", X = J.fixed === "right";
|
|
@@ -1461,8 +1467,8 @@ const wn = { class: "center" }, Cn = {
|
|
|
1461
1467
|
break;
|
|
1462
1468
|
}
|
|
1463
1469
|
}
|
|
1464
|
-
|
|
1465
|
-
}), q.push(
|
|
1470
|
+
F.push(N);
|
|
1471
|
+
}), q.push(F.join(" "));
|
|
1466
1472
|
});
|
|
1467
1473
|
const se = q.join(`
|
|
1468
1474
|
`);
|
|
@@ -1500,14 +1506,14 @@ const wn = { class: "center" }, Cn = {
|
|
|
1500
1506
|
return t({ tableRef: f, getList: I, getPrm: W, clearSort: b, calculateTableHeight: x }), (d, u) => {
|
|
1501
1507
|
var A;
|
|
1502
1508
|
const S = M("el-button"), T = M("el-checkbox"), P = M("el-text"), Z = M("vxe-column"), q = M("VxeTable"), se = M("el-pagination");
|
|
1503
|
-
return
|
|
1509
|
+
return L(), ie("div", {
|
|
1504
1510
|
class: qe({ box: e.searchForm.showShadow })
|
|
1505
1511
|
}, [
|
|
1506
|
-
e.searchForm.showSearch ? (
|
|
1512
|
+
e.searchForm.showSearch ? (L(), H(bn, {
|
|
1507
1513
|
key: 0,
|
|
1508
1514
|
form: e.searchForm,
|
|
1509
1515
|
onReset: $,
|
|
1510
|
-
onConfirm: u[1] || (u[1] = (
|
|
1516
|
+
onConfirm: u[1] || (u[1] = (F) => I()),
|
|
1511
1517
|
onVisibleChange: K(x)
|
|
1512
1518
|
}, {
|
|
1513
1519
|
btn: D(() => [
|
|
@@ -1516,7 +1522,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1516
1522
|
O(S, {
|
|
1517
1523
|
class: "mgl10",
|
|
1518
1524
|
round: "",
|
|
1519
|
-
onClick: u[0] || (u[0] = (
|
|
1525
|
+
onClick: u[0] || (u[0] = (F) => f.value.openCustom())
|
|
1520
1526
|
}, {
|
|
1521
1527
|
default: D(() => [
|
|
1522
1528
|
O(yt, { name: "Tools" })
|
|
@@ -1545,22 +1551,22 @@ const wn = { class: "center" }, Cn = {
|
|
|
1545
1551
|
onSortChange: (A = te.value["sort-config"]) == null ? void 0 : A.sortChange
|
|
1546
1552
|
}), {
|
|
1547
1553
|
default: D(() => [
|
|
1548
|
-
e.searchForm.showCheckBox == null || e.searchForm.showCheckBox ? (
|
|
1554
|
+
e.searchForm.showCheckBox == null || e.searchForm.showCheckBox ? (L(), H(Z, {
|
|
1549
1555
|
key: 0,
|
|
1550
1556
|
type: "checkbox",
|
|
1551
1557
|
width: K(a) == "zh_cn" ? 80 : 150,
|
|
1552
1558
|
title: d.$t("xu-hao"),
|
|
1553
1559
|
fixed: "left"
|
|
1554
1560
|
}, {
|
|
1555
|
-
checkbox: D(({ rowIndex:
|
|
1556
|
-
re("div",
|
|
1557
|
-
J ? (
|
|
1561
|
+
checkbox: D(({ rowIndex: F, row: Y, checked: J, disabled: R, indeterminate: X }) => [
|
|
1562
|
+
re("div", Cn, [
|
|
1563
|
+
J ? (L(), H(T, {
|
|
1558
1564
|
key: 0,
|
|
1559
1565
|
checked: !0,
|
|
1560
1566
|
disabled: R,
|
|
1561
1567
|
size: "default",
|
|
1562
1568
|
onClick: Ve((N) => !R && Ge(Y), ["stop"])
|
|
1563
|
-
}, null, 8, ["disabled", "onClick"])) : (
|
|
1569
|
+
}, null, 8, ["disabled", "onClick"])) : (L(), H(T, {
|
|
1564
1570
|
key: 1,
|
|
1565
1571
|
disabled: R,
|
|
1566
1572
|
checked: !1,
|
|
@@ -1572,7 +1578,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1572
1578
|
class: "mgl5"
|
|
1573
1579
|
}, {
|
|
1574
1580
|
default: D(() => [
|
|
1575
|
-
ne(Q(
|
|
1581
|
+
ne(Q(F + 1), 1)
|
|
1576
1582
|
]),
|
|
1577
1583
|
_: 2
|
|
1578
1584
|
}, 1024)
|
|
@@ -1585,10 +1591,10 @@ const wn = { class: "center" }, Cn = {
|
|
|
1585
1591
|
_: 3
|
|
1586
1592
|
}, 16, ["id", "loading", "data", "height", "onSortChange"])
|
|
1587
1593
|
], 512),
|
|
1588
|
-
e.searchForm.showPage ? (
|
|
1594
|
+
e.searchForm.showPage ? (L(), H(se, {
|
|
1589
1595
|
key: 1,
|
|
1590
1596
|
"current-page": m[K(v)],
|
|
1591
|
-
"onUpdate:currentPage": u[2] || (u[2] = (
|
|
1597
|
+
"onUpdate:currentPage": u[2] || (u[2] = (F) => m[K(v)] = F),
|
|
1592
1598
|
class: "myPagination mgt10",
|
|
1593
1599
|
background: "",
|
|
1594
1600
|
layout: "total, sizes, prev, pager, next",
|
|
@@ -1601,7 +1607,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1601
1607
|
], 2);
|
|
1602
1608
|
};
|
|
1603
1609
|
}
|
|
1604
|
-
},
|
|
1610
|
+
}, eo = /* @__PURE__ */ Se(xn, [["__scopeId", "data-v-c022c16d"]]), to = {
|
|
1605
1611
|
__name: "index",
|
|
1606
1612
|
props: {
|
|
1607
1613
|
sheetsConfig: {
|
|
@@ -1616,11 +1622,11 @@ const wn = { class: "center" }, Cn = {
|
|
|
1616
1622
|
setup(e) {
|
|
1617
1623
|
const t = e;
|
|
1618
1624
|
function n() {
|
|
1619
|
-
|
|
1625
|
+
on(t.fileName, t.sheetsConfig);
|
|
1620
1626
|
}
|
|
1621
1627
|
return (a, s) => {
|
|
1622
1628
|
const o = M("el-link");
|
|
1623
|
-
return
|
|
1629
|
+
return L(), H(o, ge({
|
|
1624
1630
|
type: "primary",
|
|
1625
1631
|
underline: "never"
|
|
1626
1632
|
}, a.$attrs, { onClick: n }), {
|
|
@@ -1633,7 +1639,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1633
1639
|
}, 16);
|
|
1634
1640
|
};
|
|
1635
1641
|
}
|
|
1636
|
-
},
|
|
1642
|
+
}, kn = {
|
|
1637
1643
|
mounted(e, t) {
|
|
1638
1644
|
t.value && tt(e);
|
|
1639
1645
|
},
|
|
@@ -1717,10 +1723,10 @@ async function tt(e) {
|
|
|
1717
1723
|
function nt(e) {
|
|
1718
1724
|
document.removeEventListener("mousedown", e.__mouseDown__), document.removeEventListener("mousemove", e.__mouseMove__), document.removeEventListener("mouseup", e.__mouseUp__), window.removeEventListener("resize", e.__sizeChange__);
|
|
1719
1725
|
}
|
|
1720
|
-
const
|
|
1726
|
+
const _n = {
|
|
1721
1727
|
key: 0,
|
|
1722
1728
|
class: "drawer-btn"
|
|
1723
|
-
},
|
|
1729
|
+
}, $n = { key: 1 }, no = {
|
|
1724
1730
|
__name: "index",
|
|
1725
1731
|
props: {
|
|
1726
1732
|
layer: {
|
|
@@ -1753,7 +1759,7 @@ const kn = {
|
|
|
1753
1759
|
}
|
|
1754
1760
|
return (r, i) => {
|
|
1755
1761
|
const y = M("el-button"), p = M("el-drawer"), v = M("el-dialog");
|
|
1756
|
-
return e.layer.type ? (
|
|
1762
|
+
return e.layer.type ? (L(), H(p, {
|
|
1757
1763
|
key: 0,
|
|
1758
1764
|
modelValue: e.layer.show,
|
|
1759
1765
|
"onUpdate:modelValue": i[0] || (i[0] = (g) => e.layer.show = g),
|
|
@@ -1767,7 +1773,7 @@ const kn = {
|
|
|
1767
1773
|
default: D(() => [
|
|
1768
1774
|
ee(r.$slots, "default"),
|
|
1769
1775
|
i[2] || (i[2] = re("p", { class: "mgt50" }, null, -1)),
|
|
1770
|
-
e.layer.showButton ? (
|
|
1776
|
+
e.layer.showButton ? (L(), ie("div", _n, [
|
|
1771
1777
|
ee(r.$slots, "btn", {}, () => [
|
|
1772
1778
|
O(y, { onClick: l }, {
|
|
1773
1779
|
default: D(() => [
|
|
@@ -1789,7 +1795,7 @@ const kn = {
|
|
|
1789
1795
|
])) : de("", !0)
|
|
1790
1796
|
]),
|
|
1791
1797
|
_: 3
|
|
1792
|
-
}, 8, ["modelValue", "size", "title"])) : Vt((
|
|
1798
|
+
}, 8, ["modelValue", "size", "title"])) : Vt((L(), ie("div", $n, [
|
|
1793
1799
|
O(v, {
|
|
1794
1800
|
"close-on-click-modal": !1,
|
|
1795
1801
|
modelValue: e.layer.show,
|
|
@@ -1828,12 +1834,12 @@ const kn = {
|
|
|
1828
1834
|
} : void 0
|
|
1829
1835
|
]), 1032, ["modelValue", "title", "width"])
|
|
1830
1836
|
])), [
|
|
1831
|
-
[K(
|
|
1837
|
+
[K(kn), e.layer.show]
|
|
1832
1838
|
]);
|
|
1833
1839
|
};
|
|
1834
1840
|
}
|
|
1835
1841
|
};
|
|
1836
|
-
function
|
|
1842
|
+
function oo(e, t = {}) {
|
|
1837
1843
|
const n = Ce(), a = {
|
|
1838
1844
|
inForm: !0,
|
|
1839
1845
|
required: !0,
|
|
@@ -1851,7 +1857,7 @@ function no(e, t = {}) {
|
|
|
1851
1857
|
p && !s.test(p) ? v(new Error(i)) : v();
|
|
1852
1858
|
} : s.test(l);
|
|
1853
1859
|
}
|
|
1854
|
-
class
|
|
1860
|
+
class lo {
|
|
1855
1861
|
constructor(t = {}) {
|
|
1856
1862
|
this.config = {
|
|
1857
1863
|
clientCode: t.clientCode || "one-portal",
|
|
@@ -2057,7 +2063,7 @@ class oo {
|
|
|
2057
2063
|
return this.config[t];
|
|
2058
2064
|
}
|
|
2059
2065
|
}
|
|
2060
|
-
function
|
|
2066
|
+
function ao(e, t = {}) {
|
|
2061
2067
|
const a = Object.assign({
|
|
2062
2068
|
manual: !1,
|
|
2063
2069
|
// 手动执行
|
|
@@ -2088,14 +2094,14 @@ function lo(e, t = {}) {
|
|
|
2088
2094
|
};
|
|
2089
2095
|
return s || v(), [p, y, v];
|
|
2090
2096
|
}
|
|
2091
|
-
function
|
|
2097
|
+
function so(e) {
|
|
2092
2098
|
const t = U(e), n = U(""), a = U("");
|
|
2093
2099
|
return Re(t, (s) => {
|
|
2094
2100
|
const o = s || ["", ""];
|
|
2095
2101
|
n.value = o[0], a.value = o[1];
|
|
2096
2102
|
}), [t, n, a];
|
|
2097
2103
|
}
|
|
2098
|
-
function
|
|
2104
|
+
function ro(e) {
|
|
2099
2105
|
return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
|
|
2100
2106
|
}
|
|
2101
2107
|
function Oe(e, t) {
|
|
@@ -2109,7 +2115,7 @@ function Oe(e, t) {
|
|
|
2109
2115
|
let n = {};
|
|
2110
2116
|
return t.forEach((a) => n[a] = e[a]), n;
|
|
2111
2117
|
}
|
|
2112
|
-
function
|
|
2118
|
+
function io(e, t = []) {
|
|
2113
2119
|
const { locale: n } = pe(), a = U(e());
|
|
2114
2120
|
return Re(
|
|
2115
2121
|
[n, ...t],
|
|
@@ -2119,23 +2125,23 @@ function ro(e, t = []) {
|
|
|
2119
2125
|
{ immediate: !0 }
|
|
2120
2126
|
), a;
|
|
2121
2127
|
}
|
|
2122
|
-
function
|
|
2128
|
+
function co(e, t = "zh_cn", n = "en_us") {
|
|
2123
2129
|
if (!e)
|
|
2124
2130
|
return "-";
|
|
2125
2131
|
const a = { en_us: n, zh_cn: t }, o = Ke().global.locale.value;
|
|
2126
2132
|
return e[a[o]] || e[t] || "-";
|
|
2127
2133
|
}
|
|
2128
|
-
function
|
|
2134
|
+
function uo(e, t) {
|
|
2129
2135
|
let n = Pt;
|
|
2130
2136
|
return typeof e == "string" && e.length > 0 && (n = Ye(e).mapState), bt(t, n);
|
|
2131
2137
|
}
|
|
2132
|
-
function
|
|
2138
|
+
function fo(e, t) {
|
|
2133
2139
|
let n = Rt;
|
|
2134
2140
|
return typeof e == "string" && e.length > 0 && (n = Ye(e).mapGetters), bt(t, n);
|
|
2135
2141
|
}
|
|
2136
|
-
function
|
|
2142
|
+
function ho(e, t) {
|
|
2137
2143
|
let n = Bt;
|
|
2138
|
-
return typeof e == "string" && e.length > 0 && (n = Ye(e).mapActions),
|
|
2144
|
+
return typeof e == "string" && e.length > 0 && (n = Ye(e).mapActions), Sn(t, n);
|
|
2139
2145
|
}
|
|
2140
2146
|
function bt(e, t) {
|
|
2141
2147
|
const n = ut(), a = t(e), s = {};
|
|
@@ -2144,16 +2150,16 @@ function bt(e, t) {
|
|
|
2144
2150
|
s[o] = ce(l);
|
|
2145
2151
|
}), s;
|
|
2146
2152
|
}
|
|
2147
|
-
function
|
|
2153
|
+
function Sn(e, t) {
|
|
2148
2154
|
const n = ut(), a = t(e), s = {};
|
|
2149
2155
|
return Object.keys(a).forEach((o) => {
|
|
2150
2156
|
s[o] = a[o].bind({ $store: n });
|
|
2151
2157
|
}), s;
|
|
2152
2158
|
}
|
|
2153
|
-
function
|
|
2159
|
+
function Fe(e) {
|
|
2154
2160
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !qt(e);
|
|
2155
2161
|
}
|
|
2156
|
-
function
|
|
2162
|
+
function mo() {
|
|
2157
2163
|
ke.renderer.add("Enum", {
|
|
2158
2164
|
// 默认显示模板
|
|
2159
2165
|
renderTableDefault(e, t) {
|
|
@@ -2165,11 +2171,11 @@ function ho() {
|
|
|
2165
2171
|
let s;
|
|
2166
2172
|
return O(M("el-text"), {
|
|
2167
2173
|
type: e.enum.getTag(a)
|
|
2168
|
-
},
|
|
2174
|
+
}, Fe(s = e.enum.getName(a)) ? s : {
|
|
2169
2175
|
default: () => [s]
|
|
2170
2176
|
});
|
|
2171
2177
|
}
|
|
2172
|
-
return O(M("el-text"), null,
|
|
2178
|
+
return O(M("el-text"), null, Fe(n = e.enum.getName(a)) ? n : {
|
|
2173
2179
|
default: () => [n]
|
|
2174
2180
|
});
|
|
2175
2181
|
}
|
|
@@ -2191,7 +2197,7 @@ function ho() {
|
|
|
2191
2197
|
locale: n
|
|
2192
2198
|
} = pe();
|
|
2193
2199
|
let a = n.value == "zh_cn";
|
|
2194
|
-
return O(
|
|
2200
|
+
return O(Ft, {
|
|
2195
2201
|
type: t.row[t.column.field] ? "success" : "danger"
|
|
2196
2202
|
}, {
|
|
2197
2203
|
default: () => [t.row[t.column.field] ? a ? "是" : "YES" : a ? "否" : "NO"]
|
|
@@ -2229,7 +2235,7 @@ function ho() {
|
|
|
2229
2235
|
underline: "never",
|
|
2230
2236
|
type: "primary",
|
|
2231
2237
|
onclick: () => i(l == "stystem" ? o : p, p)
|
|
2232
|
-
},
|
|
2238
|
+
}, Fe(p) ? p : {
|
|
2233
2239
|
default: () => [p]
|
|
2234
2240
|
}), v < y.length - 1 ? "," : ""]));
|
|
2235
2241
|
}
|
|
@@ -2237,54 +2243,54 @@ function ho() {
|
|
|
2237
2243
|
underline: "never",
|
|
2238
2244
|
type: "primary",
|
|
2239
2245
|
onclick: () => i(l == "stystem" ? o : r, r)
|
|
2240
|
-
},
|
|
2246
|
+
}, Fe(r) ? r : {
|
|
2241
2247
|
default: () => [r]
|
|
2242
2248
|
});
|
|
2243
2249
|
}
|
|
2244
2250
|
});
|
|
2245
2251
|
}
|
|
2246
2252
|
export {
|
|
2247
|
-
|
|
2253
|
+
cn as CmpDictionary,
|
|
2248
2254
|
yt as CmpIcon,
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2255
|
+
Gn as ConfrimButton,
|
|
2256
|
+
to as DownExcelTemp,
|
|
2257
|
+
Jn as ImportButton,
|
|
2258
|
+
qn as LayOutForm,
|
|
2259
|
+
no as Layer,
|
|
2260
|
+
eo as ListPage,
|
|
2261
|
+
lo as OnePortalCasSDK,
|
|
2262
|
+
bn as SearchBar,
|
|
2257
2263
|
et as StatusMap,
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2264
|
+
Pn as _toRaw,
|
|
2265
|
+
ro as _typeOf,
|
|
2266
|
+
Bn as arrToStatusMap,
|
|
2267
|
+
Rn as arrayToTree,
|
|
2268
|
+
Hn as checkFileSize,
|
|
2269
|
+
oo as creatValidator,
|
|
2270
|
+
Wn as createImportFields,
|
|
2271
|
+
Nn as createListPageId,
|
|
2266
2272
|
je as en_us,
|
|
2267
|
-
|
|
2273
|
+
jn as exportExcel,
|
|
2268
2274
|
Ke as getI18n,
|
|
2269
2275
|
Ce as getI18nT,
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2276
|
+
wn as getListPageConfig,
|
|
2277
|
+
co as getLocaleValue,
|
|
2278
|
+
Zn as getValueBykey,
|
|
2279
|
+
An as importExcel,
|
|
2274
2280
|
Wt as messages,
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2281
|
+
mo as registerVxeRenderers,
|
|
2282
|
+
Qn as resetListPageConfig,
|
|
2283
|
+
Xn as setListPageConfig,
|
|
2278
2284
|
Zt as setupI18n,
|
|
2279
|
-
|
|
2285
|
+
Un as sleep,
|
|
2280
2286
|
pt as stringToArray,
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2287
|
+
Yn as stripHtmlTags,
|
|
2288
|
+
Kn as unicode2Str,
|
|
2289
|
+
ho as useActions,
|
|
2290
|
+
so as useDatePicker,
|
|
2291
|
+
fo as useGetters,
|
|
2292
|
+
io as useI18nReState,
|
|
2293
|
+
ao as useRequest,
|
|
2294
|
+
uo as useState,
|
|
2289
2295
|
Ae as zh_cn
|
|
2290
2296
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(p,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("element-plus"),require("vue"),require("file-saver"),require("exceljs"),require("dayjs"),require("vue-i18n"),require("lodash"),require("vue-router"),require("vuex"),require("vxe-pc-ui")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue","file-saver","exceljs","dayjs","vue-i18n","lodash","vue-router","vuex","vxe-pc-ui"],W):(p=typeof globalThis<"u"?globalThis:p||self,W(p.JoyAdminComponents={},p.ElementPlus,p.Vue,p.fileSaver,p.ExcelJS,p.dayjs,p.VueI18n,p._,p.VueRouter,p.Vuex,p.VxeUI))})(this,function(p,W,e,Le,pe,ue,ee,ne,ve,te,fe){"use strict";const Je=e.defineComponent({name:"LayOutForm",setup(t,{slots:o,attrs:n,emit:r}){const s=e.ref(null),l=()=>o.default?o.default().filter(i=>i.type!==Symbol.for("v-cmt")).map(i=>i.type===Symbol.for("v-fgt")?i.children:i).flat().map(i=>{var c;return e.h(W.ElCol,{span:((c=i.props)==null?void 0:c.span)||24},{default:()=>i})}):null;e.onMounted(()=>{r("ref",s.value)});function a(){return e.h(W.ElForm,{...n,ref:s},()=>e.h(W.ElRow,{gutter:n.gutter??20},{default:()=>l()}))}return a}});var Fe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function De(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Be={exports:{}};(function(t,o){(function(n,r){t.exports=r()})(Fe,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(l,a,i){var c=a.prototype;i.utc=function(d){var m={date:d,utc:!0,args:arguments};return new a(m)},c.utc=function(d){var m=i(this.toDate(),{locale:this.$L,utc:!0});return d?m.add(this.utcOffset(),n):m},c.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var b=c.parse;c.parse=function(d){d.utc&&(this.$u=!0),this.$utils().u(d.$offset)||(this.$offset=d.$offset),b.call(this,d)};var C=c.init;c.init=function(){if(this.$u){var d=this.$d;this.$y=d.getUTCFullYear(),this.$M=d.getUTCMonth(),this.$D=d.getUTCDate(),this.$W=d.getUTCDay(),this.$H=d.getUTCHours(),this.$m=d.getUTCMinutes(),this.$s=d.getUTCSeconds(),this.$ms=d.getUTCMilliseconds()}else C.call(this)};var w=c.utcOffset;c.utcOffset=function(d,m){var S=this.$utils().u;if(S(d))return this.$u?0:S(this.$offset)?w.call(this):this.$offset;if(typeof d=="string"&&(d=function(B){B===void 0&&(B="");var A=B.match(r);if(!A)return null;var L=(""+A[0]).match(s)||["-",0,0],E=L[0],U=60*+L[1]+ +L[2];return U===0?0:E==="+"?U:-U}(d),d===null))return this;var $=Math.abs(d)<=16?60*d:d;if($===0)return this.utc(m);var _=this.clone();if(m)return _.$offset=$,_.$u=!1,_;var I=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(_=this.local().add($+I,n)).$offset=$,_.$x.$localOffset=I,_};var y=c.format;c.format=function(d){var m=d||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return y.call(this,m)},c.valueOf=function(){var d=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*d},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var g=c.toDate;c.toDate=function(d){return d==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var h=c.diff;c.diff=function(d,m,S){if(d&&this.$u===d.$u)return h.call(this,d,m,S);var $=this.local(),_=i(d).local();return h.call($,_,m,S)}}})})(Be);var Xe=Be.exports;const Qe=De(Xe);var ze={exports:{}};(function(t,o){(function(n,r){t.exports=r()})(Fe,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(s,l,a){var i,c=function(y,g,h){h===void 0&&(h={});var d=new Date(y),m=function(S,$){$===void 0&&($={});var _=$.timeZoneName||"short",I=S+"|"+_,B=r[I];return B||(B=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:S,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:_}),r[I]=B),B}(g,h);return m.formatToParts(d)},b=function(y,g){for(var h=c(y,g),d=[],m=0;m<h.length;m+=1){var S=h[m],$=S.type,_=S.value,I=n[$];I>=0&&(d[I]=parseInt(_,10))}var B=d[3],A=B===24?0:B,L=d[0]+"-"+d[1]+"-"+d[2]+" "+A+":"+d[4]+":"+d[5]+":000",E=+y;return(a.utc(L).valueOf()-(E-=E%1e3))/6e4},C=l.prototype;C.tz=function(y,g){y===void 0&&(y=i);var h,d=this.utcOffset(),m=this.toDate(),S=m.toLocaleString("en-US",{timeZone:y}),$=Math.round((m-new Date(S))/1e3/60),_=15*-Math.round(m.getTimezoneOffset()/15)-$;if(!Number(_))h=this.utcOffset(0,g);else if(h=a(S,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(_,!0),g){var I=h.utcOffset();h=h.add(d-I,"minute")}return h.$x.$timezone=y,h},C.offsetName=function(y){var g=this.$x.$timezone||a.tz.guess(),h=c(this.valueOf(),g,{timeZoneName:y}).find(function(d){return d.type.toLowerCase()==="timezonename"});return h&&h.value};var w=C.startOf;C.startOf=function(y,g){if(!this.$x||!this.$x.$timezone)return w.call(this,y,g);var h=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return w.call(h,y,g).tz(this.$x.$timezone,!0)},a.tz=function(y,g,h){var d=h&&g,m=h||g||i,S=b(+a(),m);if(typeof y!="string")return a(y).tz(m);var $=function(A,L,E){var U=A-60*L*1e3,x=b(U,E);if(L===x)return[U,L];var k=b(U-=60*(x-L)*1e3,E);return x===k?[U,x]:[A-60*Math.min(x,k)*1e3,Math.max(x,k)]}(a.utc(y,d).valueOf(),S,m),_=$[0],I=$[1],B=a(_).utcOffset(I);return B.$x.$timezone=m,B},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(y){i=y}}})})(ze);var et=ze.exports;const tt=De(et),ye={"dao-ru":"导入","quan-xuan":"全选","xia-zai-dao-ru-mo-ban":"下载导入模板","xu-hao":"序号","qing-shu-ru":"请输入","qing-xuan-ze":"请选择","kai-shi-shi-jian":"开始时间","jie-shu-shi-jian":"结束时间","shai-xuan":"筛选","chong-zhi":"重置","guan-bi":"关闭","zhan-kai":"展开","qu-xiao":"取消","ti-jiao":"提交","que-ding":"确定","que-ding-guan-bi-ma":"确定关闭吗","xia-zai-dao-ru-mo-ban":"下载导入模板",excel:{fieldsMappingRequired:"请输入列字段映射",invalidInput:"非法输入",invalidOption:"请输入有效选项!",copyFailed:"复制失败",sheetNameTooLong:'Sheet名称 "{0}" 长度超过31个字符,已自动截断为 "{1}"'},validate:{invalidInput:"请输入正确内容"},tools:{keysLengthError:"keys 长度必须大于2 默认前两位为 label value"}},Ce={"dao-ru":"Import","quan-xuan":"Select All","xia-zai-dao-ru-mo-ban":"Download Import Template","xu-hao":"No.","qing-shu-ru":"Please enter","qing-xuan-ze":"Please select","kai-shi-shi-jian":"Start Time","jie-shu-shi-jian":"End Time","shai-xuan":"Filter","chong-zhi":"Reset","guan-bi":"Collapse","zhan-kai":"Expand","qu-xiao":"Cancel","ti-jiao":"Submit","que-ding":"Confirm","que-ding-guan-bi-ma":"Are you sure to close?","xia-zai-dao-ru-mo-ban":"Download Import Template",excel:{fieldsMappingRequired:"Please enter column field mapping",invalidInput:"Invalid input",invalidOption:"Please enter a valid option!",copyFailed:"Copy failed",sheetNameTooLong:'Sheet name "{0}" exceeds 31 characters, automatically truncated to "{1}"'},validate:{invalidInput:"Please enter valid content"},tools:{keysLengthError:"Keys length must be greater than 2, default first two are label and value"}},Me={zh_cn:ye,en_us:Ce};let ie=null;function Oe(t=null){if(t){const{global:o}=t;return o.messages.value.zh_cn?o.mergeLocaleMessage("zh_cn",ye):o.setLocaleMessage("zh_cn",ye),o.messages.value.en_us?o.mergeLocaleMessage("en_us",Ce):o.setLocaleMessage("en_us",Ce),ie=t,t}return ie||(ie=ee.createI18n({legacy:!1,locale:"zh_cn",fallbackLocale:"zh_cn",messages:Me})),ie}function be(){return ie||Oe()}function le(){return be().global.t}ue.extend(Qe),ue.extend(tt);async function ot(t,o){const{fields:n,range:r=1}=o;if(!n){const a=le();throw new Error(a("excel.fieldsMappingRequired"))}let s=new pe.Workbook;await s.xlsx.load(t);const l={};return s.eachSheet(function(a,i){const c=[];a.eachRow(function(b,C){if(C>r){let w={},y=!0;Object.keys(n).forEach(g=>{const h=b.getCell(n[g]).value;w[g]=h,h&&(y=!1)}),y||c.push(w)}}),l[a._name]=c}),s=null,l}const Ne={columnWidth:30};async function nt(t,o,n=[],r={}){if(!t||!o)return;const{columnStyle:s}=r,{columnWidth:l}=Ne;o.forEach(c=>{c.width=c.width?c.width:l});const{workbook:a,worksheet:i}=lt();i.columns=o,i.addRows(n),s&&await at(a,i,s);try{const c=await a.xlsx.writeBuffer(),b=new File([c],t,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Le.saveAs(b)}catch(c){console.log(c)}}function lt(){const t=new pe.Workbook;t.creator="distributor System",t.lastModifiedBy="distributor System",t.created=new Date,t.modified=new Date,t.lastPrinted=new Date;const o=t.addWorksheet("Sheet1");return{workbook:t,worksheet:o}}async function at(t,o,n){const r=Object.keys(n);for(const s of r){const l=n[s],{type:a}=l;switch(a){case"IMG":await rt(t,o,s);break}}}async function rt(t,o,n,r){const s=o.getColumn(n),l=s.values;o.getColumn(n).width=20,o.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&&(o.getCell(s.letter+a).value="",await st(t,o,c,{width:100,height:50,col:s._number-1,row:a-1}))}}async function st(t,o,n,r){const{col:s,row:l,width:a,height:i}=r,{success:c,base64:b}=await it(n,.3);if(c){const C=t.addImage({base64:b,extension:"jpeg"});o.addImage(C,{tl:{col:s,row:l},ext:{width:a,height:i}})}}function it(t,o=1){const n=new Image;return n.setAttribute("crossOrigin","anonymous"),n.crossOrigin="anonymous",n.src=t,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",o)})},n.onerror=()=>{r({success:!1})}})}const ke="---";async function ct(t,o){const{fields:n,range:r=1}=o;if(!n){const a=le();throw new Error(a("excel.fieldsMappingRequired"))}let s=new pe.Workbook;await s.xlsx.load(t);const l={};return s.eachSheet(function(a,i){if(a.state=="visible"){const c=[],b=n[a._name];if(b){let C=Object.values(b).some(y=>y.includes("image")),w={};C&&(a.getImages().forEach(g=>{const{tl:h}=g.range,d=s.model.media.find(m=>m.index===g.imageId);if(d){const m=d.buffer.toString("base64"),S=`data:image/${d.extension};base64,${m}`,$=`${Math.ceil(h.row)}_${Math.ceil(h.col)}`;w[$]?w[$].push(S):w[$]=[S]}}),console.log("withImages-imageMap",w)),a.eachRow(function(y,g){if(g>r){let h={},d=!0;Object.keys(b).forEach(m=>{var B;let[S,$]=b[m].split(ke);const _=y.getCell(S);let I;if($=="image"&&C){const A=_._column._number,L=`${g}_${A}`;I=w[L]||""}else _.result!=null?I=_.result:(B=_.value)!=null&&B.richText?I=_.value.richText.reduce((A,L)=>A+L.text,""):_.type==4&&_.value?I=ue(_.value).utc().format("YYYY-MM-DD HH:mm:ss"):I=_.value;I&&$=="option"&&(I=I.split(ke)[1]),h[m]=I,I&&(d=!1)}),d||c.push(h)}}),l[a._name]=c}}}),s=null,l}async function dt(t,o){if(!t||o.length==0)return;const n=ut(o);n.eachSheet(function(r,s){const{columnWidth:l}=Ne,{tableHeader:a,tableData:i}=o[r._name];a.forEach(c=>{if(c.required){const b=c.style||{},{font:C={}}=b;c.style={...b,font:{...C,color:{argb:"FFFF0000"}}}}}),r.columns=a,r.addRows(i),a.forEach(c=>{const{header:b,key:C,width:w,option:y}=c,g=r.getColumn(C);if(g.width=w||l,y){const h=n.addWorksheet(C);h.state="hidden",h.getColumn(1).values=y.map(d=>`${d.label}${ke}${d.value}`),Array(100).fill("").forEach((d,m)=>{if(m>0){const S=le();r.getCell(`${g.letter}${m}`).dataValidation={type:"list",formulae:[`${C}!$A$1:$A$${y.length}`],showErrorMessage:!0,error:S("excel.invalidInput"),errorStyle:"stop",errorMessage:S("excel.invalidOption")}}})}})});try{const r=await n.xlsx.writeBuffer(),s=new File([r],t,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Le.saveAs(s)}catch(r){console.log(r)}}function ut(t){const o=le(),n=new pe.Workbook;return n.creator="distributor System",n.lastModifiedBy="distributor System",n.created=new Date,n.modified=new Date,n.lastPrinted=new Date,Object.keys(t).sort((s,l)=>{const a=t[s].sort??0,i=t[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(o("excel.sheetNameTooLong",[l,s]))),a&&(t[s]=t[l],delete t[l]),n.addWorksheet(s)}),n}function ft(t){if(t<26)return String.fromCharCode(65+t);{const o=String.fromCharCode(65+Math.floor((t-26)/26)),n=String.fromCharCode(65+(t-26)%26);return o+n}}function ht(t){return new Promise(o=>{setTimeout(()=>{o()},t)})}function mt(t){return JSON.parse(JSON.stringify(t))}function gt(t){let o=[],n={},r=(s,l)=>Object.prototype.hasOwnProperty.call(s,l);for(const s of t){n[s.id]={...s,children:r(n,s.id)?n[s.id].children:[]};const l=n[s.id];s.pid==-1?o.push(l):(r(n,s.pid)||(n[s.pid]={children:[]}),n[s.pid].children.push(l))}return o}function _e(t,o=" "){return t?t.split(o).filter(n=>n.trim()):[]}class Se{constructor(o,n=["label","value","labelEn"]){this.list=o.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(o){if(!this.has(o))return"-";const n=be().global.locale,{label:r,labelEn:s}=this.map.get(o);return(n.value=="zh_cn"?r:s)??r??"-"}getTag(o){if(!this.has(o))return"info";const{tag:n="info"}=this.map.get(o);return n}getItem(o){return this.has(o)?this.map.get(o):null}getColor(o){if(!this.has(o))return null;const{color:n}=this.map.get(o);return n}has(o){return this.map.has(o)}}function pt(t,o=[],n="i18nName"){if(t.length==0)return new Se([]);if(o.length<2){const s=le();throw new Error(s("tools.keysLengthError"))}let r=t.map(s=>{let l={};return n&&(l.labelEn=s[n]),o.forEach((a,i)=>{i===0?l.label=s[a]:i===1?l.value=s[a]:l[a]=s[a]}),l});return new Se(r)}function yt(t){return t?t.replace(/<[^>]+>/g,""):""}function Ct(t){return t?(t.includes("\\\\u")&&(t=t.replace(/\\/g,"")),t.replace(/\\u[\dA-F]{4}/gi,o=>String.fromCharCode(parseInt(o.replace(/\\u/g,""),16)))):""}function bt(t,o=10){let n=1048576*o;return!(t.size>n)}function wt(t){return Array.from(10).fill(0).map((n,r)=>t+"_"+r)}function xt(t){let o={};return t.map((n,r)=>{let{key:s,option:l,type:a}=n,i=ft(r);l?o[s]=`${i}---option`:a==="image"?o[s]=`${i}---image`:o[s]=i}),o}function kt(t,o){return o.split(".").reduce((n,r)=>n&&n[r],t)}const lo="",he=(t,o)=>{const n=t.__vccOpts||t;for(const[r,s]of o)n[r]=s;return n},_t=["onClick"],qe=he({__name:"index",props:e.mergeModels({api:{type:Function},showCheckAll:{type:Boolean,default:!0},maxLimit:{type:Number,default:void 0},optionClick:{type:Function,default:()=>{}},data:{type:Array},labelValue:{type:Object,default:()=>({label:"label",labelEn:"labelEn",value:"value"})},changeLocal:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["success","change","changeAll"],["update:modelValue"]),setup(t,{emit:o}){const n=t,r=e.useAttrs(),{t:s,locale:l}=ee.useI18n(),a=e.useModel(t,"modelValue"),i=e.computed(()=>r["value-key"]!=null),c=e.ref(""),b=e.computed(()=>{if(r.remote!==void 0)return n.data;const x=_e(c.value),{data:k,labelValue:Y}=n,Z=k||y.value;if(x.length==0)return Z;const{label:V,labelEn:ce}=Y;let D=l.value=="en_us"?ce||"i18nName":V;return x.length==1?Z.filter(oe=>oe[D].toLowerCase().includes(x[0].toLowerCase())):Z.filter(oe=>{let de=!1;return de=x.some(xe=>oe[D].toLowerCase()==xe.toLowerCase()),de})}),C=e.computed({get(){return r.multiple==null||a.value==null?!1:a.value.length==b.value.length},set(x){return x}}),w=o,y=e.ref([]),g=async()=>{const{data:x}=await n.api();y.value=[...x],w("success",y)};n.api&&g();function h(x){w("change",x),d.value&&e.nextTick(()=>{n.optionClick&&n.optionClick(d.value),d.value=null})}const d=e.ref(null);function m(x){d.value=x}const S=n.labelValue.label.split("-"),$=x=>{if(S.length==1){if(n.changeLocal)return s(x[n.labelValue.label]);let k=l.value=="en_us"?x[n.labelValue.labelEn||"i18nName"]:x[n.labelValue.label];return k=k||x[n.labelValue.label],k+""}else{let k=[];return S.forEach(Y=>{k.push(x[Y])}),k.join("-")}};function _(x){let k=n.data?n.data:y.value;a.value=x?k.map(Y=>i.value?Y:Y[n.labelValue.value]):[],e.nextTick(()=>{w("change",a.value),w("changeAll",a.value,k)})}function I(x){w("change",i.value?x:x[n.labelValue.value]),e.nextTick(()=>{n.optionClick&&n.optionClick(x)})}function B(x){return a.value.length>=n.maxLimit&&!a.value.includes(x[n.labelValue.value])}function A(x){return x.map(k=>({...k,label:$(k),value:i.value?k:k[n.labelValue.value]}))}const L=e.ref([]),E=n.data?n.data:y.value;L.value=A(E),e.watch(()=>n.data?n.data:y.value,x=>{var Y;const k=A(x);if(k.length!==L.value.length)L.value=k;else{let Z=!1;for(let V=0;V<k.length;V++)if(k[V].value!==((Y=L.value[V])==null?void 0:Y.value)){Z=!0;break}Z&&(L.value=k)}},{deep:!0});const U=e.computed(()=>L.value);return(x,k)=>{const Y=e.resolveComponent("el-checkbox"),Z=e.resolveComponent("el-select-v2"),V=e.resolveComponent("el-option"),ce=e.resolveComponent("el-select");return e.unref(r).v2!=null?(e.openBlock(),e.createBlock(Z,e.mergeProps({key:0,options:U.value,modelValue:a.value,"onUpdate:modelValue":k[1]||(k[1]=D=>a.value=D)},e.unref(r),{filterable:"","collapse-tags":"","collapse-tags-tooltip":"",clearable:"",onChange:h,onClear:h}),e.createSlots({default:e.withCtx(({item:D})=>[e.createElementVNode("div",{onClick:ae=>m(D)},e.toDisplayString(D.label),9,_t)]),_:2},[e.unref(r).multiple!=null?{name:"header",fn:e.withCtx(()=>[e.renderSlot(x.$slots,"header",{},()=>[e.createVNode(Y,{class:"mgl20",modelValue:C.value,"onUpdate:modelValue":k[0]||(k[0]=D=>C.value=D),onChange:_},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0)]),key:"0"}:void 0]),1040,["options","modelValue"])):(e.openBlock(),e.createBlock(ce,e.mergeProps({key:1,modelValue:a.value,"onUpdate:modelValue":k[3]||(k[3]=D=>a.value=D),filterable:"","collapse-tags":"","collapse-tags-tooltip":"","filter-method":e.unref(r).remote!=null?void 0:D=>c.value=D,clearable:""},e.unref(r),{onClear:t.optionClick}),{default:e.withCtx(()=>[e.unref(r).multiple!=null&&t.showCheckAll&&t.maxLimit==null?e.renderSlot(x.$slots,"header",{key:0},()=>[e.createVNode(Y,{class:"mgl20",modelValue:C.value,"onUpdate:modelValue":k[2]||(k[2]=D=>C.value=D),onChange:_},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(D,ae)=>(e.openBlock(),e.createBlock(V,{key:ae,label:$(D),disabled:e.unref(r).multiple!=null&&t.maxLimit>0?B(D):!1,onClick:e.withModifiers(oe=>I(D),["stop"]),value:i.value?D:D[t.labelValue.value]},null,8,["label","disabled","onClick","value"]))),128))]),_:3},16,["modelValue","filter-method","onClear"]))}}},[["__scopeId","data-v-51bd1467"]]),ro="",St=e.defineComponent({props:{name:{tyepe:String,required:!0}}});function $t(t,o,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(t.name)))]),_:1})}const $e=he(St,[["render",$t],["__scopeId","data-v-733f9daa"]]),Vt={__name:"index",emits:["ok","no"],setup(t,{emit:o}){const n=o,r=ne.debounce(()=>{n("ok")},500);function s(){n("no")}return(l,a)=>{const i=e.resolveComponent("el-popconfirm");return e.openBlock(),e.createElementBlock("span",null,[e.createVNode(i,e.mergeProps(l.$attrs,{onConfirm:e.unref(r),onCancel:s}),{reference:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16,["onConfirm"])])}}},so="",Et=["accept"],Tt=he({__name:"index",props:{accept:{type:String,default:".xlsx,.xls"},fields:{type:Object,default:()=>({})},fileChange:{type:Function,required:!0}},emits:["fileChange"],setup(t,{emit:o}){const n=t,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,{type:"primary",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:t.accept,style:{position:"absolute",width:"0px",height:"0px",opacity:"0"},type:"file"},null,40,Et)])}}},[["__scopeId","data-v-cf92fafe"]]);function Ve(t){let o={};return t.forEach(n=>{const{key:r,type:s,option:l={},value:a,dateType:i="date"}=n;if(r)if(s=="input"&&(l!=null&&l.multiple))o[r]=_e(a);else if(s=="date")if(i.includes("range")){const[c,b]=r;let[C,w]=a||[];C&&i=="daterange"&&(C=ue(C).format("YYYY-MM-DD 00:00:00"),w=ue(w).format("YYYY-MM-DD 23:59:59")),o[c]=C,o[b]=w}else o[r]=a;else o[r]=a}),o}const co="",It={key:0},Lt={class:"btns"},vt={class:"left"},Ft={class:"right"},Ae=he({__name:"index",props:{form:{type:Object,required:!0}},emits:["confirm","reset","visibleChange"],setup(t,{expose:o,emit:n}){const r=t,s=n,l=e.ref(!0),a=e.ref(null),{t:i}=ee.useI18n(),c=e.computed(()=>l.value?i("guan-bi"):i("zhan-kai"));function b(){s("confirm")}function C(m){m.option.onClear&&m.option.onClear(),s("confirm")}function w(){s("reset")}function y(){s("confirm")}function g(){return Ve(r.form.items)}const h=ne.cloneDeep(r.form.items);function d(){r.form.items.forEach(m=>{const S=h.find($=>$.key==m.key);S&&(m.value=S.value)})}return o({getPrm:g,reset:d}),(m,S)=>{const $=e.resolveComponent("el-input"),_=e.resolveComponent("el-date-picker"),I=e.resolveComponent("el-form-item"),B=e.resolveComponent("el-form"),A=e.resolveComponent("el-link"),L=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",{class:"searchBar-container mgt10 mgb10",onKeydown:e.withKeys(b,["enter"])},[e.createElementVNode("div",{class:"searchBar",style:e.normalizeStyle({height:l.value?"auto":"42px"})},[e.createVNode(B,{inline:"",model:t.form.data},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.form.items.filter(E=>!E.hidden),E=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:E.key},[E.type=="br"?(e.openBlock(),e.createElementBlock("br",It)):(e.openBlock(),e.createBlock(I,{key:1,label:E.name},{default:e.withCtx(()=>{var U,x;return[E.type==="input"?(e.openBlock(),e.createBlock($,{key:0,modelValue:E.value,"onUpdate:modelValue":k=>E.value=k,class:e.normalizeClass(((U=E.option)==null?void 0:U.class)||"w150"),placeholder:m.$t("qing-shu-ru"),clearable:""},null,8,["modelValue","onUpdate:modelValue","class","placeholder"])):E.type==="custom"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(E.render),{key:1})):e.createCommentVNode("",!0),E.type==="select"?(e.openBlock(),e.createBlock(qe,e.mergeProps({key:2,class:((x=E.option)==null?void 0:x.class)||"w150",modelValue:E.value,"onUpdate:modelValue":k=>E.value=k},{ref_for:!0},E.option,{onChange:b,onClear:k=>C(E)}),null,16,["class","modelValue","onUpdate:modelValue","onClear"])):e.createCommentVNode("",!0),E.type==="date"?(e.openBlock(),e.createBlock(_,{key:3,class:e.normalizeClass({datetimerange:"w300",daterange:"w200"}[E.dateType]||"w100"),modelValue:E.value,"onUpdate:modelValue":k=>E.value=k,"value-format":{datetimerange:"YYYY-MM-DD HH:mm:ss",daterange:"YYYY-MM-DD"}[E.dateType]||"YYYY-MM-DD",type:E.dateType||"date",onFocus:k=>a.value=E,onChange:k=>y(),placeholder:m.$t("qing-xuan-ze"),"start-placeholder":m.$t("kai-shi-shi-jian"),"end-placeholder":m.$t("jie-shu-shi-jian")},null,8,["class","modelValue","onUpdate:modelValue","value-format","type","onFocus","onChange","placeholder","start-placeholder","end-placeholder"])):e.createCommentVNode("",!0)]}),_:2},1032,["label"]))],64))),128))]),_:1},8,["model"])],4),e.createElementVNode("div",Lt,[e.createElementVNode("div",vt,[e.renderSlot(m.$slots,"table-header-left",{},void 0,!0)]),e.createElementVNode("div",Ft,[e.createVNode(A,{underline:"never",class:"mgr10",onClick:S[0]||(S[0]=()=>{s("visibleChange",!l.value),l.value=!l.value})},{default:e.withCtx(()=>[e.createVNode($e,{name:l.value?"ArrowUp":"ArrowDown"},null,8,["name"]),e.createTextVNode(" "+e.toDisplayString(c.value),1)]),_:1}),e.createVNode(L,{type:"primary",onClick:b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.$t("shai-xuan")),1)]),_:1}),e.createVNode(L,{type:"primary",onClick:w},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.$t("chong-zhi")),1)]),_:1}),e.renderSlot(m.$slots,"btn",{},void 0,!0)])])],32)}}},[["__scopeId","data-v-3c0a6716"]]),je={pageNoKey:"pageNo",pageSizeKey:"pageSize",totalKey:"total",defaultPageSize:10,pageSizes:[10,50,100,500],responseDataKeys:{rows:["rows","records","list"],total:["totalRows","total"]},showSearch:!1,showPage:!1,showShadow:!1,showCheckBox:!1,enableCellCopy:!0};let me={...je};function Dt(t){me={...me,...t,responseDataKeys:{...me.responseDataKeys,...t.responseDataKeys||{}}}}function Re(){return me}function Bt(){me={...je}}const fo="",zt={class:"center"},Mt=he({__name:"index",props:{id:{type:String,required:!1},loading:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0},searchForm:{type:Object,default:()=>({items:[],selections:[]})},api:{type:Function},data:{type:Array},tableConfig:{type:Object,default:()=>({})}},setup(t,{expose:o}){const{t:n,locale:r}=ee.useI18n(),s=ve.useRoute(),l=Re(),a=t,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 f=s.path.replace(/\//g,"-").replace(/^-/,"")||"default-table";return a.id?`listPageId-${f}-${a.id}`:`listPageId-${f}`}),C=ne.cloneDeep(a.searchForm.items),w=a.searchForm.pageNoKey||l.pageNoKey,y=a.searchForm.pageSizeKey||l.pageSizeKey,g=e.reactive({[w]:1,[y]:a.searchForm.defaultPageSize||l.defaultPageSize,total:0}),h=e.ref(null),d=e.ref(null),m=e.ref(450),S=ne.debounce(()=>{e.nextTick(()=>{if(!d.value)return;const u=d.value.getBoundingClientRect(),T=window.innerHeight,F=u.top,N=100,P=T-F-N,z=200;m.value=Math.max(P,z)})},100),$=()=>{S()},_=()=>{if(!a.searchForm.enableCellCopy&&!l.enableCellCopy)return!1;const f=h.value;if(!f||!f.$el)return!1;const u=f.$el;return u.classList.add("cell-copy-enabled"),u.setAttribute("tabindex","-1"),u.removeEventListener("mousedown",D),u.removeEventListener("mousemove",ae),u.removeEventListener("mouseup",oe),u.removeEventListener("keydown",Te),u.addEventListener("mousedown",D),u.addEventListener("mousemove",ae),u.addEventListener("mouseup",oe),u.addEventListener("keydown",Te),!0};e.onMounted(()=>{S(),window.addEventListener("resize",$),(a.searchForm.enableCellCopy||l.enableCellCopy)&&(document.addEventListener("mouseup",Ke),document.addEventListener("mousedown",We),setTimeout(()=>{_()},500))}),e.onUpdated(()=>{(a.searchForm.enableCellCopy||l.enableCellCopy)&&setTimeout(()=>{_()},500)}),e.onUnmounted(()=>{if(window.removeEventListener("resize",$),a.searchForm.enableCellCopy||l.enableCellCopy){document.removeEventListener("mouseup",Ke),document.removeEventListener("mousedown",We);const f=h.value;if(f&&f.$el){const u=f.$el;u.removeEventListener("mousedown",D),u.removeEventListener("mousemove",ae),u.removeEventListener("mouseup",oe),u.removeEventListener("keydown",Te)}}});const I=e.computed(()=>Z.value.height||m.value);let B;async function A(f){const{dataFormat:u}=a.tableConfig;f[w]!=1&&(f.nextSearchAfter=B),i.value=!0;const{code:T,data:F={}}=await a.api(f).finally(()=>{i.value=!1,a.searchForm.selections=[]});if(T==200){let N=[];for(const z of l.responseDataKeys.rows)if(F[z]){N=F[z];break}let P=0;for(const z of l.responseDataKeys.total)if(F[z]!==void 0){P=F[z];break}c.value=u?u(N):N,g.total=P,B=F.nextSearchAfter,(a.searchForm.enableCellCopy||l.enableCellCopy)&&e.nextTick(()=>{setTimeout(()=>{_()},100)})}}function L(f={}){const{searchData:u=()=>({})}=a.tableConfig,T=u();A({...g,...Ve(a.searchForm.items),...f,...T})}function E(){const{reset:f}=a.tableConfig;f&&f(),a.searchForm.items.forEach(u=>{const T=C.find(F=>ne.isArray(u.key)&&ne.isArray(F.key)?u.key.join(",")==F.key.join(","):F.key==u.key);T&&(u.value=T.value)}),L()}a.api&&a.immediate&&L();function U(){return{...g,...Ve(a.searchForm.items)}}const x=()=>{const f=h.value;f&&f.clearSort()},k=e.reactive({storage:!0}),Y=e.reactive({drag:!0,resizable:!0,maxFixedSize:0}),Z=e.computed(()=>{const{customConfig:f,columnConfig:u,...T}=a.tableConfig;return{headerAlign:"left",align:"center",customConfig:{...k,...f},columnConfig:{...Y,...u},"virtual-x-config":{enabled:!1,scrollToLeftOnChange:!1},"virtual-y-config":{enabled:!0,gt:100},...T}}),V=e.reactive({isSelecting:!1,startCell:null,endCell:null,selectedCells:[]}),ce=f=>{const u=f.closest(".vxe-body--column");if(!u||u.classList.contains("col--checkbox")||u.classList.contains("col--seq"))return null;const T=u.closest(".vxe-body--row");if(!T)return null;const F=h.value;if(!F)return null;let N=-1;const P=T.getAttribute("data-rowid");if(P!=null)N=parseInt(P,10);else{const M=T.parentElement;N=Array.from(M.querySelectorAll(".vxe-body--row")).indexOf(T)}if(N<0)return null;let z=-1;const Q=u.getAttribute("data-colid");if(Q&&(z=F.getColumns().findIndex(v=>v.id===Q)),z<0){const v=Array.from(T.querySelectorAll(".vxe-body--column")).indexOf(u),j=!!u.closest(".vxe-table--fixed-left-wrapper"),H=!!u.closest(".vxe-table--fixed-right-wrapper"),q=F.getColumns();if(j){const K=q.filter(R=>R.fixed==="left");v<K.length&&(z=q.indexOf(K[v]))}else if(H){const K=q.filter(R=>R.fixed==="right");v<K.length&&(z=q.indexOf(K[v]))}else{const K=a.searchForm.showCheckBox?1:0;z=q.filter(G=>G.fixed==="left").length+v-K}}return z<0?null:{rowIndex:N,colIndex:z,cell:u}},D=f=>{const u=ce(f.target);if(!u){de();return}V.isSelecting=!0,V.startCell={rowIndex:u.rowIndex,colIndex:u.colIndex},V.endCell={...V.startCell},xe(),He()},ae=f=>{if(!V.isSelecting)return;const u=ce(f.target);u&&(V.endCell={rowIndex:u.rowIndex,colIndex:u.colIndex},xe(),He())},oe=()=>{V.isSelecting=!1},de=()=>{V.selectedCells=[],V.startCell=null,V.endCell=null;const f=h.value;if(!f)return;f.$el.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(T=>{T.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")})},xe=()=>{if(!V.startCell||!V.endCell){V.selectedCells=[];return}const f=V.startCell.rowIndex,u=V.endCell.rowIndex,T=V.startCell.colIndex,F=V.endCell.colIndex,N=Math.min(f,u),P=Math.max(f,u),z=Math.min(T,F),Q=Math.max(T,F);V.selectedCells=[];for(let M=N;M<=P;M++)for(let v=z;v<=Q;v++)V.selectedCells.push({rowIndex:M,colIndex:v})},He=()=>{e.nextTick(()=>{const f=h.value;if(!f)return;const u=f.$el;if(u.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(j=>{j.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")}),V.selectedCells.length===0)return;const T=f.getColumns(),F=V.selectedCells.map(j=>j.rowIndex),N=V.selectedCells.map(j=>j.colIndex),P=Math.min(...F),z=Math.max(...F),Q=Math.min(...N),M=Math.max(...N),v=[u.querySelector(".vxe-table--body-wrapper tbody"),u.querySelector(".vxe-table--fixed-left-wrapper tbody"),u.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean);V.selectedCells.forEach(({rowIndex:j,colIndex:H})=>{const q=T[H];if(!q)return;const K=q.fixed==="left",R=q.fixed==="right";for(const G of v){const ge=G.querySelectorAll(".vxe-body--row")[j];if(!ge)continue;const re=Array.from(ge.querySelectorAll(".vxe-body--column"));let O=null;if(K&&G.closest(".vxe-table--fixed-left-wrapper")){const J=T.filter(X=>X.fixed==="left").indexOf(q);O=re[J]}else if(R&&G.closest(".vxe-table--fixed-right-wrapper")){const J=T.filter(X=>X.fixed==="right").indexOf(q);O=re[J]}else if(!K&&!R&&G.closest(".vxe-table--body-wrapper")){const se=a.searchForm.showCheckBox?1:0,J=T.filter(Ie=>Ie.fixed==="left").length,X=H-J;O=re[X+se]}if(O&&!O.classList.contains("col--checkbox")&&!O.classList.contains("col--seq")){O.classList.add("cell-selected"),j===P&&O.classList.add("cell-border-top"),j===z&&O.classList.add("cell-border-bottom"),H===Q&&O.classList.add("cell-border-left"),H===M&&O.classList.add("cell-border-right");break}}})})},eo=async()=>{if(V.selectedCells.length===0)return;const f=h.value;if(!f)return;const u=f.$el,T=f.getColumns(),F=[...new Set(V.selectedCells.map(M=>M.rowIndex))].sort((M,v)=>M-v),N=[...new Set(V.selectedCells.map(M=>M.colIndex))].sort((M,v)=>M-v),P=[u.querySelector(".vxe-table--body-wrapper tbody"),u.querySelector(".vxe-table--fixed-left-wrapper tbody"),u.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean),z=[];F.forEach(M=>{const v=[];N.forEach(j=>{const H=T[j];if(!H){v.push("");return}const q=H.fixed==="left",K=H.fixed==="right";let R="";for(const G of P){const ge=G.querySelectorAll(".vxe-body--row")[M];if(!ge)continue;const re=Array.from(ge.querySelectorAll(".vxe-body--column"));let O=null;if(q&&G.closest(".vxe-table--fixed-left-wrapper")){const J=T.filter(X=>X.fixed==="left").indexOf(H);O=re[J]}else if(K&&G.closest(".vxe-table--fixed-right-wrapper")){const J=T.filter(X=>X.fixed==="right").indexOf(H);O=re[J]}else if(!q&&!K&&G.closest(".vxe-table--body-wrapper")){const se=a.searchForm.showCheckBox?1:0,J=T.filter(Ie=>Ie.fixed==="left").length,X=j-J;O=re[X+se]}if(O&&!O.classList.contains("col--checkbox")&&!O.classList.contains("col--seq")){R=O.innerText||O.textContent||"",R=R.trim(),R=R.replace(/\n/g," ").replace(/\s+/g," ");break}}v.push(R)}),z.push(v.join(" "))});const Q=z.join(`
|
|
2
|
-
`);try{await navigator.clipboard.writeText(Q)}catch(M){console.error("复制失败:",M)}},Te=f=>{!a.searchForm.enableCellCopy&&!l.enableCellCopy||((f.ctrlKey||f.metaKey)&&f.key==="c"?V.selectedCells.length>0&&(f.preventDefault(),f.stopPropagation(),eo()):f.key==="Escape"&&de())},Ke=()=>{V.isSelecting=!1},We=f=>{const u=h.value;if(!u||!u.$el)return;u.$el.contains(f.target)||de()},to=f=>{g[w]=f,L()},oo=f=>{g[y]=f,g[w]=1,L()};function Ze(){const f=h.value.getCheckboxRecords();a.searchForm.selections=f}const Ge=f=>{const u=h.value;if(u){u.toggleCheckboxRow(f);const T=h.value.getCheckboxRecords();a.searchForm.selections=T}};return o({tableRef:h,getList:L,getPrm:U,clearSort:x,calculateTableHeight:S}),(f,u)=>{var M;const T=e.resolveComponent("el-button"),F=e.resolveComponent("el-checkbox"),N=e.resolveComponent("el-text"),P=e.resolveComponent("vxe-column"),z=e.resolveComponent("VxeTable"),Q=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({box:t.searchForm.showShadow})},[t.searchForm.showSearch?(e.openBlock(),e.createBlock(Ae,{key:0,form:t.searchForm,onReset:E,onConfirm:u[1]||(u[1]=v=>L()),onVisibleChange:e.unref(S)},{btn:e.withCtx(()=>[u[3]||(u[3]=e.createElementVNode("span",{class:"mgr10"},null,-1)),e.renderSlot(f.$slots,"search-bar-btn",{},void 0,!0),e.createVNode(T,{class:"mgl10",round:"",onClick:u[0]||(u[0]=v=>h.value.openCustom())},{default:e.withCtx(()=>[e.createVNode($e,{name:"Tools"})]),_:1})]),_:3},8,["form","onVisibleChange"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"table-header-left",{},void 0,!0),e.createElementVNode("div",{ref_key:"tableContentRef",ref:d},[e.createVNode(z,e.mergeProps({id:b.value,ref_key:"tableRef",ref:h,loading:t.loading||i.value,data:t.api?c.value:t.data,border:""},Z.value,{height:I.value,onCheckboxChange:Ze,onCheckboxAll:Ze,onSortChange:(M=Z.value["sort-config"])==null?void 0:M.sortChange}),{default:e.withCtx(()=>[t.searchForm.showCheckBox==null||t.searchForm.showCheckBox?(e.openBlock(),e.createBlock(P,{key:0,type:"checkbox",width:e.unref(r)=="zh_cn"?80:150,title:f.$t("xu-hao"),fixed:"left"},{checkbox:e.withCtx(({rowIndex:v,row:j,checked:H,disabled:q,indeterminate:K})=>[e.createElementVNode("div",zt,[H?(e.openBlock(),e.createBlock(F,{key:0,checked:!0,disabled:q,size:"default",onClick:e.withModifiers(R=>!q&&Ge(j),["stop"])},null,8,["disabled","onClick"])):(e.openBlock(),e.createBlock(F,{key:1,disabled:q,checked:!1,size:"default",onClick:e.withModifiers(R=>!q&&Ge(j),["stop"])},null,8,["disabled","onClick"])),e.createVNode(N,{type:"info",class:"mgl5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(v+1),1)]),_:2},1024)])]),_:1},8,["width","title"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"default",{},void 0,!0)]),_:3},16,["id","loading","data","height","onSortChange"])],512),t.searchForm.showPage?(e.openBlock(),e.createBlock(Q,{key:1,"current-page":g[e.unref(w)],"onUpdate:currentPage":u[2]||(u[2]=v=>g[e.unref(w)]=v),class:"myPagination mgt10",background:"",layout:"total, sizes, prev, pager, next",total:g.total,"page-size":g[e.unref(y)],"page-sizes":t.searchForm.pageSizes||e.unref(l).pageSizes,onCurrentChange:to,onSizeChange:oo},null,8,["current-page","total","page-size","page-sizes"])):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-c022c16d"]]),Ot={__name:"index",props:{sheetsConfig:{type:Object,required:!0},fileName:{type:String,required:!0}},setup(t){const o=t;function n(){dt(o.fileName,o.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.renderSlot(r.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(r.$t("xia-zai-dao-ru-mo-ban")),1)])]),_:3},16)}}},Nt={mounted(t,o){o.value&&Ue(t)},updated(t,o){o.value?Ue(t):Pe(t)},beforeUnmount(t){Pe(t)}};async function Ue(t){await y();const o=t.querySelector(".el-dialog");if(!o)return;const n=t.querySelector(".el-dialog__header"),r=t.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",C),window.addEventListener("resize",w);function a(){l.mouse.x-l.drag.x>=l.dialog.x&&(l.drag.x=l.mouse.x-l.dialog.x),l.drag.x-l.mouse.x>=l.window.width-(l.dialog.x+l.dialog.width)&&(l.drag.x=l.mouse.x+l.window.width-l.dialog.x-l.dialog.width),l.mouse.y-l.drag.y>=l.dialog.y&&(l.drag.y=l.mouse.y-l.dialog.y),l.drag.y-l.mouse.y>=l.window.height-(l.dialog.y+l.dialog.height)&&(l.drag.y=l.mouse.y+l.window.height-l.dialog.y-l.dialog.height),i()}function i(){let g=l.drag.y-l.mouse.y+l.dialog.y,h=l.drag.x-l.mouse.x+l.dialog.x;o.style.cssText+=`position: absolute; top: calc(${g}px - ${l.dialog.marginTop}); left: ${h}px;`}function c(g){g.button===0&&(l.window={width:document.body.clientWidth,height:document.body.clientHeight},l.dialog=o.getBoundingClientRect(),l.dialog.marginTop=window.getComputedStyle(o).marginTop,l.mouse={x:g.clientX,y:g.clientY},s=!0)}function b(g){s&&(l.drag={x:g.clientX,y:g.clientY},r.style.userSelect="none",a())}function C(g){r.style.userSelect="auto",s=!1}function w(g){}function y(){return new Promise((g,h)=>{setTimeout(()=>{g()},500)})}t.__mouseDown__=c,t.__mouseUp__=C,t.__mouseMove__=b,t.__sizeChange__=w}function Pe(t){document.removeEventListener("mousedown",t.__mouseDown__),document.removeEventListener("mousemove",t.__mouseMove__),document.removeEventListener("mouseup",t.__mouseUp__),window.removeEventListener("resize",t.__sizeChange__)}const mo="",qt={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(t,{emit:o}){const n=t,r=o,{t:s}=ee.useI18n(),l=ne.debounce(()=>{r("confirm")},300);async function a(){n.layer.type=="drawer"?n.layer.onClose?n.layer.onClose():await W.ElMessageBox.confirm(s("que-ding-guan-bi-ma"),{confirmButtonText:s("que-ding"),cancelButtonText:s("qu-xiao"),type:"warning"}).catch(()=>{})=="confirm"&&(n.layer.show=!1):n.layer.show=!1}return(i,c)=>{const b=e.resolveComponent("el-button"),C=e.resolveComponent("el-drawer"),w=e.resolveComponent("el-dialog");return t.layer.type?(e.openBlock(),e.createBlock(C,{key:0,modelValue:t.layer.show,"onUpdate:modelValue":c[0]||(c[0]=y=>t.layer.show=y),size:t.layer.width||"100%",title:t.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)),t.layer.showButton?(e.openBlock(),e.createElementBlock("div",qt,[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:t.loading,onClick:e.unref(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("ti-jiao")),1)]),_:1},8,["loading","onClick"])])])):e.createCommentVNode("",!0)]),_:3},8,["modelValue","size","title"])):e.withDirectives((e.openBlock(),e.createElementBlock("div",At,[e.createVNode(w,{"close-on-click-modal":!1,modelValue:t.layer.show,"onUpdate:modelValue":c[1]||(c[1]=y=>t.layer.show=y),title:t.layer.title,width:t.layer.width||500,center:""},e.createSlots({default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:2},[t.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(Nt),t.layer.show]])}}};function Rt(t,o={}){const n=le(),r={inForm:!0,required:!0,...o},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+)*$/}[t],{inForm:l,value:a,required:i,msg:c=n("validate.invalidInput")}=r;return l?function(b,C,w){if(i){s.test(C)?w():w(new Error(c));return}C&&!s.test(C)?w(new Error(c)):w()}:s.test(a)}class Ut{constructor(o={}){this.config={clientCode:o.clientCode||"one-portal",casServerUrl:`https://one-portal${o.isTest?"-test":""}.joy-group.com/api`,casPortalUrl:`https://one-portal${o.isTest?"-test":""}.joy-group.com`,serviceUrl:o.serviceUrl||window.location.origin+"/cas/callback",tokenKey:o.tokenKey||"one_portal_token",userKey:o.userKey||"one_portal_user",debug:o.debug||!1,autoLogin:o.autoLogin!==!1,loginCallback:o.loginCallback||null,logoutCallback:o.logoutCallback||null,errorCallback:o.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 o=localStorage.getItem(this.config.userKey);o&&(this.user=JSON.parse(o)),this.log("从本地存储加载数据:",{token:!!this.token,user:!!this.user})}catch(o){this.log("加载本地存储数据失败:",o)}}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(o){this.log("保存到本地存储失败:",o)}}clearStorage(){try{localStorage.removeItem(this.config.tokenKey),localStorage.removeItem(this.config.userKey),this.log("本地存储已清除")}catch(o){this.log("清除本地存储失败:",o)}}isLoggedIn(){return!!(this.token&&this.user)}getUser(){return this.user}getToken(){return this.token}login(){const o=`${this.config.casPortalUrl}?appCode=${this.config.clientCode}&redirectUrl=${encodeURIComponent(this.config.serviceUrl)}`;this.log("跳转到CAS登录页面:",o),window.location.href=o}async validateTicket(o){try{this.log("验证ST票据:",o);const n=await fetch(`${this.config.casServerUrl}/auth/validateST?ticket=${o}`,{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 o=new URL(window.location);o.searchParams.delete("ticket"),window.history.replaceState({},document.title,o.toString())}async logout(o=!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(),o&&this.login()}catch(n){this.log("登出失败:",n),this.handleError(n)}}async request(o,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(o,r);return s.status===401?(this.log("Token已过期,需要重新登录"),this.logout(),null):s}catch(s){throw this.log("请求失败:",s),s}}async fetchUserInfo(){try{const o=await this.request(`${this.config.casServerUrl}/auth/user`);if(o&&o.ok){const n=await o.json();if(n.success&&n.data)return this.user=n.data,this.saveToStorage(),this.user}return null}catch(o){return this.log("获取用户信息失败:",o),null}}async refreshToken(){this.log("Token刷新功能暂未实现")}handleError(o){this.log("发生错误:",o),this.config.errorCallback&&this.config.errorCallback(o)}log(...o){this.config.debug&&console.log("[OnePortal CAS SDK]",...o)}checkLoginStatus(){return!this.isLoggedIn()&&this.config.autoLogin?(this.login(),!1):this.isLoggedIn()}setConfig(o,n){this.config[o]=n}getConfig(o){return this.config[o]}}function Pt(t,o={}){const r=Object.assign({manual:!1,log:!1,params:null,format:null},o),{manual:s,log:l,params:a={},cb:i,format:c}=r,b=e.ref([]),C=e.ref(!1),w=y=>{const g=y||a;C.value=!0,t(g).then(h=>{const{code:d,data:m,msg:S}=h;if(i){const{records:$,rows:_}=m||{},I=$||_?$||_:m;b.value=Ee(I,c),i(h)}if(m){if(m.records!=null||m.rows!=null){const{records:$,rows:_,total:I=0}=m||{};g&&g.total!=null&&(a.total=parseInt(I)),b.value=Ee($||_||[],c)}else b.value=Ee(m,c);l&&console.log("useRequest-res",b.value)}}).catch(h=>{i&&(console.log("useRequestErr",h),i({code:500}))}).finally(()=>{C.value=!1})};return s||w(),[C,b,w]}function Yt(t){const o=e.ref(t),n=e.ref(""),r=e.ref("");return e.watch(o,s=>{const l=s||["",""];n.value=l[0],r.value=l[1]}),[o,n,r]}function Ht(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function Ee(t,o){if(!o)return t;if(t instanceof Array)return t.map(r=>{let s={};return o.forEach(l=>s[l]=r[l]),s});let n={};return o.forEach(r=>n[r]=t[r]),n}function Kt(t,o=[]){const{locale:n}=ee.useI18n(),r=e.ref(t());return e.watch([n,...o],()=>{r.value=t()},{immediate:!0}),r}function Wt(t,o="zh_cn",n="en_us"){if(!t)return"-";const r={en_us:n,zh_cn:o},l=be().global.locale.value;return t[r[l]]||t[o]||"-"}function Zt(t,o){let n=te.mapState;return typeof t=="string"&&t.length>0&&(n=te.createNamespacedHelpers(t).mapState),Ye(o,n)}function Gt(t,o){let n=te.mapGetters;return typeof t=="string"&&t.length>0&&(n=te.createNamespacedHelpers(t).mapGetters),Ye(o,n)}function Jt(t,o){let n=te.mapActions;return typeof t=="string"&&t.length>0&&(n=te.createNamespacedHelpers(t).mapActions),Xt(o,n)}function Ye(t,o){const n=te.useStore(),r=o(t),s={};return Object.keys(r).forEach(l=>{const a=r[l].bind({$store:n});s[l]=e.computed(a)}),s}function Xt(t,o){const n=te.useStore(),r=o(t),s={};return Object.keys(r).forEach(l=>{s[l]=r[l].bind({$store:n})}),s}function we(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}function Qt(){fe.VxeUI.renderer.add("Enum",{renderTableDefault(t,o){let n;if([null,void 0].includes(o.row[o.column.field]))return"-";const r=o.row[o.column.field];if(t.type=="tag"){let s;return e.createVNode(e.resolveComponent("el-text"),{type:t.enum.getTag(r)},we(s=t.enum.getName(r))?s:{default:()=>[s]})}return e.createVNode(e.resolveComponent("el-text"),null,we(n=t.enum.getName(r))?n:{default:()=>[n]})}}),fe.VxeUI.renderer.add("InputNumber",{renderTableDefault(t,o){return e.createVNode(W.ElInputNumber,e.mergeProps({modelValue:o.row[o.column.field],"onUpdate:modelValue":n=>o.row[o.column.field]=n},t.props,{"step-strictly":!0,"value-on-clear":0}),null)}}),fe.VxeUI.renderer.add("TrueFalse",{renderTableDefault(t,o){const{locale:n}=ee.useI18n();let r=n.value=="zh_cn";return e.createVNode(W.ElText,{type:o.row[o.column.field]?"success":"danger"},{default:()=>[o.row[o.column.field]?r?"是":"YES":r?"否":"NO"]})}}),fe.VxeUI.renderer.add("I18n",{renderTableDefault(t,o){const{locale:n}=ee.useI18n();let r=n.value=="zh_cn"?o.column.field:t.fieldEn;return o.row[r]||o.row[o.column.field]}}),fe.VxeUI.renderer.add("Link",{renderTableDefault(t,o){let n=o.column.field;const r=ve.useRouter(),{multiple:s,to:l,openType:a="system"}=t,i=o.row[n];function c(b,C){a=="blank"?window.open(b):r.push({path:b,query:{[n]:C}})}if(s){const b=(i==null?void 0:i.split(","))||[];return b.map((C,w)=>e.createVNode("span",null,[e.createVNode(W.ElLink,{underline:"never",type:"primary",onclick:()=>c(a=="stystem"?l:C,C)},we(C)?C:{default:()=>[C]}),w<b.length-1?",":""]))}return e.createVNode(W.ElLink,{underline:"never",type:"primary",onclick:()=>c(a=="stystem"?l:i,i)},we(i)?i:{default:()=>[i]})}})}p.CmpDictionary=qe,p.CmpIcon=$e,p.ConfrimButton=Vt,p.DownExcelTemp=Ot,p.ImportButton=Tt,p.LayOutForm=Je,p.Layer=jt,p.ListPage=Mt,p.OnePortalCasSDK=Ut,p.SearchBar=Ae,p.StatusMap=Se,p._toRaw=mt,p._typeOf=Ht,p.arrToStatusMap=pt,p.arrayToTree=gt,p.checkFileSize=bt,p.creatValidator=Rt,p.createImportFields=xt,p.createListPageId=wt,p.en_us=Ce,p.exportExcel=nt,p.getI18n=be,p.getI18nT=le,p.getListPageConfig=Re,p.getLocaleValue=Wt,p.getValueBykey=kt,p.importExcel=ot,p.messages=Me,p.registerVxeRenderers=Qt,p.resetListPageConfig=Bt,p.setListPageConfig=Dt,p.setupI18n=Oe,p.sleep=ht,p.stringToArray=_e,p.stripHtmlTags=yt,p.unicode2Str=Ct,p.useActions=Jt,p.useDatePicker=Yt,p.useGetters=Gt,p.useI18nReState=Kt,p.useRequest=Pt,p.useState=Zt,p.zh_cn=ye,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(p,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("element-plus"),require("vue"),require("file-saver"),require("exceljs"),require("dayjs"),require("vue-i18n"),require("lodash"),require("vue-router"),require("vuex"),require("vxe-pc-ui")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue","file-saver","exceljs","dayjs","vue-i18n","lodash","vue-router","vuex","vxe-pc-ui"],W):(p=typeof globalThis<"u"?globalThis:p||self,W(p.JoyAdminComponents={},p.ElementPlus,p.Vue,p.fileSaver,p.ExcelJS,p.dayjs,p.VueI18n,p._,p.VueRouter,p.Vuex,p.VxeUI))})(this,function(p,W,e,Le,pe,ue,ee,oe,Fe,te,fe){"use strict";const Je=e.defineComponent({name:"LayOutForm",setup(t,{slots:n,attrs:o,emit:r}){const s=e.ref(null),l=()=>n.default?n.default().filter(i=>i.type!==Symbol.for("v-cmt")).map(i=>i.type===Symbol.for("v-fgt")?i.children:i).flat().map(i=>{var c;return e.h(W.ElCol,{span:((c=i.props)==null?void 0:c.span)||24},{default:()=>i})}):null;e.onMounted(()=>{r("ref",s.value)});function a(){return e.h(W.ElForm,{...o,ref:s},()=>e.h(W.ElRow,{gutter:o.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 De(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Be={exports:{}};(function(t,n){(function(o,r){t.exports=r()})(ve,function(){var o="minute",r=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(l,a,i){var c=a.prototype;i.utc=function(d){var m={date:d,utc:!0,args:arguments};return new a(m)},c.utc=function(d){var m=i(this.toDate(),{locale:this.$L,utc:!0});return d?m.add(this.utcOffset(),o):m},c.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var b=c.parse;c.parse=function(d){d.utc&&(this.$u=!0),this.$utils().u(d.$offset)||(this.$offset=d.$offset),b.call(this,d)};var C=c.init;c.init=function(){if(this.$u){var d=this.$d;this.$y=d.getUTCFullYear(),this.$M=d.getUTCMonth(),this.$D=d.getUTCDate(),this.$W=d.getUTCDay(),this.$H=d.getUTCHours(),this.$m=d.getUTCMinutes(),this.$s=d.getUTCSeconds(),this.$ms=d.getUTCMilliseconds()}else C.call(this)};var w=c.utcOffset;c.utcOffset=function(d,m){var S=this.$utils().u;if(S(d))return this.$u?0:S(this.$offset)?w.call(this):this.$offset;if(typeof d=="string"&&(d=function(B){B===void 0&&(B="");var A=B.match(r);if(!A)return null;var L=(""+A[0]).match(s)||["-",0,0],E=L[0],U=60*+L[1]+ +L[2];return U===0?0:E==="+"?U:-U}(d),d===null))return this;var $=Math.abs(d)<=16?60*d:d;if($===0)return this.utc(m);var _=this.clone();if(m)return _.$offset=$,_.$u=!1,_;var I=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(_=this.local().add($+I,o)).$offset=$,_.$x.$localOffset=I,_};var y=c.format;c.format=function(d){var m=d||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return y.call(this,m)},c.valueOf=function(){var d=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*d},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var g=c.toDate;c.toDate=function(d){return d==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var h=c.diff;c.diff=function(d,m,S){if(d&&this.$u===d.$u)return h.call(this,d,m,S);var $=this.local(),_=i(d).local();return h.call($,_,m,S)}}})})(Be);var Xe=Be.exports;const Qe=De(Xe);var ze={exports:{}};(function(t,n){(function(o,r){t.exports=r()})(ve,function(){var o={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(s,l,a){var i,c=function(y,g,h){h===void 0&&(h={});var d=new Date(y),m=function(S,$){$===void 0&&($={});var _=$.timeZoneName||"short",I=S+"|"+_,B=r[I];return B||(B=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:S,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:_}),r[I]=B),B}(g,h);return m.formatToParts(d)},b=function(y,g){for(var h=c(y,g),d=[],m=0;m<h.length;m+=1){var S=h[m],$=S.type,_=S.value,I=o[$];I>=0&&(d[I]=parseInt(_,10))}var B=d[3],A=B===24?0:B,L=d[0]+"-"+d[1]+"-"+d[2]+" "+A+":"+d[4]+":"+d[5]+":000",E=+y;return(a.utc(L).valueOf()-(E-=E%1e3))/6e4},C=l.prototype;C.tz=function(y,g){y===void 0&&(y=i);var h,d=this.utcOffset(),m=this.toDate(),S=m.toLocaleString("en-US",{timeZone:y}),$=Math.round((m-new Date(S))/1e3/60),_=15*-Math.round(m.getTimezoneOffset()/15)-$;if(!Number(_))h=this.utcOffset(0,g);else if(h=a(S,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(_,!0),g){var I=h.utcOffset();h=h.add(d-I,"minute")}return h.$x.$timezone=y,h},C.offsetName=function(y){var g=this.$x.$timezone||a.tz.guess(),h=c(this.valueOf(),g,{timeZoneName:y}).find(function(d){return d.type.toLowerCase()==="timezonename"});return h&&h.value};var w=C.startOf;C.startOf=function(y,g){if(!this.$x||!this.$x.$timezone)return w.call(this,y,g);var h=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return w.call(h,y,g).tz(this.$x.$timezone,!0)},a.tz=function(y,g,h){var d=h&&g,m=h||g||i,S=b(+a(),m);if(typeof y!="string")return a(y).tz(m);var $=function(A,L,E){var U=A-60*L*1e3,x=b(U,E);if(L===x)return[U,L];var k=b(U-=60*(x-L)*1e3,E);return x===k?[U,x]:[A-60*Math.min(x,k)*1e3,Math.max(x,k)]}(a.utc(y,d).valueOf(),S,m),_=$[0],I=$[1],B=a(_).utcOffset(I);return B.$x.$timezone=m,B},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(y){i=y}}})})(ze);var et=ze.exports;const tt=De(et),ye={"dao-ru":"导入","quan-xuan":"全选","xia-zai-dao-ru-mo-ban":"下载导入模板","xu-hao":"序号","qing-shu-ru":"请输入","qing-xuan-ze":"请选择","kai-shi-shi-jian":"开始时间","jie-shu-shi-jian":"结束时间","shai-xuan":"筛选","chong-zhi":"重置","guan-bi":"关闭","zhan-kai":"展开","qu-xiao":"取消","ti-jiao":"提交","que-ding":"确定","que-ding-guan-bi-ma":"确定关闭吗","xia-zai-dao-ru-mo-ban":"下载导入模板",excel:{fieldsMappingRequired:"请输入列字段映射",invalidInput:"非法输入",invalidOption:"请输入有效选项!",copyFailed:"复制失败",sheetNameTooLong:'Sheet名称 "{0}" 长度超过31个字符,已自动截断为 "{1}"'},validate:{invalidInput:"请输入正确内容"},tools:{keysLengthError:"keys 长度必须大于2 默认前两位为 label value"}},Ce={"dao-ru":"Import","quan-xuan":"Select All","xia-zai-dao-ru-mo-ban":"Download Import Template","xu-hao":"No.","qing-shu-ru":"Please enter","qing-xuan-ze":"Please select","kai-shi-shi-jian":"Start Time","jie-shu-shi-jian":"End Time","shai-xuan":"Filter","chong-zhi":"Reset","guan-bi":"Collapse","zhan-kai":"Expand","qu-xiao":"Cancel","ti-jiao":"Submit","que-ding":"Confirm","que-ding-guan-bi-ma":"Are you sure to close?","xia-zai-dao-ru-mo-ban":"Download Import Template",excel:{fieldsMappingRequired:"Please enter column field mapping",invalidInput:"Invalid input",invalidOption:"Please enter a valid option!",copyFailed:"Copy failed",sheetNameTooLong:'Sheet name "{0}" exceeds 31 characters, automatically truncated to "{1}"'},validate:{invalidInput:"Please enter valid content"},tools:{keysLengthError:"Keys length must be greater than 2, default first two are label and value"}},Me={zh_cn:ye,en_us:Ce};let ie=null;function Oe(t=null){if(t){const{global:n}=t;return n.messages.value.zh_cn?n.mergeLocaleMessage("zh_cn",ye):n.setLocaleMessage("zh_cn",ye),n.messages.value.en_us?n.mergeLocaleMessage("en_us",Ce):n.setLocaleMessage("en_us",Ce),ie=t,t}return ie||(ie=ee.createI18n({legacy:!1,locale:"zh_cn",fallbackLocale:"zh_cn",messages:Me})),ie}function be(){return ie||Oe()}function le(){return be().global.t}ue.extend(Qe),ue.extend(tt);async function nt(t,n){const{fields:o,range:r=1}=n;if(!o){const a=le();throw new Error(a("excel.fieldsMappingRequired"))}let s=new pe.Workbook;await s.xlsx.load(t);const l={};return s.eachSheet(function(a,i){const c=[];a.eachRow(function(b,C){if(C>r){let w={},y=!0;Object.keys(o).forEach(g=>{const h=b.getCell(o[g]).value;w[g]=h,h&&(y=!1)}),y||c.push(w)}}),l[a._name]=c}),s=null,l}const Ne={columnWidth:30};async function ot(t,n,o=[],r={}){if(!t||!n)return;const{columnStyle:s}=r,{columnWidth:l}=Ne;n.forEach(c=>{c.width=c.width?c.width:l});const{workbook:a,worksheet:i}=lt();i.columns=n,i.addRows(o),s&&await at(a,i,s);try{const c=await a.xlsx.writeBuffer(),b=new File([c],t,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Le.saveAs(b)}catch(c){console.log(c)}}function lt(){const t=new pe.Workbook;t.creator="distributor System",t.lastModifiedBy="distributor System",t.created=new Date,t.modified=new Date,t.lastPrinted=new Date;const n=t.addWorksheet("Sheet1");return{workbook:t,worksheet:n}}async function at(t,n,o){const r=Object.keys(o);for(const s of r){const l=o[s],{type:a}=l;switch(a){case"IMG":await rt(t,n,s);break}}}async function rt(t,n,o,r){const s=n.getColumn(o),l=s.values;n.getColumn(o).width=20,n.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&&(n.getCell(s.letter+a).value="",await st(t,n,c,{width:100,height:50,col:s._number-1,row:a-1}))}}async function st(t,n,o,r){const{col:s,row:l,width:a,height:i}=r,{success:c,base64:b}=await it(o,.3);if(c){const C=t.addImage({base64:b,extension:"jpeg"});n.addImage(C,{tl:{col:s,row:l},ext:{width:a,height:i}})}}function it(t,n=1){const o=new Image;return o.setAttribute("crossOrigin","anonymous"),o.crossOrigin="anonymous",o.src=t,new Promise((r,s)=>{o.onload=()=>{const l=document.createElement("canvas");l.width=o.width,l.height=o.height,l.getContext("2d").drawImage(o,0,0,l.width,l.height),r({success:!0,base64:l.toDataURL("image/jpeg",n)})},o.onerror=()=>{r({success:!1})}})}const ke="---";async function ct(t,n){const{fields:o,range:r=1}=n;if(!o){const a=le();throw new Error(a("excel.fieldsMappingRequired"))}let s=new pe.Workbook;await s.xlsx.load(t);const l={};return s.eachSheet(function(a,i){if(a.state=="visible"){const c=[],b=o[a._name];if(b){let C=Object.values(b).some(y=>y.includes("image")),w={};C&&(a.getImages().forEach(g=>{const{tl:h}=g.range,d=s.model.media.find(m=>m.index===g.imageId);if(d){const m=d.buffer.toString("base64"),S=`data:image/${d.extension};base64,${m}`,$=`${Math.ceil(h.row)}_${Math.ceil(h.col)}`;w[$]?w[$].push(S):w[$]=[S]}}),console.log("withImages-imageMap",w)),a.eachRow(function(y,g){if(g>r){let h={},d=!0;Object.keys(b).forEach(m=>{var B;let[S,$]=b[m].split(ke);const _=y.getCell(S);let I;if($=="image"&&C){const A=_._column._number,L=`${g}_${A}`;I=w[L]||""}else _.result!=null?I=_.result:(B=_.value)!=null&&B.richText?I=_.value.richText.reduce((A,L)=>A+L.text,""):_.type==4&&_.value?I=ue(_.value).utc().format("YYYY-MM-DD HH:mm:ss"):I=_.value;I&&$=="option"&&(I=I.split(ke)[1]),h[m]=I,I&&(d=!1)}),d||c.push(h)}}),l[a._name]=c}}}),s=null,l}const dt={date:"yyyy-mm-dd",number:"0",string:"@"};async function ut(t,n){if(!t||n.length==0)return;const o=ft(n);o.eachSheet(function(r,s){const{columnWidth:l}=Ne,{tableHeader:a,tableData:i}=n[r._name];a.forEach(c=>{if(c.required){const b=c.style||{},{font:C={}}=b;c.style={...b,font:{...C,color:{argb:"FFFF0000"}},numFmt:dt[c.numFmt]}}}),r.columns=a,r.addRows(i),a.forEach(c=>{const{header:b,key:C,width:w,option:y}=c,g=r.getColumn(C);if(g.width=w||l,y){const h=o.addWorksheet(C);h.state="hidden",h.getColumn(1).values=y.map(d=>`${d.label}${ke}${d.value}`),Array(100).fill("").forEach((d,m)=>{if(m>0){const S=le();r.getCell(`${g.letter}${m}`).dataValidation={type:"list",formulae:[`${C}!$A$1:$A$${y.length}`],showErrorMessage:!0,error:S("excel.invalidInput"),errorStyle:"stop",errorMessage:S("excel.invalidOption")}}})}})});try{const r=await o.xlsx.writeBuffer(),s=new File([r],t,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Le.saveAs(s)}catch(r){console.log(r)}}function ft(t){const n=le(),o=new pe.Workbook;return o.creator="distributor System",o.lastModifiedBy="distributor System",o.created=new Date,o.modified=new Date,o.lastPrinted=new Date,Object.keys(t).sort((s,l)=>{const a=t[s].sort??0,i=t[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(n("excel.sheetNameTooLong",[l,s]))),a&&(t[s]=t[l],delete t[l]),o.addWorksheet(s)}),o}function ht(t){if(t<26)return String.fromCharCode(65+t);{const n=String.fromCharCode(65+Math.floor((t-26)/26)),o=String.fromCharCode(65+(t-26)%26);return n+o}}function mt(t){return new Promise(n=>{setTimeout(()=>{n()},t)})}function gt(t){return JSON.parse(JSON.stringify(t))}function pt(t){let n=[],o={},r=(s,l)=>Object.prototype.hasOwnProperty.call(s,l);for(const s of t){o[s.id]={...s,children:r(o,s.id)?o[s.id].children:[]};const l=o[s.id];s.pid==-1?n.push(l):(r(o,s.pid)||(o[s.pid]={children:[]}),o[s.pid].children.push(l))}return n}function _e(t,n=" "){return t?t.split(n).filter(o=>o.trim()):[]}class Se{constructor(n,o=["label","value","labelEn"]){this.list=n.map(r=>({...r,label:r[o[0]],labelEn:r[o[2]]??r[o[0]]??"",value:r[o[1]]})),this.map=new Map(this.list.map(r=>[r[o[1]],r]))}getName(n){if(!this.has(n))return"-";const o=be().global.locale,{label:r,labelEn:s}=this.map.get(n);return(o.value=="zh_cn"?r:s)??r??"-"}getTag(n){if(!this.has(n))return"info";const{tag:o="info"}=this.map.get(n);return o}getItem(n){return this.has(n)?this.map.get(n):null}getColor(n){if(!this.has(n))return null;const{color:o}=this.map.get(n);return o}has(n){return this.map.has(n)}}function yt(t,n=[],o="i18nName"){if(t.length==0)return new Se([]);if(n.length<2){const s=le();throw new Error(s("tools.keysLengthError"))}let r=t.map(s=>{let l={};return o&&(l.labelEn=s[o]),n.forEach((a,i)=>{i===0?l.label=s[a]:i===1?l.value=s[a]:l[a]=s[a]}),l});return new Se(r)}function Ct(t){return t?t.replace(/<[^>]+>/g,""):""}function bt(t){return t?(t.includes("\\\\u")&&(t=t.replace(/\\/g,"")),t.replace(/\\u[\dA-F]{4}/gi,n=>String.fromCharCode(parseInt(n.replace(/\\u/g,""),16)))):""}function wt(t,n=10){let o=1048576*n;return!(t.size>o)}function xt(t){return Array.from(10).fill(0).map((o,r)=>t+"_"+r)}function kt(t){let n={};return t.map((o,r)=>{let{key:s,option:l,type:a}=o,i=ht(r);l?n[s]=`${i}---option`:a==="image"?n[s]=`${i}---image`:n[s]=i}),n}function _t(t,n){return n.split(".").reduce((o,r)=>o&&o[r],t)}const an="",he=(t,n)=>{const o=t.__vccOpts||t;for(const[r,s]of n)o[r]=s;return o},St=["onClick"],qe=he({__name:"index",props:e.mergeModels({api:{type:Function},showCheckAll:{type:Boolean,default:!0},maxLimit:{type:Number,default:void 0},optionClick:{type:Function,default:()=>{}},data:{type:Array},labelValue:{type:Object,default:()=>({label:"label",labelEn:"labelEn",value:"value"})},changeLocal:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["success","change","changeAll"],["update:modelValue"]),setup(t,{emit:n}){const o=t,r=e.useAttrs(),{t:s,locale:l}=ee.useI18n(),a=e.useModel(t,"modelValue"),i=e.computed(()=>r["value-key"]!=null),c=e.ref(""),b=e.computed(()=>{if(r.remote!==void 0)return o.data;const x=_e(c.value),{data:k,labelValue:Y}=o,Z=k||y.value;if(x.length==0)return Z;const{label:V,labelEn:ce}=Y;let D=l.value=="en_us"?ce||"i18nName":V;return x.length==1?Z.filter(ne=>ne[D].toLowerCase().includes(x[0].toLowerCase())):Z.filter(ne=>{let de=!1;return de=x.some(xe=>ne[D].toLowerCase()==xe.toLowerCase()),de})}),C=e.computed({get(){return r.multiple==null||a.value==null?!1:a.value.length==b.value.length},set(x){return x}}),w=n,y=e.ref([]),g=async()=>{const{data:x}=await o.api();y.value=[...x],w("success",y)};o.api&&g();function h(x){w("change",x),d.value&&e.nextTick(()=>{o.optionClick&&o.optionClick(d.value),d.value=null})}const d=e.ref(null);function m(x){d.value=x}const S=o.labelValue.label.split("-"),$=x=>{if(S.length==1){if(o.changeLocal)return s(x[o.labelValue.label]);let k=l.value=="en_us"?x[o.labelValue.labelEn||"i18nName"]:x[o.labelValue.label];return k=k||x[o.labelValue.label],k+""}else{let k=[];return S.forEach(Y=>{k.push(x[Y])}),k.join("-")}};function _(x){let k=o.data?o.data:y.value;a.value=x?k.map(Y=>i.value?Y:Y[o.labelValue.value]):[],e.nextTick(()=>{w("change",a.value),w("changeAll",a.value,k)})}function I(x){w("change",i.value?x:x[o.labelValue.value]),e.nextTick(()=>{o.optionClick&&o.optionClick(x)})}function B(x){return a.value.length>=o.maxLimit&&!a.value.includes(x[o.labelValue.value])}function A(x){return x.map(k=>({...k,label:$(k),value:i.value?k:k[o.labelValue.value]}))}const L=e.ref([]),E=o.data?o.data:y.value;L.value=A(E),e.watch(()=>o.data?o.data:y.value,x=>{var Y;const k=A(x);if(k.length!==L.value.length)L.value=k;else{let Z=!1;for(let V=0;V<k.length;V++)if(k[V].value!==((Y=L.value[V])==null?void 0:Y.value)){Z=!0;break}Z&&(L.value=k)}},{deep:!0});const U=e.computed(()=>L.value);return(x,k)=>{const Y=e.resolveComponent("el-checkbox"),Z=e.resolveComponent("el-select-v2"),V=e.resolveComponent("el-option"),ce=e.resolveComponent("el-select");return e.unref(r).v2!=null?(e.openBlock(),e.createBlock(Z,e.mergeProps({key:0,options:U.value,modelValue:a.value,"onUpdate:modelValue":k[1]||(k[1]=D=>a.value=D)},e.unref(r),{filterable:"","collapse-tags":"","collapse-tags-tooltip":"",clearable:"",onChange:h,onClear:h}),e.createSlots({default:e.withCtx(({item:D})=>[e.createElementVNode("div",{onClick:ae=>m(D)},e.toDisplayString(D.label),9,St)]),_:2},[e.unref(r).multiple!=null?{name:"header",fn:e.withCtx(()=>[e.renderSlot(x.$slots,"header",{},()=>[e.createVNode(Y,{class:"mgl20",modelValue:C.value,"onUpdate:modelValue":k[0]||(k[0]=D=>C.value=D),onChange:_},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0)]),key:"0"}:void 0]),1040,["options","modelValue"])):(e.openBlock(),e.createBlock(ce,e.mergeProps({key:1,modelValue:a.value,"onUpdate:modelValue":k[3]||(k[3]=D=>a.value=D),filterable:"","collapse-tags":"","collapse-tags-tooltip":"","filter-method":e.unref(r).remote!=null?void 0:D=>c.value=D,clearable:""},e.unref(r),{onClear:t.optionClick}),{default:e.withCtx(()=>[e.unref(r).multiple!=null&&t.showCheckAll&&t.maxLimit==null?e.renderSlot(x.$slots,"header",{key:0},()=>[e.createVNode(Y,{class:"mgl20",modelValue:C.value,"onUpdate:modelValue":k[2]||(k[2]=D=>C.value=D),onChange:_},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(D,ae)=>(e.openBlock(),e.createBlock(V,{key:ae,label:$(D),disabled:e.unref(r).multiple!=null&&t.maxLimit>0?B(D):!1,onClick:e.withModifiers(ne=>I(D),["stop"]),value:i.value?D:D[t.labelValue.value]},null,8,["label","disabled","onClick","value"]))),128))]),_:3},16,["modelValue","filter-method","onClear"]))}}},[["__scopeId","data-v-51bd1467"]]),sn="",$t=e.defineComponent({props:{name:{tyepe:String,required:!0}}});function Vt(t,n,o,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(t.name)))]),_:1})}const $e=he($t,[["render",Vt],["__scopeId","data-v-733f9daa"]]),Et={__name:"index",emits:["ok","no"],setup(t,{emit:n}){const o=n,r=oe.debounce(()=>{o("ok")},500);function s(){o("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"])])}}},cn="",Tt=["accept"],It=he({__name:"index",props:{accept:{type:String,default:".xlsx,.xls"},fields:{type:Object,default:()=>({})},fileChange:{type:Function,required:!0}},emits:["fileChange"],setup(t,{emit:n}){const o=t,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,o.fields).catch(()=>{s.value=!1}).finally(()=>{r.value.value=null});await o.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,{type:"primary",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:t.accept,style:{position:"absolute",width:"0px",height:"0px",opacity:"0"},type:"file"},null,40,Tt)])}}},[["__scopeId","data-v-cf92fafe"]]);function Ve(t){let n={};return t.forEach(o=>{const{key:r,type:s,option:l={},value:a,dateType:i="date"}=o;if(r)if(s=="input"&&(l!=null&&l.multiple))n[r]=_e(a);else if(s=="date")if(i.includes("range")){const[c,b]=r;let[C,w]=a||[];C&&i=="daterange"&&(C=ue(C).format("YYYY-MM-DD 00:00:00"),w=ue(w).format("YYYY-MM-DD 23:59:59")),n[c]=C,n[b]=w}else n[r]=a;else n[r]=a}),n}const un="",Lt={key:0},Ft={class:"btns"},vt={class:"left"},Dt={class:"right"},Ae=he({__name:"index",props:{form:{type:Object,required:!0}},emits:["confirm","reset","visibleChange"],setup(t,{expose:n,emit:o}){const r=t,s=o,l=e.ref(!0),a=e.ref(null),{t:i}=ee.useI18n(),c=e.computed(()=>l.value?i("guan-bi"):i("zhan-kai"));function b(){s("confirm")}function C(m){m.option.onClear&&m.option.onClear(),s("confirm")}function w(){s("reset")}function y(){s("confirm")}function g(){return Ve(r.form.items)}const h=oe.cloneDeep(r.form.items);function d(){r.form.items.forEach(m=>{const S=h.find($=>$.key==m.key);S&&(m.value=S.value)})}return n({getPrm:g,reset:d}),(m,S)=>{const $=e.resolveComponent("el-input"),_=e.resolveComponent("el-date-picker"),I=e.resolveComponent("el-form-item"),B=e.resolveComponent("el-form"),A=e.resolveComponent("el-link"),L=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",{class:"searchBar-container mgt10 mgb10",onKeydown:e.withKeys(b,["enter"])},[e.createElementVNode("div",{class:"searchBar",style:e.normalizeStyle({height:l.value?"auto":"42px"})},[e.createVNode(B,{inline:"",model:t.form.data},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.form.items.filter(E=>!E.hidden),E=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:E.key},[E.type=="br"?(e.openBlock(),e.createElementBlock("br",Lt)):(e.openBlock(),e.createBlock(I,{key:1,label:E.name},{default:e.withCtx(()=>{var U,x;return[E.type==="input"?(e.openBlock(),e.createBlock($,{key:0,modelValue:E.value,"onUpdate:modelValue":k=>E.value=k,class:e.normalizeClass(((U=E.option)==null?void 0:U.class)||"w150"),placeholder:m.$t("qing-shu-ru"),clearable:""},null,8,["modelValue","onUpdate:modelValue","class","placeholder"])):E.type==="custom"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(E.render),{key:1})):e.createCommentVNode("",!0),E.type==="select"?(e.openBlock(),e.createBlock(qe,e.mergeProps({key:2,class:((x=E.option)==null?void 0:x.class)||"w150",modelValue:E.value,"onUpdate:modelValue":k=>E.value=k},{ref_for:!0},E.option,{onChange:b,onClear:k=>C(E)}),null,16,["class","modelValue","onUpdate:modelValue","onClear"])):e.createCommentVNode("",!0),E.type==="date"?(e.openBlock(),e.createBlock(_,{key:3,class:e.normalizeClass({datetimerange:"w300",daterange:"w200"}[E.dateType]||"w100"),modelValue:E.value,"onUpdate:modelValue":k=>E.value=k,"value-format":{datetimerange:"YYYY-MM-DD HH:mm:ss",daterange:"YYYY-MM-DD"}[E.dateType]||"YYYY-MM-DD",type:E.dateType||"date",onFocus:k=>a.value=E,onChange:k=>y(),placeholder:m.$t("qing-xuan-ze"),"start-placeholder":m.$t("kai-shi-shi-jian"),"end-placeholder":m.$t("jie-shu-shi-jian")},null,8,["class","modelValue","onUpdate:modelValue","value-format","type","onFocus","onChange","placeholder","start-placeholder","end-placeholder"])):e.createCommentVNode("",!0)]}),_:2},1032,["label"]))],64))),128))]),_:1},8,["model"])],4),e.createElementVNode("div",Ft,[e.createElementVNode("div",vt,[e.renderSlot(m.$slots,"table-header-left",{},void 0,!0)]),e.createElementVNode("div",Dt,[e.createVNode(A,{underline:"never",class:"mgr10",onClick:S[0]||(S[0]=()=>{s("visibleChange",!l.value),l.value=!l.value})},{default:e.withCtx(()=>[e.createVNode($e,{name:l.value?"ArrowUp":"ArrowDown"},null,8,["name"]),e.createTextVNode(" "+e.toDisplayString(c.value),1)]),_:1}),e.createVNode(L,{type:"primary",onClick:b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.$t("shai-xuan")),1)]),_:1}),e.createVNode(L,{type:"primary",onClick:w},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.$t("chong-zhi")),1)]),_:1}),e.renderSlot(m.$slots,"btn",{},void 0,!0)])])],32)}}},[["__scopeId","data-v-3c0a6716"]]),je={pageNoKey:"pageNo",pageSizeKey:"pageSize",totalKey:"total",defaultPageSize:10,pageSizes:[10,50,100,500],responseDataKeys:{rows:["rows","records","list"],total:["totalRows","total"]},showSearch:!1,showPage:!1,showShadow:!1,showCheckBox:!1,enableCellCopy:!0};let me={...je};function Bt(t){me={...me,...t,responseDataKeys:{...me.responseDataKeys,...t.responseDataKeys||{}}}}function Re(){return me}function zt(){me={...je}}const hn="",Mt={class:"center"},Ot=he({__name:"index",props:{id:{type:String,required:!1},loading:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0},searchForm:{type:Object,default:()=>({items:[],selections:[]})},api:{type:Function},data:{type:Array},tableConfig:{type:Object,default:()=>({})}},setup(t,{expose:n}){const{t:o,locale:r}=ee.useI18n(),s=Fe.useRoute(),l=Re(),a=t,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 f=s.path.replace(/\//g,"-").replace(/^-/,"")||"default-table";return a.id?`listPageId-${f}-${a.id}`:`listPageId-${f}`}),C=oe.cloneDeep(a.searchForm.items),w=a.searchForm.pageNoKey||l.pageNoKey,y=a.searchForm.pageSizeKey||l.pageSizeKey,g=e.reactive({[w]:1,[y]:a.searchForm.defaultPageSize||l.defaultPageSize,total:0}),h=e.ref(null),d=e.ref(null),m=e.ref(450),S=oe.debounce(()=>{e.nextTick(()=>{if(!d.value)return;const u=d.value.getBoundingClientRect(),T=window.innerHeight,v=u.top,N=100,P=T-v-N,z=200;m.value=Math.max(P,z)})},100),$=()=>{S()},_=()=>{if(!a.searchForm.enableCellCopy&&!l.enableCellCopy)return!1;const f=h.value;if(!f||!f.$el)return!1;const u=f.$el;return u.classList.add("cell-copy-enabled"),u.setAttribute("tabindex","-1"),u.removeEventListener("mousedown",D),u.removeEventListener("mousemove",ae),u.removeEventListener("mouseup",ne),u.removeEventListener("keydown",Te),u.addEventListener("mousedown",D),u.addEventListener("mousemove",ae),u.addEventListener("mouseup",ne),u.addEventListener("keydown",Te),!0};e.onMounted(()=>{S(),window.addEventListener("resize",$),(a.searchForm.enableCellCopy||l.enableCellCopy)&&(document.addEventListener("mouseup",Ke),document.addEventListener("mousedown",We),setTimeout(()=>{_()},500))}),e.onUpdated(()=>{(a.searchForm.enableCellCopy||l.enableCellCopy)&&setTimeout(()=>{_()},500)}),e.onUnmounted(()=>{if(window.removeEventListener("resize",$),a.searchForm.enableCellCopy||l.enableCellCopy){document.removeEventListener("mouseup",Ke),document.removeEventListener("mousedown",We);const f=h.value;if(f&&f.$el){const u=f.$el;u.removeEventListener("mousedown",D),u.removeEventListener("mousemove",ae),u.removeEventListener("mouseup",ne),u.removeEventListener("keydown",Te)}}});const I=e.computed(()=>Z.value.height||m.value);let B;async function A(f){const{dataFormat:u}=a.tableConfig;f[w]!=1&&(f.nextSearchAfter=B),i.value=!0;const{code:T,data:v={}}=await a.api(f).finally(()=>{i.value=!1,a.searchForm.selections=[]});if(T==200){let N=[];for(const z of l.responseDataKeys.rows)if(v[z]){N=v[z];break}let P=0;for(const z of l.responseDataKeys.total)if(v[z]!==void 0){P=v[z];break}c.value=u?u(N):N,g.total=P,B=v.nextSearchAfter,(a.searchForm.enableCellCopy||l.enableCellCopy)&&e.nextTick(()=>{setTimeout(()=>{_()},100)})}}function L(f={}){const{searchData:u=()=>({})}=a.tableConfig,T=u();A({...g,...Ve(a.searchForm.items),...f,...T})}function E(){const{reset:f}=a.tableConfig;f&&f(),a.searchForm.items.forEach(u=>{const T=C.find(v=>oe.isArray(u.key)&&oe.isArray(v.key)?u.key.join(",")==v.key.join(","):v.key==u.key);T&&(u.value=T.value)}),L()}a.api&&a.immediate&&L();function U(){return{...g,...Ve(a.searchForm.items)}}const x=()=>{const f=h.value;f&&f.clearSort()},k=e.reactive({storage:!0}),Y=e.reactive({drag:!0,resizable:!0,maxFixedSize:0}),Z=e.computed(()=>{const{customConfig:f,columnConfig:u,...T}=a.tableConfig;return{headerAlign:"left",align:"center",customConfig:{...k,...f},columnConfig:{...Y,...u},"virtual-x-config":{enabled:!1,scrollToLeftOnChange:!1},"virtual-y-config":{enabled:!0,gt:100},...T}}),V=e.reactive({isSelecting:!1,startCell:null,endCell:null,selectedCells:[]}),ce=f=>{const u=f.closest(".vxe-body--column");if(!u||u.classList.contains("col--checkbox")||u.classList.contains("col--seq"))return null;const T=u.closest(".vxe-body--row");if(!T)return null;const v=h.value;if(!v)return null;let N=-1;const P=T.getAttribute("data-rowid");if(P!=null)N=parseInt(P,10);else{const M=T.parentElement;N=Array.from(M.querySelectorAll(".vxe-body--row")).indexOf(T)}if(N<0)return null;let z=-1;const Q=u.getAttribute("data-colid");if(Q&&(z=v.getColumns().findIndex(F=>F.id===Q)),z<0){const F=Array.from(T.querySelectorAll(".vxe-body--column")).indexOf(u),j=!!u.closest(".vxe-table--fixed-left-wrapper"),H=!!u.closest(".vxe-table--fixed-right-wrapper"),q=v.getColumns();if(j){const K=q.filter(R=>R.fixed==="left");F<K.length&&(z=q.indexOf(K[F]))}else if(H){const K=q.filter(R=>R.fixed==="right");F<K.length&&(z=q.indexOf(K[F]))}else{const K=a.searchForm.showCheckBox?1:0;z=q.filter(G=>G.fixed==="left").length+F-K}}return z<0?null:{rowIndex:N,colIndex:z,cell:u}},D=f=>{const u=ce(f.target);if(!u){de();return}V.isSelecting=!0,V.startCell={rowIndex:u.rowIndex,colIndex:u.colIndex},V.endCell={...V.startCell},xe(),He()},ae=f=>{if(!V.isSelecting)return;const u=ce(f.target);u&&(V.endCell={rowIndex:u.rowIndex,colIndex:u.colIndex},xe(),He())},ne=()=>{V.isSelecting=!1},de=()=>{V.selectedCells=[],V.startCell=null,V.endCell=null;const f=h.value;if(!f)return;f.$el.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(T=>{T.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")})},xe=()=>{if(!V.startCell||!V.endCell){V.selectedCells=[];return}const f=V.startCell.rowIndex,u=V.endCell.rowIndex,T=V.startCell.colIndex,v=V.endCell.colIndex,N=Math.min(f,u),P=Math.max(f,u),z=Math.min(T,v),Q=Math.max(T,v);V.selectedCells=[];for(let M=N;M<=P;M++)for(let F=z;F<=Q;F++)V.selectedCells.push({rowIndex:M,colIndex:F})},He=()=>{e.nextTick(()=>{const f=h.value;if(!f)return;const u=f.$el;if(u.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(j=>{j.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")}),V.selectedCells.length===0)return;const T=f.getColumns(),v=V.selectedCells.map(j=>j.rowIndex),N=V.selectedCells.map(j=>j.colIndex),P=Math.min(...v),z=Math.max(...v),Q=Math.min(...N),M=Math.max(...N),F=[u.querySelector(".vxe-table--body-wrapper tbody"),u.querySelector(".vxe-table--fixed-left-wrapper tbody"),u.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean);V.selectedCells.forEach(({rowIndex:j,colIndex:H})=>{const q=T[H];if(!q)return;const K=q.fixed==="left",R=q.fixed==="right";for(const G of F){const ge=G.querySelectorAll(".vxe-body--row")[j];if(!ge)continue;const re=Array.from(ge.querySelectorAll(".vxe-body--column"));let O=null;if(K&&G.closest(".vxe-table--fixed-left-wrapper")){const J=T.filter(X=>X.fixed==="left").indexOf(q);O=re[J]}else if(R&&G.closest(".vxe-table--fixed-right-wrapper")){const J=T.filter(X=>X.fixed==="right").indexOf(q);O=re[J]}else if(!K&&!R&&G.closest(".vxe-table--body-wrapper")){const se=a.searchForm.showCheckBox?1:0,J=T.filter(Ie=>Ie.fixed==="left").length,X=H-J;O=re[X+se]}if(O&&!O.classList.contains("col--checkbox")&&!O.classList.contains("col--seq")){O.classList.add("cell-selected"),j===P&&O.classList.add("cell-border-top"),j===z&&O.classList.add("cell-border-bottom"),H===Q&&O.classList.add("cell-border-left"),H===M&&O.classList.add("cell-border-right");break}}})})},tn=async()=>{if(V.selectedCells.length===0)return;const f=h.value;if(!f)return;const u=f.$el,T=f.getColumns(),v=[...new Set(V.selectedCells.map(M=>M.rowIndex))].sort((M,F)=>M-F),N=[...new Set(V.selectedCells.map(M=>M.colIndex))].sort((M,F)=>M-F),P=[u.querySelector(".vxe-table--body-wrapper tbody"),u.querySelector(".vxe-table--fixed-left-wrapper tbody"),u.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean),z=[];v.forEach(M=>{const F=[];N.forEach(j=>{const H=T[j];if(!H){F.push("");return}const q=H.fixed==="left",K=H.fixed==="right";let R="";for(const G of P){const ge=G.querySelectorAll(".vxe-body--row")[M];if(!ge)continue;const re=Array.from(ge.querySelectorAll(".vxe-body--column"));let O=null;if(q&&G.closest(".vxe-table--fixed-left-wrapper")){const J=T.filter(X=>X.fixed==="left").indexOf(H);O=re[J]}else if(K&&G.closest(".vxe-table--fixed-right-wrapper")){const J=T.filter(X=>X.fixed==="right").indexOf(H);O=re[J]}else if(!q&&!K&&G.closest(".vxe-table--body-wrapper")){const se=a.searchForm.showCheckBox?1:0,J=T.filter(Ie=>Ie.fixed==="left").length,X=j-J;O=re[X+se]}if(O&&!O.classList.contains("col--checkbox")&&!O.classList.contains("col--seq")){R=O.innerText||O.textContent||"",R=R.trim(),R=R.replace(/\n/g," ").replace(/\s+/g," ");break}}F.push(R)}),z.push(F.join(" "))});const Q=z.join(`
|
|
2
|
+
`);try{await navigator.clipboard.writeText(Q)}catch(M){console.error("复制失败:",M)}},Te=f=>{!a.searchForm.enableCellCopy&&!l.enableCellCopy||((f.ctrlKey||f.metaKey)&&f.key==="c"?V.selectedCells.length>0&&(f.preventDefault(),f.stopPropagation(),tn()):f.key==="Escape"&&de())},Ke=()=>{V.isSelecting=!1},We=f=>{const u=h.value;if(!u||!u.$el)return;u.$el.contains(f.target)||de()},nn=f=>{g[w]=f,L()},on=f=>{g[y]=f,g[w]=1,L()};function Ze(){const f=h.value.getCheckboxRecords();a.searchForm.selections=f}const Ge=f=>{const u=h.value;if(u){u.toggleCheckboxRow(f);const T=h.value.getCheckboxRecords();a.searchForm.selections=T}};return n({tableRef:h,getList:L,getPrm:U,clearSort:x,calculateTableHeight:S}),(f,u)=>{var M;const T=e.resolveComponent("el-button"),v=e.resolveComponent("el-checkbox"),N=e.resolveComponent("el-text"),P=e.resolveComponent("vxe-column"),z=e.resolveComponent("VxeTable"),Q=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({box:t.searchForm.showShadow})},[t.searchForm.showSearch?(e.openBlock(),e.createBlock(Ae,{key:0,form:t.searchForm,onReset:E,onConfirm:u[1]||(u[1]=F=>L()),onVisibleChange:e.unref(S)},{btn:e.withCtx(()=>[u[3]||(u[3]=e.createElementVNode("span",{class:"mgr10"},null,-1)),e.renderSlot(f.$slots,"search-bar-btn",{},void 0,!0),e.createVNode(T,{class:"mgl10",round:"",onClick:u[0]||(u[0]=F=>h.value.openCustom())},{default:e.withCtx(()=>[e.createVNode($e,{name:"Tools"})]),_:1})]),_:3},8,["form","onVisibleChange"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"table-header-left",{},void 0,!0),e.createElementVNode("div",{ref_key:"tableContentRef",ref:d},[e.createVNode(z,e.mergeProps({id:b.value,ref_key:"tableRef",ref:h,loading:t.loading||i.value,data:t.api?c.value:t.data,border:""},Z.value,{height:I.value,onCheckboxChange:Ze,onCheckboxAll:Ze,onSortChange:(M=Z.value["sort-config"])==null?void 0:M.sortChange}),{default:e.withCtx(()=>[t.searchForm.showCheckBox==null||t.searchForm.showCheckBox?(e.openBlock(),e.createBlock(P,{key:0,type:"checkbox",width:e.unref(r)=="zh_cn"?80:150,title:f.$t("xu-hao"),fixed:"left"},{checkbox:e.withCtx(({rowIndex:F,row:j,checked:H,disabled:q,indeterminate:K})=>[e.createElementVNode("div",Mt,[H?(e.openBlock(),e.createBlock(v,{key:0,checked:!0,disabled:q,size:"default",onClick:e.withModifiers(R=>!q&&Ge(j),["stop"])},null,8,["disabled","onClick"])):(e.openBlock(),e.createBlock(v,{key:1,disabled:q,checked:!1,size:"default",onClick:e.withModifiers(R=>!q&&Ge(j),["stop"])},null,8,["disabled","onClick"])),e.createVNode(N,{type:"info",class:"mgl5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(F+1),1)]),_:2},1024)])]),_:1},8,["width","title"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"default",{},void 0,!0)]),_:3},16,["id","loading","data","height","onSortChange"])],512),t.searchForm.showPage?(e.openBlock(),e.createBlock(Q,{key:1,"current-page":g[e.unref(w)],"onUpdate:currentPage":u[2]||(u[2]=F=>g[e.unref(w)]=F),class:"myPagination mgt10",background:"",layout:"total, sizes, prev, pager, next",total:g.total,"page-size":g[e.unref(y)],"page-sizes":t.searchForm.pageSizes||e.unref(l).pageSizes,onCurrentChange:nn,onSizeChange:on},null,8,["current-page","total","page-size","page-sizes"])):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-c022c16d"]]),Nt={__name:"index",props:{sheetsConfig:{type:Object,required:!0},fileName:{type:String,required:!0}},setup(t){const n=t;function o(){ut(n.fileName,n.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:o}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(r.$t("xia-zai-dao-ru-mo-ban")),1)])]),_:3},16)}}},qt={mounted(t,n){n.value&&Ue(t)},updated(t,n){n.value?Ue(t):Pe(t)},beforeUnmount(t){Pe(t)}};async function Ue(t){await y();const n=t.querySelector(".el-dialog");if(!n)return;const o=t.querySelector(".el-dialog__header"),r=t.querySelector(".el-overlay");r.style.cssText+="overflow: hidden;",o.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}};o.addEventListener("mousedown",c),document.addEventListener("mousemove",b),document.addEventListener("mouseup",C),window.addEventListener("resize",w);function a(){l.mouse.x-l.drag.x>=l.dialog.x&&(l.drag.x=l.mouse.x-l.dialog.x),l.drag.x-l.mouse.x>=l.window.width-(l.dialog.x+l.dialog.width)&&(l.drag.x=l.mouse.x+l.window.width-l.dialog.x-l.dialog.width),l.mouse.y-l.drag.y>=l.dialog.y&&(l.drag.y=l.mouse.y-l.dialog.y),l.drag.y-l.mouse.y>=l.window.height-(l.dialog.y+l.dialog.height)&&(l.drag.y=l.mouse.y+l.window.height-l.dialog.y-l.dialog.height),i()}function i(){let g=l.drag.y-l.mouse.y+l.dialog.y,h=l.drag.x-l.mouse.x+l.dialog.x;n.style.cssText+=`position: absolute; top: calc(${g}px - ${l.dialog.marginTop}); left: ${h}px;`}function c(g){g.button===0&&(l.window={width:document.body.clientWidth,height:document.body.clientHeight},l.dialog=n.getBoundingClientRect(),l.dialog.marginTop=window.getComputedStyle(n).marginTop,l.mouse={x:g.clientX,y:g.clientY},s=!0)}function b(g){s&&(l.drag={x:g.clientX,y:g.clientY},r.style.userSelect="none",a())}function C(g){r.style.userSelect="auto",s=!1}function w(g){}function y(){return new Promise((g,h)=>{setTimeout(()=>{g()},500)})}t.__mouseDown__=c,t.__mouseUp__=C,t.__mouseMove__=b,t.__sizeChange__=w}function Pe(t){document.removeEventListener("mousedown",t.__mouseDown__),document.removeEventListener("mousemove",t.__mouseMove__),document.removeEventListener("mouseup",t.__mouseUp__),window.removeEventListener("resize",t.__sizeChange__)}const gn="",At={key:0,class:"drawer-btn"},jt={key:1},Rt={__name:"index",props:{layer:{type:Object,default:()=>({show:!1,type:"layer",title:"",showButton:!1}),required:!0},loading:{type:Boolean,default:!1}},emits:["confirm"],setup(t,{emit:n}){const o=t,r=n,{t:s}=ee.useI18n(),l=oe.debounce(()=>{r("confirm")},300);async function a(){o.layer.type=="drawer"?o.layer.onClose?o.layer.onClose():await W.ElMessageBox.confirm(s("que-ding-guan-bi-ma"),{confirmButtonText:s("que-ding"),cancelButtonText:s("qu-xiao"),type:"warning"}).catch(()=>{})=="confirm"&&(o.layer.show=!1):o.layer.show=!1}return(i,c)=>{const b=e.resolveComponent("el-button"),C=e.resolveComponent("el-drawer"),w=e.resolveComponent("el-dialog");return t.layer.type?(e.openBlock(),e.createBlock(C,{key:0,modelValue:t.layer.show,"onUpdate:modelValue":c[0]||(c[0]=y=>t.layer.show=y),size:t.layer.width||"100%",title:t.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)),t.layer.showButton?(e.openBlock(),e.createElementBlock("div",At,[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:t.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",jt,[e.createVNode(w,{"close-on-click-modal":!1,modelValue:t.layer.show,"onUpdate:modelValue":c[1]||(c[1]=y=>t.layer.show=y),title:t.layer.title,width:t.layer.width||500,center:""},e.createSlots({default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:2},[t.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),t.layer.show]])}}};function Ut(t,n={}){const o=le(),r={inForm:!0,required:!0,...n},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+)*$/}[t],{inForm:l,value:a,required:i,msg:c=o("validate.invalidInput")}=r;return l?function(b,C,w){if(i){s.test(C)?w():w(new Error(c));return}C&&!s.test(C)?w(new Error(c)):w()}:s.test(a)}class Pt{constructor(n={}){this.config={clientCode:n.clientCode||"one-portal",casServerUrl:`https://one-portal${n.isTest?"-test":""}.joy-group.com/api`,casPortalUrl:`https://one-portal${n.isTest?"-test":""}.joy-group.com`,serviceUrl:n.serviceUrl||window.location.origin+"/cas/callback",tokenKey:n.tokenKey||"one_portal_token",userKey:n.userKey||"one_portal_user",debug:n.debug||!1,autoLogin:n.autoLogin!==!1,loginCallback:n.loginCallback||null,logoutCallback:n.logoutCallback||null,errorCallback:n.errorCallback||null},this.token=null,this.user=null,this.init()}init(){this.log("OnePortal CAS SDK 初始化中..."),this.loadFromStorage();const o=new URLSearchParams(window.location.search).get("ticket");this.isLoggedIn()&&this.config.loginCallback?this.config.loginCallback(this.user,this.token):o?(this.log("检测到ST票据:",o),this.validateTicket(o)):this.config.autoLogin&&!this.isLoggedIn()&&(this.log("用户未登录,准备跳转到CAS登录页面"),this.login())}loadFromStorage(){try{this.token=localStorage.getItem(this.config.tokenKey);const n=localStorage.getItem(this.config.userKey);n&&(this.user=JSON.parse(n)),this.log("从本地存储加载数据:",{token:!!this.token,user:!!this.user})}catch(n){this.log("加载本地存储数据失败:",n)}}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(n){this.log("保存到本地存储失败:",n)}}clearStorage(){try{localStorage.removeItem(this.config.tokenKey),localStorage.removeItem(this.config.userKey),this.log("本地存储已清除")}catch(n){this.log("清除本地存储失败:",n)}}isLoggedIn(){return!!(this.token&&this.user)}getUser(){return this.user}getToken(){return this.token}login(){const n=`${this.config.casPortalUrl}?appCode=${this.config.clientCode}&redirectUrl=${encodeURIComponent(this.config.serviceUrl)}`;this.log("跳转到CAS登录页面:",n),window.location.href=n}async validateTicket(n){try{this.log("验证ST票据:",n);const o=await fetch(`${this.config.casServerUrl}/auth/validateST?ticket=${n}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!o.ok)throw new Error(`HTTP ${o.status}: ${o.statusText}`);const r=await o.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(o){return this.log("ST票据验证失败:",o),this.handleError(o),!1}}clearTicketFromUrl(){const n=new URL(window.location);n.searchParams.delete("ticket"),window.history.replaceState({},document.title,n.toString())}async logout(n=!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(o){this.log("调用服务端登出接口失败:",o)}this.token=null,this.user=null,this.clearStorage(),this.config.logoutCallback&&this.config.logoutCallback(),n&&this.login()}catch(o){this.log("登出失败:",o),this.handleError(o)}}async request(n,o={}){const r={headers:{"Content-Type":"application/json",...o.headers},...o};r.headers.appId=this.config.clientCode,this.token&&(r.headers.Authorization=`Bearer ${this.token}`);try{const s=await fetch(n,r);return s.status===401?(this.log("Token已过期,需要重新登录"),this.logout(),null):s}catch(s){throw this.log("请求失败:",s),s}}async fetchUserInfo(){try{const n=await this.request(`${this.config.casServerUrl}/auth/user`);if(n&&n.ok){const o=await n.json();if(o.success&&o.data)return this.user=o.data,this.saveToStorage(),this.user}return null}catch(n){return this.log("获取用户信息失败:",n),null}}async refreshToken(){this.log("Token刷新功能暂未实现")}handleError(n){this.log("发生错误:",n),this.config.errorCallback&&this.config.errorCallback(n)}log(...n){this.config.debug&&console.log("[OnePortal CAS SDK]",...n)}checkLoginStatus(){return!this.isLoggedIn()&&this.config.autoLogin?(this.login(),!1):this.isLoggedIn()}setConfig(n,o){this.config[n]=o}getConfig(n){return this.config[n]}}function Yt(t,n={}){const r=Object.assign({manual:!1,log:!1,params:null,format:null},n),{manual:s,log:l,params:a={},cb:i,format:c}=r,b=e.ref([]),C=e.ref(!1),w=y=>{const g=y||a;C.value=!0,t(g).then(h=>{const{code:d,data:m,msg:S}=h;if(i){const{records:$,rows:_}=m||{},I=$||_?$||_:m;b.value=Ee(I,c),i(h)}if(m){if(m.records!=null||m.rows!=null){const{records:$,rows:_,total:I=0}=m||{};g&&g.total!=null&&(a.total=parseInt(I)),b.value=Ee($||_||[],c)}else b.value=Ee(m,c);l&&console.log("useRequest-res",b.value)}}).catch(h=>{i&&(console.log("useRequestErr",h),i({code:500}))}).finally(()=>{C.value=!1})};return s||w(),[C,b,w]}function Ht(t){const n=e.ref(t),o=e.ref(""),r=e.ref("");return e.watch(n,s=>{const l=s||["",""];o.value=l[0],r.value=l[1]}),[n,o,r]}function Kt(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function Ee(t,n){if(!n)return t;if(t instanceof Array)return t.map(r=>{let s={};return n.forEach(l=>s[l]=r[l]),s});let o={};return n.forEach(r=>o[r]=t[r]),o}function Wt(t,n=[]){const{locale:o}=ee.useI18n(),r=e.ref(t());return e.watch([o,...n],()=>{r.value=t()},{immediate:!0}),r}function Zt(t,n="zh_cn",o="en_us"){if(!t)return"-";const r={en_us:o,zh_cn:n},l=be().global.locale.value;return t[r[l]]||t[n]||"-"}function Gt(t,n){let o=te.mapState;return typeof t=="string"&&t.length>0&&(o=te.createNamespacedHelpers(t).mapState),Ye(n,o)}function Jt(t,n){let o=te.mapGetters;return typeof t=="string"&&t.length>0&&(o=te.createNamespacedHelpers(t).mapGetters),Ye(n,o)}function Xt(t,n){let o=te.mapActions;return typeof t=="string"&&t.length>0&&(o=te.createNamespacedHelpers(t).mapActions),Qt(n,o)}function Ye(t,n){const o=te.useStore(),r=n(t),s={};return Object.keys(r).forEach(l=>{const a=r[l].bind({$store:o});s[l]=e.computed(a)}),s}function Qt(t,n){const o=te.useStore(),r=n(t),s={};return Object.keys(r).forEach(l=>{s[l]=r[l].bind({$store:o})}),s}function we(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}function en(){fe.VxeUI.renderer.add("Enum",{renderTableDefault(t,n){let o;if([null,void 0].includes(n.row[n.column.field]))return"-";const r=n.row[n.column.field];if(t.type=="tag"){let s;return e.createVNode(e.resolveComponent("el-text"),{type:t.enum.getTag(r)},we(s=t.enum.getName(r))?s:{default:()=>[s]})}return e.createVNode(e.resolveComponent("el-text"),null,we(o=t.enum.getName(r))?o:{default:()=>[o]})}}),fe.VxeUI.renderer.add("InputNumber",{renderTableDefault(t,n){return e.createVNode(W.ElInputNumber,e.mergeProps({modelValue:n.row[n.column.field],"onUpdate:modelValue":o=>n.row[n.column.field]=o},t.props,{"step-strictly":!0,"value-on-clear":0}),null)}}),fe.VxeUI.renderer.add("TrueFalse",{renderTableDefault(t,n){const{locale:o}=ee.useI18n();let r=o.value=="zh_cn";return e.createVNode(W.ElText,{type:n.row[n.column.field]?"success":"danger"},{default:()=>[n.row[n.column.field]?r?"是":"YES":r?"否":"NO"]})}}),fe.VxeUI.renderer.add("I18n",{renderTableDefault(t,n){const{locale:o}=ee.useI18n();let r=o.value=="zh_cn"?n.column.field:t.fieldEn;return n.row[r]||n.row[n.column.field]}}),fe.VxeUI.renderer.add("Link",{renderTableDefault(t,n){let o=n.column.field;const r=Fe.useRouter(),{multiple:s,to:l,openType:a="system"}=t,i=n.row[o];function c(b,C){a=="blank"?window.open(b):r.push({path:b,query:{[o]:C}})}if(s){const b=(i==null?void 0:i.split(","))||[];return b.map((C,w)=>e.createVNode("span",null,[e.createVNode(W.ElLink,{underline:"never",type:"primary",onclick:()=>c(a=="stystem"?l:C,C)},we(C)?C:{default:()=>[C]}),w<b.length-1?",":""]))}return e.createVNode(W.ElLink,{underline:"never",type:"primary",onclick:()=>c(a=="stystem"?l:i,i)},we(i)?i:{default:()=>[i]})}})}p.CmpDictionary=qe,p.CmpIcon=$e,p.ConfrimButton=Et,p.DownExcelTemp=Nt,p.ImportButton=It,p.LayOutForm=Je,p.Layer=Rt,p.ListPage=Ot,p.OnePortalCasSDK=Pt,p.SearchBar=Ae,p.StatusMap=Se,p._toRaw=gt,p._typeOf=Kt,p.arrToStatusMap=yt,p.arrayToTree=pt,p.checkFileSize=wt,p.creatValidator=Ut,p.createImportFields=kt,p.createListPageId=xt,p.en_us=Ce,p.exportExcel=ot,p.getI18n=be,p.getI18nT=le,p.getListPageConfig=Re,p.getLocaleValue=Zt,p.getValueBykey=_t,p.importExcel=nt,p.messages=Me,p.registerVxeRenderers=en,p.resetListPageConfig=zt,p.setListPageConfig=Bt,p.setupI18n=Oe,p.sleep=mt,p.stringToArray=_e,p.stripHtmlTags=Ct,p.unicode2Str=bt,p.useActions=Xt,p.useDatePicker=Ht,p.useGetters=Jt,p.useI18nReState=Wt,p.useRequest=Yt,p.useState=Gt,p.zh_cn=ye,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
|