joy-admin-components 0.2.73 → 0.2.74

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.
@@ -75,26 +75,26 @@ var mt = { exports: {} };
75
75
  };
76
76
  var p = i.utcOffset;
77
77
  i.utcOffset = function(c, v) {
78
- var w = this.$utils().u;
79
- if (w(c))
80
- return this.$u ? 0 : w(this.$offset) ? p.call(this) : this.$offset;
78
+ var C = this.$utils().u;
79
+ if (C(c))
80
+ return this.$u ? 0 : C(this.$offset) ? p.call(this) : this.$offset;
81
81
  if (typeof c == "string" && (c = function(V) {
82
82
  V === void 0 && (V = "");
83
83
  var K = V.match(a);
84
84
  if (!K)
85
85
  return null;
86
- var I = ("" + K[0]).match(r) || ["-", 0, 0], A = I[0], $ = 60 * +I[1] + +I[2];
87
- return $ === 0 ? 0 : A === "+" ? $ : -$;
86
+ var I = ("" + K[0]).match(r) || ["-", 0, 0], q = I[0], S = 60 * +I[1] + +I[2];
87
+ return S === 0 ? 0 : q === "+" ? S : -S;
88
88
  }(c), c === null))
89
89
  return this;
90
90
  var x = Math.abs(c) <= 16 ? 60 * c : c;
91
91
  if (x === 0)
92
92
  return this.utc(v);
93
- var C = this.clone();
93
+ var b = this.clone();
94
94
  if (v)
95
- return C.$offset = x, C.$u = !1, C;
96
- var S = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
97
- return (C = this.local().add(x + S, n)).$offset = x, C.$x.$localOffset = S, C;
95
+ return b.$offset = x, b.$u = !1, b;
96
+ var $ = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
97
+ return (b = this.local().add(x + $, n)).$offset = x, b.$x.$localOffset = $, b;
98
98
  };
99
99
  var y = i.format;
100
100
  i.format = function(c) {
@@ -115,11 +115,11 @@ var mt = { exports: {} };
115
115
  return c === "s" && this.$offset ? s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : h.call(this);
116
116
  };
117
117
  var f = i.diff;
118
- i.diff = function(c, v, w) {
118
+ i.diff = function(c, v, C) {
119
119
  if (c && this.$u === c.$u)
120
- return f.call(this, c, v, w);
121
- var x = this.local(), C = s(c).local();
122
- return f.call(x, C, v, w);
120
+ return f.call(this, c, v, C);
121
+ var x = this.local(), b = s(c).local();
122
+ return f.call(x, b, v, C);
123
123
  };
124
124
  };
125
125
  });
@@ -135,28 +135,28 @@ var gt = { exports: {} };
135
135
  return function(r, o, l) {
136
136
  var s, i = function(y, h, f) {
137
137
  f === void 0 && (f = {});
138
- var c = new Date(y), v = function(w, x) {
138
+ var c = new Date(y), v = function(C, x) {
139
139
  x === void 0 && (x = {});
140
- var C = x.timeZoneName || "short", S = w + "|" + C, V = a[S];
141
- return V || (V = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: w, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: C }), a[S] = V), V;
140
+ var b = x.timeZoneName || "short", $ = C + "|" + b, V = a[$];
141
+ return V || (V = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: C, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: b }), a[$] = V), V;
142
142
  }(h, f);
143
143
  return v.formatToParts(c);
144
144
  }, g = function(y, h) {
145
145
  for (var f = i(y, h), c = [], v = 0; v < f.length; v += 1) {
146
- var w = f[v], x = w.type, C = w.value, S = n[x];
147
- S >= 0 && (c[S] = parseInt(C, 10));
146
+ var C = f[v], x = C.type, b = C.value, $ = n[x];
147
+ $ >= 0 && (c[$] = parseInt(b, 10));
148
148
  }
149
- var V = c[3], K = V === 24 ? 0 : V, I = c[0] + "-" + c[1] + "-" + c[2] + " " + K + ":" + c[4] + ":" + c[5] + ":000", A = +y;
150
- return (l.utc(I).valueOf() - (A -= A % 1e3)) / 6e4;
149
+ var V = c[3], K = V === 24 ? 0 : V, I = c[0] + "-" + c[1] + "-" + c[2] + " " + K + ":" + c[4] + ":" + c[5] + ":000", q = +y;
150
+ return (l.utc(I).valueOf() - (q -= q % 1e3)) / 6e4;
151
151
  }, m = o.prototype;
