joy-admin-components 0.2.12 → 0.2.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,194 +1,194 @@
1
- import { ElForm as bt, ElRow as yt, ElCol as Ct, ElInputNumber as xt, ElText as wt, ElLink as Ze } from "element-plus";
2
- import { defineComponent as Qe, ref as R, onMounted as Xe, h as Le, mergeModels as Ge, useAttrs as kt, useModel as _t, computed as ne, watch as qe, resolveComponent as M, unref as G, openBlock as D, createBlock as Y, mergeProps as he, createSlots as St, withCtx as U, createElementVNode as oe, toDisplayString as le, renderSlot as re, createVNode as P, createTextVNode as se, createCommentVNode as fe, createElementBlock as de, Fragment as De, renderList as et, withModifiers as ze, nextTick as _e, resolveDynamicComponent as tt, withKeys as $t, normalizeStyle as It, normalizeClass as Oe, reactive as ke, onUpdated as Ft, onUnmounted as Lt, isVNode as Tt } from "vue";
3
- import { saveAs as Et } from "file-saver";
4
- import nt from "exceljs";
5
- import Se from "dayjs";
6
- import { createI18n as Dt, useI18n as ve } from "vue-i18n";
7
- import { debounce as ot, cloneDeep as lt, isArray as We } from "lodash";
8
- import { useRoute as zt, useRouter as Ot } from "vue-router";
9
- import { createNamespacedHelpers as je, useStore as at, mapState as Vt, mapGetters as Mt, mapActions as At } from "vuex";
10
- import { VxeUI as Ce } from "vxe-pc-ui";
11
- const $n = Qe({
1
+ import { ElForm as _t, ElRow as $t, ElCol as St, ElMessageBox as Et, ElInputNumber as It, ElText as Lt, ElLink as Je } from "element-plus";
2
+ import { defineComponent as ot, ref as R, onMounted as lt, h as Te, mergeModels as Xe, useAttrs as Ft, useModel as Tt, computed as se, watch as Pe, resolveComponent as z, unref as H, openBlock as L, createBlock as B, mergeProps as he, createSlots as at, withCtx as D, createElementVNode as ae, toDisplayString as J, renderSlot as X, createVNode as q, createTextVNode as Q, createCommentVNode as ce, createElementBlock as re, Fragment as Oe, renderList as st, withModifiers as Me, nextTick as Se, resolveDynamicComponent as rt, withKeys as Dt, normalizeStyle as zt, normalizeClass as Ve, reactive as $e, onUpdated as Ot, onUnmounted as Mt, withDirectives as Vt, isVNode as qt } from "vue";
3
+ import { saveAs as it } from "file-saver";
4
+ import Ee from "exceljs";
5
+ import ke from "dayjs";
6
+ import { createI18n as At, useI18n as me } from "vue-i18n";
7
+ import { debounce as Re, cloneDeep as ct, isArray as Qe } from "lodash";
8
+ import { useRoute as jt, useRouter as Ut } from "vue-router";
9
+ import { createNamespacedHelpers as Be, useStore as ut, mapState as Pt, mapGetters as Rt, mapActions as Bt } from "vuex";
10
+ import { VxeUI as xe } from "vxe-pc-ui";
11
+ const Vn = ot({
12
12
  name: "LayOutForm",
13
- setup(n, { slots: e, attrs: t, emit: o }) {
14
- const a = R(null), r = () => e.default ? e.default().filter((u) => u.type !== Symbol.for("v-cmt")).map((u) => u.type === Symbol.for("v-fgt") ? u.children : u).flat().map(
15
- (u) => {
16
- var d;
17
- return Le(
18
- Ct,
19
- { span: ((d = u.props) == null ? void 0 : d.span) || 24 },
13
+ setup(t, { slots: e, attrs: n, emit: a }) {
14
+ const s = R(null), o = () => e.default ? e.default().filter((i) => i.type !== Symbol.for("v-cmt")).map((i) => i.type === Symbol.for("v-fgt") ? i.children : i).flat().map(
15
+ (i) => {
16
+ var r;
17
+ return Te(
18
+ St,
19
+ { span: ((r = i.props) == null ? void 0 : r.span) || 24 },
20
20
  {
21
- default: () => u
21
+ default: () => i
22
22
  }
23
23
  );
24
24
  }
25
25
  ) : null;
26
- Xe(() => {
27
- o("ref", a.value);
26
+ lt(() => {
27
+ a("ref", s.value);
28
28
  });
29
29
  function l() {
30
- return Le(
31
- bt,
32
- { ...t, ref: a },
33
- () => Le(yt, { gutter: t.gutter ?? 20 }, { default: () => r() })
30
+ return Te(
31
+ _t,
32
+ { ...n, ref: s },
33
+ () => Te($t, { gutter: n.gutter ?? 20 }, { default: () => o() })
34
34
  );
35
35
  }
36
36
  return l;
37
37
  }
38
38
  });
39
- var rt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
40
- function st(n) {
41
- return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
39
+ var dt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
40
+ function ft(t) {
41
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
42
42
  }
43
- var it = { exports: {} };
44
- (function(n, e) {
45
- (function(t, o) {
46
- n.exports = o();
47
- })(rt, function() {
48
- var t = "minute", o = /[+-]\d\d(?::?\d\d)?/g, a = /([+-]|\d\d)/g;
49
- return function(r, l, u) {
50
- var d = l.prototype;
51
- u.utc = function(f) {
52
- var h = { date: f, utc: !0, args: arguments };
43
+ var ht = { exports: {} };
44
+ (function(t, e) {
45
+ (function(n, a) {
46
+ t.exports = a();
47
+ })(dt, function() {
48
+ var n = "minute", a = /[+-]\d\d(?::?\d\d)?/g, s = /([+-]|\d\d)/g;
49
+ return function(o, l, i) {
50
+ var r = l.prototype;
51
+ i.utc = function(u) {
52
+ var h = { date: u, utc: !0, args: arguments };
53
53
  return new l(h);
54
- }, d.utc = function(f) {
55
- var h = u(this.toDate(), { locale: this.$L, utc: !0 });
56
- return f ? h.add(this.utcOffset(), t) : h;
57
- }, d.local = function() {
58
- return u(this.toDate(), { locale: this.$L, utc: !1 });
54
+ }, r.utc = function(u) {
55
+ var h = i(this.toDate(), { locale: this.$L, utc: !0 });
56
+ return u ? h.add(this.utcOffset(), n) : h;
57
+ }, r.local = function() {
58
+ return i(this.toDate(), { locale: this.$L, utc: !1 });
59
59
  };
60
- var k = d.parse;
61
- d.parse = function(f) {
62
- f.utc && (this.$u = !0), this.$utils().u(f.$offset) || (this.$offset = f.$offset), k.call(this, f);
60
+ var y = r.parse;
61
+ r.parse = function(u) {
62
+ u.utc && (this.$u = !0), this.$utils().u(u.$offset) || (this.$offset = u.$offset), y.call(this, u);
63
63
  };
64
- var x = d.init;
65
- d.init = function() {
64
+ var b = r.init;
65
+ r.init = function() {
66
66
  if (this.$u) {
67
- var f = this.$d;
68
- this.$y = f.getUTCFullYear(), this.$M = f.getUTCMonth(), this.$D = f.getUTCDate(), this.$W = f.getUTCDay(), this.$H = f.getUTCHours(), this.$m = f.getUTCMinutes(), this.$s = f.getUTCSeconds(), this.$ms = f.getUTCMilliseconds();
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();
69
69
  } else
70
- x.call(this);
70
+ b.call(this);
71
71
  };
72
- var C = d.utcOffset;
73
- d.utcOffset = function(f, h) {
74
- var _ = this.$utils().u;
75
- if (_(f))
76
- return this.$u ? 0 : _(this.$offset) ? C.call(this) : this.$offset;
77
- if (typeof f == "string" && (f = function(I) {
78
- I === void 0 && (I = "");
79
- var W = I.match(o);
80
- if (!W)
72
+ var w = r.utcOffset;
73
+ r.utcOffset = function(u, h) {
74
+ var k = this.$utils().u;
75
+ if (k(u))
76
+ return this.$u ? 0 : k(this.$offset) ? w.call(this) : this.$offset;
77
+ if (typeof u == "string" && (u = function(E) {
78
+ E === void 0 && (E = "");
79
+ var Y = E.match(a);
80
+ if (!Y)
81
81
  return null;
82
- var V = ("" + W[0]).match(a) || ["-", 0, 0], i = V[0], p = 60 * +V[1] + +V[2];
83
- return p === 0 ? 0 : i === "+" ? p : -p;
84
- }(f), f === null))
82
+ var F = ("" + Y[0]).match(s) || ["-", 0, 0], d = F[0], x = 60 * +F[1] + +F[2];
83
+ return x === 0 ? 0 : d === "+" ? x : -x;
84
+ }(u), u === null))
85
85
  return this;
86
- var w = Math.abs(f) <= 16 ? 60 * f : f;
87
- if (w === 0)
86
+ var _ = Math.abs(u) <= 16 ? 60 * u : u;
87
+ if (_ === 0)
88
88
  return this.utc(h);
89
- var S = this.clone();
89
+ var C = this.clone();
90
90
  if (h)
91
- return S.$offset = w, S.$u = !1, S;
92
- var z = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
93
- return (S = this.local().add(w + z, t)).$offset = w, S.$x.$localOffset = z, S;
91
+ return C.$offset = _, C.$u = !1, C;
92
+ var S = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
93
+ return (C = this.local().add(_ + S, n)).$offset = _, C.$x.$localOffset = S, C;
94
94
  };
95
- var v = d.format;
96
- d.format = function(f) {
97
- var h = f || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
98
- return v.call(this, h);
99
- }, d.valueOf = function() {
100
- var f = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
101
- return this.$d.valueOf() - 6e4 * f;
102
- }, d.isUTC = function() {
95
+ var p = r.format;
96
+ r.format = function(u) {
97
+ var h = u || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
98
+ return p.call(this, h);
99
+ }, r.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;
102
+ }, r.isUTC = function() {
103
103
  return !!this.$u;
104
- }, d.toISOString = function() {
104
+ }, r.toISOString = function() {
105
105
  return this.toDate().toISOString();
106
- }, d.toString = function() {
106
+ }, r.toString = function() {
107
107
  return this.toDate().toUTCString();
108
108
  };
109
- var b = d.toDate;
110
- d.toDate = function(f) {
111
- return f === "s" && this.$offset ? u(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : b.call(this);
109
+ var g = r.toDate;
110
+ r.toDate = function(u) {
111
+ return u === "s" && this.$offset ? i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : g.call(this);
112
112
  };
113
- var g = d.diff;
114
- d.diff = function(f, h, _) {
115
- if (f && this.$u === f.$u)
116
- return g.call(this, f, h, _);
117
- var w = this.local(), S = u(f).local();
118
- return g.call(w, S, h, _);
113
+ var m = r.diff;
114
+ r.diff = function(u, h, k) {
115
+ if (u && this.$u === u.$u)
116
+ return m.call(this, u, h, k);
117
+ var _ = this.local(), C = i(u).local();
118
+ return m.call(_, C, h, k);
119
119
  };
120
120
  };
121
121
  });
122
- })(it);
123
- var qt = it.exports;
124
- const jt = /* @__PURE__ */ st(qt);
125
- var ct = { exports: {} };
126
- (function(n, e) {
127
- (function(t, o) {
128
- n.exports = o();
129
- })(rt, function() {
130
- var t = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, o = {};
131
- return function(a, r, l) {
132
- var u, d = function(v, b, g) {
133
- g === void 0 && (g = {});
134
- var f = new Date(v), h = function(_, w) {
135
- w === void 0 && (w = {});
136
- var S = w.timeZoneName || "short", z = _ + "|" + S, I = o[z];
137
- return I || (I = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: _, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: S }), o[z] = I), I;
138
- }(b, g);
139
- return h.formatToParts(f);
140
- }, k = function(v, b) {
141
- for (var g = d(v, b), f = [], h = 0; h < g.length; h += 1) {
142
- var _ = g[h], w = _.type, S = _.value, z = t[w];
143
- z >= 0 && (f[z] = parseInt(S, 10));
122
+ })(ht);
123
+ var Yt = ht.exports;
124
+ const Kt = /* @__PURE__ */ ft(Yt);
125
+ var mt = { exports: {} };
126
+ (function(t, e) {
127
+ (function(n, a) {
128
+ t.exports = a();
129
+ })(dt, function() {
130
+ var n = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, a = {};
131
+ return function(s, o, l) {
132
+ var i, r = function(p, g, m) {
133
+ m === void 0 && (m = {});
134
+ var u = new Date(p), h = function(k, _) {
135
+ _ === void 0 && (_ = {});
136
+ var C = _.timeZoneName || "short", S = k + "|" + C, E = a[S];
137
+ return E || (E = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: k, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: C }), a[S] = E), E;
138
+ }(g, m);
139
+ return h.formatToParts(u);
140
+ }, y = function(p, g) {
141
+ for (var m = r(p, g), u = [], h = 0; h < m.length; h += 1) {
142
+ var k = m[h], _ = k.type, C = k.value, S = n[_];
143
+ S >= 0 && (u[S] = parseInt(C, 10));
144
144
  }
145
- var I = f[3], W = I === 24 ? 0 : I, V = f[0] + "-" + f[1] + "-" + f[2] + " " + W + ":" + f[4] + ":" + f[5] + ":000", i = +v;
146
- return (l.utc(V).valueOf() - (i -= i % 1e3)) / 6e4;
147
- }, x = r.prototype;
148
- x.tz = function(v, b) {
149
- v === void 0 && (v = u);
150
- var g, f = this.utcOffset(), h = this.toDate(), _ = h.toLocaleString("en-US", { timeZone: v }), w = Math.round((h - new Date(_)) / 1e3 / 60), S = 15 * -Math.round(h.getTimezoneOffset() / 15) - w;
151
- if (!Number(S))
152
- g = this.utcOffset(0, b);
153
- else if (g = l(_, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(S, !0), b) {
154
- var z = g.utcOffset();
155
- g = g.add(f - z, "minute");
145
+ var E = u[3], Y = E === 24 ? 0 : E, F = u[0] + "-" + u[1] + "-" + u[2] + " " + Y + ":" + u[4] + ":" + u[5] + ":000", d = +p;
146
+ return (l.utc(F).valueOf() - (d -= d % 1e3)) / 6e4;
147
+ }, b = o.prototype;
148
+ b.tz = function(p, g) {
149
+ p === void 0 && (p = i);
150
+ var m, u = this.utcOffset(), h = this.toDate(), k = h.toLocaleString("en-US", { timeZone: p }), _ = Math.round((h - new Date(k)) / 1e3 / 60), C = 15 * -Math.round(h.getTimezoneOffset() / 15) - _;
151
+ if (!Number(C))
152
+ m = this.utcOffset(0, g);
153
+ else if (m = l(k, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(C, !0), g) {
154
+ var S = m.utcOffset();
155
+ m = m.add(u - S, "minute");
156
156
  }
157
- return g.$x.$timezone = v, g;
158
- }, x.offsetName = function(v) {
159
- var b = this.$x.$timezone || l.tz.guess(), g = d(this.valueOf(), b, { timeZoneName: v }).find(function(f) {
160
- return f.type.toLowerCase() === "timezonename";
157
+ return m.$x.$timezone = p, m;
158
+ }, b.offsetName = function(p) {
159
+ var g = this.$x.$timezone || l.tz.guess(), m = r(this.valueOf(), g, { timeZoneName: p }).find(function(u) {
160
+ return u.type.toLowerCase() === "timezonename";
161
161
  });
162
- return g && g.value;
162
+ return m && m.value;
163
163
  };
164
- var C = x.startOf;
165
- x.startOf = function(v, b) {
164
+ var w = b.startOf;
165
+ b.startOf = function(p, g) {
166
166
  if (!this.$x || !this.$x.$timezone)
167
- return C.call(this, v, b);
168
- var g = l(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
169
- return C.call(g, v, b).tz(this.$x.$timezone, !0);
170
- }, l.tz = function(v, b, g) {
171
- var f = g && b, h = g || b || u, _ = k(+l(), h);
172
- if (typeof v != "string")
173
- return l(v).tz(h);
174
- var w = function(W, V, i) {
175
- var p = W - 60 * V * 1e3, L = k(p, i);
176
- if (V === L)
177
- return [p, V];
178
- var O = k(p -= 60 * (L - V) * 1e3, i);
179
- return L === O ? [p, L] : [W - 60 * Math.min(L, O) * 1e3, Math.max(L, O)];
180
- }(l.utc(v, f).valueOf(), _, h), S = w[0], z = w[1], I = l(S).utcOffset(z);
181
- return I.$x.$timezone = h, I;
167
+ return w.call(this, p, g);
168
+ var m = l(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
169
+ return w.call(m, p, g).tz(this.$x.$timezone, !0);
170
+ }, l.tz = function(p, g, m) {
171
+ var u = m && g, h = m || g || i, k = y(+l(), h);
172
+ if (typeof p != "string")
173
+ return l(p).tz(h);
174
+ var _ = function(Y, F, d) {
175
+ var x = Y - 60 * F * 1e3, O = y(x, d);
176
+ if (F === O)
177
+ return [x, F];
178
+ var A = y(x -= 60 * (O - F) * 1e3, d);
179
+ return O === A ? [x, O] : [Y - 60 * Math.min(O, A) * 1e3, Math.max(O, A)];
180
+ }(l.utc(p, u).valueOf(), k, h), C = _[0], S = _[1], E = l(C).utcOffset(S);
181
+ return E.$x.$timezone = h, E;
182
182
  }, l.tz.guess = function() {
183
183
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
184
- }, l.tz.setDefault = function(v) {
185
- u = v;
184
+ }, l.tz.setDefault = function(p) {
185
+ i = p;
186
186
  };
187
187
  };
188
188
  });
189
- })(ct);
190
- var Pt = ct.exports;
191
- const Ut = /* @__PURE__ */ st(Pt), Ve = {
189
+ })(mt);
190
+ var Ht = mt.exports;
191
+ const Nt = /* @__PURE__ */ ft(Ht), qe = {
192
192
  // 组件通用文本
193
193
  "dao-ru": "导入",
194
194
  "quan-xuan": "全选",
@@ -206,6 +206,7 @@ const Ut = /* @__PURE__ */ st(Pt), Ve = {
206
206
  "ti-jiao": "提交",
207
207
  "que-ding": "确定",
208
208
  "que-ding-guan-bi-ma": "确定关闭吗",
209
+ "xia-zai-dao-ru-mo-ban": "下载导入模板",
209
210
  // Excel 工具相关
210
211
  excel: {
211
212
  fieldsMappingRequired: "请输入列字段映射",
@@ -222,7 +223,7 @@ const Ut = /* @__PURE__ */ st(Pt), Ve = {
222
223
  tools: {
223
224
  keysLengthError: "keys 长度必须大于2 默认前两位为 label value"
224
225
  }
225
- }, Me = {
226
+ }, Ae = {
226
227
  // Common component text
227
228
  "dao-ru": "Import",
228
229
  "quan-xuan": "Select All",
@@ -240,6 +241,7 @@ const Ut = /* @__PURE__ */ st(Pt), Ve = {
240
241
  "ti-jiao": "Submit",
241
242
  "que-ding": "Confirm",
242
243
  "que-ding-guan-bi-ma": "Are you sure to close?",
244
+ "xia-zai-dao-ru-mo-ban": "Download Import Template",
243
245
  // Excel utilities
244
246
  excel: {
245
247
  fieldsMappingRequired: "Please enter column field mapping",
@@ -256,192 +258,292 @@ const Ut = /* @__PURE__ */ st(Pt), Ve = {
256
258
  tools: {
257
259
  keysLengthError: "Keys length must be greater than 2, default first two are label and value"
258
260
  }
259
- }, Rt = {
260
- zh_cn: Ve,
261
- en_us: Me
261
+ }, Wt = {
262
+ zh_cn: qe,
263
+ en_us: Ae
262
264
  };
263
- let pe = null;
264
- function Bt(n = null) {
265
- if (n) {
266
- const { global: e } = n;
267
- return e.messages.value.zh_cn ? e.mergeLocaleMessage("zh_cn", Ve) : e.setLocaleMessage("zh_cn", Ve), e.messages.value.en_us ? e.mergeLocaleMessage("en_us", Me) : e.setLocaleMessage("en_us", Me), pe = n, n;
265
+ let ye = null;
266
+ function Zt(t = null) {
267
+ if (t) {
268
+ const { global: e } = t;
269
+ return e.messages.value.zh_cn ? e.mergeLocaleMessage("zh_cn", qe) : e.setLocaleMessage("zh_cn", qe), e.messages.value.en_us ? e.mergeLocaleMessage("en_us", Ae) : e.setLocaleMessage("en_us", Ae), ye = t, t;
268
270
  }
269
- return pe || (pe = Dt({
271
+ return ye || (ye = At({
270
272
  legacy: !1,
271
273
  locale: "zh_cn",
272
274
  fallbackLocale: "zh_cn",
273
- messages: Rt
274
- })), pe;
275
+ messages: Wt
276
+ })), ye;
275
277
  }
276
- function Pe() {
277
- return pe || Bt();
278
+ function Ye() {
279
+ return ye || Zt();
278
280
  }
279
- function Ue() {
280
- return Pe().global.t;
281
+ function ve() {
282
+ return Ye().global.t;
281
283
  }
282
- Se.extend(jt);
283
- Se.extend(Ut);
284
- async function In(n, e) {
285
- const { fields: t, range: o = 1 } = e;
286
- if (!t) {
287
- const l = Ue();
284
+ ke.extend(Kt);
285
+ ke.extend(Nt);
286
+ async function qn(t, e) {
287
+ const { fields: n, range: a = 1 } = e;
288
+ if (!n) {
289
+ const l = ve();
288
290
  throw new Error(l("excel.fieldsMappingRequired"));
289
291
  }
290
- let a = new nt.Workbook();
291
- await a.xlsx.load(n);
292
- const r = {};
293
- return a.eachSheet(function(l, u) {
294
- const d = [];
295
- l.eachRow(function(k, x) {
296
- if (x > o) {
297
- let C = {}, v = !0;
298
- Object.keys(t).forEach((b) => {
299
- const g = k.getCell(t[b]).value;
300
- C[b] = g, g && (v = !1);
301
- }), v || d.push(C);
292
+ let s = new Ee.Workbook();
293
+ await s.xlsx.load(t);
294
+ const o = {};
295
+ return s.eachSheet(function(l, i) {
296
+ const r = [];
297
+ l.eachRow(function(y, b) {
298
+ if (b > a) {
299
+ let w = {}, p = !0;
300
+ Object.keys(n).forEach((g) => {
301
+ const m = y.getCell(n[g]).value;
302
+ w[g] = m, m && (p = !1);
303
+ }), p || r.push(w);
302
304
  }
303
- }), r[l._name] = d;
304
- }), a = null, r;
305
+ }), o[l._name] = r;
306
+ }), s = null, o;
305
307
  }
306
- const Yt = {
308
+ const gt = {
307
309
  columnWidth: 30
308
310
  };
309
- async function Kt(n, e, t = [], o = {}) {
310
- if (!n || !e)
311
+ async function An(t, e, n = [], a = {}) {
312
+ if (!t || !e)
311
313
  return;
312
- const { columnStyle: a } = o, { columnWidth: r } = Yt;
313
- e.forEach((d) => {
314
- d.width = d.width ? d.width : r;
314
+ const { columnStyle: s } = a, { columnWidth: o } = gt;
315
+ e.forEach((r) => {
316
+ r.width = r.width ? r.width : o;
315
317
  });
316
- const { workbook: l, worksheet: u } = Ht();
317
- u.columns = e, u.addRows(t), a && await Nt(l, u, a);
318
+ const { workbook: l, worksheet: i } = Gt();
319
+ i.columns = e, i.addRows(n), s && await Jt(l, i, s);
318
320
  try {
319
- const d = await l.xlsx.writeBuffer(), k = new File([d], n, {
321
+ const r = await l.xlsx.writeBuffer(), y = new File([r], t, {
320
322
  type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
321
323
  });
322
- Et(k);
323
- } catch (d) {
324
- console.log(d);
324
+ it(y);
325
+ } catch (r) {
326
+ console.log(r);
325
327
  }
326
328
  }
327
- function Ht() {
328
- const n = new nt.Workbook();
329
- n.creator = "distributor System", n.lastModifiedBy = "distributor System", n.created = /* @__PURE__ */ new Date(), n.modified = /* @__PURE__ */ new Date(), n.lastPrinted = /* @__PURE__ */ new Date();
330
- const e = n.addWorksheet("Sheet1");
331
- return { workbook: n, worksheet: e };
329
+ function Gt() {
330
+ const t = new Ee.Workbook();
331
+ t.creator = "distributor System", t.lastModifiedBy = "distributor System", t.created = /* @__PURE__ */ new Date(), t.modified = /* @__PURE__ */ new Date(), t.lastPrinted = /* @__PURE__ */ new Date();
332
+ const e = t.addWorksheet("Sheet1");
333
+ return { workbook: t, worksheet: e };
332
334
  }
333
- async function Nt(n, e, t) {
334
- const o = Object.keys(t);
335
- for (const a of o) {
336
- const r = t[a], { type: l } = r;
335
+ async function Jt(t, e, n) {
336
+ const a = Object.keys(n);
337
+ for (const s of a) {
338
+ const o = n[s], { type: l } = o;
337
339
  switch (l) {
338
340
  case "IMG":
339
- await Zt(n, e, a);
341
+ await Xt(t, e, s);
340
342
  break;
341
343
  }
342
344
  }
343
345
  }
344
- async function Zt(n, e, t, o) {
345
- const a = e.getColumn(t), r = a.values;
346
- e.getColumn(t).width = 20, e.eachRow((l, u) => {
347
- u > 1 && (l.height = 40);
346
+ async function Xt(t, e, n, a) {
347
+ const s = e.getColumn(n), o = s.values;
348
+ e.getColumn(n).width = 20, e.eachRow((l, i) => {
349
+ i > 1 && (l.height = 40);
348
350
  });
349
- for (let l = 0, u = r.length; l < u; l++) {
351
+ for (let l = 0, i = o.length; l < i; l++) {
350
352
  if (l < 2)
351
353
  continue;
352
- let d = r[l];
353
- d && (e.getCell(a.letter + l).value = "", await Gt(n, e, d, {
354
+ let r = o[l];
355
+ r && (e.getCell(s.letter + l).value = "", await Qt(t, e, r, {
354
356
  width: 100,
355
357
  height: 50,
356
- col: a._number - 1,
358
+ col: s._number - 1,
357
359
  row: l - 1
358
360
  }));
359
361
  }
360
362
  }
361
- async function Gt(n, e, t, o) {
362
- const { col: a, row: r, width: l, height: u } = o, { success: d, base64: k } = await Wt(t, 0.3);
363
- if (d) {
364
- const x = n.addImage({
365
- base64: k,
363
+ async function Qt(t, e, n, a) {
364
+ const { col: s, row: o, width: l, height: i } = a, { success: r, base64: y } = await en(n, 0.3);
365
+ if (r) {
366
+ const b = t.addImage({
367
+ base64: y,
366
368
  extension: "jpeg"
367
369
  });
368
- e.addImage(x, {
369
- tl: { col: a, row: r },
370
- ext: { width: l, height: u }
370
+ e.addImage(b, {
371
+ tl: { col: s, row: o },
372
+ ext: { width: l, height: i }
371
373
  });
372
374
  }
373
375
  }
374
- function Wt(n, e = 1) {
375
- const t = new Image();
376
- return t.setAttribute("crossOrigin", "anonymous"), t.crossOrigin = "anonymous", t.src = n, new Promise((o, a) => {
377
- t.onload = () => {
378
- const r = document.createElement("canvas");
379
- r.width = t.width, r.height = t.height, r.getContext("2d").drawImage(t, 0, 0, r.width, r.height), o({
376
+ function en(t, e = 1) {
377
+ const n = new Image();
378
+ return n.setAttribute("crossOrigin", "anonymous"), n.crossOrigin = "anonymous", n.src = t, new Promise((a, s) => {
379
+ n.onload = () => {
380
+ const o = document.createElement("canvas");
381
+ o.width = n.width, o.height = n.height, o.getContext("2d").drawImage(n, 0, 0, o.width, o.height), a({
380
382
  success: !0,
381
383
  //canvas.toDataURL的方法将图片的绝对路径转换为base64编码
382
- base64: r.toDataURL("image/jpeg", e)
384
+ base64: o.toDataURL("image/jpeg", e)
383
385
  });
384
- }, t.onerror = () => {
385
- o({ success: !1 });
386
+ }, n.onerror = () => {
387
+ a({ success: !1 });
386
388
  };
387
389
  });
388
390
  }
389
- function Jt(n) {
390
- if (n < 26)
391
- return String.fromCharCode(65 + n);
391
+ const je = "---";
392
+ async function tn(t, e) {
393
+ const { fields: n, range: a = 1 } = e;
394
+ if (!n) {
395
+ const l = ve();
396
+ throw new Error(l("excel.fieldsMappingRequired"));
397
+ }
398
+ let s = new Ee.Workbook();
399
+ await s.xlsx.load(t);
400
+ const o = {};
401
+ return s.eachSheet(function(l, i) {
402
+ if (l.state == "visible") {
403
+ const r = [], y = n[l._name];
404
+ if (y) {
405
+ let b = Object.values(y).some((p) => p.includes("image")), w = {};
406
+ b && (l.getImages().forEach((g) => {
407
+ const { tl: m } = g.range, u = s.model.media.find((h) => h.index === g.imageId);
408
+ if (u) {
409
+ const h = u.buffer.toString("base64"), k = `data:image/${u.extension};base64,${h}`, _ = `${Math.ceil(m.row)}_${Math.ceil(m.col)}`;
410
+ w[_] ? w[_].push(k) : w[_] = [k];
411
+ }
412
+ }), console.log("withImages-imageMap", w)), l.eachRow(function(p, g) {
413
+ if (g > a) {
414
+ let m = {}, u = !0;
415
+ Object.keys(y).forEach((h) => {
416
+ var E;
417
+ let [k, _] = y[h].split(je);
418
+ const C = p.getCell(k);
419
+ let S;
420
+ if (_ == "image" && b) {
421
+ const Y = C._column._number, F = `${g}_${Y}`;
422
+ S = w[F] || "";
423
+ } else
424
+ C.result != null ? S = C.result : (E = C.value) != null && E.richText ? S = C.value.richText.reduce((Y, F) => Y + F.text, "") : C.type == 4 && C.value ? S = ke(C.value).utc().format("YYYY-MM-DD HH:mm:ss") : S = C.value;
425
+ S && _ == "option" && (S = S.split(je)[1]), m[h] = S, S && (u = !1);
426
+ }), u || r.push(m);
427
+ }
428
+ }), o[l._name] = r;
429
+ }
430
+ }
431
+ }), s = null, o;
432
+ }
433
+ async function nn(t, e) {
434
+ if (!t || e.length == 0)
435
+ return;
436
+ const n = on(e);
437
+ n.eachSheet(function(a, s) {
438
+ const { columnWidth: o } = gt, { tableHeader: l, tableData: i } = e[a._name];
439
+ l.forEach((r) => {
440
+ if (r.required) {
441
+ const y = r.style || {}, { font: b = {} } = y;
442
+ r.style = {
443
+ ...y,
444
+ font: {
445
+ ...b,
446
+ color: {
447
+ argb: "FFFF0000"
448
+ }
449
+ }
450
+ };
451
+ }
452
+ }), a.columns = l, a.addRows(i), l.forEach((r) => {
453
+ const { header: y, key: b, width: w, option: p } = r, g = a.getColumn(b);
454
+ if (g.width = w || o, p) {
455
+ const m = n.addWorksheet(b);
456
+ m.state = "hidden", m.getColumn(1).values = p.map((u) => `${u.label}${je}${u.value}`), Array(100).fill("").forEach((u, h) => {
457
+ if (h > 0) {
458
+ const k = ve();
459
+ a.getCell(`${g.letter}${h}`).dataValidation = {
460
+ type: "list",
461
+ formulae: [`${b}!$A$1:$A$${p.length}`],
462
+ showErrorMessage: !0,
463
+ error: k("excel.invalidInput"),
464
+ errorStyle: "stop",
465
+ errorMessage: k("excel.invalidOption")
466
+ };
467
+ }
468
+ });
469
+ }
470
+ });
471
+ });
472
+ try {
473
+ const a = await n.xlsx.writeBuffer(), s = new File([a], t, {
474
+ type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
475
+ });
476
+ it(s);
477
+ } catch (a) {
478
+ console.log(a);
479
+ }
480
+ }
481
+ function on(t) {
482
+ const e = ve(), n = new Ee.Workbook();
483
+ return n.creator = "distributor System", n.lastModifiedBy = "distributor System", n.created = /* @__PURE__ */ new Date(), n.modified = /* @__PURE__ */ new Date(), n.lastPrinted = /* @__PURE__ */ new Date(), Object.keys(t).sort((s, o) => {
484
+ const l = t[s].sort ?? 0, i = t[o].sort ?? 0;
485
+ return l - i;
486
+ }).forEach((s) => {
487
+ let o = s, l = !1;
488
+ /[\\/:*?\[\]]/g.test(s) && (s = s.replace(/[\\/:*?\[\]]/g, ""), l = !0), s.length > 31 && (s = s.substring(0, 31).trim(), l = !0, console.warn(e("excel.sheetNameTooLong", [o, s]))), l && (t[s] = t[o], delete t[o]), n.addWorksheet(s);
489
+ }), n;
490
+ }
491
+ function ln(t) {
492
+ if (t < 26)
493
+ return String.fromCharCode(65 + t);
392
494
  {
393
- const e = String.fromCharCode(65 + Math.floor((n - 26) / 26)), t = String.fromCharCode(65 + (n - 26) % 26);
394
- return e + t;
495
+ const e = String.fromCharCode(65 + Math.floor((t - 26) / 26)), n = String.fromCharCode(65 + (t - 26) % 26);
496
+ return e + n;
395
497
  }
396
498
  }
397
- function Fn(n) {
499
+ function jn(t) {
398
500
  return new Promise((e) => {
399
501
  setTimeout(() => {
400
502
  e();
401
- }, n);
503
+ }, t);
402
504
  });
403
505
  }
404
- function Ln(n) {
405
- return JSON.parse(JSON.stringify(n));
506
+ function Un(t) {
507
+ return JSON.parse(JSON.stringify(t));
406
508
  }
407
- function Tn(n) {
408
- let e = [], t = {}, o = (a, r) => Object.prototype.hasOwnProperty.call(a, r);
409
- for (const a of n) {
410
- t[a.id] = {
411
- ...a,
509
+ function Pn(t) {
510
+ let e = [], n = {}, a = (s, o) => Object.prototype.hasOwnProperty.call(s, o);
511
+ for (const s of t) {
512
+ n[s.id] = {
513
+ ...s,
412
514
  // 判断当前项的子项 如果map有存储就用存储的子项 否则初始化
413
- children: o(t, a.id) ? t[a.id].children : []
515
+ children: a(n, s.id) ? n[s.id].children : []
414
516
  };
415
- const r = t[a.id];
416
- a.pid == -1 ? e.push(r) : (o(t, a.pid) || (t[a.pid] = {
517
+ const o = n[s.id];
518
+ s.pid == -1 ? e.push(o) : (a(n, s.pid) || (n[s.pid] = {
417
519
  children: []
418
- }), t[a.pid].children.push(r));
520
+ }), n[s.pid].children.push(o));
419
521
  }
420
522
  return e;
421
523
  }
422
- function ut(n, e = " ") {
423
- return n ? n.split(e).filter((t) => t.trim()) : [];
524
+ function pt(t, e = " ") {
525
+ return t ? t.split(e).filter((n) => n.trim()) : [];
424
526
  }
425
- class Je {
426
- constructor(e, t = ["label", "value", "labelEn"]) {
427
- this.list = e.map((o) => ({
428
- ...o,
429
- label: o[t[0]],
430
- labelEn: o[t[2]] || o[t[0]] || "",
431
- value: o[t[1]]
432
- })), this.map = new Map(this.list.map((o) => [o[t[1]], o]));
527
+ class et {
528
+ constructor(e, n = ["label", "value", "labelEn"]) {
529
+ this.list = e.map((a) => ({
530
+ ...a,
531
+ label: a[n[0]],
532
+ labelEn: a[n[2]] || a[n[0]] || "",
533
+ value: a[n[1]]
534
+ })), this.map = new Map(this.list.map((a) => [a[n[1]], a]));
433
535
  }
434
536
  getName(e) {
435
537
  if (!this.has(e))
436
538
  return "-";
437
- const t = Pe().global.locale, { label: o, labelEn: a } = this.map.get(e);
438
- return (t.value == "zh_cn" ? o : a) || o || "-";
539
+ const n = Ye().global.locale, { label: a, labelEn: s } = this.map.get(e);
540
+ return (n.value == "zh_cn" ? a : s) || a || "-";
439
541
  }
440
542
  getTag(e) {
441
543
  if (!this.has(e))
442
544
  return "info";
443
- const { tag: t = "info" } = this.map.get(e);
444
- return t;
545
+ const { tag: n = "info" } = this.map.get(e);
546
+ return n;
445
547
  }
446
548
  getItem(e) {
447
549
  return this.has(e) ? this.map.get(e) : null;
@@ -449,59 +551,59 @@ class Je {
449
551
  getColor(e) {
450
552
  if (!this.has(e))
451
553
  return null;
452
- const { color: t } = this.map.get(e);
453
- return t;
554
+ const { color: n } = this.map.get(e);
555
+ return n;
454
556
  }
455
557
  has(e) {
456
558
  return this.map.has(e);
457
559
  }
458
560
  }
459
- function En(n, e = [], t = "i18nName") {
460
- if (n.length == 0)
461
- return new Je([]);
561
+ function Rn(t, e = [], n = "i18nName") {
562
+ if (t.length == 0)
563
+ return new et([]);
462
564
  if (e.length < 2) {
463
- const a = Ue();
464
- throw new Error(a("tools.keysLengthError"));
565
+ const s = ve();
566
+ throw new Error(s("tools.keysLengthError"));
465
567
  }
466
- let o = n.map((a) => {
467
- let r = {};
468
- return t && (r.labelEn = a[t]), e.forEach((l, u) => {
469
- u === 0 ? r.label = a[l] : u === 1 ? r.value = a[l] : r[l] = a[l];
470
- }), r;
568
+ let a = t.map((s) => {
569
+ let o = {};
570
+ return n && (o.labelEn = s[n]), e.forEach((l, i) => {
571
+ i === 0 ? o.label = s[l] : i === 1 ? o.value = s[l] : o[l] = s[l];
572
+ }), o;
471
573
  });
472
- return new Je(o);
574
+ return new et(a);
473
575
  }
474
- function Dn(n) {
475
- return n ? n.replace(/<[^>]+>/g, "") : "";
576
+ function Bn(t) {
577
+ return t ? t.replace(/<[^>]+>/g, "") : "";
476
578
  }
477
- function zn(n) {
478
- return n ? (n.includes("\\\\u") && (n = n.replace(/\\/g, "")), n.replace(/\\u[\dA-F]{4}/gi, (e) => String.fromCharCode(parseInt(e.replace(/\\u/g, ""), 16)))) : "";
579
+ function Yn(t) {
580
+ return t ? (t.includes("\\\\u") && (t = t.replace(/\\/g, "")), t.replace(/\\u[\dA-F]{4}/gi, (e) => String.fromCharCode(parseInt(e.replace(/\\u/g, ""), 16)))) : "";
479
581
  }
480
- function On(n, e = 10) {
481
- let t = 1048576 * e;
482
- return !(n.size > t);
582
+ function Kn(t, e = 10) {
583
+ let n = 1048576 * e;
584
+ return !(t.size > n);
483
585
  }
484
- function Vn(n) {
485
- return Array.from(10).fill(0).map((t, o) => n + "_" + o);
586
+ function Hn(t) {
587
+ return Array.from(10).fill(0).map((n, a) => t + "_" + a);
486
588
  }
487
- function Mn(n) {
589
+ function Nn(t) {
488
590
  let e = {};
489
- return n.map((t, o) => {
490
- let { key: a, option: r, type: l } = t, u = Jt(o);
491
- r ? e[a] = `${u}---option` : l === "image" ? e[a] = `${u}---image` : e[a] = u;
591
+ return t.map((n, a) => {
592
+ let { key: s, option: o, type: l } = n, i = ln(a);
593
+ o ? e[s] = `${i}---option` : l === "image" ? e[s] = `${i}---image` : e[s] = i;
492
594
  }), e;
493
595
  }
494
- function An(n, e) {
495
- return e.split(".").reduce((t, o) => t && t[o], n);
596
+ function Wn(t, e) {
597
+ return e.split(".").reduce((n, a) => n && n[a], t);
496
598
  }
497
- const we = (n, e) => {
498
- const t = n.__vccOpts || n;
499
- for (const [o, a] of e)
500
- t[o] = a;
501
- return t;
502
- }, Qt = ["onClick"], Xt = {
599
+ const _e = (t, e) => {
600
+ const n = t.__vccOpts || t;
601
+ for (const [a, s] of e)
602
+ n[a] = s;
603
+ return n;
604
+ }, an = ["onClick"], sn = {
503
605
  __name: "index",
504
- props: /* @__PURE__ */ Ge({
606
+ props: /* @__PURE__ */ Xe({
505
607
  api: {
506
608
  type: Function
507
609
  },
@@ -537,128 +639,128 @@ const we = (n, e) => {
537
639
  modelValue: {},
538
640
  modelModifiers: {}
539
641
  }),
540
- emits: /* @__PURE__ */ Ge(["success", "change", "changeAll"], ["update:modelValue"]),
541
- setup(n, { emit: e }) {
542
- const t = n, o = kt(), { t: a, locale: r } = ve(), l = _t(n, "modelValue"), u = ne(() => o["value-key"] != null), d = R(""), k = ne(() => {
543
- if (o.remote !== void 0)
544
- return t.data;
545
- const i = ut(d.value), { data: p, labelValue: L } = t, O = p || v.value;
546
- if (i.length == 0)
547
- return O;
548
- const { label: ee, labelEn: ie } = L;
549
- let m = r.value == "en_us" ? ie || "i18nName" : ee;
550
- return i.length == 1 ? O.filter(
551
- (ae) => ae[m].toLowerCase().includes(i[0].toLowerCase())
552
- ) : O.filter((ae) => {
553
- let me = !1;
554
- return me = i.some(
555
- (be) => ae[m].toLowerCase() == be.toLowerCase()
556
- ), me;
642
+ emits: /* @__PURE__ */ Xe(["success", "change", "changeAll"], ["update:modelValue"]),
643
+ setup(t, { emit: e }) {
644
+ const n = t, a = Ft(), { t: s, locale: o } = me(), l = Tt(t, "modelValue"), i = se(() => a["value-key"] != null), r = R(""), y = se(() => {
645
+ if (a.remote !== void 0)
646
+ return n.data;
647
+ const d = pt(r.value), { data: x, labelValue: O } = n, A = x || p.value;
648
+ if (d.length == 0)
649
+ return A;
650
+ const { label: oe, labelEn: ue } = O;
651
+ let v = o.value == "en_us" ? ue || "i18nName" : oe;
652
+ return d.length == 1 ? A.filter(
653
+ (ie) => ie[v].toLowerCase().includes(d[0].toLowerCase())
654
+ ) : A.filter((ie) => {
655
+ let pe = !1;
656
+ return pe = d.some(
657
+ (be) => ie[v].toLowerCase() == be.toLowerCase()
658
+ ), pe;
557
659
  });
558
- }), x = ne({
660
+ }), b = se({
559
661
  get() {
560
- return o.multiple == null || l.value == null ? !1 : l.value.length == k.value.length;
662
+ return a.multiple == null || l.value == null ? !1 : l.value.length == y.value.length;
561
663
  },
562
- set(i) {
563
- return i;
664
+ set(d) {
665
+ return d;
564
666
  }
565
- }), C = e, v = R([]), b = async () => {
566
- const { data: i } = await t.api();
567
- v.value = [...i], C("success", v);
667
+ }), w = e, p = R([]), g = async () => {
668
+ const { data: d } = await n.api();
669
+ p.value = [...d], w("success", p);
568
670
  };
569
- t.api && b();
570
- function g(i) {
571
- C("change", i);
671
+ n.api && g();
672
+ function m(d) {
673
+ w("change", d);
572
674
  }
573
- const f = t.labelValue.label.split("-"), h = (i) => {
574
- if (f.length == 1) {
575
- if (t.changeLocal)
576
- return a(i[t.labelValue.label]);
577
- let p = r.value == "en_us" ? i[t.labelValue.labelEn || "i18nName"] : i[t.labelValue.label];
578
- return p = p || i[t.labelValue.label], p;
675
+ const u = n.labelValue.label.split("-"), h = (d) => {
676
+ if (u.length == 1) {
677
+ if (n.changeLocal)
678
+ return s(d[n.labelValue.label]);
679
+ let x = o.value == "en_us" ? d[n.labelValue.labelEn || "i18nName"] : d[n.labelValue.label];
680
+ return x = x || d[n.labelValue.label], x;
579
681
  } else {
580
- let p = [];
581
- return f.forEach((L) => {
582
- p.push(i[L]);
583
- }), p.join("-");
682
+ let x = [];
683
+ return u.forEach((O) => {
684
+ x.push(d[O]);
685
+ }), x.join("-");
584
686
  }
585
687
  };
586
- function _(i) {
587
- let p = t.data ? t.data : v.value;
588
- l.value = i ? p.map(
589
- (L) => u.value ? L : L[t.labelValue.value]
590
- ) : [], _e(() => {
591
- C("change", l.value), C("changeAll", l.value, p);
688
+ function k(d) {
689
+ let x = n.data ? n.data : p.value;
690
+ l.value = d ? x.map(
691
+ (O) => i.value ? O : O[n.labelValue.value]
692
+ ) : [], Se(() => {
693
+ w("change", l.value), w("changeAll", l.value, x);
592
694
  });
593
695
  }
594
- function w(i) {
595
- t.optionClick && t.optionClick(i), C("change", u.value ? i : i[t.labelValue.value]);
696
+ function _(d) {
697
+ n.optionClick && n.optionClick(d), w("change", i.value ? d : d[n.labelValue.value]);
596
698
  }
597
- function S(i) {
598
- return l.value.length >= t.maxLimit && !l.value.includes(i[t.labelValue.value]);
699
+ function C(d) {
700
+ return l.value.length >= n.maxLimit && !l.value.includes(d[n.labelValue.value]);
599
701
  }
600
- function z(i) {
601
- return i.map((p) => ({
602
- ...p,
603
- label: h(p),
604
- value: u.value ? p : p[t.labelValue.value]
702
+ function S(d) {
703
+ return d.map((x) => ({
704
+ ...x,
705
+ label: h(x),
706
+ value: i.value ? x : x[n.labelValue.value]
605
707
  }));
606
708
  }
607
- const I = R([]), W = t.data ? t.data : v.value;
608
- I.value = z(W), qe(
609
- () => t.data ? t.data : v.value,
610
- (i) => {
611
- var L;
612
- const p = z(i);
613
- if (p.length !== I.value.length)
614
- I.value = p;
709
+ const E = R([]), Y = n.data ? n.data : p.value;
710
+ E.value = S(Y), Pe(
711
+ () => n.data ? n.data : p.value,
712
+ (d) => {
713
+ var O;
714
+ const x = S(d);
715
+ if (x.length !== E.value.length)
716
+ E.value = x;
615
717
  else {
616
- let O = !1;
617
- for (let ee = 0; ee < p.length; ee++)
618
- if (p[ee].value !== ((L = I.value[ee]) == null ? void 0 : L.value)) {
619
- O = !0;
718
+ let A = !1;
719
+ for (let oe = 0; oe < x.length; oe++)
720
+ if (x[oe].value !== ((O = E.value[oe]) == null ? void 0 : O.value)) {
721
+ A = !0;
620
722
  break;
621
723
  }
622
- O && (I.value = p);
724
+ A && (E.value = x);
623
725
  }
624
726
  },
625
727
  { deep: !0 }
626
728
  );
627
- const V = ne(() => I.value);
628
- return (i, p) => {
629
- const L = M("el-checkbox"), O = M("el-select-v2"), ee = M("el-option"), ie = M("el-select");
630
- return G(o).v2 != null ? (D(), Y(O, he({
729
+ const F = se(() => E.value);
730
+ return (d, x) => {
731
+ const O = z("el-checkbox"), A = z("el-select-v2"), oe = z("el-option"), ue = z("el-select");
732
+ return H(a).v2 != null ? (L(), B(A, he({
631
733
  key: 0,
632
- options: V.value,
734
+ options: F.value,
633
735
  modelValue: l.value,
634
- "onUpdate:modelValue": p[1] || (p[1] = (m) => l.value = m)
635
- }, G(o), {
736
+ "onUpdate:modelValue": x[1] || (x[1] = (v) => l.value = v)
737
+ }, H(a), {
636
738
  filterable: "",
637
739
  "collapse-tags": "",
638
740
  "collapse-tags-tooltip": "",
639
741
  clearable: "",
640
- onChange: g,
641
- onClear: g
642
- }), St({
643
- default: U(({ item: m }) => [
644
- oe("div", {
645
- onClick: (ge) => w(m)
646
- }, le(m.label), 9, Qt)
742
+ onChange: m,
743
+ onClear: m
744
+ }), at({
745
+ default: D(({ item: v }) => [
746
+ ae("div", {
747
+ onClick: (ge) => _(v)
748
+ }, J(v.label), 9, an)
647
749
  ]),
648
750
  _: 2
649
751
  }, [
650
- G(o).multiple != null ? {
752
+ H(a).multiple != null ? {
651
753
  name: "header",
652
- fn: U(() => [
653
- re(i.$slots, "header", {}, () => [
654
- P(L, {
754
+ fn: D(() => [
755
+ X(d.$slots, "header", {}, () => [
756
+ q(O, {
655
757
  class: "mgl20",
656
- modelValue: x.value,
657
- "onUpdate:modelValue": p[0] || (p[0] = (m) => x.value = m),
658
- onChange: _
758
+ modelValue: b.value,
759
+ "onUpdate:modelValue": x[0] || (x[0] = (v) => b.value = v),
760
+ onChange: k
659
761
  }, {
660
- default: U(() => [
661
- se(le(i.$t("quan-xuan")), 1)
762
+ default: D(() => [
763
+ Q(J(d.$t("quan-xuan")), 1)
662
764
  ]),
663
765
  _: 1
664
766
  }, 8, ["modelValue"])
@@ -666,44 +768,44 @@ const we = (n, e) => {
666
768
  ]),
667
769
  key: "0"
668
770
  } : void 0
669
- ]), 1040, ["options", "modelValue"])) : (D(), Y(ie, he({
771
+ ]), 1040, ["options", "modelValue"])) : (L(), B(ue, he({
670
772
  key: 1,
671
773
  modelValue: l.value,
672
- "onUpdate:modelValue": p[3] || (p[3] = (m) => l.value = m),
774
+ "onUpdate:modelValue": x[3] || (x[3] = (v) => l.value = v),
673
775
  filterable: "",
674
776
  "collapse-tags": "",
675
777
  "collapse-tags-tooltip": "",
676
- "filter-method": G(o).remote != null ? void 0 : (m) => d.value = m,
778
+ "filter-method": H(a).remote != null ? void 0 : (v) => r.value = v,
677
779
  clearable: ""
678
- }, G(o), { onClear: n.optionClick }), {
679
- default: U(() => [
680
- G(o).multiple != null && n.showCheckAll && n.maxLimit == null ? re(i.$slots, "header", { key: 0 }, () => [
681
- P(L, {
780
+ }, H(a), { onClear: t.optionClick }), {
781
+ default: D(() => [
782
+ H(a).multiple != null && t.showCheckAll && t.maxLimit == null ? X(d.$slots, "header", { key: 0 }, () => [
783
+ q(O, {
682
784
  class: "mgl20",
683
- modelValue: x.value,
684
- "onUpdate:modelValue": p[2] || (p[2] = (m) => x.value = m),
685
- onChange: _
785
+ modelValue: b.value,
786
+ "onUpdate:modelValue": x[2] || (x[2] = (v) => b.value = v),
787
+ onChange: k
686
788
  }, {
687
- default: U(() => [
688
- se(le(i.$t("quan-xuan")), 1)
789
+ default: D(() => [
790
+ Q(J(d.$t("quan-xuan")), 1)
689
791
  ]),
690
792
  _: 1
691
793
  }, 8, ["modelValue"])
692
- ], !0) : fe("", !0),
693
- (D(!0), de(De, null, et(k.value, (m, ge) => (D(), Y(ee, {
794
+ ], !0) : ce("", !0),
795
+ (L(!0), re(Oe, null, st(y.value, (v, ge) => (L(), B(oe, {
694
796
  key: ge,
695
- label: h(m),
696
- disabled: G(o).multiple != null && n.maxLimit > 0 ? S(m) : !1,
697
- onClick: ze((ae) => w(m), ["stop"]),
698
- value: u.value ? m : m[n.labelValue.value]
797
+ label: h(v),
798
+ disabled: H(a).multiple != null && t.maxLimit > 0 ? C(v) : !1,
799
+ onClick: Me((ie) => _(v), ["stop"]),
800
+ value: i.value ? v : v[t.labelValue.value]
699
801
  }, null, 8, ["label", "disabled", "onClick", "value"]))), 128))
700
802
  ]),
701
803
  _: 3
702
804
  }, 16, ["modelValue", "filter-method", "onClear"]));
703
805
  };
704
806
  }
705
- }, en = /* @__PURE__ */ we(Xt, [["__scopeId", "data-v-d12f3c20"]]);
706
- const tn = Qe({
807
+ }, rn = /* @__PURE__ */ _e(sn, [["__scopeId", "data-v-d12f3c20"]]);
808
+ const cn = ot({
707
809
  props: {
708
810
  name: {
709
811
  tyepe: String,
@@ -711,102 +813,106 @@ const tn = Qe({
711
813
  }
712
814
  }
713
815
  });
714
- function nn(n, e, t, o, a, r) {
715
- const l = M("el-icon");
716
- return D(), Y(l, { class: "cmp-icon" }, {
717
- default: U(() => [
718
- (D(), Y(tt(n.name)))
816
+ function un(t, e, n, a, s, o) {
817
+ const l = z("el-icon");
818
+ return L(), B(l, { class: "cmp-icon" }, {
819
+ default: D(() => [
820
+ (L(), B(rt(t.name)))
719
821
  ]),
720
822
  _: 1
721
823
  });
722
824
  }
723
- const dt = /* @__PURE__ */ we(tn, [["render", nn], ["__scopeId", "data-v-733f9daa"]]), qn = {
825
+ const yt = /* @__PURE__ */ _e(cn, [["render", un], ["__scopeId", "data-v-733f9daa"]]), Zn = {
724
826
  __name: "index",
725
827
  emits: ["ok", "no"],
726
- setup(n, { emit: e }) {
727
- const t = e, o = ot(() => {
728
- t("ok");
828
+ setup(t, { emit: e }) {
829
+ const n = e, a = Re(() => {
830
+ n("ok");
729
831
  }, 500);
730
- function a() {
731
- t("no");
832
+ function s() {
833
+ n("no");
732
834
  }
733
- return (r, l) => {
734
- const u = M("el-popconfirm");
735
- return D(), Y(u, he(r.$attrs, {
736
- onConfirm: G(o),
737
- onCancel: a
835
+ return (o, l) => {
836
+ const i = z("el-popconfirm");
837
+ return L(), B(i, he(o.$attrs, {
838
+ onConfirm: H(a),
839
+ onCancel: s
738
840
  }), {
739
- reference: U(() => [
740
- re(r.$slots, "default")
841
+ reference: D(() => [
842
+ X(o.$slots, "default")
741
843
  ]),
742
844
  _: 3
743
845
  }, 16, ["onConfirm"]);
744
846
  };
745
847
  }
746
848
  };
747
- const on = ["accept"], ln = {
849
+ const dn = ["accept"], fn = {
748
850
  __name: "index",
749
851
  props: {
750
852
  accept: {
751
853
  type: String,
752
854
  default: ".xlsx,.xls"
753
855
  },
754
- loading: {
755
- type: Boolean,
756
- default: !1
856
+ fields: {
857
+ type: Object,
858
+ default: () => ({})
757
859
  }
758
860
  },
759
861
  emits: ["fileChange"],
760
- setup(n, { emit: e }) {
761
- const t = e, o = R(null);
762
- function a(r) {
763
- let l = r.target.files[0];
764
- t("fileChange", l), o.value.value = null;
862
+ setup(t, { emit: e }) {
863
+ const n = t, a = e, s = R(null), o = R(!1);
864
+ async function l(i) {
865
+ o.value = !0;
866
+ let r = i.target.files[0];
867
+ const y = await tn(r, n.fields).finally(() => {
868
+ o.value = !1, s.value.value = null;
869
+ });
870
+ a("fileChange", y);
765
871
  }
766
- return (r, l) => {
767
- const u = M("el-button");
768
- return D(), de("span", null, [
769
- P(u, {
770
- loading: n.loading,
872
+ return (i, r) => {
873
+ const y = z("el-button");
874
+ return L(), re("span", null, [
875
+ q(y, {
876
+ loading: o.value,
771
877
  class: "mgr10",
772
- onClick: l[0] || (l[0] = (d) => o.value.click())
878
+ onClick: r[0] || (r[0] = (b) => s.value.click())
773
879
  }, {
774
- default: U(() => [
775
- se(le(r.$t("dao-ru")), 1)
880
+ default: D(() => [
881
+ Q(J(i.$t("dao-ru")), 1)
776
882
  ]),
777
883
  _: 1
778
884
  }, 8, ["loading"]),
779
- oe("input", {
780
- onChange: a,
885
+ ae("input", {
886
+ onChange: l,
781
887
  ref_key: "input",
782
- ref: o,
783
- accept: n.accept,
888
+ ref: s,
889
+ accept: t.accept,
784
890
  style: { position: "absolute", width: "0px", height: "0px", opacity: "0" },
785
891
  type: "file"
786
- }, null, 40, on)
892
+ }, null, 40, dn)
787
893
  ]);
788
894
  };
789
895
  }
790
- }, jn = /* @__PURE__ */ we(ln, [["__scopeId", "data-v-5f1449ad"]]);
791
- function Ae(n) {
896
+ }, Gn = /* @__PURE__ */ _e(fn, [["__scopeId", "data-v-74e50b2f"]]);
897
+ function Ue(t) {
792
898
  let e = {};
793
- return n.forEach((t) => {
794
- const { key: o, type: a, option: r = {}, value: l, dateType: u = "date" } = t;
795
- if (o)
796
- if (a == "input" && (r != null && r.multiple))
797
- e[o] = ut(l);
798
- else if (a == "date")
799
- if (u.includes("range")) {
800
- const [d, k] = o;
801
- let [x, C] = l || [];
802
- x && u == "daterange" && (x = Se(x).format("YYYY-MM-DD 00:00:00"), C = Se(C).format("YYYY-MM-DD 23:59:59")), e[d] = x, e[k] = C;
899
+ return t.forEach((n) => {
900
+ const { key: a, type: s, option: o = {}, value: l, dateType: i = "date" } = n;
901
+ if (a)
902
+ if (s == "input" && (o != null && o.multiple))
903
+ e[a] = pt(l);
904
+ else if (s == "date")
905
+ if (i.includes("range")) {
906
+ const [r, y] = a;
907
+ let [b, w] = l || [];
908
+ b && i == "daterange" && (b = ke(b).format("YYYY-MM-DD 00:00:00"), w = ke(w).format("YYYY-MM-DD 23:59:59")), e[r] = b, e[y] = w;
803
909
  } else
804
- e[o] = l;
910
+ e[a] = l;
805
911
  else
806
- e[o] = l;
912
+ e[a] = l;
807
913
  }), e;
808
914
  }
809
- const an = { key: 0 }, rn = { class: "btns" }, sn = { class: "left" }, cn = { class: "right" }, un = {
915
+ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { class: "right" }, yn = {
810
916
  __name: "index",
811
917
  props: {
812
918
  form: {
@@ -815,85 +921,85 @@ const an = { key: 0 }, rn = { class: "btns" }, sn = { class: "left" }, cn = { cl
815
921
  }
816
922
  },
817
923
  emits: ["confirm", "reset", "visibleChange"],
818
- setup(n, { expose: e, emit: t }) {
819
- const o = n, a = t, r = R(!0), l = R(null), { t: u } = ve(), d = ne(() => r.value ? u("guan-bi") : u("zhan-kai"));
820
- function k() {
821
- a("confirm");
924
+ setup(t, { expose: e, emit: n }) {
925
+ const a = t, s = n, o = R(!0), l = R(null), { t: i } = me(), r = se(() => o.value ? i("guan-bi") : i("zhan-kai"));
926
+ function y() {
927
+ s("confirm");
822
928
  }
823
- function x(h) {
824
- h.option.onClear && h.option.onClear(), a("confirm");
929
+ function b(h) {
930
+ h.option.onClear && h.option.onClear(), s("confirm");
825
931
  }
826
- function C() {
827
- a("reset");
932
+ function w() {
933
+ s("reset");
828
934
  }
829
- function v() {
830
- a("confirm");
935
+ function p() {
936
+ s("confirm");
831
937
  }
832
- function b() {
833
- return Ae(o.form.items);
938
+ function g() {
939
+ return Ue(a.form.items);
834
940
  }
835
- const g = lt(o.form.items);
836
- function f() {
837
- o.form.items.forEach((h) => {
838
- const _ = g.find((w) => w.key == h.key);
839
- _ && (h.value = _.value);
941
+ const m = ct(a.form.items);
942
+ function u() {
943
+ a.form.items.forEach((h) => {
944
+ const k = m.find((_) => _.key == h.key);
945
+ k && (h.value = k.value);
840
946
  });
841
947
  }
842
- return e({ getPrm: b, reset: f }), (h, _) => {
843
- const w = M("el-input"), S = M("el-date-picker"), z = M("el-form-item"), I = M("el-form"), W = M("el-link"), V = M("el-button");
844
- return D(), de("div", {
948
+ return e({ getPrm: g, reset: u }), (h, k) => {
949
+ const _ = z("el-input"), C = z("el-date-picker"), S = z("el-form-item"), E = z("el-form"), Y = z("el-link"), F = z("el-button");
950
+ return L(), re("div", {
845
951
  class: "searchBar-container mgt10 mgb10",
846
- onKeydown: $t(k, ["enter"])
952
+ onKeydown: Dt(y, ["enter"])
847
953
  }, [
848
- oe("div", {
954
+ ae("div", {
849
955
  class: "searchBar",
850
- style: It({ height: r.value ? "auto" : "42px" })
956
+ style: zt({ height: o.value ? "auto" : "42px" })
851
957
  }, [
852
- P(I, {
958
+ q(E, {
853
959
  inline: "",
854
- model: n.form.data
960
+ model: t.form.data
855
961
  }, {
856
- default: U(() => [
857
- (D(!0), de(De, null, et(n.form.items.filter((i) => !i.hidden), (i) => (D(), de(De, {
858
- key: i.key
962
+ default: D(() => [
963
+ (L(!0), re(Oe, null, st(t.form.items.filter((d) => !d.hidden), (d) => (L(), re(Oe, {
964
+ key: d.key
859
965
  }, [
860
- i.type == "br" ? (D(), de("br", an)) : (D(), Y(z, {
966
+ d.type == "br" ? (L(), re("br", hn)) : (L(), B(S, {
861
967
  key: 1,
862
- label: i.name
968
+ label: d.name
863
969
  }, {
864
- default: U(() => {
865
- var p, L;
970
+ default: D(() => {
971
+ var x, O;
866
972
  return [
867
- i.type === "input" ? (D(), Y(w, {
973
+ d.type === "input" ? (L(), B(_, {
868
974
  key: 0,
869
- modelValue: i.value,
870
- "onUpdate:modelValue": (O) => i.value = O,
871
- class: Oe(((p = i.option) == null ? void 0 : p.class) || "w150"),
975
+ modelValue: d.value,
976
+ "onUpdate:modelValue": (A) => d.value = A,
977
+ class: Ve(((x = d.option) == null ? void 0 : x.class) || "w150"),
872
978
  placeholder: h.$t("qing-shu-ru"),
873
979
  clearable: ""
874
- }, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) : i.type === "custom" ? (D(), Y(tt(i.render), { key: 1 })) : fe("", !0),
875
- i.type === "select" ? (D(), Y(en, he({
980
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) : d.type === "custom" ? (L(), B(rt(d.render), { key: 1 })) : ce("", !0),
981
+ d.type === "select" ? (L(), B(rn, he({
876
982
  key: 2,
877
- class: ((L = i.option) == null ? void 0 : L.class) || "w150",
878
- modelValue: i.value,
879
- "onUpdate:modelValue": (O) => i.value = O
880
- }, { ref_for: !0 }, i.option, {
881
- onChange: k,
882
- onClear: (O) => x(i)
883
- }), null, 16, ["class", "modelValue", "onUpdate:modelValue", "onClear"])) : fe("", !0),
884
- i.type === "date" ? (D(), Y(S, {
983
+ class: ((O = d.option) == null ? void 0 : O.class) || "w150",
984
+ modelValue: d.value,
985
+ "onUpdate:modelValue": (A) => d.value = A
986
+ }, { ref_for: !0 }, d.option, {
987
+ onChange: y,
988
+ onClear: (A) => b(d)
989
+ }), null, 16, ["class", "modelValue", "onUpdate:modelValue", "onClear"])) : ce("", !0),
990
+ d.type === "date" ? (L(), B(C, {
885
991
  key: 3,
886
- class: Oe({ datetimerange: "w300", daterange: "w200" }[i.dateType] || "w100"),
887
- modelValue: i.value,
888
- "onUpdate:modelValue": (O) => i.value = O,
889
- "value-format": { datetimerange: "YYYY-MM-DD HH:mm:ss", daterange: "YYYY-MM-DD" }[i.dateType] || "YYYY-MM-DD",
890
- type: i.dateType || "date",
891
- onFocus: (O) => l.value = i,
892
- onChange: (O) => v(),
992
+ class: Ve({ datetimerange: "w300", daterange: "w200" }[d.dateType] || "w100"),
993
+ modelValue: d.value,
994
+ "onUpdate:modelValue": (A) => d.value = A,
995
+ "value-format": { datetimerange: "YYYY-MM-DD HH:mm:ss", daterange: "YYYY-MM-DD" }[d.dateType] || "YYYY-MM-DD",
996
+ type: d.dateType || "date",
997
+ onFocus: (A) => l.value = d,
998
+ onChange: (A) => p(),
893
999
  placeholder: h.$t("qing-xuan-ze"),
894
1000
  "start-placeholder": h.$t("kai-shi-shi-jian"),
895
1001
  "end-placeholder": h.$t("jie-shu-shi-jian")
896
- }, null, 8, ["class", "modelValue", "onUpdate:modelValue", "value-format", "type", "onFocus", "onChange", "placeholder", "start-placeholder", "end-placeholder"])) : fe("", !0)
1002
+ }, null, 8, ["class", "modelValue", "onUpdate:modelValue", "value-format", "type", "onFocus", "onChange", "placeholder", "start-placeholder", "end-placeholder"])) : ce("", !0)
897
1003
  ];
898
1004
  }),
899
1005
  _: 2
@@ -903,51 +1009,51 @@ const an = { key: 0 }, rn = { class: "btns" }, sn = { class: "left" }, cn = { cl
903
1009
  _: 1
904
1010
  }, 8, ["model"])
905
1011
  ], 4),
906
- oe("div", rn, [
907
- oe("div", sn, [
908
- re(h.$slots, "table-header-left", {}, void 0, !0)
1012
+ ae("div", mn, [
1013
+ ae("div", gn, [
1014
+ X(h.$slots, "table-header-left", {}, void 0, !0)
909
1015
  ]),
910
- oe("div", cn, [
911
- P(W, {
1016
+ ae("div", pn, [
1017
+ q(Y, {
912
1018
  underline: "never",
913
1019
  class: "mgr10",
914
- onClick: _[0] || (_[0] = () => {
915
- a("visibleChange", !r.value), r.value = !r.value;
1020
+ onClick: k[0] || (k[0] = () => {
1021
+ s("visibleChange", !o.value), o.value = !o.value;
916
1022
  })
917
1023
  }, {
918
- default: U(() => [
919
- P(dt, {
920
- name: r.value ? "ArrowUp" : "ArrowDown"
1024
+ default: D(() => [
1025
+ q(yt, {
1026
+ name: o.value ? "ArrowUp" : "ArrowDown"
921
1027
  }, null, 8, ["name"]),
922
- se(" " + le(d.value), 1)
1028
+ Q(" " + J(r.value), 1)
923
1029
  ]),
924
1030
  _: 1
925
1031
  }),
926
- P(V, {
1032
+ q(F, {
927
1033
  type: "primary",
928
- onClick: k
1034
+ onClick: y
929
1035
  }, {
930
- default: U(() => [
931
- se(le(h.$t("shai-xuan")), 1)
1036
+ default: D(() => [
1037
+ Q(J(h.$t("shai-xuan")), 1)
932
1038
  ]),
933
1039
  _: 1
934
1040
  }),
935
- P(V, {
1041
+ q(F, {
936
1042
  type: "primary",
937
- onClick: C
1043
+ onClick: w
938
1044
  }, {
939
- default: U(() => [
940
- se(le(h.$t("chong-zhi")), 1)
1045
+ default: D(() => [
1046
+ Q(J(h.$t("chong-zhi")), 1)
941
1047
  ]),
942
1048
  _: 1
943
1049
  }),
944
- re(h.$slots, "btn", {}, void 0, !0)
1050
+ X(h.$slots, "btn", {}, void 0, !0)
945
1051
  ])
946
1052
  ])
947
1053
  ], 32);
948
1054
  };
949
1055
  }
950
- }, dn = /* @__PURE__ */ we(un, [["__scopeId", "data-v-3c0a6716"]]), ft = {
1056
+ }, vn = /* @__PURE__ */ _e(yn, [["__scopeId", "data-v-3c0a6716"]]), vt = {
951
1057
  // 分页参数名
952
1058
  pageNoKey: "pageNo",
953
1059
  // 页码参数名
@@ -977,24 +1083,24 @@ const an = { key: 0 }, rn = { class: "btns" }, sn = { class: "left" }, cn = { cl
977
1083
  enableCellCopy: !0
978
1084
  // 是否启用单元格选区复制功能
979
1085
  };
980
- let xe = { ...ft };
981
- function Pn(n) {
982
- xe = {
983
- ...xe,
984
- ...n,
1086
+ let Ce = { ...vt };
1087
+ function Jn(t) {
1088
+ Ce = {
1089
+ ...Ce,
1090
+ ...t,
985
1091
  responseDataKeys: {
986
- ...xe.responseDataKeys,
987
- ...n.responseDataKeys || {}
1092
+ ...Ce.responseDataKeys,
1093
+ ...t.responseDataKeys || {}
988
1094
  }
989
1095
  };
990
1096
  }
991
- function fn() {
992
- return xe;
1097
+ function bn() {
1098
+ return Ce;
993
1099
  }
994
- function Un() {
995
- xe = { ...ft };
1100
+ function Xn() {
1101
+ Ce = { ...vt };
996
1102
  }
997
- const hn = { class: "center" }, gn = {
1103
+ const wn = { class: "center" }, xn = {
998
1104
  __name: "index",
999
1105
  props: {
1000
1106
  // 表格id 本地存储列设置时使用,不传则使用路由路径自动生成
@@ -1030,111 +1136,111 @@ const hn = { class: "center" }, gn = {
1030
1136
  default: () => ({})
1031
1137
  }
1032
1138
  },
1033
- setup(n, { expose: e }) {
1034
- const { t, locale: o } = ve(), a = zt(), r = fn(), l = n, u = R(!1), d = R([]);
1035
- l.searchForm.showSearch === void 0 && (l.searchForm.showSearch = r.showSearch), l.searchForm.showPage === void 0 && (l.searchForm.showPage = r.showPage), l.searchForm.showShadow === void 0 && (l.searchForm.showShadow = r.showShadow), l.searchForm.showCheckBox === void 0 && (l.searchForm.showCheckBox = r.showCheckBox), l.searchForm.enableCellCopy === void 0 && (l.searchForm.enableCellCopy = r.enableCellCopy), l.searchForm.selections || (l.searchForm.selections = []);
1036
- const k = ne(() => {
1037
- const c = a.path.replace(/\//g, "-").replace(/^-/, "") || "default-table";
1038
- return l.id ? `listPageId-${c}-${l.id}` : `listPageId-${c}`;
1039
- }), x = lt(l.searchForm.items), C = l.searchForm.pageNoKey || r.pageNoKey, v = l.searchForm.pageSizeKey || r.pageSizeKey, b = ke({
1040
- [C]: 1,
1041
- [v]: l.searchForm.defaultPageSize || r.defaultPageSize,
1139
+ setup(t, { expose: e }) {
1140
+ const { t: n, locale: a } = me(), s = jt(), o = bn(), l = t, i = R(!1), r = R([]);
1141
+ l.searchForm.showSearch === void 0 && (l.searchForm.showSearch = o.showSearch), l.searchForm.showPage === void 0 && (l.searchForm.showPage = o.showPage), l.searchForm.showShadow === void 0 && (l.searchForm.showShadow = o.showShadow), l.searchForm.showCheckBox === void 0 && (l.searchForm.showCheckBox = o.showCheckBox), l.searchForm.enableCellCopy === void 0 && (l.searchForm.enableCellCopy = o.enableCellCopy), l.searchForm.selections || (l.searchForm.selections = []);
1142
+ const y = se(() => {
1143
+ const f = s.path.replace(/\//g, "-").replace(/^-/, "") || "default-table";
1144
+ return l.id ? `listPageId-${f}-${l.id}` : `listPageId-${f}`;
1145
+ }), b = ct(l.searchForm.items), w = l.searchForm.pageNoKey || o.pageNoKey, p = l.searchForm.pageSizeKey || o.pageSizeKey, g = $e({
1146
+ [w]: 1,
1147
+ [p]: l.searchForm.defaultPageSize || o.defaultPageSize,
1042
1148
  total: 0
1043
- }), g = R(null), f = R(null), h = R(450), _ = ot(() => {
1044
- _e(() => {
1045
- if (!f.value)
1149
+ }), m = R(null), u = R(null), h = R(450), k = Re(() => {
1150
+ Se(() => {
1151
+ if (!u.value)
1046
1152
  return;
1047
- const s = f.value.getBoundingClientRect(), y = window.innerHeight, F = s.top, q = 100, H = y - F - q, T = 200;
1048
- h.value = Math.max(H, T);
1153
+ const c = u.value.getBoundingClientRect(), $ = window.innerHeight, T = c.top, U = 100, W = $ - T - U, M = 200;
1154
+ h.value = Math.max(W, M);
1049
1155
  });
1050
- }, 100), w = () => {
1051
- _();
1052
- }, S = () => {
1156
+ }, 100), _ = () => {
1157
+ k();
1158
+ }, C = () => {
1053
1159
  if (!l.searchForm.enableCellCopy)
1054
1160
  return !1;
1055
- const c = g.value;
1056
- if (!c || !c.$el)
1161
+ const f = m.value;
1162
+ if (!f || !f.$el)
1057
1163
  return !1;
1058
- const s = c.$el;
1059
- return s.classList.add("cell-copy-enabled"), s.setAttribute("tabindex", "-1"), s.removeEventListener("mousedown", ae), s.removeEventListener("mousemove", me), s.removeEventListener("mouseup", be), s.removeEventListener("keydown", Ie), s.addEventListener("mousedown", ae), s.addEventListener("mousemove", me), s.addEventListener("mouseup", be), s.addEventListener("keydown", Ie), !0;
1164
+ const c = f.$el;
1165
+ return c.classList.add("cell-copy-enabled"), c.setAttribute("tabindex", "-1"), c.removeEventListener("mousedown", ie), c.removeEventListener("mousemove", pe), c.removeEventListener("mouseup", be), c.removeEventListener("keydown", Le), c.addEventListener("mousedown", ie), c.addEventListener("mousemove", pe), c.addEventListener("mouseup", be), c.addEventListener("keydown", Le), !0;
1060
1166
  };
1061
- Xe(() => {
1062
- _(), window.addEventListener("resize", w), l.searchForm.enableCellCopy && (document.addEventListener("mouseup", Ye), document.addEventListener("mousedown", Ke), setTimeout(() => {
1063
- S();
1167
+ lt(() => {
1168
+ k(), window.addEventListener("resize", _), l.searchForm.enableCellCopy && (document.addEventListener("mouseup", Ne), document.addEventListener("mousedown", We), setTimeout(() => {
1169
+ C();
1064
1170
  }, 500));
1065
- }), Ft(() => {
1171
+ }), Ot(() => {
1066
1172
  l.searchForm.enableCellCopy && setTimeout(() => {
1067
- S();
1173
+ C();
1068
1174
  }, 500);
1069
- }), Lt(() => {
1070
- if (window.removeEventListener("resize", w), l.searchForm.enableCellCopy) {
1071
- document.removeEventListener("mouseup", Ye), document.removeEventListener("mousedown", Ke);
1072
- const c = g.value;
1073
- if (c && c.$el) {
1074
- const s = c.$el;
1075
- s.removeEventListener("mousedown", ae), s.removeEventListener("mousemove", me), s.removeEventListener("mouseup", be), s.removeEventListener("keydown", Ie);
1175
+ }), Mt(() => {
1176
+ if (window.removeEventListener("resize", _), l.searchForm.enableCellCopy) {
1177
+ document.removeEventListener("mouseup", Ne), document.removeEventListener("mousedown", We);
1178
+ const f = m.value;
1179
+ if (f && f.$el) {
1180
+ const c = f.$el;
1181
+ c.removeEventListener("mousedown", ie), c.removeEventListener("mousemove", pe), c.removeEventListener("mouseup", be), c.removeEventListener("keydown", Le);
1076
1182
  }
1077
1183
  }
1078
1184
  });
1079
- const z = ne(() => ie.value.height || h.value);
1080
- let I;
1081
- async function W(c) {
1082
- const { dataFormat: s } = l.tableConfig;
1083
- c[C] != 1 && (c.nextSearchAfter = I), u.value = !0;
1084
- const { code: y, data: F = {} } = await l.api(c).finally(() => {
1085
- u.value = !1, l.searchForm.selections = [];
1185
+ const S = se(() => ue.value.height || h.value);
1186
+ let E;
1187
+ async function Y(f) {
1188
+ const { dataFormat: c } = l.tableConfig;
1189
+ f[w] != 1 && (f.nextSearchAfter = E), i.value = !0;
1190
+ const { code: $, data: T = {} } = await l.api(f).finally(() => {
1191
+ i.value = !1, l.searchForm.selections = [];
1086
1192
  });
1087
- if (y == 200) {
1088
- let q = [];
1089
- for (const T of r.responseDataKeys.rows)
1090
- if (F[T]) {
1091
- q = F[T];
1193
+ if ($ == 200) {
1194
+ let U = [];
1195
+ for (const M of o.responseDataKeys.rows)
1196
+ if (T[M]) {
1197
+ U = T[M];
1092
1198
  break;
1093
1199
  }
1094
- let H = 0;
1095
- for (const T of r.responseDataKeys.total)
1096
- if (F[T] !== void 0) {
1097
- H = F[T];
1200
+ let W = 0;
1201
+ for (const M of o.responseDataKeys.total)
1202
+ if (T[M] !== void 0) {
1203
+ W = T[M];
1098
1204
  break;
1099
1205
  }
1100
- d.value = s ? s(q) : q, b.total = H, I = F.nextSearchAfter, l.searchForm.enableCellCopy && _e(() => {
1206
+ r.value = c ? c(U) : U, g.total = W, E = T.nextSearchAfter, l.searchForm.enableCellCopy && Se(() => {
1101
1207
  setTimeout(() => {
1102
- S();
1208
+ C();
1103
1209
  }, 100);
1104
1210
  });
1105
1211
  }
1106
1212
  }
1107
- function V(c = {}) {
1108
- const { searchData: s = () => ({}) } = l.tableConfig, y = s();
1109
- W({ ...b, ...Ae(l.searchForm.items), ...c, ...y });
1213
+ function F(f = {}) {
1214
+ const { searchData: c = () => ({}) } = l.tableConfig, $ = c();
1215
+ Y({ ...g, ...Ue(l.searchForm.items), ...f, ...$ });
1110
1216
  }
1111
- function i() {
1112
- const { reset: c } = l.tableConfig;
1113
- c && c(), l.searchForm.items.forEach((s) => {
1114
- const y = x.find((F) => We(s.key) && We(F.key) ? s.key.join(",") == F.key.join(",") : F.key == s.key);
1115
- y && (s.value = y.value);
1116
- }), V();
1217
+ function d() {
1218
+ const { reset: f } = l.tableConfig;
1219
+ f && f(), l.searchForm.items.forEach((c) => {
1220
+ const $ = b.find((T) => Qe(c.key) && Qe(T.key) ? c.key.join(",") == T.key.join(",") : T.key == c.key);
1221
+ $ && (c.value = $.value);
1222
+ }), F();
1117
1223
  }
1118
- l.api && l.immediate && V();
1119
- function p() {
1120
- return { ...b, ...Ae(l.searchForm.items) };
1224
+ l.api && l.immediate && F();
1225
+ function x() {
1226
+ return { ...g, ...Ue(l.searchForm.items) };
1121
1227
  }
1122
- const L = () => {
1123
- const c = g.value;
1124
- c && c.clearSort();
1125
- }, O = ke({
1228
+ const O = () => {
1229
+ const f = m.value;
1230
+ f && f.clearSort();
1231
+ }, A = $e({
1126
1232
  storage: !0
1127
- }), ee = ke({
1233
+ }), oe = $e({
1128
1234
  drag: !0,
1129
1235
  resizable: !0,
1130
1236
  maxFixedSize: 0
1131
- }), ie = ne(() => {
1132
- const { customConfig: c, columnConfig: s, ...y } = l.tableConfig;
1237
+ }), ue = se(() => {
1238
+ const { customConfig: f, columnConfig: c, ...$ } = l.tableConfig;
1133
1239
  return {
1134
1240
  headerAlign: "left",
1135
1241
  align: "center",
1136
- customConfig: { ...O, ...c },
1137
- columnConfig: { ...ee, ...s },
1242
+ customConfig: { ...A, ...f },
1243
+ columnConfig: { ...oe, ...c },
1138
1244
  // 列过多时 自动宽度 虚拟滚动会闪屏 关闭虚拟滚动
1139
1245
  "virtual-x-config": {
1140
1246
  enabled: !1,
@@ -1142,9 +1248,9 @@ const hn = { class: "center" }, gn = {
1142
1248
  },
1143
1249
  // 纵向虚拟滚动 大于100条开启
1144
1250
  "virtual-y-config": { enabled: !0, gt: 100 },
1145
- ...y
1251
+ ...$
1146
1252
  };
1147
- }), m = ke({
1253
+ }), v = $e({
1148
1254
  isSelecting: !1,
1149
1255
  // 是否正在选择
1150
1256
  startCell: null,
@@ -1153,71 +1259,71 @@ const hn = { class: "center" }, gn = {
1153
1259
  // 结束单元格
1154
1260
  selectedCells: []
1155
1261
  // 选中的单元格列表 [{ rowIndex, colIndex }]
1156
- }), ge = (c) => {
1157
- const s = c.closest(".vxe-body--column");
1158
- if (!s || s.classList.contains("col--checkbox") || s.classList.contains("col--seq"))
1262
+ }), ge = (f) => {
1263
+ const c = f.closest(".vxe-body--column");
1264
+ if (!c || c.classList.contains("col--checkbox") || c.classList.contains("col--seq"))
1159
1265
  return null;
1160
- const y = s.closest(".vxe-body--row");
1161
- if (!y)
1266
+ const $ = c.closest(".vxe-body--row");
1267
+ if (!$)
1162
1268
  return null;
1163
- const F = g.value;
1164
- if (!F)
1269
+ const T = m.value;
1270
+ if (!T)
1165
1271
  return null;
1166
- let q = -1;
1167
- const H = y.getAttribute("data-rowid");
1168
- if (H != null)
1169
- q = parseInt(H, 10);
1272
+ let U = -1;
1273
+ const W = $.getAttribute("data-rowid");
1274
+ if (W != null)
1275
+ U = parseInt(W, 10);
1170
1276
  else {
1171
- const E = y.parentElement;
1172
- q = Array.from(E.querySelectorAll(".vxe-body--row")).indexOf(y);
1277
+ const V = $.parentElement;
1278
+ U = Array.from(V.querySelectorAll(".vxe-body--row")).indexOf($);
1173
1279
  }
1174
- if (q < 0)
1280
+ if (U < 0)
1175
1281
  return null;
1176
- let T = -1;
1177
- const te = s.getAttribute("data-colid");
1178
- if (te && (T = F.getColumns().findIndex(($) => $.id === te)), T < 0) {
1179
- const $ = Array.from(y.querySelectorAll(".vxe-body--column")).indexOf(s), B = !!s.closest(".vxe-table--fixed-left-wrapper"), N = !!s.closest(".vxe-table--fixed-right-wrapper"), j = F.getColumns();
1180
- if (B) {
1181
- const Z = j.filter((K) => K.fixed === "left");
1182
- $ < Z.length && (T = j.indexOf(Z[$]));
1183
- } else if (N) {
1184
- const Z = j.filter((K) => K.fixed === "right");
1185
- $ < Z.length && (T = j.indexOf(Z[$]));
1282
+ let M = -1;
1283
+ const le = c.getAttribute("data-colid");
1284
+ if (le && (M = T.getColumns().findIndex((I) => I.id === le)), M < 0) {
1285
+ const I = Array.from($.querySelectorAll(".vxe-body--column")).indexOf(c), K = !!c.closest(".vxe-table--fixed-left-wrapper"), Z = !!c.closest(".vxe-table--fixed-right-wrapper"), P = T.getColumns();
1286
+ if (K) {
1287
+ const G = P.filter((N) => N.fixed === "left");
1288
+ I < G.length && (M = P.indexOf(G[I]));
1289
+ } else if (Z) {
1290
+ const G = P.filter((N) => N.fixed === "right");
1291
+ I < G.length && (M = P.indexOf(G[I]));
1186
1292
  } else {
1187
- const Z = l.searchForm.showCheckBox ? 1 : 0;
1188
- T = j.filter((J) => J.fixed === "left").length + $ - Z;
1293
+ const G = l.searchForm.showCheckBox ? 1 : 0;
1294
+ M = P.filter((ee) => ee.fixed === "left").length + I - G;
1189
1295
  }
1190
1296
  }
1191
- return T < 0 ? null : { rowIndex: q, colIndex: T, cell: s };
1192
- }, ae = (c) => {
1193
- const s = ge(c.target);
1194
- if (!s) {
1195
- $e();
1297
+ return M < 0 ? null : { rowIndex: U, colIndex: M, cell: c };
1298
+ }, ie = (f) => {
1299
+ const c = ge(f.target);
1300
+ if (!c) {
1301
+ Ie();
1196
1302
  return;
1197
1303
  }
1198
- m.isSelecting = !0, m.startCell = {
1199
- rowIndex: s.rowIndex,
1200
- colIndex: s.colIndex
1201
- }, m.endCell = { ...m.startCell }, Re(), Be();
1202
- }, me = (c) => {
1203
- if (!m.isSelecting)
1304
+ v.isSelecting = !0, v.startCell = {
1305
+ rowIndex: c.rowIndex,
1306
+ colIndex: c.colIndex
1307
+ }, v.endCell = { ...v.startCell }, Ke(), He();
1308
+ }, pe = (f) => {
1309
+ if (!v.isSelecting)
1204
1310
  return;
1205
- const s = ge(c.target);
1206
- s && (m.endCell = {
1207
- rowIndex: s.rowIndex,
1208
- colIndex: s.colIndex
1209
- }, Re(), Be());
1311
+ const c = ge(f.target);
1312
+ c && (v.endCell = {
1313
+ rowIndex: c.rowIndex,
1314
+ colIndex: c.colIndex
1315
+ }, Ke(), He());
1210
1316
  }, be = () => {
1211
- m.isSelecting = !1;
1212
- }, $e = () => {
1213
- m.selectedCells = [], m.startCell = null, m.endCell = null;
1214
- const c = g.value;
1215
- if (!c)
1317
+ v.isSelecting = !1;
1318
+ }, Ie = () => {
1319
+ v.selectedCells = [], v.startCell = null, v.endCell = null;
1320
+ const f = m.value;
1321
+ if (!f)
1216
1322
  return;
1217
- c.$el.querySelectorAll(
1323
+ f.$el.querySelectorAll(
1218
1324
  ".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left"
1219
- ).forEach((y) => {
1220
- y.classList.remove(
1325
+ ).forEach(($) => {
1326
+ $.classList.remove(
1221
1327
  "cell-selected",
1222
1328
  "cell-border-top",
1223
1329
  "cell-border-right",
@@ -1225,257 +1331,257 @@ const hn = { class: "center" }, gn = {
1225
1331
  "cell-border-left"
1226
1332
  );
1227
1333
  });
1228
- }, Re = () => {
1229
- if (!m.startCell || !m.endCell) {
1230
- m.selectedCells = [];
1334
+ }, Ke = () => {
1335
+ if (!v.startCell || !v.endCell) {
1336
+ v.selectedCells = [];
1231
1337
  return;
1232
1338
  }
1233
- const c = m.startCell.rowIndex, s = m.endCell.rowIndex, y = m.startCell.colIndex, F = m.endCell.colIndex, q = Math.min(c, s), H = Math.max(c, s), T = Math.min(y, F), te = Math.max(y, F);
1234
- m.selectedCells = [];
1235
- for (let E = q; E <= H; E++)
1236
- for (let $ = T; $ <= te; $++)
1237
- m.selectedCells.push({
1238
- rowIndex: E,
1239
- colIndex: $
1339
+ const f = v.startCell.rowIndex, c = v.endCell.rowIndex, $ = v.startCell.colIndex, T = v.endCell.colIndex, U = Math.min(f, c), W = Math.max(f, c), M = Math.min($, T), le = Math.max($, T);
1340
+ v.selectedCells = [];
1341
+ for (let V = U; V <= W; V++)
1342
+ for (let I = M; I <= le; I++)
1343
+ v.selectedCells.push({
1344
+ rowIndex: V,
1345
+ colIndex: I
1240
1346
  });
1241
- }, Be = () => {
1242
- _e(() => {
1243
- const c = g.value;
1244
- if (!c)
1347
+ }, He = () => {
1348
+ Se(() => {
1349
+ const f = m.value;
1350
+ if (!f)
1245
1351
  return;
1246
- const s = c.$el;
1247
- if (s.querySelectorAll(
1352
+ const c = f.$el;
1353
+ if (c.querySelectorAll(
1248
1354
  ".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left"
1249
- ).forEach((B) => {
1250
- B.classList.remove(
1355
+ ).forEach((K) => {
1356
+ K.classList.remove(
1251
1357
  "cell-selected",
1252
1358
  "cell-border-top",
1253
1359
  "cell-border-right",
1254
1360
  "cell-border-bottom",
1255
1361
  "cell-border-left"
1256
1362
  );
1257
- }), m.selectedCells.length === 0)
1363
+ }), v.selectedCells.length === 0)
1258
1364
  return;
1259
- const y = c.getColumns(), F = m.selectedCells.map((B) => B.rowIndex), q = m.selectedCells.map((B) => B.colIndex), H = Math.min(...F), T = Math.max(...F), te = Math.min(...q), E = Math.max(...q), $ = [
1260
- s.querySelector(".vxe-table--body-wrapper tbody"),
1261
- s.querySelector(".vxe-table--fixed-left-wrapper tbody"),
1262
- s.querySelector(".vxe-table--fixed-right-wrapper tbody")
1365
+ const $ = f.getColumns(), T = v.selectedCells.map((K) => K.rowIndex), U = v.selectedCells.map((K) => K.colIndex), W = Math.min(...T), M = Math.max(...T), le = Math.min(...U), V = Math.max(...U), I = [
1366
+ c.querySelector(".vxe-table--body-wrapper tbody"),
1367
+ c.querySelector(".vxe-table--fixed-left-wrapper tbody"),
1368
+ c.querySelector(".vxe-table--fixed-right-wrapper tbody")
1263
1369
  ].filter(Boolean);
1264
- m.selectedCells.forEach(({ rowIndex: B, colIndex: N }) => {
1265
- const j = y[N];
1266
- if (!j)
1370
+ v.selectedCells.forEach(({ rowIndex: K, colIndex: Z }) => {
1371
+ const P = $[Z];
1372
+ if (!P)
1267
1373
  return;
1268
- const Z = j.fixed === "left", K = j.fixed === "right";
1269
- for (const J of $) {
1270
- const ye = J.querySelectorAll(".vxe-body--row")[B];
1271
- if (!ye)
1374
+ const G = P.fixed === "left", N = P.fixed === "right";
1375
+ for (const ee of I) {
1376
+ const we = ee.querySelectorAll(".vxe-body--row")[K];
1377
+ if (!we)
1272
1378
  continue;
1273
- const ce = Array.from(ye.querySelectorAll(".vxe-body--column"));
1274
- let A = null;
1275
- if (Z && J.closest(".vxe-table--fixed-left-wrapper")) {
1276
- const Q = y.filter((X) => X.fixed === "left").indexOf(j);
1277
- A = ce[Q];
1278
- } else if (K && J.closest(".vxe-table--fixed-right-wrapper")) {
1279
- const Q = y.filter((X) => X.fixed === "right").indexOf(j);
1280
- A = ce[Q];
1281
- } else if (!Z && !K && J.closest(".vxe-table--body-wrapper")) {
1282
- const ue = l.searchForm.showCheckBox ? 1 : 0, Q = y.filter((Fe) => Fe.fixed === "left").length, X = N - Q;
1283
- A = ce[X + ue];
1379
+ const de = Array.from(we.querySelectorAll(".vxe-body--column"));
1380
+ let j = null;
1381
+ if (G && ee.closest(".vxe-table--fixed-left-wrapper")) {
1382
+ const te = $.filter((ne) => ne.fixed === "left").indexOf(P);
1383
+ j = de[te];
1384
+ } else if (N && ee.closest(".vxe-table--fixed-right-wrapper")) {
1385
+ const te = $.filter((ne) => ne.fixed === "right").indexOf(P);
1386
+ j = de[te];
1387
+ } else if (!G && !N && ee.closest(".vxe-table--body-wrapper")) {
1388
+ const fe = l.searchForm.showCheckBox ? 1 : 0, te = $.filter((Fe) => Fe.fixed === "left").length, ne = Z - te;
1389
+ j = de[ne + fe];
1284
1390
  }
1285
- if (A && !A.classList.contains("col--checkbox") && !A.classList.contains("col--seq")) {
1286
- A.classList.add("cell-selected"), B === H && A.classList.add("cell-border-top"), B === T && A.classList.add("cell-border-bottom"), N === te && A.classList.add("cell-border-left"), N === E && A.classList.add("cell-border-right");
1391
+ if (j && !j.classList.contains("col--checkbox") && !j.classList.contains("col--seq")) {
1392
+ j.classList.add("cell-selected"), K === W && j.classList.add("cell-border-top"), K === M && j.classList.add("cell-border-bottom"), Z === le && j.classList.add("cell-border-left"), Z === V && j.classList.add("cell-border-right");
1287
1393
  break;
1288
1394
  }
1289
1395
  }
1290
1396
  });
1291
1397
  });
1292
- }, gt = async () => {
1293
- if (m.selectedCells.length === 0)
1398
+ }, wt = async () => {
1399
+ if (v.selectedCells.length === 0)
1294
1400
  return;
1295
- const c = g.value;
1296
- if (!c)
1401
+ const f = m.value;
1402
+ if (!f)
1297
1403
  return;
1298
- const s = c.$el, y = c.getColumns(), F = [...new Set(m.selectedCells.map((E) => E.rowIndex))].sort(
1299
- (E, $) => E - $
1300
- ), q = [...new Set(m.selectedCells.map((E) => E.colIndex))].sort(
1301
- (E, $) => E - $
1302
- ), H = [
1303
- s.querySelector(".vxe-table--body-wrapper tbody"),
1304
- s.querySelector(".vxe-table--fixed-left-wrapper tbody"),
1305
- s.querySelector(".vxe-table--fixed-right-wrapper tbody")
1306
- ].filter(Boolean), T = [];
1307
- F.forEach((E) => {
1308
- const $ = [];
1309
- q.forEach((B) => {
1310
- const N = y[B];
1311
- if (!N) {
1312
- $.push("");
1404
+ const c = f.$el, $ = f.getColumns(), T = [...new Set(v.selectedCells.map((V) => V.rowIndex))].sort(
1405
+ (V, I) => V - I
1406
+ ), U = [...new Set(v.selectedCells.map((V) => V.colIndex))].sort(
1407
+ (V, I) => V - I
1408
+ ), W = [
1409
+ c.querySelector(".vxe-table--body-wrapper tbody"),
1410
+ c.querySelector(".vxe-table--fixed-left-wrapper tbody"),
1411
+ c.querySelector(".vxe-table--fixed-right-wrapper tbody")
1412
+ ].filter(Boolean), M = [];
1413
+ T.forEach((V) => {
1414
+ const I = [];
1415
+ U.forEach((K) => {
1416
+ const Z = $[K];
1417
+ if (!Z) {
1418
+ I.push("");
1313
1419
  return;
1314
1420
  }
1315
- const j = N.fixed === "left", Z = N.fixed === "right";
1316
- let K = "";
1317
- for (const J of H) {
1318
- const ye = J.querySelectorAll(".vxe-body--row")[E];
1319
- if (!ye)
1421
+ const P = Z.fixed === "left", G = Z.fixed === "right";
1422
+ let N = "";
1423
+ for (const ee of W) {
1424
+ const we = ee.querySelectorAll(".vxe-body--row")[V];
1425
+ if (!we)
1320
1426
  continue;
1321
- const ce = Array.from(ye.querySelectorAll(".vxe-body--column"));
1322
- let A = null;
1323
- if (j && J.closest(".vxe-table--fixed-left-wrapper")) {
1324
- const Q = y.filter((X) => X.fixed === "left").indexOf(N);
1325
- A = ce[Q];
1326
- } else if (Z && J.closest(".vxe-table--fixed-right-wrapper")) {
1327
- const Q = y.filter((X) => X.fixed === "right").indexOf(N);
1328
- A = ce[Q];
1329
- } else if (!j && !Z && J.closest(".vxe-table--body-wrapper")) {
1330
- const ue = l.searchForm.showCheckBox ? 1 : 0, Q = y.filter((Fe) => Fe.fixed === "left").length, X = B - Q;
1331
- A = ce[X + ue];
1427
+ const de = Array.from(we.querySelectorAll(".vxe-body--column"));
1428
+ let j = null;
1429
+ if (P && ee.closest(".vxe-table--fixed-left-wrapper")) {
1430
+ const te = $.filter((ne) => ne.fixed === "left").indexOf(Z);
1431
+ j = de[te];
1432
+ } else if (G && ee.closest(".vxe-table--fixed-right-wrapper")) {
1433
+ const te = $.filter((ne) => ne.fixed === "right").indexOf(Z);
1434
+ j = de[te];
1435
+ } else if (!P && !G && ee.closest(".vxe-table--body-wrapper")) {
1436
+ const fe = l.searchForm.showCheckBox ? 1 : 0, te = $.filter((Fe) => Fe.fixed === "left").length, ne = K - te;
1437
+ j = de[ne + fe];
1332
1438
  }
1333
- if (A && !A.classList.contains("col--checkbox") && !A.classList.contains("col--seq")) {
1334
- K = A.innerText || A.textContent || "", K = K.trim(), K = K.replace(/\n/g, " ").replace(/\s+/g, " ");
1439
+ if (j && !j.classList.contains("col--checkbox") && !j.classList.contains("col--seq")) {
1440
+ N = j.innerText || j.textContent || "", N = N.trim(), N = N.replace(/\n/g, " ").replace(/\s+/g, " ");
1335
1441
  break;
1336
1442
  }
1337
1443
  }
1338
- $.push(K);
1339
- }), T.push($.join(" "));
1444
+ I.push(N);
1445
+ }), M.push(I.join(" "));
1340
1446
  });
1341
- const te = T.join(`
1447
+ const le = M.join(`
1342
1448
  `);
1343
1449
  try {
1344
- await navigator.clipboard.writeText(te);
1345
- } catch (E) {
1346
- console.error("复制失败:", E);
1450
+ await navigator.clipboard.writeText(le);
1451
+ } catch (V) {
1452
+ console.error("复制失败:", V);
1347
1453
  }
1348
- }, Ie = (c) => {
1349
- l.searchForm.enableCellCopy && ((c.ctrlKey || c.metaKey) && c.key === "c" ? m.selectedCells.length > 0 && (c.preventDefault(), c.stopPropagation(), gt()) : c.key === "Escape" && $e());
1350
- }, Ye = () => {
1351
- m.isSelecting = !1;
1352
- }, Ke = (c) => {
1353
- const s = g.value;
1354
- if (!s || !s.$el)
1454
+ }, Le = (f) => {
1455
+ l.searchForm.enableCellCopy && ((f.ctrlKey || f.metaKey) && f.key === "c" ? v.selectedCells.length > 0 && (f.preventDefault(), f.stopPropagation(), wt()) : f.key === "Escape" && Ie());
1456
+ }, Ne = () => {
1457
+ v.isSelecting = !1;
1458
+ }, We = (f) => {
1459
+ const c = m.value;
1460
+ if (!c || !c.$el)
1355
1461
  return;
1356
- s.$el.contains(c.target) || $e();
1357
- }, mt = (c) => {
1358
- b[C] = c, V();
1359
- }, pt = (c) => {
1360
- b[v] = c, b[C] = 1, V();
1462
+ c.$el.contains(f.target) || Ie();
1463
+ }, xt = (f) => {
1464
+ g[w] = f, F();
1465
+ }, Ct = (f) => {
1466
+ g[p] = f, g[w] = 1, F();
1361
1467
  };
1362
- function He() {
1363
- const c = g.value.getCheckboxRecords();
1364
- l.searchForm.selections = c;
1468
+ function Ze() {
1469
+ const f = m.value.getCheckboxRecords();
1470
+ l.searchForm.selections = f;
1365
1471
  }
1366
- const Ne = (c) => {
1367
- const s = g.value;
1368
- if (s) {
1369
- s.toggleCheckboxRow(c);
1370
- const y = g.value.getCheckboxRecords();
1371
- l.searchForm.selections = y;
1472
+ const Ge = (f) => {
1473
+ const c = m.value;
1474
+ if (c) {
1475
+ c.toggleCheckboxRow(f);
1476
+ const $ = m.value.getCheckboxRecords();
1477
+ l.searchForm.selections = $;
1372
1478
  }
1373
1479
  };
1374
- return e({ tableRef: g, getList: V, getPrm: p, clearSort: L, calculateTableHeight: _ }), (c, s) => {
1375
- var E;
1376
- const y = M("el-button"), F = M("el-checkbox"), q = M("el-text"), H = M("vxe-column"), T = M("VxeTable"), te = M("el-pagination");
1377
- return D(), de("div", {
1378
- class: Oe({ box: n.searchForm.showShadow })
1480
+ return e({ tableRef: m, getList: F, getPrm: x, clearSort: O, calculateTableHeight: k }), (f, c) => {
1481
+ var V;
1482
+ const $ = z("el-button"), T = z("el-checkbox"), U = z("el-text"), W = z("vxe-column"), M = z("VxeTable"), le = z("el-pagination");
1483
+ return L(), re("div", {
1484
+ class: Ve({ box: t.searchForm.showShadow })
1379
1485
  }, [
1380
- n.searchForm.showSearch ? (D(), Y(dn, {
1486
+ t.searchForm.showSearch ? (L(), B(vn, {
1381
1487
  key: 0,
1382
- form: n.searchForm,
1383
- onReset: i,
1384
- onConfirm: s[1] || (s[1] = ($) => V()),
1385
- onVisibleChange: G(_)
1488
+ form: t.searchForm,
1489
+ onReset: d,
1490
+ onConfirm: c[1] || (c[1] = (I) => F()),
1491
+ onVisibleChange: H(k)
1386
1492
  }, {
1387
- btn: U(() => [
1388
- s[3] || (s[3] = oe("span", { class: "mgr10" }, null, -1)),
1389
- re(c.$slots, "search-bar-btn", {}, void 0, !0),
1390
- P(y, {
1493
+ btn: D(() => [
1494
+ c[3] || (c[3] = ae("span", { class: "mgr10" }, null, -1)),
1495
+ X(f.$slots, "search-bar-btn", {}, void 0, !0),
1496
+ q($, {
1391
1497
  class: "mgl10",
1392
1498
  round: "",
1393
- onClick: s[0] || (s[0] = ($) => g.value.openCustom())
1499
+ onClick: c[0] || (c[0] = (I) => m.value.openCustom())
1394
1500
  }, {
1395
- default: U(() => [
1396
- P(dt, { name: "Tools" })
1501
+ default: D(() => [
1502
+ q(yt, { name: "Tools" })
1397
1503
  ]),
1398
1504
  _: 1
1399
1505
  })
1400
1506
  ]),
1401
1507
  _: 3
1402
- }, 8, ["form", "onVisibleChange"])) : fe("", !0),
1403
- re(c.$slots, "table-header-left", {}, void 0, !0),
1404
- oe("div", {
1508
+ }, 8, ["form", "onVisibleChange"])) : ce("", !0),
1509
+ X(f.$slots, "table-header-left", {}, void 0, !0),
1510
+ ae("div", {
1405
1511
  ref_key: "tableContentRef",
1406
- ref: f
1512
+ ref: u
1407
1513
  }, [
1408
- P(T, he({
1409
- id: k.value,
1514
+ q(M, he({
1515
+ id: y.value,
1410
1516
  ref_key: "tableRef",
1411
- ref: g,
1412
- loading: n.loading || u.value,
1413
- data: n.api ? d.value : n.data,
1517
+ ref: m,
1518
+ loading: t.loading || i.value,
1519
+ data: t.api ? r.value : t.data,
1414
1520
  border: ""
1415
- }, ie.value, {
1416
- height: z.value,
1417
- onCheckboxChange: He,
1418
- onCheckboxAll: He,
1419
- onSortChange: (E = ie.value["sort-config"]) == null ? void 0 : E.sortChange
1521
+ }, ue.value, {
1522
+ height: S.value,
1523
+ onCheckboxChange: Ze,
1524
+ onCheckboxAll: Ze,
1525
+ onSortChange: (V = ue.value["sort-config"]) == null ? void 0 : V.sortChange
1420
1526
  }), {
1421
- default: U(() => [
1422
- n.searchForm.showCheckBox == null || n.searchForm.showCheckBox ? (D(), Y(H, {
1527
+ default: D(() => [
1528
+ t.searchForm.showCheckBox == null || t.searchForm.showCheckBox ? (L(), B(W, {
1423
1529
  key: 0,
1424
1530
  type: "checkbox",
1425
- width: G(o) == "zh_cn" ? 80 : 150,
1426
- title: c.$t("xu-hao"),
1531
+ width: H(a) == "zh_cn" ? 80 : 150,
1532
+ title: f.$t("xu-hao"),
1427
1533
  fixed: "left"
1428
1534
  }, {
1429
- checkbox: U(({ rowIndex: $, row: B, checked: N, disabled: j, indeterminate: Z }) => [
1430
- oe("div", hn, [
1431
- N ? (D(), Y(F, {
1535
+ checkbox: D(({ rowIndex: I, row: K, checked: Z, disabled: P, indeterminate: G }) => [
1536
+ ae("div", wn, [
1537
+ Z ? (L(), B(T, {
1432
1538
  key: 0,
1433
1539
  checked: !0,
1434
- disabled: j,
1540
+ disabled: P,
1435
1541
  size: "default",
1436
- onClick: ze((K) => !j && Ne(B), ["stop"])
1437
- }, null, 8, ["disabled", "onClick"])) : (D(), Y(F, {
1542
+ onClick: Me((N) => !P && Ge(K), ["stop"])
1543
+ }, null, 8, ["disabled", "onClick"])) : (L(), B(T, {
1438
1544
  key: 1,
1439
- disabled: j,
1545
+ disabled: P,
1440
1546
  checked: !1,
1441
1547
  size: "default",
1442
- onClick: ze((K) => !j && Ne(B), ["stop"])
1548
+ onClick: Me((N) => !P && Ge(K), ["stop"])
1443
1549
  }, null, 8, ["disabled", "onClick"])),
1444
- P(q, {
1550
+ q(U, {
1445
1551
  type: "info",
1446
1552
  class: "mgl5"
1447
1553
  }, {
1448
- default: U(() => [
1449
- se(le($ + 1), 1)
1554
+ default: D(() => [
1555
+ Q(J(I + 1), 1)
1450
1556
  ]),
1451
1557
  _: 2
1452
1558
  }, 1024)
1453
1559
  ])
1454
1560
  ]),
1455
1561
  _: 1
1456
- }, 8, ["width", "title"])) : fe("", !0),
1457
- re(c.$slots, "default", {}, void 0, !0)
1562
+ }, 8, ["width", "title"])) : ce("", !0),
1563
+ X(f.$slots, "default", {}, void 0, !0)
1458
1564
  ]),
1459
1565
  _: 3
1460
1566
  }, 16, ["id", "loading", "data", "height", "onSortChange"])
1461
1567
  ], 512),
1462
- n.searchForm.showPage ? (D(), Y(te, {
1568
+ t.searchForm.showPage ? (L(), B(le, {
1463
1569
  key: 1,
1464
- "current-page": b[G(C)],
1465
- "onUpdate:currentPage": s[2] || (s[2] = ($) => b[G(C)] = $),
1570
+ "current-page": g[H(w)],
1571
+ "onUpdate:currentPage": c[2] || (c[2] = (I) => g[H(w)] = I),
1466
1572
  class: "myPagination mgt10",
1467
1573
  background: "",
1468
1574
  layout: "total, sizes, prev, pager, next",
1469
- total: b.total,
1470
- "page-size": b[G(v)],
1471
- "page-sizes": n.searchForm.pageSizes || G(r).pageSizes,
1472
- onCurrentChange: mt,
1473
- onSizeChange: pt
1474
- }, null, 8, ["current-page", "total", "page-size", "page-sizes"])) : fe("", !0)
1575
+ total: g.total,
1576
+ "page-size": g[H(p)],
1577
+ "page-sizes": t.searchForm.pageSizes || H(o).pageSizes,
1578
+ onCurrentChange: xt,
1579
+ onSizeChange: Ct
1580
+ }, null, 8, ["current-page", "total", "page-size", "page-sizes"])) : ce("", !0)
1475
1581
  ], 2);
1476
1582
  };
1477
1583
  }
1478
- }, Rn = /* @__PURE__ */ we(gn, [["__scopeId", "data-v-d93cad32"]]), Bn = {
1584
+ }, Qn = /* @__PURE__ */ _e(xn, [["__scopeId", "data-v-d93cad32"]]), eo = {
1479
1585
  __name: "index",
1480
1586
  props: {
1481
1587
  sheetsConfig: {
@@ -1487,44 +1593,243 @@ const hn = { class: "center" }, gn = {
1487
1593
  required: !0
1488
1594
  }
1489
1595
  },
1490
- setup(n) {
1491
- const e = n;
1492
- function t() {
1493
- Kt(e.fileName, e.sheetsConfig);
1596
+ setup(t) {
1597
+ const e = t;
1598
+ function n() {
1599
+ nn(e.fileName, e.sheetsConfig);
1494
1600
  }
1495
- return (o, a) => {
1496
- const r = M("el-link");
1497
- return D(), Y(r, he({
1601
+ return (a, s) => {
1602
+ const o = z("el-link");
1603
+ return L(), B(o, he({
1498
1604
  type: "primary",
1499
1605
  underline: "never"
1500
- }, o.$attrs, { onClick: t }), {
1501
- default: U(() => [
1502
- se(le(o.$t("xia-zai-dao-ru-mo-ban")), 1)
1606
+ }, a.$attrs, { onClick: n }), {
1607
+ default: D(() => [
1608
+ Q(J(a.$t("xia-zai-dao-ru-mo-ban")), 1)
1503
1609
  ]),
1504
1610
  _: 1
1505
1611
  }, 16);
1506
1612
  };
1507
1613
  }
1614
+ }, Cn = {
1615
+ mounted(t, e) {
1616
+ e.value && tt(t);
1617
+ },
1618
+ updated(t, e) {
1619
+ e.value ? tt(t) : nt(t);
1620
+ },
1621
+ beforeUnmount(t) {
1622
+ nt(t);
1623
+ }
1508
1624
  };
1509
- function Yn(n, e = {}) {
1510
- const t = Ue(), o = {
1625
+ async function tt(t) {
1626
+ await p();
1627
+ const e = t.querySelector(".el-dialog");
1628
+ if (!e)
1629
+ return;
1630
+ const n = t.querySelector(".el-dialog__header"), a = t.querySelector(".el-overlay");
1631
+ a.style.cssText += "overflow: hidden;", n.style.cursor = "move";
1632
+ let s = !1, o = {
1633
+ // 数据源,不变部分为:window信息、dialog信息、mouse初始值信息,可变部分为:拖拽坐标位移
1634
+ window: {
1635
+ // window信息
1636
+ width: 0,
1637
+ height: 0
1638
+ },
1639
+ dialog: {
1640
+ x: 0,
1641
+ y: 0,
1642
+ width: 0,
1643
+ height: 0,
1644
+ marginTop: ""
1645
+ },
1646
+ // dialog信息
1647
+ mouse: {
1648
+ // 鼠标初始信息
1649
+ x: 0,
1650
+ y: 0
1651
+ },
1652
+ drag: {
1653
+ // 拖拽过程信息
1654
+ x: 0,
1655
+ y: 0
1656
+ }
1657
+ };
1658
+ n.addEventListener("mousedown", r), document.addEventListener("mousemove", y), document.addEventListener("mouseup", b), window.addEventListener("resize", w);
1659
+ function l() {
1660
+ o.mouse.x - o.drag.x >= o.dialog.x && (o.drag.x = o.mouse.x - o.dialog.x), o.drag.x - o.mouse.x >= o.window.width - (o.dialog.x + o.dialog.width) && (o.drag.x = o.mouse.x + o.window.width - o.dialog.x - o.dialog.width), o.mouse.y - o.drag.y >= o.dialog.y && (o.drag.y = o.mouse.y - o.dialog.y), o.drag.y - o.mouse.y >= o.window.height - (o.dialog.y + o.dialog.height) && (o.drag.y = o.mouse.y + o.window.height - o.dialog.y - o.dialog.height), i();
1661
+ }
1662
+ function i() {
1663
+ let g = o.drag.y - o.mouse.y + o.dialog.y, m = o.drag.x - o.mouse.x + o.dialog.x;
1664
+ e.style.cssText += `position: absolute; top: calc(${g}px - ${o.dialog.marginTop}); left: ${m}px;`;
1665
+ }
1666
+ function r(g) {
1667
+ g.button === 0 && (o.window = {
1668
+ width: document.body.clientWidth,
1669
+ height: document.body.clientHeight
1670
+ }, o.dialog = e.getBoundingClientRect(), o.dialog.marginTop = window.getComputedStyle(e).marginTop, o.mouse = {
1671
+ x: g.clientX,
1672
+ y: g.clientY
1673
+ }, s = !0);
1674
+ }
1675
+ function y(g) {
1676
+ s && (o.drag = {
1677
+ x: g.clientX,
1678
+ y: g.clientY
1679
+ }, a.style.userSelect = "none", l());
1680
+ }
1681
+ function b(g) {
1682
+ a.style.userSelect = "auto", s = !1;
1683
+ }
1684
+ function w(g) {
1685
+ }
1686
+ function p() {
1687
+ return new Promise((g, m) => {
1688
+ setTimeout(() => {
1689
+ g();
1690
+ }, 500);
1691
+ });
1692
+ }
1693
+ t.__mouseDown__ = r, t.__mouseUp__ = b, t.__mouseMove__ = y, t.__sizeChange__ = w;
1694
+ }
1695
+ function nt(t) {
1696
+ document.removeEventListener("mousedown", t.__mouseDown__), document.removeEventListener("mousemove", t.__mouseMove__), document.removeEventListener("mouseup", t.__mouseUp__), window.removeEventListener("resize", t.__sizeChange__);
1697
+ }
1698
+ const kn = {
1699
+ key: 0,
1700
+ class: "drawer-btn"
1701
+ }, _n = { key: 1 }, to = {
1702
+ __name: "index",
1703
+ props: {
1704
+ layer: {
1705
+ type: Object,
1706
+ default: () => ({
1707
+ show: !1,
1708
+ type: "layer",
1709
+ title: "",
1710
+ showButton: !1
1711
+ }),
1712
+ required: !0
1713
+ },
1714
+ loading: {
1715
+ type: Boolean,
1716
+ default: !1
1717
+ }
1718
+ },
1719
+ emits: ["confirm"],
1720
+ setup(t, { emit: e }) {
1721
+ const n = t, a = e, { t: s } = me(), o = Re(() => {
1722
+ a("confirm");
1723
+ }, 300);
1724
+ async function l() {
1725
+ n.layer.type == "drawer" ? n.layer.onClose ? n.layer.onClose() : await Et.confirm(s("que-ding-guan-bi-ma"), {
1726
+ confirmButtonText: s("que-ding"),
1727
+ cancelButtonText: s("qu-xiao"),
1728
+ type: "warning"
1729
+ }).catch(() => {
1730
+ }) == "confirm" && (n.layer.show = !1) : n.layer.show = !1;
1731
+ }
1732
+ return (i, r) => {
1733
+ const y = z("el-button"), b = z("el-drawer"), w = z("el-dialog");
1734
+ return t.layer.type ? (L(), B(b, {
1735
+ key: 0,
1736
+ modelValue: t.layer.show,
1737
+ "onUpdate:modelValue": r[0] || (r[0] = (p) => t.layer.show = p),
1738
+ size: t.layer.width || "100%",
1739
+ title: t.layer.title,
1740
+ direction: "rtl",
1741
+ "append-to-body": "",
1742
+ "before-close": l,
1743
+ class: "drawer-content"
1744
+ }, {
1745
+ default: D(() => [
1746
+ X(i.$slots, "default"),
1747
+ r[2] || (r[2] = ae("p", { class: "mgt50" }, null, -1)),
1748
+ t.layer.showButton ? (L(), re("div", kn, [
1749
+ X(i.$slots, "btn", {}, () => [
1750
+ q(y, { onClick: l }, {
1751
+ default: D(() => [
1752
+ Q(J(i.$t("qu-xiao")), 1)
1753
+ ]),
1754
+ _: 1
1755
+ }),
1756
+ q(y, {
1757
+ type: "primary",
1758
+ loading: t.loading,
1759
+ onClick: H(o)
1760
+ }, {
1761
+ default: D(() => [
1762
+ Q(J(i.$t("ti-jiao")), 1)
1763
+ ]),
1764
+ _: 1
1765
+ }, 8, ["loading", "onClick"])
1766
+ ])
1767
+ ])) : ce("", !0)
1768
+ ]),
1769
+ _: 3
1770
+ }, 8, ["modelValue", "size", "title"])) : Vt((L(), re("div", _n, [
1771
+ q(w, {
1772
+ "close-on-click-modal": !1,
1773
+ modelValue: t.layer.show,
1774
+ "onUpdate:modelValue": r[1] || (r[1] = (p) => t.layer.show = p),
1775
+ title: t.layer.title,
1776
+ width: t.layer.width || 500,
1777
+ center: ""
1778
+ }, at({
1779
+ default: D(() => [
1780
+ X(i.$slots, "default")
1781
+ ]),
1782
+ _: 2
1783
+ }, [
1784
+ t.layer.showButton ? {
1785
+ name: "footer",
1786
+ fn: D(() => [
1787
+ X(i.$slots, "btn", {}, () => [
1788
+ q(y, { onClick: l }, {
1789
+ default: D(() => [
1790
+ Q(J(i.$t("qu-xiao")), 1)
1791
+ ]),
1792
+ _: 1
1793
+ }),
1794
+ q(y, {
1795
+ type: "primary",
1796
+ onClick: H(o)
1797
+ }, {
1798
+ default: D(() => [
1799
+ Q(J(i.$t("ti-jiao")), 1)
1800
+ ]),
1801
+ _: 1
1802
+ }, 8, ["onClick"])
1803
+ ])
1804
+ ]),
1805
+ key: "0"
1806
+ } : void 0
1807
+ ]), 1032, ["modelValue", "title", "width"])
1808
+ ])), [
1809
+ [H(Cn), t.layer.show]
1810
+ ]);
1811
+ };
1812
+ }
1813
+ };
1814
+ function no(t, e = {}) {
1815
+ const n = ve(), a = {
1511
1816
  inForm: !0,
1512
1817
  required: !0,
1513
1818
  ...e
1514
- }, a = {
1819
+ }, s = {
1515
1820
  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}$/,
1516
1821
  password: /(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/,
1517
1822
  email: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
1518
- }[n], { inForm: r, value: l, required: u, msg: d = t("validate.invalidInput") } = o;
1519
- return r ? function(k, x, C) {
1520
- if (u) {
1521
- a.test(x) ? C() : C(new Error(d));
1823
+ }[t], { inForm: o, value: l, required: i, msg: r = n("validate.invalidInput") } = a;
1824
+ return o ? function(y, b, w) {
1825
+ if (i) {
1826
+ s.test(b) ? w() : w(new Error(r));
1522
1827
  return;
1523
1828
  }
1524
- x && !a.test(x) ? C(new Error(d)) : C();
1525
- } : a.test(l);
1829
+ b && !s.test(b) ? w(new Error(r)) : w();
1830
+ } : s.test(l);
1526
1831
  }
1527
- class Kn {
1832
+ class oo {
1528
1833
  constructor(e = {}) {
1529
1834
  this.config = {
1530
1835
  clientCode: e.clientCode || "one-portal",
@@ -1546,8 +1851,8 @@ class Kn {
1546
1851
  */
1547
1852
  init() {
1548
1853
  this.log("OnePortal CAS SDK 初始化中..."), this.loadFromStorage();
1549
- const t = new URLSearchParams(window.location.search).get("ticket");
1550
- this.isLoggedIn() && this.config.loginCallback ? this.config.loginCallback(this.user, this.token) : t ? (this.log("检测到ST票据:", t), this.validateTicket(t)) : this.config.autoLogin && !this.isLoggedIn() && (this.log("用户未登录,准备跳转到CAS登录页面"), this.login());
1854
+ const n = new URLSearchParams(window.location.search).get("ticket");
1855
+ 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());
1551
1856
  }
1552
1857
  /**
1553
1858
  * 从本地存储加载数据
@@ -1612,20 +1917,20 @@ class Kn {
1612
1917
  async validateTicket(e) {
1613
1918
  try {
1614
1919
  this.log("验证ST票据:", e);
1615
- const t = await fetch(`${this.config.casServerUrl}/auth/validateST?ticket=${e}`, {
1920
+ const n = await fetch(`${this.config.casServerUrl}/auth/validateST?ticket=${e}`, {
1616
1921
  method: "GET",
1617
1922
  headers: {
1618
1923
  "Content-Type": "application/json"
1619
1924
  }
1620
1925
  });
1621
- if (!t.ok)
1622
- throw new Error(`HTTP ${t.status}: ${t.statusText}`);
1623
- const o = await t.json();
1624
- if (o.success && o.data)
1625
- return this.token = o.data.token, this.user = o.data.user, this.saveToStorage(), this.clearTicketFromUrl(), this.log("ST票据验证成功,用户登录成功:", this.user), this.config.loginCallback && this.config.loginCallback(this.user, this.token), !0;
1626
- throw new Error(o.message || "ST票据验证失败");
1627
- } catch (t) {
1628
- return this.log("ST票据验证失败:", t), this.handleError(t), !1;
1926
+ if (!n.ok)
1927
+ throw new Error(`HTTP ${n.status}: ${n.statusText}`);
1928
+ const a = await n.json();
1929
+ if (a.success && a.data)
1930
+ return this.token = a.data.token, this.user = a.data.user, this.saveToStorage(), this.clearTicketFromUrl(), this.log("ST票据验证成功,用户登录成功:", this.user), this.config.loginCallback && this.config.loginCallback(this.user, this.token), !0;
1931
+ throw new Error(a.message || "ST票据验证失败");
1932
+ } catch (n) {
1933
+ return this.log("ST票据验证失败:", n), this.handleError(n), !1;
1629
1934
  }
1630
1935
  }
1631
1936
  /**
@@ -1650,31 +1955,31 @@ class Kn {
1650
1955
  "Content-Type": "application/json"
1651
1956
  }
1652
1957
  });
1653
- } catch (t) {
1654
- this.log("调用服务端登出接口失败:", t);
1958
+ } catch (n) {
1959
+ this.log("调用服务端登出接口失败:", n);
1655
1960
  }
1656
1961
  this.token = null, this.user = null, this.clearStorage(), this.config.logoutCallback && this.config.logoutCallback(), e && this.login();
1657
- } catch (t) {
1658
- this.log("登出失败:", t), this.handleError(t);
1962
+ } catch (n) {
1963
+ this.log("登出失败:", n), this.handleError(n);
1659
1964
  }
1660
1965
  }
1661
1966
  /**
1662
1967
  * 发送带认证的HTTP请求
1663
1968
  */
1664
- async request(e, t = {}) {
1665
- const o = {
1969
+ async request(e, n = {}) {
1970
+ const a = {
1666
1971
  headers: {
1667
1972
  "Content-Type": "application/json",
1668
- ...t.headers
1973
+ ...n.headers
1669
1974
  },
1670
- ...t
1975
+ ...n
1671
1976
  };
1672
- o.headers.appId = this.config.clientCode, this.token && (o.headers.Authorization = `Bearer ${this.token}`);
1977
+ a.headers.appId = this.config.clientCode, this.token && (a.headers.Authorization = `Bearer ${this.token}`);
1673
1978
  try {
1674
- const a = await fetch(e, o);
1675
- return a.status === 401 ? (this.log("Token已过期,需要重新登录"), this.logout(), null) : a;
1676
- } catch (a) {
1677
- throw this.log("请求失败:", a), a;
1979
+ const s = await fetch(e, a);
1980
+ return s.status === 401 ? (this.log("Token已过期,需要重新登录"), this.logout(), null) : s;
1981
+ } catch (s) {
1982
+ throw this.log("请求失败:", s), s;
1678
1983
  }
1679
1984
  }
1680
1985
  /**
@@ -1684,9 +1989,9 @@ class Kn {
1684
1989
  try {
1685
1990
  const e = await this.request(`${this.config.casServerUrl}/auth/user`);
1686
1991
  if (e && e.ok) {
1687
- const t = await e.json();
1688
- if (t.success && t.data)
1689
- return this.user = t.data, this.saveToStorage(), this.user;
1992
+ const n = await e.json();
1993
+ if (n.success && n.data)
1994
+ return this.user = n.data, this.saveToStorage(), this.user;
1690
1995
  }
1691
1996
  return null;
1692
1997
  } catch (e) {
@@ -1720,8 +2025,8 @@ class Kn {
1720
2025
  /**
1721
2026
  * 设置配置
1722
2027
  */
1723
- setConfig(e, t) {
1724
- this.config[e] = t;
2028
+ setConfig(e, n) {
2029
+ this.config[e] = n;
1725
2030
  }
1726
2031
  /**
1727
2032
  * 获取配置
@@ -1730,234 +2035,235 @@ class Kn {
1730
2035
  return this.config[e];
1731
2036
  }
1732
2037
  }
1733
- function Hn(n, e = {}) {
1734
- const o = Object.assign({
2038
+ function lo(t, e = {}) {
2039
+ const a = Object.assign({
1735
2040
  manual: !1,
1736
2041
  // 手动执行
1737
2042
  log: !1,
1738
2043
  params: null,
1739
2044
  format: null
1740
- }, e), { manual: a, log: r, params: l = {}, cb: u, format: d } = o, k = R([]), x = R(!1), C = (v) => {
1741
- const b = v || l;
1742
- x.value = !0, n(b).then((g) => {
1743
- const { code: f, data: h, msg: _ } = g;
1744
- if (u) {
1745
- const { records: w, rows: S } = h || {}, z = w || S ? w || S : h;
1746
- k.value = Te(z, d), u(g);
2045
+ }, e), { manual: s, log: o, params: l = {}, cb: i, format: r } = a, y = R([]), b = R(!1), w = (p) => {
2046
+ const g = p || l;
2047
+ b.value = !0, t(g).then((m) => {
2048
+ const { code: u, data: h, msg: k } = m;
2049
+ if (i) {
2050
+ const { records: _, rows: C } = h || {}, S = _ || C ? _ || C : h;
2051
+ y.value = De(S, r), i(m);
1747
2052
  }
1748
2053
  if (h) {
1749
2054
  if (h.records != null || h.rows != null) {
1750
- const { records: w, rows: S, total: z = 0 } = h || {};
1751
- b && b.total != null && (l.total = parseInt(z)), k.value = Te(w || S || [], d);
2055
+ const { records: _, rows: C, total: S = 0 } = h || {};
2056
+ g && g.total != null && (l.total = parseInt(S)), y.value = De(_ || C || [], r);
1752
2057
  } else
1753
- k.value = Te(h, d);
1754
- r && console.log("useRequest-res", k.value);
2058
+ y.value = De(h, r);
2059
+ o && console.log("useRequest-res", y.value);
1755
2060
  }
1756
- }).catch((g) => {
1757
- u && (console.log("useRequestErr", g), u({ code: 500 }));
2061
+ }).catch((m) => {
2062
+ i && (console.log("useRequestErr", m), i({ code: 500 }));
1758
2063
  }).finally(() => {
1759
- x.value = !1;
2064
+ b.value = !1;
1760
2065
  });
1761
2066
  };
1762
- return a || C(), [x, k, C];
2067
+ return s || w(), [b, y, w];
1763
2068
  }
1764
- function Nn(n) {
1765
- const e = R(n), t = R(""), o = R("");
1766
- return qe(e, (a) => {
1767
- const r = a || ["", ""];
1768
- t.value = r[0], o.value = r[1];
1769
- }), [e, t, o];
2069
+ function ao(t) {
2070
+ const e = R(t), n = R(""), a = R("");
2071
+ return Pe(e, (s) => {
2072
+ const o = s || ["", ""];
2073
+ n.value = o[0], a.value = o[1];
2074
+ }), [e, n, a];
1770
2075
  }
1771
- function Zn(n) {
1772
- return Object.prototype.toString.call(n).slice(8, -1).toLowerCase();
2076
+ function so(t) {
2077
+ return Object.prototype.toString.call(t).slice(8, -1).toLowerCase();
1773
2078
  }
1774
- function Te(n, e) {
2079
+ function De(t, e) {
1775
2080
  if (!e)
1776
- return n;
1777
- if (n instanceof Array)
1778
- return n.map((o) => {
1779
- let a = {};
1780
- return e.forEach((r) => a[r] = o[r]), a;
2081
+ return t;
2082
+ if (t instanceof Array)
2083
+ return t.map((a) => {
2084
+ let s = {};
2085
+ return e.forEach((o) => s[o] = a[o]), s;
1781
2086
  });
1782
- let t = {};
1783
- return e.forEach((o) => t[o] = n[o]), t;
2087
+ let n = {};
2088
+ return e.forEach((a) => n[a] = t[a]), n;
1784
2089
  }
1785
- function Gn(n, e = []) {
1786
- const { locale: t } = ve(), o = R(n());
1787
- return qe(
1788
- [t, ...e],
2090
+ function ro(t, e = []) {
2091
+ const { locale: n } = me(), a = R(t());
2092
+ return Pe(
2093
+ [n, ...e],
1789
2094
  () => {
1790
- o.value = n();
2095
+ a.value = t();
1791
2096
  },
1792
2097
  { immediate: !0 }
1793
- ), o;
2098
+ ), a;
1794
2099
  }
1795
- function Wn(n, e = "zh_cn", t = "en_us") {
1796
- if (!n)
2100
+ function io(t, e = "zh_cn", n = "en_us") {
2101
+ if (!t)
1797
2102
  return "-";
1798
- const o = { en_us: t, zh_cn: e }, r = Pe().global.locale.value;
1799
- return n[o[r]] || n[e] || "-";
2103
+ const a = { en_us: n, zh_cn: e }, o = Ye().global.locale.value;
2104
+ return t[a[o]] || t[e] || "-";
1800
2105
  }
1801
- function Jn(n, e) {
1802
- let t = Vt;
1803
- return typeof n == "string" && n.length > 0 && (t = je(n).mapState), ht(e, t);
2106
+ function co(t, e) {
2107
+ let n = Pt;
2108
+ return typeof t == "string" && t.length > 0 && (n = Be(t).mapState), bt(e, n);
1804
2109
  }
1805
- function Qn(n, e) {
1806
- let t = Mt;
1807
- return typeof n == "string" && n.length > 0 && (t = je(n).mapGetters), ht(e, t);
2110
+ function uo(t, e) {
2111
+ let n = Rt;
2112
+ return typeof t == "string" && t.length > 0 && (n = Be(t).mapGetters), bt(e, n);
1808
2113
  }
1809
- function Xn(n, e) {
1810
- let t = At;
1811
- return typeof n == "string" && n.length > 0 && (t = je(n).mapActions), mn(e, t);
2114
+ function fo(t, e) {
2115
+ let n = Bt;
2116
+ return typeof t == "string" && t.length > 0 && (n = Be(t).mapActions), $n(e, n);
1812
2117
  }
1813
- function ht(n, e) {
1814
- const t = at(), o = e(n), a = {};
1815
- return Object.keys(o).forEach((r) => {
1816
- const l = o[r].bind({ $store: t });
1817
- a[r] = ne(l);
1818
- }), a;
2118
+ function bt(t, e) {
2119
+ const n = ut(), a = e(t), s = {};
2120
+ return Object.keys(a).forEach((o) => {
2121
+ const l = a[o].bind({ $store: n });
2122
+ s[o] = se(l);
2123
+ }), s;
1819
2124
  }
1820
- function mn(n, e) {
1821
- const t = at(), o = e(n), a = {};
1822
- return Object.keys(o).forEach((r) => {
1823
- a[r] = o[r].bind({ $store: t });
1824
- }), a;
2125
+ function $n(t, e) {
2126
+ const n = ut(), a = e(t), s = {};
2127
+ return Object.keys(a).forEach((o) => {
2128
+ s[o] = a[o].bind({ $store: n });
2129
+ }), s;
1825
2130
  }
1826
- function Ee(n) {
1827
- return typeof n == "function" || Object.prototype.toString.call(n) === "[object Object]" && !Tt(n);
2131
+ function ze(t) {
2132
+ return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !qt(t);
1828
2133
  }
1829
- function eo() {
1830
- Ce.renderer.add("Enum", {
2134
+ function ho() {
2135
+ xe.renderer.add("Enum", {
1831
2136
  // 默认显示模板
1832
- renderTableDefault(n, e) {
1833
- let t;
2137
+ renderTableDefault(t, e) {
2138
+ let n;
1834
2139
  if ([null, void 0].includes(e.row[e.column.field]))
1835
2140
  return "-";
1836
- const o = e.row[e.column.field];
1837
- if (n.type == "tag") {
1838
- let a;
1839
- return P(M("el-text"), {
1840
- type: n.enum.getTag(o)
1841
- }, Ee(a = n.enum.getName(o)) ? a : {
1842
- default: () => [a]
2141
+ const a = e.row[e.column.field];
2142
+ if (t.type == "tag") {
2143
+ let s;
2144
+ return q(z("el-text"), {
2145
+ type: t.enum.getTag(a)
2146
+ }, ze(s = t.enum.getName(a)) ? s : {
2147
+ default: () => [s]
1843
2148
  });
1844
2149
  }
1845
- return P(M("el-text"), null, Ee(t = n.enum.getName(o)) ? t : {
1846
- default: () => [t]
2150
+ return q(z("el-text"), null, ze(n = t.enum.getName(a)) ? n : {
2151
+ default: () => [n]
1847
2152
  });
1848
2153
  }
1849
- }), Ce.renderer.add("InputNumber", {
2154
+ }), xe.renderer.add("InputNumber", {
1850
2155
  // 默认显示模板
1851
- renderTableDefault(n, e) {
1852
- return P(xt, he({
2156
+ renderTableDefault(t, e) {
2157
+ return q(It, he({
1853
2158
  modelValue: e.row[e.column.field],
1854
- "onUpdate:modelValue": (t) => e.row[e.column.field] = t
1855
- }, n.props, {
2159
+ "onUpdate:modelValue": (n) => e.row[e.column.field] = n
2160
+ }, t.props, {
1856
2161
  "step-strictly": !0,
1857
2162
  "value-on-clear": 0
1858
2163
  }), null);
1859
2164
  }
1860
- }), Ce.renderer.add("TrueFalse", {
2165
+ }), xe.renderer.add("TrueFalse", {
1861
2166
  // 默认显示模板
1862
- renderTableDefault(n, e) {
2167
+ renderTableDefault(t, e) {
1863
2168
  const {
1864
- locale: t
1865
- } = ve();
1866
- let o = t.value == "zh_cn";
1867
- return P(wt, {
2169
+ locale: n
2170
+ } = me();
2171
+ let a = n.value == "zh_cn";
2172
+ return q(Lt, {
1868
2173
  type: e.row[e.column.field] ? "success" : "danger"
1869
2174
  }, {
1870
- default: () => [e.row[e.column.field] ? o ? "是" : "YES" : o ? "否" : "NO"]
2175
+ default: () => [e.row[e.column.field] ? a ? "是" : "YES" : a ? "否" : "NO"]
1871
2176
  });
1872
2177
  }
1873
- }), Ce.renderer.add("I18n", {
2178
+ }), xe.renderer.add("I18n", {
1874
2179
  // 默认显示模板
1875
- renderTableDefault(n, e) {
2180
+ renderTableDefault(t, e) {
1876
2181
  const {
1877
- locale: t
1878
- } = ve();
1879
- let o = t.value == "zh_cn" ? e.column.field : n.fieldEn;
1880
- return e.row[o] || e.row[e.column.field];
2182
+ locale: n
2183
+ } = me();
2184
+ let a = n.value == "zh_cn" ? e.column.field : t.fieldEn;
2185
+ return e.row[a] || e.row[e.column.field];
1881
2186
  }
1882
- }), Ce.renderer.add("Link", {
2187
+ }), xe.renderer.add("Link", {
1883
2188
  // 默认显示模板
1884
- renderTableDefault(n, e) {
1885
- var u;
1886
- let t = e.column.field;
1887
- const o = Ot(), {
1888
- multiple: a,
1889
- to: r
1890
- } = n;
1891
- if (!a)
1892
- return P(Ze, {
2189
+ renderTableDefault(t, e) {
2190
+ var i;
2191
+ let n = e.column.field;
2192
+ const a = Ut(), {
2193
+ multiple: s,
2194
+ to: o
2195
+ } = t;
2196
+ if (!s)
2197
+ return q(Je, {
1893
2198
  underline: "never",
1894
2199
  type: "primary",
1895
- onclick: () => o.push({
1896
- path: r,
2200
+ onclick: () => a.push({
2201
+ path: o,
1897
2202
  query: {
1898
- [t]: e.row[t]
2203
+ [n]: e.row[n]
1899
2204
  }
1900
2205
  })
1901
2206
  }, {
1902
- default: () => [e.row[t]]
2207
+ default: () => [e.row[n]]
1903
2208
  });
1904
- const l = ((u = e.row[t]) == null ? void 0 : u.split(",")) || [];
1905
- return l.map((d, k) => P("span", null, [P(Ze, {
2209
+ const l = ((i = e.row[n]) == null ? void 0 : i.split(",")) || [];
2210
+ return l.map((r, y) => q("span", null, [q(Je, {
1906
2211
  underline: "never",
1907
2212
  type: "primary",
1908
- onclick: () => o.push({
1909
- path: r,
2213
+ onclick: () => a.push({
2214
+ path: o,
1910
2215
  query: {
1911
- [t]: d
2216
+ [n]: r
1912
2217
  }
1913
2218
  })
1914
- }, Ee(d) ? d : {
1915
- default: () => [d]
1916
- }), k < l.length - 1 ? "," : ""]));
2219
+ }, ze(r) ? r : {
2220
+ default: () => [r]
2221
+ }), y < l.length - 1 ? "," : ""]));
1917
2222
  }
1918
2223
  });
1919
2224
  }
1920
2225
  export {
1921
- en as CmpDictionary,
1922
- dt as CmpIcon,
1923
- qn as ConfrimButton,
1924
- Bn as DownExcelTemp,
1925
- jn as ImportButton,
1926
- $n as LayOutForm,
1927
- Rn as ListPage,
1928
- Kn as OnePortalCasSDK,
1929
- dn as SearchBar,
1930
- Je as StatusMap,
1931
- Ln as _toRaw,
1932
- Zn as _typeOf,
1933
- En as arrToStatusMap,
1934
- Tn as arrayToTree,
1935
- On as checkFileSize,
1936
- Yn as creatValidator,
1937
- Mn as createImportFields,
1938
- Vn as createListPageId,
1939
- Me as en_us,
1940
- Kt as exportExcel,
1941
- Pe as getI18n,
1942
- Ue as getI18nT,
1943
- fn as getListPageConfig,
1944
- Wn as getLocaleValue,
1945
- An as getValueBykey,
1946
- In as importExcel,
1947
- Rt as messages,
1948
- eo as registerVxeRenderers,
1949
- Un as resetListPageConfig,
1950
- Pn as setListPageConfig,
1951
- Bt as setupI18n,
1952
- Fn as sleep,
1953
- ut as stringToArray,
1954
- Dn as stripHtmlTags,
1955
- zn as unicode2Str,
1956
- Xn as useActions,
1957
- Nn as useDatePicker,
1958
- Qn as useGetters,
1959
- Gn as useI18nReState,
1960
- Hn as useRequest,
1961
- Jn as useState,
1962
- Ve as zh_cn
2226
+ rn as CmpDictionary,
2227
+ yt as CmpIcon,
2228
+ Zn as ConfrimButton,
2229
+ eo as DownExcelTemp,
2230
+ Gn as ImportButton,
2231
+ Vn as LayOutForm,
2232
+ to as Layer,
2233
+ Qn as ListPage,
2234
+ oo as OnePortalCasSDK,
2235
+ vn as SearchBar,
2236
+ et as StatusMap,
2237
+ Un as _toRaw,
2238
+ so as _typeOf,
2239
+ Rn as arrToStatusMap,
2240
+ Pn as arrayToTree,
2241
+ Kn as checkFileSize,
2242
+ no as creatValidator,
2243
+ Nn as createImportFields,
2244
+ Hn as createListPageId,
2245
+ Ae as en_us,
2246
+ An as exportExcel,
2247
+ Ye as getI18n,
2248
+ ve as getI18nT,
2249
+ bn as getListPageConfig,
2250
+ io as getLocaleValue,
2251
+ Wn as getValueBykey,
2252
+ qn as importExcel,
2253
+ Wt as messages,
2254
+ ho as registerVxeRenderers,
2255
+ Xn as resetListPageConfig,
2256
+ Jn as setListPageConfig,
2257
+ Zt as setupI18n,
2258
+ jn as sleep,
2259
+ pt as stringToArray,
2260
+ Bn as stripHtmlTags,
2261
+ Yn as unicode2Str,
2262
+ fo as useActions,
2263
+ ao as useDatePicker,
2264
+ uo as useGetters,
2265
+ ro as useI18nReState,
2266
+ lo as useRequest,
2267
+ co as useState,
2268
+ qe as zh_cn
1963
2269
  };