joy-admin-components 0.2.47 → 0.2.48

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.
@@ -48,57 +48,57 @@ var ht = { exports: {} };
48
48
  var n = "minute", a = /[+-]\d\d(?::?\d\d)?/g, s = /([+-]|\d\d)/g;
49
49
  return function(o, l, r) {
50
50
  var i = l.prototype;
51
- r.utc = function(u) {
52
- var p = { date: u, utc: !0, args: arguments };
51
+ r.utc = function(c) {
52
+ var p = { date: c, utc: !0, args: arguments };
53
53
  return new l(p);
54
- }, i.utc = function(u) {
54
+ }, i.utc = function(c) {
55
55
  var p = r(this.toDate(), { locale: this.$L, utc: !0 });
56
- return u ? p.add(this.utcOffset(), n) : p;
56
+ return c ? p.add(this.utcOffset(), n) : p;
57
57
  }, i.local = function() {
58
58
  return r(this.toDate(), { locale: this.$L, utc: !1 });
59
59
  };
60
60
  var y = i.parse;
61
- i.parse = function(u) {
62
- u.utc && (this.$u = !0), this.$utils().u(u.$offset) || (this.$offset = u.$offset), y.call(this, u);
61
+ i.parse = function(c) {
62
+ c.utc && (this.$u = !0), this.$utils().u(c.$offset) || (this.$offset = c.$offset), y.call(this, c);
63
63
  };
64
64
  var m = i.init;
65
65
  i.init = function() {
66
66
  if (this.$u) {
67
- var u = this.$d;
68
- this.$y = u.getUTCFullYear(), this.$M = u.getUTCMonth(), this.$D = u.getUTCDate(), this.$W = u.getUTCDay(), this.$H = u.getUTCHours(), this.$m = u.getUTCMinutes(), this.$s = u.getUTCSeconds(), this.$ms = u.getUTCMilliseconds();
67
+ var c = this.$d;
68
+ this.$y = c.getUTCFullYear(), this.$M = c.getUTCMonth(), this.$D = c.getUTCDate(), this.$W = c.getUTCDay(), this.$H = c.getUTCHours(), this.$m = c.getUTCMinutes(), this.$s = c.getUTCSeconds(), this.$ms = c.getUTCMilliseconds();
69
69
  } else
70
70
  m.call(this);
71
71
  };
72
72
  var v = i.utcOffset;
73
- i.utcOffset = function(u, p) {
73
+ i.utcOffset = function(c, p) {
74
74
  var b = this.$utils().u;
75
- if (b(u))
75
+ if (b(c))
76
76
  return this.$u ? 0 : b(this.$offset) ? v.call(this) : this.$offset;
77
- if (typeof u == "string" && (u = function(V) {
77
+ if (typeof c == "string" && (c = function(V) {
78
78
  V === void 0 && (V = "");
79
79
  var Y = V.match(a);
80
80
  if (!Y)
81
81
  return null;
82
82
  var I = ("" + Y[0]).match(s) || ["-", 0, 0], G = I[0], _ = 60 * +I[1] + +I[2];
83
83
  return _ === 0 ? 0 : G === "+" ? _ : -_;
84
- }(u), u === null))
84
+ }(c), c === null))
85
85
  return this;
86
- var C = Math.abs(u) <= 16 ? 60 * u : u;
87
- if (C === 0)
86
+ var x = Math.abs(c) <= 16 ? 60 * c : c;
87
+ if (x === 0)
88
88
  return this.utc(p);
89
- var x = this.clone();
89
+ var w = this.clone();
90
90
  if (p)
91
- return x.$offset = C, x.$u = !1, x;
91
+ return w.$offset = x, w.$u = !1, w;
92
92
  var E = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
93
- return (x = this.local().add(C + E, n)).$offset = C, x.$x.$localOffset = E, x;
93
+ return (w = this.local().add(x + E, n)).$offset = x, w.$x.$localOffset = E, w;
94
94
  };
95
95
  var g = i.format;
96
- i.format = function(u) {
97
- var p = u || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
96
+ i.format = function(c) {
97
+ var p = c || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
98
98
  return g.call(this, p);
99
99
  }, i.valueOf = function() {
100
- var u = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
101
- return this.$d.valueOf() - 6e4 * u;
100
+ var c = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
101
+ return this.$d.valueOf() - 6e4 * c;
102
102
  }, i.isUTC = function() {
103
103
  return !!this.$u;
104
104
  }, i.toISOString = function() {
@@ -107,15 +107,15 @@ var ht = { exports: {} };
107
107
  return this.toDate().toUTCString();
108
108
  };
109
109
  var h = i.toDate;
110
- i.toDate = function(u) {
111
- return u === "s" && this.$offset ? r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : h.call(this);
110
+ i.toDate = function(c) {
111
+ return c === "s" && this.$offset ? r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : h.call(this);
112
112
  };
113
113
  var f = i.diff;
114
- i.diff = function(u, p, b) {
115
- if (u && this.$u === u.$u)
116
- return f.call(this, u, p, b);
117
- var C = this.local(), x = r(u).local();
118
- return f.call(C, x, p, b);
114
+ i.diff = function(c, p, b) {
115
+ if (c && this.$u === c.$u)
116
+ return f.call(this, c, p, b);
117
+ var x = this.local(), w = r(c).local();
118
+ return f.call(x, w, p, b);
119
119
  };
120
120
  };
121
121
  });
@@ -131,33 +131,33 @@ var mt = { exports: {} };
131
131
  return function(s, o, l) {
132
132
  var r, i = function(g, h, f) {
133
133
  f === void 0 && (f = {});
134
- var u = new Date(g), p = function(b, C) {
135
- C === void 0 && (C = {});
136
- var x = C.timeZoneName || "short", E = b + "|" + x, V = a[E];
137
- return V || (V = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: b, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: x }), a[E] = V), V;
134
+ var c = new Date(g), p = function(b, x) {
135
+ x === void 0 && (x = {});
136
+ var w = x.timeZoneName || "short", E = b + "|" + w, V = a[E];
137
+ return V || (V = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: b, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: w }), a[E] = V), V;
138
138
  }(h, f);
139
- return p.formatToParts(u);
139
+ return p.formatToParts(c);
140
140
  }, y = function(g, h) {
141
- for (var f = i(g, h), u = [], p = 0; p < f.length; p += 1) {
142
- var b = f[p], C = b.type, x = b.value, E = n[C];
143
- E >= 0 && (u[E] = parseInt(x, 10));
141
+ for (var f = i(g, h), c = [], p = 0; p < f.length; p += 1) {
142
+ var b = f[p], x = b.type, w = b.value, E = n[x];
143
+ E >= 0 && (c[E] = parseInt(w, 10));
144
144
  }
145
- var V = u[3], Y = V === 24 ? 0 : V, I = u[0] + "-" + u[1] + "-" + u[2] + " " + Y + ":" + u[4] + ":" + u[5] + ":000", G = +g;
145
+ var V = c[3], Y = V === 24 ? 0 : V, I = c[0] + "-" + c[1] + "-" + c[2] + " " + Y + ":" + c[4] + ":" + c[5] + ":000", G = +g;
146
146
  return (l.utc(I).valueOf() - (G -= G % 1e3)) / 6e4;
147
147
  }, m = o.prototype;
148
148
  m.tz = function(g, h) {
149
149
  g === void 0 && (g = r);
150
- var f, u = this.utcOffset(), p = this.toDate(), b = p.toLocaleString("en-US", { timeZone: g }), C = Math.round((p - new Date(b)) / 1e3 / 60), x = 15 * -Math.round(p.getTimezoneOffset() / 15) - C;
151
- if (!Number(x))
150
+ var f, c = this.utcOffset(), p = this.toDate(), b = p.toLocaleString("en-US", { timeZone: g }), x = Math.round((p - new Date(b)) / 1e3 / 60), w = 15 * -Math.round(p.getTimezoneOffset() / 15) - x;
151
+ if (!Number(w))
152
152
  f = this.utcOffset(0, h);
153
- else if (f = l(b, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(x, !0), h) {
153
+ else if (f = l(b, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(w, !0), h) {
154
154
  var E = f.utcOffset();
155
- f = f.add(u - E, "minute");
155
+ f = f.add(c - E, "minute");
156
156
  }
157
157
  return f.$x.$timezone = g, f;
158
158
  }, m.offsetName = function(g) {
159
- var h = this.$x.$timezone || l.tz.guess(), f = i(this.valueOf(), h, { timeZoneName: g }).find(function(u) {
160
- return u.type.toLowerCase() === "timezonename";
159
+ var h = this.$x.$timezone || l.tz.guess(), f = i(this.valueOf(), h, { timeZoneName: g }).find(function(c) {
160
+ return c.type.toLowerCase() === "timezonename";
161
161
  });
162
162
  return f && f.value;
163
163
  };
@@ -168,16 +168,16 @@ var mt = { exports: {} };
168
168
  var f = l(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
169
169
  return v.call(f, g, h).tz(this.$x.$timezone, !0);
170
170
  }, l.tz = function(g, h, f) {
171
- var u = f && h, p = f || h || r, b = y(+l(), p);
171
+ var c = f && h, p = f || h || r, b = y(+l(), p);
172
172
  if (typeof g != "string")
173
173
  return l(g).tz(p);
174
- var C = function(Y, I, G) {
175
- var _ = Y - 60 * I * 1e3, w = y(_, G);
176
- if (I === w)
174
+ var x = function(Y, I, G) {
175
+ var _ = Y - 60 * I * 1e3, C = y(_, G);
176
+ if (I === C)
177
177
  return [_, I];
178
- var k = y(_ -= 60 * (w - I) * 1e3, G);
179
- return w === k ? [_, w] : [Y - 60 * Math.min(w, k) * 1e3, Math.max(w, k)];
180
- }(l.utc(g, u).valueOf(), b, p), x = C[0], E = C[1], V = l(x).utcOffset(E);
178
+ var k = y(_ -= 60 * (C - I) * 1e3, G);
179
+ return C === k ? [_, C] : [Y - 60 * Math.min(C, k) * 1e3, Math.max(C, k)];
180
+ }(l.utc(g, c).valueOf(), b, p), w = x[0], E = x[1], V = l(w).utcOffset(E);
181
181
  return V.$x.$timezone = p, V;
182
182
  }, l.tz.guess = function() {
183
183
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
@@ -404,26 +404,26 @@ async function tn(e, t) {
404
404
  if (y) {
405
405
  let m = Object.values(y).some((g) => g.includes("image")), v = {};
406
406
  m && (l.getImages().forEach((h) => {
407
- const { tl: f } = h.range, u = s.model.media.find((p) => p.index === h.imageId);
408
- if (u) {
409
- const p = u.buffer.toString("base64"), b = `data:image/${u.extension};base64,${p}`, C = `${Math.ceil(f.row)}_${Math.ceil(f.col)}`;
410
- v[C] ? v[C].push(b) : v[C] = [b];
407
+ const { tl: f } = h.range, c = s.model.media.find((p) => p.index === h.imageId);
408
+ if (c) {
409
+ const p = c.buffer.toString("base64"), b = `data:image/${c.extension};base64,${p}`, x = `${Math.ceil(f.row)}_${Math.ceil(f.col)}`;
410
+ v[x] ? v[x].push(b) : v[x] = [b];
411
411
  }
412
412
  }), console.log("withImages-imageMap", v)), l.eachRow(function(g, h) {
413
413
  if (h > a) {
414
- let f = {}, u = !0;
414
+ let f = {}, c = !0;
415
415
  Object.keys(y).forEach((p) => {
416
416
  var V;
417
- let [b, C] = y[p].split(je);
418
- const x = g.getCell(b);
417
+ let [b, x] = y[p].split(je);
418
+ const w = g.getCell(b);
419
419
  let E;
420
- if (C == "image" && m) {
421
- const Y = x._column._number, I = `${h}_${Y}`;
420
+ if (x == "image" && m) {
421
+ const Y = w._column._number, I = `${h}_${Y}`;
422
422
  E = v[I] || "";
423
423
  } else
424
- x.result != null ? E = x.result : (V = x.value) != null && V.richText ? E = x.value.richText.reduce((Y, I) => Y + I.text, "") : x.type == 4 && x.value ? E = $e(x.value).utc().format("YYYY-MM-DD HH:mm:ss") : E = x.value;
425
- E && C == "option" && (E = E.split(je)[1]), f[p] = E, E && (u = !1);
426
- }), u || i.push(f);
424
+ w.result != null ? E = w.result : (V = w.value) != null && V.richText ? E = w.value.richText.reduce((Y, I) => Y + I.text, "") : w.type == 4 && w.value ? E = $e(w.value).utc().format("YYYY-MM-DD HH:mm:ss") : E = w.value;
425
+ E && x == "option" && (E = E.split(je)[1]), f[p] = E, E && (c = !1);
426
+ }), c || i.push(f);
427
427
  }
428
428
  }), o[l._name] = i;
429
429
  }
@@ -453,25 +453,25 @@ async function on(e, t) {
453
453
  }
454
454
  };
455
455
  }), a.columns = l, a.addRows(r), l.forEach((i) => {
456
- const { header: y, key: m, width: v, option: g, numFmt: h } = i, f = a.getColumn(m);
457
- if (f.numFmt = nn[h] || h, f.width = v || o, g) {
458
- const u = n.addWorksheet(m);
459
- u.state = "hidden", u.getColumn(1).values = g.map((p) => `${p.label}${je}${p.value}`), Array(100).fill("").forEach((p, b) => {
460
- if (b > 0) {
461
- const C = Ce();
462
- a.getCell(`${f.letter}${b}`).dataValidation = {
456
+ const { header: y, key: m, width: v, option: g, numFmt: h, locked: f } = i, c = a.getColumn(m);
457
+ if (c.numFmt = nn[h] || h, c.width = v || o, c.protection = { locked: f }, g) {
458
+ const p = n.addWorksheet(m);
459
+ p.state = "hidden", p.getColumn(1).values = g.map((b) => `${b.label}${je}${b.value}`), Array(100).fill("").forEach((b, x) => {
460
+ if (x > 0) {
461
+ const w = Ce();
462
+ a.getCell(`${c.letter}${x}`).dataValidation = {
463
463
  type: "list",
464
464
  formulae: [`${m}!$A$1:$A$${g.length}`],
465
465
  showErrorMessage: !0,
466
- error: C("excel.invalidInput"),
466
+ error: w("excel.invalidInput"),
467
467
  errorStyle: "stop",
468
- errorMessage: C("excel.invalidOption")
468
+ errorMessage: w("excel.invalidOption")
469
469
  };
470
470
  }
471
471
  });
472
472
  }
473
473
  });
474
- });
474
+ }), tableHeader.some((a) => a.locked) && await n.protect("6737187214");
475
475
  try {
476
476
  const a = await n.xlsx.writeBuffer(), s = new File([a], e, {
477
477
  type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
@@ -647,78 +647,78 @@ const Se = (e, t) => {
647
647
  const n = e, a = Lt(), { t: s, locale: o } = pe(), l = Tt(e, "modelValue"), r = ce(() => a["value-key"] != null), i = P(""), y = ce(() => {
648
648
  if (a.remote !== void 0)
649
649
  return n.data;
650
- const w = pt(i.value), { data: k, labelValue: j } = n, te = k || g.value;
651
- if (w.length == 0)
650
+ const C = pt(i.value), { data: k, labelValue: j } = n, te = k || g.value;
651
+ if (C.length == 0)
652
652
  return te;
653
653
  const { label: $, labelEn: ye } = j;
654
654
  let z = o.value == "en_us" ? ye || "i18nName" : $;
655
- return w.length == 1 ? te.filter(
656
- (de) => de[z].toLowerCase().includes(w[0].toLowerCase())
655
+ return C.length == 1 ? te.filter(
656
+ (de) => de[z].toLowerCase().includes(C[0].toLowerCase())
657
657
  ) : te.filter((de) => {
658
658
  let ve = !1;
659
- return ve = w.some((Ee) => de[z].toLowerCase() == Ee.toLowerCase()), ve;
659
+ return ve = C.some((Ee) => de[z].toLowerCase() == Ee.toLowerCase()), ve;
660
660
  });
661
661
  }), m = ce({
662
662
  get() {
663
663
  return a.multiple == null || l.value == null ? !1 : l.value.length == y.value.length;
664
664
  },
665
- set(w) {
666
- return w;
665
+ set(C) {
666
+ return C;
667
667
  }
668
668
  }), v = t, g = P([]), h = async () => {
669
- const { data: w } = await n.api();
670
- g.value = [...w], v("success", g);
669
+ const { data: C } = await n.api();
670
+ g.value = [...C], v("success", g);
671
671
  };
672
672
  n.api && h();
673
- function f(w) {
674
- v("change", w), u.value && we(() => {
675
- n.optionClick && n.optionClick(u.value), u.value = null;
673
+ function f(C) {
674
+ v("change", C), c.value && we(() => {
675
+ n.optionClick && n.optionClick(c.value), c.value = null;
676
676
  });
677
677
  }
678
- const u = P(null);
679
- function p(w) {
680
- u.value = w;
678
+ const c = P(null);
679
+ function p(C) {
680
+ c.value = C;
681
681
  }
682
- const b = n.labelValue.label.split("-"), C = (w) => {
682
+ const b = n.labelValue.label.split("-"), x = (C) => {
683
683
  if (b.length == 1) {
684
684
  if (n.changeLocal)
685
- return s(w[n.labelValue.label]);
686
- let k = o.value == "en_us" ? w[n.labelValue.labelEn || "i18nName"] : w[n.labelValue.label];
687
- return k = k || w[n.labelValue.label], k + "";
685
+ return s(C[n.labelValue.label]);
686
+ let k = o.value == "en_us" ? C[n.labelValue.labelEn || "i18nName"] : C[n.labelValue.label];
687
+ return k = k || C[n.labelValue.label], k + "";
688
688
  } else {
689
689
  let k = [];
690
690
  return b.forEach((j) => {
691
- k.push(w[j]);
691
+ k.push(C[j]);
692
692
  }), k.join("-");
693
693
  }
694
694
  };
695
- function x(w) {
695
+ function w(C) {
696
696
  let k = n.data ? n.data : g.value;
697
- l.value = w ? k.map((j) => r.value ? j : j[n.labelValue.value]) : [], we(() => {
697
+ l.value = C ? k.map((j) => r.value ? j : j[n.labelValue.value]) : [], we(() => {
698
698
  v("change", l.value), v("changeAll", l.value, k);
699
699
  });
700
700
  }
701
- function E(w) {
702
- v("change", r.value ? w : w[n.labelValue.value]), we(() => {
703
- n.optionClick && n.optionClick(w);
701
+ function E(C) {
702
+ v("change", r.value ? C : C[n.labelValue.value]), we(() => {
703
+ n.optionClick && n.optionClick(C);
704
704
  });
705
705
  }
706
- function V(w) {
707
- return l.value.length >= n.maxLimit && !l.value.includes(w[n.labelValue.value]);
706
+ function V(C) {
707
+ return l.value.length >= n.maxLimit && !l.value.includes(C[n.labelValue.value]);
708
708
  }
709
- function Y(w) {
710
- return w.map((k) => ({
709
+ function Y(C) {
710
+ return C.map((k) => ({
711
711
  ...k,
712
- label: C(k),
712
+ label: x(k),
713
713
  value: r.value ? k : k[n.labelValue.value]
714
714
  }));
715
715
  }
716
716
  const I = P([]), G = n.data ? n.data : g.value;
717
717
  I.value = Y(G), Pe(
718
718
  () => n.data ? n.data : g.value,
719
- (w) => {
719
+ (C) => {
720
720
  var j;
721
- const k = Y(w);
721
+ const k = Y(C);
722
722
  if (k.length !== I.value.length)
723
723
  I.value = k;
724
724
  else {
@@ -734,7 +734,7 @@ const Se = (e, t) => {
734
734
  { deep: !0 }
735
735
  );
736
736
  const _ = ce(() => I.value);
737
- return (w, k) => {
737
+ return (C, k) => {
738
738
  const j = O("el-checkbox"), te = O("el-select-v2"), $ = O("el-option"), ye = O("el-select");
739
739
  return H(a).v2 != null ? (L(), N(te, ue({
740
740
  key: 0,
@@ -759,15 +759,15 @@ const Se = (e, t) => {
759
759
  H(a).multiple != null ? {
760
760
  name: "header",
761
761
  fn: D(() => [
762
- Q(w.$slots, "header", {}, () => [
762
+ Q(C.$slots, "header", {}, () => [
763
763
  M(j, {
764
764
  class: "mgl20",
765
765
  modelValue: m.value,
766
766
  "onUpdate:modelValue": k[0] || (k[0] = (z) => m.value = z),
767
- onChange: x
767
+ onChange: w
768
768
  }, {
769
769
  default: D(() => [
770
- ne(ee(w.$t("quan-xuan")), 1)
770
+ ne(ee(C.$t("quan-xuan")), 1)
771
771
  ]),
772
772
  _: 1
773
773
  }, 8, ["modelValue"])
@@ -786,22 +786,22 @@ const Se = (e, t) => {
786
786
  clearable: ""
787
787
  }, H(a), { onClear: e.optionClick }), {
788
788
  default: D(() => [
789
- H(a).multiple != null && e.showCheckAll && e.maxLimit == null ? Q(w.$slots, "header", { key: 0 }, () => [
789
+ H(a).multiple != null && e.showCheckAll && e.maxLimit == null ? Q(C.$slots, "header", { key: 0 }, () => [
790
790
  M(j, {
791
791
  class: "mgl20",
792
792
  modelValue: m.value,
793
793
  "onUpdate:modelValue": k[2] || (k[2] = (z) => m.value = z),
794
- onChange: x
794
+ onChange: w
795
795
  }, {
796
796
  default: D(() => [
797
- ne(ee(w.$t("quan-xuan")), 1)
797
+ ne(ee(C.$t("quan-xuan")), 1)
798
798
  ]),
799
799
  _: 1
800
800
  }, 8, ["modelValue"])
801
801
  ], !0) : fe("", !0),
802
802
  (L(!0), ie(Oe, null, at(y.value, (z, he) => (L(), N($, {
803
803
  key: he,
804
- label: C(z),
804
+ label: x(z),
805
805
  disabled: H(a).multiple != null && e.maxLimit > 0 ? V(z) : !1,
806
806
  onClick: Ve((de) => E(z), ["stop"]),
807
807
  value: r.value ? z : z[e.labelValue.value]
@@ -962,15 +962,15 @@ const mn = { key: 0 }, gn = { class: "btns" }, pn = { class: "left" }, yn = { cl
962
962
  function f() {
963
963
  return Ue(a.form.items);
964
964
  }
965
- const u = ct(a.form.items);
965
+ const c = ct(a.form.items);
966
966
  function p() {
967
967
  a.form.items.forEach((b) => {
968
- const C = u.find((x) => x.key == b.key);
969
- C && (b.value = C.value);
968
+ const x = c.find((w) => w.key == b.key);
969
+ x && (b.value = x.value);
970
970
  });
971
971
  }
972
- return t({ getPrm: f, reset: p }), (b, C) => {
973
- const x = O("el-input"), E = O("el-date-picker"), V = O("el-form-item"), Y = O("el-form"), I = O("el-link"), G = O("el-button");
972
+ return t({ getPrm: f, reset: p }), (b, x) => {
973
+ const w = O("el-input"), E = O("el-date-picker"), V = O("el-form-item"), Y = O("el-form"), I = O("el-link"), G = O("el-button");
974
974
  return L(), ie("div", {
975
975
  class: "searchBar-container mgt10 mgb10",
976
976
  onKeydown: Dt(m, ["enter"])
@@ -992,13 +992,13 @@ const mn = { key: 0 }, gn = { class: "btns" }, pn = { class: "left" }, yn = { cl
992
992
  label: _.name
993
993
  }, {
994
994
  default: D(() => {
995
- var w, k;
995
+ var C, k;
996
996
  return [
997
- _.type === "input" ? (L(), N(x, {
997
+ _.type === "input" ? (L(), N(w, {
998
998
  key: 0,
999
999
  modelValue: _.value,
1000
1000
  "onUpdate:modelValue": (j) => _.value = j,
1001
- class: rt(((w = _.option) == null ? void 0 : w.class) || "w150"),
1001
+ class: rt(((C = _.option) == null ? void 0 : C.class) || "w150"),
1002
1002
  placeholder: b.$t("qing-shu-ru"),
1003
1003
  clearable: ""
1004
1004
  }, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) : _.type === "custom" ? (L(), N(st(_.render), { key: 1 })) : fe("", !0),
@@ -1041,7 +1041,7 @@ const mn = { key: 0 }, gn = { class: "btns" }, pn = { class: "left" }, yn = { cl
1041
1041
  M(I, {
1042
1042
  underline: "never",
1043
1043
  class: "mgr10",
1044
- onClick: C[0] || (C[0] = () => {
1044
+ onClick: x[0] || (x[0] = () => {
1045
1045
  s("visibleChange", !o.value), o.value = !o.value;
1046
1046
  })
1047
1047
  }, {
@@ -1170,46 +1170,46 @@ const Cn = { class: "center" }, xn = {
1170
1170
  [v]: 1,
1171
1171
  [g]: l.searchForm.defaultPageSize || o.defaultPageSize,
1172
1172
  total: 0
1173
- }), f = P(null), u = P(null), p = P(450), b = Re(() => {
1173
+ }), f = P(null), c = P(null), p = P(450), b = Re(() => {
1174
1174
  we(() => {
1175
- if (!u.value)
1175
+ if (!c.value)
1176
1176
  return;
1177
- const c = u.value.getBoundingClientRect(), S = window.innerHeight, T = c.top, R = 100, Z = S - T - R, q = 200;
1177
+ const u = c.value.getBoundingClientRect(), S = window.innerHeight, T = u.top, R = 100, Z = S - T - R, q = 200;
1178
1178
  p.value = Math.max(Z, q);
1179
1179
  });
1180
- }, 100), C = () => {
1180
+ }, 100), x = () => {
1181
1181
  b();
1182
- }, x = () => {
1182
+ }, w = () => {
1183
1183
  if (!l.searchForm.enableCellCopy && !o.enableCellCopy)
1184
1184
  return !1;
1185
1185
  const d = f.value;
1186
1186
  if (!d || !d.$el)
1187
1187
  return !1;
1188
- const c = d.$el;
1189
- return c.classList.add("cell-copy-enabled"), c.setAttribute("tabindex", "-1"), c.removeEventListener("mousedown", z), c.removeEventListener("mousemove", he), c.removeEventListener("mouseup", de), c.removeEventListener("keydown", Te), c.addEventListener("mousedown", z), c.addEventListener("mousemove", he), c.addEventListener("mouseup", de), c.addEventListener("keydown", Te), !0;
1188
+ const u = d.$el;
1189
+ return u.classList.add("cell-copy-enabled"), u.setAttribute("tabindex", "-1"), u.removeEventListener("mousedown", z), u.removeEventListener("mousemove", he), u.removeEventListener("mouseup", de), u.removeEventListener("keydown", Te), u.addEventListener("mousedown", z), u.addEventListener("mousemove", he), u.addEventListener("mouseup", de), u.addEventListener("keydown", Te), !0;
1190
1190
  };
1191
1191
  ot(() => {
1192
- b(), window.addEventListener("resize", C), (l.searchForm.enableCellCopy || o.enableCellCopy) && (document.addEventListener("mouseup", He), document.addEventListener("mousedown", Ne), setTimeout(() => {
1193
- x();
1192
+ b(), window.addEventListener("resize", x), (l.searchForm.enableCellCopy || o.enableCellCopy) && (document.addEventListener("mouseup", He), document.addEventListener("mousedown", Ne), setTimeout(() => {
1193
+ w();
1194
1194
  }, 500));
1195
1195
  }), Mt(() => {
1196
1196
  (l.searchForm.enableCellCopy || o.enableCellCopy) && setTimeout(() => {
1197
- x();
1197
+ w();
1198
1198
  }, 500);
1199
1199
  }), Ot(() => {
1200
- if (window.removeEventListener("resize", C), l.searchForm.enableCellCopy || o.enableCellCopy) {
1200
+ if (window.removeEventListener("resize", x), l.searchForm.enableCellCopy || o.enableCellCopy) {
1201
1201
  document.removeEventListener("mouseup", He), document.removeEventListener("mousedown", Ne);
1202
1202
  const d = f.value;
1203
1203
  if (d && d.$el) {
1204
- const c = d.$el;
1205
- c.removeEventListener("mousedown", z), c.removeEventListener("mousemove", he), c.removeEventListener("mouseup", de), c.removeEventListener("keydown", Te);
1204
+ const u = d.$el;
1205
+ u.removeEventListener("mousedown", z), u.removeEventListener("mousemove", he), u.removeEventListener("mouseup", de), u.removeEventListener("keydown", Te);
1206
1206
  }
1207
1207
  }
1208
1208
  });
1209
1209
  const E = ce(() => te.value.height || p.value);
1210
1210
  let V;
1211
1211
  async function Y(d) {
1212
- const { dataFormat: c } = l.tableConfig;
1212
+ const { dataFormat: u } = l.tableConfig;
1213
1213
  d[v] != 1 && (d.nextSearchAfter = V), r.value = !0;
1214
1214
  const { code: S, data: T = {} } = await l.api(d).finally(() => {
1215
1215
  r.value = !1, l.searchForm.selections = [];
@@ -1227,15 +1227,15 @@ const Cn = { class: "center" }, xn = {
1227
1227
  Z = T[q];
1228
1228
  break;
1229
1229
  }
1230
- i.value = c ? c(R) : R, h.total = Z, V = T.nextSearchAfter, (l.searchForm.enableCellCopy || o.enableCellCopy) && we(() => {
1230
+ i.value = u ? u(R) : R, h.total = Z, V = T.nextSearchAfter, (l.searchForm.enableCellCopy || o.enableCellCopy) && we(() => {
1231
1231
  setTimeout(() => {
1232
- x();
1232
+ w();
1233
1233
  }, 100);
1234
1234
  });
1235
1235
  }
1236
1236
  }
1237
1237
  function I(d = {}) {
1238
- const { searchData: c = () => ({}) } = l.tableConfig, S = c();
1238
+ const { searchData: u = () => ({}) } = l.tableConfig, S = u();
1239
1239
  Y({
1240
1240
  ...h,
1241
1241
  ...Ue(l.searchForm.items),
@@ -1245,16 +1245,16 @@ const Cn = { class: "center" }, xn = {
1245
1245
  }
1246
1246
  function G() {
1247
1247
  const { reset: d } = l.tableConfig;
1248
- d && d(), l.searchForm.items.forEach((c) => {
1249
- const S = m.find((T) => Xe(c.key) && Xe(T.key) ? c.key.join(",") == T.key.join(",") : T.key == c.key);
1250
- S && (c.value = S.value);
1248
+ d && d(), l.searchForm.items.forEach((u) => {
1249
+ const S = m.find((T) => Xe(u.key) && Xe(T.key) ? u.key.join(",") == T.key.join(",") : T.key == u.key);
1250
+ S && (u.value = S.value);
1251
1251
  }), I();
1252
1252
  }
1253
1253
  l.api && l.immediate && I();
1254
1254
  function _() {
1255
1255
  return { ...h, ...Ue(l.searchForm.items) };
1256
1256
  }
1257
- const w = () => {
1257
+ const C = () => {
1258
1258
  const d = f.value;
1259
1259
  d && d.clearSort();
1260
1260
  }, k = Ie({
@@ -1264,12 +1264,12 @@ const Cn = { class: "center" }, xn = {
1264
1264
  resizable: !0,
1265
1265
  maxFixedSize: 0
1266
1266
  }), te = ce(() => {
1267
- const { customConfig: d, columnConfig: c, ...S } = l.tableConfig;
1267
+ const { customConfig: d, columnConfig: u, ...S } = l.tableConfig;
1268
1268
  return {
1269
1269
  headerAlign: "left",
1270
1270
  align: "center",
1271
1271
  customConfig: { ...k, ...d },
1272
- columnConfig: { ...j, ...c },
1272
+ columnConfig: { ...j, ...u },
1273
1273
  // 列过多时 自动宽度 虚拟滚动会闪屏 关闭虚拟滚动
1274
1274
  "virtual-x-config": {
1275
1275
  enabled: !1,
@@ -1289,10 +1289,10 @@ const Cn = { class: "center" }, xn = {
1289
1289
  selectedCells: []
1290
1290
  // 选中的单元格列表 [{ rowIndex, colIndex }]
1291
1291
  }), ye = (d) => {
1292
- const c = d.closest(".vxe-body--column");
1293
- if (!c || c.classList.contains("col--checkbox") || c.classList.contains("col--seq"))
1292
+ const u = d.closest(".vxe-body--column");
1293
+ if (!u || u.classList.contains("col--checkbox") || u.classList.contains("col--seq"))
1294
1294
  return null;
1295
- const S = c.closest(".vxe-body--row");
1295
+ const S = u.closest(".vxe-body--row");
1296
1296
  if (!S)
1297
1297
  return null;
1298
1298
  const T = f.value;
@@ -1309,9 +1309,9 @@ const Cn = { class: "center" }, xn = {
1309
1309
  if (R < 0)
1310
1310
  return null;
1311
1311
  let q = -1;
1312
- const se = c.getAttribute("data-colid");
1312
+ const se = u.getAttribute("data-colid");
1313
1313
  if (se && (q = T.getColumns().findIndex((F) => F.id === se)), q < 0) {
1314
- const F = Array.from(S.querySelectorAll(".vxe-body--column")).indexOf(c), K = !!c.closest(".vxe-table--fixed-left-wrapper"), J = !!c.closest(".vxe-table--fixed-right-wrapper"), B = T.getColumns();
1314
+ const F = Array.from(S.querySelectorAll(".vxe-body--column")).indexOf(u), K = !!u.closest(".vxe-table--fixed-left-wrapper"), J = !!u.closest(".vxe-table--fixed-right-wrapper"), B = T.getColumns();
1315
1315
  if (K) {
1316
1316
  const X = B.filter((W) => W.fixed === "left");
1317
1317
  F < X.length && (q = B.indexOf(X[F]));
@@ -1323,24 +1323,24 @@ const Cn = { class: "center" }, xn = {
1323
1323
  q = B.filter((oe) => oe.fixed === "left").length + F - X;
1324
1324
  }
1325
1325
  }
1326
- return q < 0 ? null : { rowIndex: R, colIndex: q, cell: c };
1326
+ return q < 0 ? null : { rowIndex: R, colIndex: q, cell: u };
1327
1327
  }, z = (d) => {
1328
- const c = ye(d.target);
1329
- if (!c) {
1328
+ const u = ye(d.target);
1329
+ if (!u) {
1330
1330
  ve();
1331
1331
  return;
1332
1332
  }
1333
1333
  $.isSelecting = !0, $.startCell = {
1334
- rowIndex: c.rowIndex,
1335
- colIndex: c.colIndex
1334
+ rowIndex: u.rowIndex,
1335
+ colIndex: u.colIndex
1336
1336
  }, $.endCell = { ...$.startCell }, Ee(), Ke();
1337
1337
  }, he = (d) => {
1338
1338
  if (!$.isSelecting)
1339
1339
  return;
1340
- const c = ye(d.target);
1341
- c && ($.endCell = {
1342
- rowIndex: c.rowIndex,
1343
- colIndex: c.colIndex
1340
+ const u = ye(d.target);
1341
+ u && ($.endCell = {
1342
+ rowIndex: u.rowIndex,
1343
+ colIndex: u.colIndex
1344
1344
  }, Ee(), Ke());
1345
1345
  }, de = () => {
1346
1346
  $.isSelecting = !1;
@@ -1365,7 +1365,7 @@ const Cn = { class: "center" }, xn = {
1365
1365
  $.selectedCells = [];
1366
1366
  return;
1367
1367
  }
1368
- const d = $.startCell.rowIndex, c = $.endCell.rowIndex, S = $.startCell.colIndex, T = $.endCell.colIndex, R = Math.min(d, c), Z = Math.max(d, c), q = Math.min(S, T), se = Math.max(S, T);
1368
+ const d = $.startCell.rowIndex, u = $.endCell.rowIndex, S = $.startCell.colIndex, T = $.endCell.colIndex, R = Math.min(d, u), Z = Math.max(d, u), q = Math.min(S, T), se = Math.max(S, T);
1369
1369
  $.selectedCells = [];
1370
1370
  for (let A = R; A <= Z; A++)
1371
1371
  for (let F = q; F <= se; F++)
@@ -1378,8 +1378,8 @@ const Cn = { class: "center" }, xn = {
1378
1378
  const d = f.value;
1379
1379
  if (!d)
1380
1380
  return;
1381
- const c = d.$el;
1382
- if (c.querySelectorAll(
1381
+ const u = d.$el;
1382
+ if (u.querySelectorAll(
1383
1383
  ".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left"
1384
1384
  ).forEach((K) => {
1385
1385
  K.classList.remove(
@@ -1392,9 +1392,9 @@ const Cn = { class: "center" }, xn = {
1392
1392
  }), $.selectedCells.length === 0)
1393
1393
  return;
1394
1394
  const S = d.getColumns(), T = $.selectedCells.map((K) => K.rowIndex), R = $.selectedCells.map((K) => K.colIndex), Z = Math.min(...T), q = Math.max(...T), se = Math.min(...R), A = Math.max(...R), F = [
1395
- c.querySelector(".vxe-table--body-wrapper tbody"),
1396
- c.querySelector(".vxe-table--fixed-left-wrapper tbody"),
1397
- c.querySelector(".vxe-table--fixed-right-wrapper tbody")
1395
+ u.querySelector(".vxe-table--body-wrapper tbody"),
1396
+ u.querySelector(".vxe-table--fixed-left-wrapper tbody"),
1397
+ u.querySelector(".vxe-table--fixed-right-wrapper tbody")
1398
1398
  ].filter(Boolean);
1399
1399
  $.selectedCells.forEach(({ rowIndex: K, colIndex: J }) => {
1400
1400
  const B = S[J];
@@ -1430,14 +1430,14 @@ const Cn = { class: "center" }, xn = {
1430
1430
  const d = f.value;
1431
1431
  if (!d)
1432
1432
  return;
1433
- const c = d.$el, S = d.getColumns(), T = [...new Set($.selectedCells.map((A) => A.rowIndex))].sort(
1433
+ const u = d.$el, S = d.getColumns(), T = [...new Set($.selectedCells.map((A) => A.rowIndex))].sort(
1434
1434
  (A, F) => A - F
1435
1435
  ), R = [...new Set($.selectedCells.map((A) => A.colIndex))].sort(
1436
1436
  (A, F) => A - F
1437
1437
  ), Z = [
1438
- c.querySelector(".vxe-table--body-wrapper tbody"),
1439
- c.querySelector(".vxe-table--fixed-left-wrapper tbody"),
1440
- c.querySelector(".vxe-table--fixed-right-wrapper tbody")
1438
+ u.querySelector(".vxe-table--body-wrapper tbody"),
1439
+ u.querySelector(".vxe-table--fixed-left-wrapper tbody"),
1440
+ u.querySelector(".vxe-table--fixed-right-wrapper tbody")
1441
1441
  ].filter(Boolean), q = [];
1442
1442
  T.forEach((A) => {
1443
1443
  const F = [];
@@ -1485,10 +1485,10 @@ const Cn = { class: "center" }, xn = {
1485
1485
  }, He = () => {
1486
1486
  $.isSelecting = !1;
1487
1487
  }, Ne = (d) => {
1488
- const c = f.value;
1489
- if (!c || !c.$el)
1488
+ const u = f.value;
1489
+ if (!u || !u.$el)
1490
1490
  return;
1491
- c.$el.contains(d.target) || ve();
1491
+ u.$el.contains(d.target) || ve();
1492
1492
  }, Ct = (d) => {
1493
1493
  h[v] = d, I();
1494
1494
  }, xt = (d) => {
@@ -1499,14 +1499,14 @@ const Cn = { class: "center" }, xn = {
1499
1499
  l.searchForm.selections = d;
1500
1500
  }
1501
1501
  const Ze = (d) => {
1502
- const c = f.value;
1503
- if (c) {
1504
- c.toggleCheckboxRow(d);
1502
+ const u = f.value;
1503
+ if (u) {
1504
+ u.toggleCheckboxRow(d);
1505
1505
  const S = f.value.getCheckboxRecords();
1506
1506
  l.searchForm.selections = S;
1507
1507
  }
1508
1508
  };
1509
- return t({ tableRef: f, getList: I, getPrm: _, clearSort: w, calculateTableHeight: b }), (d, c) => {
1509
+ return t({ tableRef: f, getList: I, getPrm: _, clearSort: C, calculateTableHeight: b }), (d, u) => {
1510
1510
  var A;
1511
1511
  const S = O("el-button"), T = O("el-checkbox"), R = O("el-text"), Z = O("vxe-column"), q = O("VxeTable"), se = O("el-pagination");
1512
1512
  return L(), ie("div", {
@@ -1516,16 +1516,16 @@ const Cn = { class: "center" }, xn = {
1516
1516
  key: 0,
1517
1517
  form: e.searchForm,
1518
1518
  onReset: G,
1519
- onConfirm: c[1] || (c[1] = (F) => I()),
1519
+ onConfirm: u[1] || (u[1] = (F) => I()),
1520
1520
  onVisibleChange: H(b)
1521
1521
  }, {
1522
1522
  btn: D(() => [
1523
- c[3] || (c[3] = re("span", { class: "mgr10" }, null, -1)),
1523
+ u[3] || (u[3] = re("span", { class: "mgr10" }, null, -1)),
1524
1524
  Q(d.$slots, "search-bar-btn", {}, void 0, !0),
1525
1525
  M(S, {
1526
1526
  class: "mgl10",
1527
1527
  round: "",
1528
- onClick: c[0] || (c[0] = (F) => f.value.openCustom())
1528
+ onClick: u[0] || (u[0] = (F) => f.value.openCustom())
1529
1529
  }, {
1530
1530
  default: D(() => [
1531
1531
  M(yt, { name: "Tools" })
@@ -1538,7 +1538,7 @@ const Cn = { class: "center" }, xn = {
1538
1538
  Q(d.$slots, "table-header-left", {}, void 0, !0),
1539
1539
  re("div", {
1540
1540
  ref_key: "tableContentRef",
1541
- ref: u
1541
+ ref: c
1542
1542
  }, [
1543
1543
  M(q, ue({
1544
1544
  id: y.value,
@@ -1597,7 +1597,7 @@ const Cn = { class: "center" }, xn = {
1597
1597
  e.searchForm.showPage ? (L(), N(se, {
1598
1598
  key: 1,
1599
1599
  "current-page": h[H(v)],
1600
- "onUpdate:currentPage": c[2] || (c[2] = (F) => h[H(v)] = F),
1600
+ "onUpdate:currentPage": u[2] || (u[2] = (F) => h[H(v)] = F),
1601
1601
  class: "myPagination mgt10",
1602
1602
  background: "",
1603
1603
  layout: "total, sizes, prev, pager, next",
@@ -2076,15 +2076,15 @@ function ao(e, t = {}) {
2076
2076
  }, t), { manual: s, log: o, params: l = {}, cb: r, format: i } = a, y = P([]), m = P(!1), v = (g) => {
2077
2077
  const h = g || l;
2078
2078
  m.value = !0, e(h).then((f) => {
2079
- const { code: u, data: p, msg: b } = f;
2079
+ const { code: c, data: p, msg: b } = f;
2080
2080
  if (r) {
2081
- const { records: C, rows: x } = p || {}, E = C || x ? C || x : p;
2081
+ const { records: x, rows: w } = p || {}, E = x || w ? x || w : p;
2082
2082
  y.value = Me(E, i), r(f);
2083
2083
  }
2084
2084
  if (p) {
2085
2085
  if (p.records != null || p.rows != null) {
2086
- const { records: C, rows: x, total: E = 0 } = p || {};
2087
- h && h.total != null && (l.total = parseInt(E)), y.value = Me(C || x || [], i);
2086
+ const { records: x, rows: w, total: E = 0 } = p || {};
2087
+ h && h.total != null && (l.total = parseInt(E)), y.value = Me(x || w || [], i);
2088
2088
  } else
2089
2089
  y.value = Me(p, i);
2090
2090
  o && console.log("useRequest-res", y.value);
@@ -1,2 +1,2 @@
1
- (function(m,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("element-plus"),require("vue"),require("file-saver"),require("exceljs"),require("dayjs"),require("vue-i18n"),require("lodash"),require("vue-router"),require("vuex"),require("vxe-pc-ui")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue","file-saver","exceljs","dayjs","vue-i18n","lodash","vue-router","vuex","vxe-pc-ui"],W):(m=typeof globalThis<"u"?globalThis:m||self,W(m.JoyAdminComponents={},m.ElementPlus,m.Vue,m.fileSaver,m.ExcelJS,m.dayjs,m.VueI18n,m._,m.VueRouter,m.Vuex,m.VxeUI))})(this,function(m,W,e,Le,pe,ue,ee,ne,Fe,te,fe){"use strict";const Qe=e.defineComponent({name:"LayOutForm",setup(t,{slots:o,attrs:n,emit:r}){const s=e.ref(null),l=()=>o.default?o.default().filter(i=>i.type!==Symbol.for("v-cmt")).map(i=>i.type===Symbol.for("v-fgt")?i.children:i).flat().map(i=>{var c;return e.h(W.ElCol,{span:((c=i.props)==null?void 0:c.span)||24},{default:()=>i})}):null;e.onMounted(()=>{r("ref",s.value)});function a(){return e.h(W.ElForm,{...n,ref:s},()=>e.h(W.ElRow,{gutter:n.gutter??20},{default:()=>l()}))}return a}});var ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function De(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Be={exports:{}};(function(t,o){(function(n,r){t.exports=r()})(ve,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(l,a,i){var c=a.prototype;i.utc=function(u){var C={date:u,utc:!0,args:arguments};return new a(C)},c.utc=function(u){var C=i(this.toDate(),{locale:this.$L,utc:!0});return u?C.add(this.utcOffset(),n):C},c.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var b=c.parse;c.parse=function(u){u.utc&&(this.$u=!0),this.$utils().u(u.$offset)||(this.$offset=u.$offset),b.call(this,u)};var p=c.init;c.init=function(){if(this.$u){var u=this.$d;this.$y=u.getUTCFullYear(),this.$M=u.getUTCMonth(),this.$D=u.getUTCDate(),this.$W=u.getUTCDay(),this.$H=u.getUTCHours(),this.$m=u.getUTCMinutes(),this.$s=u.getUTCSeconds(),this.$ms=u.getUTCMilliseconds()}else p.call(this)};var w=c.utcOffset;c.utcOffset=function(u,C){var x=this.$utils().u;if(x(u))return this.$u?0:x(this.$offset)?w.call(this):this.$offset;if(typeof u=="string"&&(u=function(B){B===void 0&&(B="");var P=B.match(r);if(!P)return null;var L=(""+P[0]).match(s)||["-",0,0],Y=L[0],V=60*+L[1]+ +L[2];return V===0?0:Y==="+"?V:-V}(u),u===null))return this;var _=Math.abs(u)<=16?60*u:u;if(_===0)return this.utc(C);var S=this.clone();if(C)return S.$offset=_,S.$u=!1,S;var I=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(S=this.local().add(_+I,n)).$offset=_,S.$x.$localOffset=I,S};var y=c.format;c.format=function(u){var C=u||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return y.call(this,C)},c.valueOf=function(){var u=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*u},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var g=c.toDate;c.toDate=function(u){return u==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var h=c.diff;c.diff=function(u,C,x){if(u&&this.$u===u.$u)return h.call(this,u,C,x);var _=this.local(),S=i(u).local();return h.call(_,S,C,x)}}})})(Be);var et=Be.exports;const tt=De(et);var Me={exports:{}};(function(t,o){(function(n,r){t.exports=r()})(ve,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(s,l,a){var i,c=function(y,g,h){h===void 0&&(h={});var u=new Date(y),C=function(x,_){_===void 0&&(_={});var S=_.timeZoneName||"short",I=x+"|"+S,B=r[I];return B||(B=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:x,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:S}),r[I]=B),B}(g,h);return C.formatToParts(u)},b=function(y,g){for(var h=c(y,g),u=[],C=0;C<h.length;C+=1){var x=h[C],_=x.type,S=x.value,I=n[_];I>=0&&(u[I]=parseInt(S,10))}var B=u[3],P=B===24?0:B,L=u[0]+"-"+u[1]+"-"+u[2]+" "+P+":"+u[4]+":"+u[5]+":000",Y=+y;return(a.utc(L).valueOf()-(Y-=Y%1e3))/6e4},p=l.prototype;p.tz=function(y,g){y===void 0&&(y=i);var h,u=this.utcOffset(),C=this.toDate(),x=C.toLocaleString("en-US",{timeZone:y}),_=Math.round((C-new Date(x))/1e3/60),S=15*-Math.round(C.getTimezoneOffset()/15)-_;if(!Number(S))h=this.utcOffset(0,g);else if(h=a(x,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(S,!0),g){var I=h.utcOffset();h=h.add(u-I,"minute")}return h.$x.$timezone=y,h},p.offsetName=function(y){var g=this.$x.$timezone||a.tz.guess(),h=c(this.valueOf(),g,{timeZoneName:y}).find(function(u){return u.type.toLowerCase()==="timezonename"});return h&&h.value};var w=p.startOf;p.startOf=function(y,g){if(!this.$x||!this.$x.$timezone)return w.call(this,y,g);var h=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return w.call(h,y,g).tz(this.$x.$timezone,!0)},a.tz=function(y,g,h){var u=h&&g,C=h||g||i,x=b(+a(),C);if(typeof y!="string")return a(y).tz(C);var _=function(P,L,Y){var V=P-60*L*1e3,k=b(V,Y);if(L===k)return[V,L];var $=b(V-=60*(k-L)*1e3,Y);return k===$?[V,k]:[P-60*Math.min(k,$)*1e3,Math.max(k,$)]}(a.utc(y,u).valueOf(),x,C),S=_[0],I=_[1],B=a(S).utcOffset(I);return B.$x.$timezone=C,B},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(y){i=y}}})})(Me);var ot=Me.exports;const nt=De(ot),ye={"dao-ru":"导入","quan-xuan":"全选","xia-zai-dao-ru-mo-ban":"下载导入模板","xu-hao":"序号","qing-shu-ru":"请输入","qing-xuan-ze":"请选择","kai-shi-shi-jian":"开始时间","jie-shu-shi-jian":"结束时间","shai-xuan":"筛选","chong-zhi":"重置","guan-bi":"关闭","zhan-kai":"展开","qu-xiao":"取消","ti-jiao":"提交","que-ding":"确定","que-ding-guan-bi-ma":"确定关闭吗","xia-zai-dao-ru-mo-ban":"下载导入模板",excel:{fieldsMappingRequired:"请输入列字段映射",invalidInput:"非法输入",invalidOption:"请输入有效选项!",copyFailed:"复制失败",sheetNameTooLong:'Sheet名称 "{0}" 长度超过31个字符,已自动截断为 "{1}"'},validate:{invalidInput:"请输入正确内容"},tools:{keysLengthError:"keys 长度必须大于2 默认前两位为 label value"}},Ce={"dao-ru":"Import","quan-xuan":"Select All","xia-zai-dao-ru-mo-ban":"Download Import Template","xu-hao":"No.","qing-shu-ru":"Please enter","qing-xuan-ze":"Please select","kai-shi-shi-jian":"Start Time","jie-shu-shi-jian":"End Time","shai-xuan":"Filter","chong-zhi":"Reset","guan-bi":"Collapse","zhan-kai":"Expand","qu-xiao":"Cancel","ti-jiao":"Submit","que-ding":"Confirm","que-ding-guan-bi-ma":"Are you sure to close?","xia-zai-dao-ru-mo-ban":"Download Import Template",excel:{fieldsMappingRequired:"Please enter column field mapping",invalidInput:"Invalid input",invalidOption:"Please enter a valid option!",copyFailed:"Copy failed",sheetNameTooLong:'Sheet name "{0}" exceeds 31 characters, automatically truncated to "{1}"'},validate:{invalidInput:"Please enter valid content"},tools:{keysLengthError:"Keys length must be greater than 2, default first two are label and value"}},ze={zh_cn:ye,en_us:Ce};let ie=null;function Oe(t=null){if(t){const{global:o}=t;return o.messages.value.zh_cn?o.mergeLocaleMessage("zh_cn",ye):o.setLocaleMessage("zh_cn",ye),o.messages.value.en_us?o.mergeLocaleMessage("en_us",Ce):o.setLocaleMessage("en_us",Ce),ie=t,t}return ie||(ie=ee.createI18n({legacy:!1,locale:"zh_cn",fallbackLocale:"zh_cn",messages:ze})),ie}function be(){return ie||Oe()}function le(){return be().global.t}ue.extend(tt),ue.extend(nt);async function lt(t,o){const{fields:n,range:r=1}=o;if(!n){const a=le();throw new Error(a("excel.fieldsMappingRequired"))}let s=new pe.Workbook;await s.xlsx.load(t);const l={};return s.eachSheet(function(a,i){const c=[];a.eachRow(function(b,p){if(p>r){let w={},y=!0;Object.keys(n).forEach(g=>{const h=b.getCell(n[g]).value;w[g]=h,h&&(y=!1)}),y||c.push(w)}}),l[a._name]=c}),s=null,l}const Ne={columnWidth:30};async function at(t,o,n=[],r={}){if(!t||!o)return;const{columnStyle:s}=r,{columnWidth:l}=Ne;o.forEach(c=>{c.width=c.width?c.width:l});const{workbook:a,worksheet:i}=rt();i.columns=o,i.addRows(n),s&&await st(a,i,s);try{const c=await a.xlsx.writeBuffer(),b=new File([c],t,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Le.saveAs(b)}catch(c){console.log(c)}}function rt(){const t=new pe.Workbook;t.creator="distributor System",t.lastModifiedBy="distributor System",t.created=new Date,t.modified=new Date,t.lastPrinted=new Date;const o=t.addWorksheet("Sheet1");return{workbook:t,worksheet:o}}async function st(t,o,n){const r=Object.keys(n);for(const s of r){const l=n[s],{type:a}=l;switch(a){case"IMG":await it(t,o,s);break}}}async function it(t,o,n,r){const s=o.getColumn(n),l=s.values;o.getColumn(n).width=20,o.eachRow((a,i)=>{i>1&&(a.height=40)});for(let a=0,i=l.length;a<i;a++){if(a<2)continue;let c=l[a];c&&(o.getCell(s.letter+a).value="",await ct(t,o,c,{width:100,height:50,col:s._number-1,row:a-1}))}}async function ct(t,o,n,r){const{col:s,row:l,width:a,height:i}=r,{success:c,base64:b}=await dt(n,.3);if(c){const p=t.addImage({base64:b,extension:"jpeg"});o.addImage(p,{tl:{col:s,row:l},ext:{width:a,height:i}})}}function dt(t,o=1){const n=new Image;return n.setAttribute("crossOrigin","anonymous"),n.crossOrigin="anonymous",n.src=t,new Promise((r,s)=>{n.onload=()=>{const l=document.createElement("canvas");l.width=n.width,l.height=n.height,l.getContext("2d").drawImage(n,0,0,l.width,l.height),r({success:!0,base64:l.toDataURL("image/jpeg",o)})},n.onerror=()=>{r({success:!1})}})}const ke="---";async function qe(t,o){const{fields:n,range:r=1}=o;if(!n){const a=le();throw new Error(a("excel.fieldsMappingRequired"))}let s=new pe.Workbook;await s.xlsx.load(t);const l={};return s.eachSheet(function(a,i){if(a.state=="visible"){const c=[],b=n[a._name];if(b){let p=Object.values(b).some(y=>y.includes("image")),w={};p&&(a.getImages().forEach(g=>{const{tl:h}=g.range,u=s.model.media.find(C=>C.index===g.imageId);if(u){const C=u.buffer.toString("base64"),x=`data:image/${u.extension};base64,${C}`,_=`${Math.ceil(h.row)}_${Math.ceil(h.col)}`;w[_]?w[_].push(x):w[_]=[x]}}),console.log("withImages-imageMap",w)),a.eachRow(function(y,g){if(g>r){let h={},u=!0;Object.keys(b).forEach(C=>{var B;let[x,_]=b[C].split(ke);const S=y.getCell(x);let I;if(_=="image"&&p){const P=S._column._number,L=`${g}_${P}`;I=w[L]||""}else S.result!=null?I=S.result:(B=S.value)!=null&&B.richText?I=S.value.richText.reduce((P,L)=>P+L.text,""):S.type==4&&S.value?I=ue(S.value).utc().format("YYYY-MM-DD HH:mm:ss"):I=S.value;I&&_=="option"&&(I=I.split(ke)[1]),h[C]=I,I&&(u=!1)}),u||c.push(h)}}),l[a._name]=c}}}),s=null,l}const ut={date:"yyyy-mm-dd",number:"0",string:"@"};async function Ae(t,o){if(!t||o.length==0)return;const n=ft(o);n.eachSheet(function(r,s){const{columnWidth:l}=Ne,{tableHeader:a,tableData:i}=o[r._name];a.forEach(c=>{const{style:b={},required:p}=c,{font:w={}}=b;c.style={...b,font:{...w,color:{argb:p?"FFFF0000":void 0}}}}),r.columns=a,r.addRows(i),a.forEach(c=>{const{header:b,key:p,width:w,option:y,numFmt:g}=c,h=r.getColumn(p);if(h.numFmt=ut[g]||g,h.width=w||l,y){const u=n.addWorksheet(p);u.state="hidden",u.getColumn(1).values=y.map(C=>`${C.label}${ke}${C.value}`),Array(100).fill("").forEach((C,x)=>{if(x>0){const _=le();r.getCell(`${h.letter}${x}`).dataValidation={type:"list",formulae:[`${p}!$A$1:$A$${y.length}`],showErrorMessage:!0,error:_("excel.invalidInput"),errorStyle:"stop",errorMessage:_("excel.invalidOption")}}})}})});try{const r=await n.xlsx.writeBuffer(),s=new File([r],t,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Le.saveAs(s)}catch(r){console.log(r)}}function ft(t){const o=le(),n=new pe.Workbook;return n.creator="distributor System",n.lastModifiedBy="distributor System",n.created=new Date,n.modified=new Date,n.lastPrinted=new Date,Object.keys(t).sort((s,l)=>{const a=t[s].sort??0,i=t[l].sort??0;return a-i}).forEach(s=>{let l=s,a=!1;/[\\/:*?\[\]]/g.test(s)&&(s=s.replace(/[\\/:*?\[\]]/g,""),a=!0),s.length>31&&(s=s.substring(0,31).trim(),a=!0,console.warn(o("excel.sheetNameTooLong",[l,s]))),a&&(t[s]=t[l],delete t[l]),n.addWorksheet(s)}),n}function ht(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 mt(t){return new Promise(o=>{setTimeout(()=>{o()},t)})}function gt(t){return JSON.parse(JSON.stringify(t))}function pt(t){let o=[],n={},r=(s,l)=>Object.prototype.hasOwnProperty.call(s,l);for(const s of t){n[s.id]={...s,children:r(n,s.id)?n[s.id].children:[]};const l=n[s.id];s.pid==-1?o.push(l):(r(n,s.pid)||(n[s.pid]={children:[]}),n[s.pid].children.push(l))}return o}function _e(t,o=" "){return t?t.split(o).filter(n=>n.trim()):[]}class Se{constructor(o,n=["label","value","labelEn"]){this.list=o.map(r=>({...r,label:r[n[0]],labelEn:r[n[2]]??r[n[0]]??"",value:r[n[1]]})),this.map=new Map(this.list.map(r=>[r[n[1]],r]))}getName(o){if(!this.has(o))return"-";const n=be().global.locale,{label:r,labelEn:s}=this.map.get(o);return(n.value=="zh_cn"?r:s)??r??"-"}getTag(o){if(!this.has(o))return"info";const{tag:n="info"}=this.map.get(o);return n}getItem(o){return this.has(o)?this.map.get(o):null}getColor(o){if(!this.has(o))return null;const{color:n}=this.map.get(o);return n}has(o){return this.map.has(o)}}function yt(t,o=[],n="i18nName"){if(t.length==0)return new Se([]);if(o.length<2){const s=le();throw new Error(s("tools.keysLengthError"))}let r=t.map(s=>{let l={};return n&&(l.labelEn=s[n]),o.forEach((a,i)=>{i===0?l.label=s[a]:i===1?l.value=s[a]:l[a]=s[a]}),l});return new Se(r)}function Ct(t){return t?t.replace(/<[^>]+>/g,""):""}function bt(t){return t?(t.includes("\\\\u")&&(t=t.replace(/\\/g,"")),t.replace(/\\u[\dA-F]{4}/gi,o=>String.fromCharCode(parseInt(o.replace(/\\u/g,""),16)))):""}function wt(t,o=10){let n=1048576*o;return!(t.size>n)}function xt(t){return Array.from(10).fill(0).map((n,r)=>t+"_"+r)}function kt(t){let o={};return t.map((n,r)=>{let{key:s,option:l,type:a}=n,i=ht(r);l?o[s]=`${i}---option`:a==="image"?o[s]=`${i}---image`:o[s]=i}),o}function _t(t,o){return o.split(".").reduce((n,r)=>n&&n[r],t)}const ao="",he=(t,o)=>{const n=t.__vccOpts||t;for(const[r,s]of o)n[r]=s;return n},St=["onClick"],Pe=he({__name:"index",props:e.mergeModels({api:{type:Function},showCheckAll:{type:Boolean,default:!0},maxLimit:{type:Number,default:void 0},optionClick:{type:Function,default:()=>{}},data:{type:Array},labelValue:{type:Object,default:()=>({label:"label",labelEn:"labelEn",value:"value"})},changeLocal:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["success","change","changeAll"],["update:modelValue"]),setup(t,{emit:o}){const n=t,r=e.useAttrs(),{t:s,locale:l}=ee.useI18n(),a=e.useModel(t,"modelValue"),i=e.computed(()=>r["value-key"]!=null),c=e.ref(""),b=e.computed(()=>{if(r.remote!==void 0)return n.data;const k=_e(c.value),{data:$,labelValue:O}=n,Z=$||y.value;if(k.length==0)return Z;const{label:E,labelEn:ce}=O;let D=l.value=="en_us"?ce||"i18nName":E;return k.length==1?Z.filter(oe=>oe[D].toLowerCase().includes(k[0].toLowerCase())):Z.filter(oe=>{let de=!1;return de=k.some(xe=>oe[D].toLowerCase()==xe.toLowerCase()),de})}),p=e.computed({get(){return r.multiple==null||a.value==null?!1:a.value.length==b.value.length},set(k){return k}}),w=o,y=e.ref([]),g=async()=>{const{data:k}=await n.api();y.value=[...k],w("success",y)};n.api&&g();function h(k){w("change",k),u.value&&e.nextTick(()=>{n.optionClick&&n.optionClick(u.value),u.value=null})}const u=e.ref(null);function C(k){u.value=k}const x=n.labelValue.label.split("-"),_=k=>{if(x.length==1){if(n.changeLocal)return s(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 x.forEach(O=>{$.push(k[O])}),$.join("-")}};function S(k){let $=n.data?n.data:y.value;a.value=k?$.map(O=>i.value?O:O[n.labelValue.value]):[],e.nextTick(()=>{w("change",a.value),w("changeAll",a.value,$)})}function I(k){w("change",i.value?k:k[n.labelValue.value]),e.nextTick(()=>{n.optionClick&&n.optionClick(k)})}function B(k){return a.value.length>=n.maxLimit&&!a.value.includes(k[n.labelValue.value])}function P(k){return k.map($=>({...$,label:_($),value:i.value?$:$[n.labelValue.value]}))}const L=e.ref([]),Y=n.data?n.data:y.value;L.value=P(Y),e.watch(()=>n.data?n.data:y.value,k=>{var O;const $=P(k);if($.length!==L.value.length)L.value=$;else{let Z=!1;for(let E=0;E<$.length;E++)if($[E].value!==((O=L.value[E])==null?void 0:O.value)){Z=!0;break}Z&&(L.value=$)}},{deep:!0});const V=e.computed(()=>L.value);return(k,$)=>{const O=e.resolveComponent("el-checkbox"),Z=e.resolveComponent("el-select-v2"),E=e.resolveComponent("el-option"),ce=e.resolveComponent("el-select");return e.unref(r).v2!=null?(e.openBlock(),e.createBlock(Z,e.mergeProps({key:0,options:V.value,modelValue:a.value,"onUpdate:modelValue":$[1]||($[1]=D=>a.value=D)},e.unref(r),{filterable:"","collapse-tags":"","collapse-tags-tooltip":"",clearable:"",onChange:h,onClear:h}),e.createSlots({default:e.withCtx(({item:D})=>[e.createElementVNode("div",{onClick:ae=>C(D)},e.toDisplayString(D.label),9,St)]),_:2},[e.unref(r).multiple!=null?{name:"header",fn:e.withCtx(()=>[e.renderSlot(k.$slots,"header",{},()=>[e.createVNode(O,{class:"mgl20",modelValue:p.value,"onUpdate:modelValue":$[0]||($[0]=D=>p.value=D),onChange:S},{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(ce,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:t.optionClick}),{default:e.withCtx(()=>[e.unref(r).multiple!=null&&t.showCheckAll&&t.maxLimit==null?e.renderSlot(k.$slots,"header",{key:0},()=>[e.createVNode(O,{class:"mgl20",modelValue:p.value,"onUpdate:modelValue":$[2]||($[2]=D=>p.value=D),onChange:S},{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(b.value,(D,ae)=>(e.openBlock(),e.createBlock(E,{key:ae,label:_(D),disabled:e.unref(r).multiple!=null&&t.maxLimit>0?B(D):!1,onClick:e.withModifiers(oe=>I(D),["stop"]),value:i.value?D:D[t.labelValue.value]},null,8,["label","disabled","onClick","value"]))),128))]),_:3},16,["modelValue","filter-method","onClear"]))}}},[["__scopeId","data-v-51bd1467"]]),so="",$t=e.defineComponent({props:{name:{tyepe:String,required:!0}}});function Vt(t,o,n,r,s,l){const a=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(a,{class:"cmp-icon"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.name)))]),_:1})}const $e=he($t,[["render",Vt],["__scopeId","data-v-733f9daa"]]),Et={__name:"index",emits:["ok","no"],setup(t,{emit:o}){const n=o,r=ne.debounce(()=>{n("ok")},500);function s(){n("no")}return(l,a)=>{const i=e.resolveComponent("el-popconfirm");return e.openBlock(),e.createElementBlock("span",null,[e.createVNode(i,e.mergeProps(l.$attrs,{onConfirm:e.unref(r),onCancel:s}),{reference:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16,["onConfirm"])])}}},io="",Tt=["accept"],It=he({__name:"index",props:{accept:{type:String,default:".xlsx,.xls"},fields:{type:Object,default:()=>({})},fileChange:{type:Function,required:!0}},emits:["fileChange"],setup(t,{emit:o}){const n=t,r=e.ref(null),s=e.ref(!1);async function l(a){s.value=!0;let i=a.target.files[0];const c=await qe(i,n.fields).catch(()=>{s.value=!1}).finally(()=>{r.value.value=null});await n.fileChange(c).finally(()=>{s.value=!1})}return(a,i)=>{const c=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("span",null,[e.createVNode(c,e.mergeProps({type:"primary",loading:s.value,class:"mgr10",onClick:i[0]||(i[0]=b=>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,Tt)])}}},[["__scopeId","data-v-f5e86876"]]);function Ve(t){let o={};return t.forEach(n=>{const{key:r,type:s,option:l={},value:a,dateType:i="date"}=n;if(r)if(s=="input"&&(l!=null&&l.multiple))o[r]=_e(a);else if(s=="date")if(i.includes("range")){const[c,b]=r;let[p,w]=a||[];p&&i=="daterange"&&(p=ue(p).format("YYYY-MM-DD 00:00:00"),w=ue(w).format("YYYY-MM-DD 23:59:59")),o[c]=p,o[b]=w}else o[r]=a;else o[r]=a}),o}const uo="",Lt={key:0},Ft={class:"btns"},vt={class:"left"},Dt={class:"right"},je=he({__name:"index",props:{form:{type:Object,required:!0}},emits:["confirm","reset","visibleChange"],setup(t,{expose:o,emit:n}){const r=t,s=n,l=e.ref(!0),a=e.ref(null),{t:i}=ee.useI18n(),c={datetimerange:"YYYY-MM-DD HH:mm:ss",daterange:"YYYY-MM-DD",month:"YYYY-MM"},b=e.computed(()=>l.value?i("guan-bi"):i("zhan-kai"));function p(){s("confirm")}function w(x){x.option.onClear&&x.option.onClear(),s("confirm")}function y(){s("reset")}function g(){s("confirm")}function h(){return Ve(r.form.items)}const u=ne.cloneDeep(r.form.items);function C(){r.form.items.forEach(x=>{const _=u.find(S=>S.key==x.key);_&&(x.value=_.value)})}return o({getPrm:h,reset:C}),(x,_)=>{const S=e.resolveComponent("el-input"),I=e.resolveComponent("el-date-picker"),B=e.resolveComponent("el-form-item"),P=e.resolveComponent("el-form"),L=e.resolveComponent("el-link"),Y=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",{class:"searchBar-container mgt10 mgb10",onKeydown:e.withKeys(p,["enter"])},[e.createElementVNode("div",{class:"searchBar",style:e.normalizeStyle({height:l.value?"auto":"42px"})},[e.createVNode(P,{inline:"",model:t.form.data},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.form.items.filter(V=>!V.hidden),V=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:V.key},[V.type=="br"?(e.openBlock(),e.createElementBlock("br",Lt)):(e.openBlock(),e.createBlock(B,{key:1,label:V.name},{default:e.withCtx(()=>{var k,$;return[V.type==="input"?(e.openBlock(),e.createBlock(S,{key:0,modelValue:V.value,"onUpdate:modelValue":O=>V.value=O,class:e.normalizeClass(((k=V.option)==null?void 0:k.class)||"w150"),placeholder:x.$t("qing-shu-ru"),clearable:""},null,8,["modelValue","onUpdate:modelValue","class","placeholder"])):V.type==="custom"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(V.render),{key:1})):e.createCommentVNode("",!0),V.type==="select"?(e.openBlock(),e.createBlock(Pe,e.mergeProps({key:2,class:(($=V.option)==null?void 0:$.class)||"w150",modelValue:V.value,"onUpdate:modelValue":O=>V.value=O},{ref_for:!0},V.option,{onChange:p,onClear:O=>w(V)}),null,16,["class","modelValue","onUpdate:modelValue","onClear"])):e.createCommentVNode("",!0),V.type==="date"?(e.openBlock(),e.createBlock(I,e.mergeProps({key:3,class:{datetimerange:"w300",daterange:"w200"}[V.dateType]||"w100",modelValue:V.value,"onUpdate:modelValue":O=>V.value=O,"value-format":c[V.dateType]||"YYYY-MM-DD",type:V.dateType||"date",onFocus:O=>a.value=V,onChange:O=>g(),placeholder:x.$t("qing-xuan-ze"),"start-placeholder":x.$t("kai-shi-shi-jian"),"end-placeholder":x.$t("jie-shu-shi-jian")},{ref_for:!0},V.option),null,16,["class","modelValue","onUpdate:modelValue","value-format","type","onFocus","onChange","placeholder","start-placeholder","end-placeholder"])):e.createCommentVNode("",!0)]}),_:2},1032,["label"]))],64))),128))]),_:1},8,["model"])],4),e.createElementVNode("div",Ft,[e.createElementVNode("div",vt,[e.renderSlot(x.$slots,"table-header-left",{},void 0,!0)]),e.createElementVNode("div",Dt,[e.createVNode(L,{underline:"never",class:"mgr10",onClick:_[0]||(_[0]=()=>{s("visibleChange",!l.value),l.value=!l.value})},{default:e.withCtx(()=>[e.createVNode($e,{name:l.value?"ArrowUp":"ArrowDown"},null,8,["name"]),e.createTextVNode(" "+e.toDisplayString(b.value),1)]),_:1}),e.createVNode(Y,{type:"primary",onClick:p},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.$t("shai-xuan")),1)]),_:1}),e.createVNode(Y,{type:"primary",onClick:y},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.$t("chong-zhi")),1)]),_:1}),e.renderSlot(x.$slots,"btn",{},void 0,!0)])])],32)}}},[["__scopeId","data-v-6c7679eb"]]),Re={pageNoKey:"pageNo",pageSizeKey:"pageSize",totalKey:"total",defaultPageSize:10,pageSizes:[10,50,100,500],responseDataKeys:{rows:["rows","records","list"],total:["totalRows","total"]},showSearch:!1,showPage:!1,showShadow:!1,showCheckBox:!1,enableCellCopy:!0};let me={...Re};function Bt(t){me={...me,...t,responseDataKeys:{...me.responseDataKeys,...t.responseDataKeys||{}}}}function Ue(){return me}function Mt(){me={...Re}}const ho="",zt={class:"center"},Ot=he({__name:"index",props:{id:{type:String,required:!1},loading:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0},searchForm:{type:Object,default:()=>({items:[],selections:[]})},api:{type:Function},data:{type:Array},tableConfig:{type:Object,default:()=>({})}},setup(t,{expose:o}){const{t:n,locale:r}=ee.useI18n(),s=Fe.useRoute(),l=Ue(),a=t,i=e.ref(!1),c=e.ref([]);a.searchForm.showSearch===void 0&&(a.searchForm.showSearch=l.showSearch),a.searchForm.showPage===void 0&&(a.searchForm.showPage=l.showPage),a.searchForm.showShadow===void 0&&(a.searchForm.showShadow=l.showShadow),a.searchForm.showCheckBox===void 0&&(a.searchForm.showCheckBox=l.showCheckBox),a.searchForm.enableCellCopy===void 0&&(a.searchForm.enableCellCopy=l.enableCellCopy),a.searchForm.selections||(a.searchForm.selections=[]);const b=e.computed(()=>{const f=s.path.replace(/\//g,"-").replace(/^-/,"")||"default-table";return a.id?`listPageId-${f}-${a.id}`:`listPageId-${f}`}),p=ne.cloneDeep(a.searchForm.items),w=a.searchForm.pageNoKey||l.pageNoKey,y=a.searchForm.pageSizeKey||l.pageSizeKey,g=e.reactive({[w]:1,[y]:a.searchForm.defaultPageSize||l.defaultPageSize,total:0}),h=e.ref(null),u=e.ref(null),C=e.ref(450),x=ne.debounce(()=>{e.nextTick(()=>{if(!u.value)return;const d=u.value.getBoundingClientRect(),T=window.innerHeight,v=d.top,q=100,U=T-v-q,M=200;C.value=Math.max(U,M)})},100),_=()=>{x()},S=()=>{if(!a.searchForm.enableCellCopy&&!l.enableCellCopy)return!1;const f=h.value;if(!f||!f.$el)return!1;const d=f.$el;return d.classList.add("cell-copy-enabled"),d.setAttribute("tabindex","-1"),d.removeEventListener("mousedown",D),d.removeEventListener("mousemove",ae),d.removeEventListener("mouseup",oe),d.removeEventListener("keydown",Te),d.addEventListener("mousedown",D),d.addEventListener("mousemove",ae),d.addEventListener("mouseup",oe),d.addEventListener("keydown",Te),!0};e.onMounted(()=>{x(),window.addEventListener("resize",_),(a.searchForm.enableCellCopy||l.enableCellCopy)&&(document.addEventListener("mouseup",Ze),document.addEventListener("mousedown",Ge),setTimeout(()=>{S()},500))}),e.onUpdated(()=>{(a.searchForm.enableCellCopy||l.enableCellCopy)&&setTimeout(()=>{S()},500)}),e.onUnmounted(()=>{if(window.removeEventListener("resize",_),a.searchForm.enableCellCopy||l.enableCellCopy){document.removeEventListener("mouseup",Ze),document.removeEventListener("mousedown",Ge);const f=h.value;if(f&&f.$el){const d=f.$el;d.removeEventListener("mousedown",D),d.removeEventListener("mousemove",ae),d.removeEventListener("mouseup",oe),d.removeEventListener("keydown",Te)}}});const I=e.computed(()=>Z.value.height||C.value);let B;async function P(f){const{dataFormat:d}=a.tableConfig;f[w]!=1&&(f.nextSearchAfter=B),i.value=!0;const{code:T,data:v={}}=await a.api(f).finally(()=>{i.value=!1,a.searchForm.selections=[]});if(T==200){let q=[];for(const M of l.responseDataKeys.rows)if(v[M]){q=v[M];break}let U=0;for(const M of l.responseDataKeys.total)if(v[M]!==void 0){U=v[M];break}c.value=d?d(q):q,g.total=U,B=v.nextSearchAfter,(a.searchForm.enableCellCopy||l.enableCellCopy)&&e.nextTick(()=>{setTimeout(()=>{S()},100)})}}function L(f={}){const{searchData:d=()=>({})}=a.tableConfig,T=d();P({...g,...Ve(a.searchForm.items),...f,...T})}function Y(){const{reset:f}=a.tableConfig;f&&f(),a.searchForm.items.forEach(d=>{const T=p.find(v=>ne.isArray(d.key)&&ne.isArray(v.key)?d.key.join(",")==v.key.join(","):v.key==d.key);T&&(d.value=T.value)}),L()}a.api&&a.immediate&&L();function V(){return{...g,...Ve(a.searchForm.items)}}const k=()=>{const f=h.value;f&&f.clearSort()},$=e.reactive({storage:!0}),O=e.reactive({drag:!0,resizable:!0,maxFixedSize:0}),Z=e.computed(()=>{const{customConfig:f,columnConfig:d,...T}=a.tableConfig;return{headerAlign:"left",align:"center",customConfig:{...$,...f},columnConfig:{...O,...d},"virtual-x-config":{enabled:!1,scrollToLeftOnChange:!1},"virtual-y-config":{enabled:!0,gt:100},...T}}),E=e.reactive({isSelecting:!1,startCell:null,endCell:null,selectedCells:[]}),ce=f=>{const d=f.closest(".vxe-body--column");if(!d||d.classList.contains("col--checkbox")||d.classList.contains("col--seq"))return null;const T=d.closest(".vxe-body--row");if(!T)return null;const v=h.value;if(!v)return null;let q=-1;const U=T.getAttribute("data-rowid");if(U!=null)q=parseInt(U,10);else{const z=T.parentElement;q=Array.from(z.querySelectorAll(".vxe-body--row")).indexOf(T)}if(q<0)return null;let M=-1;const Q=d.getAttribute("data-colid");if(Q&&(M=v.getColumns().findIndex(F=>F.id===Q)),M<0){const F=Array.from(T.querySelectorAll(".vxe-body--column")).indexOf(d),j=!!d.closest(".vxe-table--fixed-left-wrapper"),H=!!d.closest(".vxe-table--fixed-right-wrapper"),A=v.getColumns();if(j){const K=A.filter(R=>R.fixed==="left");F<K.length&&(M=A.indexOf(K[F]))}else if(H){const K=A.filter(R=>R.fixed==="right");F<K.length&&(M=A.indexOf(K[F]))}else{const K=a.searchForm.showCheckBox?1:0;M=A.filter(G=>G.fixed==="left").length+F-K}}return M<0?null:{rowIndex:q,colIndex:M,cell:d}},D=f=>{const d=ce(f.target);if(!d){de();return}E.isSelecting=!0,E.startCell={rowIndex:d.rowIndex,colIndex:d.colIndex},E.endCell={...E.startCell},xe(),We()},ae=f=>{if(!E.isSelecting)return;const d=ce(f.target);d&&(E.endCell={rowIndex:d.rowIndex,colIndex:d.colIndex},xe(),We())},oe=()=>{E.isSelecting=!1},de=()=>{E.selectedCells=[],E.startCell=null,E.endCell=null;const f=h.value;if(!f)return;f.$el.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(T=>{T.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")})},xe=()=>{if(!E.startCell||!E.endCell){E.selectedCells=[];return}const f=E.startCell.rowIndex,d=E.endCell.rowIndex,T=E.startCell.colIndex,v=E.endCell.colIndex,q=Math.min(f,d),U=Math.max(f,d),M=Math.min(T,v),Q=Math.max(T,v);E.selectedCells=[];for(let z=q;z<=U;z++)for(let F=M;F<=Q;F++)E.selectedCells.push({rowIndex:z,colIndex:F})},We=()=>{e.nextTick(()=>{const f=h.value;if(!f)return;const d=f.$el;if(d.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(j=>{j.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")}),E.selectedCells.length===0)return;const T=f.getColumns(),v=E.selectedCells.map(j=>j.rowIndex),q=E.selectedCells.map(j=>j.colIndex),U=Math.min(...v),M=Math.max(...v),Q=Math.min(...q),z=Math.max(...q),F=[d.querySelector(".vxe-table--body-wrapper tbody"),d.querySelector(".vxe-table--fixed-left-wrapper tbody"),d.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean);E.selectedCells.forEach(({rowIndex:j,colIndex:H})=>{const A=T[H];if(!A)return;const K=A.fixed==="left",R=A.fixed==="right";for(const G of F){const ge=G.querySelectorAll(".vxe-body--row")[j];if(!ge)continue;const re=Array.from(ge.querySelectorAll(".vxe-body--column"));let N=null;if(K&&G.closest(".vxe-table--fixed-left-wrapper")){const J=T.filter(X=>X.fixed==="left").indexOf(A);N=re[J]}else if(R&&G.closest(".vxe-table--fixed-right-wrapper")){const J=T.filter(X=>X.fixed==="right").indexOf(A);N=re[J]}else if(!K&&!R&&G.closest(".vxe-table--body-wrapper")){const se=a.searchForm.showCheckBox?1:0,J=T.filter(Ie=>Ie.fixed==="left").length,X=H-J;N=re[X+se]}if(N&&!N.classList.contains("col--checkbox")&&!N.classList.contains("col--seq")){N.classList.add("cell-selected"),j===U&&N.classList.add("cell-border-top"),j===M&&N.classList.add("cell-border-bottom"),H===Q&&N.classList.add("cell-border-left"),H===z&&N.classList.add("cell-border-right");break}}})})},to=async()=>{if(E.selectedCells.length===0)return;const f=h.value;if(!f)return;const d=f.$el,T=f.getColumns(),v=[...new Set(E.selectedCells.map(z=>z.rowIndex))].sort((z,F)=>z-F),q=[...new Set(E.selectedCells.map(z=>z.colIndex))].sort((z,F)=>z-F),U=[d.querySelector(".vxe-table--body-wrapper tbody"),d.querySelector(".vxe-table--fixed-left-wrapper tbody"),d.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean),M=[];v.forEach(z=>{const F=[];q.forEach(j=>{const H=T[j];if(!H){F.push("");return}const A=H.fixed==="left",K=H.fixed==="right";let R="";for(const G of U){const ge=G.querySelectorAll(".vxe-body--row")[z];if(!ge)continue;const re=Array.from(ge.querySelectorAll(".vxe-body--column"));let N=null;if(A&&G.closest(".vxe-table--fixed-left-wrapper")){const J=T.filter(X=>X.fixed==="left").indexOf(H);N=re[J]}else if(K&&G.closest(".vxe-table--fixed-right-wrapper")){const J=T.filter(X=>X.fixed==="right").indexOf(H);N=re[J]}else if(!A&&!K&&G.closest(".vxe-table--body-wrapper")){const se=a.searchForm.showCheckBox?1:0,J=T.filter(Ie=>Ie.fixed==="left").length,X=j-J;N=re[X+se]}if(N&&!N.classList.contains("col--checkbox")&&!N.classList.contains("col--seq")){R=N.innerText||N.textContent||"",R=R.trim(),R=R.replace(/\n/g," ").replace(/\s+/g," ");break}}F.push(R)}),M.push(F.join(" "))});const Q=M.join(`
2
- `);try{await navigator.clipboard.writeText(Q)}catch(z){console.error("复制失败:",z)}},Te=f=>{!a.searchForm.enableCellCopy&&!l.enableCellCopy||((f.ctrlKey||f.metaKey)&&f.key==="c"?E.selectedCells.length>0&&(f.preventDefault(),f.stopPropagation(),to()):f.key==="Escape"&&de())},Ze=()=>{E.isSelecting=!1},Ge=f=>{const d=h.value;if(!d||!d.$el)return;d.$el.contains(f.target)||de()},oo=f=>{g[w]=f,L()},no=f=>{g[y]=f,g[w]=1,L()};function Je(){const f=h.value.getCheckboxRecords();a.searchForm.selections=f}const Xe=f=>{const d=h.value;if(d){d.toggleCheckboxRow(f);const T=h.value.getCheckboxRecords();a.searchForm.selections=T}};return o({tableRef:h,getList:L,getPrm:V,clearSort:k,calculateTableHeight:x}),(f,d)=>{var z;const T=e.resolveComponent("el-button"),v=e.resolveComponent("el-checkbox"),q=e.resolveComponent("el-text"),U=e.resolveComponent("vxe-column"),M=e.resolveComponent("VxeTable"),Q=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({box:t.searchForm.showShadow})},[t.searchForm.showSearch?(e.openBlock(),e.createBlock(je,{key:0,form:t.searchForm,onReset:Y,onConfirm:d[1]||(d[1]=F=>L()),onVisibleChange:e.unref(x)},{btn:e.withCtx(()=>[d[3]||(d[3]=e.createElementVNode("span",{class:"mgr10"},null,-1)),e.renderSlot(f.$slots,"search-bar-btn",{},void 0,!0),e.createVNode(T,{class:"mgl10",round:"",onClick:d[0]||(d[0]=F=>h.value.openCustom())},{default:e.withCtx(()=>[e.createVNode($e,{name:"Tools"})]),_:1})]),_:3},8,["form","onVisibleChange"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"table-header-left",{},void 0,!0),e.createElementVNode("div",{ref_key:"tableContentRef",ref:u},[e.createVNode(M,e.mergeProps({id:b.value,ref_key:"tableRef",ref:h,loading:t.loading||i.value,data:t.api?c.value:t.data,border:""},Z.value,{height:I.value,onCheckboxChange:Je,onCheckboxAll:Je,onSortChange:(z=Z.value["sort-config"])==null?void 0:z.sortChange}),{default:e.withCtx(()=>[t.searchForm.showCheckBox==null||t.searchForm.showCheckBox?(e.openBlock(),e.createBlock(U,{key:0,type:"checkbox",width:e.unref(r)=="zh_cn"?80:150,title:f.$t("xu-hao"),fixed:"left"},{checkbox:e.withCtx(({rowIndex:F,row:j,checked:H,disabled:A,indeterminate:K})=>[e.createElementVNode("div",zt,[H?(e.openBlock(),e.createBlock(v,{key:0,checked:!0,disabled:A,size:"default",onClick:e.withModifiers(R=>!A&&Xe(j),["stop"])},null,8,["disabled","onClick"])):(e.openBlock(),e.createBlock(v,{key:1,disabled:A,checked:!1,size:"default",onClick:e.withModifiers(R=>!A&&Xe(j),["stop"])},null,8,["disabled","onClick"])),e.createVNode(q,{type:"info",class:"mgl5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(F+1),1)]),_:2},1024)])]),_:1},8,["width","title"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"default",{},void 0,!0)]),_:3},16,["id","loading","data","height","onSortChange"])],512),t.searchForm.showPage?(e.openBlock(),e.createBlock(Q,{key:1,"current-page":g[e.unref(w)],"onUpdate:currentPage":d[2]||(d[2]=F=>g[e.unref(w)]=F),class:"myPagination mgt10",background:"",layout:"total, sizes, prev, pager, next",total:g.total,"page-size":g[e.unref(y)],"page-sizes":t.searchForm.pageSizes||e.unref(l).pageSizes,onCurrentChange:oo,onSizeChange:no},null,8,["current-page","total","page-size","page-sizes"])):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-c022c16d"]]),Nt={__name:"index",props:{sheetsConfig:{type:Object,required:!0},fileName:{type:String,required:!0}},setup(t){const o=t;function n(){Ae(o.fileName,o.sheetsConfig)}return(r,s)=>{const l=e.resolveComponent("el-link");return e.openBlock(),e.createBlock(l,e.mergeProps({type:"primary",underline:"never"},r.$attrs,{onClick:n}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(r.$t("xia-zai-dao-ru-mo-ban")),1)])]),_:3},16)}}},qt={mounted(t,o){o.value&&Ye(t)},updated(t,o){o.value?Ye(t):He(t)},beforeUnmount(t){He(t)}};async function Ye(t){await y();const o=t.querySelector(".el-dialog");if(!o)return;const n=t.querySelector(".el-dialog__header"),r=t.querySelector(".el-overlay");r.style.cssText+="overflow: hidden;",n.style.cursor="move";let s=!1,l={window:{width:0,height:0},dialog:{x:0,y:0,width:0,height:0,marginTop:""},mouse:{x:0,y:0},drag:{x:0,y:0}};n.addEventListener("mousedown",c),document.addEventListener("mousemove",b),document.addEventListener("mouseup",p),window.addEventListener("resize",w);function a(){l.mouse.x-l.drag.x>=l.dialog.x&&(l.drag.x=l.mouse.x-l.dialog.x),l.drag.x-l.mouse.x>=l.window.width-(l.dialog.x+l.dialog.width)&&(l.drag.x=l.mouse.x+l.window.width-l.dialog.x-l.dialog.width),l.mouse.y-l.drag.y>=l.dialog.y&&(l.drag.y=l.mouse.y-l.dialog.y),l.drag.y-l.mouse.y>=l.window.height-(l.dialog.y+l.dialog.height)&&(l.drag.y=l.mouse.y+l.window.height-l.dialog.y-l.dialog.height),i()}function i(){let g=l.drag.y-l.mouse.y+l.dialog.y,h=l.drag.x-l.mouse.x+l.dialog.x;o.style.cssText+=`position: absolute; top: calc(${g}px - ${l.dialog.marginTop}); left: ${h}px;`}function c(g){g.button===0&&(l.window={width:document.body.clientWidth,height:document.body.clientHeight},l.dialog=o.getBoundingClientRect(),l.dialog.marginTop=window.getComputedStyle(o).marginTop,l.mouse={x:g.clientX,y:g.clientY},s=!0)}function b(g){s&&(l.drag={x:g.clientX,y:g.clientY},r.style.userSelect="none",a())}function p(g){r.style.userSelect="auto",s=!1}function w(g){}function y(){return new Promise((g,h)=>{setTimeout(()=>{g()},500)})}t.__mouseDown__=c,t.__mouseUp__=p,t.__mouseMove__=b,t.__sizeChange__=w}function He(t){document.removeEventListener("mousedown",t.__mouseDown__),document.removeEventListener("mousemove",t.__mouseMove__),document.removeEventListener("mouseup",t.__mouseUp__),window.removeEventListener("resize",t.__sizeChange__)}const go="",At={key:0,class:"drawer-btn"},Pt={key:1},jt={__name:"index",props:{layer:{type:Object,default:()=>({show:!1,type:"layer",title:"",showButton:!1}),required:!0},loading:{type:Boolean,default:!1}},emits:["confirm"],setup(t,{emit:o}){const n=t,r=o,{t:s}=ee.useI18n(),l=ne.debounce(()=>{r("confirm")},300);async function a(){n.layer.type=="drawer"?n.layer.onClose?n.layer.onClose():await W.ElMessageBox.confirm(s("que-ding-guan-bi-ma"),{confirmButtonText:s("que-ding"),cancelButtonText:s("qu-xiao"),type:"warning"}).catch(()=>{})=="confirm"&&(n.layer.show=!1):n.layer.show=!1}return(i,c)=>{const b=e.resolveComponent("el-button"),p=e.resolveComponent("el-drawer"),w=e.resolveComponent("el-dialog");return t.layer.type?(e.openBlock(),e.createBlock(p,{key:0,modelValue:t.layer.show,"onUpdate:modelValue":c[0]||(c[0]=y=>t.layer.show=y),size:t.layer.width||"100%",title:t.layer.title,direction:"rtl","append-to-body":"","before-close":a,class:"drawer-content"},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default"),c[2]||(c[2]=e.createElementVNode("p",{class:"mgt50"},null,-1)),t.layer.showButton?(e.openBlock(),e.createElementBlock("div",At,[e.renderSlot(i.$slots,"btn",{},()=>[e.createVNode(b,{onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("qu-xiao")),1)]),_:1}),e.createVNode(b,{type:"primary",loading:t.loading,onClick:e.unref(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("ti-jiao")),1)]),_:1},8,["loading","onClick"])])])):e.createCommentVNode("",!0)]),_:3},8,["modelValue","size","title"])):e.withDirectives((e.openBlock(),e.createElementBlock("div",Pt,[e.createVNode(w,{"close-on-click-modal":!1,modelValue:t.layer.show,"onUpdate:modelValue":c[1]||(c[1]=y=>t.layer.show=y),title:t.layer.title,width:t.layer.width||500,center:""},e.createSlots({default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:2},[t.layer.showButton?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(i.$slots,"btn",{},()=>[e.createVNode(b,{onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("qu-xiao")),1)]),_:1}),e.createVNode(b,{type:"primary",onClick:e.unref(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("ti-jiao")),1)]),_:1},8,["onClick"])])]),key:"0"}:void 0]),1032,["modelValue","title","width"])])),[[e.unref(qt),t.layer.show]])}}};function Rt(t,o={}){const n=le(),r={inForm:!0,required:!0,...o},s={phone:/^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/,password:/(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/,email:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/}[t],{inForm:l,value:a,required:i,msg:c=n("validate.invalidInput")}=r;return l?function(b,p,w){if(i){s.test(p)?w():w(new Error(c));return}p&&!s.test(p)?w(new Error(c)):w()}:s.test(a)}class Ut{constructor(o={}){this.config={clientCode:o.clientCode||"one-portal",casServerUrl:`https://one-portal${o.isTest?"-test":""}.joy-group.com/api`,casPortalUrl:`https://one-portal${o.isTest?"-test":""}.joy-group.com`,serviceUrl:o.serviceUrl||window.location.origin+"/cas/callback",tokenKey:o.tokenKey||"one_portal_token",userKey:o.userKey||"one_portal_user",debug:o.debug||!1,autoLogin:o.autoLogin!==!1,loginCallback:o.loginCallback||null,logoutCallback:o.logoutCallback||null,errorCallback:o.errorCallback||null},this.token=null,this.user=null,this.init()}init(){this.log("OnePortal CAS SDK 初始化中..."),this.loadFromStorage();const n=new URLSearchParams(window.location.search).get("ticket");this.isLoggedIn()&&this.config.loginCallback?this.config.loginCallback(this.user,this.token):n?(this.log("检测到ST票据:",n),this.validateTicket(n)):this.config.autoLogin&&!this.isLoggedIn()&&(this.log("用户未登录,准备跳转到CAS登录页面"),this.login())}loadFromStorage(){try{this.token=localStorage.getItem(this.config.tokenKey);const o=localStorage.getItem(this.config.userKey);o&&(this.user=JSON.parse(o)),this.log("从本地存储加载数据:",{token:!!this.token,user:!!this.user})}catch(o){this.log("加载本地存储数据失败:",o)}}saveToStorage(){try{this.token&&localStorage.setItem(this.config.tokenKey,this.token),this.user&&localStorage.setItem(this.config.userKey,JSON.stringify(this.user)),this.log("数据已保存到本地存储")}catch(o){this.log("保存到本地存储失败:",o)}}clearStorage(){try{localStorage.removeItem(this.config.tokenKey),localStorage.removeItem(this.config.userKey),this.log("本地存储已清除")}catch(o){this.log("清除本地存储失败:",o)}}isLoggedIn(){return!!(this.token&&this.user)}getUser(){return this.user}getToken(){return this.token}login(){const o=`${this.config.casPortalUrl}?appCode=${this.config.clientCode}&redirectUrl=${encodeURIComponent(this.config.serviceUrl)}`;this.log("跳转到CAS登录页面:",o),window.location.href=o}async validateTicket(o){try{this.log("验证ST票据:",o);const n=await fetch(`${this.config.casServerUrl}/auth/validateST?ticket=${o}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);const r=await n.json();if(r.success&&r.data)return this.token=r.data.token,this.user=r.data.user,this.saveToStorage(),this.clearTicketFromUrl(),this.log("ST票据验证成功,用户登录成功:",this.user),this.config.loginCallback&&this.config.loginCallback(this.user,this.token),!0;throw new Error(r.message||"ST票据验证失败")}catch(n){return this.log("ST票据验证失败:",n),this.handleError(n),!1}}clearTicketFromUrl(){const o=new URL(window.location);o.searchParams.delete("ticket"),window.history.replaceState({},document.title,o.toString())}async logout(o=!0){try{if(this.log("用户登出"),this.token)try{await fetch(`${this.config.casServerUrl}/auth/logout`,{method:"POST",headers:{AppId:this.config.clientCode,Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"}})}catch(n){this.log("调用服务端登出接口失败:",n)}this.token=null,this.user=null,this.clearStorage(),this.config.logoutCallback&&this.config.logoutCallback(),o&&this.login()}catch(n){this.log("登出失败:",n),this.handleError(n)}}async request(o,n={}){const r={headers:{"Content-Type":"application/json",...n.headers},...n};r.headers.appId=this.config.clientCode,this.token&&(r.headers.Authorization=`Bearer ${this.token}`);try{const s=await fetch(o,r);return s.status===401?(this.log("Token已过期,需要重新登录"),this.logout(),null):s}catch(s){throw this.log("请求失败:",s),s}}async fetchUserInfo(){try{const o=await this.request(`${this.config.casServerUrl}/auth/user`);if(o&&o.ok){const n=await o.json();if(n.success&&n.data)return this.user=n.data,this.saveToStorage(),this.user}return null}catch(o){return this.log("获取用户信息失败:",o),null}}async refreshToken(){this.log("Token刷新功能暂未实现")}handleError(o){this.log("发生错误:",o),this.config.errorCallback&&this.config.errorCallback(o)}log(...o){this.config.debug&&console.log("[OnePortal CAS SDK]",...o)}checkLoginStatus(){return!this.isLoggedIn()&&this.config.autoLogin?(this.login(),!1):this.isLoggedIn()}setConfig(o,n){this.config[o]=n}getConfig(o){return this.config[o]}}function Yt(t,o={}){const r=Object.assign({manual:!1,log:!1,params:null,format:null},o),{manual:s,log:l,params:a={},cb:i,format:c}=r,b=e.ref([]),p=e.ref(!1),w=y=>{const g=y||a;p.value=!0,t(g).then(h=>{const{code:u,data:C,msg:x}=h;if(i){const{records:_,rows:S}=C||{},I=_||S?_||S:C;b.value=Ee(I,c),i(h)}if(C){if(C.records!=null||C.rows!=null){const{records:_,rows:S,total:I=0}=C||{};g&&g.total!=null&&(a.total=parseInt(I)),b.value=Ee(_||S||[],c)}else b.value=Ee(C,c);l&&console.log("useRequest-res",b.value)}}).catch(h=>{i&&(console.log("useRequestErr",h),i({code:500}))}).finally(()=>{p.value=!1})};return s||w(),[p,b,w]}function Ht(t){const o=e.ref(t),n=e.ref(""),r=e.ref("");return e.watch(o,s=>{const l=s||["",""];n.value=l[0],r.value=l[1]}),[o,n,r]}function Kt(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function Ee(t,o){if(!o)return t;if(t instanceof Array)return t.map(r=>{let s={};return o.forEach(l=>s[l]=r[l]),s});let n={};return o.forEach(r=>n[r]=t[r]),n}function Wt(t,o=[]){const{locale:n}=ee.useI18n(),r=e.ref(t());return e.watch([n,...o],()=>{r.value=t()},{immediate:!0}),r}function Zt(t,o="zh_cn",n="en_us"){if(!t)return"-";const r={en_us:n,zh_cn:o},l=be().global.locale.value;return t[r[l]]||t[o]||"-"}function Gt(t,o){let n=te.mapState;return typeof t=="string"&&t.length>0&&(n=te.createNamespacedHelpers(t).mapState),Ke(o,n)}function Jt(t,o){let n=te.mapGetters;return typeof t=="string"&&t.length>0&&(n=te.createNamespacedHelpers(t).mapGetters),Ke(o,n)}function Xt(t,o){let n=te.mapActions;return typeof t=="string"&&t.length>0&&(n=te.createNamespacedHelpers(t).mapActions),Qt(o,n)}function Ke(t,o){const n=te.useStore(),r=o(t),s={};return Object.keys(r).forEach(l=>{const a=r[l].bind({$store:n});s[l]=e.computed(a)}),s}function Qt(t,o){const n=te.useStore(),r=o(t),s={};return Object.keys(r).forEach(l=>{s[l]=r[l].bind({$store:n})}),s}function we(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}function eo(){fe.VxeUI.renderer.add("Enum",{renderTableDefault(t,o){let n;if([null,void 0].includes(o.row[o.column.field]))return"-";const r=o.row[o.column.field];if(t.type=="tag"){let s;return e.createVNode(e.resolveComponent("el-text"),{type:t.enum.getTag(r)},we(s=t.enum.getName(r))?s:{default:()=>[s]})}return e.createVNode(e.resolveComponent("el-text"),null,we(n=t.enum.getName(r))?n:{default:()=>[n]})}}),fe.VxeUI.renderer.add("InputNumber",{renderTableDefault(t,o){return e.createVNode(W.ElInputNumber,e.mergeProps({modelValue:o.row[o.column.field],"onUpdate:modelValue":n=>o.row[o.column.field]=n},t.props,{"step-strictly":!0,"value-on-clear":0}),null)}}),fe.VxeUI.renderer.add("TrueFalse",{renderTableDefault(t,o){const{locale:n}=ee.useI18n();let r=n.value=="zh_cn";return e.createVNode(W.ElText,{type:o.row[o.column.field]?"success":"danger"},{default:()=>[o.row[o.column.field]?r?"是":"YES":r?"否":"NO"]})}}),fe.VxeUI.renderer.add("I18n",{renderTableDefault(t,o){const{locale:n}=ee.useI18n();let r=n.value=="zh_cn"?o.column.field:t.fieldEn;return o.row[r]||o.row[o.column.field]}}),fe.VxeUI.renderer.add("Link",{renderTableDefault(t,o){let n=o.column.field;const r=Fe.useRouter(),{multiple:s,to:l,openType:a="system"}=t,i=o.row[n];function c(b,p){a=="blank"?window.open(b):r.push({path:b,query:{[n]:p}})}if(s){const b=(i==null?void 0:i.split(","))||[];return b.map((p,w)=>e.createVNode("span",null,[e.createVNode(W.ElLink,{underline:"never",type:"primary",onclick:()=>c(a=="stystem"?l:p,p)},we(p)?p:{default:()=>[p]}),w<b.length-1?",":""]))}return e.createVNode(W.ElLink,{underline:"never",type:"primary",onclick:()=>c(a=="stystem"?l:i,i)},we(i)?i:{default:()=>[i]})}})}m.CmpDictionary=Pe,m.CmpIcon=$e,m.ConfrimButton=Et,m.DownExcelTemp=Nt,m.ImportButton=It,m.LayOutForm=Qe,m.Layer=jt,m.ListPage=Ot,m.OnePortalCasSDK=Ut,m.SearchBar=je,m.StatusMap=Se,m._toRaw=gt,m._typeOf=Kt,m.arrToStatusMap=yt,m.arrayToTree=pt,m.checkFileSize=wt,m.creatValidator=Rt,m.createImportFields=kt,m.createListPageId=xt,m.en_us=Ce,m.exportExcel=at,m.exportExcelMuilti=Ae,m.getI18n=be,m.getI18nT=le,m.getListPageConfig=Ue,m.getLocaleValue=Zt,m.getValueBykey=_t,m.importExcel=lt,m.importExcelMuilti=qe,m.messages=ze,m.registerVxeRenderers=eo,m.resetListPageConfig=Mt,m.setListPageConfig=Bt,m.setupI18n=Oe,m.sleep=mt,m.stringToArray=_e,m.stripHtmlTags=Ct,m.unicode2Str=bt,m.useActions=Xt,m.useDatePicker=Ht,m.useGetters=Jt,m.useI18nReState=Wt,m.useRequest=Yt,m.useState=Gt,m.zh_cn=ye,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})});
1
+ (function(m,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("element-plus"),require("vue"),require("file-saver"),require("exceljs"),require("dayjs"),require("vue-i18n"),require("lodash"),require("vue-router"),require("vuex"),require("vxe-pc-ui")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue","file-saver","exceljs","dayjs","vue-i18n","lodash","vue-router","vuex","vxe-pc-ui"],W):(m=typeof globalThis<"u"?globalThis:m||self,W(m.JoyAdminComponents={},m.ElementPlus,m.Vue,m.fileSaver,m.ExcelJS,m.dayjs,m.VueI18n,m._,m.VueRouter,m.Vuex,m.VxeUI))})(this,function(m,W,e,Le,pe,ue,ee,ne,Fe,te,fe){"use strict";const Qe=e.defineComponent({name:"LayOutForm",setup(t,{slots:o,attrs:n,emit:r}){const s=e.ref(null),l=()=>o.default?o.default().filter(i=>i.type!==Symbol.for("v-cmt")).map(i=>i.type===Symbol.for("v-fgt")?i.children:i).flat().map(i=>{var c;return e.h(W.ElCol,{span:((c=i.props)==null?void 0:c.span)||24},{default:()=>i})}):null;e.onMounted(()=>{r("ref",s.value)});function a(){return e.h(W.ElForm,{...n,ref:s},()=>e.h(W.ElRow,{gutter:n.gutter??20},{default:()=>l()}))}return a}});var ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function De(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Be={exports:{}};(function(t,o){(function(n,r){t.exports=r()})(ve,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(l,a,i){var c=a.prototype;i.utc=function(d){var C={date:d,utc:!0,args:arguments};return new a(C)},c.utc=function(d){var C=i(this.toDate(),{locale:this.$L,utc:!0});return d?C.add(this.utcOffset(),n):C},c.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var b=c.parse;c.parse=function(d){d.utc&&(this.$u=!0),this.$utils().u(d.$offset)||(this.$offset=d.$offset),b.call(this,d)};var 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 w=c.utcOffset;c.utcOffset=function(d,C){var x=this.$utils().u;if(x(d))return this.$u?0:x(this.$offset)?w.call(this):this.$offset;if(typeof d=="string"&&(d=function(B){B===void 0&&(B="");var P=B.match(r);if(!P)return null;var L=(""+P[0]).match(s)||["-",0,0],Y=L[0],V=60*+L[1]+ +L[2];return V===0?0:Y==="+"?V:-V}(d),d===null))return this;var S=Math.abs(d)<=16?60*d:d;if(S===0)return this.utc(C);var k=this.clone();if(C)return k.$offset=S,k.$u=!1,k;var I=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(k=this.local().add(S+I,n)).$offset=S,k.$x.$localOffset=I,k};var y=c.format;c.format=function(d){var C=d||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return y.call(this,C)},c.valueOf=function(){var d=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*d},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var g=c.toDate;c.toDate=function(d){return d==="s"&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var h=c.diff;c.diff=function(d,C,x){if(d&&this.$u===d.$u)return h.call(this,d,C,x);var S=this.local(),k=i(d).local();return h.call(S,k,C,x)}}})})(Be);var et=Be.exports;const tt=De(et);var Me={exports:{}};(function(t,o){(function(n,r){t.exports=r()})(ve,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(s,l,a){var i,c=function(y,g,h){h===void 0&&(h={});var d=new Date(y),C=function(x,S){S===void 0&&(S={});var k=S.timeZoneName||"short",I=x+"|"+k,B=r[I];return B||(B=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:x,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:k}),r[I]=B),B}(g,h);return C.formatToParts(d)},b=function(y,g){for(var h=c(y,g),d=[],C=0;C<h.length;C+=1){var x=h[C],S=x.type,k=x.value,I=n[S];I>=0&&(d[I]=parseInt(k,10))}var B=d[3],P=B===24?0:B,L=d[0]+"-"+d[1]+"-"+d[2]+" "+P+":"+d[4]+":"+d[5]+":000",Y=+y;return(a.utc(L).valueOf()-(Y-=Y%1e3))/6e4},p=l.prototype;p.tz=function(y,g){y===void 0&&(y=i);var h,d=this.utcOffset(),C=this.toDate(),x=C.toLocaleString("en-US",{timeZone:y}),S=Math.round((C-new Date(x))/1e3/60),k=15*-Math.round(C.getTimezoneOffset()/15)-S;if(!Number(k))h=this.utcOffset(0,g);else if(h=a(x,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(k,!0),g){var I=h.utcOffset();h=h.add(d-I,"minute")}return h.$x.$timezone=y,h},p.offsetName=function(y){var g=this.$x.$timezone||a.tz.guess(),h=c(this.valueOf(),g,{timeZoneName:y}).find(function(d){return d.type.toLowerCase()==="timezonename"});return h&&h.value};var w=p.startOf;p.startOf=function(y,g){if(!this.$x||!this.$x.$timezone)return w.call(this,y,g);var h=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return w.call(h,y,g).tz(this.$x.$timezone,!0)},a.tz=function(y,g,h){var d=h&&g,C=h||g||i,x=b(+a(),C);if(typeof y!="string")return a(y).tz(C);var S=function(P,L,Y){var V=P-60*L*1e3,_=b(V,Y);if(L===_)return[V,L];var $=b(V-=60*(_-L)*1e3,Y);return _===$?[V,_]:[P-60*Math.min(_,$)*1e3,Math.max(_,$)]}(a.utc(y,d).valueOf(),x,C),k=S[0],I=S[1],B=a(k).utcOffset(I);return B.$x.$timezone=C,B},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(y){i=y}}})})(Me);var ot=Me.exports;const nt=De(ot),ye={"dao-ru":"导入","quan-xuan":"全选","xia-zai-dao-ru-mo-ban":"下载导入模板","xu-hao":"序号","qing-shu-ru":"请输入","qing-xuan-ze":"请选择","kai-shi-shi-jian":"开始时间","jie-shu-shi-jian":"结束时间","shai-xuan":"筛选","chong-zhi":"重置","guan-bi":"关闭","zhan-kai":"展开","qu-xiao":"取消","ti-jiao":"提交","que-ding":"确定","que-ding-guan-bi-ma":"确定关闭吗","xia-zai-dao-ru-mo-ban":"下载导入模板",excel:{fieldsMappingRequired:"请输入列字段映射",invalidInput:"非法输入",invalidOption:"请输入有效选项!",copyFailed:"复制失败",sheetNameTooLong:'Sheet名称 "{0}" 长度超过31个字符,已自动截断为 "{1}"'},validate:{invalidInput:"请输入正确内容"},tools:{keysLengthError:"keys 长度必须大于2 默认前两位为 label value"}},Ce={"dao-ru":"Import","quan-xuan":"Select All","xia-zai-dao-ru-mo-ban":"Download Import Template","xu-hao":"No.","qing-shu-ru":"Please enter","qing-xuan-ze":"Please select","kai-shi-shi-jian":"Start Time","jie-shu-shi-jian":"End Time","shai-xuan":"Filter","chong-zhi":"Reset","guan-bi":"Collapse","zhan-kai":"Expand","qu-xiao":"Cancel","ti-jiao":"Submit","que-ding":"Confirm","que-ding-guan-bi-ma":"Are you sure to close?","xia-zai-dao-ru-mo-ban":"Download Import Template",excel:{fieldsMappingRequired:"Please enter column field mapping",invalidInput:"Invalid input",invalidOption:"Please enter a valid option!",copyFailed:"Copy failed",sheetNameTooLong:'Sheet name "{0}" exceeds 31 characters, automatically truncated to "{1}"'},validate:{invalidInput:"Please enter valid content"},tools:{keysLengthError:"Keys length must be greater than 2, default first two are label and value"}},ze={zh_cn:ye,en_us:Ce};let ie=null;function Oe(t=null){if(t){const{global:o}=t;return o.messages.value.zh_cn?o.mergeLocaleMessage("zh_cn",ye):o.setLocaleMessage("zh_cn",ye),o.messages.value.en_us?o.mergeLocaleMessage("en_us",Ce):o.setLocaleMessage("en_us",Ce),ie=t,t}return ie||(ie=ee.createI18n({legacy:!1,locale:"zh_cn",fallbackLocale:"zh_cn",messages:ze})),ie}function be(){return ie||Oe()}function le(){return be().global.t}ue.extend(tt),ue.extend(nt);async function lt(t,o){const{fields:n,range:r=1}=o;if(!n){const a=le();throw new Error(a("excel.fieldsMappingRequired"))}let s=new pe.Workbook;await s.xlsx.load(t);const l={};return s.eachSheet(function(a,i){const c=[];a.eachRow(function(b,p){if(p>r){let w={},y=!0;Object.keys(n).forEach(g=>{const h=b.getCell(n[g]).value;w[g]=h,h&&(y=!1)}),y||c.push(w)}}),l[a._name]=c}),s=null,l}const Ne={columnWidth:30};async function at(t,o,n=[],r={}){if(!t||!o)return;const{columnStyle:s}=r,{columnWidth:l}=Ne;o.forEach(c=>{c.width=c.width?c.width:l});const{workbook:a,worksheet:i}=rt();i.columns=o,i.addRows(n),s&&await st(a,i,s);try{const c=await a.xlsx.writeBuffer(),b=new File([c],t,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Le.saveAs(b)}catch(c){console.log(c)}}function rt(){const t=new pe.Workbook;t.creator="distributor System",t.lastModifiedBy="distributor System",t.created=new Date,t.modified=new Date,t.lastPrinted=new Date;const o=t.addWorksheet("Sheet1");return{workbook:t,worksheet:o}}async function st(t,o,n){const r=Object.keys(n);for(const s of r){const l=n[s],{type:a}=l;switch(a){case"IMG":await it(t,o,s);break}}}async function it(t,o,n,r){const s=o.getColumn(n),l=s.values;o.getColumn(n).width=20,o.eachRow((a,i)=>{i>1&&(a.height=40)});for(let a=0,i=l.length;a<i;a++){if(a<2)continue;let c=l[a];c&&(o.getCell(s.letter+a).value="",await ct(t,o,c,{width:100,height:50,col:s._number-1,row:a-1}))}}async function ct(t,o,n,r){const{col:s,row:l,width:a,height:i}=r,{success:c,base64:b}=await dt(n,.3);if(c){const p=t.addImage({base64:b,extension:"jpeg"});o.addImage(p,{tl:{col:s,row:l},ext:{width:a,height:i}})}}function dt(t,o=1){const n=new Image;return n.setAttribute("crossOrigin","anonymous"),n.crossOrigin="anonymous",n.src=t,new Promise((r,s)=>{n.onload=()=>{const l=document.createElement("canvas");l.width=n.width,l.height=n.height,l.getContext("2d").drawImage(n,0,0,l.width,l.height),r({success:!0,base64:l.toDataURL("image/jpeg",o)})},n.onerror=()=>{r({success:!1})}})}const ke="---";async function qe(t,o){const{fields:n,range:r=1}=o;if(!n){const a=le();throw new Error(a("excel.fieldsMappingRequired"))}let s=new pe.Workbook;await s.xlsx.load(t);const l={};return s.eachSheet(function(a,i){if(a.state=="visible"){const c=[],b=n[a._name];if(b){let p=Object.values(b).some(y=>y.includes("image")),w={};p&&(a.getImages().forEach(g=>{const{tl:h}=g.range,d=s.model.media.find(C=>C.index===g.imageId);if(d){const C=d.buffer.toString("base64"),x=`data:image/${d.extension};base64,${C}`,S=`${Math.ceil(h.row)}_${Math.ceil(h.col)}`;w[S]?w[S].push(x):w[S]=[x]}}),console.log("withImages-imageMap",w)),a.eachRow(function(y,g){if(g>r){let h={},d=!0;Object.keys(b).forEach(C=>{var B;let[x,S]=b[C].split(ke);const k=y.getCell(x);let I;if(S=="image"&&p){const P=k._column._number,L=`${g}_${P}`;I=w[L]||""}else k.result!=null?I=k.result:(B=k.value)!=null&&B.richText?I=k.value.richText.reduce((P,L)=>P+L.text,""):k.type==4&&k.value?I=ue(k.value).utc().format("YYYY-MM-DD HH:mm:ss"):I=k.value;I&&S=="option"&&(I=I.split(ke)[1]),h[C]=I,I&&(d=!1)}),d||c.push(h)}}),l[a._name]=c}}}),s=null,l}const ut={date:"yyyy-mm-dd",number:"0",string:"@"};async function Ae(t,o){if(!t||o.length==0)return;const n=ft(o);n.eachSheet(function(r,s){const{columnWidth:l}=Ne,{tableHeader:a,tableData:i}=o[r._name];a.forEach(c=>{const{style:b={},required:p}=c,{font:w={}}=b;c.style={...b,font:{...w,color:{argb:p?"FFFF0000":void 0}}}}),r.columns=a,r.addRows(i),a.forEach(c=>{const{header:b,key:p,width:w,option:y,numFmt:g,locked:h}=c,d=r.getColumn(p);if(d.numFmt=ut[g]||g,d.width=w||l,d.protection={locked:h},y){const C=n.addWorksheet(p);C.state="hidden",C.getColumn(1).values=y.map(x=>`${x.label}${ke}${x.value}`),Array(100).fill("").forEach((x,S)=>{if(S>0){const k=le();r.getCell(`${d.letter}${S}`).dataValidation={type:"list",formulae:[`${p}!$A$1:$A$${y.length}`],showErrorMessage:!0,error:k("excel.invalidInput"),errorStyle:"stop",errorMessage:k("excel.invalidOption")}}})}})}),tableHeader.some(r=>r.locked)&&await n.protect("6737187214");try{const r=await n.xlsx.writeBuffer(),s=new File([r],t,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Le.saveAs(s)}catch(r){console.log(r)}}function ft(t){const o=le(),n=new pe.Workbook;return n.creator="distributor System",n.lastModifiedBy="distributor System",n.created=new Date,n.modified=new Date,n.lastPrinted=new Date,Object.keys(t).sort((s,l)=>{const a=t[s].sort??0,i=t[l].sort??0;return a-i}).forEach(s=>{let l=s,a=!1;/[\\/:*?\[\]]/g.test(s)&&(s=s.replace(/[\\/:*?\[\]]/g,""),a=!0),s.length>31&&(s=s.substring(0,31).trim(),a=!0,console.warn(o("excel.sheetNameTooLong",[l,s]))),a&&(t[s]=t[l],delete t[l]),n.addWorksheet(s)}),n}function ht(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 mt(t){return new Promise(o=>{setTimeout(()=>{o()},t)})}function gt(t){return JSON.parse(JSON.stringify(t))}function pt(t){let o=[],n={},r=(s,l)=>Object.prototype.hasOwnProperty.call(s,l);for(const s of t){n[s.id]={...s,children:r(n,s.id)?n[s.id].children:[]};const l=n[s.id];s.pid==-1?o.push(l):(r(n,s.pid)||(n[s.pid]={children:[]}),n[s.pid].children.push(l))}return o}function _e(t,o=" "){return t?t.split(o).filter(n=>n.trim()):[]}class Se{constructor(o,n=["label","value","labelEn"]){this.list=o.map(r=>({...r,label:r[n[0]],labelEn:r[n[2]]??r[n[0]]??"",value:r[n[1]]})),this.map=new Map(this.list.map(r=>[r[n[1]],r]))}getName(o){if(!this.has(o))return"-";const n=be().global.locale,{label:r,labelEn:s}=this.map.get(o);return(n.value=="zh_cn"?r:s)??r??"-"}getTag(o){if(!this.has(o))return"info";const{tag:n="info"}=this.map.get(o);return n}getItem(o){return this.has(o)?this.map.get(o):null}getColor(o){if(!this.has(o))return null;const{color:n}=this.map.get(o);return n}has(o){return this.map.has(o)}}function yt(t,o=[],n="i18nName"){if(t.length==0)return new Se([]);if(o.length<2){const s=le();throw new Error(s("tools.keysLengthError"))}let r=t.map(s=>{let l={};return n&&(l.labelEn=s[n]),o.forEach((a,i)=>{i===0?l.label=s[a]:i===1?l.value=s[a]:l[a]=s[a]}),l});return new Se(r)}function Ct(t){return t?t.replace(/<[^>]+>/g,""):""}function bt(t){return t?(t.includes("\\\\u")&&(t=t.replace(/\\/g,"")),t.replace(/\\u[\dA-F]{4}/gi,o=>String.fromCharCode(parseInt(o.replace(/\\u/g,""),16)))):""}function wt(t,o=10){let n=1048576*o;return!(t.size>n)}function xt(t){return Array.from(10).fill(0).map((n,r)=>t+"_"+r)}function kt(t){let o={};return t.map((n,r)=>{let{key:s,option:l,type:a}=n,i=ht(r);l?o[s]=`${i}---option`:a==="image"?o[s]=`${i}---image`:o[s]=i}),o}function _t(t,o){return o.split(".").reduce((n,r)=>n&&n[r],t)}const ao="",he=(t,o)=>{const n=t.__vccOpts||t;for(const[r,s]of o)n[r]=s;return n},St=["onClick"],Pe=he({__name:"index",props:e.mergeModels({api:{type:Function},showCheckAll:{type:Boolean,default:!0},maxLimit:{type:Number,default:void 0},optionClick:{type:Function,default:()=>{}},data:{type:Array},labelValue:{type:Object,default:()=>({label:"label",labelEn:"labelEn",value:"value"})},changeLocal:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["success","change","changeAll"],["update:modelValue"]),setup(t,{emit:o}){const n=t,r=e.useAttrs(),{t:s,locale:l}=ee.useI18n(),a=e.useModel(t,"modelValue"),i=e.computed(()=>r["value-key"]!=null),c=e.ref(""),b=e.computed(()=>{if(r.remote!==void 0)return n.data;const _=_e(c.value),{data:$,labelValue:O}=n,Z=$||y.value;if(_.length==0)return Z;const{label:E,labelEn:ce}=O;let D=l.value=="en_us"?ce||"i18nName":E;return _.length==1?Z.filter(oe=>oe[D].toLowerCase().includes(_[0].toLowerCase())):Z.filter(oe=>{let de=!1;return de=_.some(xe=>oe[D].toLowerCase()==xe.toLowerCase()),de})}),p=e.computed({get(){return r.multiple==null||a.value==null?!1:a.value.length==b.value.length},set(_){return _}}),w=o,y=e.ref([]),g=async()=>{const{data:_}=await n.api();y.value=[..._],w("success",y)};n.api&&g();function h(_){w("change",_),d.value&&e.nextTick(()=>{n.optionClick&&n.optionClick(d.value),d.value=null})}const d=e.ref(null);function C(_){d.value=_}const x=n.labelValue.label.split("-"),S=_=>{if(x.length==1){if(n.changeLocal)return s(_[n.labelValue.label]);let $=l.value=="en_us"?_[n.labelValue.labelEn||"i18nName"]:_[n.labelValue.label];return $=$||_[n.labelValue.label],$+""}else{let $=[];return x.forEach(O=>{$.push(_[O])}),$.join("-")}};function k(_){let $=n.data?n.data:y.value;a.value=_?$.map(O=>i.value?O:O[n.labelValue.value]):[],e.nextTick(()=>{w("change",a.value),w("changeAll",a.value,$)})}function I(_){w("change",i.value?_:_[n.labelValue.value]),e.nextTick(()=>{n.optionClick&&n.optionClick(_)})}function B(_){return a.value.length>=n.maxLimit&&!a.value.includes(_[n.labelValue.value])}function P(_){return _.map($=>({...$,label:S($),value:i.value?$:$[n.labelValue.value]}))}const L=e.ref([]),Y=n.data?n.data:y.value;L.value=P(Y),e.watch(()=>n.data?n.data:y.value,_=>{var O;const $=P(_);if($.length!==L.value.length)L.value=$;else{let Z=!1;for(let E=0;E<$.length;E++)if($[E].value!==((O=L.value[E])==null?void 0:O.value)){Z=!0;break}Z&&(L.value=$)}},{deep:!0});const V=e.computed(()=>L.value);return(_,$)=>{const O=e.resolveComponent("el-checkbox"),Z=e.resolveComponent("el-select-v2"),E=e.resolveComponent("el-option"),ce=e.resolveComponent("el-select");return e.unref(r).v2!=null?(e.openBlock(),e.createBlock(Z,e.mergeProps({key:0,options:V.value,modelValue:a.value,"onUpdate:modelValue":$[1]||($[1]=D=>a.value=D)},e.unref(r),{filterable:"","collapse-tags":"","collapse-tags-tooltip":"",clearable:"",onChange:h,onClear:h}),e.createSlots({default:e.withCtx(({item:D})=>[e.createElementVNode("div",{onClick:ae=>C(D)},e.toDisplayString(D.label),9,St)]),_:2},[e.unref(r).multiple!=null?{name:"header",fn:e.withCtx(()=>[e.renderSlot(_.$slots,"header",{},()=>[e.createVNode(O,{class:"mgl20",modelValue:p.value,"onUpdate:modelValue":$[0]||($[0]=D=>p.value=D),onChange:k},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0)]),key:"0"}:void 0]),1040,["options","modelValue"])):(e.openBlock(),e.createBlock(ce,e.mergeProps({key:1,modelValue:a.value,"onUpdate:modelValue":$[3]||($[3]=D=>a.value=D),filterable:"","collapse-tags":"","collapse-tags-tooltip":"","filter-method":e.unref(r).remote!=null?void 0:D=>c.value=D,clearable:""},e.unref(r),{onClear:t.optionClick}),{default:e.withCtx(()=>[e.unref(r).multiple!=null&&t.showCheckAll&&t.maxLimit==null?e.renderSlot(_.$slots,"header",{key:0},()=>[e.createVNode(O,{class:"mgl20",modelValue:p.value,"onUpdate:modelValue":$[2]||($[2]=D=>p.value=D),onChange:k},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(D,ae)=>(e.openBlock(),e.createBlock(E,{key:ae,label:S(D),disabled:e.unref(r).multiple!=null&&t.maxLimit>0?B(D):!1,onClick:e.withModifiers(oe=>I(D),["stop"]),value:i.value?D:D[t.labelValue.value]},null,8,["label","disabled","onClick","value"]))),128))]),_:3},16,["modelValue","filter-method","onClear"]))}}},[["__scopeId","data-v-51bd1467"]]),so="",$t=e.defineComponent({props:{name:{tyepe:String,required:!0}}});function Vt(t,o,n,r,s,l){const a=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(a,{class:"cmp-icon"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.name)))]),_:1})}const $e=he($t,[["render",Vt],["__scopeId","data-v-733f9daa"]]),Et={__name:"index",emits:["ok","no"],setup(t,{emit:o}){const n=o,r=ne.debounce(()=>{n("ok")},500);function s(){n("no")}return(l,a)=>{const i=e.resolveComponent("el-popconfirm");return e.openBlock(),e.createElementBlock("span",null,[e.createVNode(i,e.mergeProps(l.$attrs,{onConfirm:e.unref(r),onCancel:s}),{reference:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16,["onConfirm"])])}}},io="",Tt=["accept"],It=he({__name:"index",props:{accept:{type:String,default:".xlsx,.xls"},fields:{type:Object,default:()=>({})},fileChange:{type:Function,required:!0}},emits:["fileChange"],setup(t,{emit:o}){const n=t,r=e.ref(null),s=e.ref(!1);async function l(a){s.value=!0;let i=a.target.files[0];const c=await qe(i,n.fields).catch(()=>{s.value=!1}).finally(()=>{r.value.value=null});await n.fileChange(c).finally(()=>{s.value=!1})}return(a,i)=>{const c=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("span",null,[e.createVNode(c,e.mergeProps({type:"primary",loading:s.value,class:"mgr10",onClick:i[0]||(i[0]=b=>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,Tt)])}}},[["__scopeId","data-v-f5e86876"]]);function Ve(t){let o={};return t.forEach(n=>{const{key:r,type:s,option:l={},value:a,dateType:i="date"}=n;if(r)if(s=="input"&&(l!=null&&l.multiple))o[r]=_e(a);else if(s=="date")if(i.includes("range")){const[c,b]=r;let[p,w]=a||[];p&&i=="daterange"&&(p=ue(p).format("YYYY-MM-DD 00:00:00"),w=ue(w).format("YYYY-MM-DD 23:59:59")),o[c]=p,o[b]=w}else o[r]=a;else o[r]=a}),o}const uo="",Lt={key:0},Ft={class:"btns"},vt={class:"left"},Dt={class:"right"},je=he({__name:"index",props:{form:{type:Object,required:!0}},emits:["confirm","reset","visibleChange"],setup(t,{expose:o,emit:n}){const r=t,s=n,l=e.ref(!0),a=e.ref(null),{t:i}=ee.useI18n(),c={datetimerange:"YYYY-MM-DD HH:mm:ss",daterange:"YYYY-MM-DD",month:"YYYY-MM"},b=e.computed(()=>l.value?i("guan-bi"):i("zhan-kai"));function p(){s("confirm")}function w(x){x.option.onClear&&x.option.onClear(),s("confirm")}function y(){s("reset")}function g(){s("confirm")}function h(){return Ve(r.form.items)}const d=ne.cloneDeep(r.form.items);function C(){r.form.items.forEach(x=>{const S=d.find(k=>k.key==x.key);S&&(x.value=S.value)})}return o({getPrm:h,reset:C}),(x,S)=>{const k=e.resolveComponent("el-input"),I=e.resolveComponent("el-date-picker"),B=e.resolveComponent("el-form-item"),P=e.resolveComponent("el-form"),L=e.resolveComponent("el-link"),Y=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",{class:"searchBar-container mgt10 mgb10",onKeydown:e.withKeys(p,["enter"])},[e.createElementVNode("div",{class:"searchBar",style:e.normalizeStyle({height:l.value?"auto":"42px"})},[e.createVNode(P,{inline:"",model:t.form.data},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.form.items.filter(V=>!V.hidden),V=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:V.key},[V.type=="br"?(e.openBlock(),e.createElementBlock("br",Lt)):(e.openBlock(),e.createBlock(B,{key:1,label:V.name},{default:e.withCtx(()=>{var _,$;return[V.type==="input"?(e.openBlock(),e.createBlock(k,{key:0,modelValue:V.value,"onUpdate:modelValue":O=>V.value=O,class:e.normalizeClass(((_=V.option)==null?void 0:_.class)||"w150"),placeholder:x.$t("qing-shu-ru"),clearable:""},null,8,["modelValue","onUpdate:modelValue","class","placeholder"])):V.type==="custom"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(V.render),{key:1})):e.createCommentVNode("",!0),V.type==="select"?(e.openBlock(),e.createBlock(Pe,e.mergeProps({key:2,class:(($=V.option)==null?void 0:$.class)||"w150",modelValue:V.value,"onUpdate:modelValue":O=>V.value=O},{ref_for:!0},V.option,{onChange:p,onClear:O=>w(V)}),null,16,["class","modelValue","onUpdate:modelValue","onClear"])):e.createCommentVNode("",!0),V.type==="date"?(e.openBlock(),e.createBlock(I,e.mergeProps({key:3,class:{datetimerange:"w300",daterange:"w200"}[V.dateType]||"w100",modelValue:V.value,"onUpdate:modelValue":O=>V.value=O,"value-format":c[V.dateType]||"YYYY-MM-DD",type:V.dateType||"date",onFocus:O=>a.value=V,onChange:O=>g(),placeholder:x.$t("qing-xuan-ze"),"start-placeholder":x.$t("kai-shi-shi-jian"),"end-placeholder":x.$t("jie-shu-shi-jian")},{ref_for:!0},V.option),null,16,["class","modelValue","onUpdate:modelValue","value-format","type","onFocus","onChange","placeholder","start-placeholder","end-placeholder"])):e.createCommentVNode("",!0)]}),_:2},1032,["label"]))],64))),128))]),_:1},8,["model"])],4),e.createElementVNode("div",Ft,[e.createElementVNode("div",vt,[e.renderSlot(x.$slots,"table-header-left",{},void 0,!0)]),e.createElementVNode("div",Dt,[e.createVNode(L,{underline:"never",class:"mgr10",onClick:S[0]||(S[0]=()=>{s("visibleChange",!l.value),l.value=!l.value})},{default:e.withCtx(()=>[e.createVNode($e,{name:l.value?"ArrowUp":"ArrowDown"},null,8,["name"]),e.createTextVNode(" "+e.toDisplayString(b.value),1)]),_:1}),e.createVNode(Y,{type:"primary",onClick:p},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.$t("shai-xuan")),1)]),_:1}),e.createVNode(Y,{type:"primary",onClick:y},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.$t("chong-zhi")),1)]),_:1}),e.renderSlot(x.$slots,"btn",{},void 0,!0)])])],32)}}},[["__scopeId","data-v-6c7679eb"]]),Re={pageNoKey:"pageNo",pageSizeKey:"pageSize",totalKey:"total",defaultPageSize:10,pageSizes:[10,50,100,500],responseDataKeys:{rows:["rows","records","list"],total:["totalRows","total"]},showSearch:!1,showPage:!1,showShadow:!1,showCheckBox:!1,enableCellCopy:!0};let me={...Re};function Bt(t){me={...me,...t,responseDataKeys:{...me.responseDataKeys,...t.responseDataKeys||{}}}}function Ue(){return me}function Mt(){me={...Re}}const ho="",zt={class:"center"},Ot=he({__name:"index",props:{id:{type:String,required:!1},loading:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0},searchForm:{type:Object,default:()=>({items:[],selections:[]})},api:{type:Function},data:{type:Array},tableConfig:{type:Object,default:()=>({})}},setup(t,{expose:o}){const{t:n,locale:r}=ee.useI18n(),s=Fe.useRoute(),l=Ue(),a=t,i=e.ref(!1),c=e.ref([]);a.searchForm.showSearch===void 0&&(a.searchForm.showSearch=l.showSearch),a.searchForm.showPage===void 0&&(a.searchForm.showPage=l.showPage),a.searchForm.showShadow===void 0&&(a.searchForm.showShadow=l.showShadow),a.searchForm.showCheckBox===void 0&&(a.searchForm.showCheckBox=l.showCheckBox),a.searchForm.enableCellCopy===void 0&&(a.searchForm.enableCellCopy=l.enableCellCopy),a.searchForm.selections||(a.searchForm.selections=[]);const b=e.computed(()=>{const f=s.path.replace(/\//g,"-").replace(/^-/,"")||"default-table";return a.id?`listPageId-${f}-${a.id}`:`listPageId-${f}`}),p=ne.cloneDeep(a.searchForm.items),w=a.searchForm.pageNoKey||l.pageNoKey,y=a.searchForm.pageSizeKey||l.pageSizeKey,g=e.reactive({[w]:1,[y]:a.searchForm.defaultPageSize||l.defaultPageSize,total:0}),h=e.ref(null),d=e.ref(null),C=e.ref(450),x=ne.debounce(()=>{e.nextTick(()=>{if(!d.value)return;const u=d.value.getBoundingClientRect(),T=window.innerHeight,v=u.top,q=100,U=T-v-q,M=200;C.value=Math.max(U,M)})},100),S=()=>{x()},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",D),u.removeEventListener("mousemove",ae),u.removeEventListener("mouseup",oe),u.removeEventListener("keydown",Te),u.addEventListener("mousedown",D),u.addEventListener("mousemove",ae),u.addEventListener("mouseup",oe),u.addEventListener("keydown",Te),!0};e.onMounted(()=>{x(),window.addEventListener("resize",S),(a.searchForm.enableCellCopy||l.enableCellCopy)&&(document.addEventListener("mouseup",Ze),document.addEventListener("mousedown",Ge),setTimeout(()=>{k()},500))}),e.onUpdated(()=>{(a.searchForm.enableCellCopy||l.enableCellCopy)&&setTimeout(()=>{k()},500)}),e.onUnmounted(()=>{if(window.removeEventListener("resize",S),a.searchForm.enableCellCopy||l.enableCellCopy){document.removeEventListener("mouseup",Ze),document.removeEventListener("mousedown",Ge);const f=h.value;if(f&&f.$el){const u=f.$el;u.removeEventListener("mousedown",D),u.removeEventListener("mousemove",ae),u.removeEventListener("mouseup",oe),u.removeEventListener("keydown",Te)}}});const I=e.computed(()=>Z.value.height||C.value);let B;async function P(f){const{dataFormat:u}=a.tableConfig;f[w]!=1&&(f.nextSearchAfter=B),i.value=!0;const{code:T,data:v={}}=await a.api(f).finally(()=>{i.value=!1,a.searchForm.selections=[]});if(T==200){let q=[];for(const M of l.responseDataKeys.rows)if(v[M]){q=v[M];break}let U=0;for(const M of l.responseDataKeys.total)if(v[M]!==void 0){U=v[M];break}c.value=u?u(q):q,g.total=U,B=v.nextSearchAfter,(a.searchForm.enableCellCopy||l.enableCellCopy)&&e.nextTick(()=>{setTimeout(()=>{k()},100)})}}function L(f={}){const{searchData:u=()=>({})}=a.tableConfig,T=u();P({...g,...Ve(a.searchForm.items),...f,...T})}function Y(){const{reset:f}=a.tableConfig;f&&f(),a.searchForm.items.forEach(u=>{const T=p.find(v=>ne.isArray(u.key)&&ne.isArray(v.key)?u.key.join(",")==v.key.join(","):v.key==u.key);T&&(u.value=T.value)}),L()}a.api&&a.immediate&&L();function V(){return{...g,...Ve(a.searchForm.items)}}const _=()=>{const f=h.value;f&&f.clearSort()},$=e.reactive({storage:!0}),O=e.reactive({drag:!0,resizable:!0,maxFixedSize:0}),Z=e.computed(()=>{const{customConfig:f,columnConfig:u,...T}=a.tableConfig;return{headerAlign:"left",align:"center",customConfig:{...$,...f},columnConfig:{...O,...u},"virtual-x-config":{enabled:!1,scrollToLeftOnChange:!1},"virtual-y-config":{enabled:!0,gt:100},...T}}),E=e.reactive({isSelecting:!1,startCell:null,endCell:null,selectedCells:[]}),ce=f=>{const u=f.closest(".vxe-body--column");if(!u||u.classList.contains("col--checkbox")||u.classList.contains("col--seq"))return null;const T=u.closest(".vxe-body--row");if(!T)return null;const v=h.value;if(!v)return null;let q=-1;const U=T.getAttribute("data-rowid");if(U!=null)q=parseInt(U,10);else{const z=T.parentElement;q=Array.from(z.querySelectorAll(".vxe-body--row")).indexOf(T)}if(q<0)return null;let M=-1;const Q=u.getAttribute("data-colid");if(Q&&(M=v.getColumns().findIndex(F=>F.id===Q)),M<0){const F=Array.from(T.querySelectorAll(".vxe-body--column")).indexOf(u),j=!!u.closest(".vxe-table--fixed-left-wrapper"),H=!!u.closest(".vxe-table--fixed-right-wrapper"),A=v.getColumns();if(j){const K=A.filter(R=>R.fixed==="left");F<K.length&&(M=A.indexOf(K[F]))}else if(H){const K=A.filter(R=>R.fixed==="right");F<K.length&&(M=A.indexOf(K[F]))}else{const K=a.searchForm.showCheckBox?1:0;M=A.filter(G=>G.fixed==="left").length+F-K}}return M<0?null:{rowIndex:q,colIndex:M,cell:u}},D=f=>{const u=ce(f.target);if(!u){de();return}E.isSelecting=!0,E.startCell={rowIndex:u.rowIndex,colIndex:u.colIndex},E.endCell={...E.startCell},xe(),We()},ae=f=>{if(!E.isSelecting)return;const u=ce(f.target);u&&(E.endCell={rowIndex:u.rowIndex,colIndex:u.colIndex},xe(),We())},oe=()=>{E.isSelecting=!1},de=()=>{E.selectedCells=[],E.startCell=null,E.endCell=null;const f=h.value;if(!f)return;f.$el.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(T=>{T.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")})},xe=()=>{if(!E.startCell||!E.endCell){E.selectedCells=[];return}const f=E.startCell.rowIndex,u=E.endCell.rowIndex,T=E.startCell.colIndex,v=E.endCell.colIndex,q=Math.min(f,u),U=Math.max(f,u),M=Math.min(T,v),Q=Math.max(T,v);E.selectedCells=[];for(let z=q;z<=U;z++)for(let F=M;F<=Q;F++)E.selectedCells.push({rowIndex:z,colIndex:F})},We=()=>{e.nextTick(()=>{const f=h.value;if(!f)return;const u=f.$el;if(u.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(j=>{j.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")}),E.selectedCells.length===0)return;const T=f.getColumns(),v=E.selectedCells.map(j=>j.rowIndex),q=E.selectedCells.map(j=>j.colIndex),U=Math.min(...v),M=Math.max(...v),Q=Math.min(...q),z=Math.max(...q),F=[u.querySelector(".vxe-table--body-wrapper tbody"),u.querySelector(".vxe-table--fixed-left-wrapper tbody"),u.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean);E.selectedCells.forEach(({rowIndex:j,colIndex:H})=>{const A=T[H];if(!A)return;const K=A.fixed==="left",R=A.fixed==="right";for(const G of F){const ge=G.querySelectorAll(".vxe-body--row")[j];if(!ge)continue;const re=Array.from(ge.querySelectorAll(".vxe-body--column"));let N=null;if(K&&G.closest(".vxe-table--fixed-left-wrapper")){const J=T.filter(X=>X.fixed==="left").indexOf(A);N=re[J]}else if(R&&G.closest(".vxe-table--fixed-right-wrapper")){const J=T.filter(X=>X.fixed==="right").indexOf(A);N=re[J]}else if(!K&&!R&&G.closest(".vxe-table--body-wrapper")){const se=a.searchForm.showCheckBox?1:0,J=T.filter(Ie=>Ie.fixed==="left").length,X=H-J;N=re[X+se]}if(N&&!N.classList.contains("col--checkbox")&&!N.classList.contains("col--seq")){N.classList.add("cell-selected"),j===U&&N.classList.add("cell-border-top"),j===M&&N.classList.add("cell-border-bottom"),H===Q&&N.classList.add("cell-border-left"),H===z&&N.classList.add("cell-border-right");break}}})})},to=async()=>{if(E.selectedCells.length===0)return;const f=h.value;if(!f)return;const u=f.$el,T=f.getColumns(),v=[...new Set(E.selectedCells.map(z=>z.rowIndex))].sort((z,F)=>z-F),q=[...new Set(E.selectedCells.map(z=>z.colIndex))].sort((z,F)=>z-F),U=[u.querySelector(".vxe-table--body-wrapper tbody"),u.querySelector(".vxe-table--fixed-left-wrapper tbody"),u.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean),M=[];v.forEach(z=>{const F=[];q.forEach(j=>{const H=T[j];if(!H){F.push("");return}const A=H.fixed==="left",K=H.fixed==="right";let R="";for(const G of U){const ge=G.querySelectorAll(".vxe-body--row")[z];if(!ge)continue;const re=Array.from(ge.querySelectorAll(".vxe-body--column"));let N=null;if(A&&G.closest(".vxe-table--fixed-left-wrapper")){const J=T.filter(X=>X.fixed==="left").indexOf(H);N=re[J]}else if(K&&G.closest(".vxe-table--fixed-right-wrapper")){const J=T.filter(X=>X.fixed==="right").indexOf(H);N=re[J]}else if(!A&&!K&&G.closest(".vxe-table--body-wrapper")){const se=a.searchForm.showCheckBox?1:0,J=T.filter(Ie=>Ie.fixed==="left").length,X=j-J;N=re[X+se]}if(N&&!N.classList.contains("col--checkbox")&&!N.classList.contains("col--seq")){R=N.innerText||N.textContent||"",R=R.trim(),R=R.replace(/\n/g," ").replace(/\s+/g," ");break}}F.push(R)}),M.push(F.join(" "))});const Q=M.join(`
2
+ `);try{await navigator.clipboard.writeText(Q)}catch(z){console.error("复制失败:",z)}},Te=f=>{!a.searchForm.enableCellCopy&&!l.enableCellCopy||((f.ctrlKey||f.metaKey)&&f.key==="c"?E.selectedCells.length>0&&(f.preventDefault(),f.stopPropagation(),to()):f.key==="Escape"&&de())},Ze=()=>{E.isSelecting=!1},Ge=f=>{const u=h.value;if(!u||!u.$el)return;u.$el.contains(f.target)||de()},oo=f=>{g[w]=f,L()},no=f=>{g[y]=f,g[w]=1,L()};function Je(){const f=h.value.getCheckboxRecords();a.searchForm.selections=f}const Xe=f=>{const u=h.value;if(u){u.toggleCheckboxRow(f);const T=h.value.getCheckboxRecords();a.searchForm.selections=T}};return o({tableRef:h,getList:L,getPrm:V,clearSort:_,calculateTableHeight:x}),(f,u)=>{var z;const T=e.resolveComponent("el-button"),v=e.resolveComponent("el-checkbox"),q=e.resolveComponent("el-text"),U=e.resolveComponent("vxe-column"),M=e.resolveComponent("VxeTable"),Q=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({box:t.searchForm.showShadow})},[t.searchForm.showSearch?(e.openBlock(),e.createBlock(je,{key:0,form:t.searchForm,onReset:Y,onConfirm:u[1]||(u[1]=F=>L()),onVisibleChange:e.unref(x)},{btn:e.withCtx(()=>[u[3]||(u[3]=e.createElementVNode("span",{class:"mgr10"},null,-1)),e.renderSlot(f.$slots,"search-bar-btn",{},void 0,!0),e.createVNode(T,{class:"mgl10",round:"",onClick:u[0]||(u[0]=F=>h.value.openCustom())},{default:e.withCtx(()=>[e.createVNode($e,{name:"Tools"})]),_:1})]),_:3},8,["form","onVisibleChange"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"table-header-left",{},void 0,!0),e.createElementVNode("div",{ref_key:"tableContentRef",ref:d},[e.createVNode(M,e.mergeProps({id:b.value,ref_key:"tableRef",ref:h,loading:t.loading||i.value,data:t.api?c.value:t.data,border:""},Z.value,{height:I.value,onCheckboxChange:Je,onCheckboxAll:Je,onSortChange:(z=Z.value["sort-config"])==null?void 0:z.sortChange}),{default:e.withCtx(()=>[t.searchForm.showCheckBox==null||t.searchForm.showCheckBox?(e.openBlock(),e.createBlock(U,{key:0,type:"checkbox",width:e.unref(r)=="zh_cn"?80:150,title:f.$t("xu-hao"),fixed:"left"},{checkbox:e.withCtx(({rowIndex:F,row:j,checked:H,disabled:A,indeterminate:K})=>[e.createElementVNode("div",zt,[H?(e.openBlock(),e.createBlock(v,{key:0,checked:!0,disabled:A,size:"default",onClick:e.withModifiers(R=>!A&&Xe(j),["stop"])},null,8,["disabled","onClick"])):(e.openBlock(),e.createBlock(v,{key:1,disabled:A,checked:!1,size:"default",onClick:e.withModifiers(R=>!A&&Xe(j),["stop"])},null,8,["disabled","onClick"])),e.createVNode(q,{type:"info",class:"mgl5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(F+1),1)]),_:2},1024)])]),_:1},8,["width","title"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"default",{},void 0,!0)]),_:3},16,["id","loading","data","height","onSortChange"])],512),t.searchForm.showPage?(e.openBlock(),e.createBlock(Q,{key:1,"current-page":g[e.unref(w)],"onUpdate:currentPage":u[2]||(u[2]=F=>g[e.unref(w)]=F),class:"myPagination mgt10",background:"",layout:"total, sizes, prev, pager, next",total:g.total,"page-size":g[e.unref(y)],"page-sizes":t.searchForm.pageSizes||e.unref(l).pageSizes,onCurrentChange:oo,onSizeChange:no},null,8,["current-page","total","page-size","page-sizes"])):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-c022c16d"]]),Nt={__name:"index",props:{sheetsConfig:{type:Object,required:!0},fileName:{type:String,required:!0}},setup(t){const o=t;function n(){Ae(o.fileName,o.sheetsConfig)}return(r,s)=>{const l=e.resolveComponent("el-link");return e.openBlock(),e.createBlock(l,e.mergeProps({type:"primary",underline:"never"},r.$attrs,{onClick:n}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(r.$t("xia-zai-dao-ru-mo-ban")),1)])]),_:3},16)}}},qt={mounted(t,o){o.value&&Ye(t)},updated(t,o){o.value?Ye(t):He(t)},beforeUnmount(t){He(t)}};async function Ye(t){await y();const o=t.querySelector(".el-dialog");if(!o)return;const n=t.querySelector(".el-dialog__header"),r=t.querySelector(".el-overlay");r.style.cssText+="overflow: hidden;",n.style.cursor="move";let s=!1,l={window:{width:0,height:0},dialog:{x:0,y:0,width:0,height:0,marginTop:""},mouse:{x:0,y:0},drag:{x:0,y:0}};n.addEventListener("mousedown",c),document.addEventListener("mousemove",b),document.addEventListener("mouseup",p),window.addEventListener("resize",w);function a(){l.mouse.x-l.drag.x>=l.dialog.x&&(l.drag.x=l.mouse.x-l.dialog.x),l.drag.x-l.mouse.x>=l.window.width-(l.dialog.x+l.dialog.width)&&(l.drag.x=l.mouse.x+l.window.width-l.dialog.x-l.dialog.width),l.mouse.y-l.drag.y>=l.dialog.y&&(l.drag.y=l.mouse.y-l.dialog.y),l.drag.y-l.mouse.y>=l.window.height-(l.dialog.y+l.dialog.height)&&(l.drag.y=l.mouse.y+l.window.height-l.dialog.y-l.dialog.height),i()}function i(){let g=l.drag.y-l.mouse.y+l.dialog.y,h=l.drag.x-l.mouse.x+l.dialog.x;o.style.cssText+=`position: absolute; top: calc(${g}px - ${l.dialog.marginTop}); left: ${h}px;`}function c(g){g.button===0&&(l.window={width:document.body.clientWidth,height:document.body.clientHeight},l.dialog=o.getBoundingClientRect(),l.dialog.marginTop=window.getComputedStyle(o).marginTop,l.mouse={x:g.clientX,y:g.clientY},s=!0)}function b(g){s&&(l.drag={x:g.clientX,y:g.clientY},r.style.userSelect="none",a())}function p(g){r.style.userSelect="auto",s=!1}function w(g){}function y(){return new Promise((g,h)=>{setTimeout(()=>{g()},500)})}t.__mouseDown__=c,t.__mouseUp__=p,t.__mouseMove__=b,t.__sizeChange__=w}function He(t){document.removeEventListener("mousedown",t.__mouseDown__),document.removeEventListener("mousemove",t.__mouseMove__),document.removeEventListener("mouseup",t.__mouseUp__),window.removeEventListener("resize",t.__sizeChange__)}const go="",At={key:0,class:"drawer-btn"},Pt={key:1},jt={__name:"index",props:{layer:{type:Object,default:()=>({show:!1,type:"layer",title:"",showButton:!1}),required:!0},loading:{type:Boolean,default:!1}},emits:["confirm"],setup(t,{emit:o}){const n=t,r=o,{t:s}=ee.useI18n(),l=ne.debounce(()=>{r("confirm")},300);async function a(){n.layer.type=="drawer"?n.layer.onClose?n.layer.onClose():await W.ElMessageBox.confirm(s("que-ding-guan-bi-ma"),{confirmButtonText:s("que-ding"),cancelButtonText:s("qu-xiao"),type:"warning"}).catch(()=>{})=="confirm"&&(n.layer.show=!1):n.layer.show=!1}return(i,c)=>{const b=e.resolveComponent("el-button"),p=e.resolveComponent("el-drawer"),w=e.resolveComponent("el-dialog");return t.layer.type?(e.openBlock(),e.createBlock(p,{key:0,modelValue:t.layer.show,"onUpdate:modelValue":c[0]||(c[0]=y=>t.layer.show=y),size:t.layer.width||"100%",title:t.layer.title,direction:"rtl","append-to-body":"","before-close":a,class:"drawer-content"},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default"),c[2]||(c[2]=e.createElementVNode("p",{class:"mgt50"},null,-1)),t.layer.showButton?(e.openBlock(),e.createElementBlock("div",At,[e.renderSlot(i.$slots,"btn",{},()=>[e.createVNode(b,{onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("qu-xiao")),1)]),_:1}),e.createVNode(b,{type:"primary",loading:t.loading,onClick:e.unref(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("ti-jiao")),1)]),_:1},8,["loading","onClick"])])])):e.createCommentVNode("",!0)]),_:3},8,["modelValue","size","title"])):e.withDirectives((e.openBlock(),e.createElementBlock("div",Pt,[e.createVNode(w,{"close-on-click-modal":!1,modelValue:t.layer.show,"onUpdate:modelValue":c[1]||(c[1]=y=>t.layer.show=y),title:t.layer.title,width:t.layer.width||500,center:""},e.createSlots({default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:2},[t.layer.showButton?{name:"footer",fn:e.withCtx(()=>[e.renderSlot(i.$slots,"btn",{},()=>[e.createVNode(b,{onClick:a},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("qu-xiao")),1)]),_:1}),e.createVNode(b,{type:"primary",onClick:e.unref(l)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.$t("ti-jiao")),1)]),_:1},8,["onClick"])])]),key:"0"}:void 0]),1032,["modelValue","title","width"])])),[[e.unref(qt),t.layer.show]])}}};function Rt(t,o={}){const n=le(),r={inForm:!0,required:!0,...o},s={phone:/^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/,password:/(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/,email:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/}[t],{inForm:l,value:a,required:i,msg:c=n("validate.invalidInput")}=r;return l?function(b,p,w){if(i){s.test(p)?w():w(new Error(c));return}p&&!s.test(p)?w(new Error(c)):w()}:s.test(a)}class Ut{constructor(o={}){this.config={clientCode:o.clientCode||"one-portal",casServerUrl:`https://one-portal${o.isTest?"-test":""}.joy-group.com/api`,casPortalUrl:`https://one-portal${o.isTest?"-test":""}.joy-group.com`,serviceUrl:o.serviceUrl||window.location.origin+"/cas/callback",tokenKey:o.tokenKey||"one_portal_token",userKey:o.userKey||"one_portal_user",debug:o.debug||!1,autoLogin:o.autoLogin!==!1,loginCallback:o.loginCallback||null,logoutCallback:o.logoutCallback||null,errorCallback:o.errorCallback||null},this.token=null,this.user=null,this.init()}init(){this.log("OnePortal CAS SDK 初始化中..."),this.loadFromStorage();const n=new URLSearchParams(window.location.search).get("ticket");this.isLoggedIn()&&this.config.loginCallback?this.config.loginCallback(this.user,this.token):n?(this.log("检测到ST票据:",n),this.validateTicket(n)):this.config.autoLogin&&!this.isLoggedIn()&&(this.log("用户未登录,准备跳转到CAS登录页面"),this.login())}loadFromStorage(){try{this.token=localStorage.getItem(this.config.tokenKey);const o=localStorage.getItem(this.config.userKey);o&&(this.user=JSON.parse(o)),this.log("从本地存储加载数据:",{token:!!this.token,user:!!this.user})}catch(o){this.log("加载本地存储数据失败:",o)}}saveToStorage(){try{this.token&&localStorage.setItem(this.config.tokenKey,this.token),this.user&&localStorage.setItem(this.config.userKey,JSON.stringify(this.user)),this.log("数据已保存到本地存储")}catch(o){this.log("保存到本地存储失败:",o)}}clearStorage(){try{localStorage.removeItem(this.config.tokenKey),localStorage.removeItem(this.config.userKey),this.log("本地存储已清除")}catch(o){this.log("清除本地存储失败:",o)}}isLoggedIn(){return!!(this.token&&this.user)}getUser(){return this.user}getToken(){return this.token}login(){const o=`${this.config.casPortalUrl}?appCode=${this.config.clientCode}&redirectUrl=${encodeURIComponent(this.config.serviceUrl)}`;this.log("跳转到CAS登录页面:",o),window.location.href=o}async validateTicket(o){try{this.log("验证ST票据:",o);const n=await fetch(`${this.config.casServerUrl}/auth/validateST?ticket=${o}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);const r=await n.json();if(r.success&&r.data)return this.token=r.data.token,this.user=r.data.user,this.saveToStorage(),this.clearTicketFromUrl(),this.log("ST票据验证成功,用户登录成功:",this.user),this.config.loginCallback&&this.config.loginCallback(this.user,this.token),!0;throw new Error(r.message||"ST票据验证失败")}catch(n){return this.log("ST票据验证失败:",n),this.handleError(n),!1}}clearTicketFromUrl(){const o=new URL(window.location);o.searchParams.delete("ticket"),window.history.replaceState({},document.title,o.toString())}async logout(o=!0){try{if(this.log("用户登出"),this.token)try{await fetch(`${this.config.casServerUrl}/auth/logout`,{method:"POST",headers:{AppId:this.config.clientCode,Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"}})}catch(n){this.log("调用服务端登出接口失败:",n)}this.token=null,this.user=null,this.clearStorage(),this.config.logoutCallback&&this.config.logoutCallback(),o&&this.login()}catch(n){this.log("登出失败:",n),this.handleError(n)}}async request(o,n={}){const r={headers:{"Content-Type":"application/json",...n.headers},...n};r.headers.appId=this.config.clientCode,this.token&&(r.headers.Authorization=`Bearer ${this.token}`);try{const s=await fetch(o,r);return s.status===401?(this.log("Token已过期,需要重新登录"),this.logout(),null):s}catch(s){throw this.log("请求失败:",s),s}}async fetchUserInfo(){try{const o=await this.request(`${this.config.casServerUrl}/auth/user`);if(o&&o.ok){const n=await o.json();if(n.success&&n.data)return this.user=n.data,this.saveToStorage(),this.user}return null}catch(o){return this.log("获取用户信息失败:",o),null}}async refreshToken(){this.log("Token刷新功能暂未实现")}handleError(o){this.log("发生错误:",o),this.config.errorCallback&&this.config.errorCallback(o)}log(...o){this.config.debug&&console.log("[OnePortal CAS SDK]",...o)}checkLoginStatus(){return!this.isLoggedIn()&&this.config.autoLogin?(this.login(),!1):this.isLoggedIn()}setConfig(o,n){this.config[o]=n}getConfig(o){return this.config[o]}}function Yt(t,o={}){const r=Object.assign({manual:!1,log:!1,params:null,format:null},o),{manual:s,log:l,params:a={},cb:i,format:c}=r,b=e.ref([]),p=e.ref(!1),w=y=>{const g=y||a;p.value=!0,t(g).then(h=>{const{code:d,data:C,msg:x}=h;if(i){const{records:S,rows:k}=C||{},I=S||k?S||k:C;b.value=Ee(I,c),i(h)}if(C){if(C.records!=null||C.rows!=null){const{records:S,rows:k,total:I=0}=C||{};g&&g.total!=null&&(a.total=parseInt(I)),b.value=Ee(S||k||[],c)}else b.value=Ee(C,c);l&&console.log("useRequest-res",b.value)}}).catch(h=>{i&&(console.log("useRequestErr",h),i({code:500}))}).finally(()=>{p.value=!1})};return s||w(),[p,b,w]}function Ht(t){const o=e.ref(t),n=e.ref(""),r=e.ref("");return e.watch(o,s=>{const l=s||["",""];n.value=l[0],r.value=l[1]}),[o,n,r]}function Kt(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function Ee(t,o){if(!o)return t;if(t instanceof Array)return t.map(r=>{let s={};return o.forEach(l=>s[l]=r[l]),s});let n={};return o.forEach(r=>n[r]=t[r]),n}function Wt(t,o=[]){const{locale:n}=ee.useI18n(),r=e.ref(t());return e.watch([n,...o],()=>{r.value=t()},{immediate:!0}),r}function Zt(t,o="zh_cn",n="en_us"){if(!t)return"-";const r={en_us:n,zh_cn:o},l=be().global.locale.value;return t[r[l]]||t[o]||"-"}function Gt(t,o){let n=te.mapState;return typeof t=="string"&&t.length>0&&(n=te.createNamespacedHelpers(t).mapState),Ke(o,n)}function Jt(t,o){let n=te.mapGetters;return typeof t=="string"&&t.length>0&&(n=te.createNamespacedHelpers(t).mapGetters),Ke(o,n)}function Xt(t,o){let n=te.mapActions;return typeof t=="string"&&t.length>0&&(n=te.createNamespacedHelpers(t).mapActions),Qt(o,n)}function Ke(t,o){const n=te.useStore(),r=o(t),s={};return Object.keys(r).forEach(l=>{const a=r[l].bind({$store:n});s[l]=e.computed(a)}),s}function Qt(t,o){const n=te.useStore(),r=o(t),s={};return Object.keys(r).forEach(l=>{s[l]=r[l].bind({$store:n})}),s}function we(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!e.isVNode(t)}function eo(){fe.VxeUI.renderer.add("Enum",{renderTableDefault(t,o){let n;if([null,void 0].includes(o.row[o.column.field]))return"-";const r=o.row[o.column.field];if(t.type=="tag"){let s;return e.createVNode(e.resolveComponent("el-text"),{type:t.enum.getTag(r)},we(s=t.enum.getName(r))?s:{default:()=>[s]})}return e.createVNode(e.resolveComponent("el-text"),null,we(n=t.enum.getName(r))?n:{default:()=>[n]})}}),fe.VxeUI.renderer.add("InputNumber",{renderTableDefault(t,o){return e.createVNode(W.ElInputNumber,e.mergeProps({modelValue:o.row[o.column.field],"onUpdate:modelValue":n=>o.row[o.column.field]=n},t.props,{"step-strictly":!0,"value-on-clear":0}),null)}}),fe.VxeUI.renderer.add("TrueFalse",{renderTableDefault(t,o){const{locale:n}=ee.useI18n();let r=n.value=="zh_cn";return e.createVNode(W.ElText,{type:o.row[o.column.field]?"success":"danger"},{default:()=>[o.row[o.column.field]?r?"是":"YES":r?"否":"NO"]})}}),fe.VxeUI.renderer.add("I18n",{renderTableDefault(t,o){const{locale:n}=ee.useI18n();let r=n.value=="zh_cn"?o.column.field:t.fieldEn;return o.row[r]||o.row[o.column.field]}}),fe.VxeUI.renderer.add("Link",{renderTableDefault(t,o){let n=o.column.field;const r=Fe.useRouter(),{multiple:s,to:l,openType:a="system"}=t,i=o.row[n];function c(b,p){a=="blank"?window.open(b):r.push({path:b,query:{[n]:p}})}if(s){const b=(i==null?void 0:i.split(","))||[];return b.map((p,w)=>e.createVNode("span",null,[e.createVNode(W.ElLink,{underline:"never",type:"primary",onclick:()=>c(a=="stystem"?l:p,p)},we(p)?p:{default:()=>[p]}),w<b.length-1?",":""]))}return e.createVNode(W.ElLink,{underline:"never",type:"primary",onclick:()=>c(a=="stystem"?l:i,i)},we(i)?i:{default:()=>[i]})}})}m.CmpDictionary=Pe,m.CmpIcon=$e,m.ConfrimButton=Et,m.DownExcelTemp=Nt,m.ImportButton=It,m.LayOutForm=Qe,m.Layer=jt,m.ListPage=Ot,m.OnePortalCasSDK=Ut,m.SearchBar=je,m.StatusMap=Se,m._toRaw=gt,m._typeOf=Kt,m.arrToStatusMap=yt,m.arrayToTree=pt,m.checkFileSize=wt,m.creatValidator=Rt,m.createImportFields=kt,m.createListPageId=xt,m.en_us=Ce,m.exportExcel=at,m.exportExcelMuilti=Ae,m.getI18n=be,m.getI18nT=le,m.getListPageConfig=Ue,m.getLocaleValue=Zt,m.getValueBykey=_t,m.importExcel=lt,m.importExcelMuilti=qe,m.messages=ze,m.registerVxeRenderers=eo,m.resetListPageConfig=Mt,m.setListPageConfig=Bt,m.setupI18n=Oe,m.sleep=mt,m.stringToArray=_e,m.stripHtmlTags=Ct,m.unicode2Str=bt,m.useActions=Xt,m.useDatePicker=Ht,m.useGetters=Jt,m.useI18nReState=Wt,m.useRequest=Yt,m.useState=Gt,m.zh_cn=ye,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.47",
3
+ "version": "0.2.48",
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",