152
152
  m.tz = function(y, h) {
153
153
  y === void 0 && (y = s);
154
- var f, c = this.utcOffset(), v = this.toDate(), w = v.toLocaleString("en-US", { timeZone: y }), x = Math.round((v - new Date(w)) / 1e3 / 60), C = 15 * -Math.round(v.getTimezoneOffset() / 15) - x;
155
- if (!Number(C))
154
+ var f, c = this.utcOffset(), v = this.toDate(), C = v.toLocaleString("en-US", { timeZone: y }), x = Math.round((v - new Date(C)) / 1e3 / 60), b = 15 * -Math.round(v.getTimezoneOffset() / 15) - x;
155
+ if (!Number(b))
156
156
  f = this.utcOffset(0, h);
157
- else if (f = l(w, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(C, !0), h) {
158
- var S = f.utcOffset();
159
- f = f.add(c - S, "minute");
157
+ else if (f = l(C, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(b, !0), h) {
158
+ var $ = f.utcOffset();
159
+ f = f.add(c - $, "minute");
160
160
  }
161
161
  return f.$x.$timezone = y, f;
162
162
  }, m.offsetName = function(y) {
@@ -172,16 +172,16 @@ var gt = { exports: {} };
172
172
  var f = l(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
173
173
  return p.call(f, y, h).tz(this.$x.$timezone, !0);
174
174
  }, l.tz = function(y, h, f) {
175
- var c = f && h, v = f || h || s, w = g(+l(), v);
175
+ var c = f && h, v = f || h || s, C = g(+l(), v);
176
176
  if (typeof y != "string")
177
177
  return l(y).tz(v);
178
- var x = function(K, I, A) {
179
- var $ = K - 60 * I * 1e3, ee = g($, A);
178
+ var x = function(K, I, q) {
179
+ var S = K - 60 * I * 1e3, ee = g(S, q);
180
180
  if (I === ee)
181
- return [$, I];
182
- var b = g($ -= 60 * (ee - I) * 1e3, A);
183
- return ee === b ? [$, ee] : [K - 60 * Math.min(ee, b) * 1e3, Math.max(ee, b)];
184
- }(l.utc(y, c).valueOf(), w, v), C = x[0], S = x[1], V = l(C).utcOffset(S);
181
+ return [S, I];
182
+ var w = g(S -= 60 * (ee - I) * 1e3, q);
183
+ return ee === w ? [S, ee] : [K - 60 * Math.min(ee, w) * 1e3, Math.max(ee, w)];
184
+ }(l.utc(y, c).valueOf(), C, v), b = x[0], $ = x[1], V = l(b).utcOffset($);
185
185
  return V.$x.$timezone = v, V;
186
186
  }, l.tz.guess = function() {
187
187
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
@@ -410,8 +410,8 @@ async function nn(e, t) {
410
410
  m && (l.getImages().forEach((h) => {
411
411
  const { tl: f } = h.range, c = r.model.media.find((v) => v.index === h.imageId);
412
412
  if (c) {
413
- const v = c.buffer.toString("base64"), w = `data:image/${c.extension};base64,${v}`, x = `${Math.ceil(f.row)}_${Math.ceil(f.col)}`;
414
- p[x] ? p[x].push(w) : p[x] = [w];
413
+ const v = c.buffer.toString("base64"), C = `data:image/${c.extension};base64,${v}`, x = `${Math.ceil(f.row)}_${Math.ceil(f.col)}`;
414
+ p[x] ? p[x].push(C) : p[x] = [C];
415
415
  }
416
416
  }), console.log("withImages-imageMap", p)), l.eachRow(function(y, h) {
417
417
  if (h > a) {
@@ -419,16 +419,16 @@ async function nn(e, t) {
419
419
  _excelRowNumber: h
420
420
  }, c = !0;
421
421
  Object.keys(g).forEach((v) => {
422
- var V;
423
- let [w, x] = g[v].split(Ue);
424
- const C = y.getCell(w);
425
- let S;
422
+ var V, K;
423
+ let [C, x] = g[v].split(Ue);
424
+ const b = y.getCell(C);
425
+ let $;
426
426
  if (x == "image" && m) {
427
- const K = C._column._number, I = `${h}_${K}`;
428
- S = p[I] || "";
427
+ const I = b._column._number, q = `${h}_${I}`;
428
+ $ = p[q] || "";
429
429
  } else
430
- C.result != null ? S = C.result : (V = C.value) != null && V.richText ? S = C.value.richText.reduce((K, I) => K + I.text, "") : C.type == 4 && C.value ? S = Fe(C.value).utc().format("YYYY-MM-DD HH:mm:ss") : S = C.value;
431
- S && x == "option" && (S = S.split(Ue)[1]), f[v] = S, S && (c = !1);
430
+ b.result != null ? $ = b.result : (V = b.value) != null && V.richText ? $ = b.value.richText.reduce((I, q) => I + q.text, "") : (K = b.value) != null && K.hyperlink ? $ = b.value.text || b.value.hyperlink : b.type == 4 && b.value ? $ = Fe(b.value).utc().format("YYYY-MM-DD HH:mm:ss") : $ = b.value;
431
+ $ && x == "option" && ($ = $.split(Ue)[1]), f[v] = $, $ && (c = !1);
432
432
  }), c || i.push(f);
433
433
  }
434
434
  }), o[l._name] = i;
@@ -465,17 +465,17 @@ async function ln(e, t) {
465
465
  let { header: g, key: m, width: p, option: y, numFmt: h, locked: f, optionFormater: c } = i;
466
466
  const v = a.getColumn(m);
467
467
  if (v.numFmt = on[h] || h, v.width = p || r, v.protection = { locked: f === !0 }, y) {
468
- const w = n.addWorksheet(m);
469
- w.state = "hidden", c || (c = (x) => `${x.label}${Ue}${x.value}`), w.getColumn(1).values = y.map(c), Array(100).fill("").forEach((x, C) => {
470
- if (C > 0) {
471
- const S = xe();
472
- a.getCell(`${v.letter}${C}`).dataValidation = {
468
+ const C = n.addWorksheet(m);
469
+ C.state = "hidden", c || (c = (x) => `${x.label}${Ue}${x.value}`), C.getColumn(1).values = y.map(c), Array(100).fill("").forEach((x, b) => {
470
+ if (b > 0) {
471
+ const $ = xe();
472
+ a.getCell(`${v.letter}${b}`).dataValidation = {
473
473
  type: "list",
474
474
  formulae: [`${m}!$A$1:$A$${y.length}`],
475
475
  showErrorMessage: !0,
476
- error: S("excel.invalidInput"),
476
+ error: $("excel.invalidInput"),
477
477
  errorStyle: "stop",
478
- errorMessage: S("excel.invalidOption")
478
+ errorMessage: $("excel.invalidOption")
479
479
  };
480
480
  }
481
481
  });
@@ -664,31 +664,31 @@ const ke = (e, t) => {
664
664
  const n = e, a = Tt(), { t: r, locale: o } = we(), l = Dt(e, "modelValue"), s = ue(() => a["value-key"] != null), i = j(""), g = ue(() => {
665
665
  if (a.remote !== void 0)
666
666
  return n.data;
667
- const b = yt(i.value), { data: k, labelValue: R } = n, _ = k || y.value;
668
- if (b.length == 0)
667
+ const w = yt(i.value), { data: k, labelValue: R } = n, _ = k || y.value;
668
+ if (w.length == 0)
669
669
  return _;
670
670
  const { label: oe, labelEn: ge } = R;
671
671
  let M = o.value == "en_us" ? ge || "i18nName" : oe;
672
- return b.length == 1 ? _.filter(
673
- (fe) => fe[M].toLowerCase().includes(b[0].toLowerCase())
672
+ return w.length == 1 ? _.filter(
673
+ (fe) => fe[M].toLowerCase().includes(w[0].toLowerCase())
674
674
  ) : _.filter((fe) => {
675
675
  let _e = !1;
676
- return _e = b.some((Le) => fe[M].toLowerCase() == Le.toLowerCase()), _e;
676
+ return _e = w.some((Le) => fe[M].toLowerCase() == Le.toLowerCase()), _e;
677
677
  });
678
678
  }), m = ue({
679
679
  get() {
680
680
  return a.multiple == null || l.value == null ? !1 : l.value.length == g.value.length;
681
681
  },
682
- set(b) {
683
- return b;
682
+ set(w) {
683
+ return w;
684
684
  }
685
685
  }), p = t, y = j([]), h = async () => {
686
- const { data: b } = await n.api();
687
- y.value = [...b], p("success", y);
686
+ const { data: w } = await n.api();
687
+ y.value = [...w], p("success", y);
688
688
  };
689
689
  n.api && h();
690
- function f(b) {
691
- p("change", b), c.value && be(() => {
690
+ function f(w) {
691
+ p("change", w), c.value && be(() => {
692
692
  n.optionClick && n.optionClick(c.value), c.value = null;
693
693
  });
694
694
  }
@@ -698,69 +698,69 @@ const ke = (e, t) => {
698
698
  n.optionClick && n.optionClick(null);
699
699
  });
700
700
  }
701
- function w(b) {
702
- c.value = b;
701
+ function C(w) {
702
+ c.value = w;
703
703
  }
704
- const x = n.labelValue.label.split("-"), C = (b) => {
704
+ const x = n.labelValue.label.split("-"), b = (w) => {
705
705
  if (x.length == 1) {
706
706
  if (n.changeLocal)
707
- return r(b[n.labelValue.label]);
708
- let k = o.value == "en_us" ? b[n.labelValue.labelEn || "i18nName"] : b[n.labelValue.label];
709
- return k = k || b[n.labelValue.label], k + "";
707
+ return r(w[n.labelValue.label]);
708
+ let k = o.value == "en_us" ? w[n.labelValue.labelEn || "i18nName"] : w[n.labelValue.label];
709
+ return k = k || w[n.labelValue.label], k + "";
710
710
  } else {
711
711
  let k = [];
712
712
  return x.forEach((R) => {
713
- k.push(b[R]);
713
+ k.push(w[R]);
714
714
  }), k.join("-");
715
715
  }
716
716
  };
717
- function S(b) {
717
+ function $(w) {
718
718
  let k = n.data ? n.data : y.value;
719
- l.value = b ? k.map((R) => s.value ? R : R[n.labelValue.value]) : [], be(() => {
719
+ l.value = w ? k.map((R) => s.value ? R : R[n.labelValue.value]) : [], be(() => {
720
720
  p("change", l.value), p("changeAll", l.value, k);
721
721
  });
722
722
  }
723
- function V(b) {
724
- p("change", s.value ? b : b[n.labelValue.value]), be(() => {
725
- n.optionClick && n.optionClick(b);
723
+ function V(w) {
724
+ p("change", s.value ? w : w[n.labelValue.value]), be(() => {
725
+ n.optionClick && n.optionClick(w);
726
726
  });
727
727
  }
728
- function K(b) {
729
- const k = s.value ? b : b[n.labelValue.value], R = s.value ? l.value.some((_) => _[n.labelValue.value] === b[n.labelValue.value]) : l.value.includes(k);
728
+ function K(w) {
729
+ const k = s.value ? w : w[n.labelValue.value], R = s.value ? l.value.some((_) => _[n.labelValue.value] === w[n.labelValue.value]) : l.value.includes(k);
730
730
  return !!(n.maxLimit > 0 && l.value.length >= n.maxLimit && !R || n.minLimit > 0 && l.value.length === n.minLimit && R);
731
731
  }
732
- function I(b) {
733
- return b.map((k) => ({
732
+ function I(w) {
733
+ return w.map((k) => ({
734
734
  ...k,
735
- label: C(k),
735
+ label: b(k),
736
736
  value: s.value ? k : k[n.labelValue.value]
737
737
  }));
738
738
  }
739
- const A = j([]), $ = n.data ? n.data : y.value;
740
- A.value = I($), Re(
739
+ const q = j([]), S = n.data ? n.data : y.value;
740
+ q.value = I(S), Re(
741
741
  () => n.data ? n.data : y.value,
742
- (b) => {
742
+ (w) => {
743
743
  var R;
744
- const k = I(b);
745
- if (k.length !== A.value.length)
746
- A.value = k;
744
+ const k = I(w);
745
+ if (k.length !== q.value.length)
746
+ q.value = k;
747
747
  else {
748
748
  let _ = !1;
749
749
  for (let oe = 0; oe < k.length; oe++)
750
- if (k[oe].value !== ((R = A.value[oe]) == null ? void 0 : R.value)) {
750
+ if (k[oe].value !== ((R = q.value[oe]) == null ? void 0 : R.value)) {
751
751
  _ = !0;
752
752
  break;
753
753
  }
754
- _ && (A.value = k);
754
+ _ && (q.value = k);
755
755
  }
756
756
  },
757
757
  { deep: !0 }
758
758
  );
759
- const ee = ue(() => a.multiple !== void 0 && (n.maxLimit > 0 || n.minLimit > 0) ? A.value.map((b) => ({
760
- ...b,
761
- disabled: K(b)
762
- })) : A.value);
763
- return (b, k) => {
759
+ const ee = ue(() => a.multiple !== void 0 && (n.maxLimit > 0 || n.minLimit > 0) ? q.value.map((w) => ({
760
+ ...w,
761
+ disabled: K(w)
762
+ })) : q.value);
763
+ return (w, k) => {
764
764
  const R = O("el-checkbox"), _ = O("el-select-v2"), oe = O("el-option"), ge = O("el-select");
765
765
  return N(a).v2 != null ? (E(), W(_, de({
766
766
  key: 0,
@@ -776,7 +776,7 @@ const ke = (e, t) => {
776
776
  }), at({
777
777
  default: D(({ item: M }) => [
778
778
  ie("div", {
779
- onClick: (pe) => w(M)
779
+ onClick: (pe) => C(M)
780
780
  }, te(M.label), 9, sn)
781
781
  ]),
782
782
  _: 2
@@ -784,15 +784,15 @@ const ke = (e, t) => {
784
784
  N(a).multiple != null ? {
785
785
  name: "header",
786
786
  fn: D(() => [
787
- Q(b.$slots, "header", {}, () => [
787
+ Q(w.$slots, "header", {}, () => [
788
788
  z(R, {
789
789
  class: "mgl20",
790
790
  modelValue: m.value,
791
791
  "onUpdate:modelValue": k[0] || (k[0] = (M) => m.value = M),
792
- onChange: S
792
+ onChange: $
793
793
  }, {
794
794
  default: D(() => [
795
- ne(te(b.$t("quan-xuan")), 1)
795
+ ne(te(w.$t("quan-xuan")), 1)
796
796
  ]),
797
797
  _: 1
798
798
  }, 8, ["modelValue"])
@@ -811,22 +811,22 @@ const ke = (e, t) => {
811
811
  clearable: ""
812
812
  }, N(a), { onClear: v }), {
813
813
  default: D(() => [
814
- N(a).multiple != null && e.showCheckAll && e.maxLimit == null ? Q(b.$slots, "header", { key: 0 }, () => [
814
+ N(a).multiple != null && e.showCheckAll && e.maxLimit == null ? Q(w.$slots, "header", { key: 0 }, () => [
815
815
  z(R, {
816
816
  class: "mgl20",
817
817
  modelValue: m.value,
818
818
  "onUpdate:modelValue": k[2] || (k[2] = (M) => m.value = M),
819
- onChange: S
819
+ onChange: $
820
820
  }, {
821
821
  default: D(() => [
822
- ne(te(b.$t("quan-xuan")), 1)
822
+ ne(te(w.$t("quan-xuan")), 1)
823
823
  ]),
824
824
  _: 1
825
825
  }, 8, ["modelValue"])
826
826
  ], !0) : me("", !0),
827
827
  (E(!0), ce(Ve, null, rt(g.value, (M, pe) => (E(), W(oe, {
828
828
  key: pe,
829
- label: C(M),
829
+ label: b(M),
830
830
  disabled: N(a).multiple != null && (e.maxLimit > 0 || e.minLimit > 0) ? K(M) : !1,
831
831
  onClick: qe((fe) => V(M), ["stop"]),
832
832
  value: s.value ? M : M[e.labelValue.value]
@@ -976,8 +976,8 @@ const vn = { key: 0 }, bn = { class: "btns" }, wn = { class: "left" }, Cn = { cl
976
976
  function m() {
977
977
  r("confirm");
978
978
  }
979
- function p(w) {
980
- w.option.onClear && w.option.onClear(), r("confirm");
979
+ function p(C) {
980
+ C.option.onClear && C.option.onClear(), r("confirm");
981
981
  }
982
982
  function y() {
983
983
  r("reset");
@@ -990,13 +990,13 @@ const vn = { key: 0 }, bn = { class: "btns" }, wn = { class: "left" }, Cn = { cl
990
990
  }
991
991
  const c = ut(a.form.items);
992
992
  function v() {
993
- a.form.items.forEach((w) => {
994
- const x = c.find((C) => C.key == w.key);
995
- x && (w.value = x.value);
993
+ a.form.items.forEach((C) => {
994
+ const x = c.find((b) => b.key == C.key);
995
+ x && (C.value = x.value);
996
996
  });
997
997
  }
998
- return t({ getPrm: f, reset: v }), (w, x) => {
999
- const C = O("el-input"), S = O("el-date-picker"), V = O("el-form-item"), K = O("el-form"), I = O("el-link"), A = O("el-button");
998
+ return t({ getPrm: f, reset: v }), (C, x) => {
999
+ const b = O("el-input"), $ = O("el-date-picker"), V = O("el-form-item"), K = O("el-form"), I = O("el-link"), q = O("el-button");
1000
1000
  return E(), ce("div", {
1001
1001
  class: "searchBar-container mgt10 mgb10",
1002
1002
  onKeydown: Mt(m, ["enter"])
@@ -1010,47 +1010,47 @@ const vn = { key: 0 }, bn = { class: "btns" }, wn = { class: "left" }, Cn = { cl
1010
1010
  model: e.form.data
1011
1011
  }, {
1012
1012
  default: D(() => [
1013
- (E(!0), ce(Ve, null, rt(e.form.items.filter(($) => !$.hidden), ($) => (E(), ce(Ve, {
1014
- key: $.key
1013
+ (E(!0), ce(Ve, null, rt(e.form.items.filter((S) => !S.hidden), (S) => (E(), ce(Ve, {
1014
+ key: S.key
1015
1015
  }, [
1016
- $.type == "br" ? (E(), ce("br", vn)) : (E(), W(V, {
1016
+ S.type == "br" ? (E(), ce("br", vn)) : (E(), W(V, {
1017
1017
  key: 1,
1018
- label: $.name
1018
+ label: S.name
1019
1019
  }, {
1020
1020
  default: D(() => {
1021
- var ee, b;
1021
+ var ee, w;
1022
1022
  return [
1023
- $.type === "input" ? (E(), W(C, {
1023
+ S.type === "input" ? (E(), W(b, {
1024
1024
  key: 0,
1025
- modelValue: $.value,
1026
- "onUpdate:modelValue": (k) => $.value = k,
1027
- class: it(((ee = $.option) == null ? void 0 : ee.class) || "w150"),
1028
- placeholder: w.$t("qing-shu-ru"),
1025
+ modelValue: S.value,
1026
+ "onUpdate:modelValue": (k) => S.value = k,
1027
+ class: it(((ee = S.option) == null ? void 0 : ee.class) || "w150"),
1028
+ placeholder: C.$t("qing-shu-ru"),
1029
1029
  clearable: ""
1030
- }, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) : $.type === "custom" ? (E(), W(st($.render), { key: 1 })) : me("", !0),
1031
- $.type === "select" ? (E(), W(un, de({
1030
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) : S.type === "custom" ? (E(), W(st(S.render), { key: 1 })) : me("", !0),
1031
+ S.type === "select" ? (E(), W(un, de({
1032
1032
  key: 2,
1033
- class: ((b = $.option) == null ? void 0 : b.class) || "w150",
1034
- modelValue: $.value,
1035
- "onUpdate:modelValue": (k) => $.value = k
1036
- }, { ref_for: !0 }, $.option, {
1033
+ class: ((w = S.option) == null ? void 0 : w.class) || "w150",
1034
+ modelValue: S.value,
1035
+ "onUpdate:modelValue": (k) => S.value = k
1036
+ }, { ref_for: !0 }, S.option, {
1037
1037
  onChange: m,
1038
- onClear: (k) => p($),
1039
- placeholder: w.$t("qing-xuan-ze")
1038
+ onClear: (k) => p(S),
1039
+ placeholder: C.$t("qing-xuan-ze")
1040
1040
  }), null, 16, ["class", "modelValue", "onUpdate:modelValue", "onClear", "placeholder"])) : me("", !0),
1041
- $.type === "date" ? (E(), W(S, de({
1041
+ S.type === "date" ? (E(), W($, de({
1042
1042
  key: 3,
1043
- class: { datetimerange: "w300", daterange: "w200" }[$.dateType] || "w100",
1044
- modelValue: $.value,
1045
- "onUpdate:modelValue": (k) => $.value = k,
1046
- "value-format": i[$.dateType] || "YYYY-MM-DD",
1047
- type: $.dateType || "date",
1048
- onFocus: (k) => l.value = $,
1043
+ class: { datetimerange: "w300", daterange: "w200" }[S.dateType] || "w100",
1044
+ modelValue: S.value,
1045
+ "onUpdate:modelValue": (k) => S.value = k,
1046
+ "value-format": i[S.dateType] || "YYYY-MM-DD",
1047
+ type: S.dateType || "date",
1048
+ onFocus: (k) => l.value = S,
1049
1049
  onChange: (k) => h(),
1050
- placeholder: w.$t("qing-xuan-ze"),
1051
- "start-placeholder": w.$t("kai-shi-shi-jian"),
1052
- "end-placeholder": w.$t("jie-shu-shi-jian")
1053
- }, { ref_for: !0 }, $.option), null, 16, ["class", "modelValue", "onUpdate:modelValue", "value-format", "type", "onFocus", "onChange", "placeholder", "start-placeholder", "end-placeholder"])) : me("", !0)
1050
+ placeholder: C.$t("qing-xuan-ze"),
1051
+ "start-placeholder": C.$t("kai-shi-shi-jian"),
1052
+ "end-placeholder": C.$t("jie-shu-shi-jian")
1053
+ }, { ref_for: !0 }, S.option), null, 16, ["class", "modelValue", "onUpdate:modelValue", "value-format", "type", "onFocus", "onChange", "placeholder", "start-placeholder", "end-placeholder"])) : me("", !0)
1054
1054
  ];
1055
1055
  }),
1056
1056
  _: 2
@@ -1062,7 +1062,7 @@ const vn = { key: 0 }, bn = { class: "btns" }, wn = { class: "left" }, Cn = { cl
1062
1062
  ], 4),
1063
1063
  ie("div", bn, [
1064
1064
  ie("div", wn, [
1065
- Q(w.$slots, "table-header-left", {}, void 0, !0)
1065
+ Q(C.$slots, "table-header-left", {}, void 0, !0)
1066
1066
  ]),
1067
1067
  ie("div", Cn, [
1068
1068
  z(I, {
@@ -1080,25 +1080,25 @@ const vn = { key: 0 }, bn = { class: "btns" }, wn = { class: "left" }, Cn = { cl
1080
1080
  ]),
1081
1081
  _: 1
1082
1082
  }),
1083
- z(A, {
1083
+ z(q, {
1084
1084
  type: "primary",
1085
1085
  onClick: m
1086
1086
  }, {
1087
1087
  default: D(() => [
1088
- ne(te(w.$t("shai-xuan")), 1)
1088
+ ne(te(C.$t("shai-xuan")), 1)
1089
1089
  ]),
1090
1090
  _: 1
1091
1091
  }),
1092
- z(A, {
1092
+ z(q, {
1093
1093
  type: "primary",
1094
1094
  onClick: y
1095
1095
  }, {
1096
1096
  default: D(() => [
1097
- ne(te(w.$t("chong-zhi")), 1)
1097
+ ne(te(C.$t("chong-zhi")), 1)
1098
1098
  ]),
1099
1099
  _: 1
1100
1100
  }),
1101
- Q(w.$slots, "btn", {}, void 0, !0)
1101
+ Q(C.$slots, "btn", {}, void 0, !0)
1102
1102
  ])
1103
1103
  ])
1104
1104
  ], 32);
@@ -1197,16 +1197,16 @@ const $n = { class: "center" }, Sn = {
1197
1197
  [p]: 1,
1198
1198
  [y]: l.searchForm.defaultPageSize || o.defaultPageSize,
1199
1199
  total: 0
1200
- }), f = j(null), c = j(null), v = j(450), w = Be(() => {
1200
+ }), f = j(null), c = j(null), v = j(450), C = Be(() => {
1201
1201
  be(() => {
1202
1202
  if (!c.value)
1203
1203
  return;
1204
- const u = c.value.getBoundingClientRect(), F = window.innerHeight, T = u.top, B = 100, G = F - T - B, q = 200;
1205
- v.value = Math.max(G, q);
1204
+ const u = c.value.getBoundingClientRect(), F = window.innerHeight, T = u.top, B = 100, G = F - T - B, P = 200;
1205
+ v.value = Math.max(G, P);
1206
1206
  });
1207
1207
  }, 100), x = () => {
1208
- w();
1209
- }, C = () => {
1208
+ C();
1209
+ }, b = () => {
1210
1210
  if (!l.searchForm.enableCellCopy && !o.enableCellCopy)
1211
1211
  return !1;
1212
1212
  const d = f.value;
@@ -1216,12 +1216,12 @@ const $n = { class: "center" }, Sn = {
1216
1216
  return u.classList.add("cell-copy-enabled"), u.setAttribute("tabindex", "-1"), u.removeEventListener("mousedown", ge), u.removeEventListener("mousemove", M), u.removeEventListener("mouseup", pe), u.removeEventListener("keydown", De), u.addEventListener("mousedown", ge), u.addEventListener("mousemove", M), u.addEventListener("mouseup", pe), u.addEventListener("keydown", De), !0;
1217
1217
  };
1218
1218
  lt(() => {
1219
- w(), window.addEventListener("resize", x), (l.searchForm.enableCellCopy || o.enableCellCopy) && (document.addEventListener("mouseup", Ne), document.addEventListener("mousedown", We), setTimeout(() => {
1220
- C();
1219
+ C(), window.addEventListener("resize", x), (l.searchForm.enableCellCopy || o.enableCellCopy) && (document.addEventListener("mouseup", Ne), document.addEventListener("mousedown", We), setTimeout(() => {
1220
+ b();
1221
1221
  }, 500));
1222
1222
  }), Ot(() => {
1223
1223
  (l.searchForm.enableCellCopy || o.enableCellCopy) && setTimeout(() => {
1224
- C();
1224
+ b();
1225
1225
  }, 500);
1226
1226
  }), Vt(() => {
1227
1227
  if (window.removeEventListener("resize", x), l.searchForm.enableCellCopy || o.enableCellCopy) {
@@ -1233,7 +1233,7 @@ const $n = { class: "center" }, Sn = {
1233
1233
  }
1234
1234
  }
1235
1235
  });
1236
- const S = ue(() => R.value.height || v.value);
1236
+ const $ = ue(() => R.value.height || v.value);
1237
1237
  let V;
1238
1238
  async function K(d) {
1239
1239
  const { dataFormat: u } = l.tableConfig;
@@ -1243,20 +1243,20 @@ const $n = { class: "center" }, Sn = {
1243
1243
  });
1244
1244
  if (F == 200) {
1245
1245
  let B = [];
1246
- for (const q of o.responseDataKeys.rows)
1247
- if (T[q]) {
1248
- B = T[q];
1246
+ for (const P of o.responseDataKeys.rows)
1247
+ if (T[P]) {
1248
+ B = T[P];
1249
1249
  break;
1250
1250
  }
1251
1251
  let G = 0;
1252
- for (const q of o.responseDataKeys.total)
1253
- if (T[q] !== void 0) {
1254
- G = T[q];
1252
+ for (const P of o.responseDataKeys.total)
1253
+ if (T[P] !== void 0) {
1254
+ G = T[P];
1255
1255
  break;
1256
1256
  }
1257
1257
  i.value = u ? u(B) : B, h.total = G, V = T.nextSearchAfter, (l.searchForm.enableCellCopy || o.enableCellCopy) && be(() => {
1258
1258
  setTimeout(() => {
1259
- C();
1259
+ b();
1260
1260
  }, 100);
1261
1261
  });
1262
1262
  }
@@ -1270,7 +1270,7 @@ const $n = { class: "center" }, Sn = {
1270
1270
  ...F
1271
1271
  });
1272
1272
  }
1273
- function A() {
1273
+ function q() {
1274
1274
  const { reset: d } = l.tableConfig;
1275
1275
  d && d(), l.searchForm.items.forEach((u) => {
1276
1276
  const F = m.find((T) => Qe(u.key) && Qe(T.key) ? u.key.join(",") == T.key.join(",") : T.key == u.key);
@@ -1278,13 +1278,13 @@ const $n = { class: "center" }, Sn = {
1278
1278
  }), I();
1279
1279
  }
1280
1280
  l.api && l.immediate && I();
1281
- function $() {
1281
+ function S() {
1282
1282
  return { ...h, ...je(l.searchForm.items) };
1283
1283
  }
1284
1284
  const ee = () => {
1285
1285
  const d = f.value;
1286
1286
  d && d.clearSort();
1287
- }, b = Ee({
1287
+ }, w = Ee({
1288
1288
  storage: !0
1289
1289
  }), k = Ee({
1290
1290
  drag: !0,
@@ -1295,7 +1295,7 @@ const $n = { class: "center" }, Sn = {
1295
1295
  return {
1296
1296
  headerAlign: "left",
1297
1297
  align: "center",
1298
- customConfig: { ...b, ...d },
1298
+ customConfig: { ...w, ...d },
1299
1299
  columnConfig: { ...k, ...u },
1300
1300
  // 列过多时 自动宽度 虚拟滚动会闪屏 关闭虚拟滚动
1301
1301
  "virtual-x-config": {
@@ -1330,27 +1330,27 @@ const $n = { class: "center" }, Sn = {
1330
1330
  if (G != null)
1331
1331
  B = parseInt(G, 10);
1332
1332
  else {
1333
- const P = F.parentElement;
1334
- B = Array.from(P.querySelectorAll(".vxe-body--row")).indexOf(F);
1333
+ const A = F.parentElement;
1334
+ B = Array.from(A.querySelectorAll(".vxe-body--row")).indexOf(F);
1335
1335
  }
1336
1336
  if (B < 0)
1337
1337
  return null;
1338
- let q = -1;
1338
+ let P = -1;
1339
1339
  const se = u.getAttribute("data-colid");
1340
- if (se && (q = T.getColumns().findIndex((L) => L.id === se)), q < 0) {
1340
+ if (se && (P = T.getColumns().findIndex((L) => L.id === se)), P < 0) {
1341
1341
  const L = Array.from(F.querySelectorAll(".vxe-body--column")).indexOf(u), H = !!u.closest(".vxe-table--fixed-left-wrapper"), J = !!u.closest(".vxe-table--fixed-right-wrapper"), Y = T.getColumns();
1342
1342
  if (H) {
1343
1343
  const X = Y.filter((Z) => Z.fixed === "left");
1344
- L < X.length && (q = Y.indexOf(X[L]));
1344
+ L < X.length && (P = Y.indexOf(X[L]));
1345
1345
  } else if (J) {
1346
1346
  const X = Y.filter((Z) => Z.fixed === "right");
1347
- L < X.length && (q = Y.indexOf(X[L]));
1347
+ L < X.length && (P = Y.indexOf(X[L]));
1348
1348
  } else {
1349
1349
  const X = l.searchForm.showCheckBox ? 1 : 0;
1350
- q = Y.filter((le) => le.fixed === "left").length + L - X;
1350
+ P = Y.filter((le) => le.fixed === "left").length + L - X;
1351
1351
  }
1352
1352
  }
1353
- return q < 0 ? null : { rowIndex: B, colIndex: q, cell: u };
1353
+ return P < 0 ? null : { rowIndex: B, colIndex: P, cell: u };
1354
1354
  }, ge = (d) => {
1355
1355
  const u = oe(d.target);
1356
1356
  if (!u) {
@@ -1392,12 +1392,12 @@ const $n = { class: "center" }, Sn = {
1392
1392
  _.selectedCells = [];
1393
1393
  return;
1394
1394
  }
1395
- const d = _.startCell.rowIndex, u = _.endCell.rowIndex, F = _.startCell.colIndex, T = _.endCell.colIndex, B = Math.min(d, u), G = Math.max(d, u), q = Math.min(F, T), se = Math.max(F, T);
1395
+ const d = _.startCell.rowIndex, u = _.endCell.rowIndex, F = _.startCell.colIndex, T = _.endCell.colIndex, B = Math.min(d, u), G = Math.max(d, u), P = Math.min(F, T), se = Math.max(F, T);
1396
1396
  _.selectedCells = [];
1397
- for (let P = B; P <= G; P++)
1398
- for (let L = q; L <= se; L++)
1397
+ for (let A = B; A <= G; A++)
1398
+ for (let L = P; L <= se; L++)
1399
1399
  _.selectedCells.push({
1400
- rowIndex: P,
1400
+ rowIndex: A,
1401
1401
  colIndex: L
1402
1402
  });
1403
1403
  }, Le = () => {
@@ -1418,7 +1418,7 @@ const $n = { class: "center" }, Sn = {
1418
1418
  );
1419
1419
  }), _.selectedCells.length === 0)
1420
1420
  return;
1421
- const F = d.getColumns(), T = _.selectedCells.map((H) => H.rowIndex), B = _.selectedCells.map((H) => H.colIndex), G = Math.min(...T), q = Math.max(...T), se = Math.min(...B), P = Math.max(...B), L = [
1421
+ const F = d.getColumns(), T = _.selectedCells.map((H) => H.rowIndex), B = _.selectedCells.map((H) => H.colIndex), G = Math.min(...T), P = Math.max(...T), se = Math.min(...B), A = Math.max(...B), L = [
1422
1422
  u.querySelector(".vxe-table--body-wrapper tbody"),
1423
1423
  u.querySelector(".vxe-table--fixed-left-wrapper tbody"),
1424
1424
  u.querySelector(".vxe-table--fixed-right-wrapper tbody")
@@ -1445,7 +1445,7 @@ const $n = { class: "center" }, Sn = {
1445
1445
  U = ye[re + ve];
1446
1446
  }
1447
1447
  if (U && !U.classList.contains("col--checkbox") && !U.classList.contains("col--seq")) {
1448
- U.classList.add("cell-selected"), H === G && U.classList.add("cell-border-top"), H === q && U.classList.add("cell-border-bottom"), J === se && U.classList.add("cell-border-left"), J === P && U.classList.add("cell-border-right");
1448
+ U.classList.add("cell-selected"), H === G && U.classList.add("cell-border-top"), H === P && U.classList.add("cell-border-bottom"), J === se && U.classList.add("cell-border-left"), J === A && U.classList.add("cell-border-right");
1449
1449
  break;
1450
1450
  }
1451
1451
  }
@@ -1457,16 +1457,16 @@ const $n = { class: "center" }, Sn = {
1457
1457
  const d = f.value;
1458
1458
  if (!d)
1459
1459
  return;
1460
- const u = d.$el, F = d.getColumns(), T = [...new Set(_.selectedCells.map((P) => P.rowIndex))].sort(
1461
- (P, L) => P - L
1462
- ), B = [...new Set(_.selectedCells.map((P) => P.colIndex))].sort(
1463
- (P, L) => P - L
1460
+ const u = d.$el, F = d.getColumns(), T = [...new Set(_.selectedCells.map((A) => A.rowIndex))].sort(
1461
+ (A, L) => A - L
1462
+ ), B = [...new Set(_.selectedCells.map((A) => A.colIndex))].sort(
1463
+ (A, L) => A - L
1464
1464
  ), G = [
1465
1465
  u.querySelector(".vxe-table--body-wrapper tbody"),
1466
1466
  u.querySelector(".vxe-table--fixed-left-wrapper tbody"),
1467
1467
  u.querySelector(".vxe-table--fixed-right-wrapper tbody")
1468
- ].filter(Boolean), q = [];
1469
- T.forEach((P) => {
1468
+ ].filter(Boolean), P = [];
1469
+ T.forEach((A) => {
1470
1470
  const L = [];
1471
1471
  B.forEach((H) => {
1472
1472
  const J = F[H];
@@ -1477,7 +1477,7 @@ const $n = { class: "center" }, Sn = {
1477
1477
  const Y = J.fixed === "left", X = J.fixed === "right";
1478
1478
  let Z = "";
1479
1479
  for (const le of G) {
1480
- const $e = le.querySelectorAll(".vxe-body--row")[P];
1480
+ const $e = le.querySelectorAll(".vxe-body--row")[A];
1481
1481
  if (!$e)
1482
1482
  continue;
1483
1483
  const ye = Array.from($e.querySelectorAll(".vxe-body--column"));
@@ -1498,14 +1498,14 @@ const $n = { class: "center" }, Sn = {
1498
1498
  }
1499
1499
  }
1500
1500
  L.push(Z);
1501
- }), q.push(L.join(" "));
1501
+ }), P.push(L.join(" "));
1502
1502
  });
1503
- const se = q.join(`
1503
+ const se = P.join(`
1504
1504
  `);
1505
1505
  try {
1506
1506
  await navigator.clipboard.writeText(se);
1507
- } catch (P) {
1508
- console.error("复制失败:", P);
1507
+ } catch (A) {
1508
+ console.error("复制失败:", A);
1509
1509
  }
1510
1510
  }, De = (d) => {
1511
1511
  !l.searchForm.enableCellCopy && !o.enableCellCopy || ((d.ctrlKey || d.metaKey) && d.key === "c" ? _.selectedCells.length > 0 && (d.preventDefault(), d.stopPropagation(), Ct()) : d.key === "Escape" && fe());
@@ -1533,18 +1533,18 @@ const $n = { class: "center" }, Sn = {
1533
1533
  l.searchForm.selections = F;
1534
1534
  }
1535
1535
  };
1536
- return t({ tableRef: f, getList: I, getPrm: $, clearSort: ee, calculateTableHeight: w }), (d, u) => {
1537
- var P;
1538
- const F = O("el-button"), T = O("el-checkbox"), B = O("el-text"), G = O("vxe-column"), q = O("VxeTable"), se = O("el-pagination");
1536
+ return t({ tableRef: f, getList: I, getPrm: S, clearSort: ee, calculateTableHeight: C }), (d, u) => {
1537
+ var A;
1538
+ const F = O("el-button"), T = O("el-checkbox"), B = O("el-text"), G = O("vxe-column"), P = O("VxeTable"), se = O("el-pagination");
1539
1539
  return E(), ce("div", {
1540
1540
  class: it({ box: e.searchForm.showShadow })
1541
1541
  }, [
1542
1542
  e.searchForm.showSearch ? (E(), W(kn, {
1543
1543
  key: 0,
1544
1544
  form: e.searchForm,
1545
- onReset: A,
1545
+ onReset: q,
1546
1546
  onConfirm: u[1] || (u[1] = (L) => I()),
1547
- onVisibleChange: N(w)
1547
+ onVisibleChange: N(C)
1548
1548
  }, {
1549
1549
  btn: D(() => [
1550
1550
  u[3] || (u[3] = ie("span", { class: "mgr10" }, null, -1)),
@@ -1567,7 +1567,7 @@ const $n = { class: "center" }, Sn = {
1567
1567
  ref_key: "tableContentRef",
1568
1568
  ref: c
1569
1569
  }, [
1570
- z(q, de({
1570
+ z(P, de({
1571
1571
  id: g.value,
1572
1572
  ref_key: "tableRef",
1573
1573
  ref: f,
@@ -1575,10 +1575,10 @@ const $n = { class: "center" }, Sn = {
1575
1575
  data: e.api ? i.value : e.data,
1576
1576
  border: ""
1577
1577
  }, R.value, {
1578
- height: S.value,
1578
+ height: $.value,
1579
1579
  onCheckboxChange: Ze,
1580
1580
  onCheckboxAll: Ze,
1581
- onSortChange: (P = R.value["sort-config"]) == null ? void 0 : P.sortChange
1581
+ onSortChange: (A = R.value["sort-config"]) == null ? void 0 : A.sortChange
1582
1582
  }), {
1583
1583
  default: D(() => [
1584
1584
  e.searchForm.showCheckBox == null || e.searchForm.showCheckBox ? (E(), W(G, {
@@ -2122,15 +2122,15 @@ function mo(e, t = {}) {
2122
2122
  }, t), { manual: r, log: o, params: l = {}, cb: s, format: i } = a, g = j([]), m = j(!1), p = (y) => {
2123
2123
  const h = y || l;
2124
2124
  m.value = !0, e(h).then((f) => {
2125
- const { code: c, data: v, msg: w } = f;
2125
+ const { code: c, data: v, msg: C } = f;
2126
2126
  if (s) {
2127
- const { records: x, rows: C } = v || {}, S = x || C ? x || C : v;
2128
- g.value = Oe(S, i), s(f);
2127
+ const { records: x, rows: b } = v || {}, $ = x || b ? x || b : v;
2128
+ g.value = Oe($, i), s(f);
2129
2129
  }
2130
2130
  if (v) {
2131
2131
  if (v.records != null || v.rows != null) {
2132
- const { records: x, rows: C, total: S = 0 } = v || {};
2133
- h && h.total != null && (l.total = parseInt(S)), g.value = Oe(x || C || [], i);
2132
+ const { records: x, rows: b, total: $ = 0 } = v || {};
2133
+ h && h.total != null && (l.total = parseInt($)), g.value = Oe(x || b || [], i);
2134
2134
  } else
2135
2135
  g.value = Oe(v, i);
2136
2136
  o && console.log("useRequest-res", g.value);
@@ -1,2 +1,2 @@
1
- (function(m,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):(m=typeof globalThis<"u"?globalThis:m||self,Z(m.JoyAdminComponents={},m.ElementPlus,m.Vue,m.fileSaver,m.ExcelJS,m.dayjs,m.VueI18n,m._,m.VueRouter,m.Vuex,m.VxeUI))})(this,function(m,Z,e,ve,ye,me,te,ae,De,oe,ne){"use strict";const lt=e.defineComponent({name:"LayOutForm",setup(t,{slots:o,attrs:n,emit:r}){const i=e.ref(null),l=()=>o.default?o.default().filter(s=>s.type!==Symbol.for("v-cmt")).map(s=>s.type===Symbol.for("v-fgt")?s.children:s).flat().map(s=>{var c,y,p,C;return e.h(Z.ElCol,{span:((c=s.props)==null?void 0:c.span)||((p=(y=s.props)==null?void 0:y.colProps)==null?void 0:p.span)||24,...(C=s.props)==null?void 0:C.colProps},{default:()=>s})}):null;e.onMounted(()=>{r("ref",i.value)});function a(){return e.h(Z.ElForm,{...n,ref:i},()=>e.h(Z.ElRow,{gutter:n.gutter??20},{default:()=>l()}))}return a}});var Be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Me(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ze={exports:{}};(function(t,o){(function(n,r){t.exports=r()})(Be,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(l,a,s){var c=a.prototype;s.utc=function(d){var w={date:d,utc:!0,args:arguments};return new a(w)},c.utc=function(d){var w=s(this.toDate(),{locale:this.$L,utc:!0});return d?w.add(this.utcOffset(),n):w},c.local=function(){return s(this.toDate(),{locale:this.$L,utc:!1})};var y=c.parse;c.parse=function(d){d.utc&&(this.$u=!0),this.$utils().u(d.$offset)||(this.$offset=d.$offset),y.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 C=c.utcOffset;c.utcOffset=function(d,w){var k=this.$utils().u;if(k(d))return this.$u?0:k(this.$offset)?C.call(this):this.$offset;if(typeof d=="string"&&(d=function(B){B===void 0&&(B="");var j=B.match(r);if(!j)return null;var F=(""+j[0]).match(i)||["-",0,0],N=F[0],E=60*+F[1]+ +F[2];return E===0?0:N==="+"?E:-E}(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 b=c.format;c.format=function(d){var w=d||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return b.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 g=c.toDate;c.toDate=function(d){return d==="s"&&this.$offset?s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var h=c.diff;c.diff=function(d,w,k){if(d&&this.$u===d.$u)return h.call(this,d,w,k);var S=this.local(),_=s(d).local();return h.call(S,_,w,k)}}})})(ze);var at=ze.exports;const rt=Me(at);var Ne={exports:{}};(function(t,o){(function(n,r){t.exports=r()})(Be,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(i,l,a){var s,c=function(b,g,h){h===void 0&&(h={});var d=new Date(b),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}(g,h);return w.formatToParts(d)},y=function(b,g){for(var h=c(b,g),d=[],w=0;w<h.length;w+=1){var k=h[w],S=k.type,_=k.value,T=n[S];T>=0&&(d[T]=parseInt(_,10))}var B=d[3],j=B===24?0:B,F=d[0]+"-"+d[1]+"-"+d[2]+" "+j+":"+d[4]+":"+d[5]+":000",N=+b;return(a.utc(F).valueOf()-(N-=N%1e3))/6e4},p=l.prototype;p.tz=function(b,g){b===void 0&&(b=s);var h,d=this.utcOffset(),w=this.toDate(),k=w.toLocaleString("en-US",{timeZone:b}),S=Math.round((w-new Date(k))/1e3/60),_=15*-Math.round(w.getTimezoneOffset()/15)-S;if(!Number(_))h=this.utcOffset(0,g);else if(h=a(k,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(_,!0),g){var T=h.utcOffset();h=h.add(d-T,"minute")}return h.$x.$timezone=b,h},p.offsetName=function(b){var g=this.$x.$timezone||a.tz.guess(),h=c(this.valueOf(),g,{timeZoneName:b}).find(function(d){return d.type.toLowerCase()==="timezonename"});return h&&h.value};var C=p.startOf;p.startOf=function(b,g){if(!this.$x||!this.$x.$timezone)return C.call(this,b,g);var h=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return C.call(h,b,g).tz(this.$x.$timezone,!0)},a.tz=function(b,g,h){var d=h&&g,w=h||g||s,k=y(+a(),w);if(typeof b!="string")return a(b).tz(w);var S=function(j,F,N){var E=j-60*F*1e3,W=y(E,N);if(F===W)return[E,F];var x=y(E-=60*(W-F)*1e3,N);return W===x?[E,W]:[j-60*Math.min(W,x)*1e3,Math.max(W,x)]}(a.utc(b,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(b){s=b}}})})(Ne);var it=Ne.exports;const st=Me(it),Ce={"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"}},be={"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"}},Oe={zh_cn:Ce,en_us:be};let ue=null;function qe(t=null){if(t){const{global:o}=t;return o.messages.value.zh_cn?o.mergeLocaleMessage("zh_cn",Ce):o.setLocaleMessage("zh_cn",Ce),o.messages.value.en_us?o.mergeLocaleMessage("en_us",be):o.setLocaleMessage("en_us",be),ue=t,t}return ue||(ue=te.createI18n({legacy:!1,locale:"zh_cn",fallbackLocale:"zh_cn",messages:Oe})),ue}function we(){return ue||qe()}function re(){return we().global.t}me.extend(rt),me.extend(st);async function ct(t,o){const{fields:n,range:r=1}=o;if(!n){const a=re();throw new Error(a("excel.fieldsMappingRequired"))}let i=new ye.Workbook;await i.xlsx.load(t);const l={};return i.eachSheet(function(a,s){const c=[];a.eachRow(function(y,p){if(p>r){let C={},b=!0;Object.keys(n).forEach(g=>{const h=y.getCell(n[g]).value;C[g]=h,h&&(b=!1)}),b||c.push(C)}}),l[a._name]=c}),i=null,l}const Pe={columnWidth:30};async function dt(t,o,n=[],r={}){if(!t||!o)return;const{columnStyle:i}=r,{columnWidth:l}=Pe;o.forEach(c=>{c.width=c.width?c.width:l});const{workbook:a,worksheet:s}=ut();s.columns=o,s.addRows(n),i&&await ft(a,s,i);try{const c=await a.xlsx.writeBuffer(),y=new File([c],t,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});ve.saveAs(y)}catch(c){console.log(c)}}function ut(){const t=new ye.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 ft(t,o,n){const r=Object.keys(n);for(const i of r){const l=n[i],{type:a}=l;switch(a){case"IMG":await mt(t,o,i);break}}}async function mt(t,o,n,r){const i=o.getColumn(n),l=i.values;o.getColumn(n).width=20,o.eachRow((a,s)=>{s>1&&(a.height=40)});for(let a=0,s=l.length;a<s;a++){if(a<2)continue;let c=l[a];c&&(o.getCell(i.letter+a).value="",await ht(t,o,c,{width:100,height:50,col:i._number-1,row:a-1}))}}async function ht(t,o,n,r){const{col:i,row:l,width:a,height:s}=r,{success:c,base64:y}=await gt(n,.3);if(c){const p=t.addImage({base64:y,extension:"jpeg"});o.addImage(p,{tl:{col:i,row:l},ext:{width:a,height:s}})}}function gt(t,o=1){const n=new Image;return n.setAttribute("crossOrigin","anonymous"),n.crossOrigin="anonymous",n.src=t,new Promise((r,i)=>{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 Se="---";async function Ae(t,o){const{fields:n,range:r=1}=o;if(!n){const a=re();throw new Error(a("excel.fieldsMappingRequired"))}let i=new ye.Workbook;await i.xlsx.load(t);const l={};return i.eachSheet(function(a,s){if(a.state=="visible"){const c=[],y=n[a._name];if(y){let p=Object.values(y).some(b=>b.includes("image")),C={};p&&(a.getImages().forEach(g=>{const{tl:h}=g.range,d=i.model.media.find(w=>w.index===g.imageId);if(d){const w=d.buffer.toString("base64"),k=`data:image/${d.extension};base64,${w}`,S=`${Math.ceil(h.row)}_${Math.ceil(h.col)}`;C[S]?C[S].push(k):C[S]=[k]}}),console.log("withImages-imageMap",C)),a.eachRow(function(b,g){if(g>r){let h={_excelRowNumber:g},d=!0;Object.keys(y).forEach(w=>{var B;let[k,S]=y[w].split(Se);const _=b.getCell(k);let T;if(S=="image"&&p){const j=_._column._number,F=`${g}_${j}`;T=C[F]||""}else _.result!=null?T=_.result:(B=_.value)!=null&&B.richText?T=_.value.richText.reduce((j,F)=>j+F.text,""):_.type==4&&_.value?T=me(_.value).utc().format("YYYY-MM-DD HH:mm:ss"):T=_.value;T&&S=="option"&&(T=T.split(Se)[1]),h[w]=T,T&&(d=!1)}),d||c.push(h)}}),l[a._name]=c}}}),i=null,l}const pt={date:"yyyy-mm-dd",number:"0",string:"@"};async function je(t,o){if(!t||o.length==0)return;const n=yt(o);for(const r of n.worksheets){const{columnWidth:i}=Pe,l=o[r.name];if(!l)continue;const{tableHeader:a,tableData:s}=l;a.forEach(c=>{const{style:y={},required:p}=c,{font:C={}}=y;c.style={...y,font:{...C,color:{argb:p?"FFFF0000":void 0}}}}),r.columns=a,r.addRows(s),a.forEach(c=>{let{header:y,key:p,width:C,option:b,numFmt:g,locked:h,optionFormater:d}=c;const w=r.getColumn(p);if(w.numFmt=pt[g]||g,w.width=C||i,w.protection={locked:h===!0},b){const k=n.addWorksheet(p);k.state="hidden",d||(d=S=>`${S.label}${Se}${S.value}`),k.getColumn(1).values=b.map(d),Array(100).fill("").forEach((S,_)=>{if(_>0){const T=re();r.getCell(`${w.letter}${_}`).dataValidation={type:"list",formulae:[`${p}!$A$1:$A$${b.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(),i=new File([r],t,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});ve.saveAs(i)}catch(r){console.log(r)}}function yt(t){const o=re(),n=new ye.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((i,l)=>{const a=t[i].sort??0,s=t[l].sort??0;return a-s}).forEach(i=>{let l=i,a=!1;/[\\/:*?\[\]]/g.test(i)&&(i=i.replace(/[\\/:*?\[\]]/g,""),a=!0),i.length>31&&(i=i.substring(0,31).trim(),a=!0,console.warn(o("excel.sheetNameTooLong",[l,i]))),a&&(t[i]=t[l],delete t[l]),n.addWorksheet(i)}),n}function Ct(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 bt(t){return new Promise(o=>{setTimeout(()=>{o()},t)})}function wt(t){return JSON.parse(JSON.stringify(t))}function xt(t){let o=[],n={},r=(i,l)=>Object.prototype.hasOwnProperty.call(i,l);for(const i of t){n[i.id]={...i,children:r(n,i.id)?n[i.id].children:[]};const l=n[i.id];i.pid==-1?o.push(l):(r(n,i.pid)||(n[i.pid]={children:[]}),n[i.pid].children.push(l))}return o}function $e(t,o=" "){return t?t.split(o).filter(n=>n.trim()):[]}class Ve{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=we().global.locale,{label:r,labelEn:i}=this.map.get(o);return(n.value=="zh_cn"?r:i)??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 kt(t,o=[],n="i18nName"){if(t.length==0)return new Ve([]);if(o.length<2){const i=re();throw new Error(i("tools.keysLengthError"))}let r=t.map(i=>{let l={};return n&&(l.labelEn=i[n]),o.forEach((a,s)=>{s===0?l.label=i[a]:s===1?l.value=i[a]:l[a]=i[a]}),l});return new Ve(r)}function _t(t){return t?t.replace(/<[^>]+>/g,""):""}function St(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 $t(t,o=10){let n=1048576*o;return!(t.size>n)}function Vt(t){return Array.from(10).fill(0).map((n,r)=>t+"_"+r)}function Et(t){let o={};return t.map((n,r)=>{let{key:i,option:l,type:a,optionFormater:s}=n,c=Ct(r);l&&!s?o[i]=`${c}---option`:a==="image"?o[i]=`${c}---image`:o[i]=c}),o}function Tt(t,o){return o.split(".").reduce((n,r)=>n&&n[r],t)}const mo="",fe=(t,o)=>{const n=t.__vccOpts||t;for(const[r,i]of o)n[r]=i;return n},It=["onClick"],Re=fe({__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:i,locale:l}=te.useI18n(),a=e.useModel(t,"modelValue"),s=e.computed(()=>r["value-key"]!=null),c=e.ref(""),y=e.computed(()=>{if(r.remote!==void 0)return n.data;const x=$e(c.value),{data:$,labelValue:q}=n,V=$||b.value;if(x.length==0)return V;const{label:G,labelEn:ie}=q;let D=l.value=="en_us"?ie||"i18nName":G;return x.length==1?V.filter(le=>le[D].toLowerCase().includes(x[0].toLowerCase())):V.filter(le=>{let ge=!1;return ge=x.some(_e=>le[D].toLowerCase()==_e.toLowerCase()),ge})}),p=e.computed({get(){return r.multiple==null||a.value==null?!1:a.value.length==y.value.length},set(x){return x}}),C=o,b=e.ref([]),g=async()=>{const{data:x}=await n.api();b.value=[...x],C("success",b)};n.api&&g();function h(x){C("change",x),d.value&&e.nextTick(()=>{n.optionClick&&n.optionClick(d.value),d.value=null})}const d=e.ref(null);function w(){C("change",a.value),e.nextTick(()=>{n.optionClick&&n.optionClick(null)})}function k(x){d.value=x}const S=n.labelValue.label.split("-"),_=x=>{if(S.length==1){if(n.changeLocal)return i(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 S.forEach(q=>{$.push(x[q])}),$.join("-")}};function T(x){let $=n.data?n.data:b.value;a.value=x?$.map(q=>s.value?q:q[n.labelValue.value]):[],e.nextTick(()=>{C("change",a.value),C("changeAll",a.value,$)})}function B(x){C("change",s.value?x:x[n.labelValue.value]),e.nextTick(()=>{n.optionClick&&n.optionClick(x)})}function j(x){const $=s.value?x:x[n.labelValue.value],q=s.value?a.value.some(V=>V[n.labelValue.value]===x[n.labelValue.value]):a.value.includes($);return!!(n.maxLimit>0&&a.value.length>=n.maxLimit&&!q||n.minLimit>0&&a.value.length===n.minLimit&&q)}function F(x){return x.map($=>({...$,label:_($),value:s.value?$:$[n.labelValue.value]}))}const N=e.ref([]),E=n.data?n.data:b.value;N.value=F(E),e.watch(()=>n.data?n.data:b.value,x=>{var q;const $=F(x);if($.length!==N.value.length)N.value=$;else{let V=!1;for(let G=0;G<$.length;G++)if($[G].value!==((q=N.value[G])==null?void 0:q.value)){V=!0;break}V&&(N.value=$)}},{deep:!0});const W=e.computed(()=>r.multiple!==void 0&&(n.maxLimit>0||n.minLimit>0)?N.value.map(x=>({...x,disabled:j(x)})):N.value);return(x,$)=>{const q=e.resolveComponent("el-checkbox"),V=e.resolveComponent("el-select-v2"),G=e.resolveComponent("el-option"),ie=e.resolveComponent("el-select");return e.unref(r).v2!=null?(e.openBlock(),e.createBlock(V,e.mergeProps({key:0,options:W.value,modelValue:a.value,"onUpdate:modelValue":$[1]||($[1]=D=>a.value=D)},e.unref(r),{filterable:"","collapse-tags":"","collapse-tags-tooltip":"",clearable:"",onChange:h}),e.createSlots({default:e.withCtx(({item:D})=>[e.createElementVNode("div",{onClick:se=>k(D)},e.toDisplayString(D.label),9,It)]),_:2},[e.unref(r).multiple!=null?{name:"header",fn:e.withCtx(()=>[e.renderSlot(x.$slots,"header",{},()=>[e.createVNode(q,{class:"mgl20",modelValue:p.value,"onUpdate:modelValue":$[0]||($[0]=D=>p.value=D),onChange:T},{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(ie,e.mergeProps({key:1,modelValue:a.value,"onUpdate:modelValue":$[3]||($[3]=D=>a.value=D),filterable:"","collapse-tags":"","collapse-tags-tooltip":"","filter-method":e.unref(r).remote!=null?void 0:D=>c.value=D,clearable:""},e.unref(r),{onClear:w}),{default:e.withCtx(()=>[e.unref(r).multiple!=null&&t.showCheckAll&&t.maxLimit==null?e.renderSlot(x.$slots,"header",{key:0},()=>[e.createVNode(q,{class:"mgl20",modelValue:p.value,"onUpdate:modelValue":$[2]||($[2]=D=>p.value=D),onChange:T},{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(y.value,(D,se)=>(e.openBlock(),e.createBlock(G,{key:se,label:_(D),disabled:e.unref(r).multiple!=null&&(t.maxLimit>0||t.minLimit>0)?j(D):!1,onClick:e.withModifiers(le=>B(D),["stop"]),value:s.value?D:D[t.labelValue.value]},null,8,["label","disabled","onClick","value"]))),128))]),_:3},16,["modelValue","filter-method"]))}}},[["__scopeId","data-v-12794201"]]),go="",Lt=e.defineComponent({props:{name:{tyepe:String,required:!0}}});function Ft(t,o,n,r,i,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 Ee=fe(Lt,[["render",Ft],["__scopeId","data-v-733f9daa"]]),po="",vt={class:"confirm-button-wrapper"},Dt=fe({__name:"index",emits:["ok","no"],setup(t,{emit:o}){const n=o,r=ae.debounce(()=>{n("ok")},500);function i(){n("no")}return(l,a)=>{const s=e.resolveComponent("el-popconfirm");return e.openBlock(),e.createElementBlock("span",vt,[e.createVNode(s,e.mergeProps(l.$attrs,{onConfirm:e.unref(r),onCancel:i}),{reference:e.withCtx(()=>[e.renderSlot(l.$slots,"default",{},void 0,!0)]),_:3},16,["onConfirm"])])}}},[["__scopeId","data-v-24cb35fd"]]),Co="",Bt={class:"ImportButton"},Mt=["accept"],zt=fe({__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),i=e.ref(!1);async function l(a){i.value=!0;let s=a.target.files[0];const c=await Ae(s,n.fields).catch(()=>{i.value=!1}).finally(()=>{r.value.value=null});await n.fileChange(c).finally(()=>{i.value=!1})}return(a,s)=>{const c=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",Bt,[e.createVNode(c,e.mergeProps({type:"primary",loading:i.value,class:"mgr10",onClick:s[0]||(s[0]=y=>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,Mt)])}}},[["__scopeId","data-v-ea0a4c60"]]);function Te(t){let o={};return t.forEach(n=>{const{key:r,type:i,option:l={},value:a,dateType:s="date"}=n;if(r)if(i=="input"&&(l!=null&&l.multiple))o[r]=$e(a);else if(i=="date")if(s.includes("range")){const[c,y]=r;let[p,C]=a||[];p&&s=="daterange"&&(p=me(p).format("YYYY-MM-DD 00:00:00"),C=me(C).format("YYYY-MM-DD 23:59:59")),o[c]=p,o[y]=C}else o[r]=a;else o[r]=a}),o}const wo="",Nt={key:0},Ot={class:"btns"},qt={class:"left"},Pt={class:"right"},Ue=fe({__name:"index",props:{form:{type:Object,required:!0}},emits:["confirm","reset","visibleChange"],setup(t,{expose:o,emit:n}){const r=t,i=n,l=e.ref(!0),a=e.ref(null),{t:s}=te.useI18n(),c={datetimerange:"YYYY-MM-DD HH:mm:ss",daterange:"YYYY-MM-DD",month:"YYYY-MM"},y=e.computed(()=>l.value?s("guan-bi"):s("zhan-kai"));function p(){i("confirm")}function C(k){k.option.onClear&&k.option.onClear(),i("confirm")}function b(){i("reset")}function g(){i("confirm")}function h(){return Te(r.form.items)}const d=ae.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:h,reset:w}),(k,S)=>{const _=e.resolveComponent("el-input"),T=e.resolveComponent("el-date-picker"),B=e.resolveComponent("el-form-item"),j=e.resolveComponent("el-form"),F=e.resolveComponent("el-link"),N=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":"32px"})},[e.createVNode(j,{inline:"",model:t.form.data},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.form.items.filter(E=>!E.hidden),E=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:E.key},[E.type=="br"?(e.openBlock(),e.createElementBlock("br",Nt)):(e.openBlock(),e.createBlock(B,{key:1,label:E.name},{default:e.withCtx(()=>{var W,x;return[E.type==="input"?(e.openBlock(),e.createBlock(_,{key:0,modelValue:E.value,"onUpdate:modelValue":$=>E.value=$,class:e.normalizeClass(((W=E.option)==null?void 0:W.class)||"w150"),placeholder:k.$t("qing-shu-ru"),clearable:""},null,8,["modelValue","onUpdate:modelValue","class","placeholder"])):E.type==="custom"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(E.render),{key:1})):e.createCommentVNode("",!0),E.type==="select"?(e.openBlock(),e.createBlock(Re,e.mergeProps({key:2,class:((x=E.option)==null?void 0:x.class)||"w150",modelValue:E.value,"onUpdate:modelValue":$=>E.value=$},{ref_for:!0},E.option,{onChange:p,onClear:$=>C(E),placeholder:k.$t("qing-xuan-ze")}),null,16,["class","modelValue","onUpdate:modelValue","onClear","placeholder"])):e.createCommentVNode("",!0),E.type==="date"?(e.openBlock(),e.createBlock(T,e.mergeProps({key:3,class:{datetimerange:"w300",daterange:"w200"}[E.dateType]||"w100",modelValue:E.value,"onUpdate:modelValue":$=>E.value=$,"value-format":c[E.dateType]||"YYYY-MM-DD",type:E.dateType||"date",onFocus:$=>a.value=E,onChange:$=>g(),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},E.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",Ot,[e.createElementVNode("div",qt,[e.renderSlot(k.$slots,"table-header-left",{},void 0,!0)]),e.createElementVNode("div",Pt,[e.createVNode(F,{underline:"never",class:"mgr10",onClick:S[0]||(S[0]=()=>{i("visibleChange",!l.value),l.value=!l.value})},{default:e.withCtx(()=>[e.createVNode(Ee,{name:l.value?"ArrowUp":"ArrowDown"},null,8,["name"]),e.createTextVNode(" "+e.toDisplayString(y.value),1)]),_:1}),e.createVNode(N,{type:"primary",onClick:p},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.$t("shai-xuan")),1)]),_:1}),e.createVNode(N,{type:"primary",onClick:b},{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-db6f71dd"]]),Ye={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={...Ye};function At(t){he={...he,...t,responseDataKeys:{...he.responseDataKeys,...t.responseDataKeys||{}}}}function He(){return he}function jt(){he={...Ye}}const ko="",Rt={class:"center"},Ut=fe({__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}=te.useI18n(),i=De.useRoute(),l=He(),a=t,s=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 y=e.computed(()=>{const f=i.path.replace(/\//g,"-").replace(/^-/,"")||"default-table";return a.id?`listPageId-${f}-${a.id}`:`listPageId-${f}`}),p=ae.cloneDeep(a.searchForm.items),C=a.searchForm.pageNoKey||l.pageNoKey,b=a.searchForm.pageSizeKey||l.pageSizeKey,g=e.reactive({[C]:1,[b]:a.searchForm.defaultPageSize||l.defaultPageSize,total:0}),h=e.ref(null),d=e.ref(null),w=e.ref(450),k=ae.debounce(()=>{e.nextTick(()=>{if(!d.value)return;const u=d.value.getBoundingClientRect(),I=window.innerHeight,v=u.top,P=100,Y=I-v-P,M=200;w.value=Math.max(Y,M)})},100),S=()=>{k()},_=()=>{if(!a.searchForm.enableCellCopy&&!l.enableCellCopy)return!1;const f=h.value;if(!f||!f.$el)return!1;const u=f.$el;return u.classList.add("cell-copy-enabled"),u.setAttribute("tabindex","-1"),u.removeEventListener("mousedown",ie),u.removeEventListener("mousemove",D),u.removeEventListener("mouseup",se),u.removeEventListener("keydown",Le),u.addEventListener("mousedown",ie),u.addEventListener("mousemove",D),u.addEventListener("mouseup",se),u.addEventListener("keydown",Le),!0};e.onMounted(()=>{k(),window.addEventListener("resize",S),(a.searchForm.enableCellCopy||l.enableCellCopy)&&(document.addEventListener("mouseup",et),document.addEventListener("mousedown",tt),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",et),document.removeEventListener("mousedown",tt);const f=h.value;if(f&&f.$el){const u=f.$el;u.removeEventListener("mousedown",ie),u.removeEventListener("mousemove",D),u.removeEventListener("mouseup",se),u.removeEventListener("keydown",Le)}}});const T=e.computed(()=>q.value.height||w.value);let B;async function j(f){const{dataFormat:u}=a.tableConfig;f[C]!=1&&(f.nextSearchAfter=B),s.value=!0;const{code:I,data:v={}}=await a.api(f).finally(()=>{s.value=!1,a.searchForm.selections=[]});if(I==200){let P=[];for(const M of l.responseDataKeys.rows)if(v[M]){P=v[M];break}let Y=0;for(const M of l.responseDataKeys.total)if(v[M]!==void 0){Y=v[M];break}c.value=u?u(P):P,g.total=Y,B=v.nextSearchAfter,(a.searchForm.enableCellCopy||l.enableCellCopy)&&e.nextTick(()=>{setTimeout(()=>{_()},100)})}}function F(f={}){const{searchData:u=()=>({})}=a.tableConfig,I=u();j({...g,...Te(a.searchForm.items),...f,...I})}function N(){const{reset:f}=a.tableConfig;f&&f(),a.searchForm.items.forEach(u=>{const I=p.find(v=>ae.isArray(u.key)&&ae.isArray(v.key)?u.key.join(",")==v.key.join(","):v.key==u.key);I&&(u.value=I.value)}),F()}a.api&&a.immediate&&F();function E(){return{...g,...Te(a.searchForm.items)}}const W=()=>{const f=h.value;f&&f.clearSort()},x=e.reactive({storage:!0}),$=e.reactive({drag:!0,resizable:!0,maxFixedSize:0}),q=e.computed(()=>{const{customConfig:f,columnConfig:u,...I}=a.tableConfig;return{headerAlign:"left",align:"center",customConfig:{...x,...f},columnConfig:{...$,...u},"virtual-x-config":{enabled:!1,scrollToLeftOnChange:!1},"virtual-y-config":{enabled:!0,gt:100},...I}}),V=e.reactive({isSelecting:!1,startCell:null,endCell:null,selectedCells:[]}),G=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 v=h.value;if(!v)return null;let P=-1;const Y=I.getAttribute("data-rowid");if(Y!=null)P=parseInt(Y,10);else{const z=I.parentElement;P=Array.from(z.querySelectorAll(".vxe-body--row")).indexOf(I)}if(P<0)return null;let M=-1;const ee=u.getAttribute("data-colid");if(ee&&(M=v.getColumns().findIndex(L=>L.id===ee)),M<0){const L=Array.from(I.querySelectorAll(".vxe-body--column")).indexOf(u),R=!!u.closest(".vxe-table--fixed-left-wrapper"),H=!!u.closest(".vxe-table--fixed-right-wrapper"),A=v.getColumns();if(R){const K=A.filter(U=>U.fixed==="left");L<K.length&&(M=A.indexOf(K[L]))}else if(H){const K=A.filter(U=>U.fixed==="right");L<K.length&&(M=A.indexOf(K[L]))}else{const K=a.searchForm.showCheckBox?1:0;M=A.filter(J=>J.fixed==="left").length+L-K}}return M<0?null:{rowIndex:P,colIndex:M,cell:u}},ie=f=>{const u=G(f.target);if(!u){le();return}V.isSelecting=!0,V.startCell={rowIndex:u.rowIndex,colIndex:u.colIndex},V.endCell={...V.startCell},ge(),_e()},D=f=>{if(!V.isSelecting)return;const u=G(f.target);u&&(V.endCell={rowIndex:u.rowIndex,colIndex:u.colIndex},ge(),_e())},se=()=>{V.isSelecting=!1},le=()=>{V.selectedCells=[],V.startCell=null,V.endCell=null;const f=h.value;if(!f)return;f.$el.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(I=>{I.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")})},ge=()=>{if(!V.startCell||!V.endCell){V.selectedCells=[];return}const f=V.startCell.rowIndex,u=V.endCell.rowIndex,I=V.startCell.colIndex,v=V.endCell.colIndex,P=Math.min(f,u),Y=Math.max(f,u),M=Math.min(I,v),ee=Math.max(I,v);V.selectedCells=[];for(let z=P;z<=Y;z++)for(let L=M;L<=ee;L++)V.selectedCells.push({rowIndex:z,colIndex:L})},_e=()=>{e.nextTick(()=>{const f=h.value;if(!f)return;const u=f.$el;if(u.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(R=>{R.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")}),V.selectedCells.length===0)return;const I=f.getColumns(),v=V.selectedCells.map(R=>R.rowIndex),P=V.selectedCells.map(R=>R.colIndex),Y=Math.min(...v),M=Math.max(...v),ee=Math.min(...P),z=Math.max(...P),L=[u.querySelector(".vxe-table--body-wrapper tbody"),u.querySelector(".vxe-table--fixed-left-wrapper tbody"),u.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean);V.selectedCells.forEach(({rowIndex:R,colIndex:H})=>{const A=I[H];if(!A)return;const K=A.fixed==="left",U=A.fixed==="right";for(const J of L){const pe=J.querySelectorAll(".vxe-body--row")[R];if(!pe)continue;const ce=Array.from(pe.querySelectorAll(".vxe-body--column"));let O=null;if(K&&J.closest(".vxe-table--fixed-left-wrapper")){const X=I.filter(Q=>Q.fixed==="left").indexOf(A);O=ce[X]}else if(U&&J.closest(".vxe-table--fixed-right-wrapper")){const X=I.filter(Q=>Q.fixed==="right").indexOf(A);O=ce[X]}else if(!K&&!U&&J.closest(".vxe-table--body-wrapper")){const de=a.searchForm.showCheckBox?1:0,X=I.filter(Fe=>Fe.fixed==="left").length,Q=H-X;O=ce[Q+de]}if(O&&!O.classList.contains("col--checkbox")&&!O.classList.contains("col--seq")){O.classList.add("cell-selected"),R===Y&&O.classList.add("cell-border-top"),R===M&&O.classList.add("cell-border-bottom"),H===ee&&O.classList.add("cell-border-left"),H===z&&O.classList.add("cell-border-right");break}}})})},so=async()=>{if(V.selectedCells.length===0)return;const f=h.value;if(!f)return;const u=f.$el,I=f.getColumns(),v=[...new Set(V.selectedCells.map(z=>z.rowIndex))].sort((z,L)=>z-L),P=[...new Set(V.selectedCells.map(z=>z.colIndex))].sort((z,L)=>z-L),Y=[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),M=[];v.forEach(z=>{const L=[];P.forEach(R=>{const H=I[R];if(!H){L.push("");return}const A=H.fixed==="left",K=H.fixed==="right";let U="";for(const J of Y){const pe=J.querySelectorAll(".vxe-body--row")[z];if(!pe)continue;const ce=Array.from(pe.querySelectorAll(".vxe-body--column"));let O=null;if(A&&J.closest(".vxe-table--fixed-left-wrapper")){const X=I.filter(Q=>Q.fixed==="left").indexOf(H);O=ce[X]}else if(K&&J.closest(".vxe-table--fixed-right-wrapper")){const X=I.filter(Q=>Q.fixed==="right").indexOf(H);O=ce[X]}else if(!A&&!K&&J.closest(".vxe-table--body-wrapper")){const de=a.searchForm.showCheckBox?1:0,X=I.filter(Fe=>Fe.fixed==="left").length,Q=R-X;O=ce[Q+de]}if(O&&!O.classList.contains("col--checkbox")&&!O.classList.contains("col--seq")){U=O.innerText||O.textContent||"",U=U.trim(),U=U.replace(/\n/g," ").replace(/\s+/g," ");break}}L.push(U)}),M.push(L.join(" "))});const ee=M.join(`
2
- `);try{await navigator.clipboard.writeText(ee)}catch(z){console.error("复制失败:",z)}},Le=f=>{!a.searchForm.enableCellCopy&&!l.enableCellCopy||((f.ctrlKey||f.metaKey)&&f.key==="c"?V.selectedCells.length>0&&(f.preventDefault(),f.stopPropagation(),so()):f.key==="Escape"&&le())},et=()=>{V.isSelecting=!1},tt=f=>{const u=h.value;if(!u||!u.$el)return;u.$el.contains(f.target)||le()},co=f=>{g[C]=f,F()},uo=f=>{g[b]=f,g[C]=1,F()};function ot(){const f=h.value.getCheckboxRecords();a.searchForm.selections=f}const nt=f=>{const u=h.value;if(u){u.toggleCheckboxRow(f);const I=h.value.getCheckboxRecords();a.searchForm.selections=I}};return o({tableRef:h,getList:F,getPrm:E,clearSort:W,calculateTableHeight:k}),(f,u)=>{var z;const I=e.resolveComponent("el-button"),v=e.resolveComponent("el-checkbox"),P=e.resolveComponent("el-text"),Y=e.resolveComponent("vxe-column"),M=e.resolveComponent("VxeTable"),ee=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({box:t.searchForm.showShadow})},[t.searchForm.showSearch?(e.openBlock(),e.createBlock(Ue,{key:0,form:t.searchForm,onReset:N,onConfirm:u[1]||(u[1]=L=>F()),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]=L=>h.value.openCustom())},{default:e.withCtx(()=>[e.createVNode(Ee,{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(M,e.mergeProps({id:y.value,ref_key:"tableRef",ref:h,loading:t.loading||s.value,data:t.api?c.value:t.data,border:""},q.value,{height:T.value,onCheckboxChange:ot,onCheckboxAll:ot,onSortChange:(z=q.value["sort-config"])==null?void 0:z.sortChange}),{default:e.withCtx(()=>[t.searchForm.showCheckBox==null||t.searchForm.showCheckBox?(e.openBlock(),e.createBlock(Y,{key:0,type:"checkbox",width:e.unref(r)=="zh_cn"?80:150,title:f.$t("xu-hao"),fixed:"left"},{checkbox:e.withCtx(({rowIndex:L,row:R,checked:H,disabled:A,indeterminate:K})=>[e.createElementVNode("div",Rt,[H?(e.openBlock(),e.createBlock(v,{key:0,checked:!0,disabled:A,size:"default",onClick:e.withModifiers(U=>!A&&nt(R),["stop"])},null,8,["disabled","onClick"])):(e.openBlock(),e.createBlock(v,{key:1,disabled:A,checked:!1,size:"default",onClick:e.withModifiers(U=>!A&&nt(R),["stop"])},null,8,["disabled","onClick"])),e.createVNode(P,{type:"info",class:"mgl5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(L+1),1)]),_:2},1024)])]),_:1},8,["width","title"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"default",{},void 0,!0)]),_:3},16,["id","loading","data","height","onSortChange"])],512),t.searchForm.showPage?(e.openBlock(),e.createBlock(ee,{key:1,"current-page":g[e.unref(C)],"onUpdate:currentPage":u[2]||(u[2]=L=>g[e.unref(C)]=L),class:"myPagination mgt10",background:"",layout:"total, sizes, prev, pager, next",total:g.total,"page-size":g[e.unref(b)],"page-sizes":t.searchForm.pageSizes||e.unref(l).pageSizes,onCurrentChange:co,onSizeChange:uo},null,8,["current-page","total","page-size","page-sizes"])):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-c022c16d"]]),Yt={__name:"index",props:{sheetsConfig:{type:Object,required:!0},fileName:{type:String,required:!0}},setup(t){const o=t;function n(){je(o.fileName,o.sheetsConfig)}return(r,i)=>{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)}}},Ht={mounted(t,o){o.value&&Ke(t)},updated(t,o){o.value?Ke(t):We(t)},beforeUnmount(t){We(t)}};async function Ke(t){await b();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 i=!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",y),document.addEventListener("mouseup",p),window.addEventListener("resize",C);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),s()}function s(){let g=l.drag.y-l.mouse.y+l.dialog.y,h=l.drag.x-l.mouse.x+l.dialog.x;o.style.cssText+=`position: absolute; top: calc(${g}px - ${l.dialog.marginTop}); left: ${h}px;`}function c(g){g.button===0&&(l.window={width:document.body.clientWidth,height:document.body.clientHeight},l.dialog=o.getBoundingClientRect(),l.dialog.marginTop=window.getComputedStyle(o).marginTop,l.mouse={x:g.clientX,y:g.clientY},i=!0)}function y(g){i&&(l.drag={x:g.clientX,y:g.clientY},r.style.userSelect="none",a())}function p(g){r.style.userSelect="auto",i=!1}function C(g){}function b(){return new Promise((g,h)=>{setTimeout(()=>{g()},500)})}t.__mouseDown__=c,t.__mouseUp__=p,t.__mouseMove__=y,t.__sizeChange__=C}function We(t){document.removeEventListener("mousedown",t.__mouseDown__),document.removeEventListener("mousemove",t.__mouseMove__),document.removeEventListener("mouseup",t.__mouseUp__),window.removeEventListener("resize",t.__sizeChange__)}const So="",Kt={key:0,class:"drawer-btn"},Wt={key:1},Zt={__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:i}=te.useI18n(),l=ae.debounce(()=>{r("confirm")},300);async function a(){n.layer.type=="drawer"?n.layer.onClose?n.layer.onClose():n.layer.closeConfirm?await Z.ElMessageBox.confirm(i("que-ding-guan-bi-ma"),{confirmButtonText:i("que-ding"),cancelButtonText:i("qu-xiao"),type:"warning"}).catch(()=>{})=="confirm"&&(n.layer.show=!1):n.layer.show=!1:n.layer.show=!1}return(s,c)=>{const y=e.resolveComponent("el-button"),p=e.resolveComponent("el-drawer"),C=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]=b=>t.layer.show=b),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(s.$slots,"default"),c[2]||(c[2]=e.createElementVNode("p",{class:"mgt50"},null,-1)),t.layer.showButton?(e.openBlock(),e.createElementBlock("div",Kt,[e.renderSlot(s.$slots,"btn",{},()=>[e.createVNode(y,{onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.$t("qu-xiao")),1)]),_:1}),e.createVNode(y,{type:"primary",loading:t.loading,onClick:e.unref(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.$t("ti-jiao")),1)]),_:1},8,["loading","onClick"])])])):e.createCommentVNode("",!0)]),_:3},8,["modelValue","size","title"])):e.withDirectives((e.openBlock(),e.createElementBlock("div",Wt,[e.createVNode(C,{"close-on-click-modal":!1,modelValue:t.layer.show,"onUpdate:modelValue":c[1]||(c[1]=b=>t.layer.show=b),title:t.layer.title,width:t.layer.width||500,center:""},e.createSlots({default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:2},[t.layer.showButton?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(s.$slots,"btn",{},()=>[e.createVNode(y,{onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.$t("qu-xiao")),1)]),_:1}),e.createVNode(y,{type:"primary",onClick:e.unref(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.$t("ti-jiao")),1)]),_:1},8,["onClick"])])]),key:"0"}:void 0]),1032,["modelValue","title","width"])])),[[e.unref(Ht),t.layer.show]])}}};function Gt(t,o={}){const n=re(),r={inForm:!0,required:!0,...o},i={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:s,msg:c=n("validate.invalidInput")}=r;return l?function(y,p,C){if(s){i.test(p)?C():C(new Error(c));return}p&&!i.test(p)?C(new Error(c)):C()}:i.test(a)}class Jt{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 i=await fetch(o,r);return i.status===401?(this.log("Token已过期,需要重新登录"),this.logout(),null):i}catch(i){throw this.log("请求失败:",i),i}}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 xe(t,o=2,n=".",r=","){(t==null||t==="")&&(t=0);const i=Number(t);isNaN(i)?t=0:t=i,o=Math.max(0,Math.floor(o));const a=t.toFixed(o).split(".");let s=a[0];const c=a[1],y=s.startsWith("-");return y&&(s=s.slice(1)),s=s.replace(/\B(?=(\d{3})+(?!\d))/g,r),y&&(s="-"+s),o>0?s+n+c:s}function Ze(t,o=2){return xe(t,o)}function Ge(t,o=2){(t==null||t==="")&&(t=0);const n=Number(t);isNaN(n)?t=0:t=n;const r=t*100;return xe(r,o)+"%"}function Xt(t,o={}){const r=Object.assign({manual:!1,log:!1,params:null,format:null},o),{manual:i,log:l,params:a={},cb:s,format:c}=r,y=e.ref([]),p=e.ref(!1),C=b=>{const g=b||a;p.value=!0,t(g).then(h=>{const{code:d,data:w,msg:k}=h;if(s){const{records:S,rows:_}=w||{},T=S||_?S||_:w;y.value=Ie(T,c),s(h)}if(w){if(w.records!=null||w.rows!=null){const{records:S,rows:_,total:T=0}=w||{};g&&g.total!=null&&(a.total=parseInt(T)),y.value=Ie(S||_||[],c)}else y.value=Ie(w,c);l&&console.log("useRequest-res",y.value)}}).catch(h=>{s&&(console.log("useRequestErr",h),s({code:500}))}).finally(()=>{p.value=!1})};return i||C(),[p,y,C]}function Qt(t){const o=e.ref(t),n=e.ref(""),r=e.ref("");return e.watch(o,i=>{const l=i||["",""];n.value=l[0],r.value=l[1]}),[o,n,r]}function eo(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function Ie(t,o){if(!o)return t;if(t instanceof Array)return t.map(r=>{let i={};return o.forEach(l=>i[l]=r[l]),i});let n={};return o.forEach(r=>n[r]=t[r]),n}function to(t,o=[]){const{locale:n}=te.useI18n(),r=e.ref(t());return e.watch([n,...o],()=>{r.value=t()},{immediate:!0}),r}function oo(t,o="zh_cn",n="en_us"){if(!t)return"-";const r={en_us:n,zh_cn:o},l=we().global.locale.value;return t[r[l]]||t[o]||"-"}function no(t,o){let n=oe.mapState;return typeof t=="string"&&t.length>0&&(n=oe.createNamespacedHelpers(t).mapState),Je(o,n)}function lo(t,o){let n=oe.mapGetters;return typeof t=="string"&&t.length>0&&(n=oe.createNamespacedHelpers(t).mapGetters),Je(o,n)}function ao(t,o){let n=oe.mapActions;return typeof t=="string"&&t.length>0&&(n=oe.createNamespacedHelpers(t).mapActions),ro(o,n)}function Je(t,o){const n=oe.useStore(),r=o(t),i={};return Object.keys(r).forEach(l=>{const a=r[l].bind({$store:n});i[l]=e.computed(a)}),i}function ro(t,o){const n=oe.useStore(),r=o(t),i={};return Object.keys(r).forEach(l=>{i[l]=r[l].bind({$store:n})}),i}function ke(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}function Xe(){ne.VxeUI.formats.add("formatNumber",{cellFormatMethod({cellValue:t},o=2){return xe(t,o)}}),ne.VxeUI.formats.add("formatMoney",{cellFormatMethod({cellValue:t},o=2){return Ze(t,o)}}),ne.VxeUI.formats.add("formatPercent",{cellFormatMethod({cellValue:t},o=2){return Ge(t,o)}})}function Qe(){ne.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 i;return e.createVNode(e.resolveComponent("el-text"),{type:t.enum.getTag(r)},ke(i=t.enum.getName(r))?i:{default:()=>[i]})}return e.createVNode(e.resolveComponent("el-text"),null,ke(n=t.enum.getName(r))?n:{default:()=>[n]})}}),ne.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)}}),ne.VxeUI.renderer.add("TrueFalse",{renderTableDefault(t,o){const{locale:n}=te.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"]})}}),ne.VxeUI.renderer.add("I18n",{renderTableDefault(t,o){const{locale:n}=te.useI18n();let r=n.value=="zh_cn"?o.column.field:t.fieldEn;return o.row[r]||o.row[o.column.field]}}),ne.VxeUI.renderer.add("Link",{renderTableDefault(t,o){let n=o.column.field;const r=De.useRouter(),{multiple:i,to:l,openType:a="system"}=t,s=o.row[n];function c(y,p){a=="blank"?window.open(y):r.push({path:y,query:{[n]:p}})}if(i){const y=(s==null?void 0:s.split(","))||[];return y.map((p,C)=>e.createVNode("span",null,[e.createVNode(Z.ElLink,{underline:"never",type:"primary",onclick:()=>c(a=="stystem"?l:p,p)},ke(p)?p:{default:()=>[p]}),C<y.length-1?",":""]))}return e.createVNode(Z.ElLink,{underline:"never",type:"primary",onclick:()=>c(a=="stystem"?l:s,s)},ke(s)?s:{default:()=>[s]})}})}function io(){Xe(),Qe()}m.CmpDictionary=Re,m.CmpIcon=Ee,m.ConfrimButton=Dt,m.DownExcelTemp=Yt,m.ImportButton=zt,m.LayOutForm=lt,m.Layer=Zt,m.ListPage=Ut,m.OnePortalCasSDK=Jt,m.SearchBar=Ue,m.StatusMap=Ve,m._toRaw=wt,m._typeOf=eo,m.arrToStatusMap=kt,m.arrayToTree=xt,m.checkFileSize=$t,m.creatValidator=Gt,m.createImportFields=Et,m.createListPageId=Vt,m.en_us=be,m.exportExcel=dt,m.exportExcelMuilti=je,m.formatMoney=Ze,m.formatNumber=xe,m.formatPercent=Ge,m.getI18n=we,m.getI18nT=re,m.getListPageConfig=He,m.getLocaleValue=oo,m.getValueBykey=Tt,m.importExcel=ct,m.importExcelMuilti=Ae,m.messages=Oe,m.registerVxeFormatters=Xe,m.registerVxePlugins=io,m.registerVxeRenderers=Qe,m.resetListPageConfig=jt,m.setListPageConfig=At,m.setupI18n=qe,m.sleep=bt,m.stringToArray=$e,m.stripHtmlTags=_t,m.unicode2Str=St,m.useActions=ao,m.useDatePicker=Qt,m.useGetters=lo,m.useI18nReState=to,m.useRequest=Xt,m.useState=no,m.zh_cn=Ce,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
1
+ (function(m,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):(m=typeof globalThis<"u"?globalThis:m||self,Z(m.JoyAdminComponents={},m.ElementPlus,m.Vue,m.fileSaver,m.ExcelJS,m.dayjs,m.VueI18n,m._,m.VueRouter,m.Vuex,m.VxeUI))})(this,function(m,Z,e,ve,ye,me,te,ae,De,oe,ne){"use strict";const lt=e.defineComponent({name:"LayOutForm",setup(t,{slots:o,attrs:n,emit:r}){const i=e.ref(null),l=()=>o.default?o.default().filter(s=>s.type!==Symbol.for("v-cmt")).map(s=>s.type===Symbol.for("v-fgt")?s.children:s).flat().map(s=>{var c,y,p,C;return e.h(Z.ElCol,{span:((c=s.props)==null?void 0:c.span)||((p=(y=s.props)==null?void 0:y.colProps)==null?void 0:p.span)||24,...(C=s.props)==null?void 0:C.colProps},{default:()=>s})}):null;e.onMounted(()=>{r("ref",i.value)});function a(){return e.h(Z.ElForm,{...n,ref:i},()=>e.h(Z.ElRow,{gutter:n.gutter??20},{default:()=>l()}))}return a}});var Be=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Me(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ze={exports:{}};(function(t,o){(function(n,r){t.exports=r()})(Be,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(l,a,s){var c=a.prototype;s.utc=function(d){var w={date:d,utc:!0,args:arguments};return new a(w)},c.utc=function(d){var w=s(this.toDate(),{locale:this.$L,utc:!0});return d?w.add(this.utcOffset(),n):w},c.local=function(){return s(this.toDate(),{locale:this.$L,utc:!1})};var y=c.parse;c.parse=function(d){d.utc&&(this.$u=!0),this.$utils().u(d.$offset)||(this.$offset=d.$offset),y.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 C=c.utcOffset;c.utcOffset=function(d,w){var _=this.$utils().u;if(_(d))return this.$u?0:_(this.$offset)?C.call(this):this.$offset;if(typeof d=="string"&&(d=function(B){B===void 0&&(B="");var j=B.match(r);if(!j)return null;var F=(""+j[0]).match(i)||["-",0,0],M=F[0],T=60*+F[1]+ +F[2];return T===0?0:M==="+"?T:-T}(d),d===null))return this;var S=Math.abs(d)<=16?60*d:d;if(S===0)return this.utc(w);var x=this.clone();if(w)return x.$offset=S,x.$u=!1,x;var E=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(x=this.local().add(S+E,n)).$offset=S,x.$x.$localOffset=E,x};var b=c.format;c.format=function(d){var w=d||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return b.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 g=c.toDate;c.toDate=function(d){return d==="s"&&this.$offset?s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var h=c.diff;c.diff=function(d,w,_){if(d&&this.$u===d.$u)return h.call(this,d,w,_);var S=this.local(),x=s(d).local();return h.call(S,x,w,_)}}})})(ze);var at=ze.exports;const rt=Me(at);var Ne={exports:{}};(function(t,o){(function(n,r){t.exports=r()})(Be,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(i,l,a){var s,c=function(b,g,h){h===void 0&&(h={});var d=new Date(b),w=function(_,S){S===void 0&&(S={});var x=S.timeZoneName||"short",E=_+"|"+x,B=r[E];return B||(B=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:_,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:x}),r[E]=B),B}(g,h);return w.formatToParts(d)},y=function(b,g){for(var h=c(b,g),d=[],w=0;w<h.length;w+=1){var _=h[w],S=_.type,x=_.value,E=n[S];E>=0&&(d[E]=parseInt(x,10))}var B=d[3],j=B===24?0:B,F=d[0]+"-"+d[1]+"-"+d[2]+" "+j+":"+d[4]+":"+d[5]+":000",M=+b;return(a.utc(F).valueOf()-(M-=M%1e3))/6e4},p=l.prototype;p.tz=function(b,g){b===void 0&&(b=s);var h,d=this.utcOffset(),w=this.toDate(),_=w.toLocaleString("en-US",{timeZone:b}),S=Math.round((w-new Date(_))/1e3/60),x=15*-Math.round(w.getTimezoneOffset()/15)-S;if(!Number(x))h=this.utcOffset(0,g);else if(h=a(_,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(x,!0),g){var E=h.utcOffset();h=h.add(d-E,"minute")}return h.$x.$timezone=b,h},p.offsetName=function(b){var g=this.$x.$timezone||a.tz.guess(),h=c(this.valueOf(),g,{timeZoneName:b}).find(function(d){return d.type.toLowerCase()==="timezonename"});return h&&h.value};var C=p.startOf;p.startOf=function(b,g){if(!this.$x||!this.$x.$timezone)return C.call(this,b,g);var h=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return C.call(h,b,g).tz(this.$x.$timezone,!0)},a.tz=function(b,g,h){var d=h&&g,w=h||g||s,_=y(+a(),w);if(typeof b!="string")return a(b).tz(w);var S=function(j,F,M){var T=j-60*F*1e3,W=y(T,M);if(F===W)return[T,F];var k=y(T-=60*(W-F)*1e3,M);return W===k?[T,W]:[j-60*Math.min(W,k)*1e3,Math.max(W,k)]}(a.utc(b,d).valueOf(),_,w),x=S[0],E=S[1],B=a(x).utcOffset(E);return B.$x.$timezone=w,B},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(b){s=b}}})})(Ne);var it=Ne.exports;const st=Me(it),Ce={"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"}},be={"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"}},Oe={zh_cn:Ce,en_us:be};let ue=null;function qe(t=null){if(t){const{global:o}=t;return o.messages.value.zh_cn?o.mergeLocaleMessage("zh_cn",Ce):o.setLocaleMessage("zh_cn",Ce),o.messages.value.en_us?o.mergeLocaleMessage("en_us",be):o.setLocaleMessage("en_us",be),ue=t,t}return ue||(ue=te.createI18n({legacy:!1,locale:"zh_cn",fallbackLocale:"zh_cn",messages:Oe})),ue}function we(){return ue||qe()}function re(){return we().global.t}me.extend(rt),me.extend(st);async function ct(t,o){const{fields:n,range:r=1}=o;if(!n){const a=re();throw new Error(a("excel.fieldsMappingRequired"))}let i=new ye.Workbook;await i.xlsx.load(t);const l={};return i.eachSheet(function(a,s){const c=[];a.eachRow(function(y,p){if(p>r){let C={},b=!0;Object.keys(n).forEach(g=>{const h=y.getCell(n[g]).value;C[g]=h,h&&(b=!1)}),b||c.push(C)}}),l[a._name]=c}),i=null,l}const Pe={columnWidth:30};async function dt(t,o,n=[],r={}){if(!t||!o)return;const{columnStyle:i}=r,{columnWidth:l}=Pe;o.forEach(c=>{c.width=c.width?c.width:l});const{workbook:a,worksheet:s}=ut();s.columns=o,s.addRows(n),i&&await ft(a,s,i);try{const c=await a.xlsx.writeBuffer(),y=new File([c],t,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});ve.saveAs(y)}catch(c){console.log(c)}}function ut(){const t=new ye.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 ft(t,o,n){const r=Object.keys(n);for(const i of r){const l=n[i],{type:a}=l;switch(a){case"IMG":await mt(t,o,i);break}}}async function mt(t,o,n,r){const i=o.getColumn(n),l=i.values;o.getColumn(n).width=20,o.eachRow((a,s)=>{s>1&&(a.height=40)});for(let a=0,s=l.length;a<s;a++){if(a<2)continue;let c=l[a];c&&(o.getCell(i.letter+a).value="",await ht(t,o,c,{width:100,height:50,col:i._number-1,row:a-1}))}}async function ht(t,o,n,r){const{col:i,row:l,width:a,height:s}=r,{success:c,base64:y}=await gt(n,.3);if(c){const p=t.addImage({base64:y,extension:"jpeg"});o.addImage(p,{tl:{col:i,row:l},ext:{width:a,height:s}})}}function gt(t,o=1){const n=new Image;return n.setAttribute("crossOrigin","anonymous"),n.crossOrigin="anonymous",n.src=t,new Promise((r,i)=>{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 Se="---";async function Ae(t,o){const{fields:n,range:r=1}=o;if(!n){const a=re();throw new Error(a("excel.fieldsMappingRequired"))}let i=new ye.Workbook;await i.xlsx.load(t);const l={};return i.eachSheet(function(a,s){if(a.state=="visible"){const c=[],y=n[a._name];if(y){let p=Object.values(y).some(b=>b.includes("image")),C={};p&&(a.getImages().forEach(g=>{const{tl:h}=g.range,d=i.model.media.find(w=>w.index===g.imageId);if(d){const w=d.buffer.toString("base64"),_=`data:image/${d.extension};base64,${w}`,S=`${Math.ceil(h.row)}_${Math.ceil(h.col)}`;C[S]?C[S].push(_):C[S]=[_]}}),console.log("withImages-imageMap",C)),a.eachRow(function(b,g){if(g>r){let h={_excelRowNumber:g},d=!0;Object.keys(y).forEach(w=>{var B,j;let[_,S]=y[w].split(Se);const x=b.getCell(_);let E;if(S=="image"&&p){const F=x._column._number,M=`${g}_${F}`;E=C[M]||""}else x.result!=null?E=x.result:(B=x.value)!=null&&B.richText?E=x.value.richText.reduce((F,M)=>F+M.text,""):(j=x.value)!=null&&j.hyperlink?E=x.value.text||x.value.hyperlink:x.type==4&&x.value?E=me(x.value).utc().format("YYYY-MM-DD HH:mm:ss"):E=x.value;E&&S=="option"&&(E=E.split(Se)[1]),h[w]=E,E&&(d=!1)}),d||c.push(h)}}),l[a._name]=c}}}),i=null,l}const pt={date:"yyyy-mm-dd",number:"0",string:"@"};async function je(t,o){if(!t||o.length==0)return;const n=yt(o);for(const r of n.worksheets){const{columnWidth:i}=Pe,l=o[r.name];if(!l)continue;const{tableHeader:a,tableData:s}=l;a.forEach(c=>{const{style:y={},required:p}=c,{font:C={}}=y;c.style={...y,font:{...C,color:{argb:p?"FFFF0000":void 0}}}}),r.columns=a,r.addRows(s),a.forEach(c=>{let{header:y,key:p,width:C,option:b,numFmt:g,locked:h,optionFormater:d}=c;const w=r.getColumn(p);if(w.numFmt=pt[g]||g,w.width=C||i,w.protection={locked:h===!0},b){const _=n.addWorksheet(p);_.state="hidden",d||(d=S=>`${S.label}${Se}${S.value}`),_.getColumn(1).values=b.map(d),Array(100).fill("").forEach((S,x)=>{if(x>0){const E=re();r.getCell(`${w.letter}${x}`).dataValidation={type:"list",formulae:[`${p}!$A$1:$A$${b.length}`],showErrorMessage:!0,error:E("excel.invalidInput"),errorStyle:"stop",errorMessage:E("excel.invalidOption")}}})}}),a.some(c=>c.locked)&&await r.protect("6737187214",{selectLockedCells:!0,selectUnlockedCells:!0})}try{const r=await n.xlsx.writeBuffer(),i=new File([r],t,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});ve.saveAs(i)}catch(r){console.log(r)}}function yt(t){const o=re(),n=new ye.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((i,l)=>{const a=t[i].sort??0,s=t[l].sort??0;return a-s}).forEach(i=>{let l=i,a=!1;/[\\/:*?\[\]]/g.test(i)&&(i=i.replace(/[\\/:*?\[\]]/g,""),a=!0),i.length>31&&(i=i.substring(0,31).trim(),a=!0,console.warn(o("excel.sheetNameTooLong",[l,i]))),a&&(t[i]=t[l],delete t[l]),n.addWorksheet(i)}),n}function Ct(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 bt(t){return new Promise(o=>{setTimeout(()=>{o()},t)})}function wt(t){return JSON.parse(JSON.stringify(t))}function xt(t){let o=[],n={},r=(i,l)=>Object.prototype.hasOwnProperty.call(i,l);for(const i of t){n[i.id]={...i,children:r(n,i.id)?n[i.id].children:[]};const l=n[i.id];i.pid==-1?o.push(l):(r(n,i.pid)||(n[i.pid]={children:[]}),n[i.pid].children.push(l))}return o}function $e(t,o=" "){return t?t.split(o).filter(n=>n.trim()):[]}class Ve{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=we().global.locale,{label:r,labelEn:i}=this.map.get(o);return(n.value=="zh_cn"?r:i)??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 kt(t,o=[],n="i18nName"){if(t.length==0)return new Ve([]);if(o.length<2){const i=re();throw new Error(i("tools.keysLengthError"))}let r=t.map(i=>{let l={};return n&&(l.labelEn=i[n]),o.forEach((a,s)=>{s===0?l.label=i[a]:s===1?l.value=i[a]:l[a]=i[a]}),l});return new Ve(r)}function _t(t){return t?t.replace(/<[^>]+>/g,""):""}function St(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 $t(t,o=10){let n=1048576*o;return!(t.size>n)}function Vt(t){return Array.from(10).fill(0).map((n,r)=>t+"_"+r)}function Et(t){let o={};return t.map((n,r)=>{let{key:i,option:l,type:a,optionFormater:s}=n,c=Ct(r);l&&!s?o[i]=`${c}---option`:a==="image"?o[i]=`${c}---image`:o[i]=c}),o}function Tt(t,o){return o.split(".").reduce((n,r)=>n&&n[r],t)}const mo="",fe=(t,o)=>{const n=t.__vccOpts||t;for(const[r,i]of o)n[r]=i;return n},It=["onClick"],Re=fe({__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:i,locale:l}=te.useI18n(),a=e.useModel(t,"modelValue"),s=e.computed(()=>r["value-key"]!=null),c=e.ref(""),y=e.computed(()=>{if(r.remote!==void 0)return n.data;const k=$e(c.value),{data:$,labelValue:q}=n,V=$||b.value;if(k.length==0)return V;const{label:G,labelEn:ie}=q;let D=l.value=="en_us"?ie||"i18nName":G;return k.length==1?V.filter(le=>le[D].toLowerCase().includes(k[0].toLowerCase())):V.filter(le=>{let ge=!1;return ge=k.some(_e=>le[D].toLowerCase()==_e.toLowerCase()),ge})}),p=e.computed({get(){return r.multiple==null||a.value==null?!1:a.value.length==y.value.length},set(k){return k}}),C=o,b=e.ref([]),g=async()=>{const{data:k}=await n.api();b.value=[...k],C("success",b)};n.api&&g();function h(k){C("change",k),d.value&&e.nextTick(()=>{n.optionClick&&n.optionClick(d.value),d.value=null})}const d=e.ref(null);function w(){C("change",a.value),e.nextTick(()=>{n.optionClick&&n.optionClick(null)})}function _(k){d.value=k}const S=n.labelValue.label.split("-"),x=k=>{if(S.length==1){if(n.changeLocal)return i(k[n.labelValue.label]);let $=l.value=="en_us"?k[n.labelValue.labelEn||"i18nName"]:k[n.labelValue.label];return $=$||k[n.labelValue.label],$+""}else{let $=[];return S.forEach(q=>{$.push(k[q])}),$.join("-")}};function E(k){let $=n.data?n.data:b.value;a.value=k?$.map(q=>s.value?q:q[n.labelValue.value]):[],e.nextTick(()=>{C("change",a.value),C("changeAll",a.value,$)})}function B(k){C("change",s.value?k:k[n.labelValue.value]),e.nextTick(()=>{n.optionClick&&n.optionClick(k)})}function j(k){const $=s.value?k:k[n.labelValue.value],q=s.value?a.value.some(V=>V[n.labelValue.value]===k[n.labelValue.value]):a.value.includes($);return!!(n.maxLimit>0&&a.value.length>=n.maxLimit&&!q||n.minLimit>0&&a.value.length===n.minLimit&&q)}function F(k){return k.map($=>({...$,label:x($),value:s.value?$:$[n.labelValue.value]}))}const M=e.ref([]),T=n.data?n.data:b.value;M.value=F(T),e.watch(()=>n.data?n.data:b.value,k=>{var q;const $=F(k);if($.length!==M.value.length)M.value=$;else{let V=!1;for(let G=0;G<$.length;G++)if($[G].value!==((q=M.value[G])==null?void 0:q.value)){V=!0;break}V&&(M.value=$)}},{deep:!0});const W=e.computed(()=>r.multiple!==void 0&&(n.maxLimit>0||n.minLimit>0)?M.value.map(k=>({...k,disabled:j(k)})):M.value);return(k,$)=>{const q=e.resolveComponent("el-checkbox"),V=e.resolveComponent("el-select-v2"),G=e.resolveComponent("el-option"),ie=e.resolveComponent("el-select");return e.unref(r).v2!=null?(e.openBlock(),e.createBlock(V,e.mergeProps({key:0,options:W.value,modelValue:a.value,"onUpdate:modelValue":$[1]||($[1]=D=>a.value=D)},e.unref(r),{filterable:"","collapse-tags":"","collapse-tags-tooltip":"",clearable:"",onChange:h}),e.createSlots({default:e.withCtx(({item:D})=>[e.createElementVNode("div",{onClick:se=>_(D)},e.toDisplayString(D.label),9,It)]),_:2},[e.unref(r).multiple!=null?{name:"header",fn:e.withCtx(()=>[e.renderSlot(k.$slots,"header",{},()=>[e.createVNode(q,{class:"mgl20",modelValue:p.value,"onUpdate:modelValue":$[0]||($[0]=D=>p.value=D),onChange:E},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0)]),key:"0"}:void 0]),1040,["options","modelValue"])):(e.openBlock(),e.createBlock(ie,e.mergeProps({key:1,modelValue:a.value,"onUpdate:modelValue":$[3]||($[3]=D=>a.value=D),filterable:"","collapse-tags":"","collapse-tags-tooltip":"","filter-method":e.unref(r).remote!=null?void 0:D=>c.value=D,clearable:""},e.unref(r),{onClear:w}),{default:e.withCtx(()=>[e.unref(r).multiple!=null&&t.showCheckAll&&t.maxLimit==null?e.renderSlot(k.$slots,"header",{key:0},()=>[e.createVNode(q,{class:"mgl20",modelValue:p.value,"onUpdate:modelValue":$[2]||($[2]=D=>p.value=D),onChange:E},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(D,se)=>(e.openBlock(),e.createBlock(G,{key:se,label:x(D),disabled:e.unref(r).multiple!=null&&(t.maxLimit>0||t.minLimit>0)?j(D):!1,onClick:e.withModifiers(le=>B(D),["stop"]),value:s.value?D:D[t.labelValue.value]},null,8,["label","disabled","onClick","value"]))),128))]),_:3},16,["modelValue","filter-method"]))}}},[["__scopeId","data-v-12794201"]]),go="",Lt=e.defineComponent({props:{name:{tyepe:String,required:!0}}});function Ft(t,o,n,r,i,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 Ee=fe(Lt,[["render",Ft],["__scopeId","data-v-733f9daa"]]),po="",vt={class:"confirm-button-wrapper"},Dt=fe({__name:"index",emits:["ok","no"],setup(t,{emit:o}){const n=o,r=ae.debounce(()=>{n("ok")},500);function i(){n("no")}return(l,a)=>{const s=e.resolveComponent("el-popconfirm");return e.openBlock(),e.createElementBlock("span",vt,[e.createVNode(s,e.mergeProps(l.$attrs,{onConfirm:e.unref(r),onCancel:i}),{reference:e.withCtx(()=>[e.renderSlot(l.$slots,"default",{},void 0,!0)]),_:3},16,["onConfirm"])])}}},[["__scopeId","data-v-24cb35fd"]]),Co="",Bt={class:"ImportButton"},Mt=["accept"],zt=fe({__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),i=e.ref(!1);async function l(a){i.value=!0;let s=a.target.files[0];const c=await Ae(s,n.fields).catch(()=>{i.value=!1}).finally(()=>{r.value.value=null});await n.fileChange(c).finally(()=>{i.value=!1})}return(a,s)=>{const c=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",Bt,[e.createVNode(c,e.mergeProps({type:"primary",loading:i.value,class:"mgr10",onClick:s[0]||(s[0]=y=>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,Mt)])}}},[["__scopeId","data-v-ea0a4c60"]]);function Te(t){let o={};return t.forEach(n=>{const{key:r,type:i,option:l={},value:a,dateType:s="date"}=n;if(r)if(i=="input"&&(l!=null&&l.multiple))o[r]=$e(a);else if(i=="date")if(s.includes("range")){const[c,y]=r;let[p,C]=a||[];p&&s=="daterange"&&(p=me(p).format("YYYY-MM-DD 00:00:00"),C=me(C).format("YYYY-MM-DD 23:59:59")),o[c]=p,o[y]=C}else o[r]=a;else o[r]=a}),o}const wo="",Nt={key:0},Ot={class:"btns"},qt={class:"left"},Pt={class:"right"},Ue=fe({__name:"index",props:{form:{type:Object,required:!0}},emits:["confirm","reset","visibleChange"],setup(t,{expose:o,emit:n}){const r=t,i=n,l=e.ref(!0),a=e.ref(null),{t:s}=te.useI18n(),c={datetimerange:"YYYY-MM-DD HH:mm:ss",daterange:"YYYY-MM-DD",month:"YYYY-MM"},y=e.computed(()=>l.value?s("guan-bi"):s("zhan-kai"));function p(){i("confirm")}function C(_){_.option.onClear&&_.option.onClear(),i("confirm")}function b(){i("reset")}function g(){i("confirm")}function h(){return Te(r.form.items)}const d=ae.cloneDeep(r.form.items);function w(){r.form.items.forEach(_=>{const S=d.find(x=>x.key==_.key);S&&(_.value=S.value)})}return o({getPrm:h,reset:w}),(_,S)=>{const x=e.resolveComponent("el-input"),E=e.resolveComponent("el-date-picker"),B=e.resolveComponent("el-form-item"),j=e.resolveComponent("el-form"),F=e.resolveComponent("el-link"),M=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":"32px"})},[e.createVNode(j,{inline:"",model:t.form.data},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.form.items.filter(T=>!T.hidden),T=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:T.key},[T.type=="br"?(e.openBlock(),e.createElementBlock("br",Nt)):(e.openBlock(),e.createBlock(B,{key:1,label:T.name},{default:e.withCtx(()=>{var W,k;return[T.type==="input"?(e.openBlock(),e.createBlock(x,{key:0,modelValue:T.value,"onUpdate:modelValue":$=>T.value=$,class:e.normalizeClass(((W=T.option)==null?void 0:W.class)||"w150"),placeholder:_.$t("qing-shu-ru"),clearable:""},null,8,["modelValue","onUpdate:modelValue","class","placeholder"])):T.type==="custom"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(T.render),{key:1})):e.createCommentVNode("",!0),T.type==="select"?(e.openBlock(),e.createBlock(Re,e.mergeProps({key:2,class:((k=T.option)==null?void 0:k.class)||"w150",modelValue:T.value,"onUpdate:modelValue":$=>T.value=$},{ref_for:!0},T.option,{onChange:p,onClear:$=>C(T),placeholder:_.$t("qing-xuan-ze")}),null,16,["class","modelValue","onUpdate:modelValue","onClear","placeholder"])):e.createCommentVNode("",!0),T.type==="date"?(e.openBlock(),e.createBlock(E,e.mergeProps({key:3,class:{datetimerange:"w300",daterange:"w200"}[T.dateType]||"w100",modelValue:T.value,"onUpdate:modelValue":$=>T.value=$,"value-format":c[T.dateType]||"YYYY-MM-DD",type:T.dateType||"date",onFocus:$=>a.value=T,onChange:$=>g(),placeholder:_.$t("qing-xuan-ze"),"start-placeholder":_.$t("kai-shi-shi-jian"),"end-placeholder":_.$t("jie-shu-shi-jian")},{ref_for:!0},T.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",Ot,[e.createElementVNode("div",qt,[e.renderSlot(_.$slots,"table-header-left",{},void 0,!0)]),e.createElementVNode("div",Pt,[e.createVNode(F,{underline:"never",class:"mgr10",onClick:S[0]||(S[0]=()=>{i("visibleChange",!l.value),l.value=!l.value})},{default:e.withCtx(()=>[e.createVNode(Ee,{name:l.value?"ArrowUp":"ArrowDown"},null,8,["name"]),e.createTextVNode(" "+e.toDisplayString(y.value),1)]),_:1}),e.createVNode(M,{type:"primary",onClick:p},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_.$t("shai-xuan")),1)]),_:1}),e.createVNode(M,{type:"primary",onClick:b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_.$t("chong-zhi")),1)]),_:1}),e.renderSlot(_.$slots,"btn",{},void 0,!0)])])],32)}}},[["__scopeId","data-v-db6f71dd"]]),Ye={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={...Ye};function At(t){he={...he,...t,responseDataKeys:{...he.responseDataKeys,...t.responseDataKeys||{}}}}function He(){return he}function jt(){he={...Ye}}const ko="",Rt={class:"center"},Ut=fe({__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}=te.useI18n(),i=De.useRoute(),l=He(),a=t,s=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 y=e.computed(()=>{const f=i.path.replace(/\//g,"-").replace(/^-/,"")||"default-table";return a.id?`listPageId-${f}-${a.id}`:`listPageId-${f}`}),p=ae.cloneDeep(a.searchForm.items),C=a.searchForm.pageNoKey||l.pageNoKey,b=a.searchForm.pageSizeKey||l.pageSizeKey,g=e.reactive({[C]:1,[b]:a.searchForm.defaultPageSize||l.defaultPageSize,total:0}),h=e.ref(null),d=e.ref(null),w=e.ref(450),_=ae.debounce(()=>{e.nextTick(()=>{if(!d.value)return;const u=d.value.getBoundingClientRect(),I=window.innerHeight,v=u.top,P=100,Y=I-v-P,z=200;w.value=Math.max(Y,z)})},100),S=()=>{_()},x=()=>{if(!a.searchForm.enableCellCopy&&!l.enableCellCopy)return!1;const f=h.value;if(!f||!f.$el)return!1;const u=f.$el;return u.classList.add("cell-copy-enabled"),u.setAttribute("tabindex","-1"),u.removeEventListener("mousedown",ie),u.removeEventListener("mousemove",D),u.removeEventListener("mouseup",se),u.removeEventListener("keydown",Le),u.addEventListener("mousedown",ie),u.addEventListener("mousemove",D),u.addEventListener("mouseup",se),u.addEventListener("keydown",Le),!0};e.onMounted(()=>{_(),window.addEventListener("resize",S),(a.searchForm.enableCellCopy||l.enableCellCopy)&&(document.addEventListener("mouseup",et),document.addEventListener("mousedown",tt),setTimeout(()=>{x()},500))}),e.onUpdated(()=>{(a.searchForm.enableCellCopy||l.enableCellCopy)&&setTimeout(()=>{x()},500)}),e.onUnmounted(()=>{if(window.removeEventListener("resize",S),a.searchForm.enableCellCopy||l.enableCellCopy){document.removeEventListener("mouseup",et),document.removeEventListener("mousedown",tt);const f=h.value;if(f&&f.$el){const u=f.$el;u.removeEventListener("mousedown",ie),u.removeEventListener("mousemove",D),u.removeEventListener("mouseup",se),u.removeEventListener("keydown",Le)}}});const E=e.computed(()=>q.value.height||w.value);let B;async function j(f){const{dataFormat:u}=a.tableConfig;f[C]!=1&&(f.nextSearchAfter=B),s.value=!0;const{code:I,data:v={}}=await a.api(f).finally(()=>{s.value=!1,a.searchForm.selections=[]});if(I==200){let P=[];for(const z of l.responseDataKeys.rows)if(v[z]){P=v[z];break}let Y=0;for(const z of l.responseDataKeys.total)if(v[z]!==void 0){Y=v[z];break}c.value=u?u(P):P,g.total=Y,B=v.nextSearchAfter,(a.searchForm.enableCellCopy||l.enableCellCopy)&&e.nextTick(()=>{setTimeout(()=>{x()},100)})}}function F(f={}){const{searchData:u=()=>({})}=a.tableConfig,I=u();j({...g,...Te(a.searchForm.items),...f,...I})}function M(){const{reset:f}=a.tableConfig;f&&f(),a.searchForm.items.forEach(u=>{const I=p.find(v=>ae.isArray(u.key)&&ae.isArray(v.key)?u.key.join(",")==v.key.join(","):v.key==u.key);I&&(u.value=I.value)}),F()}a.api&&a.immediate&&F();function T(){return{...g,...Te(a.searchForm.items)}}const W=()=>{const f=h.value;f&&f.clearSort()},k=e.reactive({storage:!0}),$=e.reactive({drag:!0,resizable:!0,maxFixedSize:0}),q=e.computed(()=>{const{customConfig:f,columnConfig:u,...I}=a.tableConfig;return{headerAlign:"left",align:"center",customConfig:{...k,...f},columnConfig:{...$,...u},"virtual-x-config":{enabled:!1,scrollToLeftOnChange:!1},"virtual-y-config":{enabled:!0,gt:100},...I}}),V=e.reactive({isSelecting:!1,startCell:null,endCell:null,selectedCells:[]}),G=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 v=h.value;if(!v)return null;let P=-1;const Y=I.getAttribute("data-rowid");if(Y!=null)P=parseInt(Y,10);else{const N=I.parentElement;P=Array.from(N.querySelectorAll(".vxe-body--row")).indexOf(I)}if(P<0)return null;let z=-1;const ee=u.getAttribute("data-colid");if(ee&&(z=v.getColumns().findIndex(L=>L.id===ee)),z<0){const L=Array.from(I.querySelectorAll(".vxe-body--column")).indexOf(u),R=!!u.closest(".vxe-table--fixed-left-wrapper"),H=!!u.closest(".vxe-table--fixed-right-wrapper"),A=v.getColumns();if(R){const K=A.filter(U=>U.fixed==="left");L<K.length&&(z=A.indexOf(K[L]))}else if(H){const K=A.filter(U=>U.fixed==="right");L<K.length&&(z=A.indexOf(K[L]))}else{const K=a.searchForm.showCheckBox?1:0;z=A.filter(J=>J.fixed==="left").length+L-K}}return z<0?null:{rowIndex:P,colIndex:z,cell:u}},ie=f=>{const u=G(f.target);if(!u){le();return}V.isSelecting=!0,V.startCell={rowIndex:u.rowIndex,colIndex:u.colIndex},V.endCell={...V.startCell},ge(),_e()},D=f=>{if(!V.isSelecting)return;const u=G(f.target);u&&(V.endCell={rowIndex:u.rowIndex,colIndex:u.colIndex},ge(),_e())},se=()=>{V.isSelecting=!1},le=()=>{V.selectedCells=[],V.startCell=null,V.endCell=null;const f=h.value;if(!f)return;f.$el.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(I=>{I.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")})},ge=()=>{if(!V.startCell||!V.endCell){V.selectedCells=[];return}const f=V.startCell.rowIndex,u=V.endCell.rowIndex,I=V.startCell.colIndex,v=V.endCell.colIndex,P=Math.min(f,u),Y=Math.max(f,u),z=Math.min(I,v),ee=Math.max(I,v);V.selectedCells=[];for(let N=P;N<=Y;N++)for(let L=z;L<=ee;L++)V.selectedCells.push({rowIndex:N,colIndex:L})},_e=()=>{e.nextTick(()=>{const f=h.value;if(!f)return;const u=f.$el;if(u.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(R=>{R.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")}),V.selectedCells.length===0)return;const I=f.getColumns(),v=V.selectedCells.map(R=>R.rowIndex),P=V.selectedCells.map(R=>R.colIndex),Y=Math.min(...v),z=Math.max(...v),ee=Math.min(...P),N=Math.max(...P),L=[u.querySelector(".vxe-table--body-wrapper tbody"),u.querySelector(".vxe-table--fixed-left-wrapper tbody"),u.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean);V.selectedCells.forEach(({rowIndex:R,colIndex:H})=>{const A=I[H];if(!A)return;const K=A.fixed==="left",U=A.fixed==="right";for(const J of L){const pe=J.querySelectorAll(".vxe-body--row")[R];if(!pe)continue;const ce=Array.from(pe.querySelectorAll(".vxe-body--column"));let O=null;if(K&&J.closest(".vxe-table--fixed-left-wrapper")){const X=I.filter(Q=>Q.fixed==="left").indexOf(A);O=ce[X]}else if(U&&J.closest(".vxe-table--fixed-right-wrapper")){const X=I.filter(Q=>Q.fixed==="right").indexOf(A);O=ce[X]}else if(!K&&!U&&J.closest(".vxe-table--body-wrapper")){const de=a.searchForm.showCheckBox?1:0,X=I.filter(Fe=>Fe.fixed==="left").length,Q=H-X;O=ce[Q+de]}if(O&&!O.classList.contains("col--checkbox")&&!O.classList.contains("col--seq")){O.classList.add("cell-selected"),R===Y&&O.classList.add("cell-border-top"),R===z&&O.classList.add("cell-border-bottom"),H===ee&&O.classList.add("cell-border-left"),H===N&&O.classList.add("cell-border-right");break}}})})},so=async()=>{if(V.selectedCells.length===0)return;const f=h.value;if(!f)return;const u=f.$el,I=f.getColumns(),v=[...new Set(V.selectedCells.map(N=>N.rowIndex))].sort((N,L)=>N-L),P=[...new Set(V.selectedCells.map(N=>N.colIndex))].sort((N,L)=>N-L),Y=[u.querySelector(".vxe-table--body-wrapper tbody"),u.querySelector(".vxe-table--fixed-left-wrapper tbody"),u.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean),z=[];v.forEach(N=>{const L=[];P.forEach(R=>{const H=I[R];if(!H){L.push("");return}const A=H.fixed==="left",K=H.fixed==="right";let U="";for(const J of Y){const pe=J.querySelectorAll(".vxe-body--row")[N];if(!pe)continue;const ce=Array.from(pe.querySelectorAll(".vxe-body--column"));let O=null;if(A&&J.closest(".vxe-table--fixed-left-wrapper")){const X=I.filter(Q=>Q.fixed==="left").indexOf(H);O=ce[X]}else if(K&&J.closest(".vxe-table--fixed-right-wrapper")){const X=I.filter(Q=>Q.fixed==="right").indexOf(H);O=ce[X]}else if(!A&&!K&&J.closest(".vxe-table--body-wrapper")){const de=a.searchForm.showCheckBox?1:0,X=I.filter(Fe=>Fe.fixed==="left").length,Q=R-X;O=ce[Q+de]}if(O&&!O.classList.contains("col--checkbox")&&!O.classList.contains("col--seq")){U=O.innerText||O.textContent||"",U=U.trim(),U=U.replace(/\n/g," ").replace(/\s+/g," ");break}}L.push(U)}),z.push(L.join(" "))});const ee=z.join(`
2
+ `);try{await navigator.clipboard.writeText(ee)}catch(N){console.error("复制失败:",N)}},Le=f=>{!a.searchForm.enableCellCopy&&!l.enableCellCopy||((f.ctrlKey||f.metaKey)&&f.key==="c"?V.selectedCells.length>0&&(f.preventDefault(),f.stopPropagation(),so()):f.key==="Escape"&&le())},et=()=>{V.isSelecting=!1},tt=f=>{const u=h.value;if(!u||!u.$el)return;u.$el.contains(f.target)||le()},co=f=>{g[C]=f,F()},uo=f=>{g[b]=f,g[C]=1,F()};function ot(){const f=h.value.getCheckboxRecords();a.searchForm.selections=f}const nt=f=>{const u=h.value;if(u){u.toggleCheckboxRow(f);const I=h.value.getCheckboxRecords();a.searchForm.selections=I}};return o({tableRef:h,getList:F,getPrm:T,clearSort:W,calculateTableHeight:_}),(f,u)=>{var N;const I=e.resolveComponent("el-button"),v=e.resolveComponent("el-checkbox"),P=e.resolveComponent("el-text"),Y=e.resolveComponent("vxe-column"),z=e.resolveComponent("VxeTable"),ee=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({box:t.searchForm.showShadow})},[t.searchForm.showSearch?(e.openBlock(),e.createBlock(Ue,{key:0,form:t.searchForm,onReset:M,onConfirm:u[1]||(u[1]=L=>F()),onVisibleChange:e.unref(_)},{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]=L=>h.value.openCustom())},{default:e.withCtx(()=>[e.createVNode(Ee,{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:y.value,ref_key:"tableRef",ref:h,loading:t.loading||s.value,data:t.api?c.value:t.data,border:""},q.value,{height:E.value,onCheckboxChange:ot,onCheckboxAll:ot,onSortChange:(N=q.value["sort-config"])==null?void 0:N.sortChange}),{default:e.withCtx(()=>[t.searchForm.showCheckBox==null||t.searchForm.showCheckBox?(e.openBlock(),e.createBlock(Y,{key:0,type:"checkbox",width:e.unref(r)=="zh_cn"?80:150,title:f.$t("xu-hao"),fixed:"left"},{checkbox:e.withCtx(({rowIndex:L,row:R,checked:H,disabled:A,indeterminate:K})=>[e.createElementVNode("div",Rt,[H?(e.openBlock(),e.createBlock(v,{key:0,checked:!0,disabled:A,size:"default",onClick:e.withModifiers(U=>!A&&nt(R),["stop"])},null,8,["disabled","onClick"])):(e.openBlock(),e.createBlock(v,{key:1,disabled:A,checked:!1,size:"default",onClick:e.withModifiers(U=>!A&&nt(R),["stop"])},null,8,["disabled","onClick"])),e.createVNode(P,{type:"info",class:"mgl5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(L+1),1)]),_:2},1024)])]),_:1},8,["width","title"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"default",{},void 0,!0)]),_:3},16,["id","loading","data","height","onSortChange"])],512),t.searchForm.showPage?(e.openBlock(),e.createBlock(ee,{key:1,"current-page":g[e.unref(C)],"onUpdate:currentPage":u[2]||(u[2]=L=>g[e.unref(C)]=L),class:"myPagination mgt10",background:"",layout:"total, sizes, prev, pager, next",total:g.total,"page-size":g[e.unref(b)],"page-sizes":t.searchForm.pageSizes||e.unref(l).pageSizes,onCurrentChange:co,onSizeChange:uo},null,8,["current-page","total","page-size","page-sizes"])):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-c022c16d"]]),Yt={__name:"index",props:{sheetsConfig:{type:Object,required:!0},fileName:{type:String,required:!0}},setup(t){const o=t;function n(){je(o.fileName,o.sheetsConfig)}return(r,i)=>{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)}}},Ht={mounted(t,o){o.value&&Ke(t)},updated(t,o){o.value?Ke(t):We(t)},beforeUnmount(t){We(t)}};async function Ke(t){await b();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 i=!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",y),document.addEventListener("mouseup",p),window.addEventListener("resize",C);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),s()}function s(){let g=l.drag.y-l.mouse.y+l.dialog.y,h=l.drag.x-l.mouse.x+l.dialog.x;o.style.cssText+=`position: absolute; top: calc(${g}px - ${l.dialog.marginTop}); left: ${h}px;`}function c(g){g.button===0&&(l.window={width:document.body.clientWidth,height:document.body.clientHeight},l.dialog=o.getBoundingClientRect(),l.dialog.marginTop=window.getComputedStyle(o).marginTop,l.mouse={x:g.clientX,y:g.clientY},i=!0)}function y(g){i&&(l.drag={x:g.clientX,y:g.clientY},r.style.userSelect="none",a())}function p(g){r.style.userSelect="auto",i=!1}function C(g){}function b(){return new Promise((g,h)=>{setTimeout(()=>{g()},500)})}t.__mouseDown__=c,t.__mouseUp__=p,t.__mouseMove__=y,t.__sizeChange__=C}function We(t){document.removeEventListener("mousedown",t.__mouseDown__),document.removeEventListener("mousemove",t.__mouseMove__),document.removeEventListener("mouseup",t.__mouseUp__),window.removeEventListener("resize",t.__sizeChange__)}const So="",Kt={key:0,class:"drawer-btn"},Wt={key:1},Zt={__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:i}=te.useI18n(),l=ae.debounce(()=>{r("confirm")},300);async function a(){n.layer.type=="drawer"?n.layer.onClose?n.layer.onClose():n.layer.closeConfirm?await Z.ElMessageBox.confirm(i("que-ding-guan-bi-ma"),{confirmButtonText:i("que-ding"),cancelButtonText:i("qu-xiao"),type:"warning"}).catch(()=>{})=="confirm"&&(n.layer.show=!1):n.layer.show=!1:n.layer.show=!1}return(s,c)=>{const y=e.resolveComponent("el-button"),p=e.resolveComponent("el-drawer"),C=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]=b=>t.layer.show=b),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(s.$slots,"default"),c[2]||(c[2]=e.createElementVNode("p",{class:"mgt50"},null,-1)),t.layer.showButton?(e.openBlock(),e.createElementBlock("div",Kt,[e.renderSlot(s.$slots,"btn",{},()=>[e.createVNode(y,{onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.$t("qu-xiao")),1)]),_:1}),e.createVNode(y,{type:"primary",loading:t.loading,onClick:e.unref(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.$t("ti-jiao")),1)]),_:1},8,["loading","onClick"])])])):e.createCommentVNode("",!0)]),_:3},8,["modelValue","size","title"])):e.withDirectives((e.openBlock(),e.createElementBlock("div",Wt,[e.createVNode(C,{"close-on-click-modal":!1,modelValue:t.layer.show,"onUpdate:modelValue":c[1]||(c[1]=b=>t.layer.show=b),title:t.layer.title,width:t.layer.width||500,center:""},e.createSlots({default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:2},[t.layer.showButton?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(s.$slots,"btn",{},()=>[e.createVNode(y,{onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.$t("qu-xiao")),1)]),_:1}),e.createVNode(y,{type:"primary",onClick:e.unref(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.$t("ti-jiao")),1)]),_:1},8,["onClick"])])]),key:"0"}:void 0]),1032,["modelValue","title","width"])])),[[e.unref(Ht),t.layer.show]])}}};function Gt(t,o={}){const n=re(),r={inForm:!0,required:!0,...o},i={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:s,msg:c=n("validate.invalidInput")}=r;return l?function(y,p,C){if(s){i.test(p)?C():C(new Error(c));return}p&&!i.test(p)?C(new Error(c)):C()}:i.test(a)}class Jt{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 i=await fetch(o,r);return i.status===401?(this.log("Token已过期,需要重新登录"),this.logout(),null):i}catch(i){throw this.log("请求失败:",i),i}}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 xe(t,o=2,n=".",r=","){(t==null||t==="")&&(t=0);const i=Number(t);isNaN(i)?t=0:t=i,o=Math.max(0,Math.floor(o));const a=t.toFixed(o).split(".");let s=a[0];const c=a[1],y=s.startsWith("-");return y&&(s=s.slice(1)),s=s.replace(/\B(?=(\d{3})+(?!\d))/g,r),y&&(s="-"+s),o>0?s+n+c:s}function Ze(t,o=2){return xe(t,o)}function Ge(t,o=2){(t==null||t==="")&&(t=0);const n=Number(t);isNaN(n)?t=0:t=n;const r=t*100;return xe(r,o)+"%"}function Xt(t,o={}){const r=Object.assign({manual:!1,log:!1,params:null,format:null},o),{manual:i,log:l,params:a={},cb:s,format:c}=r,y=e.ref([]),p=e.ref(!1),C=b=>{const g=b||a;p.value=!0,t(g).then(h=>{const{code:d,data:w,msg:_}=h;if(s){const{records:S,rows:x}=w||{},E=S||x?S||x:w;y.value=Ie(E,c),s(h)}if(w){if(w.records!=null||w.rows!=null){const{records:S,rows:x,total:E=0}=w||{};g&&g.total!=null&&(a.total=parseInt(E)),y.value=Ie(S||x||[],c)}else y.value=Ie(w,c);l&&console.log("useRequest-res",y.value)}}).catch(h=>{s&&(console.log("useRequestErr",h),s({code:500}))}).finally(()=>{p.value=!1})};return i||C(),[p,y,C]}function Qt(t){const o=e.ref(t),n=e.ref(""),r=e.ref("");return e.watch(o,i=>{const l=i||["",""];n.value=l[0],r.value=l[1]}),[o,n,r]}function eo(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function Ie(t,o){if(!o)return t;if(t instanceof Array)return t.map(r=>{let i={};return o.forEach(l=>i[l]=r[l]),i});let n={};return o.forEach(r=>n[r]=t[r]),n}function to(t,o=[]){const{locale:n}=te.useI18n(),r=e.ref(t());return e.watch([n,...o],()=>{r.value=t()},{immediate:!0}),r}function oo(t,o="zh_cn",n="en_us"){if(!t)return"-";const r={en_us:n,zh_cn:o},l=we().global.locale.value;return t[r[l]]||t[o]||"-"}function no(t,o){let n=oe.mapState;return typeof t=="string"&&t.length>0&&(n=oe.createNamespacedHelpers(t).mapState),Je(o,n)}function lo(t,o){let n=oe.mapGetters;return typeof t=="string"&&t.length>0&&(n=oe.createNamespacedHelpers(t).mapGetters),Je(o,n)}function ao(t,o){let n=oe.mapActions;return typeof t=="string"&&t.length>0&&(n=oe.createNamespacedHelpers(t).mapActions),ro(o,n)}function Je(t,o){const n=oe.useStore(),r=o(t),i={};return Object.keys(r).forEach(l=>{const a=r[l].bind({$store:n});i[l]=e.computed(a)}),i}function ro(t,o){const n=oe.useStore(),r=o(t),i={};return Object.keys(r).forEach(l=>{i[l]=r[l].bind({$store:n})}),i}function ke(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}function Xe(){ne.VxeUI.formats.add("formatNumber",{cellFormatMethod({cellValue:t},o=2){return xe(t,o)}}),ne.VxeUI.formats.add("formatMoney",{cellFormatMethod({cellValue:t},o=2){return Ze(t,o)}}),ne.VxeUI.formats.add("formatPercent",{cellFormatMethod({cellValue:t},o=2){return Ge(t,o)}})}function Qe(){ne.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 i;return e.createVNode(e.resolveComponent("el-text"),{type:t.enum.getTag(r)},ke(i=t.enum.getName(r))?i:{default:()=>[i]})}return e.createVNode(e.resolveComponent("el-text"),null,ke(n=t.enum.getName(r))?n:{default:()=>[n]})}}),ne.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)}}),ne.VxeUI.renderer.add("TrueFalse",{renderTableDefault(t,o){const{locale:n}=te.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"]})}}),ne.VxeUI.renderer.add("I18n",{renderTableDefault(t,o){const{locale:n}=te.useI18n();let r=n.value=="zh_cn"?o.column.field:t.fieldEn;return o.row[r]||o.row[o.column.field]}}),ne.VxeUI.renderer.add("Link",{renderTableDefault(t,o){let n=o.column.field;const r=De.useRouter(),{multiple:i,to:l,openType:a="system"}=t,s=o.row[n];function c(y,p){a=="blank"?window.open(y):r.push({path:y,query:{[n]:p}})}if(i){const y=(s==null?void 0:s.split(","))||[];return y.map((p,C)=>e.createVNode("span",null,[e.createVNode(Z.ElLink,{underline:"never",type:"primary",onclick:()=>c(a=="stystem"?l:p,p)},ke(p)?p:{default:()=>[p]}),C<y.length-1?",":""]))}return e.createVNode(Z.ElLink,{underline:"never",type:"primary",onclick:()=>c(a=="stystem"?l:s,s)},ke(s)?s:{default:()=>[s]})}})}function io(){Xe(),Qe()}m.CmpDictionary=Re,m.CmpIcon=Ee,m.ConfrimButton=Dt,m.DownExcelTemp=Yt,m.ImportButton=zt,m.LayOutForm=lt,m.Layer=Zt,m.ListPage=Ut,m.OnePortalCasSDK=Jt,m.SearchBar=Ue,m.StatusMap=Ve,m._toRaw=wt,m._typeOf=eo,m.arrToStatusMap=kt,m.arrayToTree=xt,m.checkFileSize=$t,m.creatValidator=Gt,m.createImportFields=Et,m.createListPageId=Vt,m.en_us=be,m.exportExcel=dt,m.exportExcelMuilti=je,m.formatMoney=Ze,m.formatNumber=xe,m.formatPercent=Ge,m.getI18n=we,m.getI18nT=re,m.getListPageConfig=He,m.getLocaleValue=oo,m.getValueBykey=Tt,m.importExcel=ct,m.importExcelMuilti=Ae,m.messages=Oe,m.registerVxeFormatters=Xe,m.registerVxePlugins=io,m.registerVxeRenderers=Qe,m.resetListPageConfig=jt,m.setListPageConfig=At,m.setupI18n=qe,m.sleep=bt,m.stringToArray=$e,m.stripHtmlTags=_t,m.unicode2Str=St,m.useActions=ao,m.useDatePicker=Qt,m.useGetters=lo,m.useI18nReState=to,m.useRequest=Xt,m.useState=no,m.zh_cn=Ce,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "joy-admin-components",
3
- "version": "0.2.73",
3
+ "version": "0.2.74",
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",