joy-admin-components 0.2.67 → 0.2.68

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.
@@ -2,13 +2,13 @@ import { ElForm as _t, ElRow as $t, ElCol as St, ElMessageBox as Lt, ElInputNumb
2
2
  import { defineComponent as nt, ref as P, onMounted as ot, h as ze, mergeModels as Je, useAttrs as It, useModel as Tt, computed as ce, watch as Pe, resolveComponent as q, unref as H, openBlock as I, createBlock as N, mergeProps as ue, createSlots as lt, withCtx as z, createElementVNode as re, toDisplayString as te, renderSlot as ee, createVNode as V, createTextVNode as ne, createCommentVNode as fe, createElementBlock as ie, Fragment as Oe, renderList as at, withModifiers as Ve, nextTick as we, resolveDynamicComponent as st, withKeys as Dt, normalizeStyle as zt, normalizeClass as rt, reactive as Ee, onUpdated as Mt, onUnmounted as Ot, withDirectives as Vt, isVNode as qt } from "vue";
3
3
  import { saveAs as it } from "file-saver";
4
4
  import Ie from "exceljs";
5
- import $e from "dayjs";
5
+ import Se from "dayjs";
6
6
  import { createI18n as At, useI18n as pe } from "vue-i18n";
7
7
  import { debounce as Re, cloneDeep as ct, isArray as Xe } from "lodash";
8
8
  import { useRoute as Ut, useRouter as jt } from "vue-router";
9
9
  import { createNamespacedHelpers as Be, useStore as ut, mapState as Pt, mapGetters as Rt, mapActions as Bt } from "vuex";
10
- import { VxeUI as ke } from "vxe-pc-ui";
11
- const An = nt({
10
+ import { VxeUI as _e } from "vxe-pc-ui";
11
+ const jn = nt({
12
12
  name: "LayOutForm",
13
13
  setup(e, { slots: t, attrs: n, emit: a }) {
14
14
  const s = P(null), o = () => t.default ? t.default().filter((r) => r.type !== Symbol.for("v-cmt")).map((r) => r.type === Symbol.for("v-fgt") ? r.children : r).flat().map(
@@ -285,9 +285,9 @@ function Ye() {
285
285
  function Ce() {
286
286
  return Ye().global.t;
287
287
  }
288
- $e.extend(Kt);
289
- $e.extend(Nt);
290
- async function Un(e, t) {
288
+ Se.extend(Kt);
289
+ Se.extend(Nt);
290
+ async function Pn(e, t) {
291
291
  const { fields: n, range: a = 1 } = t;
292
292
  if (!n) {
293
293
  const l = Ce();
@@ -312,7 +312,7 @@ async function Un(e, t) {
312
312
  const gt = {
313
313
  columnWidth: 30
314
314
  };
315
- async function jn(e, t, n = [], a = {}) {
315
+ async function Rn(e, t, n = [], a = {}) {
316
316
  if (!e || !t)
317
317
  return;
318
318
  const { columnStyle: s } = a, { columnWidth: o } = gt;
@@ -427,7 +427,7 @@ async function tn(e, t) {
427
427
  const Y = C._column._number, E = `${h}_${Y}`;
428
428
  S = y[E] || "";
429
429
  } else
430
- C.result != null ? S = C.result : (M = C.value) != null && M.richText ? S = C.value.richText.reduce((Y, E) => Y + E.text, "") : C.type == 4 && C.value ? S = $e(C.value).utc().format("YYYY-MM-DD HH:mm:ss") : S = C.value;
430
+ C.result != null ? S = C.result : (M = C.value) != null && M.richText ? S = C.value.richText.reduce((Y, E) => Y + E.text, "") : C.type == 4 && C.value ? S = Se(C.value).utc().format("YYYY-MM-DD HH:mm:ss") : S = C.value;
431
431
  S && x == "option" && (S = S.split(Ue)[1]), f[v] = S, S && (c = !1);
432
432
  }), c || i.push(f);
433
433
  }
@@ -512,17 +512,17 @@ function an(e) {
512
512
  return t + n;
513
513
  }
514
514
  }
515
- function Pn(e) {
515
+ function Bn(e) {
516
516
  return new Promise((t) => {
517
517
  setTimeout(() => {
518
518
  t();
519
519
  }, e);
520
520
  });
521
521
  }
522
- function Rn(e) {
522
+ function Yn(e) {
523
523
  return JSON.parse(JSON.stringify(e));
524
524
  }
525
- function Bn(e) {
525
+ function Kn(e) {
526
526
  let t = [], n = {}, a = (s, o) => Object.prototype.hasOwnProperty.call(s, o);
527
527
  for (const s of e) {
528
528
  n[s.id] = {
@@ -574,7 +574,7 @@ class Qe {
574
574
  return this.map.has(t);
575
575
  }
576
576
  }
577
- function Yn(e, t = [], n = "i18nName") {
577
+ function Hn(e, t = [], n = "i18nName") {
578
578
  if (e.length == 0)
579
579
  return new Qe([]);
580
580
  if (t.length < 2) {
@@ -589,30 +589,30 @@ function Yn(e, t = [], n = "i18nName") {
589
589
  });
590
590
  return new Qe(a);
591
591
  }
592
- function Kn(e) {
592
+ function Nn(e) {
593
593
  return e ? e.replace(/<[^>]+>/g, "") : "";
594
594
  }
595
- function Hn(e) {
595
+ function Wn(e) {
596
596
  return e ? (e.includes("\\\\u") && (e = e.replace(/\\/g, "")), e.replace(/\\u[\dA-F]{4}/gi, (t) => String.fromCharCode(parseInt(t.replace(/\\u/g, ""), 16)))) : "";
597
597
  }
598
- function Nn(e, t = 10) {
598
+ function Zn(e, t = 10) {
599
599
  let n = 1048576 * t;
600
600
  return !(e.size > n);
601
601
  }
602
- function Wn(e) {
602
+ function Gn(e) {
603
603
  return Array.from(10).fill(0).map((n, a) => e + "_" + a);
604
604
  }
605
- function Zn(e) {
605
+ function Jn(e) {
606
606
  let t = {};
607
607
  return e.map((n, a) => {
608
608
  let { key: s, option: o, type: l, optionFormater: r } = n, i = an(a);
609
609
  o && !r ? t[s] = `${i}---option` : l === "image" ? t[s] = `${i}---image` : t[s] = i;
610
610
  }), t;
611
611
  }
612
- function Gn(e, t) {
612
+ function Xn(e, t) {
613
613
  return t.split(".").reduce((n, a) => n && n[a], e);
614
614
  }
615
- const Se = (e, t) => {
615
+ const xe = (e, t) => {
616
616
  const n = e.__vccOpts || e;
617
617
  for (const [a, s] of t)
618
618
  n[a] = s;
@@ -832,7 +832,7 @@ const Se = (e, t) => {
832
832
  }, 16, ["modelValue", "filter-method", "onClear"]));
833
833
  };
834
834
  }
835
- }, cn = /* @__PURE__ */ Se(rn, [["__scopeId", "data-v-078a95a6"]]);
835
+ }, cn = /* @__PURE__ */ xe(rn, [["__scopeId", "data-v-078a95a6"]]);
836
836
  const un = nt({
837
837
  props: {
838
838
  name: {
@@ -850,7 +850,8 @@ function dn(e, t, n, a, s, o) {
850
850
  _: 1
851
851
  });
852
852
  }
853
- const yt = /* @__PURE__ */ Se(un, [["render", dn], ["__scopeId", "data-v-733f9daa"]]), Jn = {
853
+ const yt = /* @__PURE__ */ xe(un, [["render", dn], ["__scopeId", "data-v-733f9daa"]]);
854
+ const fn = { class: "confirm-button-wrapper" }, hn = {
854
855
  __name: "index",
855
856
  emits: ["ok", "no"],
856
857
  setup(e, { emit: t }) {
@@ -862,21 +863,21 @@ const yt = /* @__PURE__ */ Se(un, [["render", dn], ["__scopeId", "data-v-733f9da
862
863
  }
863
864
  return (o, l) => {
864
865
  const r = q("el-popconfirm");
865
- return I(), ie("span", null, [
866
+ return I(), ie("span", fn, [
866
867
  V(r, ue(o.$attrs, {
867
868
  onConfirm: H(a),
868
869
  onCancel: s
869
870
  }), {
870
871
  reference: z(() => [
871
- ee(o.$slots, "default")
872
+ ee(o.$slots, "default", {}, void 0, !0)
872
873
  ]),
873
874
  _: 3
874
875
  }, 16, ["onConfirm"])
875
876
  ]);
876
877
  };
877
878
  }
878
- };
879
- const fn = { class: "ImportButton" }, hn = ["accept"], mn = {
879
+ }, Qn = /* @__PURE__ */ xe(hn, [["__scopeId", "data-v-24cb35fd"]]);
880
+ const mn = { class: "ImportButton" }, gn = ["accept"], pn = {
880
881
  __name: "index",
881
882
  props: {
882
883
  accept: {
@@ -909,7 +910,7 @@ const fn = { class: "ImportButton" }, hn = ["accept"], mn = {
909
910
  }
910
911
  return (l, r) => {
911
912
  const i = q("el-button");
912
- return I(), ie("div", fn, [
913
+ return I(), ie("div", mn, [
913
914
  V(i, ue({
914
915
  type: "primary",
915
916
  loading: s.value,
@@ -930,11 +931,11 @@ const fn = { class: "ImportButton" }, hn = ["accept"], mn = {
930
931
  accept: e.accept,
931
932
  style: { position: "absolute", width: "0px", height: "0px", opacity: "0" },
932
933
  type: "file"
933
- }, null, 40, hn)
934
+ }, null, 40, gn)
934
935
  ]);
935
936
  };
936
937
  }
937
- }, Xn = /* @__PURE__ */ Se(mn, [["__scopeId", "data-v-14c83b7c"]]);
938
+ }, eo = /* @__PURE__ */ xe(pn, [["__scopeId", "data-v-ea0a4c60"]]);
938
939
  function je(e) {
939
940
  let t = {};
940
941
  return e.forEach((n) => {
@@ -946,14 +947,14 @@ function je(e) {
946
947
  if (r.includes("range")) {
947
948
  const [i, p] = a;
948
949
  let [m, y] = l || [];
949
- m && r == "daterange" && (m = $e(m).format("YYYY-MM-DD 00:00:00"), y = $e(y).format("YYYY-MM-DD 23:59:59")), t[i] = m, t[p] = y;
950
+ m && r == "daterange" && (m = Se(m).format("YYYY-MM-DD 00:00:00"), y = Se(y).format("YYYY-MM-DD 23:59:59")), t[i] = m, t[p] = y;
950
951
  } else
951
952
  t[a] = l;
952
953
  else
953
954
  t[a] = l;
954
955
  }), t;
955
956
  }
956
- const gn = { key: 0 }, pn = { class: "btns" }, yn = { class: "left" }, vn = { class: "right" }, bn = {
957
+ const yn = { key: 0 }, vn = { class: "btns" }, bn = { class: "left" }, wn = { class: "right" }, Cn = {
957
958
  __name: "index",
958
959
  props: {
959
960
  form: {
@@ -1008,7 +1009,7 @@ const gn = { key: 0 }, pn = { class: "btns" }, yn = { class: "left" }, vn = { cl
1008
1009
  (I(!0), ie(Oe, null, at(e.form.items.filter((_) => !_.hidden), (_) => (I(), ie(Oe, {
1009
1010
  key: _.key
1010
1011
  }, [
1011
- _.type == "br" ? (I(), ie("br", gn)) : (I(), N(M, {
1012
+ _.type == "br" ? (I(), ie("br", yn)) : (I(), N(M, {
1012
1013
  key: 1,
1013
1014
  label: _.name
1014
1015
  }, {
@@ -1054,11 +1055,11 @@ const gn = { key: 0 }, pn = { class: "btns" }, yn = { class: "left" }, vn = { cl
1054
1055
  _: 1
1055
1056
  }, 8, ["model"])
1056
1057
  ], 4),
1057
- re("div", pn, [
1058
- re("div", yn, [
1058
+ re("div", vn, [
1059
+ re("div", bn, [
1059
1060
  ee(w.$slots, "table-header-left", {}, void 0, !0)
1060
1061
  ]),
1061
- re("div", vn, [
1062
+ re("div", wn, [
1062
1063
  V(E, {
1063
1064
  underline: "never",
1064
1065
  class: "mgr10",
@@ -1098,7 +1099,7 @@ const gn = { key: 0 }, pn = { class: "btns" }, yn = { class: "left" }, vn = { cl
1098
1099
  ], 32);
1099
1100
  };
1100
1101
  }
1101
- }, wn = /* @__PURE__ */ Se(bn, [["__scopeId", "data-v-5c7eeed9"]]), vt = {
1102
+ }, xn = /* @__PURE__ */ xe(Cn, [["__scopeId", "data-v-5c7eeed9"]]), vt = {
1102
1103
  // 分页参数名
1103
1104
  pageNoKey: "pageNo",
1104
1105
  // 页码参数名
@@ -1128,24 +1129,24 @@ const gn = { key: 0 }, pn = { class: "btns" }, yn = { class: "left" }, vn = { cl
1128
1129
  enableCellCopy: !0
1129
1130
  // 是否启用单元格选区复制功能
1130
1131
  };
1131
- let _e = { ...vt };
1132
- function Qn(e) {
1133
- _e = {
1134
- ..._e,
1132
+ let $e = { ...vt };
1133
+ function to(e) {
1134
+ $e = {
1135
+ ...$e,
1135
1136
  ...e,
1136
1137
  responseDataKeys: {
1137
- ..._e.responseDataKeys,
1138
+ ...$e.responseDataKeys,
1138
1139
  ...e.responseDataKeys || {}
1139
1140
  }
1140
1141
  };
1141
1142
  }
1142
- function Cn() {
1143
- return _e;
1143
+ function kn() {
1144
+ return $e;
1144
1145
  }
1145
- function eo() {
1146
- _e = { ...vt };
1146
+ function no() {
1147
+ $e = { ...vt };
1147
1148
  }
1148
- const xn = { class: "center" }, kn = {
1149
+ const _n = { class: "center" }, $n = {
1149
1150
  __name: "index",
1150
1151
  props: {
1151
1152
  // 表格id 本地存储列设置时使用,不传则使用路由路径自动生成
@@ -1182,7 +1183,7 @@ const xn = { class: "center" }, kn = {
1182
1183
  }
1183
1184
  },
1184
1185
  setup(e, { expose: t }) {
1185
- const { t: n, locale: a } = pe(), s = Ut(), o = Cn(), l = e, r = P(!1), i = P([]);
1186
+ const { t: n, locale: a } = pe(), s = Ut(), o = kn(), l = e, r = P(!1), i = P([]);
1186
1187
  l.searchForm.showSearch === void 0 && (l.searchForm.showSearch = o.showSearch), l.searchForm.showPage === void 0 && (l.searchForm.showPage = o.showPage), l.searchForm.showShadow === void 0 && (l.searchForm.showShadow = o.showShadow), l.searchForm.showCheckBox === void 0 && (l.searchForm.showCheckBox = o.showCheckBox), l.searchForm.enableCellCopy === void 0 && (l.searchForm.enableCellCopy = o.enableCellCopy), l.searchForm.selections || (l.searchForm.selections = []);
1187
1188
  const p = ce(() => {
1188
1189
  const d = s.path.replace(/\//g, "-").replace(/^-/, "") || "default-table";
@@ -1423,10 +1424,10 @@ const xn = { class: "center" }, kn = {
1423
1424
  return;
1424
1425
  const Q = B.fixed === "left", W = B.fixed === "right";
1425
1426
  for (const oe of F) {
1426
- const xe = oe.querySelectorAll(".vxe-body--row")[K];
1427
- if (!xe)
1427
+ const ke = oe.querySelectorAll(".vxe-body--row")[K];
1428
+ if (!ke)
1428
1429
  continue;
1429
- const me = Array.from(xe.querySelectorAll(".vxe-body--column"));
1430
+ const me = Array.from(ke.querySelectorAll(".vxe-body--column"));
1430
1431
  let j = null;
1431
1432
  if (Q && oe.closest(".vxe-table--fixed-left-wrapper")) {
1432
1433
  const le = L.filter((ae) => ae.fixed === "left").indexOf(B);
@@ -1471,10 +1472,10 @@ const xn = { class: "center" }, kn = {
1471
1472
  const B = X.fixed === "left", Q = X.fixed === "right";
1472
1473
  let W = "";
1473
1474
  for (const oe of Z) {
1474
- const xe = oe.querySelectorAll(".vxe-body--row")[U];
1475
- if (!xe)
1475
+ const ke = oe.querySelectorAll(".vxe-body--row")[U];
1476
+ if (!ke)
1476
1477
  continue;
1477
- const me = Array.from(xe.querySelectorAll(".vxe-body--column"));
1478
+ const me = Array.from(ke.querySelectorAll(".vxe-body--column"));
1478
1479
  let j = null;
1479
1480
  if (B && oe.closest(".vxe-table--fixed-left-wrapper")) {
1480
1481
  const le = L.filter((ae) => ae.fixed === "left").indexOf(X);
@@ -1533,7 +1534,7 @@ const xn = { class: "center" }, kn = {
1533
1534
  return I(), ie("div", {
1534
1535
  class: rt({ box: e.searchForm.showShadow })
1535
1536
  }, [
1536
- e.searchForm.showSearch ? (I(), N(wn, {
1537
+ e.searchForm.showSearch ? (I(), N(xn, {
1537
1538
  key: 0,
1538
1539
  form: e.searchForm,
1539
1540
  onReset: G,
@@ -1583,7 +1584,7 @@ const xn = { class: "center" }, kn = {
1583
1584
  fixed: "left"
1584
1585
  }, {
1585
1586
  checkbox: z(({ rowIndex: F, row: K, checked: X, disabled: B, indeterminate: Q }) => [
1586
- re("div", xn, [
1587
+ re("div", _n, [
1587
1588
  X ? (I(), N(D, {
1588
1589
  key: 0,
1589
1590
  checked: !0,
@@ -1631,7 +1632,7 @@ const xn = { class: "center" }, kn = {
1631
1632
  ], 2);
1632
1633
  };
1633
1634
  }
1634
- }, to = /* @__PURE__ */ Se(kn, [["__scopeId", "data-v-c022c16d"]]), no = {
1635
+ }, oo = /* @__PURE__ */ xe($n, [["__scopeId", "data-v-c022c16d"]]), lo = {
1635
1636
  __name: "index",
1636
1637
  props: {
1637
1638
  sheetsConfig: {
@@ -1663,7 +1664,7 @@ const xn = { class: "center" }, kn = {
1663
1664
  }, 16);
1664
1665
  };
1665
1666
  }
1666
- }, _n = {
1667
+ }, Sn = {
1667
1668
  mounted(e, t) {
1668
1669
  t.value && et(e);
1669
1670
  },
@@ -1747,10 +1748,10 @@ async function et(e) {
1747
1748
  function tt(e) {
1748
1749
  document.removeEventListener("mousedown", e.__mouseDown__), document.removeEventListener("mousemove", e.__mouseMove__), document.removeEventListener("mouseup", e.__mouseUp__), window.removeEventListener("resize", e.__sizeChange__);
1749
1750
  }
1750
- const $n = {
1751
+ const Ln = {
1751
1752
  key: 0,
1752
1753
  class: "drawer-btn"
1753
- }, Sn = { key: 1 }, oo = {
1754
+ }, En = { key: 1 }, ao = {
1754
1755
  __name: "index",
1755
1756
  props: {
1756
1757
  layer: {
@@ -1797,7 +1798,7 @@ const $n = {
1797
1798
  default: z(() => [
1798
1799
  ee(r.$slots, "default"),
1799
1800
  i[2] || (i[2] = re("p", { class: "mgt50" }, null, -1)),
1800
- e.layer.showButton ? (I(), ie("div", $n, [
1801
+ e.layer.showButton ? (I(), ie("div", Ln, [
1801
1802
  ee(r.$slots, "btn", {}, () => [
1802
1803
  V(p, { onClick: l }, {
1803
1804
  default: z(() => [
@@ -1819,7 +1820,7 @@ const $n = {
1819
1820
  ])) : fe("", !0)
1820
1821
  ]),
1821
1822
  _: 3
1822
- }, 8, ["modelValue", "size", "title"])) : Vt((I(), ie("div", Sn, [
1823
+ }, 8, ["modelValue", "size", "title"])) : Vt((I(), ie("div", En, [
1823
1824
  V(y, {
1824
1825
  "close-on-click-modal": !1,
1825
1826
  modelValue: e.layer.show,
@@ -1858,12 +1859,12 @@ const $n = {
1858
1859
  } : void 0
1859
1860
  ]), 1032, ["modelValue", "title", "width"])
1860
1861
  ])), [
1861
- [H(_n), e.layer.show]
1862
+ [H(Sn), e.layer.show]
1862
1863
  ]);
1863
1864
  };
1864
1865
  }
1865
1866
  };
1866
- function lo(e, t = {}) {
1867
+ function so(e, t = {}) {
1867
1868
  const n = Ce(), a = {
1868
1869
  inForm: !0,
1869
1870
  required: !0,
@@ -1881,7 +1882,7 @@ function lo(e, t = {}) {
1881
1882
  m && !s.test(m) ? y(new Error(i)) : y();
1882
1883
  } : s.test(l);
1883
1884
  }
1884
- class ao {
1885
+ class ro {
1885
1886
  constructor(t = {}) {
1886
1887
  this.config = {
1887
1888
  clientCode: t.clientCode || "one-portal",
@@ -2087,7 +2088,7 @@ class ao {
2087
2088
  return this.config[t];
2088
2089
  }
2089
2090
  }
2090
- function so(e, t = {}) {
2091
+ function io(e, t = {}) {
2091
2092
  const a = Object.assign({
2092
2093
  manual: !1,
2093
2094
  // 手动执行
@@ -2118,14 +2119,14 @@ function so(e, t = {}) {
2118
2119
  };
2119
2120
  return s || y(), [m, p, y];
2120
2121
  }
2121
- function ro(e) {
2122
+ function co(e) {
2122
2123
  const t = P(e), n = P(""), a = P("");
2123
2124
  return Pe(t, (s) => {
2124
2125
  const o = s || ["", ""];
2125
2126
  n.value = o[0], a.value = o[1];
2126
2127
  }), [t, n, a];
2127
2128
  }
2128
- function io(e) {
2129
+ function uo(e) {
2129
2130
  return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
2130
2131
  }
2131
2132
  function Me(e, t) {
@@ -2139,7 +2140,7 @@ function Me(e, t) {
2139
2140
  let n = {};
2140
2141
  return t.forEach((a) => n[a] = e[a]), n;
2141
2142
  }
2142
- function co(e, t = []) {
2143
+ function fo(e, t = []) {
2143
2144
  const { locale: n } = pe(), a = P(e());
2144
2145
  return Pe(
2145
2146
  [n, ...t],
@@ -2149,23 +2150,23 @@ function co(e, t = []) {
2149
2150
  { immediate: !0 }
2150
2151
  ), a;
2151
2152
  }
2152
- function uo(e, t = "zh_cn", n = "en_us") {
2153
+ function ho(e, t = "zh_cn", n = "en_us") {
2153
2154
  if (!e)
2154
2155
  return "-";
2155
2156
  const a = { en_us: n, zh_cn: t }, o = Ye().global.locale.value;
2156
2157
  return e[a[o]] || e[t] || "-";
2157
2158
  }
2158
- function fo(e, t) {
2159
+ function mo(e, t) {
2159
2160
  let n = Pt;
2160
2161
  return typeof e == "string" && e.length > 0 && (n = Be(e).mapState), bt(t, n);
2161
2162
  }
2162
- function ho(e, t) {
2163
+ function go(e, t) {
2163
2164
  let n = Rt;
2164
2165
  return typeof e == "string" && e.length > 0 && (n = Be(e).mapGetters), bt(t, n);
2165
2166
  }
2166
- function mo(e, t) {
2167
+ function po(e, t) {
2167
2168
  let n = Bt;
2168
- return typeof e == "string" && e.length > 0 && (n = Be(e).mapActions), Ln(t, n);
2169
+ return typeof e == "string" && e.length > 0 && (n = Be(e).mapActions), Fn(t, n);
2169
2170
  }
2170
2171
  function bt(e, t) {
2171
2172
  const n = ut(), a = t(e), s = {};
@@ -2174,7 +2175,7 @@ function bt(e, t) {
2174
2175
  s[o] = ce(l);
2175
2176
  }), s;
2176
2177
  }
2177
- function Ln(e, t) {
2178
+ function Fn(e, t) {
2178
2179
  const n = ut(), a = t(e), s = {};
2179
2180
  return Object.keys(a).forEach((o) => {
2180
2181
  s[o] = a[o].bind({ $store: n });
@@ -2183,8 +2184,8 @@ function Ln(e, t) {
2183
2184
  function Fe(e) {
2184
2185
  return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !qt(e);
2185
2186
  }
2186
- function go() {
2187
- ke.renderer.add("Enum", {
2187
+ function yo() {
2188
+ _e.renderer.add("Enum", {
2188
2189
  // 默认显示模板
2189
2190
  renderTableDefault(e, t) {
2190
2191
  let n;
@@ -2203,7 +2204,7 @@ function go() {
2203
2204
  default: () => [n]
2204
2205
  });
2205
2206
  }
2206
- }), ke.renderer.add("InputNumber", {
2207
+ }), _e.renderer.add("InputNumber", {
2207
2208
  // 默认显示模板
2208
2209
  renderTableDefault(e, t) {
2209
2210
  return V(Et, ue({
@@ -2214,7 +2215,7 @@ function go() {
2214
2215
  "value-on-clear": 0
2215
2216
  }), null);
2216
2217
  }
2217
- }), ke.renderer.add("TrueFalse", {
2218
+ }), _e.renderer.add("TrueFalse", {
2218
2219
  // 默认显示模板
2219
2220
  renderTableDefault(e, t) {
2220
2221
  const {
@@ -2227,7 +2228,7 @@ function go() {
2227
2228
  default: () => [t.row[t.column.field] ? a ? "是" : "YES" : a ? "否" : "NO"]
2228
2229
  });
2229
2230
  }
2230
- }), ke.renderer.add("I18n", {
2231
+ }), _e.renderer.add("I18n", {
2231
2232
  // 默认显示模板
2232
2233
  renderTableDefault(e, t) {
2233
2234
  const {
@@ -2236,7 +2237,7 @@ function go() {
2236
2237
  let a = n.value == "zh_cn" ? t.column.field : e.fieldEn;
2237
2238
  return t.row[a] || t.row[t.column.field];
2238
2239
  }
2239
- }), ke.renderer.add("Link", {
2240
+ }), _e.renderer.add("Link", {
2240
2241
  // 默认显示模板
2241
2242
  renderTableDefault(e, t) {
2242
2243
  let n = t.column.field;
@@ -2276,47 +2277,47 @@ function go() {
2276
2277
  export {
2277
2278
  cn as CmpDictionary,
2278
2279
  yt as CmpIcon,
2279
- Jn as ConfrimButton,
2280
- no as DownExcelTemp,
2281
- Xn as ImportButton,
2282
- An as LayOutForm,
2283
- oo as Layer,
2284
- to as ListPage,
2285
- ao as OnePortalCasSDK,
2286
- wn as SearchBar,
2280
+ Qn as ConfrimButton,
2281
+ lo as DownExcelTemp,
2282
+ eo as ImportButton,
2283
+ jn as LayOutForm,
2284
+ ao as Layer,
2285
+ oo as ListPage,
2286
+ ro as OnePortalCasSDK,
2287
+ xn as SearchBar,
2287
2288
  Qe as StatusMap,
2288
- Rn as _toRaw,
2289
- io as _typeOf,
2290
- Yn as arrToStatusMap,
2291
- Bn as arrayToTree,
2292
- Nn as checkFileSize,
2293
- lo as creatValidator,
2294
- Zn as createImportFields,
2295
- Wn as createListPageId,
2289
+ Yn as _toRaw,
2290
+ uo as _typeOf,
2291
+ Hn as arrToStatusMap,
2292
+ Kn as arrayToTree,
2293
+ Zn as checkFileSize,
2294
+ so as creatValidator,
2295
+ Jn as createImportFields,
2296
+ Gn as createListPageId,
2296
2297
  Ae as en_us,
2297
- jn as exportExcel,
2298
+ Rn as exportExcel,
2298
2299
  on as exportExcelMuilti,
2299
2300
  Ye as getI18n,
2300
2301
  Ce as getI18nT,
2301
- Cn as getListPageConfig,
2302
- uo as getLocaleValue,
2303
- Gn as getValueBykey,
2304
- Un as importExcel,
2302
+ kn as getListPageConfig,
2303
+ ho as getLocaleValue,
2304
+ Xn as getValueBykey,
2305
+ Pn as importExcel,
2305
2306
  tn as importExcelMuilti,
2306
2307
  Wt as messages,
2307
- go as registerVxeRenderers,
2308
- eo as resetListPageConfig,
2309
- Qn as setListPageConfig,
2308
+ yo as registerVxeRenderers,
2309
+ no as resetListPageConfig,
2310
+ to as setListPageConfig,
2310
2311
  Zt as setupI18n,
2311
- Pn as sleep,
2312
+ Bn as sleep,
2312
2313
  pt as stringToArray,
2313
- Kn as stripHtmlTags,
2314
- Hn as unicode2Str,
2315
- mo as useActions,
2316
- ro as useDatePicker,
2317
- ho as useGetters,
2318
- co as useI18nReState,
2319
- so as useRequest,
2320
- fo as useState,
2314
+ Nn as stripHtmlTags,
2315
+ Wn as unicode2Str,
2316
+ po as useActions,
2317
+ co as useDatePicker,
2318
+ go as useGetters,
2319
+ fo as useI18nReState,
2320
+ io as useRequest,
2321
+ mo as useState,
2321
2322
  qe as zh_cn
2322
2323
  };
@@ -1,2 +1,2 @@
1
- (function(g,Z){typeof exports=="object"&&typeof module<"u"?Z(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"],Z):(g=typeof globalThis<"u"?globalThis:g||self,Z(g.JoyAdminComponents={},g.ElementPlus,g.Vue,g.fileSaver,g.ExcelJS,g.dayjs,g.VueI18n,g._,g.VueRouter,g.Vuex,g.VxeUI))})(this,function(g,Z,e,Le,pe,ue,ee,ne,ve,te,fe){"use strict";const Qe=e.defineComponent({name:"LayOutForm",setup(t,{slots:o,attrs:n,emit:r}){const s=e.ref(null),l=()=>o.default?o.default().filter(i=>i.type!==Symbol.for("v-cmt")).map(i=>i.type===Symbol.for("v-fgt")?i.children:i).flat().map(i=>{var c,C,p,b;return e.h(Z.ElCol,{span:((c=i.props)==null?void 0:c.span)||((p=(C=i.props)==null?void 0:C.colProps)==null?void 0:p.span)||24,...(b=i.props)==null?void 0:b.colProps},{default:()=>i})}):null;e.onMounted(()=>{r("ref",s.value)});function a(){return e.h(Z.ElForm,{...n,ref:s},()=>e.h(Z.ElRow,{gutter:n.gutter??20},{default:()=>l()}))}return a}});var Fe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function De(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Be={exports:{}};(function(t,o){(function(n,r){t.exports=r()})(Fe,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(l,a,i){var c=a.prototype;i.utc=function(d){var w={date:d,utc:!0,args:arguments};return new a(w)},c.utc=function(d){var w=i(this.toDate(),{locale:this.$L,utc:!0});return d?w.add(this.utcOffset(),n):w},c.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var C=c.parse;c.parse=function(d){d.utc&&(this.$u=!0),this.$utils().u(d.$offset)||(this.$offset=d.$offset),C.call(this,d)};var p=c.init;c.init=function(){if(this.$u){var d=this.$d;this.$y=d.getUTCFullYear(),this.$M=d.getUTCMonth(),this.$D=d.getUTCDate(),this.$W=d.getUTCDay(),this.$H=d.getUTCHours(),this.$m=d.getUTCMinutes(),this.$s=d.getUTCSeconds(),this.$ms=d.getUTCMilliseconds()}else p.call(this)};var b=c.utcOffset;c.utcOffset=function(d,w){var k=this.$utils().u;if(k(d))return this.$u?0:k(this.$offset)?b.call(this):this.$offset;if(typeof d=="string"&&(d=function(B){B===void 0&&(B="");var P=B.match(r);if(!P)return null;var L=(""+P[0]).match(s)||["-",0,0],Y=L[0],V=60*+L[1]+ +L[2];return V===0?0:Y==="+"?V:-V}(d),d===null))return this;var S=Math.abs(d)<=16?60*d:d;if(S===0)return this.utc(w);var _=this.clone();if(w)return _.$offset=S,_.$u=!1,_;var T=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(_=this.local().add(S+T,n)).$offset=S,_.$x.$localOffset=T,_};var y=c.format;c.format=function(d){var w=d||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return y.call(this,w)},c.valueOf=function(){var d=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*d},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var h=c.toDate;c.toDate=function(d){return d==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var m=c.diff;c.diff=function(d,w,k){if(d&&this.$u===d.$u)return m.call(this,d,w,k);var S=this.local(),_=i(d).local();return m.call(S,_,w,k)}}})})(Be);var et=Be.exports;const tt=De(et);var Me={exports:{}};(function(t,o){(function(n,r){t.exports=r()})(Fe,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(s,l,a){var i,c=function(y,h,m){m===void 0&&(m={});var d=new Date(y),w=function(k,S){S===void 0&&(S={});var _=S.timeZoneName||"short",T=k+"|"+_,B=r[T];return B||(B=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:k,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:_}),r[T]=B),B}(h,m);return w.formatToParts(d)},C=function(y,h){for(var m=c(y,h),d=[],w=0;w<m.length;w+=1){var k=m[w],S=k.type,_=k.value,T=n[S];T>=0&&(d[T]=parseInt(_,10))}var B=d[3],P=B===24?0:B,L=d[0]+"-"+d[1]+"-"+d[2]+" "+P+":"+d[4]+":"+d[5]+":000",Y=+y;return(a.utc(L).valueOf()-(Y-=Y%1e3))/6e4},p=l.prototype;p.tz=function(y,h){y===void 0&&(y=i);var m,d=this.utcOffset(),w=this.toDate(),k=w.toLocaleString("en-US",{timeZone:y}),S=Math.round((w-new Date(k))/1e3/60),_=15*-Math.round(w.getTimezoneOffset()/15)-S;if(!Number(_))m=this.utcOffset(0,h);else if(m=a(k,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(_,!0),h){var T=m.utcOffset();m=m.add(d-T,"minute")}return m.$x.$timezone=y,m},p.offsetName=function(y){var h=this.$x.$timezone||a.tz.guess(),m=c(this.valueOf(),h,{timeZoneName:y}).find(function(d){return d.type.toLowerCase()==="timezonename"});return m&&m.value};var b=p.startOf;p.startOf=function(y,h){if(!this.$x||!this.$x.$timezone)return b.call(this,y,h);var m=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return b.call(m,y,h).tz(this.$x.$timezone,!0)},a.tz=function(y,h,m){var d=m&&h,w=m||h||i,k=C(+a(),w);if(typeof y!="string")return a(y).tz(w);var S=function(P,L,Y){var V=P-60*L*1e3,x=C(V,Y);if(L===x)return[V,L];var $=C(V-=60*(x-L)*1e3,Y);return x===$?[V,x]:[P-60*Math.min(x,$)*1e3,Math.max(x,$)]}(a.utc(y,d).valueOf(),k,w),_=S[0],T=S[1],B=a(_).utcOffset(T);return B.$x.$timezone=w,B},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(y){i=y}}})})(Me);var ot=Me.exports;const nt=De(ot),ye={"dao-ru":"导入","quan-xuan":"全选","xia-zai-dao-ru-mo-ban":"下载导入模板","xu-hao":"序号","qing-shu-ru":"请输入","qing-xuan-ze":"请选择","kai-shi-shi-jian":"开始时间","jie-shu-shi-jian":"结束时间","shai-xuan":"筛选","chong-zhi":"重置","guan-bi":"关闭","zhan-kai":"展开","qu-xiao":"取消","ti-jiao":"提交","que-ding":"确定","que-ding-guan-bi-ma":"确定关闭吗","xia-zai-dao-ru-mo-ban":"下载导入模板",excel:{fieldsMappingRequired:"请输入列字段映射",invalidInput:"非法输入",invalidOption:"请输入有效选项!",copyFailed:"复制失败",sheetNameTooLong:'Sheet名称 "{0}" 长度超过31个字符,已自动截断为 "{1}"'},validate:{invalidInput:"请输入正确内容"},tools:{keysLengthError:"keys 长度必须大于2 默认前两位为 label value"}},Ce={"dao-ru":"Import","quan-xuan":"Select All","xia-zai-dao-ru-mo-ban":"Download Import Template","xu-hao":"No.","qing-shu-ru":"Please enter","qing-xuan-ze":"Please select","kai-shi-shi-jian":"Start Time","jie-shu-shi-jian":"End Time","shai-xuan":"Filter","chong-zhi":"Reset","guan-bi":"Collapse","zhan-kai":"Expand","qu-xiao":"Cancel","ti-jiao":"Submit","que-ding":"Confirm","que-ding-guan-bi-ma":"Are you sure to close?","xia-zai-dao-ru-mo-ban":"Download Import Template",excel:{fieldsMappingRequired:"Please enter column field mapping",invalidInput:"Invalid input",invalidOption:"Please enter a valid option!",copyFailed:"Copy failed",sheetNameTooLong:'Sheet name "{0}" exceeds 31 characters, automatically truncated to "{1}"'},validate:{invalidInput:"Please enter valid content"},tools:{keysLengthError:"Keys length must be greater than 2, default first two are label and value"}},ze={zh_cn:ye,en_us:Ce};let ie=null;function Oe(t=null){if(t){const{global:o}=t;return o.messages.value.zh_cn?o.mergeLocaleMessage("zh_cn",ye):o.setLocaleMessage("zh_cn",ye),o.messages.value.en_us?o.mergeLocaleMessage("en_us",Ce):o.setLocaleMessage("en_us",Ce),ie=t,t}return ie||(ie=ee.createI18n({legacy:!1,locale:"zh_cn",fallbackLocale:"zh_cn",messages:ze})),ie}function be(){return ie||Oe()}function le(){return be().global.t}ue.extend(tt),ue.extend(nt);async function lt(t,o){const{fields:n,range:r=1}=o;if(!n){const a=le();throw new Error(a("excel.fieldsMappingRequired"))}let s=new pe.Workbook;await s.xlsx.load(t);const l={};return s.eachSheet(function(a,i){const c=[];a.eachRow(function(C,p){if(p>r){let b={},y=!0;Object.keys(n).forEach(h=>{const m=C.getCell(n[h]).value;b[h]=m,m&&(y=!1)}),y||c.push(b)}}),l[a._name]=c}),s=null,l}const Ne={columnWidth:30};async function at(t,o,n=[],r={}){if(!t||!o)return;const{columnStyle:s}=r,{columnWidth:l}=Ne;o.forEach(c=>{c.width=c.width?c.width:l});const{workbook:a,worksheet:i}=rt();i.columns=o,i.addRows(n),s&&await st(a,i,s);try{const c=await a.xlsx.writeBuffer(),C=new File([c],t,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Le.saveAs(C)}catch(c){console.log(c)}}function rt(){const t=new pe.Workbook;t.creator="distributor System",t.lastModifiedBy="distributor System",t.created=new Date,t.modified=new Date,t.lastPrinted=new Date;const o=t.addWorksheet("Sheet1");return{workbook:t,worksheet:o}}async function st(t,o,n){const r=Object.keys(n);for(const s of r){const l=n[s],{type:a}=l;switch(a){case"IMG":await it(t,o,s);break}}}async function it(t,o,n,r){const s=o.getColumn(n),l=s.values;o.getColumn(n).width=20,o.eachRow((a,i)=>{i>1&&(a.height=40)});for(let a=0,i=l.length;a<i;a++){if(a<2)continue;let c=l[a];c&&(o.getCell(s.letter+a).value="",await ct(t,o,c,{width:100,height:50,col:s._number-1,row:a-1}))}}async function ct(t,o,n,r){const{col:s,row:l,width:a,height:i}=r,{success:c,base64:C}=await dt(n,.3);if(c){const p=t.addImage({base64:C,extension:"jpeg"});o.addImage(p,{tl:{col:s,row:l},ext:{width:a,height:i}})}}function dt(t,o=1){const n=new Image;return n.setAttribute("crossOrigin","anonymous"),n.crossOrigin="anonymous",n.src=t,new Promise((r,s)=>{n.onload=()=>{const l=document.createElement("canvas");l.width=n.width,l.height=n.height,l.getContext("2d").drawImage(n,0,0,l.width,l.height),r({success:!0,base64:l.toDataURL("image/jpeg",o)})},n.onerror=()=>{r({success:!1})}})}const ke="---";async function qe(t,o){const{fields:n,range:r=1}=o;if(!n){const a=le();throw new Error(a("excel.fieldsMappingRequired"))}let s=new pe.Workbook;await s.xlsx.load(t);const l={};return s.eachSheet(function(a,i){if(a.state=="visible"){const c=[],C=n[a._name];if(C){let p=Object.values(C).some(y=>y.includes("image")),b={};p&&(a.getImages().forEach(h=>{const{tl:m}=h.range,d=s.model.media.find(w=>w.index===h.imageId);if(d){const w=d.buffer.toString("base64"),k=`data:image/${d.extension};base64,${w}`,S=`${Math.ceil(m.row)}_${Math.ceil(m.col)}`;b[S]?b[S].push(k):b[S]=[k]}}),console.log("withImages-imageMap",b)),a.eachRow(function(y,h){if(h>r){let m={_excelRowNumber:h},d=!0;Object.keys(C).forEach(w=>{var B;let[k,S]=C[w].split(ke);const _=y.getCell(k);let T;if(S=="image"&&p){const P=_._column._number,L=`${h}_${P}`;T=b[L]||""}else _.result!=null?T=_.result:(B=_.value)!=null&&B.richText?T=_.value.richText.reduce((P,L)=>P+L.text,""):_.type==4&&_.value?T=ue(_.value).utc().format("YYYY-MM-DD HH:mm:ss"):T=_.value;T&&S=="option"&&(T=T.split(ke)[1]),m[w]=T,T&&(d=!1)}),d||c.push(m)}}),l[a._name]=c}}}),s=null,l}const ut={date:"yyyy-mm-dd",number:"0",string:"@"};async function Ae(t,o){if(!t||o.length==0)return;const n=ft(o);for(const r of n.worksheets){const{columnWidth:s}=Ne,l=o[r.name];if(!l)continue;const{tableHeader:a,tableData:i}=l;a.forEach(c=>{const{style:C={},required:p}=c,{font:b={}}=C;c.style={...C,font:{...b,color:{argb:p?"FFFF0000":void 0}}}}),r.columns=a,r.addRows(i),a.forEach(c=>{let{header:C,key:p,width:b,option:y,numFmt:h,locked:m,optionFormater:d}=c;const w=r.getColumn(p);if(w.numFmt=ut[h]||h,w.width=b||s,w.protection={locked:m===!0},y){const k=n.addWorksheet(p);k.state="hidden",d||(d=S=>`${S.label}${ke}${S.value}`),k.getColumn(1).values=y.map(d),Array(100).fill("").forEach((S,_)=>{if(_>0){const T=le();r.getCell(`${w.letter}${_}`).dataValidation={type:"list",formulae:[`${p}!$A$1:$A$${y.length}`],showErrorMessage:!0,error:T("excel.invalidInput"),errorStyle:"stop",errorMessage:T("excel.invalidOption")}}})}}),a.some(c=>c.locked)&&await r.protect("6737187214",{selectLockedCells:!0,selectUnlockedCells:!0})}try{const r=await n.xlsx.writeBuffer(),s=new File([r],t,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Le.saveAs(s)}catch(r){console.log(r)}}function ft(t){const o=le(),n=new pe.Workbook;return n.creator="distributor System",n.lastModifiedBy="distributor System",n.created=new Date,n.modified=new Date,n.lastPrinted=new Date,Object.keys(t).sort((s,l)=>{const a=t[s].sort??0,i=t[l].sort??0;return a-i}).forEach(s=>{let l=s,a=!1;/[\\/:*?\[\]]/g.test(s)&&(s=s.replace(/[\\/:*?\[\]]/g,""),a=!0),s.length>31&&(s=s.substring(0,31).trim(),a=!0,console.warn(o("excel.sheetNameTooLong",[l,s]))),a&&(t[s]=t[l],delete t[l]),n.addWorksheet(s)}),n}function mt(t){if(t<26)return String.fromCharCode(65+t);{const o=String.fromCharCode(65+Math.floor((t-26)/26)),n=String.fromCharCode(65+(t-26)%26);return o+n}}function ht(t){return new Promise(o=>{setTimeout(()=>{o()},t)})}function gt(t){return JSON.parse(JSON.stringify(t))}function pt(t){let o=[],n={},r=(s,l)=>Object.prototype.hasOwnProperty.call(s,l);for(const s of t){n[s.id]={...s,children:r(n,s.id)?n[s.id].children:[]};const l=n[s.id];s.pid==-1?o.push(l):(r(n,s.pid)||(n[s.pid]={children:[]}),n[s.pid].children.push(l))}return o}function _e(t,o=" "){return t?t.split(o).filter(n=>n.trim()):[]}class Se{constructor(o,n=["label","value","labelEn"]){this.list=o.map(r=>({...r,label:r[n[0]],labelEn:r[n[2]]??r[n[0]]??"",value:r[n[1]]})),this.map=new Map(this.list.map(r=>[r[n[1]],r]))}getName(o){if(!this.has(o))return"-";const n=be().global.locale,{label:r,labelEn:s}=this.map.get(o);return(n.value=="zh_cn"?r:s)??r??"-"}getTag(o){if(!this.has(o))return"info";const{tag:n="info"}=this.map.get(o);return n}getItem(o){return this.has(o)?this.map.get(o):null}getColor(o){if(!this.has(o))return null;const{color:n}=this.map.get(o);return n}has(o){return this.map.has(o)}}function yt(t,o=[],n="i18nName"){if(t.length==0)return new Se([]);if(o.length<2){const s=le();throw new Error(s("tools.keysLengthError"))}let r=t.map(s=>{let l={};return n&&(l.labelEn=s[n]),o.forEach((a,i)=>{i===0?l.label=s[a]:i===1?l.value=s[a]:l[a]=s[a]}),l});return new Se(r)}function Ct(t){return t?t.replace(/<[^>]+>/g,""):""}function bt(t){return t?(t.includes("\\\\u")&&(t=t.replace(/\\/g,"")),t.replace(/\\u[\dA-F]{4}/gi,o=>String.fromCharCode(parseInt(o.replace(/\\u/g,""),16)))):""}function wt(t,o=10){let n=1048576*o;return!(t.size>n)}function xt(t){return Array.from(10).fill(0).map((n,r)=>t+"_"+r)}function kt(t){let o={};return t.map((n,r)=>{let{key:s,option:l,type:a,optionFormater:i}=n,c=mt(r);l&&!i?o[s]=`${c}---option`:a==="image"?o[s]=`${c}---image`:o[s]=c}),o}function _t(t,o){return o.split(".").reduce((n,r)=>n&&n[r],t)}const ro="",me=(t,o)=>{const n=t.__vccOpts||t;for(const[r,s]of o)n[r]=s;return n},St=["onClick"],Pe=me({__name:"index",props:e.mergeModels({api:{type:Function},showCheckAll:{type:Boolean,default:!0},maxLimit:{type:Number,default:void 0},minLimit:{type:Number,default:void 0},optionClick:{type:Function,default:()=>{}},data:{type:Array},labelValue:{type:Object,default:()=>({label:"label",labelEn:"labelEn",value:"value"})},changeLocal:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["success","change","changeAll"],["update:modelValue"]),setup(t,{emit:o}){const n=t,r=e.useAttrs(),{t:s,locale:l}=ee.useI18n(),a=e.useModel(t,"modelValue"),i=e.computed(()=>r["value-key"]!=null),c=e.ref(""),C=e.computed(()=>{if(r.remote!==void 0)return n.data;const x=_e(c.value),{data:$,labelValue:F}=n,H=$||y.value;if(x.length==0)return H;const{label:E,labelEn:ce}=F;let M=l.value=="en_us"?ce||"i18nName":E;return x.length==1?H.filter(oe=>oe[M].toLowerCase().includes(x[0].toLowerCase())):H.filter(oe=>{let de=!1;return de=x.some(xe=>oe[M].toLowerCase()==xe.toLowerCase()),de})}),p=e.computed({get(){return r.multiple==null||a.value==null?!1:a.value.length==C.value.length},set(x){return x}}),b=o,y=e.ref([]),h=async()=>{const{data:x}=await n.api();y.value=[...x],b("success",y)};n.api&&h();function m(x){b("change",x),d.value&&e.nextTick(()=>{n.optionClick&&n.optionClick(d.value),d.value=null})}const d=e.ref(null);function w(x){d.value=x}const k=n.labelValue.label.split("-"),S=x=>{if(k.length==1){if(n.changeLocal)return s(x[n.labelValue.label]);let $=l.value=="en_us"?x[n.labelValue.labelEn||"i18nName"]:x[n.labelValue.label];return $=$||x[n.labelValue.label],$+""}else{let $=[];return k.forEach(F=>{$.push(x[F])}),$.join("-")}};function _(x){let $=n.data?n.data:y.value;a.value=x?$.map(F=>i.value?F:F[n.labelValue.value]):[],e.nextTick(()=>{b("change",a.value),b("changeAll",a.value,$)})}function T(x){b("change",i.value?x:x[n.labelValue.value]),e.nextTick(()=>{n.optionClick&&n.optionClick(x)})}function B(x){const $=i.value?x:x[n.labelValue.value],F=i.value?a.value.some(H=>H[n.labelValue.value]===x[n.labelValue.value]):a.value.includes($);return!!(n.maxLimit>0&&a.value.length>=n.maxLimit&&!F||n.minLimit>0&&a.value.length===n.minLimit&&F)}function P(x){return x.map($=>({...$,label:S($),value:i.value?$:$[n.labelValue.value]}))}const L=e.ref([]),Y=n.data?n.data:y.value;L.value=P(Y),e.watch(()=>n.data?n.data:y.value,x=>{var F;const $=P(x);if($.length!==L.value.length)L.value=$;else{let H=!1;for(let E=0;E<$.length;E++)if($[E].value!==((F=L.value[E])==null?void 0:F.value)){H=!0;break}H&&(L.value=$)}},{deep:!0});const V=e.computed(()=>r.multiple!==void 0&&(n.maxLimit>0||n.minLimit>0)?L.value.map(x=>({...x,disabled:B(x)})):L.value);return(x,$)=>{const F=e.resolveComponent("el-checkbox"),H=e.resolveComponent("el-select-v2"),E=e.resolveComponent("el-option"),ce=e.resolveComponent("el-select");return e.unref(r).v2!=null?(e.openBlock(),e.createBlock(H,e.mergeProps({key:0,options:V.value,modelValue:a.value,"onUpdate:modelValue":$[1]||($[1]=M=>a.value=M)},e.unref(r),{filterable:"","collapse-tags":"","collapse-tags-tooltip":"",clearable:"",onChange:m,onClear:m}),e.createSlots({default:e.withCtx(({item:M})=>[e.createElementVNode("div",{onClick:ae=>w(M)},e.toDisplayString(M.label),9,St)]),_:2},[e.unref(r).multiple!=null?{name:"header",fn:e.withCtx(()=>[e.renderSlot(x.$slots,"header",{},()=>[e.createVNode(F,{class:"mgl20",modelValue:p.value,"onUpdate:modelValue":$[0]||($[0]=M=>p.value=M),onChange:_},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0)]),key:"0"}:void 0]),1040,["options","modelValue"])):(e.openBlock(),e.createBlock(ce,e.mergeProps({key:1,modelValue:a.value,"onUpdate:modelValue":$[3]||($[3]=M=>a.value=M),filterable:"","collapse-tags":"","collapse-tags-tooltip":"","filter-method":e.unref(r).remote!=null?void 0:M=>c.value=M,clearable:""},e.unref(r),{onClear:t.optionClick}),{default:e.withCtx(()=>[e.unref(r).multiple!=null&&t.showCheckAll&&t.maxLimit==null?e.renderSlot(x.$slots,"header",{key:0},()=>[e.createVNode(F,{class:"mgl20",modelValue:p.value,"onUpdate:modelValue":$[2]||($[2]=M=>p.value=M),onChange:_},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(M,ae)=>(e.openBlock(),e.createBlock(E,{key:ae,label:S(M),disabled:e.unref(r).multiple!=null&&(t.maxLimit>0||t.minLimit>0)?B(M):!1,onClick:e.withModifiers(oe=>T(M),["stop"]),value:i.value?M:M[t.labelValue.value]},null,8,["label","disabled","onClick","value"]))),128))]),_:3},16,["modelValue","filter-method","onClear"]))}}},[["__scopeId","data-v-078a95a6"]]),io="",$t=e.defineComponent({props:{name:{tyepe:String,required:!0}}});function Vt(t,o,n,r,s,l){const a=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(a,{class:"cmp-icon"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.name)))]),_:1})}const $e=me($t,[["render",Vt],["__scopeId","data-v-733f9daa"]]),Et={__name:"index",emits:["ok","no"],setup(t,{emit:o}){const n=o,r=ne.debounce(()=>{n("ok")},500);function s(){n("no")}return(l,a)=>{const i=e.resolveComponent("el-popconfirm");return e.openBlock(),e.createElementBlock("span",null,[e.createVNode(i,e.mergeProps(l.$attrs,{onConfirm:e.unref(r),onCancel:s}),{reference:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16,["onConfirm"])])}}},co="",Tt={class:"ImportButton"},It=["accept"],Lt=me({__name:"index",props:{accept:{type:String,default:".xlsx,.xls"},fields:{type:Object,default:()=>({})},fileChange:{type:Function,required:!0}},emits:["fileChange"],setup(t,{emit:o}){const n=t,r=e.ref(null),s=e.ref(!1);async function l(a){s.value=!0;let i=a.target.files[0];const c=await qe(i,n.fields).catch(()=>{s.value=!1}).finally(()=>{r.value.value=null});await n.fileChange(c).finally(()=>{s.value=!1})}return(a,i)=>{const c=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",Tt,[e.createVNode(c,e.mergeProps({type:"primary",loading:s.value,class:"mgr10",onClick:i[0]||(i[0]=C=>r.value.click())},a.$attrs),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(a.$t("dao-ru")),1)],!0)]),_:3},16,["loading"]),e.createElementVNode("input",{onChange:l,ref_key:"input",ref:r,accept:t.accept,style:{position:"absolute",width:"0px",height:"0px",opacity:"0"},type:"file"},null,40,It)])}}},[["__scopeId","data-v-14c83b7c"]]);function Ve(t){let o={};return t.forEach(n=>{const{key:r,type:s,option:l={},value:a,dateType:i="date"}=n;if(r)if(s=="input"&&(l!=null&&l.multiple))o[r]=_e(a);else if(s=="date")if(i.includes("range")){const[c,C]=r;let[p,b]=a||[];p&&i=="daterange"&&(p=ue(p).format("YYYY-MM-DD 00:00:00"),b=ue(b).format("YYYY-MM-DD 23:59:59")),o[c]=p,o[C]=b}else o[r]=a;else o[r]=a}),o}const fo="",vt={key:0},Ft={class:"btns"},Dt={class:"left"},Bt={class:"right"},je=me({__name:"index",props:{form:{type:Object,required:!0}},emits:["confirm","reset","visibleChange"],setup(t,{expose:o,emit:n}){const r=t,s=n,l=e.ref(!0),a=e.ref(null),{t:i}=ee.useI18n(),c={datetimerange:"YYYY-MM-DD HH:mm:ss",daterange:"YYYY-MM-DD",month:"YYYY-MM"},C=e.computed(()=>l.value?i("guan-bi"):i("zhan-kai"));function p(){s("confirm")}function b(k){k.option.onClear&&k.option.onClear(),s("confirm")}function y(){s("reset")}function h(){s("confirm")}function m(){return Ve(r.form.items)}const d=ne.cloneDeep(r.form.items);function w(){r.form.items.forEach(k=>{const S=d.find(_=>_.key==k.key);S&&(k.value=S.value)})}return o({getPrm:m,reset:w}),(k,S)=>{const _=e.resolveComponent("el-input"),T=e.resolveComponent("el-date-picker"),B=e.resolveComponent("el-form-item"),P=e.resolveComponent("el-form"),L=e.resolveComponent("el-link"),Y=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",{class:"searchBar-container mgt10 mgb10",onKeydown:e.withKeys(p,["enter"])},[e.createElementVNode("div",{class:"searchBar",style:e.normalizeStyle({height:l.value?"auto":"42px"})},[e.createVNode(P,{inline:"",model:t.form.data},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.form.items.filter(V=>!V.hidden),V=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:V.key},[V.type=="br"?(e.openBlock(),e.createElementBlock("br",vt)):(e.openBlock(),e.createBlock(B,{key:1,label:V.name},{default:e.withCtx(()=>{var x,$;return[V.type==="input"?(e.openBlock(),e.createBlock(_,{key:0,modelValue:V.value,"onUpdate:modelValue":F=>V.value=F,class:e.normalizeClass(((x=V.option)==null?void 0:x.class)||"w150"),placeholder:k.$t("qing-shu-ru"),clearable:""},null,8,["modelValue","onUpdate:modelValue","class","placeholder"])):V.type==="custom"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(V.render),{key:1})):e.createCommentVNode("",!0),V.type==="select"?(e.openBlock(),e.createBlock(Pe,e.mergeProps({key:2,class:(($=V.option)==null?void 0:$.class)||"w150",modelValue:V.value,"onUpdate:modelValue":F=>V.value=F},{ref_for:!0},V.option,{onChange:p,onClear:F=>b(V)}),null,16,["class","modelValue","onUpdate:modelValue","onClear"])):e.createCommentVNode("",!0),V.type==="date"?(e.openBlock(),e.createBlock(T,e.mergeProps({key:3,class:{datetimerange:"w300",daterange:"w200"}[V.dateType]||"w100",modelValue:V.value,"onUpdate:modelValue":F=>V.value=F,"value-format":c[V.dateType]||"YYYY-MM-DD",type:V.dateType||"date",onFocus:F=>a.value=V,onChange:F=>h(),placeholder:k.$t("qing-xuan-ze"),"start-placeholder":k.$t("kai-shi-shi-jian"),"end-placeholder":k.$t("jie-shu-shi-jian")},{ref_for:!0},V.option),null,16,["class","modelValue","onUpdate:modelValue","value-format","type","onFocus","onChange","placeholder","start-placeholder","end-placeholder"])):e.createCommentVNode("",!0)]}),_:2},1032,["label"]))],64))),128))]),_:1},8,["model"])],4),e.createElementVNode("div",Ft,[e.createElementVNode("div",Dt,[e.renderSlot(k.$slots,"table-header-left",{},void 0,!0)]),e.createElementVNode("div",Bt,[e.createVNode(L,{underline:"never",class:"mgr10",onClick:S[0]||(S[0]=()=>{s("visibleChange",!l.value),l.value=!l.value})},{default:e.withCtx(()=>[e.createVNode($e,{name:l.value?"ArrowUp":"ArrowDown"},null,8,["name"]),e.createTextVNode(" "+e.toDisplayString(C.value),1)]),_:1}),e.createVNode(Y,{type:"primary",onClick:p},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.$t("shai-xuan")),1)]),_:1}),e.createVNode(Y,{type:"primary",onClick:y},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.$t("chong-zhi")),1)]),_:1}),e.renderSlot(k.$slots,"btn",{},void 0,!0)])])],32)}}},[["__scopeId","data-v-5c7eeed9"]]),Re={pageNoKey:"pageNo",pageSizeKey:"pageSize",totalKey:"total",defaultPageSize:10,pageSizes:[10,50,100,500],responseDataKeys:{rows:["rows","records","list"],total:["totalRows","total"]},showSearch:!1,showPage:!1,showShadow:!1,showCheckBox:!1,enableCellCopy:!0};let he={...Re};function Mt(t){he={...he,...t,responseDataKeys:{...he.responseDataKeys,...t.responseDataKeys||{}}}}function Ue(){return he}function zt(){he={...Re}}const ho="",Ot={class:"center"},Nt=me({__name:"index",props:{id:{type:String,required:!1},loading:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0},searchForm:{type:Object,default:()=>({items:[],selections:[]})},api:{type:Function},data:{type:Array},tableConfig:{type:Object,default:()=>({})}},setup(t,{expose:o}){const{t:n,locale:r}=ee.useI18n(),s=ve.useRoute(),l=Ue(),a=t,i=e.ref(!1),c=e.ref([]);a.searchForm.showSearch===void 0&&(a.searchForm.showSearch=l.showSearch),a.searchForm.showPage===void 0&&(a.searchForm.showPage=l.showPage),a.searchForm.showShadow===void 0&&(a.searchForm.showShadow=l.showShadow),a.searchForm.showCheckBox===void 0&&(a.searchForm.showCheckBox=l.showCheckBox),a.searchForm.enableCellCopy===void 0&&(a.searchForm.enableCellCopy=l.enableCellCopy),a.searchForm.selections||(a.searchForm.selections=[]);const C=e.computed(()=>{const f=s.path.replace(/\//g,"-").replace(/^-/,"")||"default-table";return a.id?`listPageId-${f}-${a.id}`:`listPageId-${f}`}),p=ne.cloneDeep(a.searchForm.items),b=a.searchForm.pageNoKey||l.pageNoKey,y=a.searchForm.pageSizeKey||l.pageSizeKey,h=e.reactive({[b]:1,[y]:a.searchForm.defaultPageSize||l.defaultPageSize,total:0}),m=e.ref(null),d=e.ref(null),w=e.ref(450),k=ne.debounce(()=>{e.nextTick(()=>{if(!d.value)return;const u=d.value.getBoundingClientRect(),I=window.innerHeight,D=u.top,q=100,U=I-D-q,z=200;w.value=Math.max(U,z)})},100),S=()=>{k()},_=()=>{if(!a.searchForm.enableCellCopy&&!l.enableCellCopy)return!1;const f=m.value;if(!f||!f.$el)return!1;const u=f.$el;return u.classList.add("cell-copy-enabled"),u.setAttribute("tabindex","-1"),u.removeEventListener("mousedown",M),u.removeEventListener("mousemove",ae),u.removeEventListener("mouseup",oe),u.removeEventListener("keydown",Te),u.addEventListener("mousedown",M),u.addEventListener("mousemove",ae),u.addEventListener("mouseup",oe),u.addEventListener("keydown",Te),!0};e.onMounted(()=>{k(),window.addEventListener("resize",S),(a.searchForm.enableCellCopy||l.enableCellCopy)&&(document.addEventListener("mouseup",Ze),document.addEventListener("mousedown",Ge),setTimeout(()=>{_()},500))}),e.onUpdated(()=>{(a.searchForm.enableCellCopy||l.enableCellCopy)&&setTimeout(()=>{_()},500)}),e.onUnmounted(()=>{if(window.removeEventListener("resize",S),a.searchForm.enableCellCopy||l.enableCellCopy){document.removeEventListener("mouseup",Ze),document.removeEventListener("mousedown",Ge);const f=m.value;if(f&&f.$el){const u=f.$el;u.removeEventListener("mousedown",M),u.removeEventListener("mousemove",ae),u.removeEventListener("mouseup",oe),u.removeEventListener("keydown",Te)}}});const T=e.computed(()=>H.value.height||w.value);let B;async function P(f){const{dataFormat:u}=a.tableConfig;f[b]!=1&&(f.nextSearchAfter=B),i.value=!0;const{code:I,data:D={}}=await a.api(f).finally(()=>{i.value=!1,a.searchForm.selections=[]});if(I==200){let q=[];for(const z of l.responseDataKeys.rows)if(D[z]){q=D[z];break}let U=0;for(const z of l.responseDataKeys.total)if(D[z]!==void 0){U=D[z];break}c.value=u?u(q):q,h.total=U,B=D.nextSearchAfter,(a.searchForm.enableCellCopy||l.enableCellCopy)&&e.nextTick(()=>{setTimeout(()=>{_()},100)})}}function L(f={}){const{searchData:u=()=>({})}=a.tableConfig,I=u();P({...h,...Ve(a.searchForm.items),...f,...I})}function Y(){const{reset:f}=a.tableConfig;f&&f(),a.searchForm.items.forEach(u=>{const I=p.find(D=>ne.isArray(u.key)&&ne.isArray(D.key)?u.key.join(",")==D.key.join(","):D.key==u.key);I&&(u.value=I.value)}),L()}a.api&&a.immediate&&L();function V(){return{...h,...Ve(a.searchForm.items)}}const x=()=>{const f=m.value;f&&f.clearSort()},$=e.reactive({storage:!0}),F=e.reactive({drag:!0,resizable:!0,maxFixedSize:0}),H=e.computed(()=>{const{customConfig:f,columnConfig:u,...I}=a.tableConfig;return{headerAlign:"left",align:"center",customConfig:{...$,...f},columnConfig:{...F,...u},"virtual-x-config":{enabled:!1,scrollToLeftOnChange:!1},"virtual-y-config":{enabled:!0,gt:100},...I}}),E=e.reactive({isSelecting:!1,startCell:null,endCell:null,selectedCells:[]}),ce=f=>{const u=f.closest(".vxe-body--column");if(!u||u.classList.contains("col--checkbox")||u.classList.contains("col--seq"))return null;const I=u.closest(".vxe-body--row");if(!I)return null;const D=m.value;if(!D)return null;let q=-1;const U=I.getAttribute("data-rowid");if(U!=null)q=parseInt(U,10);else{const O=I.parentElement;q=Array.from(O.querySelectorAll(".vxe-body--row")).indexOf(I)}if(q<0)return null;let z=-1;const Q=u.getAttribute("data-colid");if(Q&&(z=D.getColumns().findIndex(v=>v.id===Q)),z<0){const v=Array.from(I.querySelectorAll(".vxe-body--column")).indexOf(u),j=!!u.closest(".vxe-table--fixed-left-wrapper"),K=!!u.closest(".vxe-table--fixed-right-wrapper"),A=D.getColumns();if(j){const W=A.filter(R=>R.fixed==="left");v<W.length&&(z=A.indexOf(W[v]))}else if(K){const W=A.filter(R=>R.fixed==="right");v<W.length&&(z=A.indexOf(W[v]))}else{const W=a.searchForm.showCheckBox?1:0;z=A.filter(G=>G.fixed==="left").length+v-W}}return z<0?null:{rowIndex:q,colIndex:z,cell:u}},M=f=>{const u=ce(f.target);if(!u){de();return}E.isSelecting=!0,E.startCell={rowIndex:u.rowIndex,colIndex:u.colIndex},E.endCell={...E.startCell},xe(),We()},ae=f=>{if(!E.isSelecting)return;const u=ce(f.target);u&&(E.endCell={rowIndex:u.rowIndex,colIndex:u.colIndex},xe(),We())},oe=()=>{E.isSelecting=!1},de=()=>{E.selectedCells=[],E.startCell=null,E.endCell=null;const f=m.value;if(!f)return;f.$el.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(I=>{I.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")})},xe=()=>{if(!E.startCell||!E.endCell){E.selectedCells=[];return}const f=E.startCell.rowIndex,u=E.endCell.rowIndex,I=E.startCell.colIndex,D=E.endCell.colIndex,q=Math.min(f,u),U=Math.max(f,u),z=Math.min(I,D),Q=Math.max(I,D);E.selectedCells=[];for(let O=q;O<=U;O++)for(let v=z;v<=Q;v++)E.selectedCells.push({rowIndex:O,colIndex:v})},We=()=>{e.nextTick(()=>{const f=m.value;if(!f)return;const u=f.$el;if(u.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(j=>{j.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")}),E.selectedCells.length===0)return;const I=f.getColumns(),D=E.selectedCells.map(j=>j.rowIndex),q=E.selectedCells.map(j=>j.colIndex),U=Math.min(...D),z=Math.max(...D),Q=Math.min(...q),O=Math.max(...q),v=[u.querySelector(".vxe-table--body-wrapper tbody"),u.querySelector(".vxe-table--fixed-left-wrapper tbody"),u.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean);E.selectedCells.forEach(({rowIndex:j,colIndex:K})=>{const A=I[K];if(!A)return;const W=A.fixed==="left",R=A.fixed==="right";for(const G of v){const ge=G.querySelectorAll(".vxe-body--row")[j];if(!ge)continue;const re=Array.from(ge.querySelectorAll(".vxe-body--column"));let N=null;if(W&&G.closest(".vxe-table--fixed-left-wrapper")){const J=I.filter(X=>X.fixed==="left").indexOf(A);N=re[J]}else if(R&&G.closest(".vxe-table--fixed-right-wrapper")){const J=I.filter(X=>X.fixed==="right").indexOf(A);N=re[J]}else if(!W&&!R&&G.closest(".vxe-table--body-wrapper")){const se=a.searchForm.showCheckBox?1:0,J=I.filter(Ie=>Ie.fixed==="left").length,X=K-J;N=re[X+se]}if(N&&!N.classList.contains("col--checkbox")&&!N.classList.contains("col--seq")){N.classList.add("cell-selected"),j===U&&N.classList.add("cell-border-top"),j===z&&N.classList.add("cell-border-bottom"),K===Q&&N.classList.add("cell-border-left"),K===O&&N.classList.add("cell-border-right");break}}})})},oo=async()=>{if(E.selectedCells.length===0)return;const f=m.value;if(!f)return;const u=f.$el,I=f.getColumns(),D=[...new Set(E.selectedCells.map(O=>O.rowIndex))].sort((O,v)=>O-v),q=[...new Set(E.selectedCells.map(O=>O.colIndex))].sort((O,v)=>O-v),U=[u.querySelector(".vxe-table--body-wrapper tbody"),u.querySelector(".vxe-table--fixed-left-wrapper tbody"),u.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean),z=[];D.forEach(O=>{const v=[];q.forEach(j=>{const K=I[j];if(!K){v.push("");return}const A=K.fixed==="left",W=K.fixed==="right";let R="";for(const G of U){const ge=G.querySelectorAll(".vxe-body--row")[O];if(!ge)continue;const re=Array.from(ge.querySelectorAll(".vxe-body--column"));let N=null;if(A&&G.closest(".vxe-table--fixed-left-wrapper")){const J=I.filter(X=>X.fixed==="left").indexOf(K);N=re[J]}else if(W&&G.closest(".vxe-table--fixed-right-wrapper")){const J=I.filter(X=>X.fixed==="right").indexOf(K);N=re[J]}else if(!A&&!W&&G.closest(".vxe-table--body-wrapper")){const se=a.searchForm.showCheckBox?1:0,J=I.filter(Ie=>Ie.fixed==="left").length,X=j-J;N=re[X+se]}if(N&&!N.classList.contains("col--checkbox")&&!N.classList.contains("col--seq")){R=N.innerText||N.textContent||"",R=R.trim(),R=R.replace(/\n/g," ").replace(/\s+/g," ");break}}v.push(R)}),z.push(v.join(" "))});const Q=z.join(`
2
- `);try{await navigator.clipboard.writeText(Q)}catch(O){console.error("复制失败:",O)}},Te=f=>{!a.searchForm.enableCellCopy&&!l.enableCellCopy||((f.ctrlKey||f.metaKey)&&f.key==="c"?E.selectedCells.length>0&&(f.preventDefault(),f.stopPropagation(),oo()):f.key==="Escape"&&de())},Ze=()=>{E.isSelecting=!1},Ge=f=>{const u=m.value;if(!u||!u.$el)return;u.$el.contains(f.target)||de()},no=f=>{h[b]=f,L()},lo=f=>{h[y]=f,h[b]=1,L()};function Je(){const f=m.value.getCheckboxRecords();a.searchForm.selections=f}const Xe=f=>{const u=m.value;if(u){u.toggleCheckboxRow(f);const I=m.value.getCheckboxRecords();a.searchForm.selections=I}};return o({tableRef:m,getList:L,getPrm:V,clearSort:x,calculateTableHeight:k}),(f,u)=>{var O;const I=e.resolveComponent("el-button"),D=e.resolveComponent("el-checkbox"),q=e.resolveComponent("el-text"),U=e.resolveComponent("vxe-column"),z=e.resolveComponent("VxeTable"),Q=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({box:t.searchForm.showShadow})},[t.searchForm.showSearch?(e.openBlock(),e.createBlock(je,{key:0,form:t.searchForm,onReset:Y,onConfirm:u[1]||(u[1]=v=>L()),onVisibleChange:e.unref(k)},{btn:e.withCtx(()=>[u[3]||(u[3]=e.createElementVNode("span",{class:"mgr10"},null,-1)),e.renderSlot(f.$slots,"search-bar-btn",{},void 0,!0),e.createVNode(I,{class:"mgl10",round:"",onClick:u[0]||(u[0]=v=>m.value.openCustom())},{default:e.withCtx(()=>[e.createVNode($e,{name:"Tools"})]),_:1})]),_:3},8,["form","onVisibleChange"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"table-header-left",{},void 0,!0),e.createElementVNode("div",{ref_key:"tableContentRef",ref:d},[e.createVNode(z,e.mergeProps({id:C.value,ref_key:"tableRef",ref:m,loading:t.loading||i.value,data:t.api?c.value:t.data,border:""},H.value,{height:T.value,onCheckboxChange:Je,onCheckboxAll:Je,onSortChange:(O=H.value["sort-config"])==null?void 0:O.sortChange}),{default:e.withCtx(()=>[t.searchForm.showCheckBox==null||t.searchForm.showCheckBox?(e.openBlock(),e.createBlock(U,{key:0,type:"checkbox",width:e.unref(r)=="zh_cn"?80:150,title:f.$t("xu-hao"),fixed:"left"},{checkbox:e.withCtx(({rowIndex:v,row:j,checked:K,disabled:A,indeterminate:W})=>[e.createElementVNode("div",Ot,[K?(e.openBlock(),e.createBlock(D,{key:0,checked:!0,disabled:A,size:"default",onClick:e.withModifiers(R=>!A&&Xe(j),["stop"])},null,8,["disabled","onClick"])):(e.openBlock(),e.createBlock(D,{key:1,disabled:A,checked:!1,size:"default",onClick:e.withModifiers(R=>!A&&Xe(j),["stop"])},null,8,["disabled","onClick"])),e.createVNode(q,{type:"info",class:"mgl5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(v+1),1)]),_:2},1024)])]),_:1},8,["width","title"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"default",{},void 0,!0)]),_:3},16,["id","loading","data","height","onSortChange"])],512),t.searchForm.showPage?(e.openBlock(),e.createBlock(Q,{key:1,"current-page":h[e.unref(b)],"onUpdate:currentPage":u[2]||(u[2]=v=>h[e.unref(b)]=v),class:"myPagination mgt10",background:"",layout:"total, sizes, prev, pager, next",total:h.total,"page-size":h[e.unref(y)],"page-sizes":t.searchForm.pageSizes||e.unref(l).pageSizes,onCurrentChange:no,onSizeChange:lo},null,8,["current-page","total","page-size","page-sizes"])):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-c022c16d"]]),qt={__name:"index",props:{sheetsConfig:{type:Object,required:!0},fileName:{type:String,required:!0}},setup(t){const o=t;function n(){Ae(o.fileName,o.sheetsConfig)}return(r,s)=>{const l=e.resolveComponent("el-link");return e.openBlock(),e.createBlock(l,e.mergeProps({type:"primary",underline:"never"},r.$attrs,{onClick:n}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(r.$t("xia-zai-dao-ru-mo-ban")),1)])]),_:3},16)}}},At={mounted(t,o){o.value&&Ye(t)},updated(t,o){o.value?Ye(t):He(t)},beforeUnmount(t){He(t)}};async function Ye(t){await y();const o=t.querySelector(".el-dialog");if(!o)return;const n=t.querySelector(".el-dialog__header"),r=t.querySelector(".el-overlay");r.style.cssText+="overflow: hidden;",n.style.cursor="move";let s=!1,l={window:{width:0,height:0},dialog:{x:0,y:0,width:0,height:0,marginTop:""},mouse:{x:0,y:0},drag:{x:0,y:0}};n.addEventListener("mousedown",c),document.addEventListener("mousemove",C),document.addEventListener("mouseup",p),window.addEventListener("resize",b);function a(){l.mouse.x-l.drag.x>=l.dialog.x&&(l.drag.x=l.mouse.x-l.dialog.x),l.drag.x-l.mouse.x>=l.window.width-(l.dialog.x+l.dialog.width)&&(l.drag.x=l.mouse.x+l.window.width-l.dialog.x-l.dialog.width),l.mouse.y-l.drag.y>=l.dialog.y&&(l.drag.y=l.mouse.y-l.dialog.y),l.drag.y-l.mouse.y>=l.window.height-(l.dialog.y+l.dialog.height)&&(l.drag.y=l.mouse.y+l.window.height-l.dialog.y-l.dialog.height),i()}function i(){let h=l.drag.y-l.mouse.y+l.dialog.y,m=l.drag.x-l.mouse.x+l.dialog.x;o.style.cssText+=`position: absolute; top: calc(${h}px - ${l.dialog.marginTop}); left: ${m}px;`}function c(h){h.button===0&&(l.window={width:document.body.clientWidth,height:document.body.clientHeight},l.dialog=o.getBoundingClientRect(),l.dialog.marginTop=window.getComputedStyle(o).marginTop,l.mouse={x:h.clientX,y:h.clientY},s=!0)}function C(h){s&&(l.drag={x:h.clientX,y:h.clientY},r.style.userSelect="none",a())}function p(h){r.style.userSelect="auto",s=!1}function b(h){}function y(){return new Promise((h,m)=>{setTimeout(()=>{h()},500)})}t.__mouseDown__=c,t.__mouseUp__=p,t.__mouseMove__=C,t.__sizeChange__=b}function He(t){document.removeEventListener("mousedown",t.__mouseDown__),document.removeEventListener("mousemove",t.__mouseMove__),document.removeEventListener("mouseup",t.__mouseUp__),window.removeEventListener("resize",t.__sizeChange__)}const po="",Pt={key:0,class:"drawer-btn"},jt={key:1},Rt={__name:"index",props:{layer:{type:Object,default:()=>({show:!1,type:"layer",title:"",showButton:!1}),required:!0},loading:{type:Boolean,default:!1}},emits:["confirm"],setup(t,{emit:o}){const n=t,r=o,{t:s}=ee.useI18n(),l=ne.debounce(()=>{r("confirm")},300);async function a(){n.layer.type=="drawer"?n.layer.onClose?n.layer.onClose():n.layer.closeConfirm?await Z.ElMessageBox.confirm(s("que-ding-guan-bi-ma"),{confirmButtonText:s("que-ding"),cancelButtonText:s("qu-xiao"),type:"warning"}).catch(()=>{})=="confirm"&&(n.layer.show=!1):n.layer.show=!1:n.layer.show=!1}return(i,c)=>{const C=e.resolveComponent("el-button"),p=e.resolveComponent("el-drawer"),b=e.resolveComponent("el-dialog");return t.layer.type?(e.openBlock(),e.createBlock(p,{key:0,modelValue:t.layer.show,"onUpdate:modelValue":c[0]||(c[0]=y=>t.layer.show=y),size:t.layer.width||"100%",title:t.layer.title,direction:"rtl","append-to-body":"","before-close":a,class:"drawer-content"},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default"),c[2]||(c[2]=e.createElementVNode("p",{class:"mgt50"},null,-1)),t.layer.showButton?(e.openBlock(),e.createElementBlock("div",Pt,[e.renderSlot(i.$slots,"btn",{},()=>[e.createVNode(C,{onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("qu-xiao")),1)]),_:1}),e.createVNode(C,{type:"primary",loading:t.loading,onClick:e.unref(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("ti-jiao")),1)]),_:1},8,["loading","onClick"])])])):e.createCommentVNode("",!0)]),_:3},8,["modelValue","size","title"])):e.withDirectives((e.openBlock(),e.createElementBlock("div",jt,[e.createVNode(b,{"close-on-click-modal":!1,modelValue:t.layer.show,"onUpdate:modelValue":c[1]||(c[1]=y=>t.layer.show=y),title:t.layer.title,width:t.layer.width||500,center:""},e.createSlots({default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:2},[t.layer.showButton?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(i.$slots,"btn",{},()=>[e.createVNode(C,{onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("qu-xiao")),1)]),_:1}),e.createVNode(C,{type:"primary",onClick:e.unref(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("ti-jiao")),1)]),_:1},8,["onClick"])])]),key:"0"}:void 0]),1032,["modelValue","title","width"])])),[[e.unref(At),t.layer.show]])}}};function Ut(t,o={}){const n=le(),r={inForm:!0,required:!0,...o},s={phone:/^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/,password:/(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/,email:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/}[t],{inForm:l,value:a,required:i,msg:c=n("validate.invalidInput")}=r;return l?function(C,p,b){if(i){s.test(p)?b():b(new Error(c));return}p&&!s.test(p)?b(new Error(c)):b()}:s.test(a)}class Yt{constructor(o={}){this.config={clientCode:o.clientCode||"one-portal",casServerUrl:`https://one-portal${o.isTest?"-test":""}.joy-group.com/api`,casPortalUrl:`https://one-portal${o.isTest?"-test":""}.joy-group.com`,serviceUrl:o.serviceUrl||window.location.origin+"/cas/callback",tokenKey:o.tokenKey||"one_portal_token",userKey:o.userKey||"one_portal_user",debug:o.debug||!1,autoLogin:o.autoLogin!==!1,loginCallback:o.loginCallback||null,logoutCallback:o.logoutCallback||null,errorCallback:o.errorCallback||null},this.token=null,this.user=null,this.init()}init(){this.log("OnePortal CAS SDK 初始化中..."),this.loadFromStorage();const n=new URLSearchParams(window.location.search).get("ticket");this.isLoggedIn()&&this.config.loginCallback?this.config.loginCallback(this.user,this.token):n?(this.log("检测到ST票据:",n),this.validateTicket(n)):this.config.autoLogin&&!this.isLoggedIn()&&(this.log("用户未登录,准备跳转到CAS登录页面"),this.login())}loadFromStorage(){try{this.token=localStorage.getItem(this.config.tokenKey);const o=localStorage.getItem(this.config.userKey);o&&(this.user=JSON.parse(o)),this.log("从本地存储加载数据:",{token:!!this.token,user:!!this.user})}catch(o){this.log("加载本地存储数据失败:",o)}}saveToStorage(){try{this.token&&localStorage.setItem(this.config.tokenKey,this.token),this.user&&localStorage.setItem(this.config.userKey,JSON.stringify(this.user)),this.log("数据已保存到本地存储")}catch(o){this.log("保存到本地存储失败:",o)}}clearStorage(){try{localStorage.removeItem(this.config.tokenKey),localStorage.removeItem(this.config.userKey),this.log("本地存储已清除")}catch(o){this.log("清除本地存储失败:",o)}}isLoggedIn(){return!!(this.token&&this.user)}getUser(){return this.user}getToken(){return this.token}login(){const o=`${this.config.casPortalUrl}?appCode=${this.config.clientCode}&redirectUrl=${encodeURIComponent(this.config.serviceUrl)}`;this.log("跳转到CAS登录页面:",o),window.location.href=o}async validateTicket(o){try{this.log("验证ST票据:",o);const n=await fetch(`${this.config.casServerUrl}/auth/validateST?ticket=${o}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);const r=await n.json();if(r.success&&r.data)return this.token=r.data.token,this.user=r.data.user,this.saveToStorage(),this.clearTicketFromUrl(),this.log("ST票据验证成功,用户登录成功:",this.user),this.config.loginCallback&&this.config.loginCallback(this.user,this.token),!0;throw new Error(r.message||"ST票据验证失败")}catch(n){return this.log("ST票据验证失败:",n),this.handleError(n),!1}}clearTicketFromUrl(){const o=new URL(window.location);o.searchParams.delete("ticket"),window.history.replaceState({},document.title,o.toString())}async logout(o=!0){try{if(this.log("用户登出"),this.token)try{await fetch(`${this.config.casServerUrl}/auth/logout`,{method:"POST",headers:{AppId:this.config.clientCode,Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"}})}catch(n){this.log("调用服务端登出接口失败:",n)}this.token=null,this.user=null,this.clearStorage(),this.config.logoutCallback&&this.config.logoutCallback(),o&&this.login()}catch(n){this.log("登出失败:",n),this.handleError(n)}}async request(o,n={}){const r={headers:{"Content-Type":"application/json",...n.headers},...n};r.headers.appId=this.config.clientCode,this.token&&(r.headers.Authorization=`Bearer ${this.token}`);try{const s=await fetch(o,r);return s.status===401?(this.log("Token已过期,需要重新登录"),this.logout(),null):s}catch(s){throw this.log("请求失败:",s),s}}async fetchUserInfo(){try{const o=await this.request(`${this.config.casServerUrl}/auth/user`);if(o&&o.ok){const n=await o.json();if(n.success&&n.data)return this.user=n.data,this.saveToStorage(),this.user}return null}catch(o){return this.log("获取用户信息失败:",o),null}}async refreshToken(){this.log("Token刷新功能暂未实现")}handleError(o){this.log("发生错误:",o),this.config.errorCallback&&this.config.errorCallback(o)}log(...o){this.config.debug&&console.log("[OnePortal CAS SDK]",...o)}checkLoginStatus(){return!this.isLoggedIn()&&this.config.autoLogin?(this.login(),!1):this.isLoggedIn()}setConfig(o,n){this.config[o]=n}getConfig(o){return this.config[o]}}function Ht(t,o={}){const r=Object.assign({manual:!1,log:!1,params:null,format:null},o),{manual:s,log:l,params:a={},cb:i,format:c}=r,C=e.ref([]),p=e.ref(!1),b=y=>{const h=y||a;p.value=!0,t(h).then(m=>{const{code:d,data:w,msg:k}=m;if(i){const{records:S,rows:_}=w||{},T=S||_?S||_:w;C.value=Ee(T,c),i(m)}if(w){if(w.records!=null||w.rows!=null){const{records:S,rows:_,total:T=0}=w||{};h&&h.total!=null&&(a.total=parseInt(T)),C.value=Ee(S||_||[],c)}else C.value=Ee(w,c);l&&console.log("useRequest-res",C.value)}}).catch(m=>{i&&(console.log("useRequestErr",m),i({code:500}))}).finally(()=>{p.value=!1})};return s||b(),[p,C,b]}function Kt(t){const o=e.ref(t),n=e.ref(""),r=e.ref("");return e.watch(o,s=>{const l=s||["",""];n.value=l[0],r.value=l[1]}),[o,n,r]}function Wt(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function Ee(t,o){if(!o)return t;if(t instanceof Array)return t.map(r=>{let s={};return o.forEach(l=>s[l]=r[l]),s});let n={};return o.forEach(r=>n[r]=t[r]),n}function Zt(t,o=[]){const{locale:n}=ee.useI18n(),r=e.ref(t());return e.watch([n,...o],()=>{r.value=t()},{immediate:!0}),r}function Gt(t,o="zh_cn",n="en_us"){if(!t)return"-";const r={en_us:n,zh_cn:o},l=be().global.locale.value;return t[r[l]]||t[o]||"-"}function Jt(t,o){let n=te.mapState;return typeof t=="string"&&t.length>0&&(n=te.createNamespacedHelpers(t).mapState),Ke(o,n)}function Xt(t,o){let n=te.mapGetters;return typeof t=="string"&&t.length>0&&(n=te.createNamespacedHelpers(t).mapGetters),Ke(o,n)}function Qt(t,o){let n=te.mapActions;return typeof t=="string"&&t.length>0&&(n=te.createNamespacedHelpers(t).mapActions),eo(o,n)}function Ke(t,o){const n=te.useStore(),r=o(t),s={};return Object.keys(r).forEach(l=>{const a=r[l].bind({$store:n});s[l]=e.computed(a)}),s}function eo(t,o){const n=te.useStore(),r=o(t),s={};return Object.keys(r).forEach(l=>{s[l]=r[l].bind({$store:n})}),s}function we(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}function to(){fe.VxeUI.renderer.add("Enum",{renderTableDefault(t,o){let n;if([null,void 0].includes(o.row[o.column.field]))return"-";const r=o.row[o.column.field];if(t.type=="tag"){let s;return e.createVNode(e.resolveComponent("el-text"),{type:t.enum.getTag(r)},we(s=t.enum.getName(r))?s:{default:()=>[s]})}return e.createVNode(e.resolveComponent("el-text"),null,we(n=t.enum.getName(r))?n:{default:()=>[n]})}}),fe.VxeUI.renderer.add("InputNumber",{renderTableDefault(t,o){return e.createVNode(Z.ElInputNumber,e.mergeProps({modelValue:o.row[o.column.field],"onUpdate:modelValue":n=>o.row[o.column.field]=n},t.props,{"step-strictly":!0,"value-on-clear":0}),null)}}),fe.VxeUI.renderer.add("TrueFalse",{renderTableDefault(t,o){const{locale:n}=ee.useI18n();let r=n.value=="zh_cn";return e.createVNode(Z.ElText,{type:o.row[o.column.field]?"success":"danger"},{default:()=>[o.row[o.column.field]?r?"是":"YES":r?"否":"NO"]})}}),fe.VxeUI.renderer.add("I18n",{renderTableDefault(t,o){const{locale:n}=ee.useI18n();let r=n.value=="zh_cn"?o.column.field:t.fieldEn;return o.row[r]||o.row[o.column.field]}}),fe.VxeUI.renderer.add("Link",{renderTableDefault(t,o){let n=o.column.field;const r=ve.useRouter(),{multiple:s,to:l,openType:a="system"}=t,i=o.row[n];function c(C,p){a=="blank"?window.open(C):r.push({path:C,query:{[n]:p}})}if(s){const C=(i==null?void 0:i.split(","))||[];return C.map((p,b)=>e.createVNode("span",null,[e.createVNode(Z.ElLink,{underline:"never",type:"primary",onclick:()=>c(a=="stystem"?l:p,p)},we(p)?p:{default:()=>[p]}),b<C.length-1?",":""]))}return e.createVNode(Z.ElLink,{underline:"never",type:"primary",onclick:()=>c(a=="stystem"?l:i,i)},we(i)?i:{default:()=>[i]})}})}g.CmpDictionary=Pe,g.CmpIcon=$e,g.ConfrimButton=Et,g.DownExcelTemp=qt,g.ImportButton=Lt,g.LayOutForm=Qe,g.Layer=Rt,g.ListPage=Nt,g.OnePortalCasSDK=Yt,g.SearchBar=je,g.StatusMap=Se,g._toRaw=gt,g._typeOf=Wt,g.arrToStatusMap=yt,g.arrayToTree=pt,g.checkFileSize=wt,g.creatValidator=Ut,g.createImportFields=kt,g.createListPageId=xt,g.en_us=Ce,g.exportExcel=at,g.exportExcelMuilti=Ae,g.getI18n=be,g.getI18nT=le,g.getListPageConfig=Ue,g.getLocaleValue=Gt,g.getValueBykey=_t,g.importExcel=lt,g.importExcelMuilti=qe,g.messages=ze,g.registerVxeRenderers=to,g.resetListPageConfig=zt,g.setListPageConfig=Mt,g.setupI18n=Oe,g.sleep=ht,g.stringToArray=_e,g.stripHtmlTags=Ct,g.unicode2Str=bt,g.useActions=Qt,g.useDatePicker=Kt,g.useGetters=Xt,g.useI18nReState=Zt,g.useRequest=Ht,g.useState=Jt,g.zh_cn=ye,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
1
+ (function(g,Z){typeof exports=="object"&&typeof module<"u"?Z(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"],Z):(g=typeof globalThis<"u"?globalThis:g||self,Z(g.JoyAdminComponents={},g.ElementPlus,g.Vue,g.fileSaver,g.ExcelJS,g.dayjs,g.VueI18n,g._,g.VueRouter,g.Vuex,g.VxeUI))})(this,function(g,Z,e,Le,pe,fe,ee,ne,ve,te,me){"use strict";const Qe=e.defineComponent({name:"LayOutForm",setup(t,{slots:o,attrs:n,emit:r}){const s=e.ref(null),l=()=>o.default?o.default().filter(i=>i.type!==Symbol.for("v-cmt")).map(i=>i.type===Symbol.for("v-fgt")?i.children:i).flat().map(i=>{var c,C,p,b;return e.h(Z.ElCol,{span:((c=i.props)==null?void 0:c.span)||((p=(C=i.props)==null?void 0:C.colProps)==null?void 0:p.span)||24,...(b=i.props)==null?void 0:b.colProps},{default:()=>i})}):null;e.onMounted(()=>{r("ref",s.value)});function a(){return e.h(Z.ElForm,{...n,ref:s},()=>e.h(Z.ElRow,{gutter:n.gutter??20},{default:()=>l()}))}return a}});var Fe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function De(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Be={exports:{}};(function(t,o){(function(n,r){t.exports=r()})(Fe,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(l,a,i){var c=a.prototype;i.utc=function(d){var w={date:d,utc:!0,args:arguments};return new a(w)},c.utc=function(d){var w=i(this.toDate(),{locale:this.$L,utc:!0});return d?w.add(this.utcOffset(),n):w},c.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var C=c.parse;c.parse=function(d){d.utc&&(this.$u=!0),this.$utils().u(d.$offset)||(this.$offset=d.$offset),C.call(this,d)};var p=c.init;c.init=function(){if(this.$u){var d=this.$d;this.$y=d.getUTCFullYear(),this.$M=d.getUTCMonth(),this.$D=d.getUTCDate(),this.$W=d.getUTCDay(),this.$H=d.getUTCHours(),this.$m=d.getUTCMinutes(),this.$s=d.getUTCSeconds(),this.$ms=d.getUTCMilliseconds()}else p.call(this)};var b=c.utcOffset;c.utcOffset=function(d,w){var k=this.$utils().u;if(k(d))return this.$u?0:k(this.$offset)?b.call(this):this.$offset;if(typeof d=="string"&&(d=function(B){B===void 0&&(B="");var P=B.match(r);if(!P)return null;var L=(""+P[0]).match(s)||["-",0,0],Y=L[0],V=60*+L[1]+ +L[2];return V===0?0:Y==="+"?V:-V}(d),d===null))return this;var S=Math.abs(d)<=16?60*d:d;if(S===0)return this.utc(w);var _=this.clone();if(w)return _.$offset=S,_.$u=!1,_;var T=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(_=this.local().add(S+T,n)).$offset=S,_.$x.$localOffset=T,_};var y=c.format;c.format=function(d){var w=d||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return y.call(this,w)},c.valueOf=function(){var d=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*d},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var h=c.toDate;c.toDate=function(d){return d==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var m=c.diff;c.diff=function(d,w,k){if(d&&this.$u===d.$u)return m.call(this,d,w,k);var S=this.local(),_=i(d).local();return m.call(S,_,w,k)}}})})(Be);var et=Be.exports;const tt=De(et);var Me={exports:{}};(function(t,o){(function(n,r){t.exports=r()})(Fe,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(s,l,a){var i,c=function(y,h,m){m===void 0&&(m={});var d=new Date(y),w=function(k,S){S===void 0&&(S={});var _=S.timeZoneName||"short",T=k+"|"+_,B=r[T];return B||(B=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:k,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:_}),r[T]=B),B}(h,m);return w.formatToParts(d)},C=function(y,h){for(var m=c(y,h),d=[],w=0;w<m.length;w+=1){var k=m[w],S=k.type,_=k.value,T=n[S];T>=0&&(d[T]=parseInt(_,10))}var B=d[3],P=B===24?0:B,L=d[0]+"-"+d[1]+"-"+d[2]+" "+P+":"+d[4]+":"+d[5]+":000",Y=+y;return(a.utc(L).valueOf()-(Y-=Y%1e3))/6e4},p=l.prototype;p.tz=function(y,h){y===void 0&&(y=i);var m,d=this.utcOffset(),w=this.toDate(),k=w.toLocaleString("en-US",{timeZone:y}),S=Math.round((w-new Date(k))/1e3/60),_=15*-Math.round(w.getTimezoneOffset()/15)-S;if(!Number(_))m=this.utcOffset(0,h);else if(m=a(k,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(_,!0),h){var T=m.utcOffset();m=m.add(d-T,"minute")}return m.$x.$timezone=y,m},p.offsetName=function(y){var h=this.$x.$timezone||a.tz.guess(),m=c(this.valueOf(),h,{timeZoneName:y}).find(function(d){return d.type.toLowerCase()==="timezonename"});return m&&m.value};var b=p.startOf;p.startOf=function(y,h){if(!this.$x||!this.$x.$timezone)return b.call(this,y,h);var m=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return b.call(m,y,h).tz(this.$x.$timezone,!0)},a.tz=function(y,h,m){var d=m&&h,w=m||h||i,k=C(+a(),w);if(typeof y!="string")return a(y).tz(w);var S=function(P,L,Y){var V=P-60*L*1e3,x=C(V,Y);if(L===x)return[V,L];var $=C(V-=60*(x-L)*1e3,Y);return x===$?[V,x]:[P-60*Math.min(x,$)*1e3,Math.max(x,$)]}(a.utc(y,d).valueOf(),k,w),_=S[0],T=S[1],B=a(_).utcOffset(T);return B.$x.$timezone=w,B},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(y){i=y}}})})(Me);var ot=Me.exports;const nt=De(ot),ye={"dao-ru":"导入","quan-xuan":"全选","xia-zai-dao-ru-mo-ban":"下载导入模板","xu-hao":"序号","qing-shu-ru":"请输入","qing-xuan-ze":"请选择","kai-shi-shi-jian":"开始时间","jie-shu-shi-jian":"结束时间","shai-xuan":"筛选","chong-zhi":"重置","guan-bi":"关闭","zhan-kai":"展开","qu-xiao":"取消","ti-jiao":"提交","que-ding":"确定","que-ding-guan-bi-ma":"确定关闭吗","xia-zai-dao-ru-mo-ban":"下载导入模板",excel:{fieldsMappingRequired:"请输入列字段映射",invalidInput:"非法输入",invalidOption:"请输入有效选项!",copyFailed:"复制失败",sheetNameTooLong:'Sheet名称 "{0}" 长度超过31个字符,已自动截断为 "{1}"'},validate:{invalidInput:"请输入正确内容"},tools:{keysLengthError:"keys 长度必须大于2 默认前两位为 label value"}},Ce={"dao-ru":"Import","quan-xuan":"Select All","xia-zai-dao-ru-mo-ban":"Download Import Template","xu-hao":"No.","qing-shu-ru":"Please enter","qing-xuan-ze":"Please select","kai-shi-shi-jian":"Start Time","jie-shu-shi-jian":"End Time","shai-xuan":"Filter","chong-zhi":"Reset","guan-bi":"Collapse","zhan-kai":"Expand","qu-xiao":"Cancel","ti-jiao":"Submit","que-ding":"Confirm","que-ding-guan-bi-ma":"Are you sure to close?","xia-zai-dao-ru-mo-ban":"Download Import Template",excel:{fieldsMappingRequired:"Please enter column field mapping",invalidInput:"Invalid input",invalidOption:"Please enter a valid option!",copyFailed:"Copy failed",sheetNameTooLong:'Sheet name "{0}" exceeds 31 characters, automatically truncated to "{1}"'},validate:{invalidInput:"Please enter valid content"},tools:{keysLengthError:"Keys length must be greater than 2, default first two are label and value"}},ze={zh_cn:ye,en_us:Ce};let ie=null;function Oe(t=null){if(t){const{global:o}=t;return o.messages.value.zh_cn?o.mergeLocaleMessage("zh_cn",ye):o.setLocaleMessage("zh_cn",ye),o.messages.value.en_us?o.mergeLocaleMessage("en_us",Ce):o.setLocaleMessage("en_us",Ce),ie=t,t}return ie||(ie=ee.createI18n({legacy:!1,locale:"zh_cn",fallbackLocale:"zh_cn",messages:ze})),ie}function be(){return ie||Oe()}function le(){return be().global.t}fe.extend(tt),fe.extend(nt);async function lt(t,o){const{fields:n,range:r=1}=o;if(!n){const a=le();throw new Error(a("excel.fieldsMappingRequired"))}let s=new pe.Workbook;await s.xlsx.load(t);const l={};return s.eachSheet(function(a,i){const c=[];a.eachRow(function(C,p){if(p>r){let b={},y=!0;Object.keys(n).forEach(h=>{const m=C.getCell(n[h]).value;b[h]=m,m&&(y=!1)}),y||c.push(b)}}),l[a._name]=c}),s=null,l}const Ne={columnWidth:30};async function at(t,o,n=[],r={}){if(!t||!o)return;const{columnStyle:s}=r,{columnWidth:l}=Ne;o.forEach(c=>{c.width=c.width?c.width:l});const{workbook:a,worksheet:i}=rt();i.columns=o,i.addRows(n),s&&await st(a,i,s);try{const c=await a.xlsx.writeBuffer(),C=new File([c],t,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Le.saveAs(C)}catch(c){console.log(c)}}function rt(){const t=new pe.Workbook;t.creator="distributor System",t.lastModifiedBy="distributor System",t.created=new Date,t.modified=new Date,t.lastPrinted=new Date;const o=t.addWorksheet("Sheet1");return{workbook:t,worksheet:o}}async function st(t,o,n){const r=Object.keys(n);for(const s of r){const l=n[s],{type:a}=l;switch(a){case"IMG":await it(t,o,s);break}}}async function it(t,o,n,r){const s=o.getColumn(n),l=s.values;o.getColumn(n).width=20,o.eachRow((a,i)=>{i>1&&(a.height=40)});for(let a=0,i=l.length;a<i;a++){if(a<2)continue;let c=l[a];c&&(o.getCell(s.letter+a).value="",await ct(t,o,c,{width:100,height:50,col:s._number-1,row:a-1}))}}async function ct(t,o,n,r){const{col:s,row:l,width:a,height:i}=r,{success:c,base64:C}=await dt(n,.3);if(c){const p=t.addImage({base64:C,extension:"jpeg"});o.addImage(p,{tl:{col:s,row:l},ext:{width:a,height:i}})}}function dt(t,o=1){const n=new Image;return n.setAttribute("crossOrigin","anonymous"),n.crossOrigin="anonymous",n.src=t,new Promise((r,s)=>{n.onload=()=>{const l=document.createElement("canvas");l.width=n.width,l.height=n.height,l.getContext("2d").drawImage(n,0,0,l.width,l.height),r({success:!0,base64:l.toDataURL("image/jpeg",o)})},n.onerror=()=>{r({success:!1})}})}const ke="---";async function qe(t,o){const{fields:n,range:r=1}=o;if(!n){const a=le();throw new Error(a("excel.fieldsMappingRequired"))}let s=new pe.Workbook;await s.xlsx.load(t);const l={};return s.eachSheet(function(a,i){if(a.state=="visible"){const c=[],C=n[a._name];if(C){let p=Object.values(C).some(y=>y.includes("image")),b={};p&&(a.getImages().forEach(h=>{const{tl:m}=h.range,d=s.model.media.find(w=>w.index===h.imageId);if(d){const w=d.buffer.toString("base64"),k=`data:image/${d.extension};base64,${w}`,S=`${Math.ceil(m.row)}_${Math.ceil(m.col)}`;b[S]?b[S].push(k):b[S]=[k]}}),console.log("withImages-imageMap",b)),a.eachRow(function(y,h){if(h>r){let m={_excelRowNumber:h},d=!0;Object.keys(C).forEach(w=>{var B;let[k,S]=C[w].split(ke);const _=y.getCell(k);let T;if(S=="image"&&p){const P=_._column._number,L=`${h}_${P}`;T=b[L]||""}else _.result!=null?T=_.result:(B=_.value)!=null&&B.richText?T=_.value.richText.reduce((P,L)=>P+L.text,""):_.type==4&&_.value?T=fe(_.value).utc().format("YYYY-MM-DD HH:mm:ss"):T=_.value;T&&S=="option"&&(T=T.split(ke)[1]),m[w]=T,T&&(d=!1)}),d||c.push(m)}}),l[a._name]=c}}}),s=null,l}const ut={date:"yyyy-mm-dd",number:"0",string:"@"};async function Ae(t,o){if(!t||o.length==0)return;const n=ft(o);for(const r of n.worksheets){const{columnWidth:s}=Ne,l=o[r.name];if(!l)continue;const{tableHeader:a,tableData:i}=l;a.forEach(c=>{const{style:C={},required:p}=c,{font:b={}}=C;c.style={...C,font:{...b,color:{argb:p?"FFFF0000":void 0}}}}),r.columns=a,r.addRows(i),a.forEach(c=>{let{header:C,key:p,width:b,option:y,numFmt:h,locked:m,optionFormater:d}=c;const w=r.getColumn(p);if(w.numFmt=ut[h]||h,w.width=b||s,w.protection={locked:m===!0},y){const k=n.addWorksheet(p);k.state="hidden",d||(d=S=>`${S.label}${ke}${S.value}`),k.getColumn(1).values=y.map(d),Array(100).fill("").forEach((S,_)=>{if(_>0){const T=le();r.getCell(`${w.letter}${_}`).dataValidation={type:"list",formulae:[`${p}!$A$1:$A$${y.length}`],showErrorMessage:!0,error:T("excel.invalidInput"),errorStyle:"stop",errorMessage:T("excel.invalidOption")}}})}}),a.some(c=>c.locked)&&await r.protect("6737187214",{selectLockedCells:!0,selectUnlockedCells:!0})}try{const r=await n.xlsx.writeBuffer(),s=new File([r],t,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Le.saveAs(s)}catch(r){console.log(r)}}function ft(t){const o=le(),n=new pe.Workbook;return n.creator="distributor System",n.lastModifiedBy="distributor System",n.created=new Date,n.modified=new Date,n.lastPrinted=new Date,Object.keys(t).sort((s,l)=>{const a=t[s].sort??0,i=t[l].sort??0;return a-i}).forEach(s=>{let l=s,a=!1;/[\\/:*?\[\]]/g.test(s)&&(s=s.replace(/[\\/:*?\[\]]/g,""),a=!0),s.length>31&&(s=s.substring(0,31).trim(),a=!0,console.warn(o("excel.sheetNameTooLong",[l,s]))),a&&(t[s]=t[l],delete t[l]),n.addWorksheet(s)}),n}function mt(t){if(t<26)return String.fromCharCode(65+t);{const o=String.fromCharCode(65+Math.floor((t-26)/26)),n=String.fromCharCode(65+(t-26)%26);return o+n}}function ht(t){return new Promise(o=>{setTimeout(()=>{o()},t)})}function gt(t){return JSON.parse(JSON.stringify(t))}function pt(t){let o=[],n={},r=(s,l)=>Object.prototype.hasOwnProperty.call(s,l);for(const s of t){n[s.id]={...s,children:r(n,s.id)?n[s.id].children:[]};const l=n[s.id];s.pid==-1?o.push(l):(r(n,s.pid)||(n[s.pid]={children:[]}),n[s.pid].children.push(l))}return o}function _e(t,o=" "){return t?t.split(o).filter(n=>n.trim()):[]}class Se{constructor(o,n=["label","value","labelEn"]){this.list=o.map(r=>({...r,label:r[n[0]],labelEn:r[n[2]]??r[n[0]]??"",value:r[n[1]]})),this.map=new Map(this.list.map(r=>[r[n[1]],r]))}getName(o){if(!this.has(o))return"-";const n=be().global.locale,{label:r,labelEn:s}=this.map.get(o);return(n.value=="zh_cn"?r:s)??r??"-"}getTag(o){if(!this.has(o))return"info";const{tag:n="info"}=this.map.get(o);return n}getItem(o){return this.has(o)?this.map.get(o):null}getColor(o){if(!this.has(o))return null;const{color:n}=this.map.get(o);return n}has(o){return this.map.has(o)}}function yt(t,o=[],n="i18nName"){if(t.length==0)return new Se([]);if(o.length<2){const s=le();throw new Error(s("tools.keysLengthError"))}let r=t.map(s=>{let l={};return n&&(l.labelEn=s[n]),o.forEach((a,i)=>{i===0?l.label=s[a]:i===1?l.value=s[a]:l[a]=s[a]}),l});return new Se(r)}function Ct(t){return t?t.replace(/<[^>]+>/g,""):""}function bt(t){return t?(t.includes("\\\\u")&&(t=t.replace(/\\/g,"")),t.replace(/\\u[\dA-F]{4}/gi,o=>String.fromCharCode(parseInt(o.replace(/\\u/g,""),16)))):""}function wt(t,o=10){let n=1048576*o;return!(t.size>n)}function xt(t){return Array.from(10).fill(0).map((n,r)=>t+"_"+r)}function kt(t){let o={};return t.map((n,r)=>{let{key:s,option:l,type:a,optionFormater:i}=n,c=mt(r);l&&!i?o[s]=`${c}---option`:a==="image"?o[s]=`${c}---image`:o[s]=c}),o}function _t(t,o){return o.split(".").reduce((n,r)=>n&&n[r],t)}const so="",ce=(t,o)=>{const n=t.__vccOpts||t;for(const[r,s]of o)n[r]=s;return n},St=["onClick"],Pe=ce({__name:"index",props:e.mergeModels({api:{type:Function},showCheckAll:{type:Boolean,default:!0},maxLimit:{type:Number,default:void 0},minLimit:{type:Number,default:void 0},optionClick:{type:Function,default:()=>{}},data:{type:Array},labelValue:{type:Object,default:()=>({label:"label",labelEn:"labelEn",value:"value"})},changeLocal:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["success","change","changeAll"],["update:modelValue"]),setup(t,{emit:o}){const n=t,r=e.useAttrs(),{t:s,locale:l}=ee.useI18n(),a=e.useModel(t,"modelValue"),i=e.computed(()=>r["value-key"]!=null),c=e.ref(""),C=e.computed(()=>{if(r.remote!==void 0)return n.data;const x=_e(c.value),{data:$,labelValue:F}=n,H=$||y.value;if(x.length==0)return H;const{label:E,labelEn:de}=F;let M=l.value=="en_us"?de||"i18nName":E;return x.length==1?H.filter(oe=>oe[M].toLowerCase().includes(x[0].toLowerCase())):H.filter(oe=>{let ue=!1;return ue=x.some(xe=>oe[M].toLowerCase()==xe.toLowerCase()),ue})}),p=e.computed({get(){return r.multiple==null||a.value==null?!1:a.value.length==C.value.length},set(x){return x}}),b=o,y=e.ref([]),h=async()=>{const{data:x}=await n.api();y.value=[...x],b("success",y)};n.api&&h();function m(x){b("change",x),d.value&&e.nextTick(()=>{n.optionClick&&n.optionClick(d.value),d.value=null})}const d=e.ref(null);function w(x){d.value=x}const k=n.labelValue.label.split("-"),S=x=>{if(k.length==1){if(n.changeLocal)return s(x[n.labelValue.label]);let $=l.value=="en_us"?x[n.labelValue.labelEn||"i18nName"]:x[n.labelValue.label];return $=$||x[n.labelValue.label],$+""}else{let $=[];return k.forEach(F=>{$.push(x[F])}),$.join("-")}};function _(x){let $=n.data?n.data:y.value;a.value=x?$.map(F=>i.value?F:F[n.labelValue.value]):[],e.nextTick(()=>{b("change",a.value),b("changeAll",a.value,$)})}function T(x){b("change",i.value?x:x[n.labelValue.value]),e.nextTick(()=>{n.optionClick&&n.optionClick(x)})}function B(x){const $=i.value?x:x[n.labelValue.value],F=i.value?a.value.some(H=>H[n.labelValue.value]===x[n.labelValue.value]):a.value.includes($);return!!(n.maxLimit>0&&a.value.length>=n.maxLimit&&!F||n.minLimit>0&&a.value.length===n.minLimit&&F)}function P(x){return x.map($=>({...$,label:S($),value:i.value?$:$[n.labelValue.value]}))}const L=e.ref([]),Y=n.data?n.data:y.value;L.value=P(Y),e.watch(()=>n.data?n.data:y.value,x=>{var F;const $=P(x);if($.length!==L.value.length)L.value=$;else{let H=!1;for(let E=0;E<$.length;E++)if($[E].value!==((F=L.value[E])==null?void 0:F.value)){H=!0;break}H&&(L.value=$)}},{deep:!0});const V=e.computed(()=>r.multiple!==void 0&&(n.maxLimit>0||n.minLimit>0)?L.value.map(x=>({...x,disabled:B(x)})):L.value);return(x,$)=>{const F=e.resolveComponent("el-checkbox"),H=e.resolveComponent("el-select-v2"),E=e.resolveComponent("el-option"),de=e.resolveComponent("el-select");return e.unref(r).v2!=null?(e.openBlock(),e.createBlock(H,e.mergeProps({key:0,options:V.value,modelValue:a.value,"onUpdate:modelValue":$[1]||($[1]=M=>a.value=M)},e.unref(r),{filterable:"","collapse-tags":"","collapse-tags-tooltip":"",clearable:"",onChange:m,onClear:m}),e.createSlots({default:e.withCtx(({item:M})=>[e.createElementVNode("div",{onClick:ae=>w(M)},e.toDisplayString(M.label),9,St)]),_:2},[e.unref(r).multiple!=null?{name:"header",fn:e.withCtx(()=>[e.renderSlot(x.$slots,"header",{},()=>[e.createVNode(F,{class:"mgl20",modelValue:p.value,"onUpdate:modelValue":$[0]||($[0]=M=>p.value=M),onChange:_},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0)]),key:"0"}:void 0]),1040,["options","modelValue"])):(e.openBlock(),e.createBlock(de,e.mergeProps({key:1,modelValue:a.value,"onUpdate:modelValue":$[3]||($[3]=M=>a.value=M),filterable:"","collapse-tags":"","collapse-tags-tooltip":"","filter-method":e.unref(r).remote!=null?void 0:M=>c.value=M,clearable:""},e.unref(r),{onClear:t.optionClick}),{default:e.withCtx(()=>[e.unref(r).multiple!=null&&t.showCheckAll&&t.maxLimit==null?e.renderSlot(x.$slots,"header",{key:0},()=>[e.createVNode(F,{class:"mgl20",modelValue:p.value,"onUpdate:modelValue":$[2]||($[2]=M=>p.value=M),onChange:_},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(M,ae)=>(e.openBlock(),e.createBlock(E,{key:ae,label:S(M),disabled:e.unref(r).multiple!=null&&(t.maxLimit>0||t.minLimit>0)?B(M):!1,onClick:e.withModifiers(oe=>T(M),["stop"]),value:i.value?M:M[t.labelValue.value]},null,8,["label","disabled","onClick","value"]))),128))]),_:3},16,["modelValue","filter-method","onClear"]))}}},[["__scopeId","data-v-078a95a6"]]),co="",$t=e.defineComponent({props:{name:{tyepe:String,required:!0}}});function Vt(t,o,n,r,s,l){const a=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(a,{class:"cmp-icon"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.name)))]),_:1})}const $e=ce($t,[["render",Vt],["__scopeId","data-v-733f9daa"]]),uo="",Et={class:"confirm-button-wrapper"},Tt=ce({__name:"index",emits:["ok","no"],setup(t,{emit:o}){const n=o,r=ne.debounce(()=>{n("ok")},500);function s(){n("no")}return(l,a)=>{const i=e.resolveComponent("el-popconfirm");return e.openBlock(),e.createElementBlock("span",Et,[e.createVNode(i,e.mergeProps(l.$attrs,{onConfirm:e.unref(r),onCancel:s}),{reference:e.withCtx(()=>[e.renderSlot(l.$slots,"default",{},void 0,!0)]),_:3},16,["onConfirm"])])}}},[["__scopeId","data-v-24cb35fd"]]),mo="",It={class:"ImportButton"},Lt=["accept"],vt=ce({__name:"index",props:{accept:{type:String,default:".xlsx,.xls"},fields:{type:Object,default:()=>({})},fileChange:{type:Function,required:!0}},emits:["fileChange"],setup(t,{emit:o}){const n=t,r=e.ref(null),s=e.ref(!1);async function l(a){s.value=!0;let i=a.target.files[0];const c=await qe(i,n.fields).catch(()=>{s.value=!1}).finally(()=>{r.value.value=null});await n.fileChange(c).finally(()=>{s.value=!1})}return(a,i)=>{const c=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",It,[e.createVNode(c,e.mergeProps({type:"primary",loading:s.value,class:"mgr10",onClick:i[0]||(i[0]=C=>r.value.click())},a.$attrs),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(a.$t("dao-ru")),1)],!0)]),_:3},16,["loading"]),e.createElementVNode("input",{onChange:l,ref_key:"input",ref:r,accept:t.accept,style:{position:"absolute",width:"0px",height:"0px",opacity:"0"},type:"file"},null,40,Lt)])}}},[["__scopeId","data-v-ea0a4c60"]]);function Ve(t){let o={};return t.forEach(n=>{const{key:r,type:s,option:l={},value:a,dateType:i="date"}=n;if(r)if(s=="input"&&(l!=null&&l.multiple))o[r]=_e(a);else if(s=="date")if(i.includes("range")){const[c,C]=r;let[p,b]=a||[];p&&i=="daterange"&&(p=fe(p).format("YYYY-MM-DD 00:00:00"),b=fe(b).format("YYYY-MM-DD 23:59:59")),o[c]=p,o[C]=b}else o[r]=a;else o[r]=a}),o}const go="",Ft={key:0},Dt={class:"btns"},Bt={class:"left"},Mt={class:"right"},je=ce({__name:"index",props:{form:{type:Object,required:!0}},emits:["confirm","reset","visibleChange"],setup(t,{expose:o,emit:n}){const r=t,s=n,l=e.ref(!0),a=e.ref(null),{t:i}=ee.useI18n(),c={datetimerange:"YYYY-MM-DD HH:mm:ss",daterange:"YYYY-MM-DD",month:"YYYY-MM"},C=e.computed(()=>l.value?i("guan-bi"):i("zhan-kai"));function p(){s("confirm")}function b(k){k.option.onClear&&k.option.onClear(),s("confirm")}function y(){s("reset")}function h(){s("confirm")}function m(){return Ve(r.form.items)}const d=ne.cloneDeep(r.form.items);function w(){r.form.items.forEach(k=>{const S=d.find(_=>_.key==k.key);S&&(k.value=S.value)})}return o({getPrm:m,reset:w}),(k,S)=>{const _=e.resolveComponent("el-input"),T=e.resolveComponent("el-date-picker"),B=e.resolveComponent("el-form-item"),P=e.resolveComponent("el-form"),L=e.resolveComponent("el-link"),Y=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",{class:"searchBar-container mgt10 mgb10",onKeydown:e.withKeys(p,["enter"])},[e.createElementVNode("div",{class:"searchBar",style:e.normalizeStyle({height:l.value?"auto":"42px"})},[e.createVNode(P,{inline:"",model:t.form.data},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.form.items.filter(V=>!V.hidden),V=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:V.key},[V.type=="br"?(e.openBlock(),e.createElementBlock("br",Ft)):(e.openBlock(),e.createBlock(B,{key:1,label:V.name},{default:e.withCtx(()=>{var x,$;return[V.type==="input"?(e.openBlock(),e.createBlock(_,{key:0,modelValue:V.value,"onUpdate:modelValue":F=>V.value=F,class:e.normalizeClass(((x=V.option)==null?void 0:x.class)||"w150"),placeholder:k.$t("qing-shu-ru"),clearable:""},null,8,["modelValue","onUpdate:modelValue","class","placeholder"])):V.type==="custom"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(V.render),{key:1})):e.createCommentVNode("",!0),V.type==="select"?(e.openBlock(),e.createBlock(Pe,e.mergeProps({key:2,class:(($=V.option)==null?void 0:$.class)||"w150",modelValue:V.value,"onUpdate:modelValue":F=>V.value=F},{ref_for:!0},V.option,{onChange:p,onClear:F=>b(V)}),null,16,["class","modelValue","onUpdate:modelValue","onClear"])):e.createCommentVNode("",!0),V.type==="date"?(e.openBlock(),e.createBlock(T,e.mergeProps({key:3,class:{datetimerange:"w300",daterange:"w200"}[V.dateType]||"w100",modelValue:V.value,"onUpdate:modelValue":F=>V.value=F,"value-format":c[V.dateType]||"YYYY-MM-DD",type:V.dateType||"date",onFocus:F=>a.value=V,onChange:F=>h(),placeholder:k.$t("qing-xuan-ze"),"start-placeholder":k.$t("kai-shi-shi-jian"),"end-placeholder":k.$t("jie-shu-shi-jian")},{ref_for:!0},V.option),null,16,["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",Dt,[e.createElementVNode("div",Bt,[e.renderSlot(k.$slots,"table-header-left",{},void 0,!0)]),e.createElementVNode("div",Mt,[e.createVNode(L,{underline:"never",class:"mgr10",onClick:S[0]||(S[0]=()=>{s("visibleChange",!l.value),l.value=!l.value})},{default:e.withCtx(()=>[e.createVNode($e,{name:l.value?"ArrowUp":"ArrowDown"},null,8,["name"]),e.createTextVNode(" "+e.toDisplayString(C.value),1)]),_:1}),e.createVNode(Y,{type:"primary",onClick:p},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.$t("shai-xuan")),1)]),_:1}),e.createVNode(Y,{type:"primary",onClick:y},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.$t("chong-zhi")),1)]),_:1}),e.renderSlot(k.$slots,"btn",{},void 0,!0)])])],32)}}},[["__scopeId","data-v-5c7eeed9"]]),Re={pageNoKey:"pageNo",pageSizeKey:"pageSize",totalKey:"total",defaultPageSize:10,pageSizes:[10,50,100,500],responseDataKeys:{rows:["rows","records","list"],total:["totalRows","total"]},showSearch:!1,showPage:!1,showShadow:!1,showCheckBox:!1,enableCellCopy:!0};let he={...Re};function zt(t){he={...he,...t,responseDataKeys:{...he.responseDataKeys,...t.responseDataKeys||{}}}}function Ue(){return he}function Ot(){he={...Re}}const yo="",Nt={class:"center"},qt=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(t,{expose:o}){const{t:n,locale:r}=ee.useI18n(),s=ve.useRoute(),l=Ue(),a=t,i=e.ref(!1),c=e.ref([]);a.searchForm.showSearch===void 0&&(a.searchForm.showSearch=l.showSearch),a.searchForm.showPage===void 0&&(a.searchForm.showPage=l.showPage),a.searchForm.showShadow===void 0&&(a.searchForm.showShadow=l.showShadow),a.searchForm.showCheckBox===void 0&&(a.searchForm.showCheckBox=l.showCheckBox),a.searchForm.enableCellCopy===void 0&&(a.searchForm.enableCellCopy=l.enableCellCopy),a.searchForm.selections||(a.searchForm.selections=[]);const C=e.computed(()=>{const f=s.path.replace(/\//g,"-").replace(/^-/,"")||"default-table";return a.id?`listPageId-${f}-${a.id}`:`listPageId-${f}`}),p=ne.cloneDeep(a.searchForm.items),b=a.searchForm.pageNoKey||l.pageNoKey,y=a.searchForm.pageSizeKey||l.pageSizeKey,h=e.reactive({[b]:1,[y]:a.searchForm.defaultPageSize||l.defaultPageSize,total:0}),m=e.ref(null),d=e.ref(null),w=e.ref(450),k=ne.debounce(()=>{e.nextTick(()=>{if(!d.value)return;const u=d.value.getBoundingClientRect(),I=window.innerHeight,D=u.top,q=100,U=I-D-q,z=200;w.value=Math.max(U,z)})},100),S=()=>{k()},_=()=>{if(!a.searchForm.enableCellCopy&&!l.enableCellCopy)return!1;const f=m.value;if(!f||!f.$el)return!1;const u=f.$el;return u.classList.add("cell-copy-enabled"),u.setAttribute("tabindex","-1"),u.removeEventListener("mousedown",M),u.removeEventListener("mousemove",ae),u.removeEventListener("mouseup",oe),u.removeEventListener("keydown",Te),u.addEventListener("mousedown",M),u.addEventListener("mousemove",ae),u.addEventListener("mouseup",oe),u.addEventListener("keydown",Te),!0};e.onMounted(()=>{k(),window.addEventListener("resize",S),(a.searchForm.enableCellCopy||l.enableCellCopy)&&(document.addEventListener("mouseup",Ze),document.addEventListener("mousedown",Ge),setTimeout(()=>{_()},500))}),e.onUpdated(()=>{(a.searchForm.enableCellCopy||l.enableCellCopy)&&setTimeout(()=>{_()},500)}),e.onUnmounted(()=>{if(window.removeEventListener("resize",S),a.searchForm.enableCellCopy||l.enableCellCopy){document.removeEventListener("mouseup",Ze),document.removeEventListener("mousedown",Ge);const f=m.value;if(f&&f.$el){const u=f.$el;u.removeEventListener("mousedown",M),u.removeEventListener("mousemove",ae),u.removeEventListener("mouseup",oe),u.removeEventListener("keydown",Te)}}});const T=e.computed(()=>H.value.height||w.value);let B;async function P(f){const{dataFormat:u}=a.tableConfig;f[b]!=1&&(f.nextSearchAfter=B),i.value=!0;const{code:I,data:D={}}=await a.api(f).finally(()=>{i.value=!1,a.searchForm.selections=[]});if(I==200){let q=[];for(const z of l.responseDataKeys.rows)if(D[z]){q=D[z];break}let U=0;for(const z of l.responseDataKeys.total)if(D[z]!==void 0){U=D[z];break}c.value=u?u(q):q,h.total=U,B=D.nextSearchAfter,(a.searchForm.enableCellCopy||l.enableCellCopy)&&e.nextTick(()=>{setTimeout(()=>{_()},100)})}}function L(f={}){const{searchData:u=()=>({})}=a.tableConfig,I=u();P({...h,...Ve(a.searchForm.items),...f,...I})}function Y(){const{reset:f}=a.tableConfig;f&&f(),a.searchForm.items.forEach(u=>{const I=p.find(D=>ne.isArray(u.key)&&ne.isArray(D.key)?u.key.join(",")==D.key.join(","):D.key==u.key);I&&(u.value=I.value)}),L()}a.api&&a.immediate&&L();function V(){return{...h,...Ve(a.searchForm.items)}}const x=()=>{const f=m.value;f&&f.clearSort()},$=e.reactive({storage:!0}),F=e.reactive({drag:!0,resizable:!0,maxFixedSize:0}),H=e.computed(()=>{const{customConfig:f,columnConfig:u,...I}=a.tableConfig;return{headerAlign:"left",align:"center",customConfig:{...$,...f},columnConfig:{...F,...u},"virtual-x-config":{enabled:!1,scrollToLeftOnChange:!1},"virtual-y-config":{enabled:!0,gt:100},...I}}),E=e.reactive({isSelecting:!1,startCell:null,endCell:null,selectedCells:[]}),de=f=>{const u=f.closest(".vxe-body--column");if(!u||u.classList.contains("col--checkbox")||u.classList.contains("col--seq"))return null;const I=u.closest(".vxe-body--row");if(!I)return null;const D=m.value;if(!D)return null;let q=-1;const U=I.getAttribute("data-rowid");if(U!=null)q=parseInt(U,10);else{const O=I.parentElement;q=Array.from(O.querySelectorAll(".vxe-body--row")).indexOf(I)}if(q<0)return null;let z=-1;const Q=u.getAttribute("data-colid");if(Q&&(z=D.getColumns().findIndex(v=>v.id===Q)),z<0){const v=Array.from(I.querySelectorAll(".vxe-body--column")).indexOf(u),j=!!u.closest(".vxe-table--fixed-left-wrapper"),K=!!u.closest(".vxe-table--fixed-right-wrapper"),A=D.getColumns();if(j){const W=A.filter(R=>R.fixed==="left");v<W.length&&(z=A.indexOf(W[v]))}else if(K){const W=A.filter(R=>R.fixed==="right");v<W.length&&(z=A.indexOf(W[v]))}else{const W=a.searchForm.showCheckBox?1:0;z=A.filter(G=>G.fixed==="left").length+v-W}}return z<0?null:{rowIndex:q,colIndex:z,cell:u}},M=f=>{const u=de(f.target);if(!u){ue();return}E.isSelecting=!0,E.startCell={rowIndex:u.rowIndex,colIndex:u.colIndex},E.endCell={...E.startCell},xe(),We()},ae=f=>{if(!E.isSelecting)return;const u=de(f.target);u&&(E.endCell={rowIndex:u.rowIndex,colIndex:u.colIndex},xe(),We())},oe=()=>{E.isSelecting=!1},ue=()=>{E.selectedCells=[],E.startCell=null,E.endCell=null;const f=m.value;if(!f)return;f.$el.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(I=>{I.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")})},xe=()=>{if(!E.startCell||!E.endCell){E.selectedCells=[];return}const f=E.startCell.rowIndex,u=E.endCell.rowIndex,I=E.startCell.colIndex,D=E.endCell.colIndex,q=Math.min(f,u),U=Math.max(f,u),z=Math.min(I,D),Q=Math.max(I,D);E.selectedCells=[];for(let O=q;O<=U;O++)for(let v=z;v<=Q;v++)E.selectedCells.push({rowIndex:O,colIndex:v})},We=()=>{e.nextTick(()=>{const f=m.value;if(!f)return;const u=f.$el;if(u.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(j=>{j.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")}),E.selectedCells.length===0)return;const I=f.getColumns(),D=E.selectedCells.map(j=>j.rowIndex),q=E.selectedCells.map(j=>j.colIndex),U=Math.min(...D),z=Math.max(...D),Q=Math.min(...q),O=Math.max(...q),v=[u.querySelector(".vxe-table--body-wrapper tbody"),u.querySelector(".vxe-table--fixed-left-wrapper tbody"),u.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean);E.selectedCells.forEach(({rowIndex:j,colIndex:K})=>{const A=I[K];if(!A)return;const W=A.fixed==="left",R=A.fixed==="right";for(const G of v){const ge=G.querySelectorAll(".vxe-body--row")[j];if(!ge)continue;const re=Array.from(ge.querySelectorAll(".vxe-body--column"));let N=null;if(W&&G.closest(".vxe-table--fixed-left-wrapper")){const J=I.filter(X=>X.fixed==="left").indexOf(A);N=re[J]}else if(R&&G.closest(".vxe-table--fixed-right-wrapper")){const J=I.filter(X=>X.fixed==="right").indexOf(A);N=re[J]}else if(!W&&!R&&G.closest(".vxe-table--body-wrapper")){const se=a.searchForm.showCheckBox?1:0,J=I.filter(Ie=>Ie.fixed==="left").length,X=K-J;N=re[X+se]}if(N&&!N.classList.contains("col--checkbox")&&!N.classList.contains("col--seq")){N.classList.add("cell-selected"),j===U&&N.classList.add("cell-border-top"),j===z&&N.classList.add("cell-border-bottom"),K===Q&&N.classList.add("cell-border-left"),K===O&&N.classList.add("cell-border-right");break}}})})},no=async()=>{if(E.selectedCells.length===0)return;const f=m.value;if(!f)return;const u=f.$el,I=f.getColumns(),D=[...new Set(E.selectedCells.map(O=>O.rowIndex))].sort((O,v)=>O-v),q=[...new Set(E.selectedCells.map(O=>O.colIndex))].sort((O,v)=>O-v),U=[u.querySelector(".vxe-table--body-wrapper tbody"),u.querySelector(".vxe-table--fixed-left-wrapper tbody"),u.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean),z=[];D.forEach(O=>{const v=[];q.forEach(j=>{const K=I[j];if(!K){v.push("");return}const A=K.fixed==="left",W=K.fixed==="right";let R="";for(const G of U){const ge=G.querySelectorAll(".vxe-body--row")[O];if(!ge)continue;const re=Array.from(ge.querySelectorAll(".vxe-body--column"));let N=null;if(A&&G.closest(".vxe-table--fixed-left-wrapper")){const J=I.filter(X=>X.fixed==="left").indexOf(K);N=re[J]}else if(W&&G.closest(".vxe-table--fixed-right-wrapper")){const J=I.filter(X=>X.fixed==="right").indexOf(K);N=re[J]}else if(!A&&!W&&G.closest(".vxe-table--body-wrapper")){const se=a.searchForm.showCheckBox?1:0,J=I.filter(Ie=>Ie.fixed==="left").length,X=j-J;N=re[X+se]}if(N&&!N.classList.contains("col--checkbox")&&!N.classList.contains("col--seq")){R=N.innerText||N.textContent||"",R=R.trim(),R=R.replace(/\n/g," ").replace(/\s+/g," ");break}}v.push(R)}),z.push(v.join(" "))});const Q=z.join(`
2
+ `);try{await navigator.clipboard.writeText(Q)}catch(O){console.error("复制失败:",O)}},Te=f=>{!a.searchForm.enableCellCopy&&!l.enableCellCopy||((f.ctrlKey||f.metaKey)&&f.key==="c"?E.selectedCells.length>0&&(f.preventDefault(),f.stopPropagation(),no()):f.key==="Escape"&&ue())},Ze=()=>{E.isSelecting=!1},Ge=f=>{const u=m.value;if(!u||!u.$el)return;u.$el.contains(f.target)||ue()},lo=f=>{h[b]=f,L()},ao=f=>{h[y]=f,h[b]=1,L()};function Je(){const f=m.value.getCheckboxRecords();a.searchForm.selections=f}const Xe=f=>{const u=m.value;if(u){u.toggleCheckboxRow(f);const I=m.value.getCheckboxRecords();a.searchForm.selections=I}};return o({tableRef:m,getList:L,getPrm:V,clearSort:x,calculateTableHeight:k}),(f,u)=>{var O;const I=e.resolveComponent("el-button"),D=e.resolveComponent("el-checkbox"),q=e.resolveComponent("el-text"),U=e.resolveComponent("vxe-column"),z=e.resolveComponent("VxeTable"),Q=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({box:t.searchForm.showShadow})},[t.searchForm.showSearch?(e.openBlock(),e.createBlock(je,{key:0,form:t.searchForm,onReset:Y,onConfirm:u[1]||(u[1]=v=>L()),onVisibleChange:e.unref(k)},{btn:e.withCtx(()=>[u[3]||(u[3]=e.createElementVNode("span",{class:"mgr10"},null,-1)),e.renderSlot(f.$slots,"search-bar-btn",{},void 0,!0),e.createVNode(I,{class:"mgl10",round:"",onClick:u[0]||(u[0]=v=>m.value.openCustom())},{default:e.withCtx(()=>[e.createVNode($e,{name:"Tools"})]),_:1})]),_:3},8,["form","onVisibleChange"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"table-header-left",{},void 0,!0),e.createElementVNode("div",{ref_key:"tableContentRef",ref:d},[e.createVNode(z,e.mergeProps({id:C.value,ref_key:"tableRef",ref:m,loading:t.loading||i.value,data:t.api?c.value:t.data,border:""},H.value,{height:T.value,onCheckboxChange:Je,onCheckboxAll:Je,onSortChange:(O=H.value["sort-config"])==null?void 0:O.sortChange}),{default:e.withCtx(()=>[t.searchForm.showCheckBox==null||t.searchForm.showCheckBox?(e.openBlock(),e.createBlock(U,{key:0,type:"checkbox",width:e.unref(r)=="zh_cn"?80:150,title:f.$t("xu-hao"),fixed:"left"},{checkbox:e.withCtx(({rowIndex:v,row:j,checked:K,disabled:A,indeterminate:W})=>[e.createElementVNode("div",Nt,[K?(e.openBlock(),e.createBlock(D,{key:0,checked:!0,disabled:A,size:"default",onClick:e.withModifiers(R=>!A&&Xe(j),["stop"])},null,8,["disabled","onClick"])):(e.openBlock(),e.createBlock(D,{key:1,disabled:A,checked:!1,size:"default",onClick:e.withModifiers(R=>!A&&Xe(j),["stop"])},null,8,["disabled","onClick"])),e.createVNode(q,{type:"info",class:"mgl5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(v+1),1)]),_:2},1024)])]),_:1},8,["width","title"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"default",{},void 0,!0)]),_:3},16,["id","loading","data","height","onSortChange"])],512),t.searchForm.showPage?(e.openBlock(),e.createBlock(Q,{key:1,"current-page":h[e.unref(b)],"onUpdate:currentPage":u[2]||(u[2]=v=>h[e.unref(b)]=v),class:"myPagination mgt10",background:"",layout:"total, sizes, prev, pager, next",total:h.total,"page-size":h[e.unref(y)],"page-sizes":t.searchForm.pageSizes||e.unref(l).pageSizes,onCurrentChange:lo,onSizeChange:ao},null,8,["current-page","total","page-size","page-sizes"])):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-c022c16d"]]),At={__name:"index",props:{sheetsConfig:{type:Object,required:!0},fileName:{type:String,required:!0}},setup(t){const o=t;function n(){Ae(o.fileName,o.sheetsConfig)}return(r,s)=>{const l=e.resolveComponent("el-link");return e.openBlock(),e.createBlock(l,e.mergeProps({type:"primary",underline:"never"},r.$attrs,{onClick:n}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(r.$t("xia-zai-dao-ru-mo-ban")),1)])]),_:3},16)}}},Pt={mounted(t,o){o.value&&Ye(t)},updated(t,o){o.value?Ye(t):He(t)},beforeUnmount(t){He(t)}};async function Ye(t){await y();const o=t.querySelector(".el-dialog");if(!o)return;const n=t.querySelector(".el-dialog__header"),r=t.querySelector(".el-overlay");r.style.cssText+="overflow: hidden;",n.style.cursor="move";let s=!1,l={window:{width:0,height:0},dialog:{x:0,y:0,width:0,height:0,marginTop:""},mouse:{x:0,y:0},drag:{x:0,y:0}};n.addEventListener("mousedown",c),document.addEventListener("mousemove",C),document.addEventListener("mouseup",p),window.addEventListener("resize",b);function a(){l.mouse.x-l.drag.x>=l.dialog.x&&(l.drag.x=l.mouse.x-l.dialog.x),l.drag.x-l.mouse.x>=l.window.width-(l.dialog.x+l.dialog.width)&&(l.drag.x=l.mouse.x+l.window.width-l.dialog.x-l.dialog.width),l.mouse.y-l.drag.y>=l.dialog.y&&(l.drag.y=l.mouse.y-l.dialog.y),l.drag.y-l.mouse.y>=l.window.height-(l.dialog.y+l.dialog.height)&&(l.drag.y=l.mouse.y+l.window.height-l.dialog.y-l.dialog.height),i()}function i(){let h=l.drag.y-l.mouse.y+l.dialog.y,m=l.drag.x-l.mouse.x+l.dialog.x;o.style.cssText+=`position: absolute; top: calc(${h}px - ${l.dialog.marginTop}); left: ${m}px;`}function c(h){h.button===0&&(l.window={width:document.body.clientWidth,height:document.body.clientHeight},l.dialog=o.getBoundingClientRect(),l.dialog.marginTop=window.getComputedStyle(o).marginTop,l.mouse={x:h.clientX,y:h.clientY},s=!0)}function C(h){s&&(l.drag={x:h.clientX,y:h.clientY},r.style.userSelect="none",a())}function p(h){r.style.userSelect="auto",s=!1}function b(h){}function y(){return new Promise((h,m)=>{setTimeout(()=>{h()},500)})}t.__mouseDown__=c,t.__mouseUp__=p,t.__mouseMove__=C,t.__sizeChange__=b}function He(t){document.removeEventListener("mousedown",t.__mouseDown__),document.removeEventListener("mousemove",t.__mouseMove__),document.removeEventListener("mouseup",t.__mouseUp__),window.removeEventListener("resize",t.__sizeChange__)}const bo="",jt={key:0,class:"drawer-btn"},Rt={key:1},Ut={__name:"index",props:{layer:{type:Object,default:()=>({show:!1,type:"layer",title:"",showButton:!1}),required:!0},loading:{type:Boolean,default:!1}},emits:["confirm"],setup(t,{emit:o}){const n=t,r=o,{t:s}=ee.useI18n(),l=ne.debounce(()=>{r("confirm")},300);async function a(){n.layer.type=="drawer"?n.layer.onClose?n.layer.onClose():n.layer.closeConfirm?await Z.ElMessageBox.confirm(s("que-ding-guan-bi-ma"),{confirmButtonText:s("que-ding"),cancelButtonText:s("qu-xiao"),type:"warning"}).catch(()=>{})=="confirm"&&(n.layer.show=!1):n.layer.show=!1:n.layer.show=!1}return(i,c)=>{const C=e.resolveComponent("el-button"),p=e.resolveComponent("el-drawer"),b=e.resolveComponent("el-dialog");return t.layer.type?(e.openBlock(),e.createBlock(p,{key:0,modelValue:t.layer.show,"onUpdate:modelValue":c[0]||(c[0]=y=>t.layer.show=y),size:t.layer.width||"100%",title:t.layer.title,direction:"rtl","append-to-body":"","before-close":a,class:"drawer-content"},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default"),c[2]||(c[2]=e.createElementVNode("p",{class:"mgt50"},null,-1)),t.layer.showButton?(e.openBlock(),e.createElementBlock("div",jt,[e.renderSlot(i.$slots,"btn",{},()=>[e.createVNode(C,{onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("qu-xiao")),1)]),_:1}),e.createVNode(C,{type:"primary",loading:t.loading,onClick:e.unref(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("ti-jiao")),1)]),_:1},8,["loading","onClick"])])])):e.createCommentVNode("",!0)]),_:3},8,["modelValue","size","title"])):e.withDirectives((e.openBlock(),e.createElementBlock("div",Rt,[e.createVNode(b,{"close-on-click-modal":!1,modelValue:t.layer.show,"onUpdate:modelValue":c[1]||(c[1]=y=>t.layer.show=y),title:t.layer.title,width:t.layer.width||500,center:""},e.createSlots({default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:2},[t.layer.showButton?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(i.$slots,"btn",{},()=>[e.createVNode(C,{onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("qu-xiao")),1)]),_:1}),e.createVNode(C,{type:"primary",onClick:e.unref(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("ti-jiao")),1)]),_:1},8,["onClick"])])]),key:"0"}:void 0]),1032,["modelValue","title","width"])])),[[e.unref(Pt),t.layer.show]])}}};function Yt(t,o={}){const n=le(),r={inForm:!0,required:!0,...o},s={phone:/^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/,password:/(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/,email:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/}[t],{inForm:l,value:a,required:i,msg:c=n("validate.invalidInput")}=r;return l?function(C,p,b){if(i){s.test(p)?b():b(new Error(c));return}p&&!s.test(p)?b(new Error(c)):b()}:s.test(a)}class Ht{constructor(o={}){this.config={clientCode:o.clientCode||"one-portal",casServerUrl:`https://one-portal${o.isTest?"-test":""}.joy-group.com/api`,casPortalUrl:`https://one-portal${o.isTest?"-test":""}.joy-group.com`,serviceUrl:o.serviceUrl||window.location.origin+"/cas/callback",tokenKey:o.tokenKey||"one_portal_token",userKey:o.userKey||"one_portal_user",debug:o.debug||!1,autoLogin:o.autoLogin!==!1,loginCallback:o.loginCallback||null,logoutCallback:o.logoutCallback||null,errorCallback:o.errorCallback||null},this.token=null,this.user=null,this.init()}init(){this.log("OnePortal CAS SDK 初始化中..."),this.loadFromStorage();const n=new URLSearchParams(window.location.search).get("ticket");this.isLoggedIn()&&this.config.loginCallback?this.config.loginCallback(this.user,this.token):n?(this.log("检测到ST票据:",n),this.validateTicket(n)):this.config.autoLogin&&!this.isLoggedIn()&&(this.log("用户未登录,准备跳转到CAS登录页面"),this.login())}loadFromStorage(){try{this.token=localStorage.getItem(this.config.tokenKey);const o=localStorage.getItem(this.config.userKey);o&&(this.user=JSON.parse(o)),this.log("从本地存储加载数据:",{token:!!this.token,user:!!this.user})}catch(o){this.log("加载本地存储数据失败:",o)}}saveToStorage(){try{this.token&&localStorage.setItem(this.config.tokenKey,this.token),this.user&&localStorage.setItem(this.config.userKey,JSON.stringify(this.user)),this.log("数据已保存到本地存储")}catch(o){this.log("保存到本地存储失败:",o)}}clearStorage(){try{localStorage.removeItem(this.config.tokenKey),localStorage.removeItem(this.config.userKey),this.log("本地存储已清除")}catch(o){this.log("清除本地存储失败:",o)}}isLoggedIn(){return!!(this.token&&this.user)}getUser(){return this.user}getToken(){return this.token}login(){const o=`${this.config.casPortalUrl}?appCode=${this.config.clientCode}&redirectUrl=${encodeURIComponent(this.config.serviceUrl)}`;this.log("跳转到CAS登录页面:",o),window.location.href=o}async validateTicket(o){try{this.log("验证ST票据:",o);const n=await fetch(`${this.config.casServerUrl}/auth/validateST?ticket=${o}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);const r=await n.json();if(r.success&&r.data)return this.token=r.data.token,this.user=r.data.user,this.saveToStorage(),this.clearTicketFromUrl(),this.log("ST票据验证成功,用户登录成功:",this.user),this.config.loginCallback&&this.config.loginCallback(this.user,this.token),!0;throw new Error(r.message||"ST票据验证失败")}catch(n){return this.log("ST票据验证失败:",n),this.handleError(n),!1}}clearTicketFromUrl(){const o=new URL(window.location);o.searchParams.delete("ticket"),window.history.replaceState({},document.title,o.toString())}async logout(o=!0){try{if(this.log("用户登出"),this.token)try{await fetch(`${this.config.casServerUrl}/auth/logout`,{method:"POST",headers:{AppId:this.config.clientCode,Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"}})}catch(n){this.log("调用服务端登出接口失败:",n)}this.token=null,this.user=null,this.clearStorage(),this.config.logoutCallback&&this.config.logoutCallback(),o&&this.login()}catch(n){this.log("登出失败:",n),this.handleError(n)}}async request(o,n={}){const r={headers:{"Content-Type":"application/json",...n.headers},...n};r.headers.appId=this.config.clientCode,this.token&&(r.headers.Authorization=`Bearer ${this.token}`);try{const s=await fetch(o,r);return s.status===401?(this.log("Token已过期,需要重新登录"),this.logout(),null):s}catch(s){throw this.log("请求失败:",s),s}}async fetchUserInfo(){try{const o=await this.request(`${this.config.casServerUrl}/auth/user`);if(o&&o.ok){const n=await o.json();if(n.success&&n.data)return this.user=n.data,this.saveToStorage(),this.user}return null}catch(o){return this.log("获取用户信息失败:",o),null}}async refreshToken(){this.log("Token刷新功能暂未实现")}handleError(o){this.log("发生错误:",o),this.config.errorCallback&&this.config.errorCallback(o)}log(...o){this.config.debug&&console.log("[OnePortal CAS SDK]",...o)}checkLoginStatus(){return!this.isLoggedIn()&&this.config.autoLogin?(this.login(),!1):this.isLoggedIn()}setConfig(o,n){this.config[o]=n}getConfig(o){return this.config[o]}}function Kt(t,o={}){const r=Object.assign({manual:!1,log:!1,params:null,format:null},o),{manual:s,log:l,params:a={},cb:i,format:c}=r,C=e.ref([]),p=e.ref(!1),b=y=>{const h=y||a;p.value=!0,t(h).then(m=>{const{code:d,data:w,msg:k}=m;if(i){const{records:S,rows:_}=w||{},T=S||_?S||_:w;C.value=Ee(T,c),i(m)}if(w){if(w.records!=null||w.rows!=null){const{records:S,rows:_,total:T=0}=w||{};h&&h.total!=null&&(a.total=parseInt(T)),C.value=Ee(S||_||[],c)}else C.value=Ee(w,c);l&&console.log("useRequest-res",C.value)}}).catch(m=>{i&&(console.log("useRequestErr",m),i({code:500}))}).finally(()=>{p.value=!1})};return s||b(),[p,C,b]}function Wt(t){const o=e.ref(t),n=e.ref(""),r=e.ref("");return e.watch(o,s=>{const l=s||["",""];n.value=l[0],r.value=l[1]}),[o,n,r]}function Zt(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function Ee(t,o){if(!o)return t;if(t instanceof Array)return t.map(r=>{let s={};return o.forEach(l=>s[l]=r[l]),s});let n={};return o.forEach(r=>n[r]=t[r]),n}function Gt(t,o=[]){const{locale:n}=ee.useI18n(),r=e.ref(t());return e.watch([n,...o],()=>{r.value=t()},{immediate:!0}),r}function Jt(t,o="zh_cn",n="en_us"){if(!t)return"-";const r={en_us:n,zh_cn:o},l=be().global.locale.value;return t[r[l]]||t[o]||"-"}function Xt(t,o){let n=te.mapState;return typeof t=="string"&&t.length>0&&(n=te.createNamespacedHelpers(t).mapState),Ke(o,n)}function Qt(t,o){let n=te.mapGetters;return typeof t=="string"&&t.length>0&&(n=te.createNamespacedHelpers(t).mapGetters),Ke(o,n)}function eo(t,o){let n=te.mapActions;return typeof t=="string"&&t.length>0&&(n=te.createNamespacedHelpers(t).mapActions),to(o,n)}function Ke(t,o){const n=te.useStore(),r=o(t),s={};return Object.keys(r).forEach(l=>{const a=r[l].bind({$store:n});s[l]=e.computed(a)}),s}function to(t,o){const n=te.useStore(),r=o(t),s={};return Object.keys(r).forEach(l=>{s[l]=r[l].bind({$store:n})}),s}function we(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}function oo(){me.VxeUI.renderer.add("Enum",{renderTableDefault(t,o){let n;if([null,void 0].includes(o.row[o.column.field]))return"-";const r=o.row[o.column.field];if(t.type=="tag"){let s;return e.createVNode(e.resolveComponent("el-text"),{type:t.enum.getTag(r)},we(s=t.enum.getName(r))?s:{default:()=>[s]})}return e.createVNode(e.resolveComponent("el-text"),null,we(n=t.enum.getName(r))?n:{default:()=>[n]})}}),me.VxeUI.renderer.add("InputNumber",{renderTableDefault(t,o){return e.createVNode(Z.ElInputNumber,e.mergeProps({modelValue:o.row[o.column.field],"onUpdate:modelValue":n=>o.row[o.column.field]=n},t.props,{"step-strictly":!0,"value-on-clear":0}),null)}}),me.VxeUI.renderer.add("TrueFalse",{renderTableDefault(t,o){const{locale:n}=ee.useI18n();let r=n.value=="zh_cn";return e.createVNode(Z.ElText,{type:o.row[o.column.field]?"success":"danger"},{default:()=>[o.row[o.column.field]?r?"是":"YES":r?"否":"NO"]})}}),me.VxeUI.renderer.add("I18n",{renderTableDefault(t,o){const{locale:n}=ee.useI18n();let r=n.value=="zh_cn"?o.column.field:t.fieldEn;return o.row[r]||o.row[o.column.field]}}),me.VxeUI.renderer.add("Link",{renderTableDefault(t,o){let n=o.column.field;const r=ve.useRouter(),{multiple:s,to:l,openType:a="system"}=t,i=o.row[n];function c(C,p){a=="blank"?window.open(C):r.push({path:C,query:{[n]:p}})}if(s){const C=(i==null?void 0:i.split(","))||[];return C.map((p,b)=>e.createVNode("span",null,[e.createVNode(Z.ElLink,{underline:"never",type:"primary",onclick:()=>c(a=="stystem"?l:p,p)},we(p)?p:{default:()=>[p]}),b<C.length-1?",":""]))}return e.createVNode(Z.ElLink,{underline:"never",type:"primary",onclick:()=>c(a=="stystem"?l:i,i)},we(i)?i:{default:()=>[i]})}})}g.CmpDictionary=Pe,g.CmpIcon=$e,g.ConfrimButton=Tt,g.DownExcelTemp=At,g.ImportButton=vt,g.LayOutForm=Qe,g.Layer=Ut,g.ListPage=qt,g.OnePortalCasSDK=Ht,g.SearchBar=je,g.StatusMap=Se,g._toRaw=gt,g._typeOf=Zt,g.arrToStatusMap=yt,g.arrayToTree=pt,g.checkFileSize=wt,g.creatValidator=Yt,g.createImportFields=kt,g.createListPageId=xt,g.en_us=Ce,g.exportExcel=at,g.exportExcelMuilti=Ae,g.getI18n=be,g.getI18nT=le,g.getListPageConfig=Ue,g.getLocaleValue=Jt,g.getValueBykey=_t,g.importExcel=lt,g.importExcelMuilti=qe,g.messages=ze,g.registerVxeRenderers=oo,g.resetListPageConfig=Ot,g.setListPageConfig=zt,g.setupI18n=Oe,g.sleep=ht,g.stringToArray=_e,g.stripHtmlTags=Ct,g.unicode2Str=bt,g.useActions=eo,g.useDatePicker=Wt,g.useGetters=Qt,g.useI18nReState=Gt,g.useRequest=Kt,g.useState=Xt,g.zh_cn=ye,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .cmp-icon[data-v-078a95a6],.cmp-icon[data-v-733f9daa]{padding:0!important}.ImportButton[data-v-14c83b7c]{display:inline-block}.searchBar-container .searchBar[data-v-5c7eeed9]{overflow:hidden;transition:all .3s}.searchBar-container[data-v-5c7eeed9] .el-form-item{margin-bottom:8px!important}.searchBar-container .btns[data-v-5c7eeed9]{display:flex;justify-content:space-between;align-items:center}.searchBar-container .btns .left[data-v-5c7eeed9]{display:flex;align-items:center}.searchBar-container .btns .left[data-v-5c7eeed9] .el-tabs__header{margin:0}.searchBar-container .btns .right[data-v-5c7eeed9]{display:flex;align-items:center;text-align:right}[data-v-c022c16d] .vxe-table-custom-wrapper.placement--top-right.is--active{max-height:400px!important}[data-v-c022c16d] .vxe-table.cell-copy-enabled .vxe-body--column{-webkit-user-select:none;user-select:none}[data-v-c022c16d] .vxe-table.cell-copy-enabled .vxe-body--column.cell-selected{background-color:#409eff26!important;position:relative}[data-v-c022c16d] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-top:before{content:"";position:absolute;top:0;left:0;right:0;height:1px;background-color:#409eff;pointer-events:none;z-index:10}[data-v-c022c16d] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-bottom:after{content:"";position:absolute;bottom:0;left:0;right:0;height:1px;background-color:#409eff;pointer-events:none;z-index:10}[data-v-c022c16d] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-left{border-left:1px solid #409eff!important}[data-v-c022c16d] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-right{border-right:1px solid #409eff!important}.drawer-content .drawer-btn{position:absolute;box-sizing:border-box;bottom:0;width:100%;text-align:right;padding:10px 60px 20px 20px;background-color:#fff;z-index:10}
1
+ .cmp-icon[data-v-078a95a6],.cmp-icon[data-v-733f9daa]{padding:0!important}.confirm-button-wrapper[data-v-24cb35fd],.ImportButton[data-v-ea0a4c60]{display:inline-block;line-height:1;vertical-align:middle}.searchBar-container .searchBar[data-v-5c7eeed9]{overflow:hidden;transition:all .3s}.searchBar-container[data-v-5c7eeed9] .el-form-item{margin-bottom:8px!important}.searchBar-container .btns[data-v-5c7eeed9]{display:flex;justify-content:space-between;align-items:center}.searchBar-container .btns .left[data-v-5c7eeed9]{display:flex;align-items:center}.searchBar-container .btns .left[data-v-5c7eeed9] .el-tabs__header{margin:0}.searchBar-container .btns .right[data-v-5c7eeed9]{display:flex;align-items:center;text-align:right}[data-v-c022c16d] .vxe-table-custom-wrapper.placement--top-right.is--active{max-height:400px!important}[data-v-c022c16d] .vxe-table.cell-copy-enabled .vxe-body--column{-webkit-user-select:none;user-select:none}[data-v-c022c16d] .vxe-table.cell-copy-enabled .vxe-body--column.cell-selected{background-color:#409eff26!important;position:relative}[data-v-c022c16d] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-top:before{content:"";position:absolute;top:0;left:0;right:0;height:1px;background-color:#409eff;pointer-events:none;z-index:10}[data-v-c022c16d] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-bottom:after{content:"";position:absolute;bottom:0;left:0;right:0;height:1px;background-color:#409eff;pointer-events:none;z-index:10}[data-v-c022c16d] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-left{border-left:1px solid #409eff!important}[data-v-c022c16d] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-right{border-right:1px solid #409eff!important}.drawer-content .drawer-btn{position:absolute;box-sizing:border-box;bottom:0;width:100%;text-align:right;padding:10px 60px 20px 20px;background-color:#fff;z-index:10}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "joy-admin-components",
3
- "version": "0.2.67",
3
+ "version": "0.2.68",
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",