joy-admin-components 0.2.10 → 0.2.12

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,17 +1,17 @@
1
1
  import { ElForm as bt, ElRow as yt, ElCol as Ct, ElInputNumber as xt, ElText as wt, ElLink as Ze } from "element-plus";
2
- import { defineComponent as Qe, ref as q, onMounted as Xe, h as Le, mergeModels as Ge, useAttrs as kt, useModel as _t, computed as ne, watch as Pe, resolveComponent as M, unref as G, openBlock as D, createBlock as Y, mergeProps as he, createSlots as St, withCtx as j, createElementVNode as oe, toDisplayString as le, renderSlot as re, createVNode as R, createTextVNode as se, createCommentVNode as fe, createElementBlock as de, Fragment as De, renderList as et, withModifiers as ze, nextTick as _e, resolveDynamicComponent as tt, withKeys as $t, normalizeStyle as It, normalizeClass as Oe, reactive as ke, onUpdated as Ft, onUnmounted as Lt, isVNode as Tt } from "vue";
2
+ import { defineComponent as Qe, ref as R, onMounted as Xe, h as Le, mergeModels as Ge, useAttrs as kt, useModel as _t, computed as ne, watch as qe, resolveComponent as M, unref as G, openBlock as D, createBlock as Y, mergeProps as he, createSlots as St, withCtx as U, createElementVNode as oe, toDisplayString as le, renderSlot as re, createVNode as P, createTextVNode as se, createCommentVNode as fe, createElementBlock as de, Fragment as De, renderList as et, withModifiers as ze, nextTick as _e, resolveDynamicComponent as tt, withKeys as $t, normalizeStyle as It, normalizeClass as Oe, reactive as ke, onUpdated as Ft, onUnmounted as Lt, isVNode as Tt } from "vue";
3
3
  import { saveAs as Et } from "file-saver";
4
4
  import nt from "exceljs";
5
5
  import Se from "dayjs";
6
6
  import { createI18n as Dt, useI18n as ve } from "vue-i18n";
7
7
  import { debounce as ot, cloneDeep as lt, isArray as We } from "lodash";
8
8
  import { useRoute as zt, useRouter as Ot } from "vue-router";
9
- import { createNamespacedHelpers as Ue, useStore as at, mapState as Vt, mapGetters as Mt, mapActions as At } from "vuex";
9
+ import { createNamespacedHelpers as je, useStore as at, mapState as Vt, mapGetters as Mt, mapActions as At } from "vuex";
10
10
  import { VxeUI as Ce } from "vxe-pc-ui";
