joy-admin-components 0.2.93 → 0.2.95
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 { ElCol as e, ElForm as t, ElInputNumber as n, ElLink as r, ElMessage as i, ElMessageBox as a, ElRow as o, ElText as s } from "element-plus";
|
|
2
|
-
import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createSlots as m, createTextVNode as h, createVNode as g, defineComponent as _, h as v, isVNode as y, mergeModels as b, mergeProps as x, nextTick as S, normalizeClass as C, normalizeStyle as w, onMounted as T, onUnmounted as E, onUpdated as D, openBlock as O, reactive as k, ref as A, renderList as
|
|
3
|
-
import { saveAs as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { createI18n as
|
|
7
|
-
import { cloneDeep as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
2
|
+
import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createSlots as m, createTextVNode as h, createVNode as g, defineComponent as _, h as v, isVNode as y, mergeModels as b, mergeProps as x, nextTick as S, normalizeClass as C, normalizeStyle as w, onMounted as T, onUnmounted as E, onUpdated as D, openBlock as O, reactive as k, ref as A, renderList as ee, renderSlot as j, resolveComponent as M, resolveDynamicComponent as N, toDisplayString as P, unref as F, useAttrs as te, useModel as ne, watch as re, withCtx as I, withDirectives as L, withKeys as ie, withModifiers as ae } from "vue";
|
|
3
|
+
import { saveAs as R } from "file-saver";
|
|
4
|
+
import z from "exceljs";
|
|
5
|
+
import B from "dayjs";
|
|
6
|
+
import { createI18n as oe, useI18n as V } from "vue-i18n";
|
|
7
|
+
import { cloneDeep as se, debounce as ce, isArray as le } from "lodash";
|
|
8
|
+
import { createNamespacedHelpers as ue, mapActions as de, mapGetters as fe, mapState as H, useStore as pe } from "vuex";
|
|
9
|
+
import { VxeUI as U } from "vxe-pc-ui";
|
|
10
|
+
import { useRouter as W } from "vue-router";
|
|
11
11
|
//#region \0rolldown/runtime.js
|
|
12
|
-
var
|
|
13
|
-
if (t && typeof t == "object" || typeof t == "function") for (var i =
|
|
12
|
+
var G = Object.create, me = Object.defineProperty, K = Object.getOwnPropertyDescriptor, he = Object.getOwnPropertyNames, ge = Object.getPrototypeOf, _e = Object.prototype.hasOwnProperty, q = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), ve = (e, t, n, r) => {
|
|
13
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = he(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !_e.call(e, s) && s !== n && me(e, s, {
|
|
14
14
|
get: ((e) => t[e]).bind(null, s),
|
|
15
|
-
enumerable: !(r =
|
|
15
|
+
enumerable: !(r = K(t, s)) || r.enumerable
|
|
16
16
|
});
|
|
17
17
|
return e;
|
|
18
|
-
},
|
|
18
|
+
}, ye = (e, t, n) => (n = e == null ? {} : G(ge(e)), ve(t || !e || !e.__esModule ? me(n, "default", {
|
|
19
19
|
value: e,
|
|
20
20
|
enumerable: !0
|
|
21
|
-
}) : n, e)),
|
|
21
|
+
}) : n, e)), be = _({
|
|
22
22
|
name: "LayOutForm",
|
|
23
23
|
setup(n, { slots: r, attrs: i, emit: a }) {
|
|
24
24
|
let s = A(null), c = () => r.default ? r.default().filter((e) => e.type !== Symbol.for("v-cmt")).map((e) => e.type === Symbol.for("v-fgt") ? e.children : e).flat().map((t) => v(e, {
|
|
@@ -36,7 +36,7 @@ var de = Object.create, Y = Object.defineProperty, fe = Object.getOwnPropertyDes
|
|
|
36
36
|
}
|
|
37
37
|
return l;
|
|
38
38
|
}
|
|
39
|
-
}),
|
|
39
|
+
}), J = /* @__PURE__ */ q(((e, t) => {
|
|
40
40
|
(function(n, r) {
|
|
41
41
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs_plugin_utc = r();
|
|
42
42
|
})(e, (function() {
|
|
@@ -120,7 +120,7 @@ var de = Object.create, Y = Object.defineProperty, fe = Object.getOwnPropertyDes
|
|
|
120
120
|
};
|
|
121
121
|
};
|
|
122
122
|
}));
|
|
123
|
-
})),
|
|
123
|
+
})), xe = /* @__PURE__ */ q(((e, t) => {
|
|
124
124
|
(function(n, r) {
|
|
125
125
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs_plugin_timezone = r();
|
|
126
126
|
})(e, (function() {
|
|
@@ -196,7 +196,7 @@ var de = Object.create, Y = Object.defineProperty, fe = Object.getOwnPropertyDes
|
|
|
196
196
|
};
|
|
197
197
|
};
|
|
198
198
|
}));
|
|
199
|
-
})),
|
|
199
|
+
})), Se = /* @__PURE__ */ ye(J()), Ce = /* @__PURE__ */ ye(xe()), Y = {
|
|
200
200
|
"dao-ru": "导入",
|
|
201
201
|
"quan-xuan": "全选",
|
|
202
202
|
"xia-zai-dao-ru-mo-ban": "下载导入模板",
|
|
@@ -224,7 +224,7 @@ var de = Object.create, Y = Object.defineProperty, fe = Object.getOwnPropertyDes
|
|
|
224
224
|
import: { versionMismatch: "模板版本有更新,请重新下载模板" },
|
|
225
225
|
validate: { invalidInput: "请输入正确内容" },
|
|
226
226
|
tools: { keysLengthError: "keys 长度必须大于2 默认前两位为 label value" }
|
|
227
|
-
},
|
|
227
|
+
}, X = {
|
|
228
228
|
"dao-ru": "Import",
|
|
229
229
|
"quan-xuan": "Select All",
|
|
230
230
|
"xia-zai-dao-ru-mo-ban": "Download Import Template",
|
|
@@ -252,36 +252,36 @@ var de = Object.create, Y = Object.defineProperty, fe = Object.getOwnPropertyDes
|
|
|
252
252
|
import: { versionMismatch: "Template version has been updated, please re-download the template" },
|
|
253
253
|
validate: { invalidInput: "Please enter valid content" },
|
|
254
254
|
tools: { keysLengthError: "Keys length must be greater than 2, default first two are label and value" }
|
|
255
|
-
},
|
|
256
|
-
zh_cn:
|
|
257
|
-
en_us:
|
|
258
|
-
},
|
|
259
|
-
function
|
|
255
|
+
}, we = {
|
|
256
|
+
zh_cn: Y,
|
|
257
|
+
en_us: X
|
|
258
|
+
}, Te = null;
|
|
259
|
+
function Ee(e = null) {
|
|
260
260
|
if (e) {
|
|
261
261
|
let { global: t } = e;
|
|
262
|
-
return t.messages.value?.zh_cn ? t.mergeLocaleMessage("zh_cn",
|
|
262
|
+
return t.messages.value?.zh_cn ? t.mergeLocaleMessage("zh_cn", Y) : t.setLocaleMessage("zh_cn", Y), t.messages.value?.en_us ? t.mergeLocaleMessage("en_us", X) : t.setLocaleMessage("en_us", X), Te = e, e;
|
|
263
263
|
}
|
|
264
|
-
return
|
|
264
|
+
return Te ||= oe({
|
|
265
265
|
legacy: !1,
|
|
266
266
|
locale: "zh_cn",
|
|
267
267
|
fallbackLocale: "zh_cn",
|
|
268
|
-
messages:
|
|
269
|
-
}),
|
|
270
|
-
}
|
|
271
|
-
function Oe() {
|
|
272
|
-
return Ee || De();
|
|
268
|
+
messages: we
|
|
269
|
+
}), Te;
|
|
273
270
|
}
|
|
274
271
|
function Z() {
|
|
275
|
-
return
|
|
272
|
+
return Te || Ee();
|
|
273
|
+
}
|
|
274
|
+
function Q() {
|
|
275
|
+
return Z().global.t;
|
|
276
276
|
}
|
|
277
|
-
|
|
278
|
-
async function
|
|
277
|
+
B.extend(Se.default), B.extend(Ce.default);
|
|
278
|
+
async function De(e, t) {
|
|
279
279
|
let { fields: n, range: r = 1 } = t;
|
|
280
280
|
if (!n) {
|
|
281
|
-
let e =
|
|
281
|
+
let e = Q();
|
|
282
282
|
throw Error(e("excel.fieldsMappingRequired"));
|
|
283
283
|
}
|
|
284
|
-
let i = new
|
|
284
|
+
let i = new z.Workbook();
|
|
285
285
|
await i.xlsx.load(e);
|
|
286
286
|
let a = {};
|
|
287
287
|
return i.eachSheet(function(e, t) {
|
|
@@ -297,41 +297,41 @@ async function ke(e, t) {
|
|
|
297
297
|
}), a[e._name] = i;
|
|
298
298
|
}), i = null, a;
|
|
299
299
|
}
|
|
300
|
-
var
|
|
301
|
-
async function
|
|
300
|
+
var Oe = { columnWidth: 30 };
|
|
301
|
+
async function ke(e, t, n = [], r = {}) {
|
|
302
302
|
if (!e || !t) return;
|
|
303
|
-
let { columnStyle: i } = r, { columnWidth: a } =
|
|
303
|
+
let { columnStyle: i } = r, { columnWidth: a } = Oe;
|
|
304
304
|
t.forEach((e) => {
|
|
305
305
|
e.width = e.width ? e.width : a;
|
|
306
306
|
});
|
|
307
|
-
let { workbook: o, worksheet: s } =
|
|
308
|
-
s.columns = t, s.addRows(n), i && await
|
|
307
|
+
let { workbook: o, worksheet: s } = Ae();
|
|
308
|
+
s.columns = t, s.addRows(n), i && await je(o, s, i);
|
|
309
309
|
try {
|
|
310
310
|
let t = await o.xlsx.writeBuffer();
|
|
311
|
-
|
|
311
|
+
R(new File([t], e, { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" }));
|
|
312
312
|
} catch (e) {
|
|
313
313
|
console.log(e);
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
|
-
function
|
|
317
|
-
let e = new
|
|
316
|
+
function Ae() {
|
|
317
|
+
let e = new z.Workbook();
|
|
318
318
|
return e.creator = "distributor System", e.lastModifiedBy = "distributor System", e.created = /* @__PURE__ */ new Date(), e.modified = /* @__PURE__ */ new Date(), e.lastPrinted = /* @__PURE__ */ new Date(), {
|
|
319
319
|
workbook: e,
|
|
320
320
|
worksheet: e.addWorksheet("Sheet1")
|
|
321
321
|
};
|
|
322
322
|
}
|
|
323
|
-
async function
|
|
323
|
+
async function je(e, t, n) {
|
|
324
324
|
let r = Object.keys(n);
|
|
325
325
|
for (let i of r) {
|
|
326
326
|
let r = n[i], { type: a } = r;
|
|
327
327
|
switch (a) {
|
|
328
328
|
case "IMG":
|
|
329
|
-
await
|
|
329
|
+
await Me(e, t, i, r);
|
|
330
330
|
break;
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
|
-
async function
|
|
334
|
+
async function Me(e, t, n, r) {
|
|
335
335
|
let i = t.getColumn(n), a = i.values;
|
|
336
336
|
t.getColumn(n).width = 20, t.eachRow((e, t) => {
|
|
337
337
|
t > 1 && (e.height = 40);
|
|
@@ -339,7 +339,7 @@ async function Pe(e, t, n, r) {
|
|
|
339
339
|
for (let n = 0, r = a.length; n < r; n++) {
|
|
340
340
|
if (n < 2) continue;
|
|
341
341
|
let r = a[n];
|
|
342
|
-
r && (t.getCell(i.letter + n).value = "", await
|
|
342
|
+
r && (t.getCell(i.letter + n).value = "", await Ne(e, t, r, {
|
|
343
343
|
width: 100,
|
|
344
344
|
height: 50,
|
|
345
345
|
col: i._number - 1,
|
|
@@ -347,8 +347,8 @@ async function Pe(e, t, n, r) {
|
|
|
347
347
|
}));
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
async function
|
|
351
|
-
let { col: i, row: a, width: o, height: s } = r, { success: c, base64: l } = await
|
|
350
|
+
async function Ne(e, t, n, r) {
|
|
351
|
+
let { col: i, row: a, width: o, height: s } = r, { success: c, base64: l } = await Pe(n, .3);
|
|
352
352
|
if (c) {
|
|
353
353
|
let n = e.addImage({
|
|
354
354
|
base64: l,
|
|
@@ -366,7 +366,7 @@ async function Fe(e, t, n, r) {
|
|
|
366
366
|
});
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
|
-
function
|
|
369
|
+
function Pe(e, t = 1) {
|
|
370
370
|
let n = new Image();
|
|
371
371
|
return n.setAttribute("crossOrigin", "anonymous"), n.crossOrigin = "anonymous", n.src = e, new Promise((e, r) => {
|
|
372
372
|
n.onload = () => {
|
|
@@ -380,14 +380,14 @@ function Ie(e, t = 1) {
|
|
|
380
380
|
};
|
|
381
381
|
});
|
|
382
382
|
}
|
|
383
|
-
var
|
|
384
|
-
async function
|
|
383
|
+
var Fe = "---";
|
|
384
|
+
async function Ie(e, t) {
|
|
385
385
|
let { fields: n, range: r = 1 } = t;
|
|
386
386
|
if (!n) {
|
|
387
|
-
let e =
|
|
387
|
+
let e = Q();
|
|
388
388
|
throw Error(e("excel.fieldsMappingRequired"));
|
|
389
389
|
}
|
|
390
|
-
let i = new
|
|
390
|
+
let i = new z.Workbook();
|
|
391
391
|
await i.xlsx.load(e);
|
|
392
392
|
let a = {};
|
|
393
393
|
return i.eachSheet(function(e, t) {
|
|
@@ -405,8 +405,8 @@ async function Re(e, t) {
|
|
|
405
405
|
if (i > r) {
|
|
406
406
|
let r = { _excelRowNumber: i }, a = !0;
|
|
407
407
|
Object.keys(o).forEach((t) => {
|
|
408
|
-
let [c, l] = o[t].split(
|
|
409
|
-
d = l == "image" && n ? s[`${i}_${u._column._number}`] || "" : u.result == null ? u.value?.richText ? u.value.richText.reduce((e, t) => e + t.text, "") : u.value?.hyperlink ? u.value.text || u.value.hyperlink : u.type == 4 && u.value ?
|
|
408
|
+
let [c, l] = o[t].split(Fe), u = e.getCell(c), d;
|
|
409
|
+
d = l == "image" && n ? s[`${i}_${u._column._number}`] || "" : u.result == null ? u.value?.richText ? u.value.richText.reduce((e, t) => e + t.text, "") : u.value?.hyperlink ? u.value.text || u.value.hyperlink : u.type == 4 && u.value ? B(u.value).utc().format("YYYY-MM-DD HH:mm:ss") : u.value : u.result, d && l == "option" && (d = d.split(Fe)[1]), r[t] = d, d && (a = !1);
|
|
410
410
|
}), a || t.push(r);
|
|
411
411
|
}
|
|
412
412
|
}), a[e._name] = t;
|
|
@@ -414,16 +414,16 @@ async function Re(e, t) {
|
|
|
414
414
|
}
|
|
415
415
|
}), i = null, a;
|
|
416
416
|
}
|
|
417
|
-
var
|
|
417
|
+
var Le = {
|
|
418
418
|
date: "yyyy-mm-dd",
|
|
419
419
|
number: "0",
|
|
420
420
|
string: "@"
|
|
421
421
|
};
|
|
422
|
-
async function
|
|
422
|
+
async function Re(e, t) {
|
|
423
423
|
if (!e || t.length == 0) return;
|
|
424
|
-
let n =
|
|
424
|
+
let n = ze(t);
|
|
425
425
|
for (let e of n.worksheets) {
|
|
426
|
-
let { columnWidth: r } =
|
|
426
|
+
let { columnWidth: r } = Oe, i = t[e.name];
|
|
427
427
|
if (!i) continue;
|
|
428
428
|
let { tableHeader: a, tableData: o } = i;
|
|
429
429
|
a.forEach((e) => {
|
|
@@ -437,11 +437,11 @@ async function Be(e, t) {
|
|
|
437
437
|
};
|
|
438
438
|
}), e.columns = a, e.addRows(o), a.forEach((t) => {
|
|
439
439
|
let { header: i, key: a, width: o, option: s, numFmt: c, locked: l, optionFormater: u } = t, d = e.getColumn(a);
|
|
440
|
-
if (d.numFmt =
|
|
440
|
+
if (d.numFmt = Le[c] || c, d.width = o || r, d.protection = { locked: l === !0 }, s) {
|
|
441
441
|
let t = n.addWorksheet(a);
|
|
442
|
-
t.state = "hidden", u ||= (e) => `${e.label}${
|
|
442
|
+
t.state = "hidden", u ||= (e) => `${e.label}${Fe}${e.value}`, t.getColumn(1).values = s.map(u), Array(100).fill("").forEach((t, n) => {
|
|
443
443
|
if (n > 0) {
|
|
444
|
-
let t =
|
|
444
|
+
let t = Q();
|
|
445
445
|
e.getCell(`${d.letter}${n}`).dataValidation = {
|
|
446
446
|
type: "list",
|
|
447
447
|
formulae: [`${a}!$A$1:$A$${s.length}`],
|
|
@@ -460,34 +460,34 @@ async function Be(e, t) {
|
|
|
460
460
|
}
|
|
461
461
|
try {
|
|
462
462
|
let t = await n.xlsx.writeBuffer();
|
|
463
|
-
|
|
463
|
+
R(new File([t], e, { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" }));
|
|
464
464
|
} catch (e) {
|
|
465
465
|
console.log(e);
|
|
466
466
|
}
|
|
467
467
|
}
|
|
468
|
-
function
|
|
469
|
-
let t =
|
|
468
|
+
function ze(e) {
|
|
469
|
+
let t = Q(), n = new z.Workbook();
|
|
470
470
|
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((t, n) => (e[t].sort ?? 0) - (e[n].sort ?? 0)).forEach((r) => {
|
|
471
471
|
let i = r, a = !1;
|
|
472
472
|
/[\\/:*?\[\]]/g.test(r) && (r = r.replace(/[\\/:*?\[\]]/g, ""), a = !0), r.length > 31 && (r = r.substring(0, 31).trim(), a = !0, console.warn(t("excel.sheetNameTooLong", [i, r]))), a && (e[r] = e[i], delete e[i]), n.addWorksheet(r);
|
|
473
473
|
}), n;
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function Be(e) {
|
|
476
476
|
return e < 26 ? String.fromCharCode(65 + e) : String.fromCharCode(65 + Math.floor((e - 26) / 26)) + String.fromCharCode(65 + (e - 26) % 26);
|
|
477
477
|
}
|
|
478
478
|
//#endregion
|
|
479
479
|
//#region src/utils/tools/tools.js
|
|
480
|
-
function
|
|
480
|
+
function Ve(e) {
|
|
481
481
|
return new Promise((t) => {
|
|
482
482
|
setTimeout(() => {
|
|
483
483
|
t();
|
|
484
484
|
}, e);
|
|
485
485
|
});
|
|
486
486
|
}
|
|
487
|
-
function
|
|
487
|
+
function He(e) {
|
|
488
488
|
return JSON.parse(JSON.stringify(e));
|
|
489
489
|
}
|
|
490
|
-
function
|
|
490
|
+
function Ue(e) {
|
|
491
491
|
let t = [], n = {}, r = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
|
|
492
492
|
for (let i of e) {
|
|
493
493
|
n[i.id] = {
|
|
@@ -499,10 +499,10 @@ function Ge(e) {
|
|
|
499
499
|
}
|
|
500
500
|
return t;
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function We(e, t = " ") {
|
|
503
503
|
return e ? e.split(t).filter((e) => e.trim()) : [];
|
|
504
504
|
}
|
|
505
|
-
var
|
|
505
|
+
var Ge = class {
|
|
506
506
|
constructor(e, t = [
|
|
507
507
|
"label",
|
|
508
508
|
"value",
|
|
@@ -517,7 +517,7 @@ var qe = class {
|
|
|
517
517
|
}
|
|
518
518
|
getName(e) {
|
|
519
519
|
if (!this.has(e)) return "-";
|
|
520
|
-
let t =
|
|
520
|
+
let t = Z().global.locale, { label: n, labelEn: r } = this.map.get(e);
|
|
521
521
|
return (t.value == "zh_cn" ? n : r) ?? n ?? "-";
|
|
522
522
|
}
|
|
523
523
|
getTag(e) {
|
|
@@ -537,49 +537,49 @@ var qe = class {
|
|
|
537
537
|
return this.map.has(e);
|
|
538
538
|
}
|
|
539
539
|
};
|
|
540
|
-
function
|
|
541
|
-
if (e.length == 0) return new
|
|
540
|
+
function Ke(e, t = [], n = "i18nName") {
|
|
541
|
+
if (e.length == 0) return new Ge([]);
|
|
542
542
|
if (t.length < 2) {
|
|
543
|
-
let e =
|
|
543
|
+
let e = Q();
|
|
544
544
|
throw Error(e("tools.keysLengthError"));
|
|
545
545
|
}
|
|
546
|
-
return new
|
|
546
|
+
return new Ge(e.map((e) => {
|
|
547
547
|
let r = {};
|
|
548
548
|
return n && (r.labelEn = e[n]), t.forEach((t, n) => {
|
|
549
549
|
n === 0 ? r.label = e[t] : n === 1 ? r.value = e[t] : r[t] = e[t];
|
|
550
550
|
}), r;
|
|
551
551
|
}));
|
|
552
552
|
}
|
|
553
|
-
function
|
|
553
|
+
function qe(e) {
|
|
554
554
|
return e ? e.replace(/<[^>]+>/g, "") : "";
|
|
555
555
|
}
|
|
556
|
-
function
|
|
556
|
+
function Je(e) {
|
|
557
557
|
return e ? (e.includes("\\\\u") && (e = e.replace(/\\/g, "")), e.replace(/\\u[\dA-F]{4}/gi, (e) => String.fromCharCode(parseInt(e.replace(/\\u/g, ""), 16)))) : "";
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function Ye(e, t = 10) {
|
|
560
560
|
let n = 1024 * 1024 * t;
|
|
561
561
|
return !(e.size > n);
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function Xe(e) {
|
|
564
564
|
return Array.from(10).fill(0).map((t, n) => e + "_" + n);
|
|
565
565
|
}
|
|
566
|
-
function
|
|
566
|
+
function Ze(e) {
|
|
567
567
|
let t = {};
|
|
568
568
|
return e.map((e, n) => {
|
|
569
|
-
let { key: r, option: i, type: a, optionFormater: o } = e, s =
|
|
569
|
+
let { key: r, option: i, type: a, optionFormater: o } = e, s = Be(n);
|
|
570
570
|
i && !o ? t[r] = `${s}---option` : a === "image" ? t[r] = `${s}---image` : t[r] = s;
|
|
571
571
|
}), t;
|
|
572
572
|
}
|
|
573
|
-
function
|
|
573
|
+
function Qe(e, t) {
|
|
574
574
|
if (!(!t || !e)) return t.split(".").reduce((e, t) => e?.[t], e);
|
|
575
575
|
}
|
|
576
576
|
//#endregion
|
|
577
577
|
//#region \0plugin-vue:export-helper
|
|
578
|
-
var
|
|
578
|
+
var $ = (e, t) => {
|
|
579
579
|
let n = e.__vccOpts || e;
|
|
580
580
|
for (let [e, r] of t) n[e] = r;
|
|
581
581
|
return n;
|
|
582
|
-
},
|
|
582
|
+
}, $e = ["onClick"], et = /* @__PURE__ */ $({
|
|
583
583
|
__name: "index",
|
|
584
584
|
props: /* @__PURE__ */ b({
|
|
585
585
|
api: { type: Function },
|
|
@@ -622,9 +622,9 @@ var Q = (e, t) => {
|
|
|
622
622
|
"changeAll"
|
|
623
623
|
], ["update:modelValue"]),
|
|
624
624
|
setup(e, { emit: t }) {
|
|
625
|
-
let n = e, r =
|
|
625
|
+
let n = e, r = te(), { t: i, locale: a } = V(), o = ne(e, "modelValue"), s = l(() => r["value-key"] != null), _ = A(""), v = l(() => {
|
|
626
626
|
if (r.remote !== void 0) return n.data;
|
|
627
|
-
let e =
|
|
627
|
+
let e = We(_.value), { data: t, labelValue: i } = n, o = t || C.value;
|
|
628
628
|
if (e.length == 0) return o;
|
|
629
629
|
let { label: s, labelEn: c } = i, l = a.value == "en_us" ? c || "i18nName" : s;
|
|
630
630
|
return e.length == 1 ? o.filter((t) => t[l].toLowerCase().includes(e[0].toLowerCase())) : o.filter((t) => {
|
|
@@ -658,7 +658,7 @@ var Q = (e, t) => {
|
|
|
658
658
|
function D(e) {
|
|
659
659
|
T.value = e;
|
|
660
660
|
}
|
|
661
|
-
let k = n.labelValue.label.split("-"),
|
|
661
|
+
let k = n.labelValue.label.split("-"), N = (e) => {
|
|
662
662
|
if (k.length == 1) {
|
|
663
663
|
if (n.changeLocal) return i(e[n.labelValue.label]);
|
|
664
664
|
let t = a.value == "en_us" ? e[n.labelValue.labelEn || "i18nName"] : e[n.labelValue.label];
|
|
@@ -670,70 +670,70 @@ var Q = (e, t) => {
|
|
|
670
670
|
}), t.join("-");
|
|
671
671
|
}
|
|
672
672
|
};
|
|
673
|
-
function
|
|
673
|
+
function L(e) {
|
|
674
674
|
let t = n.data ? n.data : C.value;
|
|
675
675
|
o.value = e ? t.map((e) => s.value ? e : e[n.labelValue.value]) : [], S(() => {
|
|
676
676
|
b("change", o.value), b("changeAll", o.value, t);
|
|
677
677
|
});
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function ie(e) {
|
|
680
680
|
b("change", s.value ? e : e[n.labelValue.value]), S(() => {
|
|
681
681
|
n.optionClick && n.optionClick(e);
|
|
682
682
|
});
|
|
683
683
|
}
|
|
684
|
-
function
|
|
684
|
+
function R(e) {
|
|
685
685
|
let t = s.value ? e : e[n.labelValue.value], r = s.value ? o.value.some((t) => t[n.labelValue.value] === e[n.labelValue.value]) : o.value.includes(t);
|
|
686
686
|
return !!(n.maxLimit > 0 && o.value.length >= n.maxLimit && !r || n.minLimit > 0 && o.value.length === n.minLimit && r);
|
|
687
687
|
}
|
|
688
|
-
function
|
|
688
|
+
function z(e) {
|
|
689
689
|
return e.map((e) => ({
|
|
690
690
|
...e,
|
|
691
|
-
label:
|
|
691
|
+
label: N(e),
|
|
692
692
|
value: s.value ? e : e[n.labelValue.value]
|
|
693
693
|
}));
|
|
694
694
|
}
|
|
695
|
-
let
|
|
696
|
-
|
|
697
|
-
let t =
|
|
698
|
-
if (t.length !==
|
|
695
|
+
let B = A([]);
|
|
696
|
+
B.value = z(n.data ? n.data : C.value), re(() => n.data ? n.data : C.value, (e) => {
|
|
697
|
+
let t = z(e);
|
|
698
|
+
if (t.length !== B.value.length) B.value = t;
|
|
699
699
|
else {
|
|
700
700
|
let e = !1;
|
|
701
|
-
for (let n = 0; n < t.length; n++) if (t[n].value !==
|
|
701
|
+
for (let n = 0; n < t.length; n++) if (t[n].value !== B.value[n]?.value) {
|
|
702
702
|
e = !0;
|
|
703
703
|
break;
|
|
704
704
|
}
|
|
705
|
-
e && (
|
|
705
|
+
e && (B.value = t);
|
|
706
706
|
}
|
|
707
707
|
}, { deep: !0 });
|
|
708
|
-
let
|
|
708
|
+
let oe = l(() => r.multiple !== void 0 && (n.maxLimit > 0 || n.minLimit > 0) ? B.value.map((e) => ({
|
|
709
709
|
...e,
|
|
710
|
-
disabled:
|
|
711
|
-
})) :
|
|
710
|
+
disabled: R(e)
|
|
711
|
+
})) : B.value);
|
|
712
712
|
return (t, n) => {
|
|
713
|
-
let i =
|
|
714
|
-
return
|
|
713
|
+
let i = M("el-checkbox"), a = M("el-select-v2"), l = M("el-option"), b = M("el-select");
|
|
714
|
+
return F(r).v2 == null ? (O(), u(b, x({
|
|
715
715
|
key: 1,
|
|
716
716
|
modelValue: o.value,
|
|
717
717
|
"onUpdate:modelValue": n[3] ||= (e) => o.value = e,
|
|
718
718
|
filterable: "",
|
|
719
719
|
"collapse-tags": "",
|
|
720
720
|
"collapse-tags-tooltip": "",
|
|
721
|
-
"filter-method":
|
|
721
|
+
"filter-method": F(r).remote == null ? (e) => _.value = e : void 0,
|
|
722
722
|
clearable: ""
|
|
723
|
-
},
|
|
724
|
-
default:
|
|
723
|
+
}, F(r), { onClear: E }), {
|
|
724
|
+
default: I(() => [F(r).multiple != null && e.showCheckAll && e.maxLimit == null ? j(t.$slots, "header", { key: 0 }, () => [g(i, {
|
|
725
725
|
class: "mgl20",
|
|
726
726
|
modelValue: y.value,
|
|
727
727
|
"onUpdate:modelValue": n[2] ||= (e) => y.value = e,
|
|
728
|
-
onChange:
|
|
728
|
+
onChange: L
|
|
729
729
|
}, {
|
|
730
|
-
default:
|
|
730
|
+
default: I(() => [h(P(t.$t("quan-xuan")), 1)]),
|
|
731
731
|
_: 1
|
|
732
|
-
}, 8, ["modelValue"])], !0) : d("", !0), (O(!0), f(c, null,
|
|
732
|
+
}, 8, ["modelValue"])], !0) : d("", !0), (O(!0), f(c, null, ee(v.value, (t, n) => (O(), u(l, {
|
|
733
733
|
key: n,
|
|
734
|
-
label:
|
|
735
|
-
disabled:
|
|
736
|
-
onClick:
|
|
734
|
+
label: N(t),
|
|
735
|
+
disabled: F(r).multiple != null && (e.maxLimit > 0 || e.minLimit > 0) ? R(t) : !1,
|
|
736
|
+
onClick: ae((e) => ie(t), ["stop"]),
|
|
737
737
|
value: s.value ? t : t[e.labelValue.value]
|
|
738
738
|
}, null, 8, [
|
|
739
739
|
"label",
|
|
@@ -744,66 +744,66 @@ var Q = (e, t) => {
|
|
|
744
744
|
_: 3
|
|
745
745
|
}, 16, ["modelValue", "filter-method"])) : (O(), u(a, x({
|
|
746
746
|
key: 0,
|
|
747
|
-
options:
|
|
747
|
+
options: oe.value,
|
|
748
748
|
modelValue: o.value,
|
|
749
749
|
"onUpdate:modelValue": n[1] ||= (e) => o.value = e
|
|
750
|
-
},
|
|
750
|
+
}, F(r), {
|
|
751
751
|
filterable: "",
|
|
752
752
|
"collapse-tags": "",
|
|
753
753
|
"collapse-tags-tooltip": "",
|
|
754
754
|
clearable: "",
|
|
755
755
|
onChange: w
|
|
756
756
|
}), m({
|
|
757
|
-
default:
|
|
757
|
+
default: I(({ item: e }) => [p("div", { onClick: (t) => D(e) }, P(e.label), 9, $e)]),
|
|
758
758
|
_: 2
|
|
759
|
-
}, [
|
|
759
|
+
}, [F(r).multiple == null ? void 0 : {
|
|
760
760
|
name: "header",
|
|
761
|
-
fn:
|
|
761
|
+
fn: I(() => [j(t.$slots, "header", {}, () => [g(i, {
|
|
762
762
|
class: "mgl20",
|
|
763
763
|
modelValue: y.value,
|
|
764
764
|
"onUpdate:modelValue": n[0] ||= (e) => y.value = e,
|
|
765
|
-
onChange:
|
|
765
|
+
onChange: L
|
|
766
766
|
}, {
|
|
767
|
-
default:
|
|
767
|
+
default: I(() => [h(P(t.$t("quan-xuan")), 1)]),
|
|
768
768
|
_: 1
|
|
769
769
|
}, 8, ["modelValue"])], !0)]),
|
|
770
770
|
key: "0"
|
|
771
771
|
}]), 1040, ["options", "modelValue"]));
|
|
772
772
|
};
|
|
773
773
|
}
|
|
774
|
-
}, [["__scopeId", "data-v-7b9ec6d8"]]),
|
|
774
|
+
}, [["__scopeId", "data-v-7b9ec6d8"]]), tt = _({ props: { name: {
|
|
775
775
|
tyepe: String,
|
|
776
776
|
required: !0
|
|
777
777
|
} } });
|
|
778
|
-
function
|
|
779
|
-
let o =
|
|
778
|
+
function nt(e, t, n, r, i, a) {
|
|
779
|
+
let o = M("el-icon");
|
|
780
780
|
return O(), u(o, { class: "cmp-icon" }, {
|
|
781
|
-
default:
|
|
781
|
+
default: I(() => [(O(), u(N(e.name)))]),
|
|
782
782
|
_: 1
|
|
783
783
|
});
|
|
784
784
|
}
|
|
785
|
-
var
|
|
785
|
+
var rt = /* @__PURE__ */ $(tt, [["render", nt], ["__scopeId", "data-v-733f9daa"]]), it = { class: "confirm-button-wrapper" }, at = /* @__PURE__ */ $({
|
|
786
786
|
__name: "index",
|
|
787
787
|
emits: ["ok", "no"],
|
|
788
788
|
setup(e, { emit: t }) {
|
|
789
|
-
let n = t, r =
|
|
789
|
+
let n = t, r = ce(() => {
|
|
790
790
|
n("ok");
|
|
791
791
|
}, 500);
|
|
792
792
|
function i() {
|
|
793
793
|
n("no");
|
|
794
794
|
}
|
|
795
795
|
return (e, t) => {
|
|
796
|
-
let n =
|
|
797
|
-
return O(), f("span",
|
|
798
|
-
onConfirm:
|
|
796
|
+
let n = M("el-popconfirm");
|
|
797
|
+
return O(), f("span", it, [g(n, x(e.$attrs, {
|
|
798
|
+
onConfirm: F(r),
|
|
799
799
|
onCancel: i
|
|
800
800
|
}), {
|
|
801
|
-
reference:
|
|
801
|
+
reference: I(() => [j(e.$slots, "default", {}, void 0, !0)]),
|
|
802
802
|
_: 3
|
|
803
803
|
}, 16, ["onConfirm"])]);
|
|
804
804
|
};
|
|
805
805
|
}
|
|
806
|
-
}, [["__scopeId", "data-v-24cb35fd"]]),
|
|
806
|
+
}, [["__scopeId", "data-v-24cb35fd"]]), ot = { class: "ImportButton" }, st = ["accept"], ct = /* @__PURE__ */ $({
|
|
807
807
|
__name: "index",
|
|
808
808
|
props: {
|
|
809
809
|
accept: {
|
|
@@ -824,7 +824,7 @@ var at = /* @__PURE__ */ Q(rt, [["render", it], ["__scopeId", "data-v-733f9daa"]
|
|
|
824
824
|
}
|
|
825
825
|
},
|
|
826
826
|
setup(e) {
|
|
827
|
-
let { t } =
|
|
827
|
+
let { t } = V(), n = e, r = A(null), a = A(!1);
|
|
828
828
|
function o(e) {
|
|
829
829
|
let t = e.match(/__v(\d+)/);
|
|
830
830
|
return t ? parseInt(t[1], 10) : null;
|
|
@@ -839,7 +839,7 @@ var at = /* @__PURE__ */ Q(rt, [["render", it], ["__scopeId", "data-v-733f9daa"]
|
|
|
839
839
|
return;
|
|
840
840
|
}
|
|
841
841
|
}
|
|
842
|
-
let c = await
|
|
842
|
+
let c = await Ie(s, n.fields).catch(() => {
|
|
843
843
|
a.value = !1;
|
|
844
844
|
}).finally(() => {
|
|
845
845
|
r.value.value = null;
|
|
@@ -849,14 +849,14 @@ var at = /* @__PURE__ */ Q(rt, [["render", it], ["__scopeId", "data-v-733f9daa"]
|
|
|
849
849
|
});
|
|
850
850
|
}
|
|
851
851
|
return (t, n) => {
|
|
852
|
-
let i =
|
|
853
|
-
return O(), f("div",
|
|
852
|
+
let i = M("el-button");
|
|
853
|
+
return O(), f("div", ot, [g(i, x({
|
|
854
854
|
type: "primary",
|
|
855
855
|
loading: a.value,
|
|
856
856
|
class: "mgr10",
|
|
857
857
|
onClick: n[0] ||= (e) => r.value.click()
|
|
858
858
|
}, t.$attrs), {
|
|
859
|
-
default:
|
|
859
|
+
default: I(() => [j(t.$slots, "default", {}, () => [h(P(t.$t("dao-ru")), 1)], !0)]),
|
|
860
860
|
_: 3
|
|
861
861
|
}, 16, ["loading"]), p("input", {
|
|
862
862
|
onChange: s,
|
|
@@ -870,27 +870,27 @@ var at = /* @__PURE__ */ Q(rt, [["render", it], ["__scopeId", "data-v-733f9daa"]
|
|
|
870
870
|
opacity: "0"
|
|
871
871
|
},
|
|
872
872
|
type: "file"
|
|
873
|
-
}, null, 40,
|
|
873
|
+
}, null, 40, st)]);
|
|
874
874
|
};
|
|
875
875
|
}
|
|
876
876
|
}, [["__scopeId", "data-v-b8f856ea"]]);
|
|
877
877
|
//#endregion
|
|
878
878
|
//#region src/components/SearchBar/tools.js
|
|
879
|
-
function
|
|
879
|
+
function lt(e) {
|
|
880
880
|
let t = {};
|
|
881
881
|
return e.forEach((e) => {
|
|
882
882
|
let { key: n, type: r, option: i = {}, value: a, dateType: o = "date" } = e;
|
|
883
|
-
if (n) if (r == "input" && i?.multiple) t[n] =
|
|
883
|
+
if (n) if (r == "input" && i?.multiple) t[n] = We(a);
|
|
884
884
|
else if (r == "date") if (o.includes("range")) {
|
|
885
885
|
let [e, r] = n, [i, s] = a || [];
|
|
886
|
-
i && o == "daterange" && (i =
|
|
886
|
+
i && o == "daterange" && (i = B(i).format("YYYY-MM-DD 00:00:00"), s = B(s).format("YYYY-MM-DD 23:59:59")), t[e] = i, t[r] = s;
|
|
887
887
|
} else t[n] = a;
|
|
888
888
|
else t[n] = a;
|
|
889
889
|
}), t;
|
|
890
890
|
}
|
|
891
891
|
//#endregion
|
|
892
892
|
//#region src/components/SearchBar/index.vue
|
|
893
|
-
var
|
|
893
|
+
var ut = { key: 0 }, dt = { class: "btns" }, ft = { class: "left" }, pt = { class: "right" }, mt = /* @__PURE__ */ $({
|
|
894
894
|
__name: "index",
|
|
895
895
|
props: { form: {
|
|
896
896
|
type: Object,
|
|
@@ -902,7 +902,7 @@ var ft = { key: 0 }, pt = { class: "btns" }, mt = { class: "left" }, ht = { clas
|
|
|
902
902
|
"visibleChange"
|
|
903
903
|
],
|
|
904
904
|
setup(e, { expose: t, emit: n }) {
|
|
905
|
-
let r = e, i = n, a = A(!0), o = A(null), { t: s } =
|
|
905
|
+
let r = e, i = n, a = A(!0), o = A(null), { t: s } = V(), m = {
|
|
906
906
|
datetimerange: "YYYY-MM-DD HH:mm:ss",
|
|
907
907
|
daterange: "YYYY-MM-DD",
|
|
908
908
|
month: "YYYY-MM"
|
|
@@ -920,9 +920,9 @@ var ft = { key: 0 }, pt = { class: "btns" }, mt = { class: "left" }, ht = { clas
|
|
|
920
920
|
i("confirm");
|
|
921
921
|
}
|
|
922
922
|
function T() {
|
|
923
|
-
return
|
|
923
|
+
return lt(r.form.items);
|
|
924
924
|
}
|
|
925
|
-
let E =
|
|
925
|
+
let E = se(r.form.items);
|
|
926
926
|
function D() {
|
|
927
927
|
r.form.items.forEach((e) => {
|
|
928
928
|
let t = E.find((t) => t.key == e.key);
|
|
@@ -933,10 +933,10 @@ var ft = { key: 0 }, pt = { class: "btns" }, mt = { class: "left" }, ht = { clas
|
|
|
933
933
|
getPrm: T,
|
|
934
934
|
reset: D
|
|
935
935
|
}), (t, n) => {
|
|
936
|
-
let r =
|
|
936
|
+
let r = M("el-input"), s = M("el-date-picker"), l = M("el-form-item"), T = M("el-form"), E = M("el-link"), D = M("el-button");
|
|
937
937
|
return O(), f("div", {
|
|
938
938
|
class: "searchBar-container mgt10 mgb10",
|
|
939
|
-
onKeydown:
|
|
939
|
+
onKeydown: ie(v, ["enter"])
|
|
940
940
|
}, [p("div", {
|
|
941
941
|
class: "searchBar",
|
|
942
942
|
style: w({ height: a.value ? "auto" : "32px" })
|
|
@@ -944,11 +944,11 @@ var ft = { key: 0 }, pt = { class: "btns" }, mt = { class: "left" }, ht = { clas
|
|
|
944
944
|
inline: "",
|
|
945
945
|
model: e.form.data
|
|
946
946
|
}, {
|
|
947
|
-
default:
|
|
947
|
+
default: I(() => [(O(!0), f(c, null, ee(e.form.items.filter((e) => !e.hidden), (e) => (O(), f(c, { key: e.key }, [e.type == "br" ? (O(), f("br", ut)) : (O(), u(l, {
|
|
948
948
|
key: 1,
|
|
949
949
|
label: e.name
|
|
950
950
|
}, {
|
|
951
|
-
default:
|
|
951
|
+
default: I(() => [
|
|
952
952
|
e.type === "input" ? (O(), u(r, {
|
|
953
953
|
key: 0,
|
|
954
954
|
modelValue: e.value,
|
|
@@ -961,8 +961,8 @@ var ft = { key: 0 }, pt = { class: "btns" }, mt = { class: "left" }, ht = { clas
|
|
|
961
961
|
"onUpdate:modelValue",
|
|
962
962
|
"class",
|
|
963
963
|
"placeholder"
|
|
964
|
-
])) : e.type === "custom" ? (O(), u(
|
|
965
|
-
e.type === "select" ? (O(), u(
|
|
964
|
+
])) : e.type === "custom" ? (O(), u(N(e.render), { key: 1 })) : d("", !0),
|
|
965
|
+
e.type === "select" ? (O(), u(et, x({
|
|
966
966
|
key: 2,
|
|
967
967
|
class: e.option?.class || "w150",
|
|
968
968
|
modelValue: e.value,
|
|
@@ -1009,7 +1009,7 @@ var ft = { key: 0 }, pt = { class: "btns" }, mt = { class: "left" }, ht = { clas
|
|
|
1009
1009
|
_: 2
|
|
1010
1010
|
}, 1032, ["label"]))], 64))), 128))]),
|
|
1011
1011
|
_: 1
|
|
1012
|
-
}, 8, ["model"])], 4), p("div",
|
|
1012
|
+
}, 8, ["model"])], 4), p("div", dt, [p("div", ft, [j(t.$slots, "table-header-left", {}, void 0, !0)]), p("div", pt, [
|
|
1013
1013
|
g(E, {
|
|
1014
1014
|
underline: "never",
|
|
1015
1015
|
class: "mgr10",
|
|
@@ -1017,28 +1017,28 @@ var ft = { key: 0 }, pt = { class: "btns" }, mt = { class: "left" }, ht = { clas
|
|
|
1017
1017
|
i("visibleChange", !a.value), a.value = !a.value;
|
|
1018
1018
|
}
|
|
1019
1019
|
}, {
|
|
1020
|
-
default:
|
|
1020
|
+
default: I(() => [g(rt, { name: a.value ? "ArrowUp" : "ArrowDown" }, null, 8, ["name"]), h(" " + P(_.value), 1)]),
|
|
1021
1021
|
_: 1
|
|
1022
1022
|
}),
|
|
1023
1023
|
g(D, {
|
|
1024
1024
|
type: "primary",
|
|
1025
1025
|
onClick: v
|
|
1026
1026
|
}, {
|
|
1027
|
-
default:
|
|
1027
|
+
default: I(() => [h(P(t.$t("shai-xuan")), 1)]),
|
|
1028
1028
|
_: 1
|
|
1029
1029
|
}),
|
|
1030
1030
|
g(D, {
|
|
1031
1031
|
type: "primary",
|
|
1032
1032
|
onClick: b
|
|
1033
1033
|
}, {
|
|
1034
|
-
default:
|
|
1034
|
+
default: I(() => [h(P(t.$t("chong-zhi")), 1)]),
|
|
1035
1035
|
_: 1
|
|
1036
1036
|
}),
|
|
1037
|
-
|
|
1037
|
+
j(t.$slots, "btn", {}, void 0, !0)
|
|
1038
1038
|
])])], 32);
|
|
1039
1039
|
};
|
|
1040
1040
|
}
|
|
1041
|
-
}, [["__scopeId", "data-v-db6f71dd"]]),
|
|
1041
|
+
}, [["__scopeId", "data-v-db6f71dd"]]), ht = {
|
|
1042
1042
|
pageNoKey: "pageNo",
|
|
1043
1043
|
pageSizeKey: "pageSize",
|
|
1044
1044
|
totalKey: "total",
|
|
@@ -1062,26 +1062,26 @@ var ft = { key: 0 }, pt = { class: "btns" }, mt = { class: "left" }, ht = { clas
|
|
|
1062
1062
|
showShadow: !1,
|
|
1063
1063
|
showCheckBox: !1,
|
|
1064
1064
|
enableCellCopy: !0
|
|
1065
|
-
},
|
|
1066
|
-
function
|
|
1067
|
-
|
|
1068
|
-
|
|
1065
|
+
}, gt = { ...ht };
|
|
1066
|
+
function _t(e) {
|
|
1067
|
+
gt = {
|
|
1068
|
+
...gt,
|
|
1069
1069
|
...e,
|
|
1070
1070
|
responseDataKeys: {
|
|
1071
|
-
|
|
1071
|
+
...gt.responseDataKeys,
|
|
1072
1072
|
...e.responseDataKeys || {}
|
|
1073
1073
|
}
|
|
1074
1074
|
};
|
|
1075
1075
|
}
|
|
1076
|
-
function
|
|
1077
|
-
return
|
|
1076
|
+
function vt() {
|
|
1077
|
+
return gt;
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1080
|
-
|
|
1079
|
+
function yt() {
|
|
1080
|
+
gt = { ...ht };
|
|
1081
1081
|
}
|
|
1082
1082
|
//#endregion
|
|
1083
1083
|
//#region src/components/ListPage/index.vue
|
|
1084
|
-
var
|
|
1084
|
+
var bt = { class: "center" }, xt = 0, St = 20, Ct = .3, wt = /* @__PURE__ */ $({
|
|
1085
1085
|
__name: "index",
|
|
1086
1086
|
props: {
|
|
1087
1087
|
id: {
|
|
@@ -1111,124 +1111,128 @@ var xt = { class: "center" }, St = /* @__PURE__ */ Q({
|
|
|
1111
1111
|
}
|
|
1112
1112
|
},
|
|
1113
1113
|
setup(e, { expose: t }) {
|
|
1114
|
-
let { t: n, locale: r } =
|
|
1115
|
-
|
|
1116
|
-
let
|
|
1117
|
-
let e =
|
|
1118
|
-
return
|
|
1119
|
-
}),
|
|
1120
|
-
[
|
|
1121
|
-
[
|
|
1114
|
+
let { t: n, locale: r } = V(), i = vt(), a = e, o = A(!1), s = A([]);
|
|
1115
|
+
a.searchForm.showSearch === void 0 && (a.searchForm.showSearch = i.showSearch), a.searchForm.showPage === void 0 && (a.searchForm.showPage = i.showPage), a.searchForm.showShadow === void 0 && (a.searchForm.showShadow = i.showShadow), a.searchForm.showCheckBox === void 0 && (a.searchForm.showCheckBox = i.showCheckBox), a.searchForm.enableCellCopy === void 0 && (a.searchForm.enableCellCopy = i.enableCellCopy), a.searchForm.selections || (a.searchForm.selections = []);
|
|
1116
|
+
let c = l(() => {
|
|
1117
|
+
let e = "default-table";
|
|
1118
|
+
return a.id ? `listPageId-${e}-${a.id}` : `listPageId-${e}`;
|
|
1119
|
+
}), m = se(a.searchForm.items), _ = a.searchForm.pageNoKey || i.pageNoKey, v = a.searchForm.pageSizeKey || i.pageSizeKey, y = k({
|
|
1120
|
+
[_]: 1,
|
|
1121
|
+
[v]: a.searchForm.defaultPageSize || i.defaultPageSize,
|
|
1122
1122
|
total: 0
|
|
1123
|
-
}),
|
|
1123
|
+
}), b = A(null), w = A(null), ee = A(450), N = ce(() => {
|
|
1124
1124
|
S(() => {
|
|
1125
|
-
if (!
|
|
1126
|
-
let e =
|
|
1127
|
-
|
|
1125
|
+
if (!w.value) return;
|
|
1126
|
+
let e = w.value.getBoundingClientRect(), t = window.innerHeight - e.top - 100;
|
|
1127
|
+
ee.value = Math.max(t, 200);
|
|
1128
1128
|
});
|
|
1129
|
-
}, 100),
|
|
1130
|
-
|
|
1131
|
-
},
|
|
1132
|
-
if (!
|
|
1133
|
-
let e =
|
|
1129
|
+
}, 100), te = () => {
|
|
1130
|
+
N();
|
|
1131
|
+
}, ne = () => {
|
|
1132
|
+
if (!a.searchForm.enableCellCopy && !i.enableCellCopy) return !1;
|
|
1133
|
+
let e = b.value;
|
|
1134
1134
|
if (!e || !e.$el) return !1;
|
|
1135
1135
|
let t = e.$el;
|
|
1136
|
-
|
|
1136
|
+
t.classList.add("cell-copy-enabled"), t.setAttribute("tabindex", "-1"), t.removeEventListener("mousedown", ge), t.removeEventListener("mousemove", _e), t.removeEventListener("mouseup", q), t.removeEventListener("keydown", Ce), t.addEventListener("mousedown", ge), t.addEventListener("mousemove", _e), t.addEventListener("mouseup", q), t.addEventListener("keydown", Ce);
|
|
1137
|
+
let n = t.querySelector(".vxe-table--body-inner-wrapper");
|
|
1138
|
+
return n && !n.__cellCopyScrollBound && (n.addEventListener("scroll", xe), n.__cellCopyScrollBound = !0), !0;
|
|
1137
1139
|
};
|
|
1138
1140
|
T(() => {
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
+
N(), window.addEventListener("resize", te), (a.searchForm.enableCellCopy || i.enableCellCopy) && (document.addEventListener("mouseup", Y), document.addEventListener("mousedown", X), setTimeout(() => {
|
|
1142
|
+
ne();
|
|
1141
1143
|
}, 500));
|
|
1142
1144
|
}), D(() => {
|
|
1143
|
-
(
|
|
1144
|
-
|
|
1145
|
+
(a.searchForm.enableCellCopy || i.enableCellCopy) && setTimeout(() => {
|
|
1146
|
+
ne();
|
|
1145
1147
|
}, 500);
|
|
1146
1148
|
}), E(() => {
|
|
1147
|
-
if (window.removeEventListener("resize",
|
|
1148
|
-
document.removeEventListener("mouseup",
|
|
1149
|
-
let e =
|
|
1149
|
+
if (window.removeEventListener("resize", te), a.searchForm.enableCellCopy || i.enableCellCopy) {
|
|
1150
|
+
document.removeEventListener("mouseup", Y), document.removeEventListener("mousedown", X), document.removeEventListener("mousemove", G), K(), J && cancelAnimationFrame(J);
|
|
1151
|
+
let e = b.value;
|
|
1150
1152
|
if (e && e.$el) {
|
|
1151
1153
|
let t = e.$el;
|
|
1152
|
-
t.removeEventListener("mousedown",
|
|
1154
|
+
t.removeEventListener("mousedown", ge), t.removeEventListener("mousemove", _e), t.removeEventListener("mouseup", q), t.removeEventListener("keydown", Ce);
|
|
1155
|
+
let n = t.querySelector(".vxe-table--body-inner-wrapper");
|
|
1156
|
+
n && (n.removeEventListener("scroll", xe), n.__cellCopyScrollBound = !1);
|
|
1153
1157
|
}
|
|
1154
1158
|
}
|
|
1155
1159
|
});
|
|
1156
|
-
let
|
|
1157
|
-
async function
|
|
1158
|
-
let t =
|
|
1159
|
-
e[
|
|
1160
|
-
let { code: r, data:
|
|
1161
|
-
|
|
1160
|
+
let re = l(() => fe.value.height || ee.value), L;
|
|
1161
|
+
async function ie(e) {
|
|
1162
|
+
let t = a.searchForm.responseDataKeys || i.responseDataKeys, { dataFormat: n } = a.tableConfig;
|
|
1163
|
+
e[_] != 1 && (e.nextSearchAfter = L), o.value = !0;
|
|
1164
|
+
let { code: r, data: c = {} } = await a.api(e).finally(() => {
|
|
1165
|
+
o.value = !1, a.searchForm.selections = [];
|
|
1162
1166
|
});
|
|
1163
1167
|
if (r == 200) {
|
|
1164
|
-
|
|
1168
|
+
a.searchForm?.apiCallBack?.({
|
|
1165
1169
|
code: r,
|
|
1166
|
-
data:
|
|
1170
|
+
data: c
|
|
1167
1171
|
});
|
|
1168
1172
|
let e = [];
|
|
1169
1173
|
for (let n of t.rows) {
|
|
1170
|
-
let t =
|
|
1174
|
+
let t = Qe(c, n);
|
|
1171
1175
|
if (t) {
|
|
1172
1176
|
e = t;
|
|
1173
1177
|
break;
|
|
1174
1178
|
}
|
|
1175
1179
|
}
|
|
1176
|
-
let
|
|
1180
|
+
let o = 0;
|
|
1177
1181
|
for (let e of t.total) {
|
|
1178
|
-
let t =
|
|
1182
|
+
let t = Qe(c, e);
|
|
1179
1183
|
if (t !== void 0) {
|
|
1180
|
-
|
|
1184
|
+
o = t;
|
|
1181
1185
|
break;
|
|
1182
1186
|
}
|
|
1183
1187
|
}
|
|
1184
|
-
|
|
1188
|
+
s.value = n ? n(e) : e, y.total = o, L = c.nextSearchAfter, (a.searchForm.enableCellCopy || i.enableCellCopy) && S(() => {
|
|
1185
1189
|
setTimeout(() => {
|
|
1186
|
-
|
|
1190
|
+
ne();
|
|
1187
1191
|
}, 100);
|
|
1188
1192
|
});
|
|
1189
1193
|
}
|
|
1190
1194
|
}
|
|
1191
|
-
function
|
|
1192
|
-
let { searchData: t = () => ({}) } =
|
|
1193
|
-
|
|
1194
|
-
...
|
|
1195
|
-
...
|
|
1195
|
+
function R(e = {}) {
|
|
1196
|
+
let { searchData: t = () => ({}) } = a.tableConfig, n = t();
|
|
1197
|
+
ie({
|
|
1198
|
+
...y,
|
|
1199
|
+
...lt(a.searchForm.items),
|
|
1196
1200
|
...e,
|
|
1197
1201
|
...n
|
|
1198
1202
|
});
|
|
1199
1203
|
}
|
|
1200
|
-
function
|
|
1201
|
-
let { reset: e } =
|
|
1202
|
-
e && e(),
|
|
1203
|
-
let t =
|
|
1204
|
+
function z() {
|
|
1205
|
+
let { reset: e } = a.tableConfig;
|
|
1206
|
+
e && e(), a.searchForm.items.forEach((e) => {
|
|
1207
|
+
let t = m.find((t) => le(e.key) && le(t.key) ? e.key.join(",") == t.key.join(",") : t.key == e.key);
|
|
1204
1208
|
t && (e.value = t.value);
|
|
1205
|
-
}),
|
|
1209
|
+
}), R();
|
|
1206
1210
|
}
|
|
1207
|
-
|
|
1208
|
-
function
|
|
1211
|
+
a.api && a.immediate && R();
|
|
1212
|
+
function B() {
|
|
1209
1213
|
return {
|
|
1210
|
-
...
|
|
1211
|
-
...
|
|
1214
|
+
...y,
|
|
1215
|
+
...lt(a.searchForm.items)
|
|
1212
1216
|
};
|
|
1213
1217
|
}
|
|
1214
|
-
let
|
|
1215
|
-
let e =
|
|
1218
|
+
let oe = () => {
|
|
1219
|
+
let e = b.value;
|
|
1216
1220
|
e && e.clearSort();
|
|
1217
|
-
},
|
|
1221
|
+
}, ue = k({ storage: !0 }), de = k({
|
|
1218
1222
|
drag: !0,
|
|
1219
1223
|
resizable: !0,
|
|
1220
1224
|
maxFixedSize: 0
|
|
1221
|
-
}),
|
|
1222
|
-
let { customConfig: e, columnConfig: t, ...n } =
|
|
1225
|
+
}), fe = l(() => {
|
|
1226
|
+
let { customConfig: e, columnConfig: t, ...n } = a.tableConfig;
|
|
1223
1227
|
return {
|
|
1224
1228
|
headerAlign: "left",
|
|
1225
1229
|
align: "center",
|
|
1226
1230
|
customConfig: {
|
|
1227
|
-
...
|
|
1231
|
+
...ue,
|
|
1228
1232
|
...e
|
|
1229
1233
|
},
|
|
1230
1234
|
columnConfig: {
|
|
1231
|
-
...
|
|
1235
|
+
...de,
|
|
1232
1236
|
...t
|
|
1233
1237
|
},
|
|
1234
1238
|
"virtual-x-config": {
|
|
@@ -1241,36 +1245,39 @@ var xt = { class: "center" }, St = /* @__PURE__ */ Q({
|
|
|
1241
1245
|
},
|
|
1242
1246
|
...n
|
|
1243
1247
|
};
|
|
1244
|
-
}),
|
|
1248
|
+
}), H = k({
|
|
1245
1249
|
isSelecting: !1,
|
|
1246
1250
|
startCell: null,
|
|
1247
1251
|
endCell: null,
|
|
1248
1252
|
selectedCells: []
|
|
1249
|
-
}),
|
|
1253
|
+
}), pe = (e) => {
|
|
1250
1254
|
let t = e.closest(".vxe-body--column");
|
|
1251
1255
|
if (!t || t.classList.contains("col--checkbox") || t.classList.contains("col--seq")) return null;
|
|
1252
1256
|
let n = t.closest(".vxe-body--row");
|
|
1253
1257
|
if (!n) return null;
|
|
1254
|
-
let r =
|
|
1258
|
+
let r = b.value;
|
|
1255
1259
|
if (!r) return null;
|
|
1256
|
-
let i = -1,
|
|
1257
|
-
if (
|
|
1258
|
-
|
|
1260
|
+
let i = -1, o = n.getAttribute("rowid");
|
|
1261
|
+
if (o != null) {
|
|
1262
|
+
let e = r.getRowById(o);
|
|
1263
|
+
e && (i = r.getTableData().fullData.indexOf(e));
|
|
1264
|
+
}
|
|
1265
|
+
if (i < 0) {
|
|
1259
1266
|
let e = n.parentElement;
|
|
1260
1267
|
i = Array.from(e.querySelectorAll(".vxe-body--row")).indexOf(n);
|
|
1261
1268
|
}
|
|
1262
1269
|
if (i < 0) return null;
|
|
1263
|
-
let s = -1, c = t.getAttribute("
|
|
1270
|
+
let s = -1, c = t.getAttribute("colid");
|
|
1264
1271
|
if (c && (s = r.getColumns().findIndex((e) => e.id === c)), s < 0) {
|
|
1265
|
-
let e = Array.from(n.querySelectorAll(".vxe-body--column")).indexOf(t), i = !!t.closest(".vxe-table--fixed-left-wrapper"),
|
|
1272
|
+
let e = Array.from(n.querySelectorAll(".vxe-body--column")).indexOf(t), i = !!t.closest(".vxe-table--fixed-left-wrapper"), o = !!t.closest(".vxe-table--fixed-right-wrapper"), c = r.getColumns();
|
|
1266
1273
|
if (i) {
|
|
1267
1274
|
let t = c.filter((e) => e.fixed === "left");
|
|
1268
1275
|
e < t.length && (s = c.indexOf(t[e]));
|
|
1269
|
-
} else if (
|
|
1276
|
+
} else if (o) {
|
|
1270
1277
|
let t = c.filter((e) => e.fixed === "right");
|
|
1271
1278
|
e < t.length && (s = c.indexOf(t[e]));
|
|
1272
1279
|
} else {
|
|
1273
|
-
let t =
|
|
1280
|
+
let t = a.searchForm.showCheckBox ? 1 : 0;
|
|
1274
1281
|
s = c.filter((e) => e.fixed === "left").length + e - t;
|
|
1275
1282
|
}
|
|
1276
1283
|
}
|
|
@@ -1279,217 +1286,326 @@ var xt = { class: "center" }, St = /* @__PURE__ */ Q({
|
|
|
1279
1286
|
colIndex: s,
|
|
1280
1287
|
cell: t
|
|
1281
1288
|
};
|
|
1282
|
-
},
|
|
1283
|
-
|
|
1289
|
+
}, U = null, W = 0, G = (e) => {
|
|
1290
|
+
if (!H.isSelecting) return;
|
|
1291
|
+
W = e.clientY;
|
|
1292
|
+
let t = b.value;
|
|
1293
|
+
if (!t || !t.$el) return;
|
|
1294
|
+
let n = t.$el, r = n.querySelector(".vxe-table--body-inner-wrapper") || n.querySelector(".vxe-table--body-wrapper");
|
|
1295
|
+
if (!r) return;
|
|
1296
|
+
let i = r.getBoundingClientRect();
|
|
1297
|
+
e.clientY < i.top - xt || e.clientY > i.bottom + xt ? U || me() : K();
|
|
1298
|
+
}, me = () => {
|
|
1299
|
+
let e = () => {
|
|
1300
|
+
if (!H.isSelecting) {
|
|
1301
|
+
K();
|
|
1302
|
+
return;
|
|
1303
|
+
}
|
|
1304
|
+
let t = b.value;
|
|
1305
|
+
if (!t || !t.$el) {
|
|
1306
|
+
K();
|
|
1307
|
+
return;
|
|
1308
|
+
}
|
|
1309
|
+
let n = t.$el, r = n.querySelector(".vxe-table--body-inner-wrapper") || n.querySelector(".vxe-table--body-wrapper");
|
|
1310
|
+
if (!r) {
|
|
1311
|
+
K();
|
|
1312
|
+
return;
|
|
1313
|
+
}
|
|
1314
|
+
let i = r.getBoundingClientRect(), a = 0;
|
|
1315
|
+
if (W < i.top) {
|
|
1316
|
+
let e = i.top - W;
|
|
1317
|
+
a = -Math.min(St, Math.max(2, e * Ct));
|
|
1318
|
+
} else if (W > i.bottom) {
|
|
1319
|
+
let e = W - i.bottom;
|
|
1320
|
+
a = Math.min(St, Math.max(2, e * Ct));
|
|
1321
|
+
} else {
|
|
1322
|
+
K();
|
|
1323
|
+
return;
|
|
1324
|
+
}
|
|
1325
|
+
r.scrollTop = Math.max(0, Math.min(r.scrollHeight - r.clientHeight, r.scrollTop + a)), he(r, i), U = requestAnimationFrame(e);
|
|
1326
|
+
};
|
|
1327
|
+
U = requestAnimationFrame(e);
|
|
1328
|
+
}, K = () => {
|
|
1329
|
+
U &&= (cancelAnimationFrame(U), null);
|
|
1330
|
+
}, he = (e, t) => {
|
|
1331
|
+
let n = b.value;
|
|
1332
|
+
if (!n) return;
|
|
1333
|
+
let r = n.getTableData().fullData;
|
|
1334
|
+
if (!r || r.length === 0) return;
|
|
1335
|
+
let i = n.$el.querySelector(".vxe-table--body-wrapper tbody") || e.querySelector("tbody");
|
|
1336
|
+
if (!i) return;
|
|
1337
|
+
let a = i.querySelectorAll(".vxe-body--row");
|
|
1338
|
+
if (a.length === 0) return;
|
|
1339
|
+
let o = null;
|
|
1340
|
+
if (W < t.top ? o = a[0] : W > t.bottom && (o = a[a.length - 1]), !o) return;
|
|
1341
|
+
let s = o.getAttribute("rowid");
|
|
1342
|
+
if (s == null) return;
|
|
1343
|
+
let c = -1, l = n.getRowById(s);
|
|
1344
|
+
if (l && (c = r.indexOf(l)), c < 0) return;
|
|
1345
|
+
let u = H.endCell ? H.endCell.colIndex : H.startCell ? H.startCell.colIndex : 0;
|
|
1346
|
+
H.endCell = {
|
|
1347
|
+
rowIndex: c,
|
|
1348
|
+
colIndex: u
|
|
1349
|
+
}, ye(), be();
|
|
1350
|
+
}, ge = (e) => {
|
|
1351
|
+
let t = pe(e.target);
|
|
1284
1352
|
if (!t) {
|
|
1285
|
-
|
|
1353
|
+
ve();
|
|
1286
1354
|
return;
|
|
1287
1355
|
}
|
|
1288
|
-
|
|
1356
|
+
H.isSelecting = !0, H.startCell = {
|
|
1289
1357
|
rowIndex: t.rowIndex,
|
|
1290
1358
|
colIndex: t.colIndex
|
|
1291
|
-
},
|
|
1292
|
-
},
|
|
1293
|
-
if (!
|
|
1294
|
-
let t =
|
|
1295
|
-
t && (
|
|
1359
|
+
}, H.endCell = { ...H.startCell }, document.addEventListener("mousemove", G), ye(), be();
|
|
1360
|
+
}, _e = (e) => {
|
|
1361
|
+
if (!H.isSelecting) return;
|
|
1362
|
+
let t = pe(e.target);
|
|
1363
|
+
t && (H.endCell = {
|
|
1296
1364
|
rowIndex: t.rowIndex,
|
|
1297
1365
|
colIndex: t.colIndex
|
|
1298
|
-
},
|
|
1299
|
-
},
|
|
1300
|
-
|
|
1301
|
-
},
|
|
1302
|
-
|
|
1303
|
-
let e =
|
|
1366
|
+
}, ye(), be());
|
|
1367
|
+
}, q = () => {
|
|
1368
|
+
H.isSelecting = !1, K(), document.removeEventListener("mousemove", G);
|
|
1369
|
+
}, ve = () => {
|
|
1370
|
+
H.selectedCells = [], H.startCell = null, H.endCell = null;
|
|
1371
|
+
let e = b.value;
|
|
1304
1372
|
e && e.$el.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach((e) => {
|
|
1305
1373
|
e.classList.remove("cell-selected", "cell-border-top", "cell-border-right", "cell-border-bottom", "cell-border-left");
|
|
1306
1374
|
});
|
|
1307
|
-
},
|
|
1308
|
-
if (!
|
|
1309
|
-
|
|
1375
|
+
}, ye = () => {
|
|
1376
|
+
if (!H.startCell || !H.endCell) {
|
|
1377
|
+
H.selectedCells = [];
|
|
1310
1378
|
return;
|
|
1311
1379
|
}
|
|
1312
|
-
let e =
|
|
1313
|
-
|
|
1314
|
-
for (let e = i; e <= a; e++) for (let t = o; t <= s; t++)
|
|
1380
|
+
let e = H.startCell.rowIndex, t = H.endCell.rowIndex, n = H.startCell.colIndex, r = H.endCell.colIndex, i = Math.min(e, t), a = Math.max(e, t), o = Math.min(n, r), s = Math.max(n, r);
|
|
1381
|
+
H.selectedCells = [];
|
|
1382
|
+
for (let e = i; e <= a; e++) for (let t = o; t <= s; t++) H.selectedCells.push({
|
|
1315
1383
|
rowIndex: e,
|
|
1316
1384
|
colIndex: t
|
|
1317
1385
|
});
|
|
1318
|
-
},
|
|
1386
|
+
}, be = () => {
|
|
1319
1387
|
S(() => {
|
|
1320
|
-
let e =
|
|
1388
|
+
let e = b.value;
|
|
1321
1389
|
if (!e) return;
|
|
1322
1390
|
let t = e.$el;
|
|
1323
1391
|
if (t.querySelectorAll(".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left").forEach((e) => {
|
|
1324
1392
|
e.classList.remove("cell-selected", "cell-border-top", "cell-border-right", "cell-border-bottom", "cell-border-left");
|
|
1325
|
-
}),
|
|
1326
|
-
let n = e.getColumns(), r =
|
|
1393
|
+
}), H.selectedCells.length === 0) return;
|
|
1394
|
+
let n = e.getColumns(), r = H.selectedCells.map((e) => e.rowIndex), i = H.selectedCells.map((e) => e.colIndex), o = Math.min(...r), s = Math.max(...r), c = Math.min(...i), l = Math.max(...i), u = e.getTableData().fullData, d = /* @__PURE__ */ new Map();
|
|
1395
|
+
H.selectedCells.forEach(({ rowIndex: t }) => {
|
|
1396
|
+
if (d.has(t)) return;
|
|
1397
|
+
let n = u[t];
|
|
1398
|
+
if (n) {
|
|
1399
|
+
let r = e.getRowid(n);
|
|
1400
|
+
r != null && d.set(String(r), t);
|
|
1401
|
+
}
|
|
1402
|
+
});
|
|
1403
|
+
let f = [
|
|
1327
1404
|
t.querySelector(".vxe-table--body-wrapper tbody"),
|
|
1328
1405
|
t.querySelector(".vxe-table--fixed-left-wrapper tbody"),
|
|
1329
1406
|
t.querySelector(".vxe-table--fixed-right-wrapper tbody")
|
|
1330
|
-
].filter(Boolean);
|
|
1331
|
-
|
|
1332
|
-
let r =
|
|
1333
|
-
if (
|
|
1334
|
-
let i =
|
|
1335
|
-
|
|
1336
|
-
let
|
|
1337
|
-
if (!
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1407
|
+
].filter(Boolean), p = new Set(H.selectedCells.map(({ rowIndex: e, colIndex: t }) => `${e}_${t}`));
|
|
1408
|
+
for (let e of f) e.querySelectorAll(".vxe-body--row").forEach((t) => {
|
|
1409
|
+
let r = t.getAttribute("rowid");
|
|
1410
|
+
if (r == null) return;
|
|
1411
|
+
let i = d.get(String(r));
|
|
1412
|
+
if (i === void 0) {
|
|
1413
|
+
let e = parseInt(r, 10);
|
|
1414
|
+
if (!isNaN(e) && p.has(`${e}_${c}`)) i = e;
|
|
1415
|
+
else return;
|
|
1416
|
+
}
|
|
1417
|
+
let u = Array.from(t.querySelectorAll(".vxe-body--column"));
|
|
1418
|
+
for (let t = c; t <= l; t++) {
|
|
1419
|
+
if (!p.has(`${i}_${t}`)) continue;
|
|
1420
|
+
let r = n[t];
|
|
1421
|
+
if (!r) continue;
|
|
1422
|
+
let d = r.fixed === "left", f = r.fixed === "right", m = null;
|
|
1423
|
+
if (d && e.closest(".vxe-table--fixed-left-wrapper")) m = u[n.filter((e) => e.fixed === "left").indexOf(r)];
|
|
1424
|
+
else if (f && e.closest(".vxe-table--fixed-right-wrapper")) m = u[n.filter((e) => e.fixed === "right").indexOf(r)];
|
|
1425
|
+
else if (!d && !f && e.closest(".vxe-table--body-wrapper")) {
|
|
1426
|
+
let e = a.searchForm.showCheckBox ? 1 : 0, r = n.filter((e) => e.fixed === "left").length;
|
|
1427
|
+
m = u[t - r + e];
|
|
1348
1428
|
}
|
|
1429
|
+
m && !m.classList.contains("col--checkbox") && !m.classList.contains("col--seq") && (m.classList.add("cell-selected"), i === o && m.classList.add("cell-border-top"), i === s && m.classList.add("cell-border-bottom"), t === c && m.classList.add("cell-border-left"), t === l && m.classList.add("cell-border-right"));
|
|
1349
1430
|
}
|
|
1350
1431
|
});
|
|
1351
1432
|
});
|
|
1352
|
-
},
|
|
1353
|
-
|
|
1354
|
-
|
|
1433
|
+
}, J = null, xe = () => {
|
|
1434
|
+
H.selectedCells.length !== 0 && (J && cancelAnimationFrame(J), J = requestAnimationFrame(() => {
|
|
1435
|
+
be(), J = null;
|
|
1436
|
+
}));
|
|
1437
|
+
}, Se = async () => {
|
|
1438
|
+
if (H.selectedCells.length === 0) return;
|
|
1439
|
+
let e = b.value;
|
|
1355
1440
|
if (!e) return;
|
|
1356
|
-
let t = e.$el, n = e.getColumns(), r = [...new Set(
|
|
1441
|
+
let t = e.$el, n = e.getColumns(), r = e.getTableData().fullData, i = [...new Set(H.selectedCells.map((e) => e.rowIndex))].sort((e, t) => e - t), o = [...new Set(H.selectedCells.map((e) => e.colIndex))].sort((e, t) => e - t), s = /* @__PURE__ */ new Map(), c = [
|
|
1357
1442
|
t.querySelector(".vxe-table--body-wrapper tbody"),
|
|
1358
1443
|
t.querySelector(".vxe-table--fixed-left-wrapper tbody"),
|
|
1359
1444
|
t.querySelector(".vxe-table--fixed-right-wrapper tbody")
|
|
1360
|
-
].filter(Boolean)
|
|
1361
|
-
|
|
1362
|
-
let
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1445
|
+
].filter(Boolean);
|
|
1446
|
+
for (let e of c) e.querySelectorAll(".vxe-body--row").forEach((t) => {
|
|
1447
|
+
let n = t.getAttribute("rowid");
|
|
1448
|
+
n != null && (s.has(n) || s.set(n, []), s.get(n).push({
|
|
1449
|
+
rowEl: t,
|
|
1450
|
+
tbody: e
|
|
1451
|
+
}));
|
|
1452
|
+
});
|
|
1453
|
+
let l = [];
|
|
1454
|
+
i.forEach((t) => {
|
|
1455
|
+
let i = r[t], c = [];
|
|
1456
|
+
o.forEach((t) => {
|
|
1457
|
+
let r = n[t];
|
|
1458
|
+
if (!r) {
|
|
1459
|
+
c.push("");
|
|
1367
1460
|
return;
|
|
1368
1461
|
}
|
|
1369
|
-
let
|
|
1370
|
-
|
|
1371
|
-
let
|
|
1372
|
-
if (
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1462
|
+
let o = "", l = r.field;
|
|
1463
|
+
if (r.slots && (r.slots.default || r.slots.content)) {
|
|
1464
|
+
let c = i ? e.getRowid(i) : null, u = !1;
|
|
1465
|
+
if (c != null && s.has(String(c))) {
|
|
1466
|
+
let e = s.get(String(c)), i = r.fixed === "left", l = r.fixed === "right";
|
|
1467
|
+
for (let { rowEl: s, tbody: c } of e) {
|
|
1468
|
+
let e = Array.from(s.querySelectorAll(".vxe-body--column")), d = null;
|
|
1469
|
+
if (i && c.closest(".vxe-table--fixed-left-wrapper")) d = e[n.filter((e) => e.fixed === "left").indexOf(r)];
|
|
1470
|
+
else if (l && c.closest(".vxe-table--fixed-right-wrapper")) d = e[n.filter((e) => e.fixed === "right").indexOf(r)];
|
|
1471
|
+
else if (!i && !l && c.closest(".vxe-table--body-wrapper")) {
|
|
1472
|
+
let r = a.searchForm.showCheckBox ? 1 : 0;
|
|
1473
|
+
d = e[t - n.filter((e) => e.fixed === "left").length + r];
|
|
1474
|
+
}
|
|
1475
|
+
if (d && !d.classList.contains("col--checkbox") && !d.classList.contains("col--seq")) {
|
|
1476
|
+
o = (d.innerText || d.textContent || "").trim().replace(/\n/g, " ").replace(/\s+/g, " "), u = !0;
|
|
1477
|
+
break;
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1379
1480
|
}
|
|
1380
|
-
if (
|
|
1381
|
-
|
|
1382
|
-
|
|
1481
|
+
if (!u && i && l) {
|
|
1482
|
+
let e = i[l];
|
|
1483
|
+
o = e == null ? "" : String(e);
|
|
1383
1484
|
}
|
|
1485
|
+
} else if (r.formatter && i) try {
|
|
1486
|
+
let e = r.formatter({
|
|
1487
|
+
cellValue: i[l],
|
|
1488
|
+
row: i,
|
|
1489
|
+
column: r
|
|
1490
|
+
});
|
|
1491
|
+
o = e == null ? "" : String(e);
|
|
1492
|
+
} catch {
|
|
1493
|
+
let e = i ? i[l] : "";
|
|
1494
|
+
o = e == null ? "" : String(e);
|
|
1384
1495
|
}
|
|
1385
|
-
|
|
1386
|
-
|
|
1496
|
+
else if (i && l) {
|
|
1497
|
+
let e = i[l];
|
|
1498
|
+
o = e == null ? "" : String(e);
|
|
1499
|
+
}
|
|
1500
|
+
c.push(o);
|
|
1501
|
+
}), l.push(c.join(" "));
|
|
1387
1502
|
});
|
|
1388
|
-
let
|
|
1503
|
+
let u = l.join("\n");
|
|
1389
1504
|
try {
|
|
1390
|
-
await navigator.clipboard.writeText(
|
|
1505
|
+
await navigator.clipboard.writeText(u);
|
|
1391
1506
|
} catch (e) {
|
|
1392
1507
|
console.error("复制失败:", e);
|
|
1393
1508
|
}
|
|
1509
|
+
}, Ce = (e) => {
|
|
1510
|
+
!a.searchForm.enableCellCopy && !i.enableCellCopy || ((e.ctrlKey || e.metaKey) && e.key === "c" ? H.selectedCells.length > 0 && (e.preventDefault(), e.stopPropagation(), Se()) : e.key === "Escape" && ve());
|
|
1511
|
+
}, Y = () => {
|
|
1512
|
+
H.isSelecting = !1, K(), document.removeEventListener("mousemove", G);
|
|
1394
1513
|
}, X = (e) => {
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
}, ve = (e) => {
|
|
1402
|
-
b[v] = e, H();
|
|
1403
|
-
}, ye = (e) => {
|
|
1404
|
-
b[y] = e, b[v] = 1, H();
|
|
1514
|
+
let t = b.value;
|
|
1515
|
+
!t || !t.$el || t.$el.contains(e.target) || ve();
|
|
1516
|
+
}, we = (e) => {
|
|
1517
|
+
y[_] = e, R();
|
|
1518
|
+
}, Te = (e) => {
|
|
1519
|
+
y[v] = e, y[_] = 1, R();
|
|
1405
1520
|
};
|
|
1406
|
-
function
|
|
1407
|
-
let e =
|
|
1408
|
-
|
|
1521
|
+
function Ee() {
|
|
1522
|
+
let e = b.value.getCheckboxRecords();
|
|
1523
|
+
a.searchForm.selections = e;
|
|
1409
1524
|
}
|
|
1410
|
-
let
|
|
1411
|
-
let t =
|
|
1525
|
+
let Z = (e) => {
|
|
1526
|
+
let t = b.value;
|
|
1412
1527
|
if (t) {
|
|
1413
1528
|
t.toggleCheckboxRow(e);
|
|
1414
|
-
let n =
|
|
1415
|
-
|
|
1529
|
+
let n = b.value.getCheckboxRecords();
|
|
1530
|
+
a.searchForm.selections = n;
|
|
1416
1531
|
}
|
|
1417
1532
|
};
|
|
1418
1533
|
return t({
|
|
1419
|
-
tableRef:
|
|
1420
|
-
getList:
|
|
1421
|
-
getPrm:
|
|
1422
|
-
clearSort:
|
|
1423
|
-
calculateTableHeight:
|
|
1534
|
+
tableRef: b,
|
|
1535
|
+
getList: R,
|
|
1536
|
+
getPrm: B,
|
|
1537
|
+
clearSort: oe,
|
|
1538
|
+
calculateTableHeight: N
|
|
1424
1539
|
}), (t, n) => {
|
|
1425
|
-
let
|
|
1540
|
+
let a = M("el-button"), l = M("el-checkbox"), m = M("el-text"), S = M("vxe-column"), T = M("VxeTable"), E = M("el-pagination");
|
|
1426
1541
|
return O(), f("div", { class: C({ box: e.searchForm.showShadow }) }, [
|
|
1427
|
-
e.searchForm.showSearch ? (O(), u(
|
|
1542
|
+
e.searchForm.showSearch ? (O(), u(mt, {
|
|
1428
1543
|
key: 0,
|
|
1429
1544
|
form: e.searchForm,
|
|
1430
|
-
onReset:
|
|
1431
|
-
onConfirm: n[1] ||= (e) =>
|
|
1432
|
-
onVisibleChange:
|
|
1545
|
+
onReset: z,
|
|
1546
|
+
onConfirm: n[1] ||= (e) => R(),
|
|
1547
|
+
onVisibleChange: F(N)
|
|
1433
1548
|
}, {
|
|
1434
|
-
btn:
|
|
1549
|
+
btn: I(() => [
|
|
1435
1550
|
n[3] ||= p("span", { class: "mgr10" }, null, -1),
|
|
1436
|
-
|
|
1437
|
-
g(
|
|
1551
|
+
j(t.$slots, "search-bar-btn", {}, void 0, !0),
|
|
1552
|
+
g(a, {
|
|
1438
1553
|
class: "mgl10",
|
|
1439
1554
|
round: "",
|
|
1440
|
-
onClick: n[0] ||= (e) =>
|
|
1555
|
+
onClick: n[0] ||= (e) => b.value.openCustom()
|
|
1441
1556
|
}, {
|
|
1442
|
-
default:
|
|
1557
|
+
default: I(() => [g(rt, { name: "Tools" })]),
|
|
1443
1558
|
_: 1
|
|
1444
1559
|
})
|
|
1445
1560
|
]),
|
|
1446
1561
|
_: 3
|
|
1447
1562
|
}, 8, ["form", "onVisibleChange"])) : d("", !0),
|
|
1448
|
-
|
|
1563
|
+
j(t.$slots, "table-header-left", {}, void 0, !0),
|
|
1449
1564
|
p("div", {
|
|
1450
1565
|
ref_key: "tableContentRef",
|
|
1451
|
-
ref:
|
|
1452
|
-
}, [g(
|
|
1453
|
-
id:
|
|
1566
|
+
ref: w
|
|
1567
|
+
}, [g(T, x({
|
|
1568
|
+
id: c.value,
|
|
1454
1569
|
ref_key: "tableRef",
|
|
1455
|
-
ref:
|
|
1456
|
-
loading: e.loading ||
|
|
1457
|
-
data: e.api ?
|
|
1570
|
+
ref: b,
|
|
1571
|
+
loading: e.loading || o.value,
|
|
1572
|
+
data: e.api ? s.value : e.data,
|
|
1458
1573
|
border: ""
|
|
1459
|
-
},
|
|
1460
|
-
height:
|
|
1461
|
-
onCheckboxChange:
|
|
1462
|
-
onCheckboxAll:
|
|
1463
|
-
onSortChange:
|
|
1574
|
+
}, fe.value, {
|
|
1575
|
+
height: re.value,
|
|
1576
|
+
onCheckboxChange: Ee,
|
|
1577
|
+
onCheckboxAll: Ee,
|
|
1578
|
+
onSortChange: fe.value["sort-config"]?.sortChange,
|
|
1579
|
+
onScroll: xe
|
|
1464
1580
|
}), {
|
|
1465
|
-
default:
|
|
1581
|
+
default: I(() => [e.searchForm.showCheckBox == null || e.searchForm.showCheckBox ? (O(), u(S, {
|
|
1466
1582
|
key: 0,
|
|
1467
1583
|
type: "checkbox",
|
|
1468
|
-
width:
|
|
1584
|
+
width: F(r) == "zh_cn" ? 80 : 150,
|
|
1469
1585
|
title: t.$t("xu-hao"),
|
|
1470
1586
|
fixed: "left"
|
|
1471
1587
|
}, {
|
|
1472
|
-
checkbox:
|
|
1588
|
+
checkbox: I(({ rowIndex: e, row: t, checked: n, disabled: r }) => [p("div", bt, [n ? (O(), u(l, {
|
|
1473
1589
|
key: 0,
|
|
1474
1590
|
checked: !0,
|
|
1475
1591
|
disabled: r,
|
|
1476
1592
|
size: "default",
|
|
1477
|
-
onClick:
|
|
1478
|
-
}, null, 8, ["disabled", "onClick"])) : (O(), u(
|
|
1593
|
+
onClick: ae((e) => !r && Z(t), ["stop"])
|
|
1594
|
+
}, null, 8, ["disabled", "onClick"])) : (O(), u(l, {
|
|
1479
1595
|
key: 1,
|
|
1480
1596
|
disabled: r,
|
|
1481
1597
|
checked: !1,
|
|
1482
1598
|
size: "default",
|
|
1483
|
-
onClick:
|
|
1484
|
-
}, null, 8, ["disabled", "onClick"])), g(
|
|
1599
|
+
onClick: ae((e) => !r && Z(t), ["stop"])
|
|
1600
|
+
}, null, 8, ["disabled", "onClick"])), g(m, {
|
|
1485
1601
|
type: "info",
|
|
1486
1602
|
class: "mgl5"
|
|
1487
1603
|
}, {
|
|
1488
|
-
default:
|
|
1604
|
+
default: I(() => [h(P(e + 1), 1)]),
|
|
1489
1605
|
_: 2
|
|
1490
1606
|
}, 1024)])]),
|
|
1491
1607
|
_: 1
|
|
1492
|
-
}, 8, ["width", "title"])) : d("", !0),
|
|
1608
|
+
}, 8, ["width", "title"])) : d("", !0), j(t.$slots, "default", {}, void 0, !0)]),
|
|
1493
1609
|
_: 3
|
|
1494
1610
|
}, 16, [
|
|
1495
1611
|
"id",
|
|
@@ -1498,18 +1614,18 @@ var xt = { class: "center" }, St = /* @__PURE__ */ Q({
|
|
|
1498
1614
|
"height",
|
|
1499
1615
|
"onSortChange"
|
|
1500
1616
|
])], 512),
|
|
1501
|
-
e.searchForm.showPage ? (O(), u(
|
|
1617
|
+
e.searchForm.showPage ? (O(), u(E, {
|
|
1502
1618
|
key: 1,
|
|
1503
|
-
"current-page":
|
|
1504
|
-
"onUpdate:currentPage": n[2] ||= (e) =>
|
|
1619
|
+
"current-page": y[F(_)],
|
|
1620
|
+
"onUpdate:currentPage": n[2] ||= (e) => y[F(_)] = e,
|
|
1505
1621
|
class: "myPagination mgt10",
|
|
1506
1622
|
background: "",
|
|
1507
1623
|
layout: "total, sizes, prev, pager, next",
|
|
1508
|
-
total:
|
|
1509
|
-
"page-size":
|
|
1510
|
-
"page-sizes": e.searchForm.pageSizes ||
|
|
1511
|
-
onCurrentChange:
|
|
1512
|
-
onSizeChange:
|
|
1624
|
+
total: y.total,
|
|
1625
|
+
"page-size": y[F(v)],
|
|
1626
|
+
"page-sizes": e.searchForm.pageSizes || F(i).pageSizes,
|
|
1627
|
+
onCurrentChange: we,
|
|
1628
|
+
onSizeChange: Te
|
|
1513
1629
|
}, null, 8, [
|
|
1514
1630
|
"current-page",
|
|
1515
1631
|
"total",
|
|
@@ -1519,7 +1635,7 @@ var xt = { class: "center" }, St = /* @__PURE__ */ Q({
|
|
|
1519
1635
|
], 2);
|
|
1520
1636
|
};
|
|
1521
1637
|
}
|
|
1522
|
-
}, [["__scopeId", "data-v-
|
|
1638
|
+
}, [["__scopeId", "data-v-178df059"]]), Tt = {
|
|
1523
1639
|
__name: "index",
|
|
1524
1640
|
props: {
|
|
1525
1641
|
sheetsConfig: {
|
|
@@ -1538,31 +1654,31 @@ var xt = { class: "center" }, St = /* @__PURE__ */ Q({
|
|
|
1538
1654
|
setup(e) {
|
|
1539
1655
|
let t = e;
|
|
1540
1656
|
function n() {
|
|
1541
|
-
|
|
1657
|
+
Re(t.fileName + (t.version ? `__v${t.version}` : ""), t.sheetsConfig);
|
|
1542
1658
|
}
|
|
1543
1659
|
return (e, t) => {
|
|
1544
|
-
let r =
|
|
1660
|
+
let r = M("el-link");
|
|
1545
1661
|
return O(), u(r, x({
|
|
1546
1662
|
type: "primary",
|
|
1547
1663
|
underline: "never"
|
|
1548
1664
|
}, e.$attrs, { onClick: n }), {
|
|
1549
|
-
default:
|
|
1665
|
+
default: I(() => [j(e.$slots, "default", {}, () => [h(P(e.$t("xia-zai-dao-ru-mo-ban")), 1)])]),
|
|
1550
1666
|
_: 3
|
|
1551
1667
|
}, 16);
|
|
1552
1668
|
};
|
|
1553
1669
|
}
|
|
1554
|
-
},
|
|
1670
|
+
}, Et = {
|
|
1555
1671
|
mounted(e, t) {
|
|
1556
|
-
t.value &&
|
|
1672
|
+
t.value && Dt(e);
|
|
1557
1673
|
},
|
|
1558
1674
|
updated(e, t) {
|
|
1559
|
-
t.value ?
|
|
1675
|
+
t.value ? Dt(e) : Ot(e);
|
|
1560
1676
|
},
|
|
1561
1677
|
beforeUnmount(e) {
|
|
1562
|
-
|
|
1678
|
+
Ot(e);
|
|
1563
1679
|
}
|
|
1564
1680
|
};
|
|
1565
|
-
async function
|
|
1681
|
+
async function Dt(e) {
|
|
1566
1682
|
await f();
|
|
1567
1683
|
let t = e.querySelector(".el-dialog");
|
|
1568
1684
|
if (!t) return;
|
|
@@ -1625,15 +1741,15 @@ async function Tt(e) {
|
|
|
1625
1741
|
}
|
|
1626
1742
|
e.__mouseDown__ = c, e.__mouseUp__ = u, e.__mouseMove__ = l, e.__sizeChange__ = d;
|
|
1627
1743
|
}
|
|
1628
|
-
function
|
|
1744
|
+
function Ot(e) {
|
|
1629
1745
|
document.removeEventListener("mousedown", e.__mouseDown__), document.removeEventListener("mousemove", e.__mouseMove__), document.removeEventListener("mouseup", e.__mouseUp__), window.removeEventListener("resize", e.__sizeChange__);
|
|
1630
1746
|
}
|
|
1631
1747
|
//#endregion
|
|
1632
1748
|
//#region src/components/Layer/index.vue
|
|
1633
|
-
var
|
|
1749
|
+
var kt = {
|
|
1634
1750
|
key: 0,
|
|
1635
1751
|
class: "drawer-btn"
|
|
1636
|
-
},
|
|
1752
|
+
}, At = { key: 1 }, jt = {
|
|
1637
1753
|
__name: "index",
|
|
1638
1754
|
props: {
|
|
1639
1755
|
layer: {
|
|
@@ -1653,7 +1769,7 @@ var Dt = {
|
|
|
1653
1769
|
},
|
|
1654
1770
|
emits: ["confirm"],
|
|
1655
1771
|
setup(e, { emit: t }) {
|
|
1656
|
-
let n = e, r = t, { t: i } =
|
|
1772
|
+
let n = e, r = t, { t: i } = V(), o = ce(() => {
|
|
1657
1773
|
r("confirm");
|
|
1658
1774
|
}, 300);
|
|
1659
1775
|
async function s() {
|
|
@@ -1664,7 +1780,7 @@ var Dt = {
|
|
|
1664
1780
|
}).catch(() => {}) == "confirm" && (n.layer.show = !1) : n.layer.show = !1 : n.layer.show = !1;
|
|
1665
1781
|
}
|
|
1666
1782
|
return (t, n) => {
|
|
1667
|
-
let r =
|
|
1783
|
+
let r = M("el-button"), i = M("el-drawer"), a = M("el-dialog");
|
|
1668
1784
|
return e.layer.type ? (O(), u(i, {
|
|
1669
1785
|
key: 0,
|
|
1670
1786
|
modelValue: e.layer.show,
|
|
@@ -1676,18 +1792,18 @@ var Dt = {
|
|
|
1676
1792
|
"before-close": s,
|
|
1677
1793
|
class: "drawer-content"
|
|
1678
1794
|
}, {
|
|
1679
|
-
default:
|
|
1680
|
-
|
|
1795
|
+
default: I(() => [
|
|
1796
|
+
j(t.$slots, "default"),
|
|
1681
1797
|
n[2] ||= p("p", { class: "mgt50" }, null, -1),
|
|
1682
|
-
e.layer.showButton ? (O(), f("div",
|
|
1683
|
-
default:
|
|
1798
|
+
e.layer.showButton ? (O(), f("div", kt, [j(t.$slots, "btn", {}, () => [g(r, { onClick: s }, {
|
|
1799
|
+
default: I(() => [h(P(t.$t("qu-xiao")), 1)]),
|
|
1684
1800
|
_: 1
|
|
1685
1801
|
}), g(r, {
|
|
1686
1802
|
type: "primary",
|
|
1687
1803
|
loading: e.loading,
|
|
1688
|
-
onClick:
|
|
1804
|
+
onClick: F(o)
|
|
1689
1805
|
}, {
|
|
1690
|
-
default:
|
|
1806
|
+
default: I(() => [h(P(t.$t("ti-jiao")), 1)]),
|
|
1691
1807
|
_: 1
|
|
1692
1808
|
}, 8, ["loading", "onClick"])])])) : d("", !0)
|
|
1693
1809
|
]),
|
|
@@ -1696,7 +1812,7 @@ var Dt = {
|
|
|
1696
1812
|
"modelValue",
|
|
1697
1813
|
"size",
|
|
1698
1814
|
"title"
|
|
1699
|
-
])) :
|
|
1815
|
+
])) : L((O(), f("div", At, [g(a, {
|
|
1700
1816
|
"close-on-click-modal": !1,
|
|
1701
1817
|
modelValue: e.layer.show,
|
|
1702
1818
|
"onUpdate:modelValue": n[1] ||= (t) => e.layer.show = t,
|
|
@@ -1704,18 +1820,18 @@ var Dt = {
|
|
|
1704
1820
|
width: e.layer.width || 500,
|
|
1705
1821
|
center: ""
|
|
1706
1822
|
}, m({
|
|
1707
|
-
default:
|
|
1823
|
+
default: I(() => [j(t.$slots, "default")]),
|
|
1708
1824
|
_: 2
|
|
1709
1825
|
}, [e.layer.showButton ? {
|
|
1710
1826
|
name: "footer",
|
|
1711
|
-
fn:
|
|
1712
|
-
default:
|
|
1827
|
+
fn: I(() => [j(t.$slots, "btn", {}, () => [g(r, { onClick: s }, {
|
|
1828
|
+
default: I(() => [h(P(t.$t("qu-xiao")), 1)]),
|
|
1713
1829
|
_: 1
|
|
1714
1830
|
}), g(r, {
|
|
1715
1831
|
type: "primary",
|
|
1716
|
-
onClick:
|
|
1832
|
+
onClick: F(o)
|
|
1717
1833
|
}, {
|
|
1718
|
-
default:
|
|
1834
|
+
default: I(() => [h(P(t.$t("ti-jiao")), 1)]),
|
|
1719
1835
|
_: 1
|
|
1720
1836
|
}, 8, ["onClick"])])]),
|
|
1721
1837
|
key: "0"
|
|
@@ -1723,14 +1839,14 @@ var Dt = {
|
|
|
1723
1839
|
"modelValue",
|
|
1724
1840
|
"title",
|
|
1725
1841
|
"width"
|
|
1726
|
-
])])), [[
|
|
1842
|
+
])])), [[F(Et), e.layer.show]]);
|
|
1727
1843
|
};
|
|
1728
1844
|
}
|
|
1729
1845
|
};
|
|
1730
1846
|
//#endregion
|
|
1731
1847
|
//#region src/utils/tools/validate.js
|
|
1732
|
-
function
|
|
1733
|
-
let n =
|
|
1848
|
+
function Mt(e, t = {}) {
|
|
1849
|
+
let n = Q(), r = {
|
|
1734
1850
|
inForm: !0,
|
|
1735
1851
|
required: !0,
|
|
1736
1852
|
...t
|
|
@@ -1749,7 +1865,7 @@ function At(e, t = {}) {
|
|
|
1749
1865
|
}
|
|
1750
1866
|
//#endregion
|
|
1751
1867
|
//#region src/utils/tools/one-portal-cas-sdk.js
|
|
1752
|
-
var
|
|
1868
|
+
var Nt = class {
|
|
1753
1869
|
constructor(e = {}) {
|
|
1754
1870
|
this.config = {
|
|
1755
1871
|
clientCode: e.clientCode || "one-portal",
|
|
@@ -1896,24 +2012,24 @@ var jt = class {
|
|
|
1896
2012
|
};
|
|
1897
2013
|
//#endregion
|
|
1898
2014
|
//#region src/utils/tools/format.js
|
|
1899
|
-
function
|
|
2015
|
+
function Pt(e, t = 2, n = ".", r = ",") {
|
|
1900
2016
|
(e == null || e === "") && (e = 0);
|
|
1901
2017
|
let i = Number(e);
|
|
1902
2018
|
e = isNaN(i) ? 0 : i, t = Math.max(0, Math.floor(t));
|
|
1903
2019
|
let a = e.toFixed(t).split("."), o = a[0], s = a[1], c = o.startsWith("-");
|
|
1904
2020
|
return c && (o = o.slice(1)), o = o.replace(/\B(?=(\d{3})+(?!\d))/g, r), c && (o = "-" + o), t > 0 ? o + n + s : o;
|
|
1905
2021
|
}
|
|
1906
|
-
function
|
|
1907
|
-
return
|
|
2022
|
+
function Ft(e, t = 2) {
|
|
2023
|
+
return Pt(e, t);
|
|
1908
2024
|
}
|
|
1909
|
-
function
|
|
2025
|
+
function It(e, t = 2) {
|
|
1910
2026
|
(e == null || e === "") && (e = 0);
|
|
1911
2027
|
let n = Number(e);
|
|
1912
|
-
return e = isNaN(n) ? 0 : n,
|
|
2028
|
+
return e = isNaN(n) ? 0 : n, Pt(e * 100, t) + "%";
|
|
1913
2029
|
}
|
|
1914
2030
|
//#endregion
|
|
1915
2031
|
//#region src/utils/hook/common.js
|
|
1916
|
-
function
|
|
2032
|
+
function Lt(e, t = {}) {
|
|
1917
2033
|
let { manual: n, log: r, params: i = {}, cb: a, format: o } = Object.assign({
|
|
1918
2034
|
manual: !1,
|
|
1919
2035
|
log: !1,
|
|
@@ -1925,13 +2041,13 @@ function Ft(e, t = {}) {
|
|
|
1925
2041
|
let { code: t, data: c, msg: l } = e;
|
|
1926
2042
|
if (a) {
|
|
1927
2043
|
let { records: t, rows: n } = c || {};
|
|
1928
|
-
s.value =
|
|
2044
|
+
s.value = Bt(t || n ? t || n : c, o), a(e);
|
|
1929
2045
|
}
|
|
1930
2046
|
if (c) {
|
|
1931
2047
|
if (c.records != null || c.rows != null) {
|
|
1932
2048
|
let { records: e, rows: t, total: r = 0 } = c || {};
|
|
1933
|
-
n && n.total != null && (i.total = parseInt(r)), s.value =
|
|
1934
|
-
} else s.value =
|
|
2049
|
+
n && n.total != null && (i.total = parseInt(r)), s.value = Bt(e || t || [], o);
|
|
2050
|
+
} else s.value = Bt(c, o);
|
|
1935
2051
|
r && console.log("useRequest-res", s.value);
|
|
1936
2052
|
}
|
|
1937
2053
|
}).catch((e) => {
|
|
@@ -1946,9 +2062,9 @@ function Ft(e, t = {}) {
|
|
|
1946
2062
|
l
|
|
1947
2063
|
];
|
|
1948
2064
|
}
|
|
1949
|
-
function
|
|
2065
|
+
function Rt(e) {
|
|
1950
2066
|
let t = A(e), n = A(""), r = A("");
|
|
1951
|
-
return
|
|
2067
|
+
return re(t, (e) => {
|
|
1952
2068
|
let t = e || ["", ""];
|
|
1953
2069
|
n.value = t[0], r.value = t[1];
|
|
1954
2070
|
}), [
|
|
@@ -1957,10 +2073,10 @@ function It(e) {
|
|
|
1957
2073
|
r
|
|
1958
2074
|
];
|
|
1959
2075
|
}
|
|
1960
|
-
function
|
|
2076
|
+
function zt(e) {
|
|
1961
2077
|
return Object.prototype.toString.call(e).slice(8, -1).toLowerCase();
|
|
1962
2078
|
}
|
|
1963
|
-
function
|
|
2079
|
+
function Bt(e, t) {
|
|
1964
2080
|
if (!t) return e;
|
|
1965
2081
|
if (e instanceof Array) return e.map((e) => {
|
|
1966
2082
|
let n = {};
|
|
@@ -1971,58 +2087,58 @@ function Rt(e, t) {
|
|
|
1971
2087
|
}
|
|
1972
2088
|
//#endregion
|
|
1973
2089
|
//#region src/utils/hook/i18n.js
|
|
1974
|
-
function
|
|
1975
|
-
let { locale: n } =
|
|
1976
|
-
return
|
|
2090
|
+
function Vt(e, t = []) {
|
|
2091
|
+
let { locale: n } = V(), r = A(e());
|
|
2092
|
+
return re([n, ...t], () => {
|
|
1977
2093
|
r.value = e();
|
|
1978
2094
|
}, { immediate: !0 }), r;
|
|
1979
2095
|
}
|
|
1980
|
-
function
|
|
2096
|
+
function Ht(e, t = "zh_cn", n = "en_us") {
|
|
1981
2097
|
return e && (e[{
|
|
1982
2098
|
en_us: n,
|
|
1983
2099
|
zh_cn: t
|
|
1984
|
-
}[
|
|
2100
|
+
}[Z().global.locale.value]] || e[t]) || "-";
|
|
1985
2101
|
}
|
|
1986
2102
|
//#endregion
|
|
1987
2103
|
//#region src/utils/hook/storeHook.js
|
|
1988
|
-
function Vt(e, t) {
|
|
1989
|
-
let n = q;
|
|
1990
|
-
return typeof e == "string" && e.length > 0 && (n = G(e).mapState), Wt(t, n);
|
|
1991
|
-
}
|
|
1992
|
-
function Ht(e, t) {
|
|
1993
|
-
let n = K;
|
|
1994
|
-
return typeof e == "string" && e.length > 0 && (n = G(e).mapGetters), Wt(t, n);
|
|
1995
|
-
}
|
|
1996
2104
|
function Ut(e, t) {
|
|
1997
|
-
let n =
|
|
1998
|
-
return typeof e == "string" && e.length > 0 && (n =
|
|
2105
|
+
let n = H;
|
|
2106
|
+
return typeof e == "string" && e.length > 0 && (n = ue(e).mapState), Kt(t, n);
|
|
1999
2107
|
}
|
|
2000
2108
|
function Wt(e, t) {
|
|
2001
|
-
let n =
|
|
2109
|
+
let n = fe;
|
|
2110
|
+
return typeof e == "string" && e.length > 0 && (n = ue(e).mapGetters), Kt(t, n);
|
|
2111
|
+
}
|
|
2112
|
+
function Gt(e, t) {
|
|
2113
|
+
let n = de;
|
|
2114
|
+
return typeof e == "string" && e.length > 0 && (n = ue(e).mapActions), qt(t, n);
|
|
2115
|
+
}
|
|
2116
|
+
function Kt(e, t) {
|
|
2117
|
+
let n = pe(), r = t(e), i = {};
|
|
2002
2118
|
return Object.keys(r).forEach((e) => {
|
|
2003
2119
|
i[e] = l(r[e].bind({ $store: n }));
|
|
2004
2120
|
}), i;
|
|
2005
2121
|
}
|
|
2006
|
-
function
|
|
2007
|
-
let n =
|
|
2122
|
+
function qt(e, t) {
|
|
2123
|
+
let n = pe(), r = t(e), i = {};
|
|
2008
2124
|
return Object.keys(r).forEach((e) => {
|
|
2009
2125
|
i[e] = r[e].bind({ $store: n });
|
|
2010
2126
|
}), i;
|
|
2011
2127
|
}
|
|
2012
2128
|
//#endregion
|
|
2013
2129
|
//#region src/components/CmpTag/index.vue
|
|
2014
|
-
var
|
|
2130
|
+
var Jt = {
|
|
2015
2131
|
__name: "index",
|
|
2016
2132
|
props: { fontColor: String },
|
|
2017
2133
|
setup(e) {
|
|
2018
2134
|
return (t, n) => {
|
|
2019
|
-
let r =
|
|
2135
|
+
let r = M("el-tag");
|
|
2020
2136
|
return O(), u(r, x(t.$attrs, { style: {
|
|
2021
2137
|
backgroundColor: e.fontColor ? `color-mix(in srgb, ${e.fontColor} 5%, transparent)` : void 0,
|
|
2022
2138
|
color: e.fontColor,
|
|
2023
2139
|
borderColor: e.fontColor ? `color-mix(in srgb, ${e.fontColor} 5%, transparent)` : void 0
|
|
2024
2140
|
} }), {
|
|
2025
|
-
default:
|
|
2141
|
+
default: I(() => [j(t.$slots, "default")]),
|
|
2026
2142
|
_: 3
|
|
2027
2143
|
}, 16, ["style"]);
|
|
2028
2144
|
};
|
|
@@ -2030,40 +2146,40 @@ var Kt = {
|
|
|
2030
2146
|
};
|
|
2031
2147
|
//#endregion
|
|
2032
2148
|
//#region src/components/VxeTable/index.jsx
|
|
2033
|
-
function
|
|
2149
|
+
function Yt(e) {
|
|
2034
2150
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !y(e);
|
|
2035
2151
|
}
|
|
2036
|
-
function
|
|
2037
|
-
|
|
2038
|
-
return Mt(e, t);
|
|
2039
|
-
} }), J.formats.add("formatMoney", { cellFormatMethod({ cellValue: e }, t = 2) {
|
|
2040
|
-
return Nt(e, t);
|
|
2041
|
-
} }), J.formats.add("formatPercent", { cellFormatMethod({ cellValue: e }, t = 2) {
|
|
2152
|
+
function Xt() {
|
|
2153
|
+
U.formats.add("formatNumber", { cellFormatMethod({ cellValue: e }, t = 2) {
|
|
2042
2154
|
return Pt(e, t);
|
|
2155
|
+
} }), U.formats.add("formatMoney", { cellFormatMethod({ cellValue: e }, t = 2) {
|
|
2156
|
+
return Ft(e, t);
|
|
2157
|
+
} }), U.formats.add("formatPercent", { cellFormatMethod({ cellValue: e }, t = 2) {
|
|
2158
|
+
return It(e, t);
|
|
2043
2159
|
} });
|
|
2044
2160
|
}
|
|
2045
|
-
function
|
|
2046
|
-
|
|
2161
|
+
function Zt() {
|
|
2162
|
+
U.renderer.add("Enum", { renderTableDefault(e, t) {
|
|
2047
2163
|
if ([null, void 0].includes(t.row[t.column.field])) return "-";
|
|
2048
|
-
let n = t.row[t.column.field], { label: r, labelEn: i, tag: a, color: o } = e.enum.getItem(n), { locale: s } =
|
|
2049
|
-
return e.type == "tag" ? o ? g(
|
|
2164
|
+
let n = t.row[t.column.field], { label: r, labelEn: i, tag: a, color: o } = e.enum.getItem(n), { locale: s } = V(), c = s.value == "zh_cn" ? r : i;
|
|
2165
|
+
return e.type == "tag" ? o ? g(Jt, { fontColor: o }, { default: () => [
|
|
2050
2166
|
h(" "),
|
|
2051
2167
|
c,
|
|
2052
2168
|
h(" ")
|
|
2053
|
-
] }) : g(
|
|
2169
|
+
] }) : g(Jt, { type: a }, { default: () => [
|
|
2054
2170
|
h(" "),
|
|
2055
2171
|
c,
|
|
2056
2172
|
h(" ")
|
|
2057
|
-
] }) : e.type == "text" ? g(
|
|
2173
|
+
] }) : e.type == "text" ? g(M("el-text"), { type: a }, { default: () => [
|
|
2058
2174
|
h(" "),
|
|
2059
2175
|
c,
|
|
2060
2176
|
h(" ")
|
|
2061
|
-
] }) : g(
|
|
2177
|
+
] }) : g(M("el-text"), null, { default: () => [
|
|
2062
2178
|
h(" "),
|
|
2063
2179
|
c,
|
|
2064
2180
|
h(" ")
|
|
2065
2181
|
] });
|
|
2066
|
-
} }),
|
|
2182
|
+
} }), U.renderer.add("InputNumber", { renderTableDefault(e, t) {
|
|
2067
2183
|
return g(n, x({
|
|
2068
2184
|
modelValue: t.row[t.column.field],
|
|
2069
2185
|
"onUpdate:modelValue": (e) => t.row[t.column.field] = e
|
|
@@ -2071,14 +2187,14 @@ function Yt() {
|
|
|
2071
2187
|
"step-strictly": !0,
|
|
2072
2188
|
"value-on-clear": 0
|
|
2073
2189
|
}), null);
|
|
2074
|
-
} }),
|
|
2075
|
-
let { locale: n } =
|
|
2190
|
+
} }), U.renderer.add("TrueFalse", { renderTableDefault(e, t) {
|
|
2191
|
+
let { locale: n } = V(), r = n.value == "zh_cn";
|
|
2076
2192
|
return g(s, { type: t.row[t.column.field] ? "success" : "danger" }, { default: () => [t.row[t.column.field] ? r ? "是" : "YES" : r ? "否" : "NO"] });
|
|
2077
|
-
} }),
|
|
2078
|
-
let { locale: n } =
|
|
2193
|
+
} }), U.renderer.add("I18n", { renderTableDefault(e, t) {
|
|
2194
|
+
let { locale: n } = V(), r = n.value == "zh_cn" ? t.column.field : e.fieldEn;
|
|
2079
2195
|
return t.row[r] || t.row[t.column.field];
|
|
2080
|
-
} }),
|
|
2081
|
-
let n = t.column.field, i =
|
|
2196
|
+
} }), U.renderer.add("Link", { renderTableDefault(e, t) {
|
|
2197
|
+
let n = t.column.field, i = W(), { multiple: a, to: o, openType: s = "system" } = e, c = t.row[n];
|
|
2082
2198
|
function l(e, t) {
|
|
2083
2199
|
s == "blank" ? window.open(e) : i.push({
|
|
2084
2200
|
path: e,
|
|
@@ -2091,17 +2207,17 @@ function Yt() {
|
|
|
2091
2207
|
underline: "never",
|
|
2092
2208
|
type: "primary",
|
|
2093
2209
|
onclick: () => l(s == "stystem" ? o : t, t)
|
|
2094
|
-
},
|
|
2210
|
+
}, Yt(t) ? t : { default: () => [t] }), n < e.length - 1 ? "," : ""]));
|
|
2095
2211
|
}
|
|
2096
2212
|
return g(r, {
|
|
2097
2213
|
underline: "never",
|
|
2098
2214
|
type: "primary",
|
|
2099
2215
|
onclick: () => l(s == "stystem" ? o : c, c)
|
|
2100
|
-
},
|
|
2216
|
+
}, Yt(c) ? c : { default: () => [c] });
|
|
2101
2217
|
} });
|
|
2102
2218
|
}
|
|
2103
|
-
function
|
|
2104
|
-
|
|
2219
|
+
function Qt() {
|
|
2220
|
+
Xt(), Zt();
|
|
2105
2221
|
}
|
|
2106
2222
|
//#endregion
|
|
2107
|
-
export {
|
|
2223
|
+
export { et as CmpDictionary, rt as CmpIcon, at as ConfrimButton, Tt as DownExcelTemp, ct as ImportButton, be as LayOutForm, jt as Layer, wt as ListPage, Nt as OnePortalCasSDK, mt as SearchBar, Ge as StatusMap, He as _toRaw, zt as _typeOf, Ke as arrToStatusMap, Ue as arrayToTree, Ye as checkFileSize, Mt as creatValidator, Ze as createImportFields, Xe as createListPageId, X as en_us, ke as exportExcel, Re as exportExcelMuilti, Ft as formatMoney, Pt as formatNumber, It as formatPercent, Z as getI18n, Q as getI18nT, vt as getListPageConfig, Ht as getLocaleValue, Qe as getValueBykey, De as importExcel, Ie as importExcelMuilti, we as messages, Xt as registerVxeFormatters, Qt as registerVxePlugins, Zt as registerVxeRenderers, yt as resetListPageConfig, _t as setListPageConfig, Ee as setupI18n, Ve as sleep, We as stringToArray, qe as stripHtmlTags, Je as unicode2Str, Gt as useActions, Rt as useDatePicker, Wt as useGetters, Vt as useI18nReState, Lt as useRequest, Ut as useState, Y as zh_cn };
|