joy-admin-components 0.1.43 → 0.1.44

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,24 +1,24 @@
1
1
  import { ElForm as dt, ElRow as ft, ElCol as ht, ElInputNumber as mt, ElText as gt, ElLink as je } from "element-plus";
2
- import { defineComponent as Ye, ref as q, onMounted as He, h as ke, mergeModels as qe, useAttrs as pt, useModel as vt, computed as ce, resolveComponent as O, openBlock as L, createBlock as U, mergeProps as me, unref as K, withCtx as R, renderSlot as ae, createVNode as G, createTextVNode as ee, toDisplayString as te, createCommentVNode as se, createElementBlock as le, Fragment as Se, renderList as Ne, withModifiers as Ie, resolveDynamicComponent as Ke, createElementVNode as re, withKeys as bt, normalizeStyle as yt, normalizeClass as Ee, reactive as pe, nextTick as _e, onUnmounted as Ct, watch as Ze } from "vue";
3
- import { saveAs as xt } from "file-saver";
2
+ import { defineComponent as Ye, ref as q, onMounted as He, h as ke, mergeModels as qe, useAttrs as pt, useModel as vt, computed as ce, resolveComponent as O, openBlock as L, createBlock as U, mergeProps as me, unref as K, withCtx as R, renderSlot as ae, createVNode as G, createTextVNode as ee, toDisplayString as te, createCommentVNode as se, createElementBlock as le, Fragment as Se, renderList as Ne, withModifiers as Ie, resolveDynamicComponent as Ke, createElementVNode as re, withKeys as bt, normalizeStyle as yt, normalizeClass as Ee, reactive as pe, nextTick as _e, onUpdated as Ct, onUnmounted as xt, watch as Ze } from "vue";
3
+ import { saveAs as wt } from "file-saver";
4
4
  import Ge from "exceljs";
5
5
  import ve from "dayjs";
6
- import { createI18n as wt, useI18n as ue } from "vue-i18n";
6
+ import { createI18n as kt, useI18n as ue } from "vue-i18n";
7
7
  import { debounce as We, cloneDeep as Je, isArray as Pe } from "lodash";
8
- import { createNamespacedHelpers as Oe, useStore as Qe, mapState as kt, mapGetters as _t, mapActions as $t } from "vuex";
8
+ import { createNamespacedHelpers as Oe, useStore as Qe, mapState as _t, mapGetters as $t, mapActions as St } from "vuex";
9
9
  import { VxeUI as he } from "vxe-pc-ui";