11
11
  const $n = Qe({
12
12
  name: "LayOutForm",
13
13
  setup(n, { slots: e, attrs: t, emit: o }) {
14
- const a = q(null), r = () => e.default ? e.default().filter((u) => u.type !== Symbol.for("v-cmt")).map((u) => u.type === Symbol.for("v-fgt") ? u.children : u).flat().map(
14
+ const a = R(null), r = () => e.default ? e.default().filter((u) => u.type !== Symbol.for("v-cmt")).map((u) => u.type === Symbol.for("v-fgt") ? u.children : u).flat().map(
15
15
  (u) => {
16
16
  var d;
17
17
  return Le(
@@ -120,8 +120,8 @@ var it = { exports: {} };
120
120
  };
121
121
  });
122
122
  })(it);
123
- var Pt = it.exports;
124
- const Ut = /* @__PURE__ */ st(Pt);
123
+ var qt = it.exports;
124
+ const jt = /* @__PURE__ */ st(qt);
125
125
  var ct = { exports: {} };
126
126
  (function(n, e) {
127
127
  (function(t, o) {
@@ -187,8 +187,8 @@ var ct = { exports: {} };
187
187
  };
188
188
  });
189
189
  })(ct);
190
- var Rt = ct.exports;
191
- const jt = /* @__PURE__ */ st(Rt), Ve = {
190
+ var Pt = ct.exports;
191
+ const Ut = /* @__PURE__ */ st(Pt), Ve = {
192
192
  // 组件通用文本
193
193
  "dao-ru": "导入",
194
194
  "quan-xuan": "全选",
@@ -202,6 +202,10 @@ const jt = /* @__PURE__ */ st(Rt), Ve = {
202
202
  "chong-zhi": "重置",
203
203
  "guan-bi": "关闭",
204
204
  "zhan-kai": "展开",
205
+ "qu-xiao": "取消",
206
+ "ti-jiao": "提交",
207
+ "que-ding": "确定",
208
+ "que-ding-guan-bi-ma": "确定关闭吗",
205
209
  // Excel 工具相关
206
210
  excel: {
207
211
  fieldsMappingRequired: "请输入列字段映射",
@@ -232,6 +236,10 @@ const jt = /* @__PURE__ */ st(Rt), Ve = {
232
236
  "chong-zhi": "Reset",
233
237
  "guan-bi": "Collapse",
234
238
  "zhan-kai": "Expand",
239
+ "qu-xiao": "Cancel",
240
+ "ti-jiao": "Submit",
241
+ "que-ding": "Confirm",
242
+ "que-ding-guan-bi-ma": "Are you sure to close?",
235
243
  // Excel utilities
236
244
  excel: {
237
245
  fieldsMappingRequired: "Please enter column field mapping",
@@ -248,7 +256,7 @@ const jt = /* @__PURE__ */ st(Rt), Ve = {
248
256
  tools: {
249
257
  keysLengthError: "Keys length must be greater than 2, default first two are label and value"
250
258
  }
251
- }, qt = {
259
+ }, Rt = {
252
260
  zh_cn: Ve,
253
261
  en_us: Me
254
262
  };
@@ -262,21 +270,21 @@ function Bt(n = null) {
262
270
  legacy: !1,
263
271
  locale: "zh_cn",
264
272
  fallbackLocale: "zh_cn",
265
- messages: qt
273
+ messages: Rt
266
274
  })), pe;
267
275
  }
268
- function Re() {
276
+ function Pe() {
269
277
  return pe || Bt();
270
278
  }
271
- function je() {
272
- return Re().global.t;
279
+ function Ue() {
280
+ return Pe().global.t;
273
281
  }
274
- Se.extend(Ut);
275
282
  Se.extend(jt);
283
+ Se.extend(Ut);
276
284
  async function In(n, e) {
277
285
  const { fields: t, range: o = 1 } = e;
278
286
  if (!t) {
279
- const l = je();
287
+ const l = Ue();
280
288
  throw new Error(l("excel.fieldsMappingRequired"));
281
289
  }
282
290
  let a = new nt.Workbook();
@@ -426,7 +434,7 @@ class Je {
426
434
  getName(e) {
427
435
  if (!this.has(e))
428
436
  return "-";
429
- const t = Re().global.locale, { label: o, labelEn: a } = this.map.get(e);
437
+ const t = Pe().global.locale, { label: o, labelEn: a } = this.map.get(e);
430
438
  return (t.value == "zh_cn" ? o : a) || o || "-";
431
439
  }
432
440
  getTag(e) {
@@ -452,7 +460,7 @@ function En(n, e = [], t = "i18nName") {
452
460
  if (n.length == 0)
453
461
  return new Je([]);
454
462
  if (e.length < 2) {
455
- const a = je();
463
+ const a = Ue();
456
464
  throw new Error(a("tools.keysLengthError"));
457
465
  }
458
466
  let o = n.map((a) => {
@@ -531,7 +539,7 @@ const we = (n, e) => {
531
539
  }),
532
540
  emits: /* @__PURE__ */ Ge(["success", "change", "changeAll"], ["update:modelValue"]),
533
541
  setup(n, { emit: e }) {
534
- const t = n, o = kt(), { t: a, locale: r } = ve(), l = _t(n, "modelValue"), u = ne(() => o["value-key"] != null), d = q(""), k = ne(() => {
542
+ const t = n, o = kt(), { t: a, locale: r } = ve(), l = _t(n, "modelValue"), u = ne(() => o["value-key"] != null), d = R(""), k = ne(() => {
535
543
  if (o.remote !== void 0)
536
544
  return t.data;
537
545
  const i = ut(d.value), { data: p, labelValue: L } = t, O = p || v.value;
@@ -554,7 +562,7 @@ const we = (n, e) => {
554
562
  set(i) {
555
563
  return i;
556
564
  }
557
- }), C = e, v = q([]), b = async () => {
565
+ }), C = e, v = R([]), b = async () => {
558
566
  const { data: i } = await t.api();
559
567
  v.value = [...i], C("success", v);
560
568
  };
@@ -596,8 +604,8 @@ const we = (n, e) => {
596
604
  value: u.value ? p : p[t.labelValue.value]
597
605
  }));
598
606
  }
599
- const I = q([]), W = t.data ? t.data : v.value;
600
- I.value = z(W), Pe(
607
+ const I = R([]), W = t.data ? t.data : v.value;
608
+ I.value = z(W), qe(
601
609
  () => t.data ? t.data : v.value,
602
610
  (i) => {
603
611
  var L;
@@ -632,7 +640,7 @@ const we = (n, e) => {
632
640
  onChange: g,
633
641
  onClear: g
634
642
  }), St({
635
- default: j(({ item: m }) => [
643
+ default: U(({ item: m }) => [
636
644
  oe("div", {
637
645
  onClick: (ge) => w(m)
638
646
  }, le(m.label), 9, Qt)
@@ -641,15 +649,15 @@ const we = (n, e) => {
641
649
  }, [
642
650
  G(o).multiple != null ? {
643
651
  name: "header",
644
- fn: j(() => [
652
+ fn: U(() => [
645
653
  re(i.$slots, "header", {}, () => [
646
- R(L, {
654
+ P(L, {
647
655
  class: "mgl20",
648
656
  modelValue: x.value,
649
657
  "onUpdate:modelValue": p[0] || (p[0] = (m) => x.value = m),
650
658
  onChange: _
651
659
  }, {
652
- default: j(() => [
660
+ default: U(() => [
653
661
  se(le(i.$t("quan-xuan")), 1)
654
662
  ]),
655
663
  _: 1
@@ -668,15 +676,15 @@ const we = (n, e) => {
668
676
  "filter-method": G(o).remote != null ? void 0 : (m) => d.value = m,
669
677
  clearable: ""
670
678
  }, G(o), { onClear: n.optionClick }), {
671
- default: j(() => [
679
+ default: U(() => [
672
680
  G(o).multiple != null && n.showCheckAll && n.maxLimit == null ? re(i.$slots, "header", { key: 0 }, () => [
673
- R(L, {
681
+ P(L, {
674
682
  class: "mgl20",
675
683
  modelValue: x.value,
676
684
  "onUpdate:modelValue": p[2] || (p[2] = (m) => x.value = m),
677
685
  onChange: _
678
686
  }, {
679
- default: j(() => [
687
+ default: U(() => [
680
688
  se(le(i.$t("quan-xuan")), 1)
681
689
  ]),
682
690
  _: 1
@@ -706,13 +714,13 @@ const tn = Qe({
706
714
  function nn(n, e, t, o, a, r) {
707
715
  const l = M("el-icon");
708
716
  return D(), Y(l, { class: "cmp-icon" }, {
709
- default: j(() => [
717
+ default: U(() => [
710
718
  (D(), Y(tt(n.name)))
711
719
  ]),
712
720
  _: 1
713
721
  });
714
722
  }
715
- const dt = /* @__PURE__ */ we(tn, [["render", nn], ["__scopeId", "data-v-733f9daa"]]), Pn = {
723
+ const dt = /* @__PURE__ */ we(tn, [["render", nn], ["__scopeId", "data-v-733f9daa"]]), qn = {
716
724
  __name: "index",
717
725
  emits: ["ok", "no"],
718
726
  setup(n, { emit: e }) {
@@ -728,7 +736,7 @@ const dt = /* @__PURE__ */ we(tn, [["render", nn], ["__scopeId", "data-v-733f9da
728
736
  onConfirm: G(o),
729
737
  onCancel: a
730
738
  }), {
731
- reference: j(() => [
739
+ reference: U(() => [
732
740
  re(r.$slots, "default")
733
741
  ]),
734
742
  _: 3
@@ -750,7 +758,7 @@ const on = ["accept"], ln = {
750
758
  },
751
759
  emits: ["fileChange"],
752
760
  setup(n, { emit: e }) {
753
- const t = e, o = q(null);
761
+ const t = e, o = R(null);
754
762
  function a(r) {
755
763
  let l = r.target.files[0];
756
764
  t("fileChange", l), o.value.value = null;
@@ -758,12 +766,12 @@ const on = ["accept"], ln = {
758
766
  return (r, l) => {
759
767
  const u = M("el-button");
760
768
  return D(), de("span", null, [
761
- R(u, {
769
+ P(u, {
762
770
  loading: n.loading,
763
771
  class: "mgr10",
764
772
  onClick: l[0] || (l[0] = (d) => o.value.click())
765
773
  }, {
766
- default: j(() => [
774
+ default: U(() => [
767
775
  se(le(r.$t("dao-ru")), 1)
768
776
  ]),
769
777
  _: 1
@@ -779,7 +787,7 @@ const on = ["accept"], ln = {
779
787
  ]);
780
788
  };
781
789
  }
782
- }, Un = /* @__PURE__ */ we(ln, [["__scopeId", "data-v-5f1449ad"]]);
790
+ }, jn = /* @__PURE__ */ we(ln, [["__scopeId", "data-v-5f1449ad"]]);
783
791
  function Ae(n) {
784
792
  let e = {};
785
793
  return n.forEach((t) => {
@@ -808,7 +816,7 @@ const an = { key: 0 }, rn = { class: "btns" }, sn = { class: "left" }, cn = { cl
808
816
  },
809
817
  emits: ["confirm", "reset", "visibleChange"],
810
818
  setup(n, { expose: e, emit: t }) {
811
- const o = n, a = t, r = q(!0), l = q(null), { t: u } = ve(), d = ne(() => r.value ? u("guan-bi") : u("zhan-kai"));
819
+ const o = n, a = t, r = R(!0), l = R(null), { t: u } = ve(), d = ne(() => r.value ? u("guan-bi") : u("zhan-kai"));
812
820
  function k() {
813
821
  a("confirm");
814
822
  }
@@ -841,11 +849,11 @@ const an = { key: 0 }, rn = { class: "btns" }, sn = { class: "left" }, cn = { cl
841
849
  class: "searchBar",
842
850
  style: It({ height: r.value ? "auto" : "42px" })
843
851
  }, [
844
- R(I, {
852
+ P(I, {
845
853
  inline: "",
846
854
  model: n.form.data
847
855
  }, {
848
- default: j(() => [
856
+ default: U(() => [
849
857
  (D(!0), de(De, null, et(n.form.items.filter((i) => !i.hidden), (i) => (D(), de(De, {
850
858
  key: i.key
851
859
  }, [
@@ -853,7 +861,7 @@ const an = { key: 0 }, rn = { class: "btns" }, sn = { class: "left" }, cn = { cl
853
861
  key: 1,
854
862
  label: i.name
855
863
  }, {
856
- default: j(() => {
864
+ default: U(() => {
857
865
  var p, L;
858
866
  return [
859
867
  i.type === "input" ? (D(), Y(w, {
@@ -900,35 +908,35 @@ const an = { key: 0 }, rn = { class: "btns" }, sn = { class: "left" }, cn = { cl
900
908
  re(h.$slots, "table-header-left", {}, void 0, !0)
901
909
  ]),
902
910
  oe("div", cn, [
903
- R(W, {
911
+ P(W, {
904
912
  underline: "never",
905
913
  class: "mgr10",
906
914
  onClick: _[0] || (_[0] = () => {
907
915
  a("visibleChange", !r.value), r.value = !r.value;
908
916
  })
909
917
  }, {
910
- default: j(() => [
911
- R(dt, {
918
+ default: U(() => [
919
+ P(dt, {
912
920
  name: r.value ? "ArrowUp" : "ArrowDown"
913
921
  }, null, 8, ["name"]),
914
922
  se(" " + le(d.value), 1)
915
923
  ]),
916
924
  _: 1
917
925
  }),
918
- R(V, {
926
+ P(V, {
919
927
  type: "primary",
920
928
  onClick: k
921
929
  }, {
922
- default: j(() => [
930
+ default: U(() => [
923
931
  se(le(h.$t("shai-xuan")), 1)
924
932
  ]),
925
933
  _: 1
926
934
  }),
927
- R(V, {
935
+ P(V, {
928
936
  type: "primary",
929
937
  onClick: C
930
938
  }, {
931
- default: j(() => [
939
+ default: U(() => [
932
940
  se(le(h.$t("chong-zhi")), 1)
933
941
  ]),
934
942
  _: 1
@@ -970,7 +978,7 @@ const an = { key: 0 }, rn = { class: "btns" }, sn = { class: "left" }, cn = { cl
970
978
  // 是否启用单元格选区复制功能
971
979
  };
972
980
  let xe = { ...ft };
973
- function Rn(n) {
981
+ function Pn(n) {
974
982
  xe = {
975
983
  ...xe,
976
984
  ...n,
@@ -983,7 +991,7 @@ function Rn(n) {
983
991
  function fn() {
984
992
  return xe;
985
993
  }
986
- function jn() {
994
+ function Un() {
987
995
  xe = { ...ft };
988
996
  }
989
997
  const hn = { class: "center" }, gn = {
@@ -1023,7 +1031,7 @@ const hn = { class: "center" }, gn = {
1023
1031
  }
1024
1032
  },
1025
1033
  setup(n, { expose: e }) {
1026
- const { t, locale: o } = ve(), a = zt(), r = fn(), l = n, u = q(!1), d = q([]);
1034
+ const { t, locale: o } = ve(), a = zt(), r = fn(), l = n, u = R(!1), d = R([]);
1027
1035
  l.searchForm.showSearch === void 0 && (l.searchForm.showSearch = r.showSearch), l.searchForm.showPage === void 0 && (l.searchForm.showPage = r.showPage), l.searchForm.showShadow === void 0 && (l.searchForm.showShadow = r.showShadow), l.searchForm.showCheckBox === void 0 && (l.searchForm.showCheckBox = r.showCheckBox), l.searchForm.enableCellCopy === void 0 && (l.searchForm.enableCellCopy = r.enableCellCopy), l.searchForm.selections || (l.searchForm.selections = []);
1028
1036
  const k = ne(() => {
1029
1037
  const c = a.path.replace(/\//g, "-").replace(/^-/, "") || "default-table";
@@ -1032,11 +1040,11 @@ const hn = { class: "center" }, gn = {
1032
1040
  [C]: 1,
1033
1041
  [v]: l.searchForm.defaultPageSize || r.defaultPageSize,
1034
1042
  total: 0
1035
- }), g = q(null), f = q(null), h = q(450), _ = ot(() => {
1043
+ }), g = R(null), f = R(null), h = R(450), _ = ot(() => {
1036
1044
  _e(() => {
1037
1045
  if (!f.value)
1038
1046
  return;
1039
- const s = f.value.getBoundingClientRect(), y = window.innerHeight, F = s.top, P = 100, H = y - F - P, T = 200;
1047
+ const s = f.value.getBoundingClientRect(), y = window.innerHeight, F = s.top, q = 100, H = y - F - q, T = 200;
1040
1048
  h.value = Math.max(H, T);
1041
1049
  });
1042
1050
  }, 100), w = () => {
@@ -1077,10 +1085,10 @@ const hn = { class: "center" }, gn = {
1077
1085
  u.value = !1, l.searchForm.selections = [];
1078
1086
  });
1079
1087
  if (y == 200) {
1080
- let P = [];
1088
+ let q = [];
1081
1089
  for (const T of r.responseDataKeys.rows)
1082
1090
  if (F[T]) {
1083
- P = F[T];
1091
+ q = F[T];
1084
1092
  break;
1085
1093
  }
1086
1094
  let H = 0;
@@ -1089,7 +1097,7 @@ const hn = { class: "center" }, gn = {
1089
1097
  H = F[T];
1090
1098
  break;
1091
1099
  }
1092
- d.value = s ? s(P) : P, b.total = H, I = F.nextSearchAfter, l.searchForm.enableCellCopy && _e(() => {
1100
+ d.value = s ? s(q) : q, b.total = H, I = F.nextSearchAfter, l.searchForm.enableCellCopy && _e(() => {
1093
1101
  setTimeout(() => {
1094
1102
  S();
1095
1103
  }, 100);
@@ -1155,32 +1163,32 @@ const hn = { class: "center" }, gn = {
1155
1163
  const F = g.value;
1156
1164
  if (!F)
1157
1165
  return null;
1158
- let P = -1;
1166
+ let q = -1;
1159
1167
  const H = y.getAttribute("data-rowid");
1160
1168
  if (H != null)
1161
- P = parseInt(H, 10);
1169
+ q = parseInt(H, 10);
1162
1170
  else {
1163
1171
  const E = y.parentElement;
1164
- P = Array.from(E.querySelectorAll(".vxe-body--row")).indexOf(y);
1172
+ q = Array.from(E.querySelectorAll(".vxe-body--row")).indexOf(y);
1165
1173
  }
1166
- if (P < 0)
1174
+ if (q < 0)
1167
1175
  return null;
1168
1176
  let T = -1;
1169
1177
  const te = s.getAttribute("data-colid");
1170
1178
  if (te && (T = F.getColumns().findIndex(($) => $.id === te)), T < 0) {
1171
- const $ = Array.from(y.querySelectorAll(".vxe-body--column")).indexOf(s), B = !!s.closest(".vxe-table--fixed-left-wrapper"), N = !!s.closest(".vxe-table--fixed-right-wrapper"), U = F.getColumns();
1179
+ const $ = Array.from(y.querySelectorAll(".vxe-body--column")).indexOf(s), B = !!s.closest(".vxe-table--fixed-left-wrapper"), N = !!s.closest(".vxe-table--fixed-right-wrapper"), j = F.getColumns();
1172
1180
  if (B) {
1173
- const Z = U.filter((K) => K.fixed === "left");
1174
- $ < Z.length && (T = U.indexOf(Z[$]));
1181
+ const Z = j.filter((K) => K.fixed === "left");
1182
+ $ < Z.length && (T = j.indexOf(Z[$]));
1175
1183
  } else if (N) {
1176
- const Z = U.filter((K) => K.fixed === "right");
1177
- $ < Z.length && (T = U.indexOf(Z[$]));
1184
+ const Z = j.filter((K) => K.fixed === "right");
1185
+ $ < Z.length && (T = j.indexOf(Z[$]));
1178
1186
  } else {
1179
1187
  const Z = l.searchForm.showCheckBox ? 1 : 0;
1180
- T = U.filter((J) => J.fixed === "left").length + $ - Z;
1188
+ T = j.filter((J) => J.fixed === "left").length + $ - Z;
1181
1189
  }
1182
1190
  }
1183
- return T < 0 ? null : { rowIndex: P, colIndex: T, cell: s };
1191
+ return T < 0 ? null : { rowIndex: q, colIndex: T, cell: s };
1184
1192
  }, ae = (c) => {
1185
1193
  const s = ge(c.target);
1186
1194
  if (!s) {
@@ -1190,7 +1198,7 @@ const hn = { class: "center" }, gn = {
1190
1198
  m.isSelecting = !0, m.startCell = {
1191
1199
  rowIndex: s.rowIndex,
1192
1200
  colIndex: s.colIndex
1193
- }, m.endCell = { ...m.startCell }, qe(), Be();
1201
+ }, m.endCell = { ...m.startCell }, Re(), Be();
1194
1202
  }, me = (c) => {
1195
1203
  if (!m.isSelecting)
1196
1204
  return;
@@ -1198,7 +1206,7 @@ const hn = { class: "center" }, gn = {
1198
1206
  s && (m.endCell = {
1199
1207
  rowIndex: s.rowIndex,
1200
1208
  colIndex: s.colIndex
1201
- }, qe(), Be());
1209
+ }, Re(), Be());
1202
1210
  }, be = () => {
1203
1211
  m.isSelecting = !1;
1204
1212
  }, $e = () => {
@@ -1217,14 +1225,14 @@ const hn = { class: "center" }, gn = {
1217
1225
  "cell-border-left"
1218
1226
  );
1219
1227
  });
1220
- }, qe = () => {
1228
+ }, Re = () => {
1221
1229
  if (!m.startCell || !m.endCell) {
1222
1230
  m.selectedCells = [];
1223
1231
  return;
1224
1232
  }
1225
- const c = m.startCell.rowIndex, s = m.endCell.rowIndex, y = m.startCell.colIndex, F = m.endCell.colIndex, P = Math.min(c, s), H = Math.max(c, s), T = Math.min(y, F), te = Math.max(y, F);
1233
+ const c = m.startCell.rowIndex, s = m.endCell.rowIndex, y = m.startCell.colIndex, F = m.endCell.colIndex, q = Math.min(c, s), H = Math.max(c, s), T = Math.min(y, F), te = Math.max(y, F);
1226
1234
  m.selectedCells = [];
1227
- for (let E = P; E <= H; E++)
1235
+ for (let E = q; E <= H; E++)
1228
1236
  for (let $ = T; $ <= te; $++)
1229
1237
  m.selectedCells.push({
1230
1238
  rowIndex: E,
@@ -1248,16 +1256,16 @@ const hn = { class: "center" }, gn = {
1248
1256
  );
1249
1257
  }), m.selectedCells.length === 0)
1250
1258
  return;
1251
- const y = c.getColumns(), F = m.selectedCells.map((B) => B.rowIndex), P = m.selectedCells.map((B) => B.colIndex), H = Math.min(...F), T = Math.max(...F), te = Math.min(...P), E = Math.max(...P), $ = [
1259
+ const y = c.getColumns(), F = m.selectedCells.map((B) => B.rowIndex), q = m.selectedCells.map((B) => B.colIndex), H = Math.min(...F), T = Math.max(...F), te = Math.min(...q), E = Math.max(...q), $ = [
1252
1260
  s.querySelector(".vxe-table--body-wrapper tbody"),
1253
1261
  s.querySelector(".vxe-table--fixed-left-wrapper tbody"),
1254
1262
  s.querySelector(".vxe-table--fixed-right-wrapper tbody")
1255
1263
  ].filter(Boolean);
1256
1264
  m.selectedCells.forEach(({ rowIndex: B, colIndex: N }) => {
1257
- const U = y[N];
1258
- if (!U)
1265
+ const j = y[N];
1266
+ if (!j)
1259
1267
  return;
1260
- const Z = U.fixed === "left", K = U.fixed === "right";
1268
+ const Z = j.fixed === "left", K = j.fixed === "right";
1261
1269
  for (const J of $) {
1262
1270
  const ye = J.querySelectorAll(".vxe-body--row")[B];
1263
1271
  if (!ye)
@@ -1265,10 +1273,10 @@ const hn = { class: "center" }, gn = {
1265
1273
  const ce = Array.from(ye.querySelectorAll(".vxe-body--column"));
1266
1274
  let A = null;
1267
1275
  if (Z && J.closest(".vxe-table--fixed-left-wrapper")) {
1268
- const Q = y.filter((X) => X.fixed === "left").indexOf(U);
1276
+ const Q = y.filter((X) => X.fixed === "left").indexOf(j);
1269
1277
  A = ce[Q];
1270
1278
  } else if (K && J.closest(".vxe-table--fixed-right-wrapper")) {
1271
- const Q = y.filter((X) => X.fixed === "right").indexOf(U);
1279
+ const Q = y.filter((X) => X.fixed === "right").indexOf(j);
1272
1280
  A = ce[Q];
1273
1281
  } else if (!Z && !K && J.closest(".vxe-table--body-wrapper")) {
1274
1282
  const ue = l.searchForm.showCheckBox ? 1 : 0, Q = y.filter((Fe) => Fe.fixed === "left").length, X = N - Q;
@@ -1289,7 +1297,7 @@ const hn = { class: "center" }, gn = {
1289
1297
  return;
1290
1298
  const s = c.$el, y = c.getColumns(), F = [...new Set(m.selectedCells.map((E) => E.rowIndex))].sort(
1291
1299
  (E, $) => E - $
1292
- ), P = [...new Set(m.selectedCells.map((E) => E.colIndex))].sort(
1300
+ ), q = [...new Set(m.selectedCells.map((E) => E.colIndex))].sort(
1293
1301
  (E, $) => E - $
1294
1302
  ), H = [
1295
1303
  s.querySelector(".vxe-table--body-wrapper tbody"),
@@ -1298,13 +1306,13 @@ const hn = { class: "center" }, gn = {
1298
1306
  ].filter(Boolean), T = [];
1299
1307
  F.forEach((E) => {
1300
1308
  const $ = [];
1301
- P.forEach((B) => {
1309
+ q.forEach((B) => {
1302
1310
  const N = y[B];
1303
1311
  if (!N) {
1304
1312
  $.push("");
1305
1313
  return;
1306
1314
  }
1307
- const U = N.fixed === "left", Z = N.fixed === "right";
1315
+ const j = N.fixed === "left", Z = N.fixed === "right";
1308
1316
  let K = "";
1309
1317
  for (const J of H) {
1310
1318
  const ye = J.querySelectorAll(".vxe-body--row")[E];
@@ -1312,13 +1320,13 @@ const hn = { class: "center" }, gn = {
1312
1320
  continue;
1313
1321
  const ce = Array.from(ye.querySelectorAll(".vxe-body--column"));
1314
1322
  let A = null;
1315
- if (U && J.closest(".vxe-table--fixed-left-wrapper")) {
1323
+ if (j && J.closest(".vxe-table--fixed-left-wrapper")) {
1316
1324
  const Q = y.filter((X) => X.fixed === "left").indexOf(N);
1317
1325
  A = ce[Q];
1318
1326
  } else if (Z && J.closest(".vxe-table--fixed-right-wrapper")) {
1319
1327
  const Q = y.filter((X) => X.fixed === "right").indexOf(N);
1320
1328
  A = ce[Q];
1321
- } else if (!U && !Z && J.closest(".vxe-table--body-wrapper")) {
1329
+ } else if (!j && !Z && J.closest(".vxe-table--body-wrapper")) {
1322
1330
  const ue = l.searchForm.showCheckBox ? 1 : 0, Q = y.filter((Fe) => Fe.fixed === "left").length, X = B - Q;
1323
1331
  A = ce[X + ue];
1324
1332
  }
@@ -1365,7 +1373,7 @@ const hn = { class: "center" }, gn = {
1365
1373
  };
1366
1374
  return e({ tableRef: g, getList: V, getPrm: p, clearSort: L, calculateTableHeight: _ }), (c, s) => {
1367
1375
  var E;
1368
- const y = M("el-button"), F = M("el-checkbox"), P = M("el-text"), H = M("vxe-column"), T = M("VxeTable"), te = M("el-pagination");
1376
+ const y = M("el-button"), F = M("el-checkbox"), q = M("el-text"), H = M("vxe-column"), T = M("VxeTable"), te = M("el-pagination");
1369
1377
  return D(), de("div", {
1370
1378
  class: Oe({ box: n.searchForm.showShadow })
1371
1379
  }, [
@@ -1376,16 +1384,16 @@ const hn = { class: "center" }, gn = {
1376
1384
  onConfirm: s[1] || (s[1] = ($) => V()),
1377
1385
  onVisibleChange: G(_)
1378
1386
  }, {
1379
- btn: j(() => [
1387
+ btn: U(() => [
1380
1388
  s[3] || (s[3] = oe("span", { class: "mgr10" }, null, -1)),
1381
1389
  re(c.$slots, "search-bar-btn", {}, void 0, !0),
1382
- R(y, {
1390
+ P(y, {
1383
1391
  class: "mgl10",
1384
1392
  round: "",
1385
1393
  onClick: s[0] || (s[0] = ($) => g.value.openCustom())
1386
1394
  }, {
1387
- default: j(() => [
1388
- R(dt, { name: "Tools" })
1395
+ default: U(() => [
1396
+ P(dt, { name: "Tools" })
1389
1397
  ]),
1390
1398
  _: 1
1391
1399
  })
@@ -1397,7 +1405,7 @@ const hn = { class: "center" }, gn = {
1397
1405
  ref_key: "tableContentRef",
1398
1406
  ref: f
1399
1407
  }, [
1400
- R(T, he({
1408
+ P(T, he({
1401
1409
  id: k.value,
1402
1410
  ref_key: "tableRef",
1403
1411
  ref: g,
@@ -1410,7 +1418,7 @@ const hn = { class: "center" }, gn = {
1410
1418
  onCheckboxAll: He,
1411
1419
  onSortChange: (E = ie.value["sort-config"]) == null ? void 0 : E.sortChange
1412
1420
  }), {
1413
- default: j(() => [
1421
+ default: U(() => [
1414
1422
  n.searchForm.showCheckBox == null || n.searchForm.showCheckBox ? (D(), Y(H, {
1415
1423
  key: 0,
1416
1424
  type: "checkbox",
@@ -1418,26 +1426,26 @@ const hn = { class: "center" }, gn = {
1418
1426
  title: c.$t("xu-hao"),
1419
1427
  fixed: "left"
1420
1428
  }, {
1421
- checkbox: j(({ rowIndex: $, row: B, checked: N, disabled: U, indeterminate: Z }) => [
1429
+ checkbox: U(({ rowIndex: $, row: B, checked: N, disabled: j, indeterminate: Z }) => [
1422
1430
  oe("div", hn, [
1423
1431
  N ? (D(), Y(F, {
1424
1432
  key: 0,
1425
1433
  checked: !0,
1426
- disabled: U,
1434
+ disabled: j,
1427
1435
  size: "default",
1428
- onClick: ze((K) => !U && Ne(B), ["stop"])
1436
+ onClick: ze((K) => !j && Ne(B), ["stop"])
1429
1437
  }, null, 8, ["disabled", "onClick"])) : (D(), Y(F, {
1430
1438
  key: 1,
1431
- disabled: U,
1439
+ disabled: j,
1432
1440
  checked: !1,
1433
1441
  size: "default",
1434
- onClick: ze((K) => !U && Ne(B), ["stop"])
1442
+ onClick: ze((K) => !j && Ne(B), ["stop"])
1435
1443
  }, null, 8, ["disabled", "onClick"])),
1436
- R(P, {
1444
+ P(q, {
1437
1445
  type: "info",
1438
1446
  class: "mgl5"
1439
1447
  }, {
1440
- default: j(() => [
1448
+ default: U(() => [
1441
1449
  se(le($ + 1), 1)
1442
1450
  ]),
1443
1451
  _: 2
@@ -1467,7 +1475,7 @@ const hn = { class: "center" }, gn = {
1467
1475
  ], 2);
1468
1476
  };
1469
1477
  }
1470
- }, qn = /* @__PURE__ */ we(gn, [["__scopeId", "data-v-d93cad32"]]), Bn = {
1478
+ }, Rn = /* @__PURE__ */ we(gn, [["__scopeId", "data-v-d93cad32"]]), Bn = {
1471
1479
  __name: "index",
1472
1480
  props: {
1473
1481
  sheetsConfig: {
@@ -1490,7 +1498,7 @@ const hn = { class: "center" }, gn = {
1490
1498
  type: "primary",
1491
1499
  underline: "never"
1492
1500
  }, o.$attrs, { onClick: t }), {
1493
- default: j(() => [
1501
+ default: U(() => [
1494
1502
  se(le(o.$t("xia-zai-dao-ru-mo-ban")), 1)
1495
1503
  ]),
1496
1504
  _: 1
@@ -1499,7 +1507,7 @@ const hn = { class: "center" }, gn = {
1499
1507
  }
1500
1508
  };
1501
1509
  function Yn(n, e = {}) {
1502
- const t = je(), o = {
1510
+ const t = Ue(), o = {
1503
1511
  inForm: !0,
1504
1512
  required: !0,
1505
1513
  ...e
@@ -1729,7 +1737,7 @@ function Hn(n, e = {}) {
1729
1737
  log: !1,
1730
1738
  params: null,
1731
1739
  format: null
1732
- }, e), { manual: a, log: r, params: l = {}, cb: u, format: d } = o, k = q([]), x = q(!1), C = (v) => {
1740
+ }, e), { manual: a, log: r, params: l = {}, cb: u, format: d } = o, k = R([]), x = R(!1), C = (v) => {
1733
1741
  const b = v || l;
1734
1742
  x.value = !0, n(b).then((g) => {
1735
1743
  const { code: f, data: h, msg: _ } = g;
@@ -1754,8 +1762,8 @@ function Hn(n, e = {}) {
1754
1762
  return a || C(), [x, k, C];
1755
1763
  }
1756
1764
  function Nn(n) {
1757
- const e = q(n), t = q(""), o = q("");
1758
- return Pe(e, (a) => {
1765
+ const e = R(n), t = R(""), o = R("");
1766
+ return qe(e, (a) => {
1759
1767
  const r = a || ["", ""];
1760
1768
  t.value = r[0], o.value = r[1];
1761
1769
  }), [e, t, o];
@@ -1775,8 +1783,8 @@ function Te(n, e) {
1775
1783
  return e.forEach((o) => t[o] = n[o]), t;
1776
1784
  }
1777
1785
  function Gn(n, e = []) {
1778
- const { locale: t } = ve(), o = q(n());
1779
- return Pe(
1786
+ const { locale: t } = ve(), o = R(n());
1787
+ return qe(
1780
1788
  [t, ...e],
1781
1789
  () => {
1782
1790
  o.value = n();
@@ -1787,20 +1795,20 @@ function Gn(n, e = []) {
1787
1795
  function Wn(n, e = "zh_cn", t = "en_us") {
1788
1796
  if (!n)
1789
1797
  return "-";
1790
- const o = { en_us: t, zh_cn: e }, r = Re().global.locale.value;
1798
+ const o = { en_us: t, zh_cn: e }, r = Pe().global.locale.value;
1791
1799
  return n[o[r]] || n[e] || "-";
1792
1800
  }
1793
1801
  function Jn(n, e) {
1794
1802
  let t = Vt;
1795
- return typeof n == "string" && n.length > 0 && (t = Ue(n).mapState), ht(e, t);
1803
+ return typeof n == "string" && n.length > 0 && (t = je(n).mapState), ht(e, t);
1796
1804
  }
1797
1805
  function Qn(n, e) {
1798
1806
  let t = Mt;
1799
- return typeof n == "string" && n.length > 0 && (t = Ue(n).mapGetters), ht(e, t);
1807
+ return typeof n == "string" && n.length > 0 && (t = je(n).mapGetters), ht(e, t);
1800
1808
  }
1801
1809
  function Xn(n, e) {
1802
1810
  let t = At;
1803
- return typeof n == "string" && n.length > 0 && (t = Ue(n).mapActions), mn(e, t);
1811
+ return typeof n == "string" && n.length > 0 && (t = je(n).mapActions), mn(e, t);
1804
1812
  }
1805
1813
  function ht(n, e) {
1806
1814
  const t = at(), o = e(n), a = {};
@@ -1828,20 +1836,20 @@ function eo() {
1828
1836
  const o = e.row[e.column.field];
1829
1837
  if (n.type == "tag") {
1830
1838
  let a;
1831
- return R(M("el-text"), {
1839
+ return P(M("el-text"), {
1832
1840
  type: n.enum.getTag(o)
1833
1841
  }, Ee(a = n.enum.getName(o)) ? a : {
1834
1842
  default: () => [a]
1835
1843
  });
1836
1844
  }
1837
- return R(M("el-text"), null, Ee(t = n.enum.getName(o)) ? t : {
1845
+ return P(M("el-text"), null, Ee(t = n.enum.getName(o)) ? t : {
1838
1846
  default: () => [t]
1839
1847
  });
1840
1848
  }
1841
1849
  }), Ce.renderer.add("InputNumber", {
1842
1850
  // 默认显示模板
1843
1851
  renderTableDefault(n, e) {
1844
- return R(xt, he({
1852
+ return P(xt, he({
1845
1853
  modelValue: e.row[e.column.field],
1846
1854
  "onUpdate:modelValue": (t) => e.row[e.column.field] = t
1847
1855
  }, n.props, {
@@ -1856,7 +1864,7 @@ function eo() {
1856
1864
  locale: t
1857
1865
  } = ve();
1858
1866
  let o = t.value == "zh_cn";
1859
- return R(wt, {
1867
+ return P(wt, {
1860
1868
  type: e.row[e.column.field] ? "success" : "danger"
1861
1869
  }, {
1862
1870
  default: () => [e.row[e.column.field] ? o ? "是" : "YES" : o ? "否" : "NO"]
@@ -1881,7 +1889,7 @@ function eo() {
1881
1889
  to: r
1882
1890
  } = n;
1883
1891
  if (!a)
1884
- return R(Ze, {
1892
+ return P(Ze, {
1885
1893
  underline: "never",
1886
1894
  type: "primary",
1887
1895
  onclick: () => o.push({
@@ -1894,7 +1902,7 @@ function eo() {
1894
1902
  default: () => [e.row[t]]
1895
1903
  });
1896
1904
  const l = ((u = e.row[t]) == null ? void 0 : u.split(",")) || [];
1897
- return l.map((d, k) => R("span", null, [R(Ze, {
1905
+ return l.map((d, k) => P("span", null, [P(Ze, {
1898
1906
  underline: "never",
1899
1907
  type: "primary",
1900
1908
  onclick: () => o.push({
@@ -1912,11 +1920,11 @@ function eo() {
1912
1920
  export {
1913
1921
  en as CmpDictionary,
1914
1922
  dt as CmpIcon,
1915
- Pn as ConfrimButton,
1923
+ qn as ConfrimButton,
1916
1924
  Bn as DownExcelTemp,
1917
- Un as ImportButton,
1925
+ jn as ImportButton,
1918
1926
  $n as LayOutForm,
1919
- qn as ListPage,
1927
+ Rn as ListPage,
1920
1928
  Kn as OnePortalCasSDK,
1921
1929
  dn as SearchBar,
1922
1930
  Je as StatusMap,
@@ -1930,16 +1938,16 @@ export {
1930
1938
  Vn as createListPageId,
1931
1939
  Me as en_us,
1932
1940
  Kt as exportExcel,
1933
- Re as getI18n,
1934
- je as getI18nT,
1941
+ Pe as getI18n,
1942
+ Ue as getI18nT,
1935
1943
  fn as getListPageConfig,
1936
1944
  Wn as getLocaleValue,
1937
1945
  An as getValueBykey,
1938
1946
  In as importExcel,
1939
- qt as messages,
1947
+ Rt as messages,
1940
1948
  eo as registerVxeRenderers,
1941
- jn as resetListPageConfig,
1942
- Rn as setListPageConfig,
1949
+ Un as resetListPageConfig,
1950
+ Pn as setListPageConfig,
1943
1951
  Bt as setupI18n,
1944
1952
  Fn as sleep,
1945
1953
  ut as stringToArray,
@@ -1,2 +1,2 @@
1
- (function(m,K){typeof exports=="object"&&typeof module<"u"?K(exports,require("element-plus"),require("vue"),require("file-saver"),require("exceljs"),require("dayjs"),require("vue-i18n"),require("lodash"),require("vue-router"),require("vuex"),require("vxe-pc-ui")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue","file-saver","exceljs","dayjs","vue-i18n","lodash","vue-router","vuex","vxe-pc-ui"],K):(m=typeof globalThis<"u"?globalThis:m||self,K(m.JoyAdminComponents={},m.ElementPlus,m.Vue,m.fileSaver,m.ExcelJS,m.dayjs,m.VueI18n,m._,m.VueRouter,m.Vuex,m.VxeUI))})(this,function(m,K,e,He,Ie,he,ee,le,Te,Q,ie){"use strict";const Ze=e.defineComponent({name:"LayOutForm",setup(o,{slots:t,attrs:n,emit:l}){const a=e.ref(null),s=()=>t.default?t.default().filter(d=>d.type!==Symbol.for("v-cmt")).map(d=>d.type===Symbol.for("v-fgt")?d.children:d).flat().map(d=>{var f;return e.h(K.ElCol,{span:((f=d.props)==null?void 0:f.span)||24},{default:()=>d})}):null;e.onMounted(()=>{l("ref",a.value)});function r(){return e.h(K.ElForm,{...n,ref:a},()=>e.h(K.ElRow,{gutter:n.gutter??20},{default:()=>s()}))}return r}});var ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ee(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Le={exports:{}};(function(o,t){(function(n,l){o.exports=l()})(ve,function(){var n="minute",l=/[+-]\d\d(?::?\d\d)?/g,a=/([+-]|\d\d)/g;return function(s,r,d){var f=r.prototype;d.utc=function(h){var g={date:h,utc:!0,args:arguments};return new r(g)},f.utc=function(h){var g=d(this.toDate(),{locale:this.$L,utc:!0});return h?g.add(this.utcOffset(),n):g},f.local=function(){return d(this.toDate(),{locale:this.$L,utc:!1})};var $=f.parse;f.parse=function(h){h.utc&&(this.$u=!0),this.$utils().u(h.$offset)||(this.$offset=h.$offset),$.call(this,h)};var S=f.init;f.init=function(){if(this.$u){var h=this.$d;this.$y=h.getUTCFullYear(),this.$M=h.getUTCMonth(),this.$D=h.getUTCDate(),this.$W=h.getUTCDay(),this.$H=h.getUTCHours(),this.$m=h.getUTCMinutes(),this.$s=h.getUTCSeconds(),this.$ms=h.getUTCMilliseconds()}else S.call(this)};var x=f.utcOffset;f.utcOffset=function(h,g){var V=this.$utils().u;if(V(h))return this.$u?0:V(this.$offset)?x.call(this):this.$offset;if(typeof h=="string"&&(h=function(v){v===void 0&&(v="");var Y=v.match(l);if(!Y)return null;var O=(""+Y[0]).match(a)||["-",0,0],c=O[0],y=60*+O[1]+ +O[2];return y===0?0:c==="+"?y:-y}(h),h===null))return this;var _=Math.abs(h)<=16?60*h:h;if(_===0)return this.utc(g);var I=this.clone();if(g)return I.$offset=_,I.$u=!1,I;var B=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(I=this.local().add(_+B,n)).$offset=_,I.$x.$localOffset=B,I};var b=f.format;f.format=function(h){var g=h||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return b.call(this,g)},f.valueOf=function(){var h=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*h},f.isUTC=function(){return!!this.$u},f.toISOString=function(){return this.toDate().toISOString()},f.toString=function(){return this.toDate().toUTCString()};var w=f.toDate;f.toDate=function(h){return h==="s"&&this.$offset?d(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():w.call(this)};var p=f.diff;f.diff=function(h,g,V){if(h&&this.$u===h.$u)return p.call(this,h,g,V);var _=this.local(),I=d(h).local();return p.call(_,I,g,V)}}})})(Le);var Ge=Le.exports;const We=Ee(Ge);var Fe={exports:{}};(function(o,t){(function(n,l){o.exports=l()})(ve,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},l={};return function(a,s,r){var d,f=function(b,w,p){p===void 0&&(p={});var h=new Date(b),g=function(V,_){_===void 0&&(_={});var I=_.timeZoneName||"short",B=V+"|"+I,v=l[B];return v||(v=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:V,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:I}),l[B]=v),v}(w,p);return g.formatToParts(h)},$=function(b,w){for(var p=f(b,w),h=[],g=0;g<p.length;g+=1){var V=p[g],_=V.type,I=V.value,B=n[_];B>=0&&(h[B]=parseInt(I,10))}var v=h[3],Y=v===24?0:v,O=h[0]+"-"+h[1]+"-"+h[2]+" "+Y+":"+h[4]+":"+h[5]+":000",c=+b;return(r.utc(O).valueOf()-(c-=c%1e3))/6e4},S=s.prototype;S.tz=function(b,w){b===void 0&&(b=d);var p,h=this.utcOffset(),g=this.toDate(),V=g.toLocaleString("en-US",{timeZone:b}),_=Math.round((g-new Date(V))/1e3/60),I=15*-Math.round(g.getTimezoneOffset()/15)-_;if(!Number(I))p=this.utcOffset(0,w);else if(p=r(V,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(I,!0),w){var B=p.utcOffset();p=p.add(h-B,"minute")}return p.$x.$timezone=b,p},S.offsetName=function(b){var w=this.$x.$timezone||r.tz.guess(),p=f(this.valueOf(),w,{timeZoneName:b}).find(function(h){return h.type.toLowerCase()==="timezonename"});return p&&p.value};var x=S.startOf;S.startOf=function(b,w){if(!this.$x||!this.$x.$timezone)return x.call(this,b,w);var p=r(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return x.call(p,b,w).tz(this.$x.$timezone,!0)},r.tz=function(b,w,p){var h=p&&w,g=p||w||d,V=$(+r(),g);if(typeof b!="string")return r(b).tz(g);var _=function(Y,O,c){var y=Y-60*O*1e3,L=$(y,c);if(O===L)return[y,O];var z=$(y-=60*(L-O)*1e3,c);return L===z?[y,L]:[Y-60*Math.min(L,z)*1e3,Math.max(L,z)]}(r.utc(b,h).valueOf(),V,g),I=_[0],B=_[1],v=r(I).utcOffset(B);return v.$x.$timezone=g,v},r.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},r.tz.setDefault=function(b){d=b}}})})(Fe);var Je=Fe.exports;const Qe=Ee(Je),me={"dao-ru":"导入","quan-xuan":"全选","xia-zai-dao-ru-mo-ban":"下载导入模板","xu-hao":"序号","qing-shu-ru":"请输入","qing-xuan-ze":"请选择","kai-shi-shi-jian":"开始时间","jie-shu-shi-jian":"结束时间","shai-xuan":"筛选","chong-zhi":"重置","guan-bi":"关闭","zhan-kai":"展开",excel:{fieldsMappingRequired:"请输入列字段映射",invalidInput:"非法输入",invalidOption:"请输入有效选项!",copyFailed:"复制失败",sheetNameTooLong:'Sheet名称 "{0}" 长度超过31个字符,已自动截断为 "{1}"'},validate:{invalidInput:"请输入正确内容"},tools:{keysLengthError:"keys 长度必须大于2 默认前两位为 label value"}},ge={"dao-ru":"Import","quan-xuan":"Select All","xia-zai-dao-ru-mo-ban":"Download Import Template","xu-hao":"No.","qing-shu-ru":"Please enter","qing-xuan-ze":"Please select","kai-shi-shi-jian":"Start Time","jie-shu-shi-jian":"End Time","shai-xuan":"Filter","chong-zhi":"Reset","guan-bi":"Collapse","zhan-kai":"Expand",excel:{fieldsMappingRequired:"Please enter column field mapping",invalidInput:"Invalid input",invalidOption:"Please enter a valid option!",copyFailed:"Copy failed",sheetNameTooLong:'Sheet name "{0}" exceeds 31 characters, automatically truncated to "{1}"'},validate:{invalidInput:"Please enter valid content"},tools:{keysLengthError:"Keys length must be greater than 2, default first two are label and value"}},De={zh_cn:me,en_us:ge};let re=null;function Be(o=null){if(o){const{global:t}=o;return t.messages.value.zh_cn?t.mergeLocaleMessage("zh_cn",me):t.setLocaleMessage("zh_cn",me),t.messages.value.en_us?t.mergeLocaleMessage("en_us",ge):t.setLocaleMessage("en_us",ge),re=o,o}return re||(re=ee.createI18n({legacy:!1,locale:"zh_cn",fallbackLocale:"zh_cn",messages:De})),re}function pe(){return re||Be()}function Ce(){return pe().global.t}he.extend(We),he.extend(Qe);async function Xe(o,t){const{fields:n,range:l=1}=t;if(!n){const r=Ce();throw new Error(r("excel.fieldsMappingRequired"))}let a=new Ie.Workbook;await a.xlsx.load(o);const s={};return a.eachSheet(function(r,d){const f=[];r.eachRow(function($,S){if(S>l){let x={},b=!0;Object.keys(n).forEach(w=>{const p=$.getCell(n[w]).value;x[w]=p,p&&(b=!1)}),b||f.push(x)}}),s[r._name]=f}),a=null,s}const et={columnWidth:30};async function ze(o,t,n=[],l={}){if(!o||!t)return;const{columnStyle:a}=l,{columnWidth:s}=et;t.forEach(f=>{f.width=f.width?f.width:s});const{workbook:r,worksheet:d}=tt();d.columns=t,d.addRows(n),a&&await nt(r,d,a);try{const f=await r.xlsx.writeBuffer(),$=new File([f],o,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});He.saveAs($)}catch(f){console.log(f)}}function tt(){const o=new Ie.Workbook;o.creator="distributor System",o.lastModifiedBy="distributor System",o.created=new Date,o.modified=new Date,o.lastPrinted=new Date;const t=o.addWorksheet("Sheet1");return{workbook:o,worksheet:t}}async function nt(o,t,n){const l=Object.keys(n);for(const a of l){const s=n[a],{type:r}=s;switch(r){case"IMG":await ot(o,t,a);break}}}async function ot(o,t,n,l){const a=t.getColumn(n),s=a.values;t.getColumn(n).width=20,t.eachRow((r,d)=>{d>1&&(r.height=40)});for(let r=0,d=s.length;r<d;r++){if(r<2)continue;let f=s[r];f&&(t.getCell(a.letter+r).value="",await lt(o,t,f,{width:100,height:50,col:a._number-1,row:r-1}))}}async function lt(o,t,n,l){const{col:a,row:s,width:r,height:d}=l,{success:f,base64:$}=await rt(n,.3);if(f){const S=o.addImage({base64:$,extension:"jpeg"});t.addImage(S,{tl:{col:a,row:s},ext:{width:r,height:d}})}}function rt(o,t=1){const n=new Image;return n.setAttribute("crossOrigin","anonymous"),n.crossOrigin="anonymous",n.src=o,new Promise((l,a)=>{n.onload=()=>{const s=document.createElement("canvas");s.width=n.width,s.height=n.height,s.getContext("2d").drawImage(n,0,0,s.width,s.height),l({success:!0,base64:s.toDataURL("image/jpeg",t)})},n.onerror=()=>{l({success:!1})}})}function at(o){if(o<26)return String.fromCharCode(65+o);{const t=String.fromCharCode(65+Math.floor((o-26)/26)),n=String.fromCharCode(65+(o-26)%26);return t+n}}function st(o){return new Promise(t=>{setTimeout(()=>{t()},o)})}function it(o){return JSON.parse(JSON.stringify(o))}function ct(o){let t=[],n={},l=(a,s)=>Object.prototype.hasOwnProperty.call(a,s);for(const a of o){n[a.id]={...a,children:l(n,a.id)?n[a.id].children:[]};const s=n[a.id];a.pid==-1?t.push(s):(l(n,a.pid)||(n[a.pid]={children:[]}),n[a.pid].children.push(s))}return t}function ye(o,t=" "){return o?o.split(t).filter(n=>n.trim()):[]}class be{constructor(t,n=["label","value","labelEn"]){this.list=t.map(l=>({...l,label:l[n[0]],labelEn:l[n[2]]||l[n[0]]||"",value:l[n[1]]})),this.map=new Map(this.list.map(l=>[l[n[1]],l]))}getName(t){if(!this.has(t))return"-";const n=pe().global.locale,{label:l,labelEn:a}=this.map.get(t);return(n.value=="zh_cn"?l:a)||l||"-"}getTag(t){if(!this.has(t))return"info";const{tag:n="info"}=this.map.get(t);return n}getItem(t){return this.has(t)?this.map.get(t):null}getColor(t){if(!this.has(t))return null;const{color:n}=this.map.get(t);return n}has(t){return this.map.has(t)}}function ut(o,t=[],n="i18nName"){if(o.length==0)return new be([]);if(t.length<2){const a=Ce();throw new Error(a("tools.keysLengthError"))}let l=o.map(a=>{let s={};return n&&(s.labelEn=a[n]),t.forEach((r,d)=>{d===0?s.label=a[r]:d===1?s.value=a[r]:s[r]=a[r]}),s});return new be(l)}function dt(o){return o?o.replace(/<[^>]+>/g,""):""}function ft(o){return o?(o.includes("\\\\u")&&(o=o.replace(/\\/g,"")),o.replace(/\\u[\dA-F]{4}/gi,t=>String.fromCharCode(parseInt(t.replace(/\\u/g,""),16)))):""}function ht(o,t=10){let n=1048576*t;return!(o.size>n)}function mt(o){return Array.from(10).fill(0).map((n,l)=>o+"_"+l)}function gt(o){let t={};return o.map((n,l)=>{let{key:a,option:s,type:r}=n,d=at(l);s?t[a]=`${d}---option`:r==="image"?t[a]=`${d}---image`:t[a]=d}),t}function pt(o,t){return t.split(".").reduce((n,l)=>n&&n[l],o)}const Zt="",ce=(o,t)=>{const n=o.__vccOpts||o;for(const[l,a]of t)n[l]=a;return n},Ct=["onClick"],Oe=ce({__name:"index",props:e.mergeModels({api:{type:Function},showCheckAll:{type:Boolean,default:!0},maxLimit:{type:Number,default:void 0},optionClick:{type:Function,default:()=>{}},data:{type:Array},labelValue:{type:Object,default:()=>({label:"label",labelEn:"labelEn",value:"value"})},changeLocal:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["success","change","changeAll"],["update:modelValue"]),setup(o,{emit:t}){const n=o,l=e.useAttrs(),{t:a,locale:s}=ee.useI18n(),r=e.useModel(o,"modelValue"),d=e.computed(()=>l["value-key"]!=null),f=e.ref(""),$=e.computed(()=>{if(l.remote!==void 0)return n.data;const c=ye(f.value),{data:y,labelValue:L}=n,z=y||b.value;if(c.length==0)return z;const{label:W,labelEn:te}=L;let C=s.value=="en_us"?te||"i18nName":W;return c.length==1?z.filter(X=>X[C].toLowerCase().includes(c[0].toLowerCase())):z.filter(X=>{let se=!1;return se=c.some(de=>X[C].toLowerCase()==de.toLowerCase()),se})}),S=e.computed({get(){return l.multiple==null||r.value==null?!1:r.value.length==$.value.length},set(c){return c}}),x=t,b=e.ref([]),w=async()=>{const{data:c}=await n.api();b.value=[...c],x("success",b)};n.api&&w();function p(c){x("change",c)}const h=n.labelValue.label.split("-"),g=c=>{if(h.length==1){if(n.changeLocal)return a(c[n.labelValue.label]);let y=s.value=="en_us"?c[n.labelValue.labelEn||"i18nName"]:c[n.labelValue.label];return y=y||c[n.labelValue.label],y}else{let y=[];return h.forEach(L=>{y.push(c[L])}),y.join("-")}};function V(c){let y=n.data?n.data:b.value;r.value=c?y.map(L=>d.value?L:L[n.labelValue.value]):[],e.nextTick(()=>{x("change",r.value),x("changeAll",r.value,y)})}function _(c){n.optionClick&&n.optionClick(c),x("change",d.value?c:c[n.labelValue.value])}function I(c){return r.value.length>=n.maxLimit&&!r.value.includes(c[n.labelValue.value])}function B(c){return c.map(y=>({...y,label:g(y),value:d.value?y:y[n.labelValue.value]}))}const v=e.ref([]),Y=n.data?n.data:b.value;v.value=B(Y),e.watch(()=>n.data?n.data:b.value,c=>{var L;const y=B(c);if(y.length!==v.value.length)v.value=y;else{let z=!1;for(let W=0;W<y.length;W++)if(y[W].value!==((L=v.value[W])==null?void 0:L.value)){z=!0;break}z&&(v.value=y)}},{deep:!0});const O=e.computed(()=>v.value);return(c,y)=>{const L=e.resolveComponent("el-checkbox"),z=e.resolveComponent("el-select-v2"),W=e.resolveComponent("el-option"),te=e.resolveComponent("el-select");return e.unref(l).v2!=null?(e.openBlock(),e.createBlock(z,e.mergeProps({key:0,options:O.value,modelValue:r.value,"onUpdate:modelValue":y[1]||(y[1]=C=>r.value=C)},e.unref(l),{filterable:"","collapse-tags":"","collapse-tags-tooltip":"",clearable:"",onChange:p,onClear:p}),e.createSlots({default:e.withCtx(({item:C})=>[e.createElementVNode("div",{onClick:ae=>_(C)},e.toDisplayString(C.label),9,Ct)]),_:2},[e.unref(l).multiple!=null?{name:"header",fn:e.withCtx(()=>[e.renderSlot(c.$slots,"header",{},()=>[e.createVNode(L,{class:"mgl20",modelValue:S.value,"onUpdate:modelValue":y[0]||(y[0]=C=>S.value=C),onChange:V},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0)]),key:"0"}:void 0]),1040,["options","modelValue"])):(e.openBlock(),e.createBlock(te,e.mergeProps({key:1,modelValue:r.value,"onUpdate:modelValue":y[3]||(y[3]=C=>r.value=C),filterable:"","collapse-tags":"","collapse-tags-tooltip":"","filter-method":e.unref(l).remote!=null?void 0:C=>f.value=C,clearable:""},e.unref(l),{onClear:o.optionClick}),{default:e.withCtx(()=>[e.unref(l).multiple!=null&&o.showCheckAll&&o.maxLimit==null?e.renderSlot(c.$slots,"header",{key:0},()=>[e.createVNode(L,{class:"mgl20",modelValue:S.value,"onUpdate:modelValue":y[2]||(y[2]=C=>S.value=C),onChange:V},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(C,ae)=>(e.openBlock(),e.createBlock(W,{key:ae,label:g(C),disabled:e.unref(l).multiple!=null&&o.maxLimit>0?I(C):!1,onClick:e.withModifiers(X=>_(C),["stop"]),value:d.value?C:C[o.labelValue.value]},null,8,["label","disabled","onClick","value"]))),128))]),_:3},16,["modelValue","filter-method","onClear"]))}}},[["__scopeId","data-v-d12f3c20"]]),Wt="",yt=e.defineComponent({props:{name:{tyepe:String,required:!0}}});function bt(o,t,n,l,a,s){const r=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(r,{class:"cmp-icon"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.name)))]),_:1})}const we=ce(yt,[["render",bt],["__scopeId","data-v-733f9daa"]]),wt={__name:"index",emits:["ok","no"],setup(o,{emit:t}){const n=t,l=le.debounce(()=>{n("ok")},500);function a(){n("no")}return(s,r)=>{const d=e.resolveComponent("el-popconfirm");return e.openBlock(),e.createBlock(d,e.mergeProps(s.$attrs,{onConfirm:e.unref(l),onCancel:a}),{reference:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16,["onConfirm"])}}},Jt="",kt=["accept"],xt=ce({__name:"index",props:{accept:{type:String,default:".xlsx,.xls"},loading:{type:Boolean,default:!1}},emits:["fileChange"],setup(o,{emit:t}){const n=t,l=e.ref(null);function a(s){let r=s.target.files[0];n("fileChange",r),l.value.value=null}return(s,r)=>{const d=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("span",null,[e.createVNode(d,{loading:o.loading,class:"mgr10",onClick:r[0]||(r[0]=f=>l.value.click())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.$t("dao-ru")),1)]),_:1},8,["loading"]),e.createElementVNode("input",{onChange:a,ref_key:"input",ref:l,accept:o.accept,style:{position:"absolute",width:"0px",height:"0px",opacity:"0"},type:"file"},null,40,kt)])}}},[["__scopeId","data-v-5f1449ad"]]);function ke(o){let t={};return o.forEach(n=>{const{key:l,type:a,option:s={},value:r,dateType:d="date"}=n;if(l)if(a=="input"&&(s!=null&&s.multiple))t[l]=ye(r);else if(a=="date")if(d.includes("range")){const[f,$]=l;let[S,x]=r||[];S&&d=="daterange"&&(S=he(S).format("YYYY-MM-DD 00:00:00"),x=he(x).format("YYYY-MM-DD 23:59:59")),t[f]=S,t[$]=x}else t[l]=r;else t[l]=r}),t}const Xt="",St={key:0},_t={class:"btns"},$t={class:"left"},Vt={class:"right"},Ne=ce({__name:"index",props:{form:{type:Object,required:!0}},emits:["confirm","reset","visibleChange"],setup(o,{expose:t,emit:n}){const l=o,a=n,s=e.ref(!0),r=e.ref(null),{t:d}=ee.useI18n(),f=e.computed(()=>s.value?d("guan-bi"):d("zhan-kai"));function $(){a("confirm")}function S(g){g.option.onClear&&g.option.onClear(),a("confirm")}function x(){a("reset")}function b(){a("confirm")}function w(){return ke(l.form.items)}const p=le.cloneDeep(l.form.items);function h(){l.form.items.forEach(g=>{const V=p.find(_=>_.key==g.key);V&&(g.value=V.value)})}return t({getPrm:w,reset:h}),(g,V)=>{const _=e.resolveComponent("el-input"),I=e.resolveComponent("el-date-picker"),B=e.resolveComponent("el-form-item"),v=e.resolveComponent("el-form"),Y=e.resolveComponent("el-link"),O=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",{class:"searchBar-container mgt10 mgb10",onKeydown:e.withKeys($,["enter"])},[e.createElementVNode("div",{class:"searchBar",style:e.normalizeStyle({height:s.value?"auto":"42px"})},[e.createVNode(v,{inline:"",model:o.form.data},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.form.items.filter(c=>!c.hidden),c=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c.key},[c.type=="br"?(e.openBlock(),e.createElementBlock("br",St)):(e.openBlock(),e.createBlock(B,{key:1,label:c.name},{default:e.withCtx(()=>{var y,L;return[c.type==="input"?(e.openBlock(),e.createBlock(_,{key:0,modelValue:c.value,"onUpdate:modelValue":z=>c.value=z,class:e.normalizeClass(((y=c.option)==null?void 0:y.class)||"w150"),placeholder:g.$t("qing-shu-ru"),clearable:""},null,8,["modelValue","onUpdate:modelValue","class","placeholder"])):c.type==="custom"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.render),{key:1})):e.createCommentVNode("",!0),c.type==="select"?(e.openBlock(),e.createBlock(Oe,e.mergeProps({key:2,class:((L=c.option)==null?void 0:L.class)||"w150",modelValue:c.value,"onUpdate:modelValue":z=>c.value=z},{ref_for:!0},c.option,{onChange:$,onClear:z=>S(c)}),null,16,["class","modelValue","onUpdate:modelValue","onClear"])):e.createCommentVNode("",!0),c.type==="date"?(e.openBlock(),e.createBlock(I,{key:3,class:e.normalizeClass({datetimerange:"w300",daterange:"w200"}[c.dateType]||"w100"),modelValue:c.value,"onUpdate:modelValue":z=>c.value=z,"value-format":{datetimerange:"YYYY-MM-DD HH:mm:ss",daterange:"YYYY-MM-DD"}[c.dateType]||"YYYY-MM-DD",type:c.dateType||"date",onFocus:z=>r.value=c,onChange:z=>b(),placeholder:g.$t("qing-xuan-ze"),"start-placeholder":g.$t("kai-shi-shi-jian"),"end-placeholder":g.$t("jie-shu-shi-jian")},null,8,["class","modelValue","onUpdate:modelValue","value-format","type","onFocus","onChange","placeholder","start-placeholder","end-placeholder"])):e.createCommentVNode("",!0)]}),_:2},1032,["label"]))],64))),128))]),_:1},8,["model"])],4),e.createElementVNode("div",_t,[e.createElementVNode("div",$t,[e.renderSlot(g.$slots,"table-header-left",{},void 0,!0)]),e.createElementVNode("div",Vt,[e.createVNode(Y,{underline:"never",class:"mgr10",onClick:V[0]||(V[0]=()=>{a("visibleChange",!s.value),s.value=!s.value})},{default:e.withCtx(()=>[e.createVNode(we,{name:s.value?"ArrowUp":"ArrowDown"},null,8,["name"]),e.createTextVNode(" "+e.toDisplayString(f.value),1)]),_:1}),e.createVNode(O,{type:"primary",onClick:$},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.$t("shai-xuan")),1)]),_:1}),e.createVNode(O,{type:"primary",onClick:x},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.$t("chong-zhi")),1)]),_:1}),e.renderSlot(g.$slots,"btn",{},void 0,!0)])])],32)}}},[["__scopeId","data-v-3c0a6716"]]),Me={pageNoKey:"pageNo",pageSizeKey:"pageSize",totalKey:"total",defaultPageSize:10,pageSizes:[10,50,100,500],responseDataKeys:{rows:["rows","records"],total:["totalRows","total"]},showSearch:!1,showPage:!1,showShadow:!1,showCheckBox:!1,enableCellCopy:!0};let ue={...Me};function It(o){ue={...ue,...o,responseDataKeys:{...ue.responseDataKeys,...o.responseDataKeys||{}}}}function Ae(){return ue}function Tt(){ue={...Me}}const tn="",vt={class:"center"},Et=ce({__name:"index",props:{id:{type:String,required:!1},loading:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0},searchForm:{type:Object,default:()=>({items:[],selections:[]})},api:{type:Function},data:{type:Array},tableConfig:{type:Object,default:()=>({})}},setup(o,{expose:t}){const{t:n,locale:l}=ee.useI18n(),a=Te.useRoute(),s=Ae(),r=o,d=e.ref(!1),f=e.ref([]);r.searchForm.showSearch===void 0&&(r.searchForm.showSearch=s.showSearch),r.searchForm.showPage===void 0&&(r.searchForm.showPage=s.showPage),r.searchForm.showShadow===void 0&&(r.searchForm.showShadow=s.showShadow),r.searchForm.showCheckBox===void 0&&(r.searchForm.showCheckBox=s.showCheckBox),r.searchForm.enableCellCopy===void 0&&(r.searchForm.enableCellCopy=s.enableCellCopy),r.searchForm.selections||(r.searchForm.selections=[]);const $=e.computed(()=>{const u=a.path.replace(/\//g,"-").replace(/^-/,"")||"default-table";return r.id?`listPageId-${u}-${r.id}`:`listPageId-${u}`}),S=le.cloneDeep(r.searchForm.items),x=r.searchForm.pageNoKey||s.pageNoKey,b=r.searchForm.pageSizeKey||s.pageSizeKey,w=e.reactive({[x]:1,[b]:r.searchForm.defaultPageSize||s.defaultPageSize,total:0}),p=e.ref(null),h=e.ref(null),g=e.ref(450),V=le.debounce(()=>{e.nextTick(()=>{if(!h.value)return;const i=h.value.getBoundingClientRect(),k=window.innerHeight,E=i.top,M=100,R=k-E-M,F=200;g.value=Math.max(R,F)})},100),_=()=>{V()},I=()=>{if(!r.searchForm.enableCellCopy)return!1;const u=p.value;if(!u||!u.$el)return!1;const i=u.$el;return i.classList.add("cell-copy-enabled"),i.setAttribute("tabindex","-1"),i.removeEventListener("mousedown",X),i.removeEventListener("mousemove",se),i.removeEventListener("mouseup",de),i.removeEventListener("keydown",$e),i.addEventListener("mousedown",X),i.addEventListener("mousemove",se),i.addEventListener("mouseup",de),i.addEventListener("keydown",$e),!0};e.onMounted(()=>{V(),window.addEventListener("resize",_),r.searchForm.enableCellCopy&&(document.addEventListener("mouseup",je),document.addEventListener("mousedown",Ue),setTimeout(()=>{I()},500))}),e.onUpdated(()=>{r.searchForm.enableCellCopy&&setTimeout(()=>{I()},500)}),e.onUnmounted(()=>{if(window.removeEventListener("resize",_),r.searchForm.enableCellCopy){document.removeEventListener("mouseup",je),document.removeEventListener("mousedown",Ue);const u=p.value;if(u&&u.$el){const i=u.$el;i.removeEventListener("mousedown",X),i.removeEventListener("mousemove",se),i.removeEventListener("mouseup",de),i.removeEventListener("keydown",$e)}}});const B=e.computed(()=>te.value.height||g.value);let v;async function Y(u){const{dataFormat:i}=r.tableConfig;u[x]!=1&&(u.nextSearchAfter=v),d.value=!0;const{code:k,data:E={}}=await r.api(u).finally(()=>{d.value=!1,r.searchForm.selections=[]});if(k==200){let M=[];for(const F of s.responseDataKeys.rows)if(E[F]){M=E[F];break}let R=0;for(const F of s.responseDataKeys.total)if(E[F]!==void 0){R=E[F];break}f.value=i?i(M):M,w.total=R,v=E.nextSearchAfter,r.searchForm.enableCellCopy&&e.nextTick(()=>{setTimeout(()=>{I()},100)})}}function O(u={}){const{searchData:i=()=>({})}=r.tableConfig,k=i();Y({...w,...ke(r.searchForm.items),...u,...k})}function c(){const{reset:u}=r.tableConfig;u&&u(),r.searchForm.items.forEach(i=>{const k=S.find(E=>le.isArray(i.key)&&le.isArray(E.key)?i.key.join(",")==E.key.join(","):E.key==i.key);k&&(i.value=k.value)}),O()}r.api&&r.immediate&&O();function y(){return{...w,...ke(r.searchForm.items)}}const L=()=>{const u=p.value;u&&u.clearSort()},z=e.reactive({storage:!0}),W=e.reactive({drag:!0,resizable:!0,maxFixedSize:0}),te=e.computed(()=>{const{customConfig:u,columnConfig:i,...k}=r.tableConfig;return{headerAlign:"left",align:"center",customConfig:{...z,...u},columnConfig:{...W,...i},"virtual-x-config":{enabled:!1,scrollToLeftOnChange:!1},"virtual-y-config":{enabled:!0,gt:100},...k}}),C=e.reactive({isSelecting:!1,startCell:null,endCell:null,selectedCells:[]}),ae=u=>{const i=u.closest(".vxe-body--column");if(!i||i.classList.contains("col--checkbox")||i.classList.contains("col--seq"))return null;const k=i.closest(".vxe-body--row");if(!k)return null;const E=p.value;if(!E)return null;let M=-1;const R=k.getAttribute("data-rowid");if(R!=null)M=parseInt(R,10);else{const D=k.parentElement;M=Array.from(D.querySelectorAll(".vxe-body--row")).indexOf(k)}if(M<0)return null;let F=-1;const J=i.getAttribute("data-colid");if(J&&(F=E.getColumns().findIndex(T=>T.id===J)),F<0){const T=Array.from(k.querySelectorAll(".vxe-body--column")).indexOf(i),q=!!i.closest(".vxe-table--fixed-left-wrapper"),j=!!i.closest(".vxe-table--fixed-right-wrapper"),A=E.getColumns();if(q){const U=A.filter(P=>P.fixed==="left");T<U.length&&(F=A.indexOf(U[T]))}else if(j){const U=A.filter(P=>P.fixed==="right");T<U.length&&(F=A.indexOf(U[T]))}else{const U=r.searchForm.showCheckBox?1:0;F=A.filter(H=>H.fixed==="left").length+T-U}}return F<0?null:{rowIndex:M,colIndex:F,cell:i}},X=u=>{const i=ae(u.target);if(!i){_e();return}C.isSelecting=!0,C.startCell={rowIndex:i.rowIndex,colIndex:i.colIndex},C.endCell={...C.startCell},Pe(),Re()},se=u=>{if(!C.isSelecting)return;const i=ae(u.target);i&&(C.endCell={rowIndex:i.rowIndex,colIndex:i.colIndex},Pe(),Re())},de=()=>{C.isSelecting=!1},_e=()=>{C.selectedCells=[],C.startCell=null,C.endCell=null;const u=p.value;if(!u)return;u.$el.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(k=>{k.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")})},Pe=()=>{if(!C.startCell||!C.endCell){C.selectedCells=[];return}const u=C.startCell.rowIndex,i=C.endCell.rowIndex,k=C.startCell.colIndex,E=C.endCell.colIndex,M=Math.min(u,i),R=Math.max(u,i),F=Math.min(k,E),J=Math.max(k,E);C.selectedCells=[];for(let D=M;D<=R;D++)for(let T=F;T<=J;T++)C.selectedCells.push({rowIndex:D,colIndex:T})},Re=()=>{e.nextTick(()=>{const u=p.value;if(!u)return;const i=u.$el;if(i.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(q=>{q.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")}),C.selectedCells.length===0)return;const k=u.getColumns(),E=C.selectedCells.map(q=>q.rowIndex),M=C.selectedCells.map(q=>q.colIndex),R=Math.min(...E),F=Math.max(...E),J=Math.min(...M),D=Math.max(...M),T=[i.querySelector(".vxe-table--body-wrapper tbody"),i.querySelector(".vxe-table--fixed-left-wrapper tbody"),i.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean);C.selectedCells.forEach(({rowIndex:q,colIndex:j})=>{const A=k[j];if(!A)return;const U=A.fixed==="left",P=A.fixed==="right";for(const H of T){const fe=H.querySelectorAll(".vxe-body--row")[q];if(!fe)continue;const ne=Array.from(fe.querySelectorAll(".vxe-body--column"));let N=null;if(U&&H.closest(".vxe-table--fixed-left-wrapper")){const Z=k.filter(G=>G.fixed==="left").indexOf(A);N=ne[Z]}else if(P&&H.closest(".vxe-table--fixed-right-wrapper")){const Z=k.filter(G=>G.fixed==="right").indexOf(A);N=ne[Z]}else if(!U&&!P&&H.closest(".vxe-table--body-wrapper")){const oe=r.searchForm.showCheckBox?1:0,Z=k.filter(Ve=>Ve.fixed==="left").length,G=j-Z;N=ne[G+oe]}if(N&&!N.classList.contains("col--checkbox")&&!N.classList.contains("col--seq")){N.classList.add("cell-selected"),q===R&&N.classList.add("cell-border-top"),q===F&&N.classList.add("cell-border-bottom"),j===J&&N.classList.add("cell-border-left"),j===D&&N.classList.add("cell-border-right");break}}})})},Ut=async()=>{if(C.selectedCells.length===0)return;const u=p.value;if(!u)return;const i=u.$el,k=u.getColumns(),E=[...new Set(C.selectedCells.map(D=>D.rowIndex))].sort((D,T)=>D-T),M=[...new Set(C.selectedCells.map(D=>D.colIndex))].sort((D,T)=>D-T),R=[i.querySelector(".vxe-table--body-wrapper tbody"),i.querySelector(".vxe-table--fixed-left-wrapper tbody"),i.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean),F=[];E.forEach(D=>{const T=[];M.forEach(q=>{const j=k[q];if(!j){T.push("");return}const A=j.fixed==="left",U=j.fixed==="right";let P="";for(const H of R){const fe=H.querySelectorAll(".vxe-body--row")[D];if(!fe)continue;const ne=Array.from(fe.querySelectorAll(".vxe-body--column"));let N=null;if(A&&H.closest(".vxe-table--fixed-left-wrapper")){const Z=k.filter(G=>G.fixed==="left").indexOf(j);N=ne[Z]}else if(U&&H.closest(".vxe-table--fixed-right-wrapper")){const Z=k.filter(G=>G.fixed==="right").indexOf(j);N=ne[Z]}else if(!A&&!U&&H.closest(".vxe-table--body-wrapper")){const oe=r.searchForm.showCheckBox?1:0,Z=k.filter(Ve=>Ve.fixed==="left").length,G=q-Z;N=ne[G+oe]}if(N&&!N.classList.contains("col--checkbox")&&!N.classList.contains("col--seq")){P=N.innerText||N.textContent||"",P=P.trim(),P=P.replace(/\n/g," ").replace(/\s+/g," ");break}}T.push(P)}),F.push(T.join(" "))});const J=F.join(`
2
- `);try{await navigator.clipboard.writeText(J)}catch(D){console.error("复制失败:",D)}},$e=u=>{r.searchForm.enableCellCopy&&((u.ctrlKey||u.metaKey)&&u.key==="c"?C.selectedCells.length>0&&(u.preventDefault(),u.stopPropagation(),Ut()):u.key==="Escape"&&_e())},je=()=>{C.isSelecting=!1},Ue=u=>{const i=p.value;if(!i||!i.$el)return;i.$el.contains(u.target)||_e()},Yt=u=>{w[x]=u,O()},Kt=u=>{w[b]=u,w[x]=1,O()};function Ye(){const u=p.value.getCheckboxRecords();r.searchForm.selections=u}const Ke=u=>{const i=p.value;if(i){i.toggleCheckboxRow(u);const k=p.value.getCheckboxRecords();r.searchForm.selections=k}};return t({tableRef:p,getList:O,getPrm:y,clearSort:L,calculateTableHeight:V}),(u,i)=>{var D;const k=e.resolveComponent("el-button"),E=e.resolveComponent("el-checkbox"),M=e.resolveComponent("el-text"),R=e.resolveComponent("vxe-column"),F=e.resolveComponent("VxeTable"),J=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({box:o.searchForm.showShadow})},[o.searchForm.showSearch?(e.openBlock(),e.createBlock(Ne,{key:0,form:o.searchForm,onReset:c,onConfirm:i[1]||(i[1]=T=>O()),onVisibleChange:e.unref(V)},{btn:e.withCtx(()=>[i[3]||(i[3]=e.createElementVNode("span",{class:"mgr10"},null,-1)),e.renderSlot(u.$slots,"search-bar-btn",{},void 0,!0),e.createVNode(k,{class:"mgl10",round:"",onClick:i[0]||(i[0]=T=>p.value.openCustom())},{default:e.withCtx(()=>[e.createVNode(we,{name:"Tools"})]),_:1})]),_:3},8,["form","onVisibleChange"])):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"table-header-left",{},void 0,!0),e.createElementVNode("div",{ref_key:"tableContentRef",ref:h},[e.createVNode(F,e.mergeProps({id:$.value,ref_key:"tableRef",ref:p,loading:o.loading||d.value,data:o.api?f.value:o.data,border:""},te.value,{height:B.value,onCheckboxChange:Ye,onCheckboxAll:Ye,onSortChange:(D=te.value["sort-config"])==null?void 0:D.sortChange}),{default:e.withCtx(()=>[o.searchForm.showCheckBox==null||o.searchForm.showCheckBox?(e.openBlock(),e.createBlock(R,{key:0,type:"checkbox",width:e.unref(l)=="zh_cn"?80:150,title:u.$t("xu-hao"),fixed:"left"},{checkbox:e.withCtx(({rowIndex:T,row:q,checked:j,disabled:A,indeterminate:U})=>[e.createElementVNode("div",vt,[j?(e.openBlock(),e.createBlock(E,{key:0,checked:!0,disabled:A,size:"default",onClick:e.withModifiers(P=>!A&&Ke(q),["stop"])},null,8,["disabled","onClick"])):(e.openBlock(),e.createBlock(E,{key:1,disabled:A,checked:!1,size:"default",onClick:e.withModifiers(P=>!A&&Ke(q),["stop"])},null,8,["disabled","onClick"])),e.createVNode(M,{type:"info",class:"mgl5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(T+1),1)]),_:2},1024)])]),_:1},8,["width","title"])):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"default",{},void 0,!0)]),_:3},16,["id","loading","data","height","onSortChange"])],512),o.searchForm.showPage?(e.openBlock(),e.createBlock(J,{key:1,"current-page":w[e.unref(x)],"onUpdate:currentPage":i[2]||(i[2]=T=>w[e.unref(x)]=T),class:"myPagination mgt10",background:"",layout:"total, sizes, prev, pager, next",total:w.total,"page-size":w[e.unref(b)],"page-sizes":o.searchForm.pageSizes||e.unref(s).pageSizes,onCurrentChange:Yt,onSizeChange:Kt},null,8,["current-page","total","page-size","page-sizes"])):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-d93cad32"]]),Lt={__name:"index",props:{sheetsConfig:{type:Object,required:!0},fileName:{type:String,required:!0}},setup(o){const t=o;function n(){ze(t.fileName,t.sheetsConfig)}return(l,a)=>{const s=e.resolveComponent("el-link");return e.openBlock(),e.createBlock(s,e.mergeProps({type:"primary",underline:"never"},l.$attrs,{onClick:n}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.$t("xia-zai-dao-ru-mo-ban")),1)]),_:1},16)}}};function Ft(o,t={}){const n=Ce(),l={inForm:!0,required:!0,...t},a={phone:/^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/,password:/(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/,email:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/}[o],{inForm:s,value:r,required:d,msg:f=n("validate.invalidInput")}=l;return s?function($,S,x){if(d){a.test(S)?x():x(new Error(f));return}S&&!a.test(S)?x(new Error(f)):x()}:a.test(r)}class Dt{constructor(t={}){this.config={clientCode:t.clientCode||"one-portal",casServerUrl:`https://one-portal${t.isTest?"-test":""}.joy-group.com/api`,casPortalUrl:`https://one-portal${t.isTest?"-test":""}.joy-group.com`,serviceUrl:t.serviceUrl||window.location.origin+"/cas/callback",tokenKey:t.tokenKey||"one_portal_token",userKey:t.userKey||"one_portal_user",debug:t.debug||!1,autoLogin:t.autoLogin!==!1,loginCallback:t.loginCallback||null,logoutCallback:t.logoutCallback||null,errorCallback:t.errorCallback||null},this.token=null,this.user=null,this.init()}init(){this.log("OnePortal CAS SDK 初始化中..."),this.loadFromStorage();const n=new URLSearchParams(window.location.search).get("ticket");this.isLoggedIn()&&this.config.loginCallback?this.config.loginCallback(this.user,this.token):n?(this.log("检测到ST票据:",n),this.validateTicket(n)):this.config.autoLogin&&!this.isLoggedIn()&&(this.log("用户未登录,准备跳转到CAS登录页面"),this.login())}loadFromStorage(){try{this.token=localStorage.getItem(this.config.tokenKey);const t=localStorage.getItem(this.config.userKey);t&&(this.user=JSON.parse(t)),this.log("从本地存储加载数据:",{token:!!this.token,user:!!this.user})}catch(t){this.log("加载本地存储数据失败:",t)}}saveToStorage(){try{this.token&&localStorage.setItem(this.config.tokenKey,this.token),this.user&&localStorage.setItem(this.config.userKey,JSON.stringify(this.user)),this.log("数据已保存到本地存储")}catch(t){this.log("保存到本地存储失败:",t)}}clearStorage(){try{localStorage.removeItem(this.config.tokenKey),localStorage.removeItem(this.config.userKey),this.log("本地存储已清除")}catch(t){this.log("清除本地存储失败:",t)}}isLoggedIn(){return!!(this.token&&this.user)}getUser(){return this.user}getToken(){return this.token}login(){const t=`${this.config.casPortalUrl}?appCode=${this.config.clientCode}&redirectUrl=${encodeURIComponent(this.config.serviceUrl)}`;this.log("跳转到CAS登录页面:",t),window.location.href=t}async validateTicket(t){try{this.log("验证ST票据:",t);const n=await fetch(`${this.config.casServerUrl}/auth/validateST?ticket=${t}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);const l=await n.json();if(l.success&&l.data)return this.token=l.data.token,this.user=l.data.user,this.saveToStorage(),this.clearTicketFromUrl(),this.log("ST票据验证成功,用户登录成功:",this.user),this.config.loginCallback&&this.config.loginCallback(this.user,this.token),!0;throw new Error(l.message||"ST票据验证失败")}catch(n){return this.log("ST票据验证失败:",n),this.handleError(n),!1}}clearTicketFromUrl(){const t=new URL(window.location);t.searchParams.delete("ticket"),window.history.replaceState({},document.title,t.toString())}async logout(t=!0){try{if(this.log("用户登出"),this.token)try{await fetch(`${this.config.casServerUrl}/auth/logout`,{method:"POST",headers:{AppId:this.config.clientCode,Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"}})}catch(n){this.log("调用服务端登出接口失败:",n)}this.token=null,this.user=null,this.clearStorage(),this.config.logoutCallback&&this.config.logoutCallback(),t&&this.login()}catch(n){this.log("登出失败:",n),this.handleError(n)}}async request(t,n={}){const l={headers:{"Content-Type":"application/json",...n.headers},...n};l.headers.appId=this.config.clientCode,this.token&&(l.headers.Authorization=`Bearer ${this.token}`);try{const a=await fetch(t,l);return a.status===401?(this.log("Token已过期,需要重新登录"),this.logout(),null):a}catch(a){throw this.log("请求失败:",a),a}}async fetchUserInfo(){try{const t=await this.request(`${this.config.casServerUrl}/auth/user`);if(t&&t.ok){const n=await t.json();if(n.success&&n.data)return this.user=n.data,this.saveToStorage(),this.user}return null}catch(t){return this.log("获取用户信息失败:",t),null}}async refreshToken(){this.log("Token刷新功能暂未实现")}handleError(t){this.log("发生错误:",t),this.config.errorCallback&&this.config.errorCallback(t)}log(...t){this.config.debug&&console.log("[OnePortal CAS SDK]",...t)}checkLoginStatus(){return!this.isLoggedIn()&&this.config.autoLogin?(this.login(),!1):this.isLoggedIn()}setConfig(t,n){this.config[t]=n}getConfig(t){return this.config[t]}}function Bt(o,t={}){const l=Object.assign({manual:!1,log:!1,params:null,format:null},t),{manual:a,log:s,params:r={},cb:d,format:f}=l,$=e.ref([]),S=e.ref(!1),x=b=>{const w=b||r;S.value=!0,o(w).then(p=>{const{code:h,data:g,msg:V}=p;if(d){const{records:_,rows:I}=g||{},B=_||I?_||I:g;$.value=xe(B,f),d(p)}if(g){if(g.records!=null||g.rows!=null){const{records:_,rows:I,total:B=0}=g||{};w&&w.total!=null&&(r.total=parseInt(B)),$.value=xe(_||I||[],f)}else $.value=xe(g,f);s&&console.log("useRequest-res",$.value)}}).catch(p=>{d&&(console.log("useRequestErr",p),d({code:500}))}).finally(()=>{S.value=!1})};return a||x(),[S,$,x]}function zt(o){const t=e.ref(o),n=e.ref(""),l=e.ref("");return e.watch(t,a=>{const s=a||["",""];n.value=s[0],l.value=s[1]}),[t,n,l]}function Ot(o){return Object.prototype.toString.call(o).slice(8,-1).toLowerCase()}function xe(o,t){if(!t)return o;if(o instanceof Array)return o.map(l=>{let a={};return t.forEach(s=>a[s]=l[s]),a});let n={};return t.forEach(l=>n[l]=o[l]),n}function Nt(o,t=[]){const{locale:n}=ee.useI18n(),l=e.ref(o());return e.watch([n,...t],()=>{l.value=o()},{immediate:!0}),l}function Mt(o,t="zh_cn",n="en_us"){if(!o)return"-";const l={en_us:n,zh_cn:t},s=pe().global.locale.value;return o[l[s]]||o[t]||"-"}function At(o,t){let n=Q.mapState;return typeof o=="string"&&o.length>0&&(n=Q.createNamespacedHelpers(o).mapState),qe(t,n)}function qt(o,t){let n=Q.mapGetters;return typeof o=="string"&&o.length>0&&(n=Q.createNamespacedHelpers(o).mapGetters),qe(t,n)}function Pt(o,t){let n=Q.mapActions;return typeof o=="string"&&o.length>0&&(n=Q.createNamespacedHelpers(o).mapActions),Rt(t,n)}function qe(o,t){const n=Q.useStore(),l=t(o),a={};return Object.keys(l).forEach(s=>{const r=l[s].bind({$store:n});a[s]=e.computed(r)}),a}function Rt(o,t){const n=Q.useStore(),l=t(o),a={};return Object.keys(l).forEach(s=>{a[s]=l[s].bind({$store:n})}),a}function Se(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!e.isVNode(o)}function jt(){ie.VxeUI.renderer.add("Enum",{renderTableDefault(o,t){let n;if([null,void 0].includes(t.row[t.column.field]))return"-";const l=t.row[t.column.field];if(o.type=="tag"){let a;return e.createVNode(e.resolveComponent("el-text"),{type:o.enum.getTag(l)},Se(a=o.enum.getName(l))?a:{default:()=>[a]})}return e.createVNode(e.resolveComponent("el-text"),null,Se(n=o.enum.getName(l))?n:{default:()=>[n]})}}),ie.VxeUI.renderer.add("InputNumber",{renderTableDefault(o,t){return e.createVNode(K.ElInputNumber,e.mergeProps({modelValue:t.row[t.column.field],"onUpdate:modelValue":n=>t.row[t.column.field]=n},o.props,{"step-strictly":!0,"value-on-clear":0}),null)}}),ie.VxeUI.renderer.add("TrueFalse",{renderTableDefault(o,t){const{locale:n}=ee.useI18n();let l=n.value=="zh_cn";return e.createVNode(K.ElText,{type:t.row[t.column.field]?"success":"danger"},{default:()=>[t.row[t.column.field]?l?"是":"YES":l?"否":"NO"]})}}),ie.VxeUI.renderer.add("I18n",{renderTableDefault(o,t){const{locale:n}=ee.useI18n();let l=n.value=="zh_cn"?t.column.field:o.fieldEn;return t.row[l]||t.row[t.column.field]}}),ie.VxeUI.renderer.add("Link",{renderTableDefault(o,t){var d;let n=t.column.field;const l=Te.useRouter(),{multiple:a,to:s}=o;if(!a)return e.createVNode(K.ElLink,{underline:"never",type:"primary",onclick:()=>l.push({path:s,query:{[n]:t.row[n]}})},{default:()=>[t.row[n]]});const r=((d=t.row[n])==null?void 0:d.split(","))||[];return r.map((f,$)=>e.createVNode("span",null,[e.createVNode(K.ElLink,{underline:"never",type:"primary",onclick:()=>l.push({path:s,query:{[n]:f}})},Se(f)?f:{default:()=>[f]}),$<r.length-1?",":""]))}})}m.CmpDictionary=Oe,m.CmpIcon=we,m.ConfrimButton=wt,m.DownExcelTemp=Lt,m.ImportButton=xt,m.LayOutForm=Ze,m.ListPage=Et,m.OnePortalCasSDK=Dt,m.SearchBar=Ne,m.StatusMap=be,m._toRaw=it,m._typeOf=Ot,m.arrToStatusMap=ut,m.arrayToTree=ct,m.checkFileSize=ht,m.creatValidator=Ft,m.createImportFields=gt,m.createListPageId=mt,m.en_us=ge,m.exportExcel=ze,m.getI18n=pe,m.getI18nT=Ce,m.getListPageConfig=Ae,m.getLocaleValue=Mt,m.getValueBykey=pt,m.importExcel=Xe,m.messages=De,m.registerVxeRenderers=jt,m.resetListPageConfig=Tt,m.setListPageConfig=It,m.setupI18n=Be,m.sleep=st,m.stringToArray=ye,m.stripHtmlTags=dt,m.unicode2Str=ft,m.useActions=Pt,m.useDatePicker=zt,m.useGetters=qt,m.useI18nReState=Nt,m.useRequest=Bt,m.useState=At,m.zh_cn=me,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
1
+ (function(m,K){typeof exports=="object"&&typeof module<"u"?K(exports,require("element-plus"),require("vue"),require("file-saver"),require("exceljs"),require("dayjs"),require("vue-i18n"),require("lodash"),require("vue-router"),require("vuex"),require("vxe-pc-ui")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue","file-saver","exceljs","dayjs","vue-i18n","lodash","vue-router","vuex","vxe-pc-ui"],K):(m=typeof globalThis<"u"?globalThis:m||self,K(m.JoyAdminComponents={},m.ElementPlus,m.Vue,m.fileSaver,m.ExcelJS,m.dayjs,m.VueI18n,m._,m.VueRouter,m.Vuex,m.VxeUI))})(this,function(m,K,e,He,Ie,he,ee,le,Te,Q,ie){"use strict";const Ze=e.defineComponent({name:"LayOutForm",setup(o,{slots:t,attrs:n,emit:l}){const a=e.ref(null),s=()=>t.default?t.default().filter(d=>d.type!==Symbol.for("v-cmt")).map(d=>d.type===Symbol.for("v-fgt")?d.children:d).flat().map(d=>{var f;return e.h(K.ElCol,{span:((f=d.props)==null?void 0:f.span)||24},{default:()=>d})}):null;e.onMounted(()=>{l("ref",a.value)});function r(){return e.h(K.ElForm,{...n,ref:a},()=>e.h(K.ElRow,{gutter:n.gutter??20},{default:()=>s()}))}return r}});var ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ee(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Le={exports:{}};(function(o,t){(function(n,l){o.exports=l()})(ve,function(){var n="minute",l=/[+-]\d\d(?::?\d\d)?/g,a=/([+-]|\d\d)/g;return function(s,r,d){var f=r.prototype;d.utc=function(h){var g={date:h,utc:!0,args:arguments};return new r(g)},f.utc=function(h){var g=d(this.toDate(),{locale:this.$L,utc:!0});return h?g.add(this.utcOffset(),n):g},f.local=function(){return d(this.toDate(),{locale:this.$L,utc:!1})};var $=f.parse;f.parse=function(h){h.utc&&(this.$u=!0),this.$utils().u(h.$offset)||(this.$offset=h.$offset),$.call(this,h)};var S=f.init;f.init=function(){if(this.$u){var h=this.$d;this.$y=h.getUTCFullYear(),this.$M=h.getUTCMonth(),this.$D=h.getUTCDate(),this.$W=h.getUTCDay(),this.$H=h.getUTCHours(),this.$m=h.getUTCMinutes(),this.$s=h.getUTCSeconds(),this.$ms=h.getUTCMilliseconds()}else S.call(this)};var x=f.utcOffset;f.utcOffset=function(h,g){var V=this.$utils().u;if(V(h))return this.$u?0:V(this.$offset)?x.call(this):this.$offset;if(typeof h=="string"&&(h=function(v){v===void 0&&(v="");var Y=v.match(l);if(!Y)return null;var O=(""+Y[0]).match(a)||["-",0,0],c=O[0],y=60*+O[1]+ +O[2];return y===0?0:c==="+"?y:-y}(h),h===null))return this;var _=Math.abs(h)<=16?60*h:h;if(_===0)return this.utc(g);var I=this.clone();if(g)return I.$offset=_,I.$u=!1,I;var B=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(I=this.local().add(_+B,n)).$offset=_,I.$x.$localOffset=B,I};var b=f.format;f.format=function(h){var g=h||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return b.call(this,g)},f.valueOf=function(){var h=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*h},f.isUTC=function(){return!!this.$u},f.toISOString=function(){return this.toDate().toISOString()},f.toString=function(){return this.toDate().toUTCString()};var w=f.toDate;f.toDate=function(h){return h==="s"&&this.$offset?d(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():w.call(this)};var p=f.diff;f.diff=function(h,g,V){if(h&&this.$u===h.$u)return p.call(this,h,g,V);var _=this.local(),I=d(h).local();return p.call(_,I,g,V)}}})})(Le);var Ge=Le.exports;const We=Ee(Ge);var Fe={exports:{}};(function(o,t){(function(n,l){o.exports=l()})(ve,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},l={};return function(a,s,r){var d,f=function(b,w,p){p===void 0&&(p={});var h=new Date(b),g=function(V,_){_===void 0&&(_={});var I=_.timeZoneName||"short",B=V+"|"+I,v=l[B];return v||(v=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:V,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:I}),l[B]=v),v}(w,p);return g.formatToParts(h)},$=function(b,w){for(var p=f(b,w),h=[],g=0;g<p.length;g+=1){var V=p[g],_=V.type,I=V.value,B=n[_];B>=0&&(h[B]=parseInt(I,10))}var v=h[3],Y=v===24?0:v,O=h[0]+"-"+h[1]+"-"+h[2]+" "+Y+":"+h[4]+":"+h[5]+":000",c=+b;return(r.utc(O).valueOf()-(c-=c%1e3))/6e4},S=s.prototype;S.tz=function(b,w){b===void 0&&(b=d);var p,h=this.utcOffset(),g=this.toDate(),V=g.toLocaleString("en-US",{timeZone:b}),_=Math.round((g-new Date(V))/1e3/60),I=15*-Math.round(g.getTimezoneOffset()/15)-_;if(!Number(I))p=this.utcOffset(0,w);else if(p=r(V,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(I,!0),w){var B=p.utcOffset();p=p.add(h-B,"minute")}return p.$x.$timezone=b,p},S.offsetName=function(b){var w=this.$x.$timezone||r.tz.guess(),p=f(this.valueOf(),w,{timeZoneName:b}).find(function(h){return h.type.toLowerCase()==="timezonename"});return p&&p.value};var x=S.startOf;S.startOf=function(b,w){if(!this.$x||!this.$x.$timezone)return x.call(this,b,w);var p=r(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return x.call(p,b,w).tz(this.$x.$timezone,!0)},r.tz=function(b,w,p){var h=p&&w,g=p||w||d,V=$(+r(),g);if(typeof b!="string")return r(b).tz(g);var _=function(Y,O,c){var y=Y-60*O*1e3,L=$(y,c);if(O===L)return[y,O];var z=$(y-=60*(L-O)*1e3,c);return L===z?[y,L]:[Y-60*Math.min(L,z)*1e3,Math.max(L,z)]}(r.utc(b,h).valueOf(),V,g),I=_[0],B=_[1],v=r(I).utcOffset(B);return v.$x.$timezone=g,v},r.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},r.tz.setDefault=function(b){d=b}}})})(Fe);var Je=Fe.exports;const Qe=Ee(Je),me={"dao-ru":"导入","quan-xuan":"全选","xia-zai-dao-ru-mo-ban":"下载导入模板","xu-hao":"序号","qing-shu-ru":"请输入","qing-xuan-ze":"请选择","kai-shi-shi-jian":"开始时间","jie-shu-shi-jian":"结束时间","shai-xuan":"筛选","chong-zhi":"重置","guan-bi":"关闭","zhan-kai":"展开","qu-xiao":"取消","ti-jiao":"提交","que-ding":"确定","que-ding-guan-bi-ma":"确定关闭吗",excel:{fieldsMappingRequired:"请输入列字段映射",invalidInput:"非法输入",invalidOption:"请输入有效选项!",copyFailed:"复制失败",sheetNameTooLong:'Sheet名称 "{0}" 长度超过31个字符,已自动截断为 "{1}"'},validate:{invalidInput:"请输入正确内容"},tools:{keysLengthError:"keys 长度必须大于2 默认前两位为 label value"}},ge={"dao-ru":"Import","quan-xuan":"Select All","xia-zai-dao-ru-mo-ban":"Download Import Template","xu-hao":"No.","qing-shu-ru":"Please enter","qing-xuan-ze":"Please select","kai-shi-shi-jian":"Start Time","jie-shu-shi-jian":"End Time","shai-xuan":"Filter","chong-zhi":"Reset","guan-bi":"Collapse","zhan-kai":"Expand","qu-xiao":"Cancel","ti-jiao":"Submit","que-ding":"Confirm","que-ding-guan-bi-ma":"Are you sure to close?",excel:{fieldsMappingRequired:"Please enter column field mapping",invalidInput:"Invalid input",invalidOption:"Please enter a valid option!",copyFailed:"Copy failed",sheetNameTooLong:'Sheet name "{0}" exceeds 31 characters, automatically truncated to "{1}"'},validate:{invalidInput:"Please enter valid content"},tools:{keysLengthError:"Keys length must be greater than 2, default first two are label and value"}},De={zh_cn:me,en_us:ge};let re=null;function Be(o=null){if(o){const{global:t}=o;return t.messages.value.zh_cn?t.mergeLocaleMessage("zh_cn",me):t.setLocaleMessage("zh_cn",me),t.messages.value.en_us?t.mergeLocaleMessage("en_us",ge):t.setLocaleMessage("en_us",ge),re=o,o}return re||(re=ee.createI18n({legacy:!1,locale:"zh_cn",fallbackLocale:"zh_cn",messages:De})),re}function pe(){return re||Be()}function Ce(){return pe().global.t}he.extend(We),he.extend(Qe);async function Xe(o,t){const{fields:n,range:l=1}=t;if(!n){const r=Ce();throw new Error(r("excel.fieldsMappingRequired"))}let a=new Ie.Workbook;await a.xlsx.load(o);const s={};return a.eachSheet(function(r,d){const f=[];r.eachRow(function($,S){if(S>l){let x={},b=!0;Object.keys(n).forEach(w=>{const p=$.getCell(n[w]).value;x[w]=p,p&&(b=!1)}),b||f.push(x)}}),s[r._name]=f}),a=null,s}const et={columnWidth:30};async function ze(o,t,n=[],l={}){if(!o||!t)return;const{columnStyle:a}=l,{columnWidth:s}=et;t.forEach(f=>{f.width=f.width?f.width:s});const{workbook:r,worksheet:d}=tt();d.columns=t,d.addRows(n),a&&await nt(r,d,a);try{const f=await r.xlsx.writeBuffer(),$=new File([f],o,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});He.saveAs($)}catch(f){console.log(f)}}function tt(){const o=new Ie.Workbook;o.creator="distributor System",o.lastModifiedBy="distributor System",o.created=new Date,o.modified=new Date,o.lastPrinted=new Date;const t=o.addWorksheet("Sheet1");return{workbook:o,worksheet:t}}async function nt(o,t,n){const l=Object.keys(n);for(const a of l){const s=n[a],{type:r}=s;switch(r){case"IMG":await ot(o,t,a);break}}}async function ot(o,t,n,l){const a=t.getColumn(n),s=a.values;t.getColumn(n).width=20,t.eachRow((r,d)=>{d>1&&(r.height=40)});for(let r=0,d=s.length;r<d;r++){if(r<2)continue;let f=s[r];f&&(t.getCell(a.letter+r).value="",await lt(o,t,f,{width:100,height:50,col:a._number-1,row:r-1}))}}async function lt(o,t,n,l){const{col:a,row:s,width:r,height:d}=l,{success:f,base64:$}=await rt(n,.3);if(f){const S=o.addImage({base64:$,extension:"jpeg"});t.addImage(S,{tl:{col:a,row:s},ext:{width:r,height:d}})}}function rt(o,t=1){const n=new Image;return n.setAttribute("crossOrigin","anonymous"),n.crossOrigin="anonymous",n.src=o,new Promise((l,a)=>{n.onload=()=>{const s=document.createElement("canvas");s.width=n.width,s.height=n.height,s.getContext("2d").drawImage(n,0,0,s.width,s.height),l({success:!0,base64:s.toDataURL("image/jpeg",t)})},n.onerror=()=>{l({success:!1})}})}function at(o){if(o<26)return String.fromCharCode(65+o);{const t=String.fromCharCode(65+Math.floor((o-26)/26)),n=String.fromCharCode(65+(o-26)%26);return t+n}}function st(o){return new Promise(t=>{setTimeout(()=>{t()},o)})}function it(o){return JSON.parse(JSON.stringify(o))}function ct(o){let t=[],n={},l=(a,s)=>Object.prototype.hasOwnProperty.call(a,s);for(const a of o){n[a.id]={...a,children:l(n,a.id)?n[a.id].children:[]};const s=n[a.id];a.pid==-1?t.push(s):(l(n,a.pid)||(n[a.pid]={children:[]}),n[a.pid].children.push(s))}return t}function ye(o,t=" "){return o?o.split(t).filter(n=>n.trim()):[]}class be{constructor(t,n=["label","value","labelEn"]){this.list=t.map(l=>({...l,label:l[n[0]],labelEn:l[n[2]]||l[n[0]]||"",value:l[n[1]]})),this.map=new Map(this.list.map(l=>[l[n[1]],l]))}getName(t){if(!this.has(t))return"-";const n=pe().global.locale,{label:l,labelEn:a}=this.map.get(t);return(n.value=="zh_cn"?l:a)||l||"-"}getTag(t){if(!this.has(t))return"info";const{tag:n="info"}=this.map.get(t);return n}getItem(t){return this.has(t)?this.map.get(t):null}getColor(t){if(!this.has(t))return null;const{color:n}=this.map.get(t);return n}has(t){return this.map.has(t)}}function ut(o,t=[],n="i18nName"){if(o.length==0)return new be([]);if(t.length<2){const a=Ce();throw new Error(a("tools.keysLengthError"))}let l=o.map(a=>{let s={};return n&&(s.labelEn=a[n]),t.forEach((r,d)=>{d===0?s.label=a[r]:d===1?s.value=a[r]:s[r]=a[r]}),s});return new be(l)}function dt(o){return o?o.replace(/<[^>]+>/g,""):""}function ft(o){return o?(o.includes("\\\\u")&&(o=o.replace(/\\/g,"")),o.replace(/\\u[\dA-F]{4}/gi,t=>String.fromCharCode(parseInt(t.replace(/\\u/g,""),16)))):""}function ht(o,t=10){let n=1048576*t;return!(o.size>n)}function mt(o){return Array.from(10).fill(0).map((n,l)=>o+"_"+l)}function gt(o){let t={};return o.map((n,l)=>{let{key:a,option:s,type:r}=n,d=at(l);s?t[a]=`${d}---option`:r==="image"?t[a]=`${d}---image`:t[a]=d}),t}function pt(o,t){return t.split(".").reduce((n,l)=>n&&n[l],o)}const Zt="",ce=(o,t)=>{const n=o.__vccOpts||o;for(const[l,a]of t)n[l]=a;return n},Ct=["onClick"],Oe=ce({__name:"index",props:e.mergeModels({api:{type:Function},showCheckAll:{type:Boolean,default:!0},maxLimit:{type:Number,default:void 0},optionClick:{type:Function,default:()=>{}},data:{type:Array},labelValue:{type:Object,default:()=>({label:"label",labelEn:"labelEn",value:"value"})},changeLocal:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["success","change","changeAll"],["update:modelValue"]),setup(o,{emit:t}){const n=o,l=e.useAttrs(),{t:a,locale:s}=ee.useI18n(),r=e.useModel(o,"modelValue"),d=e.computed(()=>l["value-key"]!=null),f=e.ref(""),$=e.computed(()=>{if(l.remote!==void 0)return n.data;const c=ye(f.value),{data:y,labelValue:L}=n,z=y||b.value;if(c.length==0)return z;const{label:W,labelEn:te}=L;let C=s.value=="en_us"?te||"i18nName":W;return c.length==1?z.filter(X=>X[C].toLowerCase().includes(c[0].toLowerCase())):z.filter(X=>{let se=!1;return se=c.some(de=>X[C].toLowerCase()==de.toLowerCase()),se})}),S=e.computed({get(){return l.multiple==null||r.value==null?!1:r.value.length==$.value.length},set(c){return c}}),x=t,b=e.ref([]),w=async()=>{const{data:c}=await n.api();b.value=[...c],x("success",b)};n.api&&w();function p(c){x("change",c)}const h=n.labelValue.label.split("-"),g=c=>{if(h.length==1){if(n.changeLocal)return a(c[n.labelValue.label]);let y=s.value=="en_us"?c[n.labelValue.labelEn||"i18nName"]:c[n.labelValue.label];return y=y||c[n.labelValue.label],y}else{let y=[];return h.forEach(L=>{y.push(c[L])}),y.join("-")}};function V(c){let y=n.data?n.data:b.value;r.value=c?y.map(L=>d.value?L:L[n.labelValue.value]):[],e.nextTick(()=>{x("change",r.value),x("changeAll",r.value,y)})}function _(c){n.optionClick&&n.optionClick(c),x("change",d.value?c:c[n.labelValue.value])}function I(c){return r.value.length>=n.maxLimit&&!r.value.includes(c[n.labelValue.value])}function B(c){return c.map(y=>({...y,label:g(y),value:d.value?y:y[n.labelValue.value]}))}const v=e.ref([]),Y=n.data?n.data:b.value;v.value=B(Y),e.watch(()=>n.data?n.data:b.value,c=>{var L;const y=B(c);if(y.length!==v.value.length)v.value=y;else{let z=!1;for(let W=0;W<y.length;W++)if(y[W].value!==((L=v.value[W])==null?void 0:L.value)){z=!0;break}z&&(v.value=y)}},{deep:!0});const O=e.computed(()=>v.value);return(c,y)=>{const L=e.resolveComponent("el-checkbox"),z=e.resolveComponent("el-select-v2"),W=e.resolveComponent("el-option"),te=e.resolveComponent("el-select");return e.unref(l).v2!=null?(e.openBlock(),e.createBlock(z,e.mergeProps({key:0,options:O.value,modelValue:r.value,"onUpdate:modelValue":y[1]||(y[1]=C=>r.value=C)},e.unref(l),{filterable:"","collapse-tags":"","collapse-tags-tooltip":"",clearable:"",onChange:p,onClear:p}),e.createSlots({default:e.withCtx(({item:C})=>[e.createElementVNode("div",{onClick:ae=>_(C)},e.toDisplayString(C.label),9,Ct)]),_:2},[e.unref(l).multiple!=null?{name:"header",fn:e.withCtx(()=>[e.renderSlot(c.$slots,"header",{},()=>[e.createVNode(L,{class:"mgl20",modelValue:S.value,"onUpdate:modelValue":y[0]||(y[0]=C=>S.value=C),onChange:V},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0)]),key:"0"}:void 0]),1040,["options","modelValue"])):(e.openBlock(),e.createBlock(te,e.mergeProps({key:1,modelValue:r.value,"onUpdate:modelValue":y[3]||(y[3]=C=>r.value=C),filterable:"","collapse-tags":"","collapse-tags-tooltip":"","filter-method":e.unref(l).remote!=null?void 0:C=>f.value=C,clearable:""},e.unref(l),{onClear:o.optionClick}),{default:e.withCtx(()=>[e.unref(l).multiple!=null&&o.showCheckAll&&o.maxLimit==null?e.renderSlot(c.$slots,"header",{key:0},()=>[e.createVNode(L,{class:"mgl20",modelValue:S.value,"onUpdate:modelValue":y[2]||(y[2]=C=>S.value=C),onChange:V},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(C,ae)=>(e.openBlock(),e.createBlock(W,{key:ae,label:g(C),disabled:e.unref(l).multiple!=null&&o.maxLimit>0?I(C):!1,onClick:e.withModifiers(X=>_(C),["stop"]),value:d.value?C:C[o.labelValue.value]},null,8,["label","disabled","onClick","value"]))),128))]),_:3},16,["modelValue","filter-method","onClear"]))}}},[["__scopeId","data-v-d12f3c20"]]),Wt="",yt=e.defineComponent({props:{name:{tyepe:String,required:!0}}});function bt(o,t,n,l,a,s){const r=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(r,{class:"cmp-icon"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.name)))]),_:1})}const we=ce(yt,[["render",bt],["__scopeId","data-v-733f9daa"]]),wt={__name:"index",emits:["ok","no"],setup(o,{emit:t}){const n=t,l=le.debounce(()=>{n("ok")},500);function a(){n("no")}return(s,r)=>{const d=e.resolveComponent("el-popconfirm");return e.openBlock(),e.createBlock(d,e.mergeProps(s.$attrs,{onConfirm:e.unref(l),onCancel:a}),{reference:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16,["onConfirm"])}}},Jt="",kt=["accept"],xt=ce({__name:"index",props:{accept:{type:String,default:".xlsx,.xls"},loading:{type:Boolean,default:!1}},emits:["fileChange"],setup(o,{emit:t}){const n=t,l=e.ref(null);function a(s){let r=s.target.files[0];n("fileChange",r),l.value.value=null}return(s,r)=>{const d=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("span",null,[e.createVNode(d,{loading:o.loading,class:"mgr10",onClick:r[0]||(r[0]=f=>l.value.click())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.$t("dao-ru")),1)]),_:1},8,["loading"]),e.createElementVNode("input",{onChange:a,ref_key:"input",ref:l,accept:o.accept,style:{position:"absolute",width:"0px",height:"0px",opacity:"0"},type:"file"},null,40,kt)])}}},[["__scopeId","data-v-5f1449ad"]]);function ke(o){let t={};return o.forEach(n=>{const{key:l,type:a,option:s={},value:r,dateType:d="date"}=n;if(l)if(a=="input"&&(s!=null&&s.multiple))t[l]=ye(r);else if(a=="date")if(d.includes("range")){const[f,$]=l;let[S,x]=r||[];S&&d=="daterange"&&(S=he(S).format("YYYY-MM-DD 00:00:00"),x=he(x).format("YYYY-MM-DD 23:59:59")),t[f]=S,t[$]=x}else t[l]=r;else t[l]=r}),t}const Xt="",St={key:0},_t={class:"btns"},$t={class:"left"},Vt={class:"right"},Ne=ce({__name:"index",props:{form:{type:Object,required:!0}},emits:["confirm","reset","visibleChange"],setup(o,{expose:t,emit:n}){const l=o,a=n,s=e.ref(!0),r=e.ref(null),{t:d}=ee.useI18n(),f=e.computed(()=>s.value?d("guan-bi"):d("zhan-kai"));function $(){a("confirm")}function S(g){g.option.onClear&&g.option.onClear(),a("confirm")}function x(){a("reset")}function b(){a("confirm")}function w(){return ke(l.form.items)}const p=le.cloneDeep(l.form.items);function h(){l.form.items.forEach(g=>{const V=p.find(_=>_.key==g.key);V&&(g.value=V.value)})}return t({getPrm:w,reset:h}),(g,V)=>{const _=e.resolveComponent("el-input"),I=e.resolveComponent("el-date-picker"),B=e.resolveComponent("el-form-item"),v=e.resolveComponent("el-form"),Y=e.resolveComponent("el-link"),O=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",{class:"searchBar-container mgt10 mgb10",onKeydown:e.withKeys($,["enter"])},[e.createElementVNode("div",{class:"searchBar",style:e.normalizeStyle({height:s.value?"auto":"42px"})},[e.createVNode(v,{inline:"",model:o.form.data},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.form.items.filter(c=>!c.hidden),c=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c.key},[c.type=="br"?(e.openBlock(),e.createElementBlock("br",St)):(e.openBlock(),e.createBlock(B,{key:1,label:c.name},{default:e.withCtx(()=>{var y,L;return[c.type==="input"?(e.openBlock(),e.createBlock(_,{key:0,modelValue:c.value,"onUpdate:modelValue":z=>c.value=z,class:e.normalizeClass(((y=c.option)==null?void 0:y.class)||"w150"),placeholder:g.$t("qing-shu-ru"),clearable:""},null,8,["modelValue","onUpdate:modelValue","class","placeholder"])):c.type==="custom"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.render),{key:1})):e.createCommentVNode("",!0),c.type==="select"?(e.openBlock(),e.createBlock(Oe,e.mergeProps({key:2,class:((L=c.option)==null?void 0:L.class)||"w150",modelValue:c.value,"onUpdate:modelValue":z=>c.value=z},{ref_for:!0},c.option,{onChange:$,onClear:z=>S(c)}),null,16,["class","modelValue","onUpdate:modelValue","onClear"])):e.createCommentVNode("",!0),c.type==="date"?(e.openBlock(),e.createBlock(I,{key:3,class:e.normalizeClass({datetimerange:"w300",daterange:"w200"}[c.dateType]||"w100"),modelValue:c.value,"onUpdate:modelValue":z=>c.value=z,"value-format":{datetimerange:"YYYY-MM-DD HH:mm:ss",daterange:"YYYY-MM-DD"}[c.dateType]||"YYYY-MM-DD",type:c.dateType||"date",onFocus:z=>r.value=c,onChange:z=>b(),placeholder:g.$t("qing-xuan-ze"),"start-placeholder":g.$t("kai-shi-shi-jian"),"end-placeholder":g.$t("jie-shu-shi-jian")},null,8,["class","modelValue","onUpdate:modelValue","value-format","type","onFocus","onChange","placeholder","start-placeholder","end-placeholder"])):e.createCommentVNode("",!0)]}),_:2},1032,["label"]))],64))),128))]),_:1},8,["model"])],4),e.createElementVNode("div",_t,[e.createElementVNode("div",$t,[e.renderSlot(g.$slots,"table-header-left",{},void 0,!0)]),e.createElementVNode("div",Vt,[e.createVNode(Y,{underline:"never",class:"mgr10",onClick:V[0]||(V[0]=()=>{a("visibleChange",!s.value),s.value=!s.value})},{default:e.withCtx(()=>[e.createVNode(we,{name:s.value?"ArrowUp":"ArrowDown"},null,8,["name"]),e.createTextVNode(" "+e.toDisplayString(f.value),1)]),_:1}),e.createVNode(O,{type:"primary",onClick:$},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.$t("shai-xuan")),1)]),_:1}),e.createVNode(O,{type:"primary",onClick:x},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.$t("chong-zhi")),1)]),_:1}),e.renderSlot(g.$slots,"btn",{},void 0,!0)])])],32)}}},[["__scopeId","data-v-3c0a6716"]]),Me={pageNoKey:"pageNo",pageSizeKey:"pageSize",totalKey:"total",defaultPageSize:10,pageSizes:[10,50,100,500],responseDataKeys:{rows:["rows","records"],total:["totalRows","total"]},showSearch:!1,showPage:!1,showShadow:!1,showCheckBox:!1,enableCellCopy:!0};let ue={...Me};function It(o){ue={...ue,...o,responseDataKeys:{...ue.responseDataKeys,...o.responseDataKeys||{}}}}function qe(){return ue}function Tt(){ue={...Me}}const tn="",vt={class:"center"},Et=ce({__name:"index",props:{id:{type:String,required:!1},loading:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0},searchForm:{type:Object,default:()=>({items:[],selections:[]})},api:{type:Function},data:{type:Array},tableConfig:{type:Object,default:()=>({})}},setup(o,{expose:t}){const{t:n,locale:l}=ee.useI18n(),a=Te.useRoute(),s=qe(),r=o,d=e.ref(!1),f=e.ref([]);r.searchForm.showSearch===void 0&&(r.searchForm.showSearch=s.showSearch),r.searchForm.showPage===void 0&&(r.searchForm.showPage=s.showPage),r.searchForm.showShadow===void 0&&(r.searchForm.showShadow=s.showShadow),r.searchForm.showCheckBox===void 0&&(r.searchForm.showCheckBox=s.showCheckBox),r.searchForm.enableCellCopy===void 0&&(r.searchForm.enableCellCopy=s.enableCellCopy),r.searchForm.selections||(r.searchForm.selections=[]);const $=e.computed(()=>{const u=a.path.replace(/\//g,"-").replace(/^-/,"")||"default-table";return r.id?`listPageId-${u}-${r.id}`:`listPageId-${u}`}),S=le.cloneDeep(r.searchForm.items),x=r.searchForm.pageNoKey||s.pageNoKey,b=r.searchForm.pageSizeKey||s.pageSizeKey,w=e.reactive({[x]:1,[b]:r.searchForm.defaultPageSize||s.defaultPageSize,total:0}),p=e.ref(null),h=e.ref(null),g=e.ref(450),V=le.debounce(()=>{e.nextTick(()=>{if(!h.value)return;const i=h.value.getBoundingClientRect(),k=window.innerHeight,E=i.top,M=100,j=k-E-M,F=200;g.value=Math.max(j,F)})},100),_=()=>{V()},I=()=>{if(!r.searchForm.enableCellCopy)return!1;const u=p.value;if(!u||!u.$el)return!1;const i=u.$el;return i.classList.add("cell-copy-enabled"),i.setAttribute("tabindex","-1"),i.removeEventListener("mousedown",X),i.removeEventListener("mousemove",se),i.removeEventListener("mouseup",de),i.removeEventListener("keydown",$e),i.addEventListener("mousedown",X),i.addEventListener("mousemove",se),i.addEventListener("mouseup",de),i.addEventListener("keydown",$e),!0};e.onMounted(()=>{V(),window.addEventListener("resize",_),r.searchForm.enableCellCopy&&(document.addEventListener("mouseup",Re),document.addEventListener("mousedown",Ue),setTimeout(()=>{I()},500))}),e.onUpdated(()=>{r.searchForm.enableCellCopy&&setTimeout(()=>{I()},500)}),e.onUnmounted(()=>{if(window.removeEventListener("resize",_),r.searchForm.enableCellCopy){document.removeEventListener("mouseup",Re),document.removeEventListener("mousedown",Ue);const u=p.value;if(u&&u.$el){const i=u.$el;i.removeEventListener("mousedown",X),i.removeEventListener("mousemove",se),i.removeEventListener("mouseup",de),i.removeEventListener("keydown",$e)}}});const B=e.computed(()=>te.value.height||g.value);let v;async function Y(u){const{dataFormat:i}=r.tableConfig;u[x]!=1&&(u.nextSearchAfter=v),d.value=!0;const{code:k,data:E={}}=await r.api(u).finally(()=>{d.value=!1,r.searchForm.selections=[]});if(k==200){let M=[];for(const F of s.responseDataKeys.rows)if(E[F]){M=E[F];break}let j=0;for(const F of s.responseDataKeys.total)if(E[F]!==void 0){j=E[F];break}f.value=i?i(M):M,w.total=j,v=E.nextSearchAfter,r.searchForm.enableCellCopy&&e.nextTick(()=>{setTimeout(()=>{I()},100)})}}function O(u={}){const{searchData:i=()=>({})}=r.tableConfig,k=i();Y({...w,...ke(r.searchForm.items),...u,...k})}function c(){const{reset:u}=r.tableConfig;u&&u(),r.searchForm.items.forEach(i=>{const k=S.find(E=>le.isArray(i.key)&&le.isArray(E.key)?i.key.join(",")==E.key.join(","):E.key==i.key);k&&(i.value=k.value)}),O()}r.api&&r.immediate&&O();function y(){return{...w,...ke(r.searchForm.items)}}const L=()=>{const u=p.value;u&&u.clearSort()},z=e.reactive({storage:!0}),W=e.reactive({drag:!0,resizable:!0,maxFixedSize:0}),te=e.computed(()=>{const{customConfig:u,columnConfig:i,...k}=r.tableConfig;return{headerAlign:"left",align:"center",customConfig:{...z,...u},columnConfig:{...W,...i},"virtual-x-config":{enabled:!1,scrollToLeftOnChange:!1},"virtual-y-config":{enabled:!0,gt:100},...k}}),C=e.reactive({isSelecting:!1,startCell:null,endCell:null,selectedCells:[]}),ae=u=>{const i=u.closest(".vxe-body--column");if(!i||i.classList.contains("col--checkbox")||i.classList.contains("col--seq"))return null;const k=i.closest(".vxe-body--row");if(!k)return null;const E=p.value;if(!E)return null;let M=-1;const j=k.getAttribute("data-rowid");if(j!=null)M=parseInt(j,10);else{const D=k.parentElement;M=Array.from(D.querySelectorAll(".vxe-body--row")).indexOf(k)}if(M<0)return null;let F=-1;const J=i.getAttribute("data-colid");if(J&&(F=E.getColumns().findIndex(T=>T.id===J)),F<0){const T=Array.from(k.querySelectorAll(".vxe-body--column")).indexOf(i),A=!!i.closest(".vxe-table--fixed-left-wrapper"),R=!!i.closest(".vxe-table--fixed-right-wrapper"),q=E.getColumns();if(A){const U=q.filter(P=>P.fixed==="left");T<U.length&&(F=q.indexOf(U[T]))}else if(R){const U=q.filter(P=>P.fixed==="right");T<U.length&&(F=q.indexOf(U[T]))}else{const U=r.searchForm.showCheckBox?1:0;F=q.filter(H=>H.fixed==="left").length+T-U}}return F<0?null:{rowIndex:M,colIndex:F,cell:i}},X=u=>{const i=ae(u.target);if(!i){_e();return}C.isSelecting=!0,C.startCell={rowIndex:i.rowIndex,colIndex:i.colIndex},C.endCell={...C.startCell},Pe(),je()},se=u=>{if(!C.isSelecting)return;const i=ae(u.target);i&&(C.endCell={rowIndex:i.rowIndex,colIndex:i.colIndex},Pe(),je())},de=()=>{C.isSelecting=!1},_e=()=>{C.selectedCells=[],C.startCell=null,C.endCell=null;const u=p.value;if(!u)return;u.$el.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(k=>{k.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")})},Pe=()=>{if(!C.startCell||!C.endCell){C.selectedCells=[];return}const u=C.startCell.rowIndex,i=C.endCell.rowIndex,k=C.startCell.colIndex,E=C.endCell.colIndex,M=Math.min(u,i),j=Math.max(u,i),F=Math.min(k,E),J=Math.max(k,E);C.selectedCells=[];for(let D=M;D<=j;D++)for(let T=F;T<=J;T++)C.selectedCells.push({rowIndex:D,colIndex:T})},je=()=>{e.nextTick(()=>{const u=p.value;if(!u)return;const i=u.$el;if(i.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(A=>{A.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")}),C.selectedCells.length===0)return;const k=u.getColumns(),E=C.selectedCells.map(A=>A.rowIndex),M=C.selectedCells.map(A=>A.colIndex),j=Math.min(...E),F=Math.max(...E),J=Math.min(...M),D=Math.max(...M),T=[i.querySelector(".vxe-table--body-wrapper tbody"),i.querySelector(".vxe-table--fixed-left-wrapper tbody"),i.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean);C.selectedCells.forEach(({rowIndex:A,colIndex:R})=>{const q=k[R];if(!q)return;const U=q.fixed==="left",P=q.fixed==="right";for(const H of T){const fe=H.querySelectorAll(".vxe-body--row")[A];if(!fe)continue;const ne=Array.from(fe.querySelectorAll(".vxe-body--column"));let N=null;if(U&&H.closest(".vxe-table--fixed-left-wrapper")){const Z=k.filter(G=>G.fixed==="left").indexOf(q);N=ne[Z]}else if(P&&H.closest(".vxe-table--fixed-right-wrapper")){const Z=k.filter(G=>G.fixed==="right").indexOf(q);N=ne[Z]}else if(!U&&!P&&H.closest(".vxe-table--body-wrapper")){const oe=r.searchForm.showCheckBox?1:0,Z=k.filter(Ve=>Ve.fixed==="left").length,G=R-Z;N=ne[G+oe]}if(N&&!N.classList.contains("col--checkbox")&&!N.classList.contains("col--seq")){N.classList.add("cell-selected"),A===j&&N.classList.add("cell-border-top"),A===F&&N.classList.add("cell-border-bottom"),R===J&&N.classList.add("cell-border-left"),R===D&&N.classList.add("cell-border-right");break}}})})},Ut=async()=>{if(C.selectedCells.length===0)return;const u=p.value;if(!u)return;const i=u.$el,k=u.getColumns(),E=[...new Set(C.selectedCells.map(D=>D.rowIndex))].sort((D,T)=>D-T),M=[...new Set(C.selectedCells.map(D=>D.colIndex))].sort((D,T)=>D-T),j=[i.querySelector(".vxe-table--body-wrapper tbody"),i.querySelector(".vxe-table--fixed-left-wrapper tbody"),i.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean),F=[];E.forEach(D=>{const T=[];M.forEach(A=>{const R=k[A];if(!R){T.push("");return}const q=R.fixed==="left",U=R.fixed==="right";let P="";for(const H of j){const fe=H.querySelectorAll(".vxe-body--row")[D];if(!fe)continue;const ne=Array.from(fe.querySelectorAll(".vxe-body--column"));let N=null;if(q&&H.closest(".vxe-table--fixed-left-wrapper")){const Z=k.filter(G=>G.fixed==="left").indexOf(R);N=ne[Z]}else if(U&&H.closest(".vxe-table--fixed-right-wrapper")){const Z=k.filter(G=>G.fixed==="right").indexOf(R);N=ne[Z]}else if(!q&&!U&&H.closest(".vxe-table--body-wrapper")){const oe=r.searchForm.showCheckBox?1:0,Z=k.filter(Ve=>Ve.fixed==="left").length,G=A-Z;N=ne[G+oe]}if(N&&!N.classList.contains("col--checkbox")&&!N.classList.contains("col--seq")){P=N.innerText||N.textContent||"",P=P.trim(),P=P.replace(/\n/g," ").replace(/\s+/g," ");break}}T.push(P)}),F.push(T.join(" "))});const J=F.join(`
2
+ `);try{await navigator.clipboard.writeText(J)}catch(D){console.error("复制失败:",D)}},$e=u=>{r.searchForm.enableCellCopy&&((u.ctrlKey||u.metaKey)&&u.key==="c"?C.selectedCells.length>0&&(u.preventDefault(),u.stopPropagation(),Ut()):u.key==="Escape"&&_e())},Re=()=>{C.isSelecting=!1},Ue=u=>{const i=p.value;if(!i||!i.$el)return;i.$el.contains(u.target)||_e()},Yt=u=>{w[x]=u,O()},Kt=u=>{w[b]=u,w[x]=1,O()};function Ye(){const u=p.value.getCheckboxRecords();r.searchForm.selections=u}const Ke=u=>{const i=p.value;if(i){i.toggleCheckboxRow(u);const k=p.value.getCheckboxRecords();r.searchForm.selections=k}};return t({tableRef:p,getList:O,getPrm:y,clearSort:L,calculateTableHeight:V}),(u,i)=>{var D;const k=e.resolveComponent("el-button"),E=e.resolveComponent("el-checkbox"),M=e.resolveComponent("el-text"),j=e.resolveComponent("vxe-column"),F=e.resolveComponent("VxeTable"),J=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({box:o.searchForm.showShadow})},[o.searchForm.showSearch?(e.openBlock(),e.createBlock(Ne,{key:0,form:o.searchForm,onReset:c,onConfirm:i[1]||(i[1]=T=>O()),onVisibleChange:e.unref(V)},{btn:e.withCtx(()=>[i[3]||(i[3]=e.createElementVNode("span",{class:"mgr10"},null,-1)),e.renderSlot(u.$slots,"search-bar-btn",{},void 0,!0),e.createVNode(k,{class:"mgl10",round:"",onClick:i[0]||(i[0]=T=>p.value.openCustom())},{default:e.withCtx(()=>[e.createVNode(we,{name:"Tools"})]),_:1})]),_:3},8,["form","onVisibleChange"])):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"table-header-left",{},void 0,!0),e.createElementVNode("div",{ref_key:"tableContentRef",ref:h},[e.createVNode(F,e.mergeProps({id:$.value,ref_key:"tableRef",ref:p,loading:o.loading||d.value,data:o.api?f.value:o.data,border:""},te.value,{height:B.value,onCheckboxChange:Ye,onCheckboxAll:Ye,onSortChange:(D=te.value["sort-config"])==null?void 0:D.sortChange}),{default:e.withCtx(()=>[o.searchForm.showCheckBox==null||o.searchForm.showCheckBox?(e.openBlock(),e.createBlock(j,{key:0,type:"checkbox",width:e.unref(l)=="zh_cn"?80:150,title:u.$t("xu-hao"),fixed:"left"},{checkbox:e.withCtx(({rowIndex:T,row:A,checked:R,disabled:q,indeterminate:U})=>[e.createElementVNode("div",vt,[R?(e.openBlock(),e.createBlock(E,{key:0,checked:!0,disabled:q,size:"default",onClick:e.withModifiers(P=>!q&&Ke(A),["stop"])},null,8,["disabled","onClick"])):(e.openBlock(),e.createBlock(E,{key:1,disabled:q,checked:!1,size:"default",onClick:e.withModifiers(P=>!q&&Ke(A),["stop"])},null,8,["disabled","onClick"])),e.createVNode(M,{type:"info",class:"mgl5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(T+1),1)]),_:2},1024)])]),_:1},8,["width","title"])):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"default",{},void 0,!0)]),_:3},16,["id","loading","data","height","onSortChange"])],512),o.searchForm.showPage?(e.openBlock(),e.createBlock(J,{key:1,"current-page":w[e.unref(x)],"onUpdate:currentPage":i[2]||(i[2]=T=>w[e.unref(x)]=T),class:"myPagination mgt10",background:"",layout:"total, sizes, prev, pager, next",total:w.total,"page-size":w[e.unref(b)],"page-sizes":o.searchForm.pageSizes||e.unref(s).pageSizes,onCurrentChange:Yt,onSizeChange:Kt},null,8,["current-page","total","page-size","page-sizes"])):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-d93cad32"]]),Lt={__name:"index",props:{sheetsConfig:{type:Object,required:!0},fileName:{type:String,required:!0}},setup(o){const t=o;function n(){ze(t.fileName,t.sheetsConfig)}return(l,a)=>{const s=e.resolveComponent("el-link");return e.openBlock(),e.createBlock(s,e.mergeProps({type:"primary",underline:"never"},l.$attrs,{onClick:n}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.$t("xia-zai-dao-ru-mo-ban")),1)]),_:1},16)}}};function Ft(o,t={}){const n=Ce(),l={inForm:!0,required:!0,...t},a={phone:/^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/,password:/(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/,email:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/}[o],{inForm:s,value:r,required:d,msg:f=n("validate.invalidInput")}=l;return s?function($,S,x){if(d){a.test(S)?x():x(new Error(f));return}S&&!a.test(S)?x(new Error(f)):x()}:a.test(r)}class Dt{constructor(t={}){this.config={clientCode:t.clientCode||"one-portal",casServerUrl:`https://one-portal${t.isTest?"-test":""}.joy-group.com/api`,casPortalUrl:`https://one-portal${t.isTest?"-test":""}.joy-group.com`,serviceUrl:t.serviceUrl||window.location.origin+"/cas/callback",tokenKey:t.tokenKey||"one_portal_token",userKey:t.userKey||"one_portal_user",debug:t.debug||!1,autoLogin:t.autoLogin!==!1,loginCallback:t.loginCallback||null,logoutCallback:t.logoutCallback||null,errorCallback:t.errorCallback||null},this.token=null,this.user=null,this.init()}init(){this.log("OnePortal CAS SDK 初始化中..."),this.loadFromStorage();const n=new URLSearchParams(window.location.search).get("ticket");this.isLoggedIn()&&this.config.loginCallback?this.config.loginCallback(this.user,this.token):n?(this.log("检测到ST票据:",n),this.validateTicket(n)):this.config.autoLogin&&!this.isLoggedIn()&&(this.log("用户未登录,准备跳转到CAS登录页面"),this.login())}loadFromStorage(){try{this.token=localStorage.getItem(this.config.tokenKey);const t=localStorage.getItem(this.config.userKey);t&&(this.user=JSON.parse(t)),this.log("从本地存储加载数据:",{token:!!this.token,user:!!this.user})}catch(t){this.log("加载本地存储数据失败:",t)}}saveToStorage(){try{this.token&&localStorage.setItem(this.config.tokenKey,this.token),this.user&&localStorage.setItem(this.config.userKey,JSON.stringify(this.user)),this.log("数据已保存到本地存储")}catch(t){this.log("保存到本地存储失败:",t)}}clearStorage(){try{localStorage.removeItem(this.config.tokenKey),localStorage.removeItem(this.config.userKey),this.log("本地存储已清除")}catch(t){this.log("清除本地存储失败:",t)}}isLoggedIn(){return!!(this.token&&this.user)}getUser(){return this.user}getToken(){return this.token}login(){const t=`${this.config.casPortalUrl}?appCode=${this.config.clientCode}&redirectUrl=${encodeURIComponent(this.config.serviceUrl)}`;this.log("跳转到CAS登录页面:",t),window.location.href=t}async validateTicket(t){try{this.log("验证ST票据:",t);const n=await fetch(`${this.config.casServerUrl}/auth/validateST?ticket=${t}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);const l=await n.json();if(l.success&&l.data)return this.token=l.data.token,this.user=l.data.user,this.saveToStorage(),this.clearTicketFromUrl(),this.log("ST票据验证成功,用户登录成功:",this.user),this.config.loginCallback&&this.config.loginCallback(this.user,this.token),!0;throw new Error(l.message||"ST票据验证失败")}catch(n){return this.log("ST票据验证失败:",n),this.handleError(n),!1}}clearTicketFromUrl(){const t=new URL(window.location);t.searchParams.delete("ticket"),window.history.replaceState({},document.title,t.toString())}async logout(t=!0){try{if(this.log("用户登出"),this.token)try{await fetch(`${this.config.casServerUrl}/auth/logout`,{method:"POST",headers:{AppId:this.config.clientCode,Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"}})}catch(n){this.log("调用服务端登出接口失败:",n)}this.token=null,this.user=null,this.clearStorage(),this.config.logoutCallback&&this.config.logoutCallback(),t&&this.login()}catch(n){this.log("登出失败:",n),this.handleError(n)}}async request(t,n={}){const l={headers:{"Content-Type":"application/json",...n.headers},...n};l.headers.appId=this.config.clientCode,this.token&&(l.headers.Authorization=`Bearer ${this.token}`);try{const a=await fetch(t,l);return a.status===401?(this.log("Token已过期,需要重新登录"),this.logout(),null):a}catch(a){throw this.log("请求失败:",a),a}}async fetchUserInfo(){try{const t=await this.request(`${this.config.casServerUrl}/auth/user`);if(t&&t.ok){const n=await t.json();if(n.success&&n.data)return this.user=n.data,this.saveToStorage(),this.user}return null}catch(t){return this.log("获取用户信息失败:",t),null}}async refreshToken(){this.log("Token刷新功能暂未实现")}handleError(t){this.log("发生错误:",t),this.config.errorCallback&&this.config.errorCallback(t)}log(...t){this.config.debug&&console.log("[OnePortal CAS SDK]",...t)}checkLoginStatus(){return!this.isLoggedIn()&&this.config.autoLogin?(this.login(),!1):this.isLoggedIn()}setConfig(t,n){this.config[t]=n}getConfig(t){return this.config[t]}}function Bt(o,t={}){const l=Object.assign({manual:!1,log:!1,params:null,format:null},t),{manual:a,log:s,params:r={},cb:d,format:f}=l,$=e.ref([]),S=e.ref(!1),x=b=>{const w=b||r;S.value=!0,o(w).then(p=>{const{code:h,data:g,msg:V}=p;if(d){const{records:_,rows:I}=g||{},B=_||I?_||I:g;$.value=xe(B,f),d(p)}if(g){if(g.records!=null||g.rows!=null){const{records:_,rows:I,total:B=0}=g||{};w&&w.total!=null&&(r.total=parseInt(B)),$.value=xe(_||I||[],f)}else $.value=xe(g,f);s&&console.log("useRequest-res",$.value)}}).catch(p=>{d&&(console.log("useRequestErr",p),d({code:500}))}).finally(()=>{S.value=!1})};return a||x(),[S,$,x]}function zt(o){const t=e.ref(o),n=e.ref(""),l=e.ref("");return e.watch(t,a=>{const s=a||["",""];n.value=s[0],l.value=s[1]}),[t,n,l]}function Ot(o){return Object.prototype.toString.call(o).slice(8,-1).toLowerCase()}function xe(o,t){if(!t)return o;if(o instanceof Array)return o.map(l=>{let a={};return t.forEach(s=>a[s]=l[s]),a});let n={};return t.forEach(l=>n[l]=o[l]),n}function Nt(o,t=[]){const{locale:n}=ee.useI18n(),l=e.ref(o());return e.watch([n,...t],()=>{l.value=o()},{immediate:!0}),l}function Mt(o,t="zh_cn",n="en_us"){if(!o)return"-";const l={en_us:n,zh_cn:t},s=pe().global.locale.value;return o[l[s]]||o[t]||"-"}function qt(o,t){let n=Q.mapState;return typeof o=="string"&&o.length>0&&(n=Q.createNamespacedHelpers(o).mapState),Ae(t,n)}function At(o,t){let n=Q.mapGetters;return typeof o=="string"&&o.length>0&&(n=Q.createNamespacedHelpers(o).mapGetters),Ae(t,n)}function Pt(o,t){let n=Q.mapActions;return typeof o=="string"&&o.length>0&&(n=Q.createNamespacedHelpers(o).mapActions),jt(t,n)}function Ae(o,t){const n=Q.useStore(),l=t(o),a={};return Object.keys(l).forEach(s=>{const r=l[s].bind({$store:n});a[s]=e.computed(r)}),a}function jt(o,t){const n=Q.useStore(),l=t(o),a={};return Object.keys(l).forEach(s=>{a[s]=l[s].bind({$store:n})}),a}function Se(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!e.isVNode(o)}function Rt(){ie.VxeUI.renderer.add("Enum",{renderTableDefault(o,t){let n;if([null,void 0].includes(t.row[t.column.field]))return"-";const l=t.row[t.column.field];if(o.type=="tag"){let a;return e.createVNode(e.resolveComponent("el-text"),{type:o.enum.getTag(l)},Se(a=o.enum.getName(l))?a:{default:()=>[a]})}return e.createVNode(e.resolveComponent("el-text"),null,Se(n=o.enum.getName(l))?n:{default:()=>[n]})}}),ie.VxeUI.renderer.add("InputNumber",{renderTableDefault(o,t){return e.createVNode(K.ElInputNumber,e.mergeProps({modelValue:t.row[t.column.field],"onUpdate:modelValue":n=>t.row[t.column.field]=n},o.props,{"step-strictly":!0,"value-on-clear":0}),null)}}),ie.VxeUI.renderer.add("TrueFalse",{renderTableDefault(o,t){const{locale:n}=ee.useI18n();let l=n.value=="zh_cn";return e.createVNode(K.ElText,{type:t.row[t.column.field]?"success":"danger"},{default:()=>[t.row[t.column.field]?l?"是":"YES":l?"否":"NO"]})}}),ie.VxeUI.renderer.add("I18n",{renderTableDefault(o,t){const{locale:n}=ee.useI18n();let l=n.value=="zh_cn"?t.column.field:o.fieldEn;return t.row[l]||t.row[t.column.field]}}),ie.VxeUI.renderer.add("Link",{renderTableDefault(o,t){var d;let n=t.column.field;const l=Te.useRouter(),{multiple:a,to:s}=o;if(!a)return e.createVNode(K.ElLink,{underline:"never",type:"primary",onclick:()=>l.push({path:s,query:{[n]:t.row[n]}})},{default:()=>[t.row[n]]});const r=((d=t.row[n])==null?void 0:d.split(","))||[];return r.map((f,$)=>e.createVNode("span",null,[e.createVNode(K.ElLink,{underline:"never",type:"primary",onclick:()=>l.push({path:s,query:{[n]:f}})},Se(f)?f:{default:()=>[f]}),$<r.length-1?",":""]))}})}m.CmpDictionary=Oe,m.CmpIcon=we,m.ConfrimButton=wt,m.DownExcelTemp=Lt,m.ImportButton=xt,m.LayOutForm=Ze,m.ListPage=Et,m.OnePortalCasSDK=Dt,m.SearchBar=Ne,m.StatusMap=be,m._toRaw=it,m._typeOf=Ot,m.arrToStatusMap=ut,m.arrayToTree=ct,m.checkFileSize=ht,m.creatValidator=Ft,m.createImportFields=gt,m.createListPageId=mt,m.en_us=ge,m.exportExcel=ze,m.getI18n=pe,m.getI18nT=Ce,m.getListPageConfig=qe,m.getLocaleValue=Mt,m.getValueBykey=pt,m.importExcel=Xe,m.messages=De,m.registerVxeRenderers=Rt,m.resetListPageConfig=Tt,m.setListPageConfig=It,m.setupI18n=Be,m.sleep=st,m.stringToArray=ye,m.stripHtmlTags=dt,m.unicode2Str=ft,m.useActions=Pt,m.useDatePicker=zt,m.useGetters=At,m.useI18nReState=Nt,m.useRequest=Bt,m.useState=qt,m.zh_cn=me,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "joy-admin-components",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "main": "./dist/joy-admin-components.umd.js",
5
5
  "module": "./dist/joy-admin-components.es.js",
6
6
  "types": "./src/index.d.ts",
@@ -0,0 +1,35 @@
1
+ import { DefineComponent } from 'vue';
2
+
3
+ /**
4
+ * Layer 组件 - 弹层组件(支持 Dialog 和 Drawer 两种模式)
5
+ * 基于 Element Plus 的 Dialog 和 Drawer 封装
6
+ */
7
+ export interface LayerConfig {
8
+ /** 是否显示弹层 */
9
+ show: boolean;
10
+ /** 弹层类型:'layer' 为 Dialog,'drawer' 为 Drawer */
11
+ type?: 'layer' | 'drawer';
12
+ /** 弹层标题 */
13
+ title?: string;
14
+ /** 弹层宽度,Dialog 默认 500,Drawer 默认 '100%' */
15
+ width?: string | number;
16
+ /** 是否显示底部按钮 */
17
+ showButton?: boolean;
18
+ /** 自定义关闭回调(仅 Drawer 模式有效) */
19
+ onClose?: () => void;
20
+ }
21
+
22
+ export interface LayerProps {
23
+ /** 弹层配置对象 */
24
+ layer: LayerConfig;
25
+ /** 确认按钮加载状态 */
26
+ loading?: boolean;
27
+ }
28
+
29
+ export interface LayerEmits {
30
+ /** 点击确认按钮时触发(已防抖 300ms) */
31
+ (e: 'confirm'): void;
32
+ }
33
+
34
+ declare const Layer: DefineComponent<LayerProps, {}, any, {}, {}, {}, {}, LayerEmits>;
35
+ export default Layer;
package/src/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from './components/ImportButton/index';
7
7
  export * from './components/ListPage/index';
8
8
  export * from './components/SearchBar/index';
9
9
  export * from './components/DownExcelTemp/index';
10
+ export * from './components/layer/index';
10
11
 
11
12
  // 导出工具函数类型
12
13
  export * from './utils/index';
@@ -23,3 +24,4 @@ export { default as ImportButton } from './components/ImportButton/index.vue';
23
24
  export { default as ListPage } from './components/ListPage/index.vue';
24
25
  export { default as SearchBar } from './components/SearchBar/index.vue';
25
26
  export { default as DownExcelTemp } from './components/DownExcelTemp/index.vue';
27
+ export { default as Layer } from './components/layer/index.vue';