joy-admin-components 0.2.36 → 0.2.38
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,7 +1,7 @@
|
|
|
1
1
|
import { ElForm as _t, ElRow as $t, ElCol as St, ElMessageBox as Et, ElInputNumber as It, ElText as Lt, ElLink as Je } from "element-plus";
|
|
2
|
-
import { defineComponent as ot, ref as U, onMounted as lt, h as
|
|
2
|
+
import { defineComponent as ot, ref as U, onMounted as lt, h as ze, mergeModels as Xe, useAttrs as Ft, useModel as Tt, computed as ce, watch as Re, resolveComponent as M, unref as K, openBlock as F, createBlock as H, mergeProps as ge, createSlots as at, withCtx as D, createElementVNode as re, toDisplayString as Q, renderSlot as ee, createVNode as O, createTextVNode as ne, createCommentVNode as de, createElementBlock as ie, Fragment as Me, renderList as st, withModifiers as Ve, nextTick as we, resolveDynamicComponent as rt, withKeys as Dt, normalizeStyle as zt, normalizeClass as qe, reactive as Ie, onUpdated as Ot, onUnmounted as Mt, withDirectives as Vt, isVNode as qt } from "vue";
|
|
3
3
|
import { saveAs as it } from "file-saver";
|
|
4
|
-
import
|
|
4
|
+
import Fe from "exceljs";
|
|
5
5
|
import $e from "dayjs";
|
|
6
6
|
import { createI18n as At, useI18n as pe } from "vue-i18n";
|
|
7
7
|
import { debounce as Be, cloneDeep as ct, isArray as Qe } from "lodash";
|
|
@@ -10,11 +10,11 @@ import { createNamespacedHelpers as Ye, useStore as ut, mapState as Pt, mapGette
|
|
|
10
10
|
import { VxeUI as ke } from "vxe-pc-ui";
|
|
11
11
|
const Vn = ot({
|
|
12
12
|
name: "LayOutForm",
|
|
13
|
-
setup(
|
|
14
|
-
const s = U(null), o = () =>
|
|
13
|
+
setup(e, { slots: t, attrs: n, emit: a }) {
|
|
14
|
+
const s = U(null), o = () => t.default ? t.default().filter((r) => r.type !== Symbol.for("v-cmt")).map((r) => r.type === Symbol.for("v-fgt") ? r.children : r).flat().map(
|
|
15
15
|
(r) => {
|
|
16
16
|
var i;
|
|
17
|
-
return
|
|
17
|
+
return ze(
|
|
18
18
|
St,
|
|
19
19
|
{ span: ((i = r.props) == null ? void 0 : i.span) || 24 },
|
|
20
20
|
{
|
|
@@ -27,23 +27,23 @@ const Vn = ot({
|
|
|
27
27
|
a("ref", s.value);
|
|
28
28
|
});
|
|
29
29
|
function l() {
|
|
30
|
-
return
|
|
30
|
+
return ze(
|
|
31
31
|
_t,
|
|
32
32
|
{ ...n, ref: s },
|
|
33
|
-
() =>
|
|
33
|
+
() => ze($t, { gutter: n.gutter ?? 20 }, { default: () => o() })
|
|
34
34
|
);
|
|
35
35
|
}
|
|
36
36
|
return l;
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
var dt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
40
|
-
function ft(
|
|
41
|
-
return
|
|
40
|
+
function ft(e) {
|
|
41
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
42
42
|
}
|
|
43
43
|
var ht = { exports: {} };
|
|
44
|
-
(function(
|
|
44
|
+
(function(e, t) {
|
|
45
45
|
(function(n, a) {
|
|
46
|
-
|
|
46
|
+
e.exports = a();
|
|
47
47
|
})(dt, function() {
|
|
48
48
|
var n = "minute", a = /[+-]\d\d(?::?\d\d)?/g, s = /([+-]|\d\d)/g;
|
|
49
49
|
return function(o, l, r) {
|
|
@@ -57,23 +57,23 @@ var ht = { exports: {} };
|
|
|
57
57
|
}, i.local = function() {
|
|
58
58
|
return r(this.toDate(), { locale: this.$L, utc: !1 });
|
|
59
59
|
};
|
|
60
|
-
var
|
|
60
|
+
var y = i.parse;
|
|
61
61
|
i.parse = function(c) {
|
|
62
|
-
c.utc && (this.$u = !0), this.$utils().u(c.$offset) || (this.$offset = c.$offset),
|
|
62
|
+
c.utc && (this.$u = !0), this.$utils().u(c.$offset) || (this.$offset = c.$offset), y.call(this, c);
|
|
63
63
|
};
|
|
64
|
-
var
|
|
64
|
+
var p = i.init;
|
|
65
65
|
i.init = function() {
|
|
66
66
|
if (this.$u) {
|
|
67
67
|
var c = this.$d;
|
|
68
68
|
this.$y = c.getUTCFullYear(), this.$M = c.getUTCMonth(), this.$D = c.getUTCDate(), this.$W = c.getUTCDay(), this.$H = c.getUTCHours(), this.$m = c.getUTCMinutes(), this.$s = c.getUTCSeconds(), this.$ms = c.getUTCMilliseconds();
|
|
69
69
|
} else
|
|
70
|
-
|
|
70
|
+
p.call(this);
|
|
71
71
|
};
|
|
72
|
-
var
|
|
72
|
+
var v = i.utcOffset;
|
|
73
73
|
i.utcOffset = function(c, h) {
|
|
74
74
|
var x = this.$utils().u;
|
|
75
75
|
if (x(c))
|
|
76
|
-
return this.$u ? 0 : x(this.$offset) ?
|
|
76
|
+
return this.$u ? 0 : x(this.$offset) ? v.call(this) : this.$offset;
|
|
77
77
|
if (typeof c == "string" && (c = function(V) {
|
|
78
78
|
V === void 0 && (V = "");
|
|
79
79
|
var B = V.match(a);
|
|
@@ -123,9 +123,9 @@ var ht = { exports: {} };
|
|
|
123
123
|
var Yt = ht.exports;
|
|
124
124
|
const Kt = /* @__PURE__ */ ft(Yt);
|
|
125
125
|
var mt = { exports: {} };
|
|
126
|
-
(function(
|
|
126
|
+
(function(e, t) {
|
|
127
127
|
(function(n, a) {
|
|
128
|
-
|
|
128
|
+
e.exports = a();
|
|
129
129
|
})(dt, function() {
|
|
130
130
|
var n = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, a = {};
|
|
131
131
|
return function(s, o, l) {
|
|
@@ -137,15 +137,15 @@ var mt = { exports: {} };
|
|
|
137
137
|
return V || (V = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: x, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: C }), a[E] = V), V;
|
|
138
138
|
}(m, f);
|
|
139
139
|
return h.formatToParts(c);
|
|
140
|
-
},
|
|
140
|
+
}, y = function(g, m) {
|
|
141
141
|
for (var f = i(g, m), c = [], h = 0; h < f.length; h += 1) {
|
|
142
142
|
var x = f[h], k = x.type, C = x.value, E = n[k];
|
|
143
143
|
E >= 0 && (c[E] = parseInt(C, 10));
|
|
144
144
|
}
|
|
145
145
|
var V = c[3], B = V === 24 ? 0 : V, I = c[0] + "-" + c[1] + "-" + c[2] + " " + B + ":" + c[4] + ":" + c[5] + ":000", $ = +g;
|
|
146
146
|
return (l.utc(I).valueOf() - ($ -= $ % 1e3)) / 6e4;
|
|
147
|
-
},
|
|
148
|
-
|
|
147
|
+
}, p = o.prototype;
|
|
148
|
+
p.tz = function(g, m) {
|
|
149
149
|
g === void 0 && (g = r);
|
|
150
150
|
var f, c = this.utcOffset(), h = this.toDate(), x = h.toLocaleString("en-US", { timeZone: g }), k = Math.round((h - new Date(x)) / 1e3 / 60), C = 15 * -Math.round(h.getTimezoneOffset() / 15) - k;
|
|
151
151
|
if (!Number(C))
|
|
@@ -155,28 +155,28 @@ var mt = { exports: {} };
|
|
|
155
155
|
f = f.add(c - E, "minute");
|
|
156
156
|
}
|
|
157
157
|
return f.$x.$timezone = g, f;
|
|
158
|
-
},
|
|
158
|
+
}, p.offsetName = function(g) {
|
|
159
159
|
var m = this.$x.$timezone || l.tz.guess(), f = i(this.valueOf(), m, { timeZoneName: g }).find(function(c) {
|
|
160
160
|
return c.type.toLowerCase() === "timezonename";
|
|
161
161
|
});
|
|
162
162
|
return f && f.value;
|
|
163
163
|
};
|
|
164
|
-
var
|
|
165
|
-
|
|
164
|
+
var v = p.startOf;
|
|
165
|
+
p.startOf = function(g, m) {
|
|
166
166
|
if (!this.$x || !this.$x.$timezone)
|
|
167
|
-
return
|
|
167
|
+
return v.call(this, g, m);
|
|
168
168
|
var f = l(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
|
|
169
|
-
return
|
|
169
|
+
return v.call(f, g, m).tz(this.$x.$timezone, !0);
|
|
170
170
|
}, l.tz = function(g, m, f) {
|
|
171
|
-
var c = f && m, h = f || m || r, x =
|
|
171
|
+
var c = f && m, h = f || m || r, x = y(+l(), h);
|
|
172
172
|
if (typeof g != "string")
|
|
173
173
|
return l(g).tz(h);
|
|
174
174
|
var k = function(B, I, $) {
|
|
175
|
-
var W = B - 60 * I * 1e3,
|
|
176
|
-
if (I ===
|
|
175
|
+
var W = B - 60 * I * 1e3, b = y(W, $);
|
|
176
|
+
if (I === b)
|
|
177
177
|
return [W, I];
|
|
178
|
-
var w =
|
|
179
|
-
return
|
|
178
|
+
var w = y(W -= 60 * (b - I) * 1e3, $);
|
|
179
|
+
return b === w ? [W, b] : [B - 60 * Math.min(b, w) * 1e3, Math.max(b, w)];
|
|
180
180
|
}(l.utc(g, c).valueOf(), x, h), C = k[0], E = k[1], V = l(C).utcOffset(E);
|
|
181
181
|
return V.$x.$timezone = h, V;
|
|
182
182
|
}, l.tz.guess = function() {
|
|
@@ -263,10 +263,10 @@ const Nt = /* @__PURE__ */ ft(Ht), Ae = {
|
|
|
263
263
|
en_us: je
|
|
264
264
|
};
|
|
265
265
|
let be = null;
|
|
266
|
-
function Zt(
|
|
267
|
-
if (
|
|
268
|
-
const { global:
|
|
269
|
-
return
|
|
266
|
+
function Zt(e = null) {
|
|
267
|
+
if (e) {
|
|
268
|
+
const { global: t } = e;
|
|
269
|
+
return t.messages.value.zh_cn ? t.mergeLocaleMessage("zh_cn", Ae) : t.setLocaleMessage("zh_cn", Ae), t.messages.value.en_us ? t.mergeLocaleMessage("en_us", je) : t.setLocaleMessage("en_us", je), be = e, e;
|
|
270
270
|
}
|
|
271
271
|
return be || (be = At({
|
|
272
272
|
legacy: !1,
|
|
@@ -283,24 +283,24 @@ function Ce() {
|
|
|
283
283
|
}
|
|
284
284
|
$e.extend(Kt);
|
|
285
285
|
$e.extend(Nt);
|
|
286
|
-
async function qn(
|
|
287
|
-
const { fields: n, range: a = 1 } =
|
|
286
|
+
async function qn(e, t) {
|
|
287
|
+
const { fields: n, range: a = 1 } = t;
|
|
288
288
|
if (!n) {
|
|
289
289
|
const l = Ce();
|
|
290
290
|
throw new Error(l("excel.fieldsMappingRequired"));
|
|
291
291
|
}
|
|
292
|
-
let s = new
|
|
293
|
-
await s.xlsx.load(
|
|
292
|
+
let s = new Fe.Workbook();
|
|
293
|
+
await s.xlsx.load(e);
|
|
294
294
|
const o = {};
|
|
295
295
|
return s.eachSheet(function(l, r) {
|
|
296
296
|
const i = [];
|
|
297
|
-
l.eachRow(function(
|
|
298
|
-
if (
|
|
299
|
-
let
|
|
297
|
+
l.eachRow(function(y, p) {
|
|
298
|
+
if (p > a) {
|
|
299
|
+
let v = {}, g = !0;
|
|
300
300
|
Object.keys(n).forEach((m) => {
|
|
301
|
-
const f =
|
|
302
|
-
|
|
303
|
-
}), g || i.push(
|
|
301
|
+
const f = y.getCell(n[m]).value;
|
|
302
|
+
v[m] = f, f && (g = !1);
|
|
303
|
+
}), g || i.push(v);
|
|
304
304
|
}
|
|
305
305
|
}), o[l._name] = i;
|
|
306
306
|
}), s = null, o;
|
|
@@ -308,51 +308,51 @@ async function qn(t, e) {
|
|
|
308
308
|
const gt = {
|
|
309
309
|
columnWidth: 30
|
|
310
310
|
};
|
|
311
|
-
async function An(
|
|
312
|
-
if (!
|
|
311
|
+
async function An(e, t, n = [], a = {}) {
|
|
312
|
+
if (!e || !t)
|
|
313
313
|
return;
|
|
314
314
|
const { columnStyle: s } = a, { columnWidth: o } = gt;
|
|
315
|
-
|
|
315
|
+
t.forEach((i) => {
|
|
316
316
|
i.width = i.width ? i.width : o;
|
|
317
317
|
});
|
|
318
318
|
const { workbook: l, worksheet: r } = Gt();
|
|
319
|
-
r.columns =
|
|
319
|
+
r.columns = t, r.addRows(n), s && await Jt(l, r, s);
|
|
320
320
|
try {
|
|
321
|
-
const i = await l.xlsx.writeBuffer(),
|
|
321
|
+
const i = await l.xlsx.writeBuffer(), y = new File([i], e, {
|
|
322
322
|
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
323
323
|
});
|
|
324
|
-
it(
|
|
324
|
+
it(y);
|
|
325
325
|
} catch (i) {
|
|
326
326
|
console.log(i);
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
function Gt() {
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
const
|
|
333
|
-
return { workbook:
|
|
330
|
+
const e = new Fe.Workbook();
|
|
331
|
+
e.creator = "distributor System", e.lastModifiedBy = "distributor System", e.created = /* @__PURE__ */ new Date(), e.modified = /* @__PURE__ */ new Date(), e.lastPrinted = /* @__PURE__ */ new Date();
|
|
332
|
+
const t = e.addWorksheet("Sheet1");
|
|
333
|
+
return { workbook: e, worksheet: t };
|
|
334
334
|
}
|
|
335
|
-
async function Jt(
|
|
335
|
+
async function Jt(e, t, n) {
|
|
336
336
|
const a = Object.keys(n);
|
|
337
337
|
for (const s of a) {
|
|
338
338
|
const o = n[s], { type: l } = o;
|
|
339
339
|
switch (l) {
|
|
340
340
|
case "IMG":
|
|
341
|
-
await Xt(
|
|
341
|
+
await Xt(e, t, s);
|
|
342
342
|
break;
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
-
async function Xt(
|
|
347
|
-
const s =
|
|
348
|
-
|
|
346
|
+
async function Xt(e, t, n, a) {
|
|
347
|
+
const s = t.getColumn(n), o = s.values;
|
|
348
|
+
t.getColumn(n).width = 20, t.eachRow((l, r) => {
|
|
349
349
|
r > 1 && (l.height = 40);
|
|
350
350
|
});
|
|
351
351
|
for (let l = 0, r = o.length; l < r; l++) {
|
|
352
352
|
if (l < 2)
|
|
353
353
|
continue;
|
|
354
354
|
let i = o[l];
|
|
355
|
-
i && (
|
|
355
|
+
i && (t.getCell(s.letter + l).value = "", await Qt(e, t, i, {
|
|
356
356
|
width: 100,
|
|
357
357
|
height: 50,
|
|
358
358
|
col: s._number - 1,
|
|
@@ -360,28 +360,28 @@ async function Xt(t, e, n, a) {
|
|
|
360
360
|
}));
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
-
async function Qt(
|
|
364
|
-
const { col: s, row: o, width: l, height: r } = a, { success: i, base64:
|
|
363
|
+
async function Qt(e, t, n, a) {
|
|
364
|
+
const { col: s, row: o, width: l, height: r } = a, { success: i, base64: y } = await en(n, 0.3);
|
|
365
365
|
if (i) {
|
|
366
|
-
const
|
|
367
|
-
base64:
|
|
366
|
+
const p = e.addImage({
|
|
367
|
+
base64: y,
|
|
368
368
|
extension: "jpeg"
|
|
369
369
|
});
|
|
370
|
-
|
|
370
|
+
t.addImage(p, {
|
|
371
371
|
tl: { col: s, row: o },
|
|
372
372
|
ext: { width: l, height: r }
|
|
373
373
|
});
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
|
-
function en(
|
|
376
|
+
function en(e, t = 1) {
|
|
377
377
|
const n = new Image();
|
|
378
|
-
return n.setAttribute("crossOrigin", "anonymous"), n.crossOrigin = "anonymous", n.src =
|
|
378
|
+
return n.setAttribute("crossOrigin", "anonymous"), n.crossOrigin = "anonymous", n.src = e, new Promise((a, s) => {
|
|
379
379
|
n.onload = () => {
|
|
380
380
|
const o = document.createElement("canvas");
|
|
381
381
|
o.width = n.width, o.height = n.height, o.getContext("2d").drawImage(n, 0, 0, o.width, o.height), a({
|
|
382
382
|
success: !0,
|
|
383
383
|
//canvas.toDataURL的方法将图片的绝对路径转换为base64编码
|
|
384
|
-
base64: o.toDataURL("image/jpeg",
|
|
384
|
+
base64: o.toDataURL("image/jpeg", t)
|
|
385
385
|
});
|
|
386
386
|
}, n.onerror = () => {
|
|
387
387
|
a({ success: !1 });
|
|
@@ -389,37 +389,37 @@ function en(t, e = 1) {
|
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
391
|
const Ue = "---";
|
|
392
|
-
async function tn(
|
|
393
|
-
const { fields: n, range: a = 1 } =
|
|
392
|
+
async function tn(e, t) {
|
|
393
|
+
const { fields: n, range: a = 1 } = t;
|
|
394
394
|
if (!n) {
|
|
395
395
|
const l = Ce();
|
|
396
396
|
throw new Error(l("excel.fieldsMappingRequired"));
|
|
397
397
|
}
|
|
398
|
-
let s = new
|
|
399
|
-
await s.xlsx.load(
|
|
398
|
+
let s = new Fe.Workbook();
|
|
399
|
+
await s.xlsx.load(e);
|
|
400
400
|
const o = {};
|
|
401
401
|
return s.eachSheet(function(l, r) {
|
|
402
402
|
if (l.state == "visible") {
|
|
403
|
-
const i = [],
|
|
404
|
-
if (
|
|
405
|
-
let
|
|
406
|
-
|
|
403
|
+
const i = [], y = n[l._name];
|
|
404
|
+
if (y) {
|
|
405
|
+
let p = Object.values(y).some((g) => g.includes("image")), v = {};
|
|
406
|
+
p && (l.getImages().forEach((m) => {
|
|
407
407
|
const { tl: f } = m.range, c = s.model.media.find((h) => h.index === m.imageId);
|
|
408
408
|
if (c) {
|
|
409
409
|
const h = c.buffer.toString("base64"), x = `data:image/${c.extension};base64,${h}`, k = `${Math.ceil(f.row)}_${Math.ceil(f.col)}`;
|
|
410
|
-
|
|
410
|
+
v[k] ? v[k].push(x) : v[k] = [x];
|
|
411
411
|
}
|
|
412
|
-
}), console.log("withImages-imageMap",
|
|
412
|
+
}), console.log("withImages-imageMap", v)), l.eachRow(function(g, m) {
|
|
413
413
|
if (m > a) {
|
|
414
414
|
let f = {}, c = !0;
|
|
415
|
-
Object.keys(
|
|
415
|
+
Object.keys(y).forEach((h) => {
|
|
416
416
|
var V;
|
|
417
|
-
let [x, k] =
|
|
417
|
+
let [x, k] = y[h].split(Ue);
|
|
418
418
|
const C = g.getCell(x);
|
|
419
419
|
let E;
|
|
420
|
-
if (k == "image" &&
|
|
420
|
+
if (k == "image" && p) {
|
|
421
421
|
const B = C._column._number, I = `${m}_${B}`;
|
|
422
|
-
E =
|
|
422
|
+
E = v[I] || "";
|
|
423
423
|
} else
|
|
424
424
|
C.result != null ? E = C.result : (V = C.value) != null && V.richText ? E = C.value.richText.reduce((B, I) => B + I.text, "") : C.type == 4 && C.value ? E = $e(C.value).utc().format("YYYY-MM-DD HH:mm:ss") : E = C.value;
|
|
425
425
|
E && k == "option" && (E = E.split(Ue)[1]), f[h] = E, E && (c = !1);
|
|
@@ -430,19 +430,19 @@ async function tn(t, e) {
|
|
|
430
430
|
}
|
|
431
431
|
}), s = null, o;
|
|
432
432
|
}
|
|
433
|
-
async function nn(
|
|
434
|
-
if (!
|
|
433
|
+
async function nn(e, t) {
|
|
434
|
+
if (!e || t.length == 0)
|
|
435
435
|
return;
|
|
436
|
-
const n = on(
|
|
436
|
+
const n = on(t);
|
|
437
437
|
n.eachSheet(function(a, s) {
|
|
438
|
-
const { columnWidth: o } = gt, { tableHeader: l, tableData: r } =
|
|
438
|
+
const { columnWidth: o } = gt, { tableHeader: l, tableData: r } = t[a._name];
|
|
439
439
|
l.forEach((i) => {
|
|
440
440
|
if (i.required) {
|
|
441
|
-
const
|
|
441
|
+
const y = i.style || {}, { font: p = {} } = y;
|
|
442
442
|
i.style = {
|
|
443
|
-
...
|
|
443
|
+
...y,
|
|
444
444
|
font: {
|
|
445
|
-
...
|
|
445
|
+
...p,
|
|
446
446
|
color: {
|
|
447
447
|
argb: "FFFF0000"
|
|
448
448
|
}
|
|
@@ -450,15 +450,15 @@ async function nn(t, e) {
|
|
|
450
450
|
};
|
|
451
451
|
}
|
|
452
452
|
}), a.columns = l, a.addRows(r), l.forEach((i) => {
|
|
453
|
-
const { header:
|
|
454
|
-
if (m.width =
|
|
455
|
-
const f = n.addWorksheet(
|
|
453
|
+
const { header: y, key: p, width: v, option: g } = i, m = a.getColumn(p);
|
|
454
|
+
if (m.width = v || o, g) {
|
|
455
|
+
const f = n.addWorksheet(p);
|
|
456
456
|
f.state = "hidden", f.getColumn(1).values = g.map((c) => `${c.label}${Ue}${c.value}`), Array(100).fill("").forEach((c, h) => {
|
|
457
457
|
if (h > 0) {
|
|
458
458
|
const x = Ce();
|
|
459
459
|
a.getCell(`${m.letter}${h}`).dataValidation = {
|
|
460
460
|
type: "list",
|
|
461
|
-
formulae: [`${
|
|
461
|
+
formulae: [`${p}!$A$1:$A$${g.length}`],
|
|
462
462
|
showErrorMessage: !0,
|
|
463
463
|
error: x("excel.invalidInput"),
|
|
464
464
|
errorStyle: "stop",
|
|
@@ -470,7 +470,7 @@ async function nn(t, e) {
|
|
|
470
470
|
});
|
|
471
471
|
});
|
|
472
472
|
try {
|
|
473
|
-
const a = await n.xlsx.writeBuffer(), s = new File([a],
|
|
473
|
+
const a = await n.xlsx.writeBuffer(), s = new File([a], e, {
|
|
474
474
|
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
475
475
|
});
|
|
476
476
|
it(s);
|
|
@@ -478,127 +478,127 @@ async function nn(t, e) {
|
|
|
478
478
|
console.log(a);
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
|
-
function on(
|
|
482
|
-
const
|
|
483
|
-
return n.creator = "distributor System", n.lastModifiedBy = "distributor System", n.created = /* @__PURE__ */ new Date(), n.modified = /* @__PURE__ */ new Date(), n.lastPrinted = /* @__PURE__ */ new Date(), Object.keys(
|
|
484
|
-
const l =
|
|
481
|
+
function on(e) {
|
|
482
|
+
const t = Ce(), n = new Fe.Workbook();
|
|
483
|
+
return n.creator = "distributor System", n.lastModifiedBy = "distributor System", n.created = /* @__PURE__ */ new Date(), n.modified = /* @__PURE__ */ new Date(), n.lastPrinted = /* @__PURE__ */ new Date(), Object.keys(e).sort((s, o) => {
|
|
484
|
+
const l = e[s].sort ?? 0, r = e[o].sort ?? 0;
|
|
485
485
|
return l - r;
|
|
486
486
|
}).forEach((s) => {
|
|
487
487
|
let o = s, l = !1;
|
|
488
|
-
/[\\/:*?\[\]]/g.test(s) && (s = s.replace(/[\\/:*?\[\]]/g, ""), l = !0), s.length > 31 && (s = s.substring(0, 31).trim(), l = !0, console.warn(
|
|
488
|
+
/[\\/:*?\[\]]/g.test(s) && (s = s.replace(/[\\/:*?\[\]]/g, ""), l = !0), s.length > 31 && (s = s.substring(0, 31).trim(), l = !0, console.warn(t("excel.sheetNameTooLong", [o, s]))), l && (e[s] = e[o], delete e[o]), n.addWorksheet(s);
|
|
489
489
|
}), n;
|
|
490
490
|
}
|
|
491
|
-
function ln(
|
|
492
|
-
if (
|
|
493
|
-
return String.fromCharCode(65 +
|
|
491
|
+
function ln(e) {
|
|
492
|
+
if (e < 26)
|
|
493
|
+
return String.fromCharCode(65 + e);
|
|
494
494
|
{
|
|
495
|
-
const
|
|
496
|
-
return
|
|
495
|
+
const t = String.fromCharCode(65 + Math.floor((e - 26) / 26)), n = String.fromCharCode(65 + (e - 26) % 26);
|
|
496
|
+
return t + n;
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
|
-
function jn(
|
|
500
|
-
return new Promise((
|
|
499
|
+
function jn(e) {
|
|
500
|
+
return new Promise((t) => {
|
|
501
501
|
setTimeout(() => {
|
|
502
|
-
|
|
503
|
-
},
|
|
502
|
+
t();
|
|
503
|
+
}, e);
|
|
504
504
|
});
|
|
505
505
|
}
|
|
506
|
-
function Un(
|
|
507
|
-
return JSON.parse(JSON.stringify(
|
|
506
|
+
function Un(e) {
|
|
507
|
+
return JSON.parse(JSON.stringify(e));
|
|
508
508
|
}
|
|
509
|
-
function Pn(
|
|
510
|
-
let
|
|
511
|
-
for (const s of
|
|
509
|
+
function Pn(e) {
|
|
510
|
+
let t = [], n = {}, a = (s, o) => Object.prototype.hasOwnProperty.call(s, o);
|
|
511
|
+
for (const s of e) {
|
|
512
512
|
n[s.id] = {
|
|
513
513
|
...s,
|
|
514
514
|
// 判断当前项的子项 如果map有存储就用存储的子项 否则初始化
|
|
515
515
|
children: a(n, s.id) ? n[s.id].children : []
|
|
516
516
|
};
|
|
517
517
|
const o = n[s.id];
|
|
518
|
-
s.pid == -1 ?
|
|
518
|
+
s.pid == -1 ? t.push(o) : (a(n, s.pid) || (n[s.pid] = {
|
|
519
519
|
children: []
|
|
520
520
|
}), n[s.pid].children.push(o));
|
|
521
521
|
}
|
|
522
|
-
return
|
|
522
|
+
return t;
|
|
523
523
|
}
|
|
524
|
-
function pt(
|
|
525
|
-
return
|
|
524
|
+
function pt(e, t = " ") {
|
|
525
|
+
return e ? e.split(t).filter((n) => n.trim()) : [];
|
|
526
526
|
}
|
|
527
527
|
class et {
|
|
528
|
-
constructor(
|
|
529
|
-
this.list =
|
|
528
|
+
constructor(t, n = ["label", "value", "labelEn"]) {
|
|
529
|
+
this.list = t.map((a) => ({
|
|
530
530
|
...a,
|
|
531
531
|
label: a[n[0]],
|
|
532
532
|
labelEn: a[n[2]] ?? a[n[0]] ?? "",
|
|
533
533
|
value: a[n[1]]
|
|
534
534
|
})), this.map = new Map(this.list.map((a) => [a[n[1]], a]));
|
|
535
535
|
}
|
|
536
|
-
getName(
|
|
537
|
-
if (!this.has(
|
|
536
|
+
getName(t) {
|
|
537
|
+
if (!this.has(t))
|
|
538
538
|
return "-";
|
|
539
|
-
const n = Ke().global.locale, { label: a, labelEn: s } = this.map.get(
|
|
539
|
+
const n = Ke().global.locale, { label: a, labelEn: s } = this.map.get(t);
|
|
540
540
|
return (n.value == "zh_cn" ? a : s) ?? a ?? "-";
|
|
541
541
|
}
|
|
542
|
-
getTag(
|
|
543
|
-
if (!this.has(
|
|
542
|
+
getTag(t) {
|
|
543
|
+
if (!this.has(t))
|
|
544
544
|
return "info";
|
|
545
|
-
const { tag: n = "info" } = this.map.get(
|
|
545
|
+
const { tag: n = "info" } = this.map.get(t);
|
|
546
546
|
return n;
|
|
547
547
|
}
|
|
548
|
-
getItem(
|
|
549
|
-
return this.has(
|
|
548
|
+
getItem(t) {
|
|
549
|
+
return this.has(t) ? this.map.get(t) : null;
|
|
550
550
|
}
|
|
551
|
-
getColor(
|
|
552
|
-
if (!this.has(
|
|
551
|
+
getColor(t) {
|
|
552
|
+
if (!this.has(t))
|
|
553
553
|
return null;
|
|
554
|
-
const { color: n } = this.map.get(
|
|
554
|
+
const { color: n } = this.map.get(t);
|
|
555
555
|
return n;
|
|
556
556
|
}
|
|
557
|
-
has(
|
|
558
|
-
return this.map.has(
|
|
557
|
+
has(t) {
|
|
558
|
+
return this.map.has(t);
|
|
559
559
|
}
|
|
560
560
|
}
|
|
561
|
-
function Rn(
|
|
562
|
-
if (
|
|
561
|
+
function Rn(e, t = [], n = "i18nName") {
|
|
562
|
+
if (e.length == 0)
|
|
563
563
|
return new et([]);
|
|
564
|
-
if (
|
|
564
|
+
if (t.length < 2) {
|
|
565
565
|
const s = Ce();
|
|
566
566
|
throw new Error(s("tools.keysLengthError"));
|
|
567
567
|
}
|
|
568
|
-
let a =
|
|
568
|
+
let a = e.map((s) => {
|
|
569
569
|
let o = {};
|
|
570
|
-
return n && (o.labelEn = s[n]),
|
|
570
|
+
return n && (o.labelEn = s[n]), t.forEach((l, r) => {
|
|
571
571
|
r === 0 ? o.label = s[l] : r === 1 ? o.value = s[l] : o[l] = s[l];
|
|
572
572
|
}), o;
|
|
573
573
|
});
|
|
574
574
|
return new et(a);
|
|
575
575
|
}
|
|
576
|
-
function Bn(
|
|
577
|
-
return
|
|
576
|
+
function Bn(e) {
|
|
577
|
+
return e ? e.replace(/<[^>]+>/g, "") : "";
|
|
578
578
|
}
|
|
579
|
-
function Yn(
|
|
580
|
-
return
|
|
579
|
+
function Yn(e) {
|
|
580
|
+
return e ? (e.includes("\\\\u") && (e = e.replace(/\\/g, "")), e.replace(/\\u[\dA-F]{4}/gi, (t) => String.fromCharCode(parseInt(t.replace(/\\u/g, ""), 16)))) : "";
|
|
581
581
|
}
|
|
582
|
-
function Kn(
|
|
583
|
-
let n = 1048576 *
|
|
584
|
-
return !(
|
|
582
|
+
function Kn(e, t = 10) {
|
|
583
|
+
let n = 1048576 * t;
|
|
584
|
+
return !(e.size > n);
|
|
585
585
|
}
|
|
586
|
-
function Hn(
|
|
587
|
-
return Array.from(10).fill(0).map((n, a) =>
|
|
586
|
+
function Hn(e) {
|
|
587
|
+
return Array.from(10).fill(0).map((n, a) => e + "_" + a);
|
|
588
588
|
}
|
|
589
|
-
function Nn(
|
|
590
|
-
let
|
|
591
|
-
return
|
|
589
|
+
function Nn(e) {
|
|
590
|
+
let t = {};
|
|
591
|
+
return e.map((n, a) => {
|
|
592
592
|
let { key: s, option: o, type: l } = n, r = ln(a);
|
|
593
|
-
o ?
|
|
594
|
-
}),
|
|
593
|
+
o ? t[s] = `${r}---option` : l === "image" ? t[s] = `${r}---image` : t[s] = r;
|
|
594
|
+
}), t;
|
|
595
595
|
}
|
|
596
|
-
function Wn(
|
|
597
|
-
return
|
|
596
|
+
function Wn(e, t) {
|
|
597
|
+
return t.split(".").reduce((n, a) => n && n[a], e);
|
|
598
598
|
}
|
|
599
|
-
const Se = (
|
|
600
|
-
const n =
|
|
601
|
-
for (const [a, s] of
|
|
599
|
+
const Se = (e, t) => {
|
|
600
|
+
const n = e.__vccOpts || e;
|
|
601
|
+
for (const [a, s] of t)
|
|
602
602
|
n[a] = s;
|
|
603
603
|
return n;
|
|
604
604
|
}, an = ["onClick"], sn = {
|
|
@@ -640,71 +640,71 @@ const Se = (t, e) => {
|
|
|
640
640
|
modelModifiers: {}
|
|
641
641
|
}),
|
|
642
642
|
emits: /* @__PURE__ */ Xe(["success", "change", "changeAll"], ["update:modelValue"]),
|
|
643
|
-
setup(
|
|
644
|
-
const n =
|
|
643
|
+
setup(e, { emit: t }) {
|
|
644
|
+
const n = e, a = Ft(), { t: s, locale: o } = pe(), l = Tt(e, "modelValue"), r = ce(() => a["value-key"] != null), i = U(""), y = ce(() => {
|
|
645
645
|
if (a.remote !== void 0)
|
|
646
646
|
return n.data;
|
|
647
|
-
const
|
|
648
|
-
if (
|
|
649
|
-
return
|
|
647
|
+
const b = pt(i.value), { data: w, labelValue: G } = n, te = w || g.value;
|
|
648
|
+
if (b.length == 0)
|
|
649
|
+
return te;
|
|
650
650
|
const { label: _, labelEn: ye } = G;
|
|
651
651
|
let z = o.value == "en_us" ? ye || "i18nName" : _;
|
|
652
|
-
return
|
|
653
|
-
(ue) => ue[z].toLowerCase().includes(
|
|
654
|
-
) :
|
|
652
|
+
return b.length == 1 ? te.filter(
|
|
653
|
+
(ue) => ue[z].toLowerCase().includes(b[0].toLowerCase())
|
|
654
|
+
) : te.filter((ue) => {
|
|
655
655
|
let ve = !1;
|
|
656
|
-
return ve =
|
|
656
|
+
return ve = b.some((Ee) => ue[z].toLowerCase() == Ee.toLowerCase()), ve;
|
|
657
657
|
});
|
|
658
|
-
}),
|
|
658
|
+
}), p = ce({
|
|
659
659
|
get() {
|
|
660
|
-
return a.multiple == null || l.value == null ? !1 : l.value.length ==
|
|
660
|
+
return a.multiple == null || l.value == null ? !1 : l.value.length == y.value.length;
|
|
661
661
|
},
|
|
662
|
-
set(
|
|
663
|
-
return
|
|
662
|
+
set(b) {
|
|
663
|
+
return b;
|
|
664
664
|
}
|
|
665
|
-
}),
|
|
666
|
-
const { data:
|
|
667
|
-
g.value = [...
|
|
665
|
+
}), v = t, g = U([]), m = async () => {
|
|
666
|
+
const { data: b } = await n.api();
|
|
667
|
+
g.value = [...b], v("success", g);
|
|
668
668
|
};
|
|
669
669
|
n.api && m();
|
|
670
|
-
function f(
|
|
671
|
-
|
|
670
|
+
function f(b) {
|
|
671
|
+
v("change", b), c.value && we(() => {
|
|
672
672
|
n.optionClick && n.optionClick(c.value), c.value = null;
|
|
673
673
|
});
|
|
674
674
|
}
|
|
675
675
|
const c = U(null);
|
|
676
|
-
function h(
|
|
677
|
-
c.value =
|
|
676
|
+
function h(b) {
|
|
677
|
+
c.value = b;
|
|
678
678
|
}
|
|
679
|
-
const x = n.labelValue.label.split("-"), k = (
|
|
679
|
+
const x = n.labelValue.label.split("-"), k = (b) => {
|
|
680
680
|
if (x.length == 1) {
|
|
681
681
|
if (n.changeLocal)
|
|
682
|
-
return s(
|
|
683
|
-
let w = o.value == "en_us" ?
|
|
684
|
-
return w = w ||
|
|
682
|
+
return s(b[n.labelValue.label]);
|
|
683
|
+
let w = o.value == "en_us" ? b[n.labelValue.labelEn || "i18nName"] : b[n.labelValue.label];
|
|
684
|
+
return w = w || b[n.labelValue.label], w + "";
|
|
685
685
|
} else {
|
|
686
686
|
let w = [];
|
|
687
687
|
return x.forEach((G) => {
|
|
688
|
-
w.push(
|
|
688
|
+
w.push(b[G]);
|
|
689
689
|
}), w.join("-");
|
|
690
690
|
}
|
|
691
691
|
};
|
|
692
|
-
function C(
|
|
692
|
+
function C(b) {
|
|
693
693
|
let w = n.data ? n.data : g.value;
|
|
694
|
-
l.value =
|
|
695
|
-
|
|
694
|
+
l.value = b ? w.map((G) => r.value ? G : G[n.labelValue.value]) : [], we(() => {
|
|
695
|
+
v("change", l.value), v("changeAll", l.value, w);
|
|
696
696
|
});
|
|
697
697
|
}
|
|
698
|
-
function E(
|
|
699
|
-
|
|
700
|
-
n.optionClick && n.optionClick(
|
|
698
|
+
function E(b) {
|
|
699
|
+
v("change", r.value ? b : b[n.labelValue.value]), we(() => {
|
|
700
|
+
n.optionClick && n.optionClick(b);
|
|
701
701
|
});
|
|
702
702
|
}
|
|
703
|
-
function V(
|
|
704
|
-
return l.value.length >= n.maxLimit && !l.value.includes(
|
|
703
|
+
function V(b) {
|
|
704
|
+
return l.value.length >= n.maxLimit && !l.value.includes(b[n.labelValue.value]);
|
|
705
705
|
}
|
|
706
|
-
function B(
|
|
707
|
-
return
|
|
706
|
+
function B(b) {
|
|
707
|
+
return b.map((w) => ({
|
|
708
708
|
...w,
|
|
709
709
|
label: k(w),
|
|
710
710
|
value: r.value ? w : w[n.labelValue.value]
|
|
@@ -713,27 +713,27 @@ const Se = (t, e) => {
|
|
|
713
713
|
const I = U([]), $ = n.data ? n.data : g.value;
|
|
714
714
|
I.value = B($), Re(
|
|
715
715
|
() => n.data ? n.data : g.value,
|
|
716
|
-
(
|
|
716
|
+
(b) => {
|
|
717
717
|
var G;
|
|
718
|
-
const w = B(
|
|
718
|
+
const w = B(b);
|
|
719
719
|
if (w.length !== I.value.length)
|
|
720
720
|
I.value = w;
|
|
721
721
|
else {
|
|
722
|
-
let
|
|
722
|
+
let te = !1;
|
|
723
723
|
for (let _ = 0; _ < w.length; _++)
|
|
724
724
|
if (w[_].value !== ((G = I.value[_]) == null ? void 0 : G.value)) {
|
|
725
|
-
|
|
725
|
+
te = !0;
|
|
726
726
|
break;
|
|
727
727
|
}
|
|
728
|
-
|
|
728
|
+
te && (I.value = w);
|
|
729
729
|
}
|
|
730
730
|
},
|
|
731
731
|
{ deep: !0 }
|
|
732
732
|
);
|
|
733
733
|
const W = ce(() => I.value);
|
|
734
|
-
return (
|
|
735
|
-
const G = M("el-checkbox"),
|
|
736
|
-
return K(a).v2 != null ? (F(), H(
|
|
734
|
+
return (b, w) => {
|
|
735
|
+
const G = M("el-checkbox"), te = M("el-select-v2"), _ = M("el-option"), ye = M("el-select");
|
|
736
|
+
return K(a).v2 != null ? (F(), H(te, ge({
|
|
737
737
|
key: 0,
|
|
738
738
|
options: W.value,
|
|
739
739
|
modelValue: l.value,
|
|
@@ -756,15 +756,15 @@ const Se = (t, e) => {
|
|
|
756
756
|
K(a).multiple != null ? {
|
|
757
757
|
name: "header",
|
|
758
758
|
fn: D(() => [
|
|
759
|
-
|
|
759
|
+
ee(b.$slots, "header", {}, () => [
|
|
760
760
|
O(G, {
|
|
761
761
|
class: "mgl20",
|
|
762
|
-
modelValue:
|
|
763
|
-
"onUpdate:modelValue": w[0] || (w[0] = (z) =>
|
|
762
|
+
modelValue: p.value,
|
|
763
|
+
"onUpdate:modelValue": w[0] || (w[0] = (z) => p.value = z),
|
|
764
764
|
onChange: C
|
|
765
765
|
}, {
|
|
766
766
|
default: D(() => [
|
|
767
|
-
ne(Q(
|
|
767
|
+
ne(Q(b.$t("quan-xuan")), 1)
|
|
768
768
|
]),
|
|
769
769
|
_: 1
|
|
770
770
|
}, 8, ["modelValue"])
|
|
@@ -781,27 +781,27 @@ const Se = (t, e) => {
|
|
|
781
781
|
"collapse-tags-tooltip": "",
|
|
782
782
|
"filter-method": K(a).remote != null ? void 0 : (z) => i.value = z,
|
|
783
783
|
clearable: ""
|
|
784
|
-
}, K(a), { onClear:
|
|
784
|
+
}, K(a), { onClear: e.optionClick }), {
|
|
785
785
|
default: D(() => [
|
|
786
|
-
K(a).multiple != null &&
|
|
786
|
+
K(a).multiple != null && e.showCheckAll && e.maxLimit == null ? ee(b.$slots, "header", { key: 0 }, () => [
|
|
787
787
|
O(G, {
|
|
788
788
|
class: "mgl20",
|
|
789
|
-
modelValue:
|
|
790
|
-
"onUpdate:modelValue": w[2] || (w[2] = (z) =>
|
|
789
|
+
modelValue: p.value,
|
|
790
|
+
"onUpdate:modelValue": w[2] || (w[2] = (z) => p.value = z),
|
|
791
791
|
onChange: C
|
|
792
792
|
}, {
|
|
793
793
|
default: D(() => [
|
|
794
|
-
ne(Q(
|
|
794
|
+
ne(Q(b.$t("quan-xuan")), 1)
|
|
795
795
|
]),
|
|
796
796
|
_: 1
|
|
797
797
|
}, 8, ["modelValue"])
|
|
798
798
|
], !0) : de("", !0),
|
|
799
|
-
(F(!0), ie(Me, null, st(
|
|
799
|
+
(F(!0), ie(Me, null, st(y.value, (z, fe) => (F(), H(_, {
|
|
800
800
|
key: fe,
|
|
801
801
|
label: k(z),
|
|
802
|
-
disabled: K(a).multiple != null &&
|
|
802
|
+
disabled: K(a).multiple != null && e.maxLimit > 0 ? V(z) : !1,
|
|
803
803
|
onClick: Ve((ue) => E(z), ["stop"]),
|
|
804
|
-
value: r.value ? z : z[
|
|
804
|
+
value: r.value ? z : z[e.labelValue.value]
|
|
805
805
|
}, null, 8, ["label", "disabled", "onClick", "value"]))), 128))
|
|
806
806
|
]),
|
|
807
807
|
_: 3
|
|
@@ -817,11 +817,11 @@ const cn = ot({
|
|
|
817
817
|
}
|
|
818
818
|
}
|
|
819
819
|
});
|
|
820
|
-
function un(
|
|
820
|
+
function un(e, t, n, a, s, o) {
|
|
821
821
|
const l = M("el-icon");
|
|
822
822
|
return F(), H(l, { class: "cmp-icon" }, {
|
|
823
823
|
default: D(() => [
|
|
824
|
-
(F(), H(rt(
|
|
824
|
+
(F(), H(rt(e.name)))
|
|
825
825
|
]),
|
|
826
826
|
_: 1
|
|
827
827
|
});
|
|
@@ -829,8 +829,8 @@ function un(t, e, n, a, s, o) {
|
|
|
829
829
|
const yt = /* @__PURE__ */ Se(cn, [["render", un], ["__scopeId", "data-v-733f9daa"]]), Zn = {
|
|
830
830
|
__name: "index",
|
|
831
831
|
emits: ["ok", "no"],
|
|
832
|
-
setup(
|
|
833
|
-
const n =
|
|
832
|
+
setup(e, { emit: t }) {
|
|
833
|
+
const n = t, a = Be(() => {
|
|
834
834
|
n("ok");
|
|
835
835
|
}, 500);
|
|
836
836
|
function s() {
|
|
@@ -844,7 +844,7 @@ const yt = /* @__PURE__ */ Se(cn, [["render", un], ["__scopeId", "data-v-733f9da
|
|
|
844
844
|
onCancel: s
|
|
845
845
|
}), {
|
|
846
846
|
reference: D(() => [
|
|
847
|
-
|
|
847
|
+
ee(o.$slots, "default")
|
|
848
848
|
]),
|
|
849
849
|
_: 3
|
|
850
850
|
}, 16, ["onConfirm"])
|
|
@@ -869,8 +869,8 @@ const dn = ["accept"], fn = {
|
|
|
869
869
|
}
|
|
870
870
|
},
|
|
871
871
|
emits: ["fileChange"],
|
|
872
|
-
setup(
|
|
873
|
-
const n =
|
|
872
|
+
setup(e, { emit: t }) {
|
|
873
|
+
const n = e, a = U(null), s = U(!1);
|
|
874
874
|
async function o(l) {
|
|
875
875
|
s.value = !0;
|
|
876
876
|
let r = l.target.files[0];
|
|
@@ -889,7 +889,7 @@ const dn = ["accept"], fn = {
|
|
|
889
889
|
O(i, {
|
|
890
890
|
loading: s.value,
|
|
891
891
|
class: "mgr10",
|
|
892
|
-
onClick: r[0] || (r[0] = (
|
|
892
|
+
onClick: r[0] || (r[0] = (y) => a.value.click())
|
|
893
893
|
}, {
|
|
894
894
|
default: D(() => [
|
|
895
895
|
ne(Q(l.$t("dao-ru")), 1)
|
|
@@ -900,7 +900,7 @@ const dn = ["accept"], fn = {
|
|
|
900
900
|
onChange: o,
|
|
901
901
|
ref_key: "input",
|
|
902
902
|
ref: a,
|
|
903
|
-
accept:
|
|
903
|
+
accept: e.accept,
|
|
904
904
|
style: { position: "absolute", width: "0px", height: "0px", opacity: "0" },
|
|
905
905
|
type: "file"
|
|
906
906
|
}, null, 40, dn)
|
|
@@ -908,23 +908,23 @@ const dn = ["accept"], fn = {
|
|
|
908
908
|
};
|
|
909
909
|
}
|
|
910
910
|
}, Gn = /* @__PURE__ */ Se(fn, [["__scopeId", "data-v-6f9ede29"]]);
|
|
911
|
-
function Pe(
|
|
912
|
-
let
|
|
913
|
-
return
|
|
911
|
+
function Pe(e) {
|
|
912
|
+
let t = {};
|
|
913
|
+
return e.forEach((n) => {
|
|
914
914
|
const { key: a, type: s, option: o = {}, value: l, dateType: r = "date" } = n;
|
|
915
915
|
if (a)
|
|
916
916
|
if (s == "input" && (o != null && o.multiple))
|
|
917
|
-
|
|
917
|
+
t[a] = pt(l);
|
|
918
918
|
else if (s == "date")
|
|
919
919
|
if (r.includes("range")) {
|
|
920
|
-
const [i,
|
|
921
|
-
let [
|
|
922
|
-
|
|
920
|
+
const [i, y] = a;
|
|
921
|
+
let [p, v] = l || [];
|
|
922
|
+
p && r == "daterange" && (p = $e(p).format("YYYY-MM-DD 00:00:00"), v = $e(v).format("YYYY-MM-DD 23:59:59")), t[i] = p, t[y] = v;
|
|
923
923
|
} else
|
|
924
|
-
|
|
924
|
+
t[a] = l;
|
|
925
925
|
else
|
|
926
|
-
|
|
927
|
-
}),
|
|
926
|
+
t[a] = l;
|
|
927
|
+
}), t;
|
|
928
928
|
}
|
|
929
929
|
const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { class: "right" }, yn = {
|
|
930
930
|
__name: "index",
|
|
@@ -935,15 +935,15 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
935
935
|
}
|
|
936
936
|
},
|
|
937
937
|
emits: ["confirm", "reset", "visibleChange"],
|
|
938
|
-
setup(
|
|
939
|
-
const a =
|
|
940
|
-
function
|
|
938
|
+
setup(e, { expose: t, emit: n }) {
|
|
939
|
+
const a = e, s = n, o = U(!0), l = U(null), { t: r } = pe(), i = ce(() => o.value ? r("guan-bi") : r("zhan-kai"));
|
|
940
|
+
function y() {
|
|
941
941
|
s("confirm");
|
|
942
942
|
}
|
|
943
|
-
function
|
|
943
|
+
function p(h) {
|
|
944
944
|
h.option.onClear && h.option.onClear(), s("confirm");
|
|
945
945
|
}
|
|
946
|
-
function
|
|
946
|
+
function v() {
|
|
947
947
|
s("reset");
|
|
948
948
|
}
|
|
949
949
|
function g() {
|
|
@@ -959,11 +959,11 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
959
959
|
x && (h.value = x.value);
|
|
960
960
|
});
|
|
961
961
|
}
|
|
962
|
-
return
|
|
962
|
+
return t({ getPrm: m, reset: c }), (h, x) => {
|
|
963
963
|
const k = M("el-input"), C = M("el-date-picker"), E = M("el-form-item"), V = M("el-form"), B = M("el-link"), I = M("el-button");
|
|
964
964
|
return F(), ie("div", {
|
|
965
965
|
class: "searchBar-container mgt10 mgb10",
|
|
966
|
-
onKeydown: Dt(
|
|
966
|
+
onKeydown: Dt(y, ["enter"])
|
|
967
967
|
}, [
|
|
968
968
|
re("div", {
|
|
969
969
|
class: "searchBar",
|
|
@@ -971,10 +971,10 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
971
971
|
}, [
|
|
972
972
|
O(V, {
|
|
973
973
|
inline: "",
|
|
974
|
-
model:
|
|
974
|
+
model: e.form.data
|
|
975
975
|
}, {
|
|
976
976
|
default: D(() => [
|
|
977
|
-
(F(!0), ie(Me, null, st(
|
|
977
|
+
(F(!0), ie(Me, null, st(e.form.items.filter(($) => !$.hidden), ($) => (F(), ie(Me, {
|
|
978
978
|
key: $.key
|
|
979
979
|
}, [
|
|
980
980
|
$.type == "br" ? (F(), ie("br", hn)) : (F(), H(E, {
|
|
@@ -982,7 +982,7 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
982
982
|
label: $.name
|
|
983
983
|
}, {
|
|
984
984
|
default: D(() => {
|
|
985
|
-
var W,
|
|
985
|
+
var W, b;
|
|
986
986
|
return [
|
|
987
987
|
$.type === "input" ? (F(), H(k, {
|
|
988
988
|
key: 0,
|
|
@@ -994,12 +994,12 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
994
994
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) : $.type === "custom" ? (F(), H(rt($.render), { key: 1 })) : de("", !0),
|
|
995
995
|
$.type === "select" ? (F(), H(rn, ge({
|
|
996
996
|
key: 2,
|
|
997
|
-
class: ((
|
|
997
|
+
class: ((b = $.option) == null ? void 0 : b.class) || "w150",
|
|
998
998
|
modelValue: $.value,
|
|
999
999
|
"onUpdate:modelValue": (w) => $.value = w
|
|
1000
1000
|
}, { ref_for: !0 }, $.option, {
|
|
1001
|
-
onChange:
|
|
1002
|
-
onClear: (w) =>
|
|
1001
|
+
onChange: y,
|
|
1002
|
+
onClear: (w) => p($)
|
|
1003
1003
|
}), null, 16, ["class", "modelValue", "onUpdate:modelValue", "onClear"])) : de("", !0),
|
|
1004
1004
|
$.type === "date" ? (F(), H(C, {
|
|
1005
1005
|
key: 3,
|
|
@@ -1025,7 +1025,7 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
1025
1025
|
], 4),
|
|
1026
1026
|
re("div", mn, [
|
|
1027
1027
|
re("div", gn, [
|
|
1028
|
-
|
|
1028
|
+
ee(h.$slots, "table-header-left", {}, void 0, !0)
|
|
1029
1029
|
]),
|
|
1030
1030
|
re("div", pn, [
|
|
1031
1031
|
O(B, {
|
|
@@ -1045,7 +1045,7 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
1045
1045
|
}),
|
|
1046
1046
|
O(I, {
|
|
1047
1047
|
type: "primary",
|
|
1048
|
-
onClick:
|
|
1048
|
+
onClick: y
|
|
1049
1049
|
}, {
|
|
1050
1050
|
default: D(() => [
|
|
1051
1051
|
ne(Q(h.$t("shai-xuan")), 1)
|
|
@@ -1054,14 +1054,14 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
1054
1054
|
}),
|
|
1055
1055
|
O(I, {
|
|
1056
1056
|
type: "primary",
|
|
1057
|
-
onClick:
|
|
1057
|
+
onClick: v
|
|
1058
1058
|
}, {
|
|
1059
1059
|
default: D(() => [
|
|
1060
1060
|
ne(Q(h.$t("chong-zhi")), 1)
|
|
1061
1061
|
]),
|
|
1062
1062
|
_: 1
|
|
1063
1063
|
}),
|
|
1064
|
-
|
|
1064
|
+
ee(h.$slots, "btn", {}, void 0, !0)
|
|
1065
1065
|
])
|
|
1066
1066
|
])
|
|
1067
1067
|
], 32);
|
|
@@ -1098,13 +1098,13 @@ const hn = { key: 0 }, mn = { class: "btns" }, gn = { class: "left" }, pn = { cl
|
|
|
1098
1098
|
// 是否启用单元格选区复制功能
|
|
1099
1099
|
};
|
|
1100
1100
|
let _e = { ...vt };
|
|
1101
|
-
function Jn(
|
|
1101
|
+
function Jn(e) {
|
|
1102
1102
|
_e = {
|
|
1103
1103
|
..._e,
|
|
1104
|
-
...
|
|
1104
|
+
...e,
|
|
1105
1105
|
responseDataKeys: {
|
|
1106
1106
|
..._e.responseDataKeys,
|
|
1107
|
-
...
|
|
1107
|
+
...e.responseDataKeys || {}
|
|
1108
1108
|
}
|
|
1109
1109
|
};
|
|
1110
1110
|
}
|
|
@@ -1150,14 +1150,14 @@ const wn = { class: "center" }, Cn = {
|
|
|
1150
1150
|
default: () => ({})
|
|
1151
1151
|
}
|
|
1152
1152
|
},
|
|
1153
|
-
setup(
|
|
1154
|
-
const { t: n, locale: a } = pe(), s = jt(), o = bn(), l =
|
|
1153
|
+
setup(e, { expose: t }) {
|
|
1154
|
+
const { t: n, locale: a } = pe(), s = jt(), o = bn(), l = e, r = U(!1), i = U([]);
|
|
1155
1155
|
l.searchForm.showSearch === void 0 && (l.searchForm.showSearch = o.showSearch), l.searchForm.showPage === void 0 && (l.searchForm.showPage = o.showPage), l.searchForm.showShadow === void 0 && (l.searchForm.showShadow = o.showShadow), l.searchForm.showCheckBox === void 0 && (l.searchForm.showCheckBox = o.showCheckBox), l.searchForm.enableCellCopy === void 0 && (l.searchForm.enableCellCopy = o.enableCellCopy), l.searchForm.selections || (l.searchForm.selections = []);
|
|
1156
|
-
const
|
|
1156
|
+
const y = ce(() => {
|
|
1157
1157
|
const d = s.path.replace(/\//g, "-").replace(/^-/, "") || "default-table";
|
|
1158
1158
|
return l.id ? `listPageId-${d}-${l.id}` : `listPageId-${d}`;
|
|
1159
|
-
}),
|
|
1160
|
-
[
|
|
1159
|
+
}), p = ct(l.searchForm.items), v = l.searchForm.pageNoKey || o.pageNoKey, g = l.searchForm.pageSizeKey || o.pageSizeKey, m = Ie({
|
|
1160
|
+
[v]: 1,
|
|
1161
1161
|
[g]: l.searchForm.defaultPageSize || o.defaultPageSize,
|
|
1162
1162
|
total: 0
|
|
1163
1163
|
}), f = U(null), c = U(null), h = U(450), x = Be(() => {
|
|
@@ -1176,7 +1176,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1176
1176
|
if (!d || !d.$el)
|
|
1177
1177
|
return !1;
|
|
1178
1178
|
const u = d.$el;
|
|
1179
|
-
return u.classList.add("cell-copy-enabled"), u.setAttribute("tabindex", "-1"), u.removeEventListener("mousedown", z), u.removeEventListener("mousemove", fe), u.removeEventListener("mouseup", ue), u.removeEventListener("keydown",
|
|
1179
|
+
return u.classList.add("cell-copy-enabled"), u.setAttribute("tabindex", "-1"), u.removeEventListener("mousedown", z), u.removeEventListener("mousemove", fe), u.removeEventListener("mouseup", ue), u.removeEventListener("keydown", Te), u.addEventListener("mousedown", z), u.addEventListener("mousemove", fe), u.addEventListener("mouseup", ue), u.addEventListener("keydown", Te), !0;
|
|
1180
1180
|
};
|
|
1181
1181
|
lt(() => {
|
|
1182
1182
|
x(), window.addEventListener("resize", k), (l.searchForm.enableCellCopy || o.enableCellCopy) && (document.addEventListener("mouseup", Ne), document.addEventListener("mousedown", We), setTimeout(() => {
|
|
@@ -1192,15 +1192,15 @@ const wn = { class: "center" }, Cn = {
|
|
|
1192
1192
|
const d = f.value;
|
|
1193
1193
|
if (d && d.$el) {
|
|
1194
1194
|
const u = d.$el;
|
|
1195
|
-
u.removeEventListener("mousedown", z), u.removeEventListener("mousemove", fe), u.removeEventListener("mouseup", ue), u.removeEventListener("keydown",
|
|
1195
|
+
u.removeEventListener("mousedown", z), u.removeEventListener("mousemove", fe), u.removeEventListener("mouseup", ue), u.removeEventListener("keydown", Te);
|
|
1196
1196
|
}
|
|
1197
1197
|
}
|
|
1198
1198
|
});
|
|
1199
|
-
const E = ce(() =>
|
|
1199
|
+
const E = ce(() => te.value.height || h.value);
|
|
1200
1200
|
let V;
|
|
1201
1201
|
async function B(d) {
|
|
1202
1202
|
const { dataFormat: u } = l.tableConfig;
|
|
1203
|
-
d[
|
|
1203
|
+
d[v] != 1 && (d.nextSearchAfter = V), r.value = !0;
|
|
1204
1204
|
const { code: S, data: T = {} } = await l.api(d).finally(() => {
|
|
1205
1205
|
r.value = !1, l.searchForm.selections = [];
|
|
1206
1206
|
});
|
|
@@ -1236,7 +1236,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1236
1236
|
function $() {
|
|
1237
1237
|
const { reset: d } = l.tableConfig;
|
|
1238
1238
|
d && d(), l.searchForm.items.forEach((u) => {
|
|
1239
|
-
const S =
|
|
1239
|
+
const S = p.find((T) => Qe(u.key) && Qe(T.key) ? u.key.join(",") == T.key.join(",") : T.key == u.key);
|
|
1240
1240
|
S && (u.value = S.value);
|
|
1241
1241
|
}), I();
|
|
1242
1242
|
}
|
|
@@ -1244,7 +1244,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1244
1244
|
function W() {
|
|
1245
1245
|
return { ...m, ...Pe(l.searchForm.items) };
|
|
1246
1246
|
}
|
|
1247
|
-
const
|
|
1247
|
+
const b = () => {
|
|
1248
1248
|
const d = f.value;
|
|
1249
1249
|
d && d.clearSort();
|
|
1250
1250
|
}, w = Ie({
|
|
@@ -1253,7 +1253,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1253
1253
|
drag: !0,
|
|
1254
1254
|
resizable: !0,
|
|
1255
1255
|
maxFixedSize: 0
|
|
1256
|
-
}),
|
|
1256
|
+
}), te = ce(() => {
|
|
1257
1257
|
const { customConfig: d, columnConfig: u, ...S } = l.tableConfig;
|
|
1258
1258
|
return {
|
|
1259
1259
|
headerAlign: "left",
|
|
@@ -1404,7 +1404,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1404
1404
|
const le = S.filter((ae) => ae.fixed === "right").indexOf(R);
|
|
1405
1405
|
j = he[le];
|
|
1406
1406
|
} else if (!X && !N && oe.closest(".vxe-table--body-wrapper")) {
|
|
1407
|
-
const me = l.searchForm.showCheckBox ? 1 : 0, le = S.filter((
|
|
1407
|
+
const me = l.searchForm.showCheckBox ? 1 : 0, le = S.filter((De) => De.fixed === "left").length, ae = J - le;
|
|
1408
1408
|
j = he[ae + me];
|
|
1409
1409
|
}
|
|
1410
1410
|
if (j && !j.classList.contains("col--checkbox") && !j.classList.contains("col--seq")) {
|
|
@@ -1452,7 +1452,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1452
1452
|
const le = S.filter((ae) => ae.fixed === "right").indexOf(J);
|
|
1453
1453
|
j = he[le];
|
|
1454
1454
|
} else if (!R && !X && oe.closest(".vxe-table--body-wrapper")) {
|
|
1455
|
-
const me = l.searchForm.showCheckBox ? 1 : 0, le = S.filter((
|
|
1455
|
+
const me = l.searchForm.showCheckBox ? 1 : 0, le = S.filter((De) => De.fixed === "left").length, ae = Y - le;
|
|
1456
1456
|
j = he[ae + me];
|
|
1457
1457
|
}
|
|
1458
1458
|
if (j && !j.classList.contains("col--checkbox") && !j.classList.contains("col--seq")) {
|
|
@@ -1470,7 +1470,7 @@ const wn = { class: "center" }, Cn = {
|
|
|
1470
1470
|
} catch (A) {
|
|
1471
1471
|
console.error("复制失败:", A);
|
|
1472
1472
|
}
|
|
1473
|
-
},
|
|
1473
|
+
}, Te = (d) => {
|
|
1474
1474
|
!l.searchForm.enableCellCopy && !o.enableCellCopy || ((d.ctrlKey || d.metaKey) && d.key === "c" ? _.selectedCells.length > 0 && (d.preventDefault(), d.stopPropagation(), wt()) : d.key === "Escape" && ve());
|
|
1475
1475
|
}, Ne = () => {
|
|
1476
1476
|
_.isSelecting = !1;
|
|
@@ -1480,9 +1480,9 @@ const wn = { class: "center" }, Cn = {
|
|
|
1480
1480
|
return;
|
|
1481
1481
|
u.$el.contains(d.target) || ve();
|
|
1482
1482
|
}, Ct = (d) => {
|
|
1483
|
-
m[
|
|
1483
|
+
m[v] = d, I();
|
|
1484
1484
|
}, xt = (d) => {
|
|
1485
|
-
m[g] = d, m[
|
|
1485
|
+
m[g] = d, m[v] = 1, I();
|
|
1486
1486
|
};
|
|
1487
1487
|
function Ze() {
|
|
1488
1488
|
const d = f.value.getCheckboxRecords();
|
|
@@ -1496,22 +1496,22 @@ const wn = { class: "center" }, Cn = {
|
|
|
1496
1496
|
l.searchForm.selections = S;
|
|
1497
1497
|
}
|
|
1498
1498
|
};
|
|
1499
|
-
return
|
|
1499
|
+
return t({ tableRef: f, getList: I, getPrm: W, clearSort: b, calculateTableHeight: x }), (d, u) => {
|
|
1500
1500
|
var A;
|
|
1501
1501
|
const S = M("el-button"), T = M("el-checkbox"), P = M("el-text"), Z = M("vxe-column"), q = M("VxeTable"), se = M("el-pagination");
|
|
1502
1502
|
return F(), ie("div", {
|
|
1503
|
-
class: qe({ box:
|
|
1503
|
+
class: qe({ box: e.searchForm.showShadow })
|
|
1504
1504
|
}, [
|
|
1505
|
-
|
|
1505
|
+
e.searchForm.showSearch ? (F(), H(vn, {
|
|
1506
1506
|
key: 0,
|
|
1507
|
-
form:
|
|
1507
|
+
form: e.searchForm,
|
|
1508
1508
|
onReset: $,
|
|
1509
1509
|
onConfirm: u[1] || (u[1] = (L) => I()),
|
|
1510
1510
|
onVisibleChange: K(x)
|
|
1511
1511
|
}, {
|
|
1512
1512
|
btn: D(() => [
|
|
1513
1513
|
u[3] || (u[3] = re("span", { class: "mgr10" }, null, -1)),
|
|
1514
|
-
|
|
1514
|
+
ee(d.$slots, "search-bar-btn", {}, void 0, !0),
|
|
1515
1515
|
O(S, {
|
|
1516
1516
|
class: "mgl10",
|
|
1517
1517
|
round: "",
|
|
@@ -1525,26 +1525,26 @@ const wn = { class: "center" }, Cn = {
|
|
|
1525
1525
|
]),
|
|
1526
1526
|
_: 3
|
|
1527
1527
|
}, 8, ["form", "onVisibleChange"])) : de("", !0),
|
|
1528
|
-
|
|
1528
|
+
ee(d.$slots, "table-header-left", {}, void 0, !0),
|
|
1529
1529
|
re("div", {
|
|
1530
1530
|
ref_key: "tableContentRef",
|
|
1531
1531
|
ref: c
|
|
1532
1532
|
}, [
|
|
1533
1533
|
O(q, ge({
|
|
1534
|
-
id:
|
|
1534
|
+
id: y.value,
|
|
1535
1535
|
ref_key: "tableRef",
|
|
1536
1536
|
ref: f,
|
|
1537
|
-
loading:
|
|
1538
|
-
data:
|
|
1537
|
+
loading: e.loading || r.value,
|
|
1538
|
+
data: e.api ? i.value : e.data,
|
|
1539
1539
|
border: ""
|
|
1540
|
-
},
|
|
1540
|
+
}, te.value, {
|
|
1541
1541
|
height: E.value,
|
|
1542
1542
|
onCheckboxChange: Ze,
|
|
1543
1543
|
onCheckboxAll: Ze,
|
|
1544
|
-
onSortChange: (A =
|
|
1544
|
+
onSortChange: (A = te.value["sort-config"]) == null ? void 0 : A.sortChange
|
|
1545
1545
|
}), {
|
|
1546
1546
|
default: D(() => [
|
|
1547
|
-
|
|
1547
|
+
e.searchForm.showCheckBox == null || e.searchForm.showCheckBox ? (F(), H(Z, {
|
|
1548
1548
|
key: 0,
|
|
1549
1549
|
type: "checkbox",
|
|
1550
1550
|
width: K(a) == "zh_cn" ? 80 : 150,
|
|
@@ -1579,21 +1579,21 @@ const wn = { class: "center" }, Cn = {
|
|
|
1579
1579
|
]),
|
|
1580
1580
|
_: 1
|
|
1581
1581
|
}, 8, ["width", "title"])) : de("", !0),
|
|
1582
|
-
|
|
1582
|
+
ee(d.$slots, "default", {}, void 0, !0)
|
|
1583
1583
|
]),
|
|
1584
1584
|
_: 3
|
|
1585
1585
|
}, 16, ["id", "loading", "data", "height", "onSortChange"])
|
|
1586
1586
|
], 512),
|
|
1587
|
-
|
|
1587
|
+
e.searchForm.showPage ? (F(), H(se, {
|
|
1588
1588
|
key: 1,
|
|
1589
|
-
"current-page": m[K(
|
|
1590
|
-
"onUpdate:currentPage": u[2] || (u[2] = (L) => m[K(
|
|
1589
|
+
"current-page": m[K(v)],
|
|
1590
|
+
"onUpdate:currentPage": u[2] || (u[2] = (L) => m[K(v)] = L),
|
|
1591
1591
|
class: "myPagination mgt10",
|
|
1592
1592
|
background: "",
|
|
1593
1593
|
layout: "total, sizes, prev, pager, next",
|
|
1594
1594
|
total: m.total,
|
|
1595
1595
|
"page-size": m[K(g)],
|
|
1596
|
-
"page-sizes":
|
|
1596
|
+
"page-sizes": e.searchForm.pageSizes || K(o).pageSizes,
|
|
1597
1597
|
onCurrentChange: Ct,
|
|
1598
1598
|
onSizeChange: xt
|
|
1599
1599
|
}, null, 8, ["current-page", "total", "page-size", "page-sizes"])) : de("", !0)
|
|
@@ -1612,10 +1612,10 @@ const wn = { class: "center" }, Cn = {
|
|
|
1612
1612
|
required: !0
|
|
1613
1613
|
}
|
|
1614
1614
|
},
|
|
1615
|
-
setup(
|
|
1616
|
-
const
|
|
1615
|
+
setup(e) {
|
|
1616
|
+
const t = e;
|
|
1617
1617
|
function n() {
|
|
1618
|
-
nn(
|
|
1618
|
+
nn(t.fileName, t.sheetsConfig);
|
|
1619
1619
|
}
|
|
1620
1620
|
return (a, s) => {
|
|
1621
1621
|
const o = M("el-link");
|
|
@@ -1624,29 +1624,31 @@ const wn = { class: "center" }, Cn = {
|
|
|
1624
1624
|
underline: "never"
|
|
1625
1625
|
}, a.$attrs, { onClick: n }), {
|
|
1626
1626
|
default: D(() => [
|
|
1627
|
-
|
|
1627
|
+
ee(a.$slots, "default", {}, () => [
|
|
1628
|
+
ne(Q(a.$t("xia-zai-dao-ru-mo-ban")), 1)
|
|
1629
|
+
])
|
|
1628
1630
|
]),
|
|
1629
|
-
_:
|
|
1631
|
+
_: 3
|
|
1630
1632
|
}, 16);
|
|
1631
1633
|
};
|
|
1632
1634
|
}
|
|
1633
1635
|
}, xn = {
|
|
1634
|
-
mounted(
|
|
1635
|
-
|
|
1636
|
+
mounted(e, t) {
|
|
1637
|
+
t.value && tt(e);
|
|
1636
1638
|
},
|
|
1637
|
-
updated(
|
|
1638
|
-
|
|
1639
|
+
updated(e, t) {
|
|
1640
|
+
t.value ? tt(e) : nt(e);
|
|
1639
1641
|
},
|
|
1640
|
-
beforeUnmount(
|
|
1641
|
-
nt(
|
|
1642
|
+
beforeUnmount(e) {
|
|
1643
|
+
nt(e);
|
|
1642
1644
|
}
|
|
1643
1645
|
};
|
|
1644
|
-
async function tt(
|
|
1646
|
+
async function tt(e) {
|
|
1645
1647
|
await g();
|
|
1646
|
-
const
|
|
1647
|
-
if (!
|
|
1648
|
+
const t = e.querySelector(".el-dialog");
|
|
1649
|
+
if (!t)
|
|
1648
1650
|
return;
|
|
1649
|
-
const n =
|
|
1651
|
+
const n = e.querySelector(".el-dialog__header"), a = e.querySelector(".el-overlay");
|
|
1650
1652
|
a.style.cssText += "overflow: hidden;", n.style.cursor = "move";
|
|
1651
1653
|
let s = !1, o = {
|
|
1652
1654
|
// 数据源,不变部分为:window信息、dialog信息、mouse初始值信息,可变部分为:拖拽坐标位移
|
|
@@ -1674,33 +1676,33 @@ async function tt(t) {
|
|
|
1674
1676
|
y: 0
|
|
1675
1677
|
}
|
|
1676
1678
|
};
|
|
1677
|
-
n.addEventListener("mousedown", i), document.addEventListener("mousemove",
|
|
1679
|
+
n.addEventListener("mousedown", i), document.addEventListener("mousemove", y), document.addEventListener("mouseup", p), window.addEventListener("resize", v);
|
|
1678
1680
|
function l() {
|
|
1679
1681
|
o.mouse.x - o.drag.x >= o.dialog.x && (o.drag.x = o.mouse.x - o.dialog.x), o.drag.x - o.mouse.x >= o.window.width - (o.dialog.x + o.dialog.width) && (o.drag.x = o.mouse.x + o.window.width - o.dialog.x - o.dialog.width), o.mouse.y - o.drag.y >= o.dialog.y && (o.drag.y = o.mouse.y - o.dialog.y), o.drag.y - o.mouse.y >= o.window.height - (o.dialog.y + o.dialog.height) && (o.drag.y = o.mouse.y + o.window.height - o.dialog.y - o.dialog.height), r();
|
|
1680
1682
|
}
|
|
1681
1683
|
function r() {
|
|
1682
1684
|
let m = o.drag.y - o.mouse.y + o.dialog.y, f = o.drag.x - o.mouse.x + o.dialog.x;
|
|
1683
|
-
|
|
1685
|
+
t.style.cssText += `position: absolute; top: calc(${m}px - ${o.dialog.marginTop}); left: ${f}px;`;
|
|
1684
1686
|
}
|
|
1685
1687
|
function i(m) {
|
|
1686
1688
|
m.button === 0 && (o.window = {
|
|
1687
1689
|
width: document.body.clientWidth,
|
|
1688
1690
|
height: document.body.clientHeight
|
|
1689
|
-
}, o.dialog =
|
|
1691
|
+
}, o.dialog = t.getBoundingClientRect(), o.dialog.marginTop = window.getComputedStyle(t).marginTop, o.mouse = {
|
|
1690
1692
|
x: m.clientX,
|
|
1691
1693
|
y: m.clientY
|
|
1692
1694
|
}, s = !0);
|
|
1693
1695
|
}
|
|
1694
|
-
function
|
|
1696
|
+
function y(m) {
|
|
1695
1697
|
s && (o.drag = {
|
|
1696
1698
|
x: m.clientX,
|
|
1697
1699
|
y: m.clientY
|
|
1698
1700
|
}, a.style.userSelect = "none", l());
|
|
1699
1701
|
}
|
|
1700
|
-
function
|
|
1702
|
+
function p(m) {
|
|
1701
1703
|
a.style.userSelect = "auto", s = !1;
|
|
1702
1704
|
}
|
|
1703
|
-
function
|
|
1705
|
+
function v(m) {
|
|
1704
1706
|
}
|
|
1705
1707
|
function g() {
|
|
1706
1708
|
return new Promise((m, f) => {
|
|
@@ -1709,10 +1711,10 @@ async function tt(t) {
|
|
|
1709
1711
|
}, 500);
|
|
1710
1712
|
});
|
|
1711
1713
|
}
|
|
1712
|
-
|
|
1714
|
+
e.__mouseDown__ = i, e.__mouseUp__ = p, e.__mouseMove__ = y, e.__sizeChange__ = v;
|
|
1713
1715
|
}
|
|
1714
|
-
function nt(
|
|
1715
|
-
document.removeEventListener("mousedown",
|
|
1716
|
+
function nt(e) {
|
|
1717
|
+
document.removeEventListener("mousedown", e.__mouseDown__), document.removeEventListener("mousemove", e.__mouseMove__), document.removeEventListener("mouseup", e.__mouseUp__), window.removeEventListener("resize", e.__sizeChange__);
|
|
1716
1718
|
}
|
|
1717
1719
|
const kn = {
|
|
1718
1720
|
key: 0,
|
|
@@ -1736,8 +1738,8 @@ const kn = {
|
|
|
1736
1738
|
}
|
|
1737
1739
|
},
|
|
1738
1740
|
emits: ["confirm"],
|
|
1739
|
-
setup(
|
|
1740
|
-
const n =
|
|
1741
|
+
setup(e, { emit: t }) {
|
|
1742
|
+
const n = e, a = t, { t: s } = pe(), o = Be(() => {
|
|
1741
1743
|
a("confirm");
|
|
1742
1744
|
}, 300);
|
|
1743
1745
|
async function l() {
|
|
@@ -1749,32 +1751,32 @@ const kn = {
|
|
|
1749
1751
|
}) == "confirm" && (n.layer.show = !1) : n.layer.show = !1;
|
|
1750
1752
|
}
|
|
1751
1753
|
return (r, i) => {
|
|
1752
|
-
const
|
|
1753
|
-
return
|
|
1754
|
+
const y = M("el-button"), p = M("el-drawer"), v = M("el-dialog");
|
|
1755
|
+
return e.layer.type ? (F(), H(p, {
|
|
1754
1756
|
key: 0,
|
|
1755
|
-
modelValue:
|
|
1756
|
-
"onUpdate:modelValue": i[0] || (i[0] = (g) =>
|
|
1757
|
-
size:
|
|
1758
|
-
title:
|
|
1757
|
+
modelValue: e.layer.show,
|
|
1758
|
+
"onUpdate:modelValue": i[0] || (i[0] = (g) => e.layer.show = g),
|
|
1759
|
+
size: e.layer.width || "100%",
|
|
1760
|
+
title: e.layer.title,
|
|
1759
1761
|
direction: "rtl",
|
|
1760
1762
|
"append-to-body": "",
|
|
1761
1763
|
"before-close": l,
|
|
1762
1764
|
class: "drawer-content"
|
|
1763
1765
|
}, {
|
|
1764
1766
|
default: D(() => [
|
|
1765
|
-
|
|
1767
|
+
ee(r.$slots, "default"),
|
|
1766
1768
|
i[2] || (i[2] = re("p", { class: "mgt50" }, null, -1)),
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
O(
|
|
1769
|
+
e.layer.showButton ? (F(), ie("div", kn, [
|
|
1770
|
+
ee(r.$slots, "btn", {}, () => [
|
|
1771
|
+
O(y, { onClick: l }, {
|
|
1770
1772
|
default: D(() => [
|
|
1771
1773
|
ne(Q(r.$t("qu-xiao")), 1)
|
|
1772
1774
|
]),
|
|
1773
1775
|
_: 1
|
|
1774
1776
|
}),
|
|
1775
|
-
O(
|
|
1777
|
+
O(y, {
|
|
1776
1778
|
type: "primary",
|
|
1777
|
-
loading:
|
|
1779
|
+
loading: e.loading,
|
|
1778
1780
|
onClick: K(o)
|
|
1779
1781
|
}, {
|
|
1780
1782
|
default: D(() => [
|
|
@@ -1787,30 +1789,30 @@ const kn = {
|
|
|
1787
1789
|
]),
|
|
1788
1790
|
_: 3
|
|
1789
1791
|
}, 8, ["modelValue", "size", "title"])) : Vt((F(), ie("div", _n, [
|
|
1790
|
-
O(
|
|
1792
|
+
O(v, {
|
|
1791
1793
|
"close-on-click-modal": !1,
|
|
1792
|
-
modelValue:
|
|
1793
|
-
"onUpdate:modelValue": i[1] || (i[1] = (g) =>
|
|
1794
|
-
title:
|
|
1795
|
-
width:
|
|
1794
|
+
modelValue: e.layer.show,
|
|
1795
|
+
"onUpdate:modelValue": i[1] || (i[1] = (g) => e.layer.show = g),
|
|
1796
|
+
title: e.layer.title,
|
|
1797
|
+
width: e.layer.width || 500,
|
|
1796
1798
|
center: ""
|
|
1797
1799
|
}, at({
|
|
1798
1800
|
default: D(() => [
|
|
1799
|
-
|
|
1801
|
+
ee(r.$slots, "default")
|
|
1800
1802
|
]),
|
|
1801
1803
|
_: 2
|
|
1802
1804
|
}, [
|
|
1803
|
-
|
|
1805
|
+
e.layer.showButton ? {
|
|
1804
1806
|
name: "footer",
|
|
1805
1807
|
fn: D(() => [
|
|
1806
|
-
|
|
1807
|
-
O(
|
|
1808
|
+
ee(r.$slots, "btn", {}, () => [
|
|
1809
|
+
O(y, { onClick: l }, {
|
|
1808
1810
|
default: D(() => [
|
|
1809
1811
|
ne(Q(r.$t("qu-xiao")), 1)
|
|
1810
1812
|
]),
|
|
1811
1813
|
_: 1
|
|
1812
1814
|
}),
|
|
1813
|
-
O(
|
|
1815
|
+
O(y, {
|
|
1814
1816
|
type: "primary",
|
|
1815
1817
|
onClick: K(o)
|
|
1816
1818
|
}, {
|
|
@@ -1825,44 +1827,44 @@ const kn = {
|
|
|
1825
1827
|
} : void 0
|
|
1826
1828
|
]), 1032, ["modelValue", "title", "width"])
|
|
1827
1829
|
])), [
|
|
1828
|
-
[K(xn),
|
|
1830
|
+
[K(xn), e.layer.show]
|
|
1829
1831
|
]);
|
|
1830
1832
|
};
|
|
1831
1833
|
}
|
|
1832
1834
|
};
|
|
1833
|
-
function no(
|
|
1835
|
+
function no(e, t = {}) {
|
|
1834
1836
|
const n = Ce(), a = {
|
|
1835
1837
|
inForm: !0,
|
|
1836
1838
|
required: !0,
|
|
1837
|
-
...
|
|
1839
|
+
...t
|
|
1838
1840
|
}, s = {
|
|
1839
1841
|
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}$/,
|
|
1840
1842
|
password: /(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/,
|
|
1841
1843
|
email: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
|
|
1842
|
-
}[
|
|
1843
|
-
return o ? function(
|
|
1844
|
+
}[e], { inForm: o, value: l, required: r, msg: i = n("validate.invalidInput") } = a;
|
|
1845
|
+
return o ? function(y, p, v) {
|
|
1844
1846
|
if (r) {
|
|
1845
|
-
s.test(
|
|
1847
|
+
s.test(p) ? v() : v(new Error(i));
|
|
1846
1848
|
return;
|
|
1847
1849
|
}
|
|
1848
|
-
|
|
1850
|
+
p && !s.test(p) ? v(new Error(i)) : v();
|
|
1849
1851
|
} : s.test(l);
|
|
1850
1852
|
}
|
|
1851
1853
|
class oo {
|
|
1852
|
-
constructor(
|
|
1854
|
+
constructor(t = {}) {
|
|
1853
1855
|
this.config = {
|
|
1854
|
-
clientCode:
|
|
1855
|
-
casServerUrl: `https://one-portal${
|
|
1856
|
-
casPortalUrl: `https://one-portal${
|
|
1857
|
-
serviceUrl:
|
|
1858
|
-
tokenKey:
|
|
1859
|
-
userKey:
|
|
1860
|
-
debug:
|
|
1861
|
-
autoLogin:
|
|
1856
|
+
clientCode: t.clientCode || "one-portal",
|
|
1857
|
+
casServerUrl: `https://one-portal${t.isTest ? "-test" : ""}.joy-group.com/api`,
|
|
1858
|
+
casPortalUrl: `https://one-portal${t.isTest ? "-test" : ""}.joy-group.com`,
|
|
1859
|
+
serviceUrl: t.serviceUrl || window.location.origin + "/cas/callback",
|
|
1860
|
+
tokenKey: t.tokenKey || "one_portal_token",
|
|
1861
|
+
userKey: t.userKey || "one_portal_user",
|
|
1862
|
+
debug: t.debug || !1,
|
|
1863
|
+
autoLogin: t.autoLogin !== !1,
|
|
1862
1864
|
// 默认开启自动登录
|
|
1863
|
-
loginCallback:
|
|
1864
|
-
logoutCallback:
|
|
1865
|
-
errorCallback:
|
|
1865
|
+
loginCallback: t.loginCallback || null,
|
|
1866
|
+
logoutCallback: t.logoutCallback || null,
|
|
1867
|
+
errorCallback: t.errorCallback || null
|
|
1866
1868
|
}, this.token = null, this.user = null, this.init();
|
|
1867
1869
|
}
|
|
1868
1870
|
/**
|
|
@@ -1879,10 +1881,10 @@ class oo {
|
|
|
1879
1881
|
loadFromStorage() {
|
|
1880
1882
|
try {
|
|
1881
1883
|
this.token = localStorage.getItem(this.config.tokenKey);
|
|
1882
|
-
const
|
|
1883
|
-
|
|
1884
|
-
} catch (
|
|
1885
|
-
this.log("加载本地存储数据失败:",
|
|
1884
|
+
const t = localStorage.getItem(this.config.userKey);
|
|
1885
|
+
t && (this.user = JSON.parse(t)), this.log("从本地存储加载数据:", { token: !!this.token, user: !!this.user });
|
|
1886
|
+
} catch (t) {
|
|
1887
|
+
this.log("加载本地存储数据失败:", t);
|
|
1886
1888
|
}
|
|
1887
1889
|
}
|
|
1888
1890
|
/**
|
|
@@ -1891,8 +1893,8 @@ class oo {
|
|
|
1891
1893
|
saveToStorage() {
|
|
1892
1894
|
try {
|
|
1893
1895
|
this.token && localStorage.setItem(this.config.tokenKey, this.token), this.user && localStorage.setItem(this.config.userKey, JSON.stringify(this.user)), this.log("数据已保存到本地存储");
|
|
1894
|
-
} catch (
|
|
1895
|
-
this.log("保存到本地存储失败:",
|
|
1896
|
+
} catch (t) {
|
|
1897
|
+
this.log("保存到本地存储失败:", t);
|
|
1896
1898
|
}
|
|
1897
1899
|
}
|
|
1898
1900
|
/**
|
|
@@ -1901,8 +1903,8 @@ class oo {
|
|
|
1901
1903
|
clearStorage() {
|
|
1902
1904
|
try {
|
|
1903
1905
|
localStorage.removeItem(this.config.tokenKey), localStorage.removeItem(this.config.userKey), this.log("本地存储已清除");
|
|
1904
|
-
} catch (
|
|
1905
|
-
this.log("清除本地存储失败:",
|
|
1906
|
+
} catch (t) {
|
|
1907
|
+
this.log("清除本地存储失败:", t);
|
|
1906
1908
|
}
|
|
1907
1909
|
}
|
|
1908
1910
|
/**
|
|
@@ -1927,16 +1929,16 @@ class oo {
|
|
|
1927
1929
|
* 登录 - 跳转到CAS登录页面
|
|
1928
1930
|
*/
|
|
1929
1931
|
login() {
|
|
1930
|
-
const
|
|
1931
|
-
this.log("跳转到CAS登录页面:",
|
|
1932
|
+
const t = `${this.config.casPortalUrl}?appCode=${this.config.clientCode}&redirectUrl=${encodeURIComponent(this.config.serviceUrl)}`;
|
|
1933
|
+
this.log("跳转到CAS登录页面:", t), window.location.href = t;
|
|
1932
1934
|
}
|
|
1933
1935
|
/**
|
|
1934
1936
|
* 验证ST票据
|
|
1935
1937
|
*/
|
|
1936
|
-
async validateTicket(
|
|
1938
|
+
async validateTicket(t) {
|
|
1937
1939
|
try {
|
|
1938
|
-
this.log("验证ST票据:",
|
|
1939
|
-
const n = await fetch(`${this.config.casServerUrl}/auth/validateST?ticket=${
|
|
1940
|
+
this.log("验证ST票据:", t);
|
|
1941
|
+
const n = await fetch(`${this.config.casServerUrl}/auth/validateST?ticket=${t}`, {
|
|
1940
1942
|
method: "GET",
|
|
1941
1943
|
headers: {
|
|
1942
1944
|
"Content-Type": "application/json"
|
|
@@ -1956,13 +1958,13 @@ class oo {
|
|
|
1956
1958
|
* 清除URL中的ticket参数
|
|
1957
1959
|
*/
|
|
1958
1960
|
clearTicketFromUrl() {
|
|
1959
|
-
const
|
|
1960
|
-
|
|
1961
|
+
const t = new URL(window.location);
|
|
1962
|
+
t.searchParams.delete("ticket"), window.history.replaceState({}, document.title, t.toString());
|
|
1961
1963
|
}
|
|
1962
1964
|
/**
|
|
1963
1965
|
* 登出
|
|
1964
1966
|
*/
|
|
1965
|
-
async logout(
|
|
1967
|
+
async logout(t = !0) {
|
|
1966
1968
|
try {
|
|
1967
1969
|
if (this.log("用户登出"), this.token)
|
|
1968
1970
|
try {
|
|
@@ -1977,7 +1979,7 @@ class oo {
|
|
|
1977
1979
|
} catch (n) {
|
|
1978
1980
|
this.log("调用服务端登出接口失败:", n);
|
|
1979
1981
|
}
|
|
1980
|
-
this.token = null, this.user = null, this.clearStorage(), this.config.logoutCallback && this.config.logoutCallback(),
|
|
1982
|
+
this.token = null, this.user = null, this.clearStorage(), this.config.logoutCallback && this.config.logoutCallback(), t && this.login();
|
|
1981
1983
|
} catch (n) {
|
|
1982
1984
|
this.log("登出失败:", n), this.handleError(n);
|
|
1983
1985
|
}
|
|
@@ -1985,7 +1987,7 @@ class oo {
|
|
|
1985
1987
|
/**
|
|
1986
1988
|
* 发送带认证的HTTP请求
|
|
1987
1989
|
*/
|
|
1988
|
-
async request(
|
|
1990
|
+
async request(t, n = {}) {
|
|
1989
1991
|
const a = {
|
|
1990
1992
|
headers: {
|
|
1991
1993
|
"Content-Type": "application/json",
|
|
@@ -1995,7 +1997,7 @@ class oo {
|
|
|
1995
1997
|
};
|
|
1996
1998
|
a.headers.appId = this.config.clientCode, this.token && (a.headers.Authorization = `Bearer ${this.token}`);
|
|
1997
1999
|
try {
|
|
1998
|
-
const s = await fetch(
|
|
2000
|
+
const s = await fetch(t, a);
|
|
1999
2001
|
return s.status === 401 ? (this.log("Token已过期,需要重新登录"), this.logout(), null) : s;
|
|
2000
2002
|
} catch (s) {
|
|
2001
2003
|
throw this.log("请求失败:", s), s;
|
|
@@ -2006,15 +2008,15 @@ class oo {
|
|
|
2006
2008
|
*/
|
|
2007
2009
|
async fetchUserInfo() {
|
|
2008
2010
|
try {
|
|
2009
|
-
const
|
|
2010
|
-
if (
|
|
2011
|
-
const n = await
|
|
2011
|
+
const t = await this.request(`${this.config.casServerUrl}/auth/user`);
|
|
2012
|
+
if (t && t.ok) {
|
|
2013
|
+
const n = await t.json();
|
|
2012
2014
|
if (n.success && n.data)
|
|
2013
2015
|
return this.user = n.data, this.saveToStorage(), this.user;
|
|
2014
2016
|
}
|
|
2015
2017
|
return null;
|
|
2016
|
-
} catch (
|
|
2017
|
-
return this.log("获取用户信息失败:",
|
|
2018
|
+
} catch (t) {
|
|
2019
|
+
return this.log("获取用户信息失败:", t), null;
|
|
2018
2020
|
}
|
|
2019
2021
|
}
|
|
2020
2022
|
/**
|
|
@@ -2026,14 +2028,14 @@ class oo {
|
|
|
2026
2028
|
/**
|
|
2027
2029
|
* 错误处理
|
|
2028
2030
|
*/
|
|
2029
|
-
handleError(
|
|
2030
|
-
this.log("发生错误:",
|
|
2031
|
+
handleError(t) {
|
|
2032
|
+
this.log("发生错误:", t), this.config.errorCallback && this.config.errorCallback(t);
|
|
2031
2033
|
}
|
|
2032
2034
|
/**
|
|
2033
2035
|
* 日志输出
|
|
2034
2036
|
*/
|
|
2035
|
-
log(...
|
|
2036
|
-
this.config.debug && console.log("[OnePortal CAS SDK]", ...
|
|
2037
|
+
log(...t) {
|
|
2038
|
+
this.config.debug && console.log("[OnePortal CAS SDK]", ...t);
|
|
2037
2039
|
}
|
|
2038
2040
|
/**
|
|
2039
2041
|
* 检查登录状态并自动处理
|
|
@@ -2044,200 +2046,199 @@ class oo {
|
|
|
2044
2046
|
/**
|
|
2045
2047
|
* 设置配置
|
|
2046
2048
|
*/
|
|
2047
|
-
setConfig(
|
|
2048
|
-
this.config[
|
|
2049
|
+
setConfig(t, n) {
|
|
2050
|
+
this.config[t] = n;
|
|
2049
2051
|
}
|
|
2050
2052
|
/**
|
|
2051
2053
|
* 获取配置
|
|
2052
2054
|
*/
|
|
2053
|
-
getConfig(
|
|
2054
|
-
return this.config[
|
|
2055
|
+
getConfig(t) {
|
|
2056
|
+
return this.config[t];
|
|
2055
2057
|
}
|
|
2056
2058
|
}
|
|
2057
|
-
function lo(
|
|
2059
|
+
function lo(e, t = {}) {
|
|
2058
2060
|
const a = Object.assign({
|
|
2059
2061
|
manual: !1,
|
|
2060
2062
|
// 手动执行
|
|
2061
2063
|
log: !1,
|
|
2062
2064
|
params: null,
|
|
2063
2065
|
format: null
|
|
2064
|
-
},
|
|
2066
|
+
}, t), { manual: s, log: o, params: l = {}, cb: r, format: i } = a, y = U([]), p = U(!1), v = (g) => {
|
|
2065
2067
|
const m = g || l;
|
|
2066
|
-
|
|
2068
|
+
p.value = !0, e(m).then((f) => {
|
|
2067
2069
|
const { code: c, data: h, msg: x } = f;
|
|
2068
2070
|
if (r) {
|
|
2069
2071
|
const { records: k, rows: C } = h || {}, E = k || C ? k || C : h;
|
|
2070
|
-
|
|
2072
|
+
y.value = Oe(E, i), r(f);
|
|
2071
2073
|
}
|
|
2072
2074
|
if (h) {
|
|
2073
2075
|
if (h.records != null || h.rows != null) {
|
|
2074
2076
|
const { records: k, rows: C, total: E = 0 } = h || {};
|
|
2075
|
-
m && m.total != null && (l.total = parseInt(E)),
|
|
2077
|
+
m && m.total != null && (l.total = parseInt(E)), y.value = Oe(k || C || [], i);
|
|
2076
2078
|
} else
|
|
2077
|
-
|
|
2078
|
-
o && console.log("useRequest-res",
|
|
2079
|
+
y.value = Oe(h, i);
|
|
2080
|
+
o && console.log("useRequest-res", y.value);
|
|
2079
2081
|
}
|
|
2080
2082
|
}).catch((f) => {
|
|
2081
2083
|
r && (console.log("useRequestErr", f), r({ code: 500 }));
|
|
2082
2084
|
}).finally(() => {
|
|
2083
|
-
|
|
2085
|
+
p.value = !1;
|
|
2084
2086
|
});
|
|
2085
2087
|
};
|
|
2086
|
-
return s ||
|
|
2088
|
+
return s || v(), [p, y, v];
|
|
2087
2089
|
}
|
|
2088
|
-
function ao(
|
|
2089
|
-
const
|
|
2090
|
-
return Re(
|
|
2090
|
+
function ao(e) {
|
|
2091
|
+
const t = U(e), n = U(""), a = U("");
|
|
2092
|
+
return Re(t, (s) => {
|
|
2091
2093
|
const o = s || ["", ""];
|
|
2092
2094
|
n.value = o[0], a.value = o[1];
|
|
2093
|
-
}), [
|
|
2095
|
+
}), [t, n, a];
|
|
2094
2096
|
}
|
|
2095
|
-
function so(
|
|
2096
|
-
return Object.prototype.toString.call(
|
|
2097
|
+
function so(e) {
|
|
2098
|
+
return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
|
|
2097
2099
|
}
|
|
2098
|
-
function
|
|
2099
|
-
if (!
|
|
2100
|
-
return
|
|
2101
|
-
if (
|
|
2102
|
-
return
|
|
2100
|
+
function Oe(e, t) {
|
|
2101
|
+
if (!t)
|
|
2102
|
+
return e;
|
|
2103
|
+
if (e instanceof Array)
|
|
2104
|
+
return e.map((a) => {
|
|
2103
2105
|
let s = {};
|
|
2104
|
-
return
|
|
2106
|
+
return t.forEach((o) => s[o] = a[o]), s;
|
|
2105
2107
|
});
|
|
2106
2108
|
let n = {};
|
|
2107
|
-
return
|
|
2109
|
+
return t.forEach((a) => n[a] = e[a]), n;
|
|
2108
2110
|
}
|
|
2109
|
-
function ro(
|
|
2110
|
-
const { locale: n } = pe(), a = U(
|
|
2111
|
+
function ro(e, t = []) {
|
|
2112
|
+
const { locale: n } = pe(), a = U(e());
|
|
2111
2113
|
return Re(
|
|
2112
|
-
[n, ...
|
|
2114
|
+
[n, ...t],
|
|
2113
2115
|
() => {
|
|
2114
|
-
a.value =
|
|
2116
|
+
a.value = e();
|
|
2115
2117
|
},
|
|
2116
2118
|
{ immediate: !0 }
|
|
2117
2119
|
), a;
|
|
2118
2120
|
}
|
|
2119
|
-
function io(
|
|
2120
|
-
if (!
|
|
2121
|
+
function io(e, t = "zh_cn", n = "en_us") {
|
|
2122
|
+
if (!e)
|
|
2121
2123
|
return "-";
|
|
2122
|
-
const a = { en_us: n, zh_cn:
|
|
2123
|
-
return
|
|
2124
|
+
const a = { en_us: n, zh_cn: t }, o = Ke().global.locale.value;
|
|
2125
|
+
return e[a[o]] || e[t] || "-";
|
|
2124
2126
|
}
|
|
2125
|
-
function co(
|
|
2127
|
+
function co(e, t) {
|
|
2126
2128
|
let n = Pt;
|
|
2127
|
-
return typeof
|
|
2129
|
+
return typeof e == "string" && e.length > 0 && (n = Ye(e).mapState), bt(t, n);
|
|
2128
2130
|
}
|
|
2129
|
-
function uo(
|
|
2131
|
+
function uo(e, t) {
|
|
2130
2132
|
let n = Rt;
|
|
2131
|
-
return typeof
|
|
2133
|
+
return typeof e == "string" && e.length > 0 && (n = Ye(e).mapGetters), bt(t, n);
|
|
2132
2134
|
}
|
|
2133
|
-
function fo(
|
|
2135
|
+
function fo(e, t) {
|
|
2134
2136
|
let n = Bt;
|
|
2135
|
-
return typeof
|
|
2137
|
+
return typeof e == "string" && e.length > 0 && (n = Ye(e).mapActions), $n(t, n);
|
|
2136
2138
|
}
|
|
2137
|
-
function bt(
|
|
2138
|
-
const n = ut(), a = e
|
|
2139
|
+
function bt(e, t) {
|
|
2140
|
+
const n = ut(), a = t(e), s = {};
|
|
2139
2141
|
return Object.keys(a).forEach((o) => {
|
|
2140
2142
|
const l = a[o].bind({ $store: n });
|
|
2141
2143
|
s[o] = ce(l);
|
|
2142
2144
|
}), s;
|
|
2143
2145
|
}
|
|
2144
|
-
function $n(
|
|
2145
|
-
const n = ut(), a = e
|
|
2146
|
+
function $n(e, t) {
|
|
2147
|
+
const n = ut(), a = t(e), s = {};
|
|
2146
2148
|
return Object.keys(a).forEach((o) => {
|
|
2147
2149
|
s[o] = a[o].bind({ $store: n });
|
|
2148
2150
|
}), s;
|
|
2149
2151
|
}
|
|
2150
|
-
function
|
|
2151
|
-
return typeof
|
|
2152
|
+
function Le(e) {
|
|
2153
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !qt(e);
|
|
2152
2154
|
}
|
|
2153
2155
|
function ho() {
|
|
2154
2156
|
ke.renderer.add("Enum", {
|
|
2155
2157
|
// 默认显示模板
|
|
2156
|
-
renderTableDefault(
|
|
2158
|
+
renderTableDefault(e, t) {
|
|
2157
2159
|
let n;
|
|
2158
|
-
if ([null, void 0].includes(
|
|
2160
|
+
if ([null, void 0].includes(t.row[t.column.field]))
|
|
2159
2161
|
return "-";
|
|
2160
|
-
const a =
|
|
2161
|
-
if (
|
|
2162
|
+
const a = t.row[t.column.field];
|
|
2163
|
+
if (e.type == "tag") {
|
|
2162
2164
|
let s;
|
|
2163
2165
|
return O(M("el-text"), {
|
|
2164
|
-
type:
|
|
2165
|
-
},
|
|
2166
|
+
type: e.enum.getTag(a)
|
|
2167
|
+
}, Le(s = e.enum.getName(a)) ? s : {
|
|
2166
2168
|
default: () => [s]
|
|
2167
2169
|
});
|
|
2168
2170
|
}
|
|
2169
|
-
return O(M("el-text"), null,
|
|
2171
|
+
return O(M("el-text"), null, Le(n = e.enum.getName(a)) ? n : {
|
|
2170
2172
|
default: () => [n]
|
|
2171
2173
|
});
|
|
2172
2174
|
}
|
|
2173
2175
|
}), ke.renderer.add("InputNumber", {
|
|
2174
2176
|
// 默认显示模板
|
|
2175
|
-
renderTableDefault(
|
|
2177
|
+
renderTableDefault(e, t) {
|
|
2176
2178
|
return O(It, ge({
|
|
2177
|
-
modelValue:
|
|
2178
|
-
"onUpdate:modelValue": (n) =>
|
|
2179
|
-
},
|
|
2179
|
+
modelValue: t.row[t.column.field],
|
|
2180
|
+
"onUpdate:modelValue": (n) => t.row[t.column.field] = n
|
|
2181
|
+
}, e.props, {
|
|
2180
2182
|
"step-strictly": !0,
|
|
2181
2183
|
"value-on-clear": 0
|
|
2182
2184
|
}), null);
|
|
2183
2185
|
}
|
|
2184
2186
|
}), ke.renderer.add("TrueFalse", {
|
|
2185
2187
|
// 默认显示模板
|
|
2186
|
-
renderTableDefault(
|
|
2188
|
+
renderTableDefault(e, t) {
|
|
2187
2189
|
const {
|
|
2188
2190
|
locale: n
|
|
2189
2191
|
} = pe();
|
|
2190
2192
|
let a = n.value == "zh_cn";
|
|
2191
2193
|
return O(Lt, {
|
|
2192
|
-
type:
|
|
2194
|
+
type: t.row[t.column.field] ? "success" : "danger"
|
|
2193
2195
|
}, {
|
|
2194
|
-
default: () => [
|
|
2196
|
+
default: () => [t.row[t.column.field] ? a ? "是" : "YES" : a ? "否" : "NO"]
|
|
2195
2197
|
});
|
|
2196
2198
|
}
|
|
2197
2199
|
}), ke.renderer.add("I18n", {
|
|
2198
2200
|
// 默认显示模板
|
|
2199
|
-
renderTableDefault(
|
|
2201
|
+
renderTableDefault(e, t) {
|
|
2200
2202
|
const {
|
|
2201
2203
|
locale: n
|
|
2202
2204
|
} = pe();
|
|
2203
|
-
let a = n.value == "zh_cn" ?
|
|
2204
|
-
return
|
|
2205
|
+
let a = n.value == "zh_cn" ? t.column.field : e.fieldEn;
|
|
2206
|
+
return t.row[a] || t.row[t.column.field];
|
|
2205
2207
|
}
|
|
2206
2208
|
}), ke.renderer.add("Link", {
|
|
2207
2209
|
// 默认显示模板
|
|
2208
|
-
renderTableDefault(
|
|
2209
|
-
|
|
2210
|
-
let n = e.column.field;
|
|
2210
|
+
renderTableDefault(e, t) {
|
|
2211
|
+
let n = t.column.field;
|
|
2211
2212
|
const a = Ut(), {
|
|
2212
2213
|
multiple: s,
|
|
2213
|
-
to: o
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2214
|
+
to: o,
|
|
2215
|
+
openType: l = "system"
|
|
2216
|
+
} = e, r = t.row[n];
|
|
2217
|
+
function i(y, p) {
|
|
2218
|
+
l == "blank" ? window.open(y) : a.push({
|
|
2219
|
+
path: y,
|
|
2220
|
+
query: {
|
|
2221
|
+
[n]: p
|
|
2222
|
+
}
|
|
2223
|
+
});
|
|
2224
|
+
}
|
|
2225
|
+
if (s) {
|
|
2226
|
+
const y = (r == null ? void 0 : r.split(",")) || [];
|
|
2227
|
+
return y.map((p, v) => O("span", null, [O(Je, {
|
|
2217
2228
|
underline: "never",
|
|
2218
2229
|
type: "primary",
|
|
2219
|
-
onclick: () =>
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
}, {
|
|
2226
|
-
default: () => [e.row[n]]
|
|
2227
|
-
});
|
|
2228
|
-
const l = ((r = e.row[n]) == null ? void 0 : r.split(",")) || [];
|
|
2229
|
-
return l.map((i, p) => O("span", null, [O(Je, {
|
|
2230
|
+
onclick: () => i(l == "stystem" ? o : p, p)
|
|
2231
|
+
}, Le(p) ? p : {
|
|
2232
|
+
default: () => [p]
|
|
2233
|
+
}), v < y.length - 1 ? "," : ""]));
|
|
2234
|
+
}
|
|
2235
|
+
return O(Je, {
|
|
2230
2236
|
underline: "never",
|
|
2231
2237
|
type: "primary",
|
|
2232
|
-
onclick: () =>
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
}
|
|
2237
|
-
})
|
|
2238
|
-
}, Oe(i) ? i : {
|
|
2239
|
-
default: () => [i]
|
|
2240
|
-
}), p < l.length - 1 ? "," : ""]));
|
|
2238
|
+
onclick: () => i(l == "stystem" ? o : r, r)
|
|
2239
|
+
}, Le(r) ? r : {
|
|
2240
|
+
default: () => [r]
|
|
2241
|
+
});
|
|
2241
2242
|
}
|
|
2242
2243
|
});
|
|
2243
2244
|
}
|