10
- import { useRouter as St } from "vue-router";
11
- const mn = Ye({
10
+ import { useRouter as It } from "vue-router";
11
+ const gn = Ye({
12
12
  name: "LayOutForm",
13
13
  setup(n, { slots: e, attrs: t, emit: l }) {
14
- const o = q(null), r = () => e.default ? e.default().filter((u) => u.type !== Symbol.for("v-cmt")).map((u) => u.type === Symbol.for("v-fgt") ? u.children : u).flat().map(
15
- (u) => {
14
+ const o = q(null), r = () => e.default ? e.default().filter((d) => d.type !== Symbol.for("v-cmt")).map((d) => d.type === Symbol.for("v-fgt") ? d.children : d).flat().map(
15
+ (d) => {
16
16
  var i;
17
17
  return ke(
18
18
  ht,
19
- { span: ((i = u.props) == null ? void 0 : i.span) || 24 },
19
+ { span: ((i = d.props) == null ? void 0 : i.span) || 24 },
20
20
  {
21
- default: () => u
21
+ default: () => d
22
22
  }
23
23
  );
24
24
  }
@@ -46,44 +46,44 @@ var tt = { exports: {} };
46
46
  n.exports = l();
47
47
  })(Xe, function() {
48
48
  var t = "minute", l = /[+-]\d\d(?::?\d\d)?/g, o = /([+-]|\d\d)/g;
49
- return function(r, a, u) {
49
+ return function(r, a, d) {
50
50
  var i = a.prototype;
51
- u.utc = function(d) {
52
- var f = { date: d, utc: !0, args: arguments };
51
+ d.utc = function(u) {
52
+ var f = { date: u, utc: !0, args: arguments };
53
53
  return new a(f);
54
- }, i.utc = function(d) {
55
- var f = u(this.toDate(), { locale: this.$L, utc: !0 });
56
- return d ? f.add(this.utcOffset(), t) : f;
54
+ }, i.utc = function(u) {
55
+ var f = d(this.toDate(), { locale: this.$L, utc: !0 });
56
+ return u ? f.add(this.utcOffset(), t) : f;
57
57
  }, i.local = function() {
58
- return u(this.toDate(), { locale: this.$L, utc: !1 });
58
+ return d(this.toDate(), { locale: this.$L, utc: !1 });
59
59
  };
60
60
  var v = i.parse;
61
- i.parse = function(d) {
62
- d.utc && (this.$u = !0), this.$utils().u(d.$offset) || (this.$offset = d.$offset), v.call(this, d);
61
+ i.parse = function(u) {
62
+ u.utc && (this.$u = !0), this.$utils().u(u.$offset) || (this.$offset = u.$offset), v.call(this, u);
63
63
  };
64
64
  var g = i.init;
65
65
  i.init = function() {
66
66
  if (this.$u) {
67
- var d = this.$d;
68
- this.$y = d.getUTCFullYear(), this.$M = d.getUTCMonth(), this.$D = d.getUTCDate(), this.$W = d.getUTCDay(), this.$H = d.getUTCHours(), this.$m = d.getUTCMinutes(), this.$s = d.getUTCSeconds(), this.$ms = d.getUTCMilliseconds();
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
70
  g.call(this);
71
71
  };
72
72
  var k = i.utcOffset;
73
- i.utcOffset = function(d, f) {
73
+ i.utcOffset = function(u, f) {
74
74
  var $ = this.$utils().u;
75
- if ($(d))
75
+ if ($(u))
76
76
  return this.$u ? 0 : $(this.$offset) ? k.call(this) : this.$offset;
77
- if (typeof d == "string" && (d = function(T) {
77
+ if (typeof u == "string" && (u = function(T) {
78
78
  T === void 0 && (T = "");
79
79
  var Y = T.match(l);
80
80
  if (!Y)
81
81
  return null;
82
82
  var _ = ("" + Y[0]).match(o) || ["-", 0, 0], y = _[0], p = 60 * +_[1] + +_[2];
83
83
  return p === 0 ? 0 : y === "+" ? p : -p;
84
- }(d), d === null))
84
+ }(u), u === null))
85
85
  return this;
86
- var h = Math.abs(d) <= 16 ? 60 * d : d;
86
+ var h = Math.abs(u) <= 16 ? 60 * u : u;
87
87
  if (h === 0)
88
88
  return this.utc(f);
89
89
  var m = this.clone();
@@ -93,12 +93,12 @@ var tt = { exports: {} };
93
93
  return (m = this.local().add(h + I, t)).$offset = h, m.$x.$localOffset = I, m;
94
94
  };
95
95
  var x = i.format;
96
- i.format = function(d) {
97
- var f = d || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
96
+ i.format = function(u) {
97
+ var f = u || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
98
98
  return x.call(this, f);
99
99
  }, i.valueOf = function() {
100
- var d = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
101
- return this.$d.valueOf() - 6e4 * d;
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
102
  }, i.isUTC = function() {
103
103
  return !!this.$u;
104
104
  }, i.toISOString = function() {
@@ -107,21 +107,21 @@ var tt = { exports: {} };
107
107
  return this.toDate().toUTCString();
108
108
  };
109
109
  var w = i.toDate;
110
- i.toDate = function(d) {
111
- return d === "s" && this.$offset ? u(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : w.call(this);
110
+ i.toDate = function(u) {
111
+ return u === "s" && this.$offset ? d(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : w.call(this);
112
112
  };
113
113
  var b = i.diff;
114
- i.diff = function(d, f, $) {
115
- if (d && this.$u === d.$u)
116
- return b.call(this, d, f, $);
117
- var h = this.local(), m = u(d).local();
114
+ i.diff = function(u, f, $) {
115
+ if (u && this.$u === u.$u)
116
+ return b.call(this, u, f, $);
117
+ var h = this.local(), m = d(u).local();
118
118
  return b.call(h, m, f, $);
119
119
  };
120
120
  };
121
121
  });
122
122
  })(tt);
123
- var It = tt.exports;
124
- const Et = /* @__PURE__ */ et(It);
123
+ var Et = tt.exports;
124
+ const Lt = /* @__PURE__ */ et(Et);
125
125
  var nt = { exports: {} };
126
126
  (function(n, e) {
127
127
  (function(t, l) {
@@ -129,35 +129,35 @@ var nt = { exports: {} };
129
129
  })(Xe, function() {
130
130
  var t = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, l = {};
131
131
  return function(o, r, a) {
132
- var u, i = function(x, w, b) {
132
+ var d, i = function(x, w, b) {
133
133
  b === void 0 && (b = {});
134
- var d = new Date(x), f = function($, h) {
134
+ var u = new Date(x), f = function($, h) {
135
135
  h === void 0 && (h = {});
136
136
  var m = h.timeZoneName || "short", I = $ + "|" + m, T = l[I];
137
137
  return T || (T = 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: m }), l[I] = T), T;
138
138
  }(w, b);
139
- return f.formatToParts(d);
139
+ return f.formatToParts(u);
140
140
  }, v = function(x, w) {
141
- for (var b = i(x, w), d = [], f = 0; f < b.length; f += 1) {
141
+ for (var b = i(x, w), u = [], f = 0; f < b.length; f += 1) {
142
142
  var $ = b[f], h = $.type, m = $.value, I = t[h];
143
- I >= 0 && (d[I] = parseInt(m, 10));
143
+ I >= 0 && (u[I] = parseInt(m, 10));
144
144
  }
145
- var T = d[3], Y = T === 24 ? 0 : T, _ = d[0] + "-" + d[1] + "-" + d[2] + " " + Y + ":" + d[4] + ":" + d[5] + ":000", y = +x;
145
+ var T = u[3], Y = T === 24 ? 0 : T, _ = u[0] + "-" + u[1] + "-" + u[2] + " " + Y + ":" + u[4] + ":" + u[5] + ":000", y = +x;
146
146
  return (a.utc(_).valueOf() - (y -= y % 1e3)) / 6e4;
147
147
  }, g = r.prototype;
148
148
  g.tz = function(x, w) {
149
- x === void 0 && (x = u);
150
- var b, d = this.utcOffset(), f = this.toDate(), $ = f.toLocaleString("en-US", { timeZone: x }), h = Math.round((f - new Date($)) / 1e3 / 60), m = 15 * -Math.round(f.getTimezoneOffset() / 15) - h;
149
+ x === void 0 && (x = d);
150
+ var b, u = this.utcOffset(), f = this.toDate(), $ = f.toLocaleString("en-US", { timeZone: x }), h = Math.round((f - new Date($)) / 1e3 / 60), m = 15 * -Math.round(f.getTimezoneOffset() / 15) - h;
151
151
  if (!Number(m))
152
152
  b = this.utcOffset(0, w);
153
153
  else if (b = a($, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(m, !0), w) {
154
154
  var I = b.utcOffset();
155
- b = b.add(d - I, "minute");
155
+ b = b.add(u - I, "minute");
156
156
  }
157
157
  return b.$x.$timezone = x, b;
158
158
  }, g.offsetName = function(x) {
159
- var w = this.$x.$timezone || a.tz.guess(), b = i(this.valueOf(), w, { timeZoneName: x }).find(function(d) {
160
- return d.type.toLowerCase() === "timezonename";
159
+ var w = this.$x.$timezone || a.tz.guess(), b = i(this.valueOf(), w, { timeZoneName: x }).find(function(u) {
160
+ return u.type.toLowerCase() === "timezonename";
161
161
  });
162
162
  return b && b.value;
163
163
  };
@@ -168,7 +168,7 @@ var nt = { exports: {} };
168
168
  var b = a(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
169
169
  return k.call(b, x, w).tz(this.$x.$timezone, !0);
170
170
  }, a.tz = function(x, w, b) {
171
- var d = b && w, f = b || w || u, $ = v(+a(), f);
171
+ var u = b && w, f = b || w || d, $ = v(+a(), f);
172
172
  if (typeof x != "string")
173
173
  return a(x).tz(f);
174
174
  var h = function(Y, _, y) {
@@ -177,18 +177,18 @@ var nt = { exports: {} };
177
177
  return [p, _];
178
178
  var z = v(p -= 60 * (P - _) * 1e3, y);
179
179
  return P === z ? [p, P] : [Y - 60 * Math.min(P, z) * 1e3, Math.max(P, z)];
180
- }(a.utc(x, d).valueOf(), $, f), m = h[0], I = h[1], T = a(m).utcOffset(I);
180
+ }(a.utc(x, u).valueOf(), $, f), m = h[0], I = h[1], T = a(m).utcOffset(I);
181
181
  return T.$x.$timezone = f, T;
182
182
  }, a.tz.guess = function() {
183
183
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
184
184
  }, a.tz.setDefault = function(x) {
185
- u = x;
185
+ d = x;
186
186
  };
187
187
  };
188
188
  });
189
189
  })(nt);
190
- var Lt = nt.exports;
191
- const Tt = /* @__PURE__ */ et(Lt), Le = {
190
+ var Tt = nt.exports;
191
+ const Ft = /* @__PURE__ */ et(Tt), Le = {
192
192
  // 组件通用文本
193
193
  "dao-ru": "导入",
194
194
  "quan-xuan": "全选",
@@ -248,32 +248,32 @@ const Tt = /* @__PURE__ */ et(Lt), Le = {
248
248
  tools: {
249
249
  keysLengthError: "Keys length must be greater than 2, default first two are label and value"
250
250
  }
251
- }, Ft = {
251
+ }, Ot = {
252
252
  zh_cn: Le,
253
253
  en: Te
254
254
  };
255
255
  let ie = null;
256
- function Ot(n = null) {
256
+ function Dt(n = null) {
257
257
  if (n) {
258
258
  const { global: e } = n;
259
259
  return e.messages.value.zh_cn ? e.mergeLocaleMessage("zh_cn", Le) : e.setLocaleMessage("zh_cn", Le), e.messages.value.en ? e.mergeLocaleMessage("en", Te) : e.setLocaleMessage("en", Te), ie = n, n;
260
260
  }
261
- return ie || (ie = wt({
261
+ return ie || (ie = kt({
262
262
  legacy: !1,
263
263
  locale: "zh_cn",
264
264
  fallbackLocale: "zh_cn",
265
- messages: Ft
265
+ messages: Ot
266
266
  })), ie;
267
267
  }
268
268
  function ot() {
269
- return ie || Ot();
269
+ return ie || Dt();
270
270
  }
271
271
  function De() {
272
272
  return ot().global.t;
273
273
  }
274
- ve.extend(Et);
275
- ve.extend(Tt);
276
- async function gn(n, e) {
274
+ ve.extend(Lt);
275
+ ve.extend(Ft);
276
+ async function pn(n, e) {
277
277
  const { fields: t, range: l = 1 } = e;
278
278
  if (!t) {
279
279
  const a = De();
@@ -282,7 +282,7 @@ async function gn(n, e) {
282
282
  let o = new Ge.Workbook();
283
283
  await o.xlsx.load(n);
284
284
  const r = {};
285
- return o.eachSheet(function(a, u) {
285
+ return o.eachSheet(function(a, d) {
286
286
  const i = [];
287
287
  a.eachRow(function(v, g) {
288
288
  if (g > l) {
@@ -295,54 +295,54 @@ async function gn(n, e) {
295
295
  }), r[a._name] = i;
296
296
  }), o = null, r;
297
297
  }
298
- const Dt = {
298
+ const zt = {
299
299
  columnWidth: 30
300
300
  };
301
- async function zt(n, e, t = [], l = {}) {
301
+ async function Mt(n, e, t = [], l = {}) {
302
302
  if (!n || !e)
303
303
  return;
304
- const { columnStyle: o } = l, { columnWidth: r } = Dt;
304
+ const { columnStyle: o } = l, { columnWidth: r } = zt;
305
305
  e.forEach((i) => {
306
306
  i.width = i.width ? i.width : r;
307
307
  });
308
- const { workbook: a, worksheet: u } = Mt();
309
- u.columns = e, u.addRows(t), o && await Rt(a, u, o);
308
+ const { workbook: a, worksheet: d } = Rt();
309
+ d.columns = e, d.addRows(t), o && await At(a, d, o);
310
310
  try {
311
311
  const i = await a.xlsx.writeBuffer(), v = new File([i], n, {
312
312
  type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
313
313
  });
314
- xt(v);
314
+ wt(v);
315
315
  } catch (i) {
316
316
  console.log(i);
317
317
  }
318
318
  }
319
- function Mt() {
319
+ function Rt() {
320
320
  const n = new Ge.Workbook();
321
321
  n.creator = "distributor System", n.lastModifiedBy = "distributor System", n.created = /* @__PURE__ */ new Date(), n.modified = /* @__PURE__ */ new Date(), n.lastPrinted = /* @__PURE__ */ new Date();
322
322
  const e = n.addWorksheet("Sheet1");
323
323
  return { workbook: n, worksheet: e };
324
324
  }
325
- async function Rt(n, e, t) {
325
+ async function At(n, e, t) {
326
326
  const l = Object.keys(t);
327
327
  for (const o of l) {
328
328
  const r = t[o], { type: a } = r;
329
329
  switch (a) {
330
330
  case "IMG":
331
- await At(n, e, o);
331
+ await Vt(n, e, o);
332
332
  break;
333
333
  }
334
334
  }
335
335
  }
336
- async function At(n, e, t, l) {
336
+ async function Vt(n, e, t, l) {
337
337
  const o = e.getColumn(t), r = o.values;
338
- e.getColumn(t).width = 20, e.eachRow((a, u) => {
339
- u > 1 && (a.height = 40);
338
+ e.getColumn(t).width = 20, e.eachRow((a, d) => {
339
+ d > 1 && (a.height = 40);
340
340
  });
341
- for (let a = 0, u = r.length; a < u; a++) {
341
+ for (let a = 0, d = r.length; a < d; a++) {
342
342
  if (a < 2)
343
343
  continue;
344
344
  let i = r[a];
345
- i && (e.getCell(o.letter + a).value = "", await Vt(n, e, i, {
345
+ i && (e.getCell(o.letter + a).value = "", await Ut(n, e, i, {
346
346
  width: 100,
347
347
  height: 50,
348
348
  col: o._number - 1,
@@ -350,8 +350,8 @@ async function At(n, e, t, l) {
350
350
  }));
351
351
  }
352
352
  }
353
- async function Vt(n, e, t, l) {
354
- const { col: o, row: r, width: a, height: u } = l, { success: i, base64: v } = await Ut(t, 0.3);
353
+ async function Ut(n, e, t, l) {
354
+ const { col: o, row: r, width: a, height: d } = l, { success: i, base64: v } = await jt(t, 0.3);
355
355
  if (i) {
356
356
  const g = n.addImage({
357
357
  base64: v,
@@ -359,11 +359,11 @@ async function Vt(n, e, t, l) {
359
359
  });
360
360
  e.addImage(g, {
361
361
  tl: { col: o, row: r },
362
- ext: { width: a, height: u }
362
+ ext: { width: a, height: d }
363
363
  });
364
364
  }
365
365
  }
366
- function Ut(n, e = 1) {
366
+ function jt(n, e = 1) {
367
367
  const t = new Image();
368
368
  return t.setAttribute("crossOrigin", "anonymous"), t.crossOrigin = "anonymous", t.src = n, new Promise((l, o) => {
369
369
  t.onload = () => {
@@ -378,7 +378,7 @@ function Ut(n, e = 1) {
378
378
  };
379
379
  });
380
380
  }
381
- function jt(n) {
381
+ function qt(n) {
382
382
  if (n < 26)
383
383
  return String.fromCharCode(65 + n);
384
384
  {
@@ -386,17 +386,17 @@ function jt(n) {
386
386
  return e + t;
387
387
  }
388
388
  }
389
- function pn(n) {
389
+ function vn(n) {
390
390
  return new Promise((e) => {
391
391
  setTimeout(() => {
392
392
  e();
393
393
  }, n);
394
394
  });
395
395
  }
396
- function vn(n) {
396
+ function bn(n) {
397
397
  return JSON.parse(JSON.stringify(n));
398
398
  }
399
- function bn(n) {
399
+ function yn(n) {
400
400
  let e = [], t = {}, l = (o, r) => Object.prototype.hasOwnProperty.call(o, r);
401
401
  for (const o of n) {
402
402
  t[o.id] = {
@@ -452,7 +452,7 @@ class Be {
452
452
  return this.map.has(e);
453
453
  }
454
454
  }
455
- function yn(n, e = [], t = "i18nName") {
455
+ function Cn(n, e = [], t = "i18nName") {
456
456
  if (n.length == 0)
457
457
  return new Be([]);
458
458
  if (e.length < 2) {
@@ -461,33 +461,33 @@ function yn(n, e = [], t = "i18nName") {
461
461
  }
462
462
  let l = n.map((o) => {
463
463
  let r = {};
464
- return t && (r.labelEn = o[t]), e.forEach((a, u) => {
465
- u === 0 ? r.label = o[a] : u === 1 ? r.value = o[a] : r[a] = o[a];
464
+ return t && (r.labelEn = o[t]), e.forEach((a, d) => {
465
+ d === 0 ? r.label = o[a] : d === 1 ? r.value = o[a] : r[a] = o[a];
466
466
  }), r;
467
467
  });
468
468
  return new Be(l);
469
469
  }
470
- function Cn(n) {
470
+ function xn(n) {
471
471
  return n ? n.replace(/<[^>]+>/g, "") : "";
472
472
  }
473
- function xn(n) {
473
+ function wn(n) {
474
474
  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)))) : "";
475
475
  }
476
- function wn(n, e = 10) {
476
+ function kn(n, e = 10) {
477
477
  let t = 1048576 * e;
478
478
  return !(n.size > t);
479
479
  }
480
- function kn(n) {
480
+ function _n(n) {
481
481
  return Array.from(10).fill(0).map((t, l) => n + "_" + l);
482
482
  }
483
- function _n(n) {
483
+ function $n(n) {
484
484
  let e = {};
485
485
  return n.map((t, l) => {
486
- let { key: o, option: r, type: a } = t, u = jt(l);
487
- r ? e[o] = `${u}---option` : a === "image" ? e[o] = `${u}---image` : e[o] = u;
486
+ let { key: o, option: r, type: a } = t, d = qt(l);
487
+ r ? e[o] = `${d}---option` : a === "image" ? e[o] = `${d}---image` : e[o] = d;
488
488
  }), e;
489
489
  }
490
- function $n(n, e) {
490
+ function Sn(n, e) {
491
491
  return e.split(".").reduce((t, l) => t && t[l], n);
492
492
  }
493
493
  const ge = (n, e) => {
@@ -495,7 +495,7 @@ const ge = (n, e) => {
495
495
  for (const [l, o] of e)
496
496
  t[l] = o;
497
497
  return t;
498
- }, qt = {
498
+ }, Pt = {
499
499
  __name: "index",
500
500
  props: /* @__PURE__ */ qe({
501
501
  api: {
@@ -535,10 +535,10 @@ const ge = (n, e) => {
535
535
  }),
536
536
  emits: /* @__PURE__ */ qe(["success", "change"], ["update:modelValue"]),
537
537
  setup(n, { emit: e }) {
538
- const t = n, l = pt(), { t: o, locale: r } = ue(), a = vt(n, "modelValue"), u = q(""), i = ce(() => {
538
+ const t = n, l = pt(), { t: o, locale: r } = ue(), a = vt(n, "modelValue"), d = q(""), i = ce(() => {
539
539
  if (l.remote !== void 0)
540
540
  return t.data;
541
- const h = lt(u.value), { data: m, labelValue: I } = t, T = m || k.value;
541
+ const h = lt(d.value), { data: m, labelValue: I } = t, T = m || k.value;
542
542
  if (h.length == 0)
543
543
  return T;
544
544
  const { label: Y, labelEn: _ } = I;
@@ -574,7 +574,7 @@ const ge = (n, e) => {
574
574
  }), m.join("-");
575
575
  }
576
576
  };
577
- function d(h) {
577
+ function u(h) {
578
578
  a.value = h ? i.value.map((m) => m[t.labelValue.value]) : [], g("change", a.value);
579
579
  }
580
580
  function f(h) {
@@ -591,7 +591,7 @@ const ge = (n, e) => {
591
591
  filterable: "",
592
592
  "collapse-tags": "",
593
593
  "collapse-tags-tooltip": "",
594
- "filter-method": K(l).remote != null ? void 0 : (_) => u.value = _,
594
+ "filter-method": K(l).remote != null ? void 0 : (_) => d.value = _,
595
595
  clearable: ""
596
596
  }, K(l), { onClear: n.optionClick }), {
597
597
  default: R(() => [
@@ -600,7 +600,7 @@ const ge = (n, e) => {
600
600
  class: "mgl20",
601
601
  modelValue: v.value,
602
602
  "onUpdate:modelValue": m[0] || (m[0] = (_) => v.value = _),
603
- onChange: d
603
+ onChange: u
604
604
  }, {
605
605
  default: R(() => [
606
606
  ee(te(h.$t("quan-xuan")), 1)
@@ -620,8 +620,8 @@ const ge = (n, e) => {
620
620
  }, 16, ["modelValue", "filter-method", "onClear"]);
621
621
  };
622
622
  }
623
- }, Pt = /* @__PURE__ */ ge(qt, [["__scopeId", "data-v-34eb8641"]]);
624
- const Bt = Ye({
623
+ }, Bt = /* @__PURE__ */ ge(Pt, [["__scopeId", "data-v-34eb8641"]]);
624
+ const Yt = Ye({
625
625
  props: {
626
626
  name: {
627
627
  tyepe: String,
@@ -629,7 +629,7 @@ const Bt = Ye({
629
629
  }
630
630
  }
631
631
  });
632
- function Yt(n, e, t, l, o, r) {
632
+ function Ht(n, e, t, l, o, r) {
633
633
  const a = O("el-icon");
634
634
  return L(), U(a, { class: "cmp-icon" }, {
635
635
  default: R(() => [
@@ -638,7 +638,7 @@ function Yt(n, e, t, l, o, r) {
638
638
  _: 1
639
639
  });
640
640
  }
641
- const rt = /* @__PURE__ */ ge(Bt, [["render", Yt], ["__scopeId", "data-v-733f9daa"]]), Sn = {
641
+ const rt = /* @__PURE__ */ ge(Yt, [["render", Ht], ["__scopeId", "data-v-733f9daa"]]), In = {
642
642
  __name: "index",
643
643
  emits: ["ok", "no"],
644
644
  setup(n, { emit: e }) {
@@ -649,13 +649,13 @@ const rt = /* @__PURE__ */ ge(Bt, [["render", Yt], ["__scopeId", "data-v-733f9da
649
649
  t("no");
650
650
  }
651
651
  return (r, a) => {
652
- const u = O("el-link"), i = O("el-popconfirm");
652
+ const d = O("el-link"), i = O("el-popconfirm");
653
653
  return L(), U(i, me(r.$attrs, {
654
654
  onConfirm: K(l),
655
655
  onCancel: o
656
656
  }), {
657
657
  reference: R(() => [
658
- G(u, {
658
+ G(d, {
659
659
  underline: "never",
660
660
  type: r.$attrs.type
661
661
  }, {
@@ -670,7 +670,7 @@ const rt = /* @__PURE__ */ ge(Bt, [["render", Yt], ["__scopeId", "data-v-733f9da
670
670
  };
671
671
  }
672
672
  };
673
- const Ht = ["accept"], Nt = {
673
+ const Nt = ["accept"], Kt = {
674
674
  __name: "index",
675
675
  props: {
676
676
  accept: {
@@ -690,9 +690,9 @@ const Ht = ["accept"], Nt = {
690
690
  t("fileChange", a), l.value.value = null;
691
691
  }
692
692
  return (r, a) => {
693
- const u = O("el-button");
693
+ const d = O("el-button");
694
694
  return L(), le("span", null, [
695
- G(u, {
695
+ G(d, {
696
696
  loading: n.loading,
697
697
  class: "mgr10",
698
698
  onClick: a[0] || (a[0] = (i) => l.value.click())
@@ -709,30 +709,30 @@ const Ht = ["accept"], Nt = {
709
709
  accept: n.accept,
710
710
  style: { position: "absolute", width: "0px", height: "0px", opacity: "0" },
711
711
  type: "file"
712
- }, null, 40, Ht)
712
+ }, null, 40, Nt)
713
713
  ]);
714
714
  };
715
715
  }
716
- }, In = /* @__PURE__ */ ge(Nt, [["__scopeId", "data-v-5f1449ad"]]);
716
+ }, En = /* @__PURE__ */ ge(Kt, [["__scopeId", "data-v-5f1449ad"]]);
717
717
  function Fe(n) {
718
718
  let e = {};
719
719
  return n.forEach((t) => {
720
- const { key: l, type: o, option: r = {}, value: a, dateType: u } = t;
720
+ const { key: l, type: o, option: r = {}, value: a, dateType: d } = t;
721
721
  if (l)
722
722
  if (o == "input" && (r != null && r.multiple))
723
723
  e[l] = lt(a);
724
724
  else if (o == "date")
725
- if (u.includes("range")) {
725
+ if (d.includes("range")) {
726
726
  const [i, v] = l;
727
727
  let [g, k] = a || [];
728
- g && u == "daterange" && (g = ve(g).format("YYYY-MM-DD 00:00:00"), k = ve(k).format("YYYY-MM-DD 23:59:59")), e[i] = g, e[v] = k;
728
+ g && d == "daterange" && (g = ve(g).format("YYYY-MM-DD 00:00:00"), k = ve(k).format("YYYY-MM-DD 23:59:59")), e[i] = g, e[v] = k;
729
729
  } else
730
730
  e[l] = a;
731
731
  else
732
732
  e[l] = a;
733
733
  }), e;
734
734
  }
735
- const Kt = { key: 0 }, Zt = { class: "btns" }, Gt = { class: "left" }, Wt = { class: "right" }, Jt = {
735
+ const Zt = { key: 0 }, Gt = { class: "btns" }, Wt = { class: "left" }, Jt = { class: "right" }, Qt = {
736
736
  __name: "index",
737
737
  props: {
738
738
  form: {
@@ -742,7 +742,7 @@ const Kt = { key: 0 }, Zt = { class: "btns" }, Gt = { class: "left" }, Wt = { cl
742
742
  },
743
743
  emits: ["confirm", "reset", "visibleChange"],
744
744
  setup(n, { expose: e, emit: t }) {
745
- const l = n, o = t, r = q(!0), a = q(null), { t: u } = ue(), i = ce(() => r.value ? u("guan-bi") : u("zhan-kai"));
745
+ const l = n, o = t, r = q(!0), a = q(null), { t: d } = ue(), i = ce(() => r.value ? d("guan-bi") : d("zhan-kai"));
746
746
  function v() {
747
747
  o("confirm");
748
748
  }
@@ -759,13 +759,13 @@ const Kt = { key: 0 }, Zt = { class: "btns" }, Gt = { class: "left" }, Wt = { cl
759
759
  return Fe(l.form.items);
760
760
  }
761
761
  const b = Je(l.form.items);
762
- function d() {
762
+ function u() {
763
763
  l.form.items.forEach((f) => {
764
764
  const $ = b.find((h) => h.key == f.key);
765
765
  $ && (f.value = $.value);
766
766
  });
767
767
  }
768
- return e({ getPrm: w, reset: d }), (f, $) => {
768
+ return e({ getPrm: w, reset: u }), (f, $) => {
769
769
  const h = O("el-input"), m = O("el-date-picker"), I = O("el-form-item"), T = O("el-form"), Y = O("el-link"), _ = O("el-button");
770
770
  return L(), le("div", {
771
771
  class: "searchBar-container mgt10 mgb10",
@@ -783,7 +783,7 @@ const Kt = { key: 0 }, Zt = { class: "btns" }, Gt = { class: "left" }, Wt = { cl
783
783
  (L(!0), le(Se, null, Ne(n.form.items.filter((y) => !y.hidden), (y) => (L(), le(Se, {
784
784
  key: y.key
785
785
  }, [
786
- y.type == "br" ? (L(), le("br", Kt)) : (L(), U(I, {
786
+ y.type == "br" ? (L(), le("br", Zt)) : (L(), U(I, {
787
787
  key: 1,
788
788
  label: y.name
789
789
  }, {
@@ -798,7 +798,7 @@ const Kt = { key: 0 }, Zt = { class: "btns" }, Gt = { class: "left" }, Wt = { cl
798
798
  placeholder: f.$t("qing-shu-ru"),
799
799
  clearable: ""
800
800
  }, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) : y.type === "custom" ? (L(), U(Ke(y.render), { key: 1 })) : se("", !0),
801
- y.type === "select" ? (L(), U(Pt, me({
801
+ y.type === "select" ? (L(), U(Bt, me({
802
802
  key: 2,
803
803
  class: ((P = y.option) == null ? void 0 : P.class) || "w150",
804
804
  modelValue: y.value,
@@ -829,11 +829,11 @@ const Kt = { key: 0 }, Zt = { class: "btns" }, Gt = { class: "left" }, Wt = { cl
829
829
  _: 1
830
830
  }, 8, ["model"])
831
831
  ], 4),
832
- re("div", Zt, [
833
- re("div", Gt, [
832
+ re("div", Gt, [
833
+ re("div", Wt, [
834
834
  ae(f.$slots, "table-header-left", {}, void 0, !0)
835
835
  ]),
836
- re("div", Wt, [
836
+ re("div", Jt, [
837
837
  G(Y, {
838
838
  underline: "never",
839
839
  class: "mgr10",
@@ -873,8 +873,8 @@ const Kt = { key: 0 }, Zt = { class: "btns" }, Gt = { class: "left" }, Wt = { cl
873
873
  ], 32);
874
874
  };
875
875
  }
876
- }, Qt = /* @__PURE__ */ ge(Jt, [["__scopeId", "data-v-32ac9990"]]);
877
- const Xt = { class: "center" }, en = {
876
+ }, Xt = /* @__PURE__ */ ge(Qt, [["__scopeId", "data-v-32ac9990"]]);
877
+ const en = { class: "center" }, tn = {
878
878
  __name: "index",
879
879
  props: {
880
880
  // 表格id 本地存储列设置时使用
@@ -918,7 +918,7 @@ const Xt = { class: "center" }, en = {
918
918
  setup(n, { expose: e }) {
919
919
  const { t, locale: l } = ue(), o = n, r = q(!1), a = q([]);
920
920
  o.searchForm.selections = [], console.log("单元格复制功能默认启用,若不需要请在searchForm中设置enableCellCopy为false123", o.searchForm.enableCellCopy), o.searchForm.enableCellCopy == null && (o.searchForm.enableCellCopy = !0);
921
- const u = Je(o.searchForm.items), i = o.searchForm.pageNoKey || "pageNo", v = pe({
921
+ const d = Je(o.searchForm.items), i = o.searchForm.pageNoKey || "pageNo", v = pe({
922
922
  [i]: 1,
923
923
  pageSize: 10,
924
924
  total: 0
@@ -931,7 +931,7 @@ const Xt = { class: "center" }, en = {
931
931
  });
932
932
  }, 100), b = () => {
933
933
  w();
934
- }, d = () => {
934
+ }, u = () => {
935
935
  if (!o.searchForm.enableCellCopy)
936
936
  return !1;
937
937
  const c = g.value;
@@ -942,9 +942,13 @@ const Xt = { class: "center" }, en = {
942
942
  };
943
943
  He(() => {
944
944
  w(), window.addEventListener("resize", b), o.searchForm.enableCellCopy && (document.addEventListener("mouseup", Re), document.addEventListener("mousedown", Ae), setTimeout(() => {
945
- d();
945
+ u();
946
946
  }, 500));
947
947
  }), Ct(() => {
948
+ o.searchForm.enableCellCopy && setTimeout(() => {
949
+ u();
950
+ }, 500);
951
+ }), xt(() => {
948
952
  if (window.removeEventListener("resize", b), o.searchForm.enableCellCopy) {
949
953
  document.removeEventListener("mouseup", Re), document.removeEventListener("mousedown", Ae);
950
954
  const c = g.value;
@@ -966,7 +970,7 @@ const Xt = { class: "center" }, en = {
966
970
  let A = E.rows || E.records || [];
967
971
  a.value = s ? s(A) : A, v.total = E.totalRows || E.total || 0, $ = E.nextSearchAfter, o.searchForm.enableCellCopy && _e(() => {
968
972
  setTimeout(() => {
969
- d();
973
+ u();
970
974
  }, 100);
971
975
  });
972
976
  }
@@ -978,7 +982,7 @@ const Xt = { class: "center" }, en = {
978
982
  function I() {
979
983
  const { reset: c } = o.tableConfig;
980
984
  c && c(), o.searchForm.items.forEach((s) => {
981
- const C = u.find((E) => Pe(s.key) && Pe(E.key) ? s.key.join(",") == E.key.join(",") : E.key == s.key);
985
+ const C = d.find((E) => Pe(s.key) && Pe(E.key) ? s.key.join(",") == E.key.join(",") : E.key == s.key);
982
986
  C && (s.value = C.value);
983
987
  }), m();
984
988
  }
@@ -1245,7 +1249,7 @@ const Xt = { class: "center" }, en = {
1245
1249
  return L(), le("div", {
1246
1250
  class: Ee({ box: n.searchForm.showShadow })
1247
1251
  }, [
1248
- n.searchForm.showSearch ? (L(), U(Qt, {
1252
+ n.searchForm.showSearch ? (L(), U(Xt, {
1249
1253
  key: 0,
1250
1254
  form: n.searchForm,
1251
1255
  onReset: I,
@@ -1293,7 +1297,7 @@ const Xt = { class: "center" }, en = {
1293
1297
  fixed: "left"
1294
1298
  }, {
1295
1299
  checkbox: R(({ rowIndex: S, row: j, checked: H, disabled: M, indeterminate: N }) => [
1296
- re("div", Xt, [
1300
+ re("div", en, [
1297
1301
  H ? (L(), U(E, {
1298
1302
  key: 0,
1299
1303
  checked: !0,
@@ -1341,7 +1345,7 @@ const Xt = { class: "center" }, en = {
1341
1345
  ], 2);
1342
1346
  };
1343
1347
  }
1344
- }, En = /* @__PURE__ */ ge(en, [["__scopeId", "data-v-1515c739"]]), Ln = {
1348
+ }, Ln = /* @__PURE__ */ ge(tn, [["__scopeId", "data-v-8b6ee274"]]), Tn = {
1345
1349
  __name: "index",
1346
1350
  props: {
1347
1351
  sheetsConfig: {
@@ -1356,7 +1360,7 @@ const Xt = { class: "center" }, en = {
1356
1360
  setup(n) {
1357
1361
  const e = n;
1358
1362
  function t() {
1359
- zt(e.fileName, e.sheetsConfig);
1363
+ Mt(e.fileName, e.sheetsConfig);
1360
1364
  }
1361
1365
  return (l, o) => {
1362
1366
  const r = O("el-link");
@@ -1372,7 +1376,7 @@ const Xt = { class: "center" }, en = {
1372
1376
  };
1373
1377
  }
1374
1378
  };
1375
- function Tn(n, e = {}) {
1379
+ function Fn(n, e = {}) {
1376
1380
  const t = De(), l = {
1377
1381
  inForm: !0,
1378
1382
  required: !0,
@@ -1381,16 +1385,16 @@ function Tn(n, e = {}) {
1381
1385
  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}$/,
1382
1386
  password: /(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/,
1383
1387
  email: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
1384
- }[n], { inForm: r, value: a, required: u, msg: i = t("validate.invalidInput") } = l;
1388
+ }[n], { inForm: r, value: a, required: d, msg: i = t("validate.invalidInput") } = l;
1385
1389
  return r ? function(v, g, k) {
1386
- if (u) {
1390
+ if (d) {
1387
1391
  o.test(g) ? k() : k(new Error(i));
1388
1392
  return;
1389
1393
  }
1390
1394
  g && !o.test(g) ? k(new Error(i)) : k();
1391
1395
  } : o.test(a);
1392
1396
  }
1393
- class Fn {
1397
+ class On {
1394
1398
  constructor(e = {}) {
1395
1399
  this.config = {
1396
1400
  clientCode: e.clientCode || "one-portal",
@@ -1596,20 +1600,20 @@ class Fn {
1596
1600
  return this.config[e];
1597
1601
  }
1598
1602
  }
1599
- function On(n, e = {}) {
1603
+ function Dn(n, e = {}) {
1600
1604
  const l = Object.assign({
1601
1605
  manual: !1,
1602
1606
  // 手动执行
1603
1607
  log: !1,
1604
1608
  params: null,
1605
1609
  format: null
1606
- }, e), { manual: o, log: r, params: a = {}, cb: u, format: i } = l, v = q([]), g = q(!1), k = (x) => {
1610
+ }, e), { manual: o, log: r, params: a = {}, cb: d, format: i } = l, v = q([]), g = q(!1), k = (x) => {
1607
1611
  const w = x || a;
1608
1612
  g.value = !0, n(w).then((b) => {
1609
- const { code: d, data: f, msg: $ } = b;
1610
- if (u) {
1613
+ const { code: u, data: f, msg: $ } = b;
1614
+ if (d) {
1611
1615
  const { records: h, rows: m } = f || {}, I = h || m ? h || m : f;
1612
- v.value = $e(I, i), u(b);
1616
+ v.value = $e(I, i), d(b);
1613
1617
  }
1614
1618
  if (f) {
1615
1619
  if (f.records != null || f.rows != null) {
@@ -1620,21 +1624,21 @@ function On(n, e = {}) {
1620
1624
  r && console.log("useRequest-res", v.value);
1621
1625
  }
1622
1626
  }).catch((b) => {
1623
- u && (console.log("useRequestErr", b), u({ code: 500 }));
1627
+ d && (console.log("useRequestErr", b), d({ code: 500 }));
1624
1628
  }).finally(() => {
1625
1629
  g.value = !1;
1626
1630
  });
1627
1631
  };
1628
1632
  return o || k(), [g, v, k];
1629
1633
  }
1630
- function Dn(n) {
1634
+ function zn(n) {
1631
1635
  const e = q(n), t = q(""), l = q("");
1632
1636
  return Ze(e, (o) => {
1633
1637
  const r = o || ["", ""];
1634
1638
  t.value = r[0], l.value = r[1];
1635
1639
  }), [e, t, l];
1636
1640
  }
1637
- function zn(n) {
1641
+ function Mn(n) {
1638
1642
  return Object.prototype.toString.call(n).slice(8, -1).toLowerCase();
1639
1643
  }
1640
1644
  function $e(n, e) {
@@ -1648,7 +1652,7 @@ function $e(n, e) {
1648
1652
  let t = {};
1649
1653
  return e.forEach((l) => t[l] = n[l]), t;
1650
1654
  }
1651
- function Mn(n, e = []) {
1655
+ function Rn(n, e = []) {
1652
1656
  const { locale: t } = ue(), l = q(n());
1653
1657
  return Ze(
1654
1658
  [t, ...e],
@@ -1658,23 +1662,23 @@ function Mn(n, e = []) {
1658
1662
  { immediate: !0 }
1659
1663
  ), l;
1660
1664
  }
1661
- function Rn(n, e = "zh_cn", t = "en_us") {
1665
+ function An(n, e = "zh_cn", t = "en_us") {
1662
1666
  if (!n)
1663
1667
  return "-";
1664
1668
  const l = { en_us: t, zh_cn: e }, r = ot().global.locale.value;
1665
1669
  return n[l[r]] || n[e] || "-";
1666
1670
  }
1667
- function An(n, e) {
1668
- let t = kt;
1669
- return typeof n == "string" && n.length > 0 && (t = Oe(n).mapState), at(e, t);
1670
- }
1671
1671
  function Vn(n, e) {
1672
1672
  let t = _t;
1673
- return typeof n == "string" && n.length > 0 && (t = Oe(n).mapGetters), at(e, t);
1673
+ return typeof n == "string" && n.length > 0 && (t = Oe(n).mapState), at(e, t);
1674
1674
  }
1675
1675
  function Un(n, e) {
1676
1676
  let t = $t;
1677
- return typeof n == "string" && n.length > 0 && (t = Oe(n).mapActions), tn(e, t);
1677
+ return typeof n == "string" && n.length > 0 && (t = Oe(n).mapGetters), at(e, t);
1678
+ }
1679
+ function jn(n, e) {
1680
+ let t = St;
1681
+ return typeof n == "string" && n.length > 0 && (t = Oe(n).mapActions), nn(e, t);
1678
1682
  }
1679
1683
  function at(n, e) {
1680
1684
  const t = Qe(), l = e(n), o = {};
@@ -1683,13 +1687,13 @@ function at(n, e) {
1683
1687
  o[r] = ce(a);
1684
1688
  }), o;
1685
1689
  }
1686
- function tn(n, e) {
1690
+ function nn(n, e) {
1687
1691
  const t = Qe(), l = e(n), o = {};
1688
1692
  return Object.keys(l).forEach((r) => {
1689
1693
  o[r] = l[r].bind({ $store: t });
1690
1694
  }), o;
1691
1695
  }
1692
- const nn = {
1696
+ const on = {
1693
1697
  __name: "EnumRender",
1694
1698
  props: {
1695
1699
  renderOpts: {
@@ -1723,11 +1727,11 @@ const nn = {
1723
1727
  };
1724
1728
  }
1725
1729
  };
1726
- function jn() {
1730
+ function qn() {
1727
1731
  he.renderer.add("Enum", {
1728
1732
  // 默认显示模板
1729
1733
  renderTableDefault(n, e) {
1730
- return [null, void 0].includes(e.row[e.column.field]) ? "-" : /* @__PURE__ */ React.createElement(nn, { renderOpts: n, params: e });
1734
+ return [null, void 0].includes(e.row[e.column.field]) ? "-" : /* @__PURE__ */ React.createElement(on, { renderOpts: n, params: e });
1731
1735
  }
1732
1736
  }), he.renderer.add("InputNumber", {
1733
1737
  // 默认显示模板
@@ -1757,9 +1761,9 @@ function jn() {
1757
1761
  }), he.renderer.add("Link", {
1758
1762
  // 默认显示模板
1759
1763
  renderTableDefault(n, e) {
1760
- var u;
1764
+ var d;
1761
1765
  let t = e.column.field;
1762
- const l = St(), { multiple: o, to: r } = n;
1766
+ const l = It(), { multiple: o, to: r } = n;
1763
1767
  if (!o)
1764
1768
  return /* @__PURE__ */ React.createElement(
1765
1769
  je,
@@ -1770,7 +1774,7 @@ function jn() {
1770
1774
  },
1771
1775
  e.row[t]
1772
1776
  );
1773
- const a = ((u = e.row[t]) == null ? void 0 : u.split(",")) || [];
1777
+ const a = ((d = e.row[t]) == null ? void 0 : d.split(",")) || [];
1774
1778
  return a.map((i, v) => /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement(
1775
1779
  je,
1776
1780
  {
@@ -1784,43 +1788,43 @@ function jn() {
1784
1788
  });
1785
1789
  }
1786
1790
  export {
1787
- Pt as CmpDictionary,
1791
+ Bt as CmpDictionary,
1788
1792
  rt as CmpIcon,
1789
- Sn as ConfrimButton,
1790
- Ln as DownExcelTemp,
1791
- In as ImportButton,
1792
- mn as LayOutForm,
1793
- En as ListPage,
1794
- Fn as OnePortalCasSDK,
1795
- Qt as SearchBar,
1793
+ In as ConfrimButton,
1794
+ Tn as DownExcelTemp,
1795
+ En as ImportButton,
1796
+ gn as LayOutForm,
1797
+ Ln as ListPage,
1798
+ On as OnePortalCasSDK,
1799
+ Xt as SearchBar,
1796
1800
  Be as StatusMap,
1797
- vn as _toRaw,
1798
- zn as _typeOf,
1799
- yn as arrToStatusMap,
1800
- bn as arrayToTree,
1801
- wn as checkFileSize,
1802
- Tn as creatValidator,
1803
- _n as createImportFields,
1804
- kn as createListPageId,
1801
+ bn as _toRaw,
1802
+ Mn as _typeOf,
1803
+ Cn as arrToStatusMap,
1804
+ yn as arrayToTree,
1805
+ kn as checkFileSize,
1806
+ Fn as creatValidator,
1807
+ $n as createImportFields,
1808
+ _n as createListPageId,
1805
1809
  Te as en,
1806
- zt as exportExcel,
1810
+ Mt as exportExcel,
1807
1811
  ot as getI18n,
1808
1812
  De as getI18nT,
1809
- Rn as getLocaleValue,
1810
- $n as getValueBykey,
1811
- gn as importExcel,
1812
- Ft as messages,
1813
- jn as registerVxeRenderers,
1814
- Ot as setupI18n,
1815
- pn as sleep,
1813
+ An as getLocaleValue,
1814
+ Sn as getValueBykey,
1815
+ pn as importExcel,
1816
+ Ot as messages,
1817
+ qn as registerVxeRenderers,
1818
+ Dt as setupI18n,
1819
+ vn as sleep,
1816
1820
  lt as stringToArray,
1817
- Cn as stripHtmlTags,
1818
- xn as unicode2Str,
1819
- Un as useActions,
1820
- Dn as useDatePicker,
1821
- Vn as useGetters,
1822
- Mn as useI18nReState,
1823
- On as useRequest,
1824
- An as useState,
1821
+ xn as stripHtmlTags,
1822
+ wn as unicode2Str,
1823
+ jn as useActions,
1824
+ zn as useDatePicker,
1825
+ Un as useGetters,
1826
+ Rn as useI18nReState,
1827
+ Dn as useRequest,
1828
+ Vn as useState,
1825
1829
  Le as zhCn
1826
1830
  };
@@ -1,2 +1,2 @@
1
- (function(h,Y){typeof exports=="object"&&typeof module<"u"?Y(exports,require("element-plus"),require("vue"),require("file-saver"),require("exceljs"),require("dayjs"),require("vue-i18n"),require("lodash"),require("vuex"),require("vxe-pc-ui"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue","file-saver","exceljs","dayjs","vue-i18n","lodash","vuex","vxe-pc-ui","vue-router"],Y):(h=typeof globalThis<"u"?globalThis:h||self,Y(h.JoyAdminComponents={},h.ElementPlus,h.Vue,h.fileSaver,h.ExcelJS,h.dayjs,h.VueI18n,h._,h.Vuex,h.VxeUI,h.VueRouter))})(this,function(h,Y,e,Ne,xe,ae,J,ee,W,ne,Re){"use strict";const Ae=e.defineComponent({name:"LayOutForm",setup(o,{slots:t,attrs:n,emit:r}){const l=e.ref(null),a=()=>t.default?t.default().filter(d=>d.type!==Symbol.for("v-cmt")).map(d=>d.type===Symbol.for("v-fgt")?d.children:d).flat().map(d=>{var c;return e.h(Y.ElCol,{span:((c=d.props)==null?void 0:c.span)||24},{default:()=>d})}):null;e.onMounted(()=>{r("ref",l.value)});function s(){return e.h(Y.ElForm,{...n,ref:l},()=>e.h(Y.ElRow,{gutter:n.gutter??20},{default:()=>a()}))}return s}});var ke=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _e(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Se={exports:{}};(function(o,t){(function(n,r){o.exports=r()})(ke,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,l=/([+-]|\d\d)/g;return function(a,s,d){var c=s.prototype;d.utc=function(f){var m={date:f,utc:!0,args:arguments};return new s(m)},c.utc=function(f){var m=d(this.toDate(),{locale:this.$L,utc:!0});return f?m.add(this.utcOffset(),n):m},c.local=function(){return d(this.toDate(),{locale:this.$L,utc:!1})};var b=c.parse;c.parse=function(f){f.utc&&(this.$u=!0),this.$utils().u(f.$offset)||(this.$offset=f.$offset),b.call(this,f)};var C=c.init;c.init=function(){if(this.$u){var f=this.$d;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()}else C.call(this)};var $=c.utcOffset;c.utcOffset=function(f,m){var I=this.$utils().u;if(I(f))return this.$u?0:I(this.$offset)?$.call(this):this.$offset;if(typeof f=="string"&&(f=function(V){V===void 0&&(V="");var q=V.match(r);if(!q)return null;var E=(""+q[0]).match(l)||["-",0,0],x=E[0],y=60*+E[1]+ +E[2];return y===0?0:x==="+"?y:-y}(f),f===null))return this;var p=Math.abs(f)<=16?60*f:f;if(p===0)return this.utc(m);var g=this.clone();if(m)return g.$offset=p,g.$u=!1,g;var v=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(g=this.local().add(p+v,n)).$offset=p,g.$x.$localOffset=v,g};var _=c.format;c.format=function(f){var m=f||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return _.call(this,m)},c.valueOf=function(){var f=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*f},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var S=c.toDate;c.toDate=function(f){return f==="s"&&this.$offset?d(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():S.call(this)};var w=c.diff;c.diff=function(f,m,I){if(f&&this.$u===f.$u)return w.call(this,f,m,I);var p=this.local(),g=d(f).local();return w.call(p,g,m,I)}}})})(Se);var qe=Se.exports;const je=_e(qe);var $e={exports:{}};(function(o,t){(function(n,r){o.exports=r()})(ke,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(l,a,s){var d,c=function(_,S,w){w===void 0&&(w={});var f=new Date(_),m=function(I,p){p===void 0&&(p={});var g=p.timeZoneName||"short",v=I+"|"+g,V=r[v];return V||(V=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:I,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:g}),r[v]=V),V}(S,w);return m.formatToParts(f)},b=function(_,S){for(var w=c(_,S),f=[],m=0;m<w.length;m+=1){var I=w[m],p=I.type,g=I.value,v=n[p];v>=0&&(f[v]=parseInt(g,10))}var V=f[3],q=V===24?0:V,E=f[0]+"-"+f[1]+"-"+f[2]+" "+q+":"+f[4]+":"+f[5]+":000",x=+_;return(s.utc(E).valueOf()-(x-=x%1e3))/6e4},C=a.prototype;C.tz=function(_,S){_===void 0&&(_=d);var w,f=this.utcOffset(),m=this.toDate(),I=m.toLocaleString("en-US",{timeZone:_}),p=Math.round((m-new Date(I))/1e3/60),g=15*-Math.round(m.getTimezoneOffset()/15)-p;if(!Number(g))w=this.utcOffset(0,S);else if(w=s(I,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(g,!0),S){var v=w.utcOffset();w=w.add(f-v,"minute")}return w.$x.$timezone=_,w},C.offsetName=function(_){var S=this.$x.$timezone||s.tz.guess(),w=c(this.valueOf(),S,{timeZoneName:_}).find(function(f){return f.type.toLowerCase()==="timezonename"});return w&&w.value};var $=C.startOf;C.startOf=function(_,S){if(!this.$x||!this.$x.$timezone)return $.call(this,_,S);var w=s(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return $.call(w,_,S).tz(this.$x.$timezone,!0)},s.tz=function(_,S,w){var f=w&&S,m=w||S||d,I=b(+s(),m);if(typeof _!="string")return s(_).tz(m);var p=function(q,E,x){var y=q-60*E*1e3,R=b(y,x);if(E===R)return[y,E];var B=b(y-=60*(R-E)*1e3,x);return R===B?[y,R]:[q-60*Math.min(R,B)*1e3,Math.max(R,B)]}(s.utc(_,f).valueOf(),I,m),g=p[0],v=p[1],V=s(g).utcOffset(v);return V.$x.$timezone=m,V},s.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},s.tz.setDefault=function(_){d=_}}})})($e);var Ue=$e.exports;const Pe=_e(Ue),se={"dao-ru":"导入","quan-xuan":"全选","xia-zai-dao-ru-mo-ban":"下载导入模板","xu-hao":"序号","qing-shu-ru":"请输入","qing-xuan-ze":"请选择","kai-shi-shi-jian":"开始时间","jie-shu-shi-jian":"结束时间","shai-xuan":"筛选","chong-zhi":"重置","guan-bi":"关闭","zhan-kai":"展开",excel:{fieldsMappingRequired:"请输入列字段映射",invalidInput:"非法输入",invalidOption:"请输入有效选项!",copyFailed:"复制失败",sheetNameTooLong:'Sheet名称 "{0}" 长度超过31个字符,已自动截断为 "{1}"'},validate:{invalidInput:"请输入正确内容"},tools:{keysLengthError:"keys 长度必须大于2 默认前两位为 label value"}},ie={"dao-ru":"Import","quan-xuan":"Select All","xia-zai-dao-ru-mo-ban":"Download Import Template","xu-hao":"No.","qing-shu-ru":"Please enter","qing-xuan-ze":"Please select","kai-shi-shi-jian":"Start Time","jie-shu-shi-jian":"End Time","shai-xuan":"Filter","chong-zhi":"Reset","guan-bi":"Collapse","zhan-kai":"Expand",excel:{fieldsMappingRequired:"Please enter column field mapping",invalidInput:"Invalid input",invalidOption:"Please enter a valid option!",copyFailed:"Copy failed",sheetNameTooLong:'Sheet name "{0}" exceeds 31 characters, automatically truncated to "{1}"'},validate:{invalidInput:"Please enter valid content"},tools:{keysLengthError:"Keys length must be greater than 2, default first two are label and value"}},Ee={zh_cn:se,en:ie};let te=null;function Ie(o=null){if(o){const{global:t}=o;return t.messages.value.zh_cn?t.mergeLocaleMessage("zh_cn",se):t.setLocaleMessage("zh_cn",se),t.messages.value.en?t.mergeLocaleMessage("en",ie):t.setLocaleMessage("en",ie),te=o,o}return te||(te=J.createI18n({legacy:!1,locale:"zh_cn",fallbackLocale:"zh_cn",messages:Ee})),te}function ue(){return te||Ie()}function ce(){return ue().global.t}ae.extend(je),ae.extend(Pe);async function Ye(o,t){const{fields:n,range:r=1}=t;if(!n){const s=ce();throw new Error(s("excel.fieldsMappingRequired"))}let l=new xe.Workbook;await l.xlsx.load(o);const a={};return l.eachSheet(function(s,d){const c=[];s.eachRow(function(b,C){if(C>r){let $={},_=!0;Object.keys(n).forEach(S=>{const w=b.getCell(n[S]).value;$[S]=w,w&&(_=!1)}),_||c.push($)}}),a[s._name]=c}),l=null,a}const He={columnWidth:30};async function Te(o,t,n=[],r={}){if(!o||!t)return;const{columnStyle:l}=r,{columnWidth:a}=He;t.forEach(c=>{c.width=c.width?c.width:a});const{workbook:s,worksheet:d}=Ke();d.columns=t,d.addRows(n),l&&await Ze(s,d,l);try{const c=await s.xlsx.writeBuffer(),b=new File([c],o,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Ne.saveAs(b)}catch(c){console.log(c)}}function Ke(){const o=new xe.Workbook;o.creator="distributor System",o.lastModifiedBy="distributor System",o.created=new Date,o.modified=new Date,o.lastPrinted=new Date;const t=o.addWorksheet("Sheet1");return{workbook:o,worksheet:t}}async function Ze(o,t,n){const r=Object.keys(n);for(const l of r){const a=n[l],{type:s}=a;switch(s){case"IMG":await Ge(o,t,l);break}}}async function Ge(o,t,n,r){const l=t.getColumn(n),a=l.values;t.getColumn(n).width=20,t.eachRow((s,d)=>{d>1&&(s.height=40)});for(let s=0,d=a.length;s<d;s++){if(s<2)continue;let c=a[s];c&&(t.getCell(l.letter+s).value="",await We(o,t,c,{width:100,height:50,col:l._number-1,row:s-1}))}}async function We(o,t,n,r){const{col:l,row:a,width:s,height:d}=r,{success:c,base64:b}=await Je(n,.3);if(c){const C=o.addImage({base64:b,extension:"jpeg"});t.addImage(C,{tl:{col:l,row:a},ext:{width:s,height:d}})}}function Je(o,t=1){const n=new Image;return n.setAttribute("crossOrigin","anonymous"),n.crossOrigin="anonymous",n.src=o,new Promise((r,l)=>{n.onload=()=>{const a=document.createElement("canvas");a.width=n.width,a.height=n.height,a.getContext("2d").drawImage(n,0,0,a.width,a.height),r({success:!0,base64:a.toDataURL("image/jpeg",t)})},n.onerror=()=>{r({success:!1})}})}function Qe(o){if(o<26)return String.fromCharCode(65+o);{const t=String.fromCharCode(65+Math.floor((o-26)/26)),n=String.fromCharCode(65+(o-26)%26);return t+n}}function Xe(o){return new Promise(t=>{setTimeout(()=>{t()},o)})}function et(o){return JSON.parse(JSON.stringify(o))}function tt(o){let t=[],n={},r=(l,a)=>Object.prototype.hasOwnProperty.call(l,a);for(const l of o){n[l.id]={...l,children:r(n,l.id)?n[l.id].children:[]};const a=n[l.id];l.pid==-1?t.push(a):(r(n,l.pid)||(n[l.pid]={children:[]}),n[l.pid].children.push(a))}return t}function de(o,t=" "){return o?o.split(t).filter(n=>n.trim()):[]}class fe{constructor(t,n=["label","value","labelEn"]){this.list=t,this.map=new Map(t.map(r=>{let l={...r,label:r[n[0]],value:r[n[1]]};return n[2]&&(l.labelEn=r[n[2]]),[r[n[1]],l]}))}getName(t,n){if(!this.has(t))return"-";const{label:r,labelEn:l}=this.map.get(t);return(n=="zh_cn"?r:l)||r||"-"}getTag(t){if(!this.has(t))return"info";const{tag:n="info"}=this.map.get(t);return n}getItem(t){return this.has(t)?this.map.get(t):null}getColor(t){if(!this.has(t))return null;const{color:n}=this.map.get(t);return n}has(t){return this.map.has(t)}}function nt(o,t=[],n="i18nName"){if(o.length==0)return new fe([]);if(t.length<2){const l=ce();throw new Error(l("tools.keysLengthError"))}let r=o.map(l=>{let a={};return n&&(a.labelEn=l[n]),t.forEach((s,d)=>{d===0?a.label=l[s]:d===1?a.value=l[s]:a[s]=l[s]}),a});return new fe(r)}function ot(o){return o?o.replace(/<[^>]+>/g,""):""}function lt(o){return o?(o.includes("\\\\u")&&(o=o.replace(/\\/g,"")),o.replace(/\\u[\dA-F]{4}/gi,t=>String.fromCharCode(parseInt(t.replace(/\\u/g,""),16)))):""}function rt(o,t=10){let n=1048576*t;return!(o.size>n)}function at(o){return Array.from(10).fill(0).map((n,r)=>o+"_"+r)}function st(o){let t={};return o.map((n,r)=>{let{key:l,option:a,type:s}=n,d=Qe(r);a?t[l]=`${d}---option`:s==="image"?t[l]=`${d}---image`:t[l]=d}),t}function it(o,t){return t.split(".").reduce((n,r)=>n&&n[r],o)}const Nt="",oe=(o,t)=>{const n=o.__vccOpts||o;for(const[r,l]of t)n[r]=l;return n},ve=oe({__name:"index",props:e.mergeModels({api:{type:Function},showCheckAll:{type:Boolean,default:!0},maxLimit:{type:Number,default:void 0},optionClick:{type:Function,default:()=>{}},data:{type:Array},labelValue:{type:Object,default:()=>({label:"label",labelEn:"labelEn",value:"value"})},changeLocal:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["success","change"],["update:modelValue"]),setup(o,{emit:t}){const n=o,r=e.useAttrs(),{t:l,locale:a}=J.useI18n(),s=e.useModel(o,"modelValue"),d=e.ref(""),c=e.computed(()=>{if(r.remote!==void 0)return n.data;const p=de(d.value),{data:g,labelValue:v}=n,V=g||$.value;if(p.length==0)return V;const{label:q,labelEn:E}=v;let x=a.value=="en_us"?E||"i18nName":q;return p.length==1?V.filter(R=>R[x].toLowerCase().includes(p[0].toLowerCase())):V.filter(R=>{let B=!1;return B=p.some(le=>R[x].toLowerCase()==le.toLowerCase()),B})}),b=e.computed({get(){return r.multiple==null||s.value==null?!1:s.value.length==c.value.length},set(p){return p}}),C=t,$=e.ref([]),_=async()=>{const{data:p}=await n.api();$.value=[...p],C("success",$)};n.api&&_();const S=n.labelValue.label.split("-"),w=p=>{if(S.length==1){if(n.changeLocal)return l(p[n.labelValue.label]);let g=a.value=="en_us"?p[n.labelValue.labelEn||"i18nName"]:p[n.labelValue.label];return g=g||p[n.labelValue.label],g}else{let g=[];return S.forEach(v=>{g.push(p[v])}),g.join("-")}};function f(p){s.value=p?c.value.map(g=>g[n.labelValue.value]):[],C("change",s.value)}function m(p){n.optionClick(p),C("change",r["value-key"]?p:p[n.labelValue.value])}function I(p){return s.value.length>=n.maxLimit&&!s.value.includes(p[n.labelValue.value])}return(p,g)=>{const v=e.resolveComponent("el-checkbox"),V=e.resolveComponent("el-option"),q=e.resolveComponent("el-select");return e.openBlock(),e.createBlock(q,e.mergeProps({modelValue:s.value,"onUpdate:modelValue":g[1]||(g[1]=E=>s.value=E),filterable:"","collapse-tags":"","collapse-tags-tooltip":"","filter-method":e.unref(r).remote!=null?void 0:E=>d.value=E,clearable:""},e.unref(r),{onClear:o.optionClick}),{default:e.withCtx(()=>[e.unref(r).multiple!=null&&o.showCheckAll&&o.maxLimit==null?e.renderSlot(p.$slots,"header",{key:0},()=>[e.createVNode(v,{class:"mgl20",modelValue:b.value,"onUpdate:modelValue":g[0]||(g[0]=E=>b.value=E),onChange:f},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(E,x)=>(e.openBlock(),e.createBlock(V,{key:x,label:w(E),disabled:e.unref(r).multiple!=null&&o.maxLimit>0?I(E):!1,onClick:e.withModifiers(y=>m(E),["stop"]),value:e.unref(r)["value-key"]?E:E[o.labelValue.value]},null,8,["label","disabled","onClick","value"]))),128))]),_:3},16,["modelValue","filter-method","onClear"])}}},[["__scopeId","data-v-34eb8641"]]),At="",ct=e.defineComponent({props:{name:{tyepe:String,required:!0}}});function ut(o,t,n,r,l,a){const s=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(s,{class:"cmp-icon"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.name)))]),_:1})}const he=oe(ct,[["render",ut],["__scopeId","data-v-733f9daa"]]),dt={__name:"index",emits:["ok","no"],setup(o,{emit:t}){const n=t,r=ee.debounce(()=>{n("ok")},500);function l(){n("no")}return(a,s)=>{const d=e.resolveComponent("el-link"),c=e.resolveComponent("el-popconfirm");return e.openBlock(),e.createBlock(c,e.mergeProps(a.$attrs,{onConfirm:e.unref(r),onCancel:l}),{reference:e.withCtx(()=>[e.createVNode(d,{underline:"never",type:a.$attrs.type},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},8,["type"])]),_:3},16,["onConfirm"])}}},qt="",ft=["accept"],ht=oe({__name:"index",props:{accept:{type:String,default:".xlsx,.xls"},loading:{type:Boolean,default:!1}},emits:["fileChange"],setup(o,{emit:t}){const n=t,r=e.ref(null);function l(a){let s=a.target.files[0];n("fileChange",s),r.value.value=null}return(a,s)=>{const d=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("span",null,[e.createVNode(d,{loading:o.loading,class:"mgr10",onClick:s[0]||(s[0]=c=>r.value.click())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("dao-ru")),1)]),_:1},8,["loading"]),e.createElementVNode("input",{onChange:l,ref_key:"input",ref:r,accept:o.accept,style:{position:"absolute",width:"0px",height:"0px",opacity:"0"},type:"file"},null,40,ft)])}}},[["__scopeId","data-v-5f1449ad"]]);function me(o){let t={};return o.forEach(n=>{const{key:r,type:l,option:a={},value:s,dateType:d}=n;if(r)if(l=="input"&&(a!=null&&a.multiple))t[r]=de(s);else if(l=="date")if(d.includes("range")){const[c,b]=r;let[C,$]=s||[];C&&d=="daterange"&&(C=ae(C).format("YYYY-MM-DD 00:00:00"),$=ae($).format("YYYY-MM-DD 23:59:59")),t[c]=C,t[b]=$}else t[r]=s;else t[r]=s}),t}const Ut="",mt={key:0},pt={class:"btns"},gt={class:"left"},Ct={class:"right"},Le=oe({__name:"index",props:{form:{type:Object,required:!0}},emits:["confirm","reset","visibleChange"],setup(o,{expose:t,emit:n}){const r=o,l=n,a=e.ref(!0),s=e.ref(null),{t:d}=J.useI18n(),c=e.computed(()=>a.value?d("guan-bi"):d("zhan-kai"));function b(){l("confirm")}function C(m){m.option.onClear&&m.option.onClear(),l("confirm")}function $(){l("reset")}function _(){l("confirm")}function S(){return me(r.form.items)}const w=ee.cloneDeep(r.form.items);function f(){r.form.items.forEach(m=>{const I=w.find(p=>p.key==m.key);I&&(m.value=I.value)})}return t({getPrm:S,reset:f}),(m,I)=>{const p=e.resolveComponent("el-input"),g=e.resolveComponent("el-date-picker"),v=e.resolveComponent("el-form-item"),V=e.resolveComponent("el-form"),q=e.resolveComponent("el-link"),E=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",{class:"searchBar-container mgt10 mgb10",onKeydown:e.withKeys(b,["enter"])},[e.createElementVNode("div",{class:"searchBar",style:e.normalizeStyle({height:a.value?"auto":"42px"})},[e.createVNode(V,{inline:"",model:o.form.data},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.form.items.filter(x=>!x.hidden),x=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:x.key},[x.type=="br"?(e.openBlock(),e.createElementBlock("br",mt)):(e.openBlock(),e.createBlock(v,{key:1,label:x.name},{default:e.withCtx(()=>{var y,R;return[x.type==="input"?(e.openBlock(),e.createBlock(p,{key:0,modelValue:x.value,"onUpdate:modelValue":B=>x.value=B,class:e.normalizeClass(((y=x.option)==null?void 0:y.class)||"w150"),placeholder:m.$t("qing-shu-ru"),clearable:""},null,8,["modelValue","onUpdate:modelValue","class","placeholder"])):x.type==="custom"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(x.render),{key:1})):e.createCommentVNode("",!0),x.type==="select"?(e.openBlock(),e.createBlock(ve,e.mergeProps({key:2,class:((R=x.option)==null?void 0:R.class)||"w150",modelValue:x.value,"onUpdate:modelValue":B=>x.value=B},{ref_for:!0},x.option,{onChange:b,onClear:B=>C(x)}),null,16,["class","modelValue","onUpdate:modelValue","onClear"])):e.createCommentVNode("",!0),x.type==="date"?(e.openBlock(),e.createBlock(g,{key:3,class:e.normalizeClass({datetimerange:"w300",daterange:"w200"}[x.dateType]||"w100"),modelValue:x.value,"onUpdate:modelValue":B=>x.value=B,"value-format":{datetimerange:"YYYY-MM-DD HH:mm:ss",daterange:"YYYY-MM-DD"}[x.dateType]||"YYYY-MM-DD",type:x.dateType||"date",onFocus:B=>s.value=x,onChange:B=>_(),placeholder:m.$t("qing-xuan-ze"),"start-placeholder":m.$t("kai-shi-shi-jian"),"end-placeholder":m.$t("jie-shu-shi-jian")},null,8,["class","modelValue","onUpdate:modelValue","value-format","type","onFocus","onChange","placeholder","start-placeholder","end-placeholder"])):e.createCommentVNode("",!0)]}),_:2},1032,["label"]))],64))),128))]),_:1},8,["model"])],4),e.createElementVNode("div",pt,[e.createElementVNode("div",gt,[e.renderSlot(m.$slots,"table-header-left",{},void 0,!0)]),e.createElementVNode("div",Ct,[e.createVNode(q,{underline:"never",class:"mgr10",onClick:I[0]||(I[0]=()=>{l("visibleChange",!a.value),a.value=!a.value})},{default:e.withCtx(()=>[e.createVNode(he,{name:a.value?"ArrowUp":"ArrowDown"},null,8,["name"]),e.createTextVNode(" "+e.toDisplayString(c.value),1)]),_:1}),e.createVNode(E,{type:"primary",onClick:b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.$t("shai-xuan")),1)]),_:1}),e.createVNode(E,{type:"primary",onClick:$},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.$t("chong-zhi")),1)]),_:1}),e.renderSlot(m.$slots,"btn",{},void 0,!0)])])],32)}}},[["__scopeId","data-v-32ac9990"]]),Yt="",yt={class:"center"},bt=oe({__name:"index",props:{id:{type:String,required:!0},loading:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0},searchForm:{type:Object,default:()=>({items:[],selections:[],showSearch:!1,showPage:!1,showShadow:!1,showCheckBox:!1,enableCellCopy:!0})},api:{type:Function},data:{type:Array},tableConfig:{type:Object,default:()=>({})}},setup(o,{expose:t}){const{t:n,locale:r}=J.useI18n(),l=o,a=e.ref(!1),s=e.ref([]);l.searchForm.selections=[],console.log("单元格复制功能默认启用,若不需要请在searchForm中设置enableCellCopy为false123",l.searchForm.enableCellCopy),l.searchForm.enableCellCopy==null&&(l.searchForm.enableCellCopy=!0);const d=ee.cloneDeep(l.searchForm.items),c=l.searchForm.pageNoKey||"pageNo",b=e.reactive({[c]:1,pageSize:10,total:0}),C=e.ref(null),$=e.ref(null),_=e.ref(450),S=ee.debounce(()=>{e.nextTick(()=>{if(!$.value)return;const i=$.value.getBoundingClientRect(),k=window.innerHeight,L=i.top,z=100,P=k-L-z,M=200;_.value=Math.max(P,M)})},100),w=()=>{S()},f=()=>{if(!l.searchForm.enableCellCopy)return!1;const u=C.value;if(!u||!u.$el)return!1;const i=u.$el;return i.classList.add("cell-copy-enabled"),i.setAttribute("tabindex","-1"),i.removeEventListener("mousedown",B),i.removeEventListener("mousemove",le),i.removeEventListener("mouseup",ge),i.removeEventListener("keydown",ye),i.addEventListener("mousedown",B),i.addEventListener("mousemove",le),i.addEventListener("mouseup",ge),i.addEventListener("keydown",ye),!0};e.onMounted(()=>{S(),window.addEventListener("resize",w),l.searchForm.enableCellCopy&&(document.addEventListener("mouseup",Be),document.addEventListener("mousedown",Oe),setTimeout(()=>{f()},500))}),e.onUnmounted(()=>{if(window.removeEventListener("resize",w),l.searchForm.enableCellCopy){document.removeEventListener("mouseup",Be),document.removeEventListener("mousedown",Oe);const u=C.value;if(u&&u.$el){const i=u.$el;i.removeEventListener("mousedown",B),i.removeEventListener("mousemove",le),i.removeEventListener("mouseup",ge),i.removeEventListener("keydown",ye)}}});const m=e.computed(()=>be.value.height||_.value);let I;async function p(u){const{dataFormat:i}=l.tableConfig;u.pageNo!=1&&(u.nextSearchAfter=I),a.value=!0;const{code:k,data:L={}}=await l.api(u).finally(()=>{a.value=!1,l.searchForm.selections=[]});if(k==200){let z=L.rows||L.records||[];s.value=i?i(z):z,b.total=L.totalRows||L.total||0,I=L.nextSearchAfter,l.searchForm.enableCellCopy&&e.nextTick(()=>{setTimeout(()=>{f()},100)})}}function g(u={}){const{searchData:i=()=>({})}=l.tableConfig,k=i();p({...b,...me(l.searchForm.items),...u,...k})}function v(){const{reset:u}=l.tableConfig;u&&u(),l.searchForm.items.forEach(i=>{const k=d.find(L=>ee.isArray(i.key)&&ee.isArray(L.key)?i.key.join(",")==L.key.join(","):L.key==i.key);k&&(i.value=k.value)}),g()}l.api&&l.immediate&&g();function V(){return{...b,...me(l.searchForm.items)}}const q=()=>{const u=C.value;u&&u.clearSort()},E=e.reactive({storage:!0}),x=e.reactive({width:"auto",drag:!0,resizable:!0,maxFixedSize:0}),y=e.reactive({isSelecting:!1,startCell:null,endCell:null,selectedCells:[]}),R=u=>{const i=u.closest(".vxe-body--column");if(!i||i.classList.contains("col--checkbox")||i.classList.contains("col--seq"))return null;const k=i.closest(".vxe-body--row");if(!k)return null;const L=C.value;if(!L)return null;let z=-1;const P=k.getAttribute("data-rowid");if(P!=null)z=parseInt(P,10);else{const F=k.parentElement;z=Array.from(F.querySelectorAll(".vxe-body--row")).indexOf(k)}if(z<0)return null;let M=-1;const G=i.getAttribute("data-colid");if(G&&(M=L.getColumns().findIndex(T=>T.id===G)),M<0){const T=Array.from(k.querySelectorAll(".vxe-body--column")).indexOf(i),N=!!i.closest(".vxe-table--fixed-left-wrapper"),j=!!i.closest(".vxe-table--fixed-right-wrapper"),O=L.getColumns();if(N){const U=O.filter(A=>A.fixed==="left");T<U.length&&(M=O.indexOf(U[T]))}else if(j){const U=O.filter(A=>A.fixed==="right");T<U.length&&(M=O.indexOf(U[T]))}else{const U=l.searchForm.showCheckBox?1:0;M=O.filter(H=>H.fixed==="left").length+T-U}}return M<0?null:{rowIndex:z,colIndex:M,cell:i}},B=u=>{const i=R(u.target);if(!i){Ce();return}y.isSelecting=!0,y.startCell={rowIndex:i.rowIndex,colIndex:i.colIndex},y.endCell={...y.startCell},Fe(),De()},le=u=>{if(!y.isSelecting)return;const i=R(u.target);i&&(y.endCell={rowIndex:i.rowIndex,colIndex:i.colIndex},Fe(),De())},ge=()=>{y.isSelecting=!1},Ce=()=>{y.selectedCells=[],y.startCell=null,y.endCell=null;const u=C.value;if(!u)return;u.$el.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(k=>{k.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")})},Fe=()=>{if(!y.startCell||!y.endCell){y.selectedCells=[];return}const u=y.startCell.rowIndex,i=y.endCell.rowIndex,k=y.startCell.colIndex,L=y.endCell.colIndex,z=Math.min(u,i),P=Math.max(u,i),M=Math.min(k,L),G=Math.max(k,L);y.selectedCells=[];for(let F=z;F<=P;F++)for(let T=M;T<=G;T++)y.selectedCells.push({rowIndex:F,colIndex:T})},De=()=>{e.nextTick(()=>{const u=C.value;if(!u)return;const i=u.$el;if(i.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(N=>{N.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")}),y.selectedCells.length===0)return;const k=u.getColumns(),L=y.selectedCells.map(N=>N.rowIndex),z=y.selectedCells.map(N=>N.colIndex),P=Math.min(...L),M=Math.max(...L),G=Math.min(...z),F=Math.max(...z),T=[i.querySelector(".vxe-table--body-wrapper tbody"),i.querySelector(".vxe-table--fixed-left-wrapper tbody"),i.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean);y.selectedCells.forEach(({rowIndex:N,colIndex:j})=>{const O=k[j];if(!O)return;const U=O.fixed==="left",A=O.fixed==="right";for(const H of T){const re=H.querySelectorAll(".vxe-body--row")[N];if(!re)continue;const Q=Array.from(re.querySelectorAll(".vxe-body--column"));let D=null;if(U&&H.closest(".vxe-table--fixed-left-wrapper")){const K=k.filter(Z=>Z.fixed==="left").indexOf(O);D=Q[K]}else if(A&&H.closest(".vxe-table--fixed-right-wrapper")){const K=k.filter(Z=>Z.fixed==="right").indexOf(O);D=Q[K]}else if(!U&&!A&&H.closest(".vxe-table--body-wrapper")){const X=l.searchForm.showCheckBox?1:0,K=k.filter(we=>we.fixed==="left").length,Z=j-K;D=Q[Z+X]}if(D&&!D.classList.contains("col--checkbox")&&!D.classList.contains("col--seq")){D.classList.add("cell-selected"),N===P&&D.classList.add("cell-border-top"),N===M&&D.classList.add("cell-border-bottom"),j===G&&D.classList.add("cell-border-left"),j===F&&D.classList.add("cell-border-right");break}}})})},Bt=async()=>{if(y.selectedCells.length===0)return;const u=C.value;if(!u)return;const i=u.$el,k=u.getColumns(),L=[...new Set(y.selectedCells.map(F=>F.rowIndex))].sort((F,T)=>F-T),z=[...new Set(y.selectedCells.map(F=>F.colIndex))].sort((F,T)=>F-T),P=[i.querySelector(".vxe-table--body-wrapper tbody"),i.querySelector(".vxe-table--fixed-left-wrapper tbody"),i.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean),M=[];L.forEach(F=>{const T=[];z.forEach(N=>{const j=k[N];if(!j){T.push("");return}const O=j.fixed==="left",U=j.fixed==="right";let A="";for(const H of P){const re=H.querySelectorAll(".vxe-body--row")[F];if(!re)continue;const Q=Array.from(re.querySelectorAll(".vxe-body--column"));let D=null;if(O&&H.closest(".vxe-table--fixed-left-wrapper")){const K=k.filter(Z=>Z.fixed==="left").indexOf(j);D=Q[K]}else if(U&&H.closest(".vxe-table--fixed-right-wrapper")){const K=k.filter(Z=>Z.fixed==="right").indexOf(j);D=Q[K]}else if(!O&&!U&&H.closest(".vxe-table--body-wrapper")){const X=l.searchForm.showCheckBox?1:0,K=k.filter(we=>we.fixed==="left").length,Z=N-K;D=Q[Z+X]}if(D&&!D.classList.contains("col--checkbox")&&!D.classList.contains("col--seq")){A=D.innerText||D.textContent||"",A=A.trim(),A=A.replace(/\n/g," ").replace(/\s+/g," ");break}}T.push(A)}),M.push(T.join(" "))});const G=M.join(`
2
- `);try{await navigator.clipboard.writeText(G)}catch(F){console.error("复制失败:",F)}},ye=u=>{l.searchForm.enableCellCopy&&((u.ctrlKey||u.metaKey)&&u.key==="c"?y.selectedCells.length>0&&(u.preventDefault(),u.stopPropagation(),Bt()):u.key==="Escape"&&Ce())},Be=()=>{y.isSelecting=!1},Oe=u=>{const i=C.value;if(!i||!i.$el)return;i.$el.contains(u.target)||Ce()},be=e.computed(()=>{const{customConfig:u,columnConfig:i,...k}=l.tableConfig;return{headerAlign:"left",align:"center",customConfig:{...E,...u},columnConfig:{...x,...i},"virtual-x-config":{enabled:!1,scrollToLeftOnChange:!1},"virtual-y-config":{enabled:!0,gt:100},...k}}),Ot=u=>{b.pageNo=u,g()},zt=u=>{b.pageSize=u,b[c]=1,g()};function ze(){const u=C.value.getCheckboxRecords();l.searchForm.selections=u}const Me=u=>{const i=C.value;if(i){i.toggleCheckboxRow(u);const k=C.value.getCheckboxRecords();l.searchForm.selections=k}};return t({tableRef:C,getList:g,getPrm:V,clearSort:q,calculateTableHeight:S}),(u,i)=>{var F;const k=e.resolveComponent("el-button"),L=e.resolveComponent("el-checkbox"),z=e.resolveComponent("el-text"),P=e.resolveComponent("vxe-column"),M=e.resolveComponent("VxeTable"),G=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({box:o.searchForm.showShadow})},[o.searchForm.showSearch?(e.openBlock(),e.createBlock(Le,{key:0,form:o.searchForm,onReset:v,onConfirm:i[1]||(i[1]=T=>g()),onVisibleChange:e.unref(S)},{btn:e.withCtx(()=>[e.renderSlot(u.$slots,"search-bar-btn",{},void 0,!0),e.createVNode(k,{round:"",onClick:i[0]||(i[0]=T=>C.value.openCustom())},{default:e.withCtx(()=>[e.createVNode(he,{name:"Tools"})]),_:1})]),_:3},8,["form","onVisibleChange"])):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"table-header-left",{},void 0,!0),e.createElementVNode("div",{ref_key:"tableContentRef",ref:$},[e.createVNode(M,e.mergeProps({id:o.id,ref_key:"tableRef",ref:C,loading:o.loading||a.value,data:o.api?s.value:o.data,border:""},be.value,{height:m.value,onCheckboxChange:ze,onCheckboxAll:ze,onSortChange:(F=be.value["sort-config"])==null?void 0:F.sortChange}),{default:e.withCtx(()=>[o.searchForm.showCheckBox==null||o.searchForm.showCheckBox?(e.openBlock(),e.createBlock(P,{key:0,type:"checkbox",width:e.unref(r)=="zh_cn"?80:150,title:u.$t("xu-hao"),fixed:"left"},{checkbox:e.withCtx(({rowIndex:T,row:N,checked:j,disabled:O,indeterminate:U})=>[e.createElementVNode("div",yt,[j?(e.openBlock(),e.createBlock(L,{key:0,checked:!0,disabled:O,size:"default",onClick:e.withModifiers(A=>!O&&Me(N),["stop"])},null,8,["disabled","onClick"])):(e.openBlock(),e.createBlock(L,{key:1,disabled:O,checked:!1,size:"default",onClick:e.withModifiers(A=>!O&&Me(N),["stop"])},null,8,["disabled","onClick"])),e.createVNode(z,{type:"info",class:"mgl5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(T+1),1)]),_:2},1024)])]),_:1},8,["width","title"])):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"default",{},void 0,!0)]),_:3},16,["id","loading","data","height","onSortChange"])],512),o.searchForm.showPage?(e.openBlock(),e.createBlock(G,{key:1,"current-page":b[e.unref(c)],"onUpdate:currentPage":i[2]||(i[2]=T=>b[e.unref(c)]=T),class:"myPagination mgt10",background:"",layout:"total, sizes, prev, pager, next",total:b.total,"page-size":b.pageSize,"page-sizes":[10,50,100,500],onCurrentChange:Ot,onSizeChange:zt},null,8,["current-page","total","page-size"])):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-1515c739"]]),wt={__name:"index",props:{sheetsConfig:{type:Object,required:!0},fileName:{type:String,required:!0}},setup(o){const t=o;function n(){Te(t.fileName,t.sheetsConfig)}return(r,l)=>{const a=e.resolveComponent("el-link");return e.openBlock(),e.createBlock(a,e.mergeProps({type:"primary",underline:"never"},r.$attrs,{onClick:n}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.$t("xia-zai-dao-ru-mo-ban")),1)]),_:1},16)}}};function xt(o,t={}){const n=ce(),r={inForm:!0,required:!0,...t},l={phone:/^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/,password:/(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/,email:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/}[o],{inForm:a,value:s,required:d,msg:c=n("validate.invalidInput")}=r;return a?function(b,C,$){if(d){l.test(C)?$():$(new Error(c));return}C&&!l.test(C)?$(new Error(c)):$()}:l.test(s)}class kt{constructor(t={}){this.config={clientCode:t.clientCode||"one-portal",casServerUrl:`https://one-portal${t.isTest?"-test":""}.joy-group.com/api`,casPortalUrl:`https://one-portal${t.isTest?"-test":""}.joy-group.com`,serviceUrl:t.serviceUrl||window.location.origin+"/cas/callback",tokenKey:t.tokenKey||"one_portal_token",userKey:t.userKey||"one_portal_user",debug:t.debug||!1,autoLogin:t.autoLogin!==!1,loginCallback:t.loginCallback||null,logoutCallback:t.logoutCallback||null,errorCallback:t.errorCallback||null},this.token=null,this.user=null,this.init()}init(){this.log("OnePortal CAS SDK 初始化中..."),this.loadFromStorage();const n=new URLSearchParams(window.location.search).get("ticket");this.isLoggedIn()&&this.config.loginCallback?this.config.loginCallback(this.user,this.token):n?(this.log("检测到ST票据:",n),this.validateTicket(n)):this.config.autoLogin&&!this.isLoggedIn()&&(this.log("用户未登录,准备跳转到CAS登录页面"),this.login())}loadFromStorage(){try{this.token=localStorage.getItem(this.config.tokenKey);const t=localStorage.getItem(this.config.userKey);t&&(this.user=JSON.parse(t)),this.log("从本地存储加载数据:",{token:!!this.token,user:!!this.user})}catch(t){this.log("加载本地存储数据失败:",t)}}saveToStorage(){try{this.token&&localStorage.setItem(this.config.tokenKey,this.token),this.user&&localStorage.setItem(this.config.userKey,JSON.stringify(this.user)),this.log("数据已保存到本地存储")}catch(t){this.log("保存到本地存储失败:",t)}}clearStorage(){try{localStorage.removeItem(this.config.tokenKey),localStorage.removeItem(this.config.userKey),this.log("本地存储已清除")}catch(t){this.log("清除本地存储失败:",t)}}isLoggedIn(){return!!(this.token&&this.user)}getUser(){return this.user}getToken(){return this.token}login(){const t=`${this.config.casPortalUrl}?appCode=${this.config.clientCode}&redirectUrl=${encodeURIComponent(this.config.serviceUrl)}`;this.log("跳转到CAS登录页面:",t),window.location.href=t}async validateTicket(t){try{this.log("验证ST票据:",t);const n=await fetch(`${this.config.casServerUrl}/auth/validateST?ticket=${t}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);const r=await n.json();if(r.success&&r.data)return this.token=r.data.token,this.user=r.data.user,this.saveToStorage(),this.clearTicketFromUrl(),this.log("ST票据验证成功,用户登录成功:",this.user),this.config.loginCallback&&this.config.loginCallback(this.user,this.token),!0;throw new Error(r.message||"ST票据验证失败")}catch(n){return this.log("ST票据验证失败:",n),this.handleError(n),!1}}clearTicketFromUrl(){const t=new URL(window.location);t.searchParams.delete("ticket"),window.history.replaceState({},document.title,t.toString())}async logout(t=!0){try{if(this.log("用户登出"),this.token)try{await fetch(`${this.config.casServerUrl}/auth/logout`,{method:"POST",headers:{AppId:this.config.clientCode,Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"}})}catch(n){this.log("调用服务端登出接口失败:",n)}this.token=null,this.user=null,this.clearStorage(),this.config.logoutCallback&&this.config.logoutCallback(),t&&this.login()}catch(n){this.log("登出失败:",n),this.handleError(n)}}async request(t,n={}){const r={headers:{"Content-Type":"application/json",...n.headers},...n};r.headers.appId=this.config.clientCode,this.token&&(r.headers.Authorization=`Bearer ${this.token}`);try{const l=await fetch(t,r);return l.status===401?(this.log("Token已过期,需要重新登录"),this.logout(),null):l}catch(l){throw this.log("请求失败:",l),l}}async fetchUserInfo(){try{const t=await this.request(`${this.config.casServerUrl}/auth/user`);if(t&&t.ok){const n=await t.json();if(n.success&&n.data)return this.user=n.data,this.saveToStorage(),this.user}return null}catch(t){return this.log("获取用户信息失败:",t),null}}async refreshToken(){this.log("Token刷新功能暂未实现")}handleError(t){this.log("发生错误:",t),this.config.errorCallback&&this.config.errorCallback(t)}log(...t){this.config.debug&&console.log("[OnePortal CAS SDK]",...t)}checkLoginStatus(){return!this.isLoggedIn()&&this.config.autoLogin?(this.login(),!1):this.isLoggedIn()}setConfig(t,n){this.config[t]=n}getConfig(t){return this.config[t]}}function _t(o,t={}){const r=Object.assign({manual:!1,log:!1,params:null,format:null},t),{manual:l,log:a,params:s={},cb:d,format:c}=r,b=e.ref([]),C=e.ref(!1),$=_=>{const S=_||s;C.value=!0,o(S).then(w=>{const{code:f,data:m,msg:I}=w;if(d){const{records:p,rows:g}=m||{},v=p||g?p||g:m;b.value=pe(v,c),d(w)}if(m){if(m.records!=null||m.rows!=null){const{records:p,rows:g,total:v=0}=m||{};S&&S.total!=null&&(s.total=parseInt(v)),b.value=pe(p||g||[],c)}else b.value=pe(m,c);a&&console.log("useRequest-res",b.value)}}).catch(w=>{d&&(console.log("useRequestErr",w),d({code:500}))}).finally(()=>{C.value=!1})};return l||$(),[C,b,$]}function St(o){const t=e.ref(o),n=e.ref(""),r=e.ref("");return e.watch(t,l=>{const a=l||["",""];n.value=a[0],r.value=a[1]}),[t,n,r]}function $t(o){return Object.prototype.toString.call(o).slice(8,-1).toLowerCase()}function pe(o,t){if(!t)return o;if(o instanceof Array)return o.map(r=>{let l={};return t.forEach(a=>l[a]=r[a]),l});let n={};return t.forEach(r=>n[r]=o[r]),n}function Et(o,t=[]){const{locale:n}=J.useI18n(),r=e.ref(o());return e.watch([n,...t],()=>{r.value=o()},{immediate:!0}),r}function It(o,t="zh_cn",n="en_us"){if(!o)return"-";const r={en_us:n,zh_cn:t},a=ue().global.locale.value;return o[r[a]]||o[t]||"-"}function Tt(o,t){let n=W.mapState;return typeof o=="string"&&o.length>0&&(n=W.createNamespacedHelpers(o).mapState),Ve(t,n)}function vt(o,t){let n=W.mapGetters;return typeof o=="string"&&o.length>0&&(n=W.createNamespacedHelpers(o).mapGetters),Ve(t,n)}function Lt(o,t){let n=W.mapActions;return typeof o=="string"&&o.length>0&&(n=W.createNamespacedHelpers(o).mapActions),Vt(t,n)}function Ve(o,t){const n=W.useStore(),r=t(o),l={};return Object.keys(r).forEach(a=>{const s=r[a].bind({$store:n});l[a]=e.computed(s)}),l}function Vt(o,t){const n=W.useStore(),r=t(o),l={};return Object.keys(r).forEach(a=>{l[a]=r[a].bind({$store:n})}),l}const Ft={__name:"EnumRender",props:{renderOpts:{type:Object,default:()=>({enum:{}})},params:{type:Object}},setup(o){const t=o,n=t.params.row[t.params.column.field];return(r,l)=>{const a=e.resolveComponent("el-text");return o.renderOpts.text?(e.openBlock(),e.createBlock(a,{key:0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.renderOpts.enum.getName(e.unref(n))),1)]),_:1})):(e.openBlock(),e.createBlock(a,{key:1,type:o.renderOpts.enum.getTag(e.unref(n))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.renderOpts.enum.getName(e.unref(n))),1)]),_:1},8,["type"]))}}};function Dt(){ne.VxeUI.renderer.add("Enum",{renderTableDefault(o,t){return[null,void 0].includes(t.row[t.column.field])?"-":React.createElement(Ft,{renderOpts:o,params:t})}}),ne.VxeUI.renderer.add("InputNumber",{renderTableDefault(o,t){return React.createElement(Y.ElInputNumber,{"v-model":t.row[t.column.field],...o.props,"step-strictly":!0,"value-on-clear":0})}}),ne.VxeUI.renderer.add("TrueFalse",{renderTableDefault(o,t){const{locale:n}=J.useI18n();let r=n.value=="zh_cn";return React.createElement(Y.ElText,{type:t.row[t.column.field]?"success":"danger"},t.row[t.column.field]?r?"是":"YES":r?"否":"NO")}}),ne.VxeUI.renderer.add("I18n",{renderTableDefault(o,t){const{locale:n}=J.useI18n();let r=n.value=="zh_cn"?t.column.field:o.fieldEn;return t.row[r]||t.row[t.column.field]}}),ne.VxeUI.renderer.add("Link",{renderTableDefault(o,t){var d;let n=t.column.field;const r=Re.useRouter(),{multiple:l,to:a}=o;if(!l)return React.createElement(Y.ElLink,{underline:"never",type:"primary",onclick:()=>r.push({path:a,query:{[n]:t.row[n]}})},t.row[n]);const s=((d=t.row[n])==null?void 0:d.split(","))||[];return s.map((c,b)=>React.createElement("span",null,React.createElement(Y.ElLink,{underline:"never",type:"primary",onclick:()=>r.push({path:a,query:{[n]:c}})},c),b<s.length-1?",":""))}})}h.CmpDictionary=ve,h.CmpIcon=he,h.ConfrimButton=dt,h.DownExcelTemp=wt,h.ImportButton=ht,h.LayOutForm=Ae,h.ListPage=bt,h.OnePortalCasSDK=kt,h.SearchBar=Le,h.StatusMap=fe,h._toRaw=et,h._typeOf=$t,h.arrToStatusMap=nt,h.arrayToTree=tt,h.checkFileSize=rt,h.creatValidator=xt,h.createImportFields=st,h.createListPageId=at,h.en=ie,h.exportExcel=Te,h.getI18n=ue,h.getI18nT=ce,h.getLocaleValue=It,h.getValueBykey=it,h.importExcel=Ye,h.messages=Ee,h.registerVxeRenderers=Dt,h.setupI18n=Ie,h.sleep=Xe,h.stringToArray=de,h.stripHtmlTags=ot,h.unicode2Str=lt,h.useActions=Lt,h.useDatePicker=St,h.useGetters=vt,h.useI18nReState=Et,h.useRequest=_t,h.useState=Tt,h.zhCn=se,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
1
+ (function(h,Y){typeof exports=="object"&&typeof module<"u"?Y(exports,require("element-plus"),require("vue"),require("file-saver"),require("exceljs"),require("dayjs"),require("vue-i18n"),require("lodash"),require("vuex"),require("vxe-pc-ui"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","element-plus","vue","file-saver","exceljs","dayjs","vue-i18n","lodash","vuex","vxe-pc-ui","vue-router"],Y):(h=typeof globalThis<"u"?globalThis:h||self,Y(h.JoyAdminComponents={},h.ElementPlus,h.Vue,h.fileSaver,h.ExcelJS,h.dayjs,h.VueI18n,h._,h.Vuex,h.VxeUI,h.VueRouter))})(this,function(h,Y,e,Ne,xe,ae,J,ee,W,ne,Re){"use strict";const Ae=e.defineComponent({name:"LayOutForm",setup(o,{slots:t,attrs:n,emit:r}){const l=e.ref(null),a=()=>t.default?t.default().filter(f=>f.type!==Symbol.for("v-cmt")).map(f=>f.type===Symbol.for("v-fgt")?f.children:f).flat().map(f=>{var c;return e.h(Y.ElCol,{span:((c=f.props)==null?void 0:c.span)||24},{default:()=>f})}):null;e.onMounted(()=>{r("ref",l.value)});function s(){return e.h(Y.ElForm,{...n,ref:l},()=>e.h(Y.ElRow,{gutter:n.gutter??20},{default:()=>a()}))}return s}});var ke=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _e(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Se={exports:{}};(function(o,t){(function(n,r){o.exports=r()})(ke,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,l=/([+-]|\d\d)/g;return function(a,s,f){var c=s.prototype;f.utc=function(d){var m={date:d,utc:!0,args:arguments};return new s(m)},c.utc=function(d){var m=f(this.toDate(),{locale:this.$L,utc:!0});return d?m.add(this.utcOffset(),n):m},c.local=function(){return f(this.toDate(),{locale:this.$L,utc:!1})};var b=c.parse;c.parse=function(d){d.utc&&(this.$u=!0),this.$utils().u(d.$offset)||(this.$offset=d.$offset),b.call(this,d)};var C=c.init;c.init=function(){if(this.$u){var d=this.$d;this.$y=d.getUTCFullYear(),this.$M=d.getUTCMonth(),this.$D=d.getUTCDate(),this.$W=d.getUTCDay(),this.$H=d.getUTCHours(),this.$m=d.getUTCMinutes(),this.$s=d.getUTCSeconds(),this.$ms=d.getUTCMilliseconds()}else C.call(this)};var $=c.utcOffset;c.utcOffset=function(d,m){var T=this.$utils().u;if(T(d))return this.$u?0:T(this.$offset)?$.call(this):this.$offset;if(typeof d=="string"&&(d=function(V){V===void 0&&(V="");var q=V.match(r);if(!q)return null;var E=(""+q[0]).match(l)||["-",0,0],x=E[0],y=60*+E[1]+ +E[2];return y===0?0:x==="+"?y:-y}(d),d===null))return this;var p=Math.abs(d)<=16?60*d:d;if(p===0)return this.utc(m);var g=this.clone();if(m)return g.$offset=p,g.$u=!1,g;var v=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(g=this.local().add(p+v,n)).$offset=p,g.$x.$localOffset=v,g};var _=c.format;c.format=function(d){var m=d||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return _.call(this,m)},c.valueOf=function(){var d=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*d},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var S=c.toDate;c.toDate=function(d){return d==="s"&&this.$offset?f(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():S.call(this)};var w=c.diff;c.diff=function(d,m,T){if(d&&this.$u===d.$u)return w.call(this,d,m,T);var p=this.local(),g=f(d).local();return w.call(p,g,m,T)}}})})(Se);var qe=Se.exports;const je=_e(qe);var $e={exports:{}};(function(o,t){(function(n,r){o.exports=r()})(ke,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(l,a,s){var f,c=function(_,S,w){w===void 0&&(w={});var d=new Date(_),m=function(T,p){p===void 0&&(p={});var g=p.timeZoneName||"short",v=T+"|"+g,V=r[v];return V||(V=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:T,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:g}),r[v]=V),V}(S,w);return m.formatToParts(d)},b=function(_,S){for(var w=c(_,S),d=[],m=0;m<w.length;m+=1){var T=w[m],p=T.type,g=T.value,v=n[p];v>=0&&(d[v]=parseInt(g,10))}var V=d[3],q=V===24?0:V,E=d[0]+"-"+d[1]+"-"+d[2]+" "+q+":"+d[4]+":"+d[5]+":000",x=+_;return(s.utc(E).valueOf()-(x-=x%1e3))/6e4},C=a.prototype;C.tz=function(_,S){_===void 0&&(_=f);var w,d=this.utcOffset(),m=this.toDate(),T=m.toLocaleString("en-US",{timeZone:_}),p=Math.round((m-new Date(T))/1e3/60),g=15*-Math.round(m.getTimezoneOffset()/15)-p;if(!Number(g))w=this.utcOffset(0,S);else if(w=s(T,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(g,!0),S){var v=w.utcOffset();w=w.add(d-v,"minute")}return w.$x.$timezone=_,w},C.offsetName=function(_){var S=this.$x.$timezone||s.tz.guess(),w=c(this.valueOf(),S,{timeZoneName:_}).find(function(d){return d.type.toLowerCase()==="timezonename"});return w&&w.value};var $=C.startOf;C.startOf=function(_,S){if(!this.$x||!this.$x.$timezone)return $.call(this,_,S);var w=s(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return $.call(w,_,S).tz(this.$x.$timezone,!0)},s.tz=function(_,S,w){var d=w&&S,m=w||S||f,T=b(+s(),m);if(typeof _!="string")return s(_).tz(m);var p=function(q,E,x){var y=q-60*E*1e3,R=b(y,x);if(E===R)return[y,E];var B=b(y-=60*(R-E)*1e3,x);return R===B?[y,R]:[q-60*Math.min(R,B)*1e3,Math.max(R,B)]}(s.utc(_,d).valueOf(),T,m),g=p[0],v=p[1],V=s(g).utcOffset(v);return V.$x.$timezone=m,V},s.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},s.tz.setDefault=function(_){f=_}}})})($e);var Ue=$e.exports;const Pe=_e(Ue),se={"dao-ru":"导入","quan-xuan":"全选","xia-zai-dao-ru-mo-ban":"下载导入模板","xu-hao":"序号","qing-shu-ru":"请输入","qing-xuan-ze":"请选择","kai-shi-shi-jian":"开始时间","jie-shu-shi-jian":"结束时间","shai-xuan":"筛选","chong-zhi":"重置","guan-bi":"关闭","zhan-kai":"展开",excel:{fieldsMappingRequired:"请输入列字段映射",invalidInput:"非法输入",invalidOption:"请输入有效选项!",copyFailed:"复制失败",sheetNameTooLong:'Sheet名称 "{0}" 长度超过31个字符,已自动截断为 "{1}"'},validate:{invalidInput:"请输入正确内容"},tools:{keysLengthError:"keys 长度必须大于2 默认前两位为 label value"}},ie={"dao-ru":"Import","quan-xuan":"Select All","xia-zai-dao-ru-mo-ban":"Download Import Template","xu-hao":"No.","qing-shu-ru":"Please enter","qing-xuan-ze":"Please select","kai-shi-shi-jian":"Start Time","jie-shu-shi-jian":"End Time","shai-xuan":"Filter","chong-zhi":"Reset","guan-bi":"Collapse","zhan-kai":"Expand",excel:{fieldsMappingRequired:"Please enter column field mapping",invalidInput:"Invalid input",invalidOption:"Please enter a valid option!",copyFailed:"Copy failed",sheetNameTooLong:'Sheet name "{0}" exceeds 31 characters, automatically truncated to "{1}"'},validate:{invalidInput:"Please enter valid content"},tools:{keysLengthError:"Keys length must be greater than 2, default first two are label and value"}},Ee={zh_cn:se,en:ie};let te=null;function Te(o=null){if(o){const{global:t}=o;return t.messages.value.zh_cn?t.mergeLocaleMessage("zh_cn",se):t.setLocaleMessage("zh_cn",se),t.messages.value.en?t.mergeLocaleMessage("en",ie):t.setLocaleMessage("en",ie),te=o,o}return te||(te=J.createI18n({legacy:!1,locale:"zh_cn",fallbackLocale:"zh_cn",messages:Ee})),te}function ue(){return te||Te()}function ce(){return ue().global.t}ae.extend(je),ae.extend(Pe);async function Ye(o,t){const{fields:n,range:r=1}=t;if(!n){const s=ce();throw new Error(s("excel.fieldsMappingRequired"))}let l=new xe.Workbook;await l.xlsx.load(o);const a={};return l.eachSheet(function(s,f){const c=[];s.eachRow(function(b,C){if(C>r){let $={},_=!0;Object.keys(n).forEach(S=>{const w=b.getCell(n[S]).value;$[S]=w,w&&(_=!1)}),_||c.push($)}}),a[s._name]=c}),l=null,a}const He={columnWidth:30};async function Ie(o,t,n=[],r={}){if(!o||!t)return;const{columnStyle:l}=r,{columnWidth:a}=He;t.forEach(c=>{c.width=c.width?c.width:a});const{workbook:s,worksheet:f}=Ke();f.columns=t,f.addRows(n),l&&await Ze(s,f,l);try{const c=await s.xlsx.writeBuffer(),b=new File([c],o,{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});Ne.saveAs(b)}catch(c){console.log(c)}}function Ke(){const o=new xe.Workbook;o.creator="distributor System",o.lastModifiedBy="distributor System",o.created=new Date,o.modified=new Date,o.lastPrinted=new Date;const t=o.addWorksheet("Sheet1");return{workbook:o,worksheet:t}}async function Ze(o,t,n){const r=Object.keys(n);for(const l of r){const a=n[l],{type:s}=a;switch(s){case"IMG":await Ge(o,t,l);break}}}async function Ge(o,t,n,r){const l=t.getColumn(n),a=l.values;t.getColumn(n).width=20,t.eachRow((s,f)=>{f>1&&(s.height=40)});for(let s=0,f=a.length;s<f;s++){if(s<2)continue;let c=a[s];c&&(t.getCell(l.letter+s).value="",await We(o,t,c,{width:100,height:50,col:l._number-1,row:s-1}))}}async function We(o,t,n,r){const{col:l,row:a,width:s,height:f}=r,{success:c,base64:b}=await Je(n,.3);if(c){const C=o.addImage({base64:b,extension:"jpeg"});t.addImage(C,{tl:{col:l,row:a},ext:{width:s,height:f}})}}function Je(o,t=1){const n=new Image;return n.setAttribute("crossOrigin","anonymous"),n.crossOrigin="anonymous",n.src=o,new Promise((r,l)=>{n.onload=()=>{const a=document.createElement("canvas");a.width=n.width,a.height=n.height,a.getContext("2d").drawImage(n,0,0,a.width,a.height),r({success:!0,base64:a.toDataURL("image/jpeg",t)})},n.onerror=()=>{r({success:!1})}})}function Qe(o){if(o<26)return String.fromCharCode(65+o);{const t=String.fromCharCode(65+Math.floor((o-26)/26)),n=String.fromCharCode(65+(o-26)%26);return t+n}}function Xe(o){return new Promise(t=>{setTimeout(()=>{t()},o)})}function et(o){return JSON.parse(JSON.stringify(o))}function tt(o){let t=[],n={},r=(l,a)=>Object.prototype.hasOwnProperty.call(l,a);for(const l of o){n[l.id]={...l,children:r(n,l.id)?n[l.id].children:[]};const a=n[l.id];l.pid==-1?t.push(a):(r(n,l.pid)||(n[l.pid]={children:[]}),n[l.pid].children.push(a))}return t}function de(o,t=" "){return o?o.split(t).filter(n=>n.trim()):[]}class fe{constructor(t,n=["label","value","labelEn"]){this.list=t,this.map=new Map(t.map(r=>{let l={...r,label:r[n[0]],value:r[n[1]]};return n[2]&&(l.labelEn=r[n[2]]),[r[n[1]],l]}))}getName(t,n){if(!this.has(t))return"-";const{label:r,labelEn:l}=this.map.get(t);return(n=="zh_cn"?r:l)||r||"-"}getTag(t){if(!this.has(t))return"info";const{tag:n="info"}=this.map.get(t);return n}getItem(t){return this.has(t)?this.map.get(t):null}getColor(t){if(!this.has(t))return null;const{color:n}=this.map.get(t);return n}has(t){return this.map.has(t)}}function nt(o,t=[],n="i18nName"){if(o.length==0)return new fe([]);if(t.length<2){const l=ce();throw new Error(l("tools.keysLengthError"))}let r=o.map(l=>{let a={};return n&&(a.labelEn=l[n]),t.forEach((s,f)=>{f===0?a.label=l[s]:f===1?a.value=l[s]:a[s]=l[s]}),a});return new fe(r)}function ot(o){return o?o.replace(/<[^>]+>/g,""):""}function lt(o){return o?(o.includes("\\\\u")&&(o=o.replace(/\\/g,"")),o.replace(/\\u[\dA-F]{4}/gi,t=>String.fromCharCode(parseInt(t.replace(/\\u/g,""),16)))):""}function rt(o,t=10){let n=1048576*t;return!(o.size>n)}function at(o){return Array.from(10).fill(0).map((n,r)=>o+"_"+r)}function st(o){let t={};return o.map((n,r)=>{let{key:l,option:a,type:s}=n,f=Qe(r);a?t[l]=`${f}---option`:s==="image"?t[l]=`${f}---image`:t[l]=f}),t}function it(o,t){return t.split(".").reduce((n,r)=>n&&n[r],o)}const Nt="",oe=(o,t)=>{const n=o.__vccOpts||o;for(const[r,l]of t)n[r]=l;return n},ve=oe({__name:"index",props:e.mergeModels({api:{type:Function},showCheckAll:{type:Boolean,default:!0},maxLimit:{type:Number,default:void 0},optionClick:{type:Function,default:()=>{}},data:{type:Array},labelValue:{type:Object,default:()=>({label:"label",labelEn:"labelEn",value:"value"})},changeLocal:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["success","change"],["update:modelValue"]),setup(o,{emit:t}){const n=o,r=e.useAttrs(),{t:l,locale:a}=J.useI18n(),s=e.useModel(o,"modelValue"),f=e.ref(""),c=e.computed(()=>{if(r.remote!==void 0)return n.data;const p=de(f.value),{data:g,labelValue:v}=n,V=g||$.value;if(p.length==0)return V;const{label:q,labelEn:E}=v;let x=a.value=="en_us"?E||"i18nName":q;return p.length==1?V.filter(R=>R[x].toLowerCase().includes(p[0].toLowerCase())):V.filter(R=>{let B=!1;return B=p.some(le=>R[x].toLowerCase()==le.toLowerCase()),B})}),b=e.computed({get(){return r.multiple==null||s.value==null?!1:s.value.length==c.value.length},set(p){return p}}),C=t,$=e.ref([]),_=async()=>{const{data:p}=await n.api();$.value=[...p],C("success",$)};n.api&&_();const S=n.labelValue.label.split("-"),w=p=>{if(S.length==1){if(n.changeLocal)return l(p[n.labelValue.label]);let g=a.value=="en_us"?p[n.labelValue.labelEn||"i18nName"]:p[n.labelValue.label];return g=g||p[n.labelValue.label],g}else{let g=[];return S.forEach(v=>{g.push(p[v])}),g.join("-")}};function d(p){s.value=p?c.value.map(g=>g[n.labelValue.value]):[],C("change",s.value)}function m(p){n.optionClick(p),C("change",r["value-key"]?p:p[n.labelValue.value])}function T(p){return s.value.length>=n.maxLimit&&!s.value.includes(p[n.labelValue.value])}return(p,g)=>{const v=e.resolveComponent("el-checkbox"),V=e.resolveComponent("el-option"),q=e.resolveComponent("el-select");return e.openBlock(),e.createBlock(q,e.mergeProps({modelValue:s.value,"onUpdate:modelValue":g[1]||(g[1]=E=>s.value=E),filterable:"","collapse-tags":"","collapse-tags-tooltip":"","filter-method":e.unref(r).remote!=null?void 0:E=>f.value=E,clearable:""},e.unref(r),{onClear:o.optionClick}),{default:e.withCtx(()=>[e.unref(r).multiple!=null&&o.showCheckAll&&o.maxLimit==null?e.renderSlot(p.$slots,"header",{key:0},()=>[e.createVNode(v,{class:"mgl20",modelValue:b.value,"onUpdate:modelValue":g[0]||(g[0]=E=>b.value=E),onChange:d},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.$t("quan-xuan")),1)]),_:1},8,["modelValue"])],!0):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(E,x)=>(e.openBlock(),e.createBlock(V,{key:x,label:w(E),disabled:e.unref(r).multiple!=null&&o.maxLimit>0?T(E):!1,onClick:e.withModifiers(y=>m(E),["stop"]),value:e.unref(r)["value-key"]?E:E[o.labelValue.value]},null,8,["label","disabled","onClick","value"]))),128))]),_:3},16,["modelValue","filter-method","onClear"])}}},[["__scopeId","data-v-34eb8641"]]),At="",ct=e.defineComponent({props:{name:{tyepe:String,required:!0}}});function ut(o,t,n,r,l,a){const s=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(s,{class:"cmp-icon"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.name)))]),_:1})}const he=oe(ct,[["render",ut],["__scopeId","data-v-733f9daa"]]),dt={__name:"index",emits:["ok","no"],setup(o,{emit:t}){const n=t,r=ee.debounce(()=>{n("ok")},500);function l(){n("no")}return(a,s)=>{const f=e.resolveComponent("el-link"),c=e.resolveComponent("el-popconfirm");return e.openBlock(),e.createBlock(c,e.mergeProps(a.$attrs,{onConfirm:e.unref(r),onCancel:l}),{reference:e.withCtx(()=>[e.createVNode(f,{underline:"never",type:a.$attrs.type},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},8,["type"])]),_:3},16,["onConfirm"])}}},qt="",ft=["accept"],ht=oe({__name:"index",props:{accept:{type:String,default:".xlsx,.xls"},loading:{type:Boolean,default:!1}},emits:["fileChange"],setup(o,{emit:t}){const n=t,r=e.ref(null);function l(a){let s=a.target.files[0];n("fileChange",s),r.value.value=null}return(a,s)=>{const f=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("span",null,[e.createVNode(f,{loading:o.loading,class:"mgr10",onClick:s[0]||(s[0]=c=>r.value.click())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.$t("dao-ru")),1)]),_:1},8,["loading"]),e.createElementVNode("input",{onChange:l,ref_key:"input",ref:r,accept:o.accept,style:{position:"absolute",width:"0px",height:"0px",opacity:"0"},type:"file"},null,40,ft)])}}},[["__scopeId","data-v-5f1449ad"]]);function me(o){let t={};return o.forEach(n=>{const{key:r,type:l,option:a={},value:s,dateType:f}=n;if(r)if(l=="input"&&(a!=null&&a.multiple))t[r]=de(s);else if(l=="date")if(f.includes("range")){const[c,b]=r;let[C,$]=s||[];C&&f=="daterange"&&(C=ae(C).format("YYYY-MM-DD 00:00:00"),$=ae($).format("YYYY-MM-DD 23:59:59")),t[c]=C,t[b]=$}else t[r]=s;else t[r]=s}),t}const Ut="",mt={key:0},pt={class:"btns"},gt={class:"left"},Ct={class:"right"},Le=oe({__name:"index",props:{form:{type:Object,required:!0}},emits:["confirm","reset","visibleChange"],setup(o,{expose:t,emit:n}){const r=o,l=n,a=e.ref(!0),s=e.ref(null),{t:f}=J.useI18n(),c=e.computed(()=>a.value?f("guan-bi"):f("zhan-kai"));function b(){l("confirm")}function C(m){m.option.onClear&&m.option.onClear(),l("confirm")}function $(){l("reset")}function _(){l("confirm")}function S(){return me(r.form.items)}const w=ee.cloneDeep(r.form.items);function d(){r.form.items.forEach(m=>{const T=w.find(p=>p.key==m.key);T&&(m.value=T.value)})}return t({getPrm:S,reset:d}),(m,T)=>{const p=e.resolveComponent("el-input"),g=e.resolveComponent("el-date-picker"),v=e.resolveComponent("el-form-item"),V=e.resolveComponent("el-form"),q=e.resolveComponent("el-link"),E=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",{class:"searchBar-container mgt10 mgb10",onKeydown:e.withKeys(b,["enter"])},[e.createElementVNode("div",{class:"searchBar",style:e.normalizeStyle({height:a.value?"auto":"42px"})},[e.createVNode(V,{inline:"",model:o.form.data},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.form.items.filter(x=>!x.hidden),x=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:x.key},[x.type=="br"?(e.openBlock(),e.createElementBlock("br",mt)):(e.openBlock(),e.createBlock(v,{key:1,label:x.name},{default:e.withCtx(()=>{var y,R;return[x.type==="input"?(e.openBlock(),e.createBlock(p,{key:0,modelValue:x.value,"onUpdate:modelValue":B=>x.value=B,class:e.normalizeClass(((y=x.option)==null?void 0:y.class)||"w150"),placeholder:m.$t("qing-shu-ru"),clearable:""},null,8,["modelValue","onUpdate:modelValue","class","placeholder"])):x.type==="custom"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(x.render),{key:1})):e.createCommentVNode("",!0),x.type==="select"?(e.openBlock(),e.createBlock(ve,e.mergeProps({key:2,class:((R=x.option)==null?void 0:R.class)||"w150",modelValue:x.value,"onUpdate:modelValue":B=>x.value=B},{ref_for:!0},x.option,{onChange:b,onClear:B=>C(x)}),null,16,["class","modelValue","onUpdate:modelValue","onClear"])):e.createCommentVNode("",!0),x.type==="date"?(e.openBlock(),e.createBlock(g,{key:3,class:e.normalizeClass({datetimerange:"w300",daterange:"w200"}[x.dateType]||"w100"),modelValue:x.value,"onUpdate:modelValue":B=>x.value=B,"value-format":{datetimerange:"YYYY-MM-DD HH:mm:ss",daterange:"YYYY-MM-DD"}[x.dateType]||"YYYY-MM-DD",type:x.dateType||"date",onFocus:B=>s.value=x,onChange:B=>_(),placeholder:m.$t("qing-xuan-ze"),"start-placeholder":m.$t("kai-shi-shi-jian"),"end-placeholder":m.$t("jie-shu-shi-jian")},null,8,["class","modelValue","onUpdate:modelValue","value-format","type","onFocus","onChange","placeholder","start-placeholder","end-placeholder"])):e.createCommentVNode("",!0)]}),_:2},1032,["label"]))],64))),128))]),_:1},8,["model"])],4),e.createElementVNode("div",pt,[e.createElementVNode("div",gt,[e.renderSlot(m.$slots,"table-header-left",{},void 0,!0)]),e.createElementVNode("div",Ct,[e.createVNode(q,{underline:"never",class:"mgr10",onClick:T[0]||(T[0]=()=>{l("visibleChange",!a.value),a.value=!a.value})},{default:e.withCtx(()=>[e.createVNode(he,{name:a.value?"ArrowUp":"ArrowDown"},null,8,["name"]),e.createTextVNode(" "+e.toDisplayString(c.value),1)]),_:1}),e.createVNode(E,{type:"primary",onClick:b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.$t("shai-xuan")),1)]),_:1}),e.createVNode(E,{type:"primary",onClick:$},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.$t("chong-zhi")),1)]),_:1}),e.renderSlot(m.$slots,"btn",{},void 0,!0)])])],32)}}},[["__scopeId","data-v-32ac9990"]]),Yt="",yt={class:"center"},bt=oe({__name:"index",props:{id:{type:String,required:!0},loading:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0},searchForm:{type:Object,default:()=>({items:[],selections:[],showSearch:!1,showPage:!1,showShadow:!1,showCheckBox:!1,enableCellCopy:!0})},api:{type:Function},data:{type:Array},tableConfig:{type:Object,default:()=>({})}},setup(o,{expose:t}){const{t:n,locale:r}=J.useI18n(),l=o,a=e.ref(!1),s=e.ref([]);l.searchForm.selections=[],console.log("单元格复制功能默认启用,若不需要请在searchForm中设置enableCellCopy为false123",l.searchForm.enableCellCopy),l.searchForm.enableCellCopy==null&&(l.searchForm.enableCellCopy=!0);const f=ee.cloneDeep(l.searchForm.items),c=l.searchForm.pageNoKey||"pageNo",b=e.reactive({[c]:1,pageSize:10,total:0}),C=e.ref(null),$=e.ref(null),_=e.ref(450),S=ee.debounce(()=>{e.nextTick(()=>{if(!$.value)return;const i=$.value.getBoundingClientRect(),k=window.innerHeight,L=i.top,z=100,P=k-L-z,M=200;_.value=Math.max(P,M)})},100),w=()=>{S()},d=()=>{if(!l.searchForm.enableCellCopy)return!1;const u=C.value;if(!u||!u.$el)return!1;const i=u.$el;return i.classList.add("cell-copy-enabled"),i.setAttribute("tabindex","-1"),i.removeEventListener("mousedown",B),i.removeEventListener("mousemove",le),i.removeEventListener("mouseup",ge),i.removeEventListener("keydown",ye),i.addEventListener("mousedown",B),i.addEventListener("mousemove",le),i.addEventListener("mouseup",ge),i.addEventListener("keydown",ye),!0};e.onMounted(()=>{S(),window.addEventListener("resize",w),l.searchForm.enableCellCopy&&(document.addEventListener("mouseup",Be),document.addEventListener("mousedown",Oe),setTimeout(()=>{d()},500))}),e.onUpdated(()=>{l.searchForm.enableCellCopy&&setTimeout(()=>{d()},500)}),e.onUnmounted(()=>{if(window.removeEventListener("resize",w),l.searchForm.enableCellCopy){document.removeEventListener("mouseup",Be),document.removeEventListener("mousedown",Oe);const u=C.value;if(u&&u.$el){const i=u.$el;i.removeEventListener("mousedown",B),i.removeEventListener("mousemove",le),i.removeEventListener("mouseup",ge),i.removeEventListener("keydown",ye)}}});const m=e.computed(()=>be.value.height||_.value);let T;async function p(u){const{dataFormat:i}=l.tableConfig;u.pageNo!=1&&(u.nextSearchAfter=T),a.value=!0;const{code:k,data:L={}}=await l.api(u).finally(()=>{a.value=!1,l.searchForm.selections=[]});if(k==200){let z=L.rows||L.records||[];s.value=i?i(z):z,b.total=L.totalRows||L.total||0,T=L.nextSearchAfter,l.searchForm.enableCellCopy&&e.nextTick(()=>{setTimeout(()=>{d()},100)})}}function g(u={}){const{searchData:i=()=>({})}=l.tableConfig,k=i();p({...b,...me(l.searchForm.items),...u,...k})}function v(){const{reset:u}=l.tableConfig;u&&u(),l.searchForm.items.forEach(i=>{const k=f.find(L=>ee.isArray(i.key)&&ee.isArray(L.key)?i.key.join(",")==L.key.join(","):L.key==i.key);k&&(i.value=k.value)}),g()}l.api&&l.immediate&&g();function V(){return{...b,...me(l.searchForm.items)}}const q=()=>{const u=C.value;u&&u.clearSort()},E=e.reactive({storage:!0}),x=e.reactive({width:"auto",drag:!0,resizable:!0,maxFixedSize:0}),y=e.reactive({isSelecting:!1,startCell:null,endCell:null,selectedCells:[]}),R=u=>{const i=u.closest(".vxe-body--column");if(!i||i.classList.contains("col--checkbox")||i.classList.contains("col--seq"))return null;const k=i.closest(".vxe-body--row");if(!k)return null;const L=C.value;if(!L)return null;let z=-1;const P=k.getAttribute("data-rowid");if(P!=null)z=parseInt(P,10);else{const F=k.parentElement;z=Array.from(F.querySelectorAll(".vxe-body--row")).indexOf(k)}if(z<0)return null;let M=-1;const G=i.getAttribute("data-colid");if(G&&(M=L.getColumns().findIndex(I=>I.id===G)),M<0){const I=Array.from(k.querySelectorAll(".vxe-body--column")).indexOf(i),N=!!i.closest(".vxe-table--fixed-left-wrapper"),j=!!i.closest(".vxe-table--fixed-right-wrapper"),O=L.getColumns();if(N){const U=O.filter(A=>A.fixed==="left");I<U.length&&(M=O.indexOf(U[I]))}else if(j){const U=O.filter(A=>A.fixed==="right");I<U.length&&(M=O.indexOf(U[I]))}else{const U=l.searchForm.showCheckBox?1:0;M=O.filter(H=>H.fixed==="left").length+I-U}}return M<0?null:{rowIndex:z,colIndex:M,cell:i}},B=u=>{const i=R(u.target);if(!i){Ce();return}y.isSelecting=!0,y.startCell={rowIndex:i.rowIndex,colIndex:i.colIndex},y.endCell={...y.startCell},Fe(),De()},le=u=>{if(!y.isSelecting)return;const i=R(u.target);i&&(y.endCell={rowIndex:i.rowIndex,colIndex:i.colIndex},Fe(),De())},ge=()=>{y.isSelecting=!1},Ce=()=>{y.selectedCells=[],y.startCell=null,y.endCell=null;const u=C.value;if(!u)return;u.$el.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(k=>{k.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")})},Fe=()=>{if(!y.startCell||!y.endCell){y.selectedCells=[];return}const u=y.startCell.rowIndex,i=y.endCell.rowIndex,k=y.startCell.colIndex,L=y.endCell.colIndex,z=Math.min(u,i),P=Math.max(u,i),M=Math.min(k,L),G=Math.max(k,L);y.selectedCells=[];for(let F=z;F<=P;F++)for(let I=M;I<=G;I++)y.selectedCells.push({rowIndex:F,colIndex:I})},De=()=>{e.nextTick(()=>{const u=C.value;if(!u)return;const i=u.$el;if(i.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach(N=>{N.classList.remove("cell-selected","cell-border-top","cell-border-right","cell-border-bottom","cell-border-left")}),y.selectedCells.length===0)return;const k=u.getColumns(),L=y.selectedCells.map(N=>N.rowIndex),z=y.selectedCells.map(N=>N.colIndex),P=Math.min(...L),M=Math.max(...L),G=Math.min(...z),F=Math.max(...z),I=[i.querySelector(".vxe-table--body-wrapper tbody"),i.querySelector(".vxe-table--fixed-left-wrapper tbody"),i.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean);y.selectedCells.forEach(({rowIndex:N,colIndex:j})=>{const O=k[j];if(!O)return;const U=O.fixed==="left",A=O.fixed==="right";for(const H of I){const re=H.querySelectorAll(".vxe-body--row")[N];if(!re)continue;const Q=Array.from(re.querySelectorAll(".vxe-body--column"));let D=null;if(U&&H.closest(".vxe-table--fixed-left-wrapper")){const K=k.filter(Z=>Z.fixed==="left").indexOf(O);D=Q[K]}else if(A&&H.closest(".vxe-table--fixed-right-wrapper")){const K=k.filter(Z=>Z.fixed==="right").indexOf(O);D=Q[K]}else if(!U&&!A&&H.closest(".vxe-table--body-wrapper")){const X=l.searchForm.showCheckBox?1:0,K=k.filter(we=>we.fixed==="left").length,Z=j-K;D=Q[Z+X]}if(D&&!D.classList.contains("col--checkbox")&&!D.classList.contains("col--seq")){D.classList.add("cell-selected"),N===P&&D.classList.add("cell-border-top"),N===M&&D.classList.add("cell-border-bottom"),j===G&&D.classList.add("cell-border-left"),j===F&&D.classList.add("cell-border-right");break}}})})},Bt=async()=>{if(y.selectedCells.length===0)return;const u=C.value;if(!u)return;const i=u.$el,k=u.getColumns(),L=[...new Set(y.selectedCells.map(F=>F.rowIndex))].sort((F,I)=>F-I),z=[...new Set(y.selectedCells.map(F=>F.colIndex))].sort((F,I)=>F-I),P=[i.querySelector(".vxe-table--body-wrapper tbody"),i.querySelector(".vxe-table--fixed-left-wrapper tbody"),i.querySelector(".vxe-table--fixed-right-wrapper tbody")].filter(Boolean),M=[];L.forEach(F=>{const I=[];z.forEach(N=>{const j=k[N];if(!j){I.push("");return}const O=j.fixed==="left",U=j.fixed==="right";let A="";for(const H of P){const re=H.querySelectorAll(".vxe-body--row")[F];if(!re)continue;const Q=Array.from(re.querySelectorAll(".vxe-body--column"));let D=null;if(O&&H.closest(".vxe-table--fixed-left-wrapper")){const K=k.filter(Z=>Z.fixed==="left").indexOf(j);D=Q[K]}else if(U&&H.closest(".vxe-table--fixed-right-wrapper")){const K=k.filter(Z=>Z.fixed==="right").indexOf(j);D=Q[K]}else if(!O&&!U&&H.closest(".vxe-table--body-wrapper")){const X=l.searchForm.showCheckBox?1:0,K=k.filter(we=>we.fixed==="left").length,Z=N-K;D=Q[Z+X]}if(D&&!D.classList.contains("col--checkbox")&&!D.classList.contains("col--seq")){A=D.innerText||D.textContent||"",A=A.trim(),A=A.replace(/\n/g," ").replace(/\s+/g," ");break}}I.push(A)}),M.push(I.join(" "))});const G=M.join(`
2
+ `);try{await navigator.clipboard.writeText(G)}catch(F){console.error("复制失败:",F)}},ye=u=>{l.searchForm.enableCellCopy&&((u.ctrlKey||u.metaKey)&&u.key==="c"?y.selectedCells.length>0&&(u.preventDefault(),u.stopPropagation(),Bt()):u.key==="Escape"&&Ce())},Be=()=>{y.isSelecting=!1},Oe=u=>{const i=C.value;if(!i||!i.$el)return;i.$el.contains(u.target)||Ce()},be=e.computed(()=>{const{customConfig:u,columnConfig:i,...k}=l.tableConfig;return{headerAlign:"left",align:"center",customConfig:{...E,...u},columnConfig:{...x,...i},"virtual-x-config":{enabled:!1,scrollToLeftOnChange:!1},"virtual-y-config":{enabled:!0,gt:100},...k}}),Ot=u=>{b.pageNo=u,g()},zt=u=>{b.pageSize=u,b[c]=1,g()};function ze(){const u=C.value.getCheckboxRecords();l.searchForm.selections=u}const Me=u=>{const i=C.value;if(i){i.toggleCheckboxRow(u);const k=C.value.getCheckboxRecords();l.searchForm.selections=k}};return t({tableRef:C,getList:g,getPrm:V,clearSort:q,calculateTableHeight:S}),(u,i)=>{var F;const k=e.resolveComponent("el-button"),L=e.resolveComponent("el-checkbox"),z=e.resolveComponent("el-text"),P=e.resolveComponent("vxe-column"),M=e.resolveComponent("VxeTable"),G=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({box:o.searchForm.showShadow})},[o.searchForm.showSearch?(e.openBlock(),e.createBlock(Le,{key:0,form:o.searchForm,onReset:v,onConfirm:i[1]||(i[1]=I=>g()),onVisibleChange:e.unref(S)},{btn:e.withCtx(()=>[e.renderSlot(u.$slots,"search-bar-btn",{},void 0,!0),e.createVNode(k,{round:"",onClick:i[0]||(i[0]=I=>C.value.openCustom())},{default:e.withCtx(()=>[e.createVNode(he,{name:"Tools"})]),_:1})]),_:3},8,["form","onVisibleChange"])):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"table-header-left",{},void 0,!0),e.createElementVNode("div",{ref_key:"tableContentRef",ref:$},[e.createVNode(M,e.mergeProps({id:o.id,ref_key:"tableRef",ref:C,loading:o.loading||a.value,data:o.api?s.value:o.data,border:""},be.value,{height:m.value,onCheckboxChange:ze,onCheckboxAll:ze,onSortChange:(F=be.value["sort-config"])==null?void 0:F.sortChange}),{default:e.withCtx(()=>[o.searchForm.showCheckBox==null||o.searchForm.showCheckBox?(e.openBlock(),e.createBlock(P,{key:0,type:"checkbox",width:e.unref(r)=="zh_cn"?80:150,title:u.$t("xu-hao"),fixed:"left"},{checkbox:e.withCtx(({rowIndex:I,row:N,checked:j,disabled:O,indeterminate:U})=>[e.createElementVNode("div",yt,[j?(e.openBlock(),e.createBlock(L,{key:0,checked:!0,disabled:O,size:"default",onClick:e.withModifiers(A=>!O&&Me(N),["stop"])},null,8,["disabled","onClick"])):(e.openBlock(),e.createBlock(L,{key:1,disabled:O,checked:!1,size:"default",onClick:e.withModifiers(A=>!O&&Me(N),["stop"])},null,8,["disabled","onClick"])),e.createVNode(z,{type:"info",class:"mgl5"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(I+1),1)]),_:2},1024)])]),_:1},8,["width","title"])):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"default",{},void 0,!0)]),_:3},16,["id","loading","data","height","onSortChange"])],512),o.searchForm.showPage?(e.openBlock(),e.createBlock(G,{key:1,"current-page":b[e.unref(c)],"onUpdate:currentPage":i[2]||(i[2]=I=>b[e.unref(c)]=I),class:"myPagination mgt10",background:"",layout:"total, sizes, prev, pager, next",total:b.total,"page-size":b.pageSize,"page-sizes":[10,50,100,500],onCurrentChange:Ot,onSizeChange:zt},null,8,["current-page","total","page-size"])):e.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-8b6ee274"]]),wt={__name:"index",props:{sheetsConfig:{type:Object,required:!0},fileName:{type:String,required:!0}},setup(o){const t=o;function n(){Ie(t.fileName,t.sheetsConfig)}return(r,l)=>{const a=e.resolveComponent("el-link");return e.openBlock(),e.createBlock(a,e.mergeProps({type:"primary",underline:"never"},r.$attrs,{onClick:n}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.$t("xia-zai-dao-ru-mo-ban")),1)]),_:1},16)}}};function xt(o,t={}){const n=ce(),r={inForm:!0,required:!0,...t},l={phone:/^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/,password:/(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/,email:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/}[o],{inForm:a,value:s,required:f,msg:c=n("validate.invalidInput")}=r;return a?function(b,C,$){if(f){l.test(C)?$():$(new Error(c));return}C&&!l.test(C)?$(new Error(c)):$()}:l.test(s)}class kt{constructor(t={}){this.config={clientCode:t.clientCode||"one-portal",casServerUrl:`https://one-portal${t.isTest?"-test":""}.joy-group.com/api`,casPortalUrl:`https://one-portal${t.isTest?"-test":""}.joy-group.com`,serviceUrl:t.serviceUrl||window.location.origin+"/cas/callback",tokenKey:t.tokenKey||"one_portal_token",userKey:t.userKey||"one_portal_user",debug:t.debug||!1,autoLogin:t.autoLogin!==!1,loginCallback:t.loginCallback||null,logoutCallback:t.logoutCallback||null,errorCallback:t.errorCallback||null},this.token=null,this.user=null,this.init()}init(){this.log("OnePortal CAS SDK 初始化中..."),this.loadFromStorage();const n=new URLSearchParams(window.location.search).get("ticket");this.isLoggedIn()&&this.config.loginCallback?this.config.loginCallback(this.user,this.token):n?(this.log("检测到ST票据:",n),this.validateTicket(n)):this.config.autoLogin&&!this.isLoggedIn()&&(this.log("用户未登录,准备跳转到CAS登录页面"),this.login())}loadFromStorage(){try{this.token=localStorage.getItem(this.config.tokenKey);const t=localStorage.getItem(this.config.userKey);t&&(this.user=JSON.parse(t)),this.log("从本地存储加载数据:",{token:!!this.token,user:!!this.user})}catch(t){this.log("加载本地存储数据失败:",t)}}saveToStorage(){try{this.token&&localStorage.setItem(this.config.tokenKey,this.token),this.user&&localStorage.setItem(this.config.userKey,JSON.stringify(this.user)),this.log("数据已保存到本地存储")}catch(t){this.log("保存到本地存储失败:",t)}}clearStorage(){try{localStorage.removeItem(this.config.tokenKey),localStorage.removeItem(this.config.userKey),this.log("本地存储已清除")}catch(t){this.log("清除本地存储失败:",t)}}isLoggedIn(){return!!(this.token&&this.user)}getUser(){return this.user}getToken(){return this.token}login(){const t=`${this.config.casPortalUrl}?appCode=${this.config.clientCode}&redirectUrl=${encodeURIComponent(this.config.serviceUrl)}`;this.log("跳转到CAS登录页面:",t),window.location.href=t}async validateTicket(t){try{this.log("验证ST票据:",t);const n=await fetch(`${this.config.casServerUrl}/auth/validateST?ticket=${t}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);const r=await n.json();if(r.success&&r.data)return this.token=r.data.token,this.user=r.data.user,this.saveToStorage(),this.clearTicketFromUrl(),this.log("ST票据验证成功,用户登录成功:",this.user),this.config.loginCallback&&this.config.loginCallback(this.user,this.token),!0;throw new Error(r.message||"ST票据验证失败")}catch(n){return this.log("ST票据验证失败:",n),this.handleError(n),!1}}clearTicketFromUrl(){const t=new URL(window.location);t.searchParams.delete("ticket"),window.history.replaceState({},document.title,t.toString())}async logout(t=!0){try{if(this.log("用户登出"),this.token)try{await fetch(`${this.config.casServerUrl}/auth/logout`,{method:"POST",headers:{AppId:this.config.clientCode,Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"}})}catch(n){this.log("调用服务端登出接口失败:",n)}this.token=null,this.user=null,this.clearStorage(),this.config.logoutCallback&&this.config.logoutCallback(),t&&this.login()}catch(n){this.log("登出失败:",n),this.handleError(n)}}async request(t,n={}){const r={headers:{"Content-Type":"application/json",...n.headers},...n};r.headers.appId=this.config.clientCode,this.token&&(r.headers.Authorization=`Bearer ${this.token}`);try{const l=await fetch(t,r);return l.status===401?(this.log("Token已过期,需要重新登录"),this.logout(),null):l}catch(l){throw this.log("请求失败:",l),l}}async fetchUserInfo(){try{const t=await this.request(`${this.config.casServerUrl}/auth/user`);if(t&&t.ok){const n=await t.json();if(n.success&&n.data)return this.user=n.data,this.saveToStorage(),this.user}return null}catch(t){return this.log("获取用户信息失败:",t),null}}async refreshToken(){this.log("Token刷新功能暂未实现")}handleError(t){this.log("发生错误:",t),this.config.errorCallback&&this.config.errorCallback(t)}log(...t){this.config.debug&&console.log("[OnePortal CAS SDK]",...t)}checkLoginStatus(){return!this.isLoggedIn()&&this.config.autoLogin?(this.login(),!1):this.isLoggedIn()}setConfig(t,n){this.config[t]=n}getConfig(t){return this.config[t]}}function _t(o,t={}){const r=Object.assign({manual:!1,log:!1,params:null,format:null},t),{manual:l,log:a,params:s={},cb:f,format:c}=r,b=e.ref([]),C=e.ref(!1),$=_=>{const S=_||s;C.value=!0,o(S).then(w=>{const{code:d,data:m,msg:T}=w;if(f){const{records:p,rows:g}=m||{},v=p||g?p||g:m;b.value=pe(v,c),f(w)}if(m){if(m.records!=null||m.rows!=null){const{records:p,rows:g,total:v=0}=m||{};S&&S.total!=null&&(s.total=parseInt(v)),b.value=pe(p||g||[],c)}else b.value=pe(m,c);a&&console.log("useRequest-res",b.value)}}).catch(w=>{f&&(console.log("useRequestErr",w),f({code:500}))}).finally(()=>{C.value=!1})};return l||$(),[C,b,$]}function St(o){const t=e.ref(o),n=e.ref(""),r=e.ref("");return e.watch(t,l=>{const a=l||["",""];n.value=a[0],r.value=a[1]}),[t,n,r]}function $t(o){return Object.prototype.toString.call(o).slice(8,-1).toLowerCase()}function pe(o,t){if(!t)return o;if(o instanceof Array)return o.map(r=>{let l={};return t.forEach(a=>l[a]=r[a]),l});let n={};return t.forEach(r=>n[r]=o[r]),n}function Et(o,t=[]){const{locale:n}=J.useI18n(),r=e.ref(o());return e.watch([n,...t],()=>{r.value=o()},{immediate:!0}),r}function Tt(o,t="zh_cn",n="en_us"){if(!o)return"-";const r={en_us:n,zh_cn:t},a=ue().global.locale.value;return o[r[a]]||o[t]||"-"}function It(o,t){let n=W.mapState;return typeof o=="string"&&o.length>0&&(n=W.createNamespacedHelpers(o).mapState),Ve(t,n)}function vt(o,t){let n=W.mapGetters;return typeof o=="string"&&o.length>0&&(n=W.createNamespacedHelpers(o).mapGetters),Ve(t,n)}function Lt(o,t){let n=W.mapActions;return typeof o=="string"&&o.length>0&&(n=W.createNamespacedHelpers(o).mapActions),Vt(t,n)}function Ve(o,t){const n=W.useStore(),r=t(o),l={};return Object.keys(r).forEach(a=>{const s=r[a].bind({$store:n});l[a]=e.computed(s)}),l}function Vt(o,t){const n=W.useStore(),r=t(o),l={};return Object.keys(r).forEach(a=>{l[a]=r[a].bind({$store:n})}),l}const Ft={__name:"EnumRender",props:{renderOpts:{type:Object,default:()=>({enum:{}})},params:{type:Object}},setup(o){const t=o,n=t.params.row[t.params.column.field];return(r,l)=>{const a=e.resolveComponent("el-text");return o.renderOpts.text?(e.openBlock(),e.createBlock(a,{key:0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.renderOpts.enum.getName(e.unref(n))),1)]),_:1})):(e.openBlock(),e.createBlock(a,{key:1,type:o.renderOpts.enum.getTag(e.unref(n))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.renderOpts.enum.getName(e.unref(n))),1)]),_:1},8,["type"]))}}};function Dt(){ne.VxeUI.renderer.add("Enum",{renderTableDefault(o,t){return[null,void 0].includes(t.row[t.column.field])?"-":React.createElement(Ft,{renderOpts:o,params:t})}}),ne.VxeUI.renderer.add("InputNumber",{renderTableDefault(o,t){return React.createElement(Y.ElInputNumber,{"v-model":t.row[t.column.field],...o.props,"step-strictly":!0,"value-on-clear":0})}}),ne.VxeUI.renderer.add("TrueFalse",{renderTableDefault(o,t){const{locale:n}=J.useI18n();let r=n.value=="zh_cn";return React.createElement(Y.ElText,{type:t.row[t.column.field]?"success":"danger"},t.row[t.column.field]?r?"是":"YES":r?"否":"NO")}}),ne.VxeUI.renderer.add("I18n",{renderTableDefault(o,t){const{locale:n}=J.useI18n();let r=n.value=="zh_cn"?t.column.field:o.fieldEn;return t.row[r]||t.row[t.column.field]}}),ne.VxeUI.renderer.add("Link",{renderTableDefault(o,t){var f;let n=t.column.field;const r=Re.useRouter(),{multiple:l,to:a}=o;if(!l)return React.createElement(Y.ElLink,{underline:"never",type:"primary",onclick:()=>r.push({path:a,query:{[n]:t.row[n]}})},t.row[n]);const s=((f=t.row[n])==null?void 0:f.split(","))||[];return s.map((c,b)=>React.createElement("span",null,React.createElement(Y.ElLink,{underline:"never",type:"primary",onclick:()=>r.push({path:a,query:{[n]:c}})},c),b<s.length-1?",":""))}})}h.CmpDictionary=ve,h.CmpIcon=he,h.ConfrimButton=dt,h.DownExcelTemp=wt,h.ImportButton=ht,h.LayOutForm=Ae,h.ListPage=bt,h.OnePortalCasSDK=kt,h.SearchBar=Le,h.StatusMap=fe,h._toRaw=et,h._typeOf=$t,h.arrToStatusMap=nt,h.arrayToTree=tt,h.checkFileSize=rt,h.creatValidator=xt,h.createImportFields=st,h.createListPageId=at,h.en=ie,h.exportExcel=Ie,h.getI18n=ue,h.getI18nT=ce,h.getLocaleValue=Tt,h.getValueBykey=it,h.importExcel=Ye,h.messages=Ee,h.registerVxeRenderers=Dt,h.setupI18n=Te,h.sleep=Xe,h.stringToArray=de,h.stripHtmlTags=ot,h.unicode2Str=lt,h.useActions=Lt,h.useDatePicker=St,h.useGetters=vt,h.useI18nReState=Et,h.useRequest=_t,h.useState=It,h.zhCn=se,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .cmp-icon[data-v-34eb8641],.cmp-icon[data-v-733f9daa],.cmp-icon[data-v-5f1449ad]{padding:0!important}.searchBar-container .searchBar[data-v-32ac9990]{overflow:hidden;transition:all .3s}.searchBar-container .btns[data-v-32ac9990]{display:flex;justify-content:space-between;align-items:center}.searchBar-container .btns .left[data-v-32ac9990]{display:flex;align-items:center}.searchBar-container .btns .left[data-v-32ac9990] .el-tabs__header{margin:0}.searchBar-container .btns .right[data-v-32ac9990]{text-align:right}[data-v-1515c739] .vxe-table-custom-wrapper.placement--top-right.is--active{max-height:400px!important}[data-v-1515c739] .vxe-table.cell-copy-enabled .vxe-body--column{-webkit-user-select:none;user-select:none}[data-v-1515c739] .vxe-table.cell-copy-enabled .vxe-body--column.cell-selected{background-color:#409eff26!important;position:relative}[data-v-1515c739] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-top:before{content:"";position:absolute;top:0;left:0;right:0;height:1px;background-color:#409eff;pointer-events:none;z-index:10}[data-v-1515c739] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-bottom:after{content:"";position:absolute;bottom:0;left:0;right:0;height:1px;background-color:#409eff;pointer-events:none;z-index:10}[data-v-1515c739] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-left{border-left:1px solid #409eff!important}[data-v-1515c739] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-right{border-right:1px solid #409eff!important}
1
+ .cmp-icon[data-v-34eb8641],.cmp-icon[data-v-733f9daa],.cmp-icon[data-v-5f1449ad]{padding:0!important}.searchBar-container .searchBar[data-v-32ac9990]{overflow:hidden;transition:all .3s}.searchBar-container .btns[data-v-32ac9990]{display:flex;justify-content:space-between;align-items:center}.searchBar-container .btns .left[data-v-32ac9990]{display:flex;align-items:center}.searchBar-container .btns .left[data-v-32ac9990] .el-tabs__header{margin:0}.searchBar-container .btns .right[data-v-32ac9990]{text-align:right}[data-v-8b6ee274] .vxe-table-custom-wrapper.placement--top-right.is--active{max-height:400px!important}[data-v-8b6ee274] .vxe-table.cell-copy-enabled .vxe-body--column{-webkit-user-select:none;user-select:none}[data-v-8b6ee274] .vxe-table.cell-copy-enabled .vxe-body--column.cell-selected{background-color:#409eff26!important;position:relative}[data-v-8b6ee274] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-top:before{content:"";position:absolute;top:0;left:0;right:0;height:1px;background-color:#409eff;pointer-events:none;z-index:10}[data-v-8b6ee274] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-bottom:after{content:"";position:absolute;bottom:0;left:0;right:0;height:1px;background-color:#409eff;pointer-events:none;z-index:10}[data-v-8b6ee274] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-left{border-left:1px solid #409eff!important}[data-v-8b6ee274] .vxe-table.cell-copy-enabled .vxe-body--column.cell-border-right{border-right:1px solid #409eff!important}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "joy-admin-components",
3
- "version": "0.1.43",
3
+ "version": "0.1.44",
4
4
  "main": "./dist/joy-admin-components.umd.js",
5
5
  "module": "./dist/joy-admin-components.es.js",
6
6
  "types": "./src/index.d.ts",