joy-admin-components 0.1.35 → 0.1.36
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.
- package/README.md +509 -13
- package/dist/joy-admin-components.es.js +1291 -826
- package/dist/joy-admin-components.umd.js +2 -1
- package/dist/style.css +1 -1
- package/package.json +11 -6
- package/src/components/DownExcelTemp/index.d.ts +20 -0
- package/src/components/VxeTable/index.d.ts +23 -0
- package/src/index.d.ts +5 -0
- package/src/utils/index.d.ts +8 -69
|
@@ -1,48 +1,502 @@
|
|
|
1
|
-
import { ElForm as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { createNamespacedHelpers as
|
|
10
|
-
|
|
1
|
+
import { ElForm as ft, ElRow as ht, ElCol as mt, ElInputNumber as pt, ElText as gt, ElLink as Ue } from "element-plus";
|
|
2
|
+
import { defineComponent as Ye, ref as q, onMounted as He, h as xe, mergeModels as je, useAttrs as vt, useModel as bt, computed as ue, resolveComponent as O, openBlock as T, createBlock as U, mergeProps as pe, unref as K, withCtx as M, renderSlot as se, createVNode as G, createTextVNode as te, toDisplayString as ne, createCommentVNode as ie, createElementBlock as re, Fragment as _e, renderList as Ne, withModifiers as $e, createElementVNode as ae, resolveDynamicComponent as Ke, withKeys as yt, normalizeStyle as Ct, normalizeClass as Se, reactive as ve, nextTick as we, onUnmounted as xt, watch as Ze } from "vue";
|
|
3
|
+
import { saveAs as wt } from "file-saver";
|
|
4
|
+
import Ge from "exceljs";
|
|
5
|
+
import Je, { dayjs as qe } from "dayjs";
|
|
6
|
+
import { createI18n as kt, useI18n as de } from "vue-i18n";
|
|
7
|
+
import { debounce as We, cloneDeep as Qe, isArray as Pe } from "lodash";
|
|
8
|
+
import ee from "crypto-js";
|
|
9
|
+
import { createNamespacedHelpers as Fe, useStore as Xe, mapState as _t, mapGetters as $t, mapActions as St } from "vuex";
|
|
10
|
+
import { VxeUI as me } from "vxe-pc-ui";
|
|
11
|
+
import { useRouter as Et } from "vue-router";
|
|
12
|
+
const gn = Ye({
|
|
11
13
|
name: "LayOutForm",
|
|
12
|
-
setup(n, { slots: e, attrs: t, emit:
|
|
13
|
-
const
|
|
14
|
-
(
|
|
14
|
+
setup(n, { slots: e, attrs: t, emit: l }) {
|
|
15
|
+
const o = q(null), r = () => e.default ? e.default().filter((c) => c.type !== Symbol.for("v-cmt")).map((c) => c.type === Symbol.for("v-fgt") ? c.children : c).flat().map(
|
|
16
|
+
(c) => {
|
|
15
17
|
var s;
|
|
16
|
-
return
|
|
17
|
-
|
|
18
|
-
{ span: ((s =
|
|
18
|
+
return xe(
|
|
19
|
+
mt,
|
|
20
|
+
{ span: ((s = c.props) == null ? void 0 : s.span) || 24 },
|
|
19
21
|
{
|
|
20
|
-
default: () =>
|
|
22
|
+
default: () => c
|
|
21
23
|
}
|
|
22
24
|
);
|
|
23
25
|
}
|
|
24
26
|
) : null;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
He(() => {
|
|
28
|
+
l("ref", o.value);
|
|
27
29
|
});
|
|
28
|
-
function
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
{ ...t, ref:
|
|
32
|
-
() =>
|
|
30
|
+
function a() {
|
|
31
|
+
return xe(
|
|
32
|
+
ft,
|
|
33
|
+
{ ...t, ref: o },
|
|
34
|
+
() => xe(ht, { gutter: t.gutter ?? 20 }, { default: () => r() })
|
|
33
35
|
);
|
|
34
36
|
}
|
|
35
|
-
return
|
|
37
|
+
return a;
|
|
36
38
|
}
|
|
37
39
|
});
|
|
38
|
-
|
|
40
|
+
var et = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
41
|
+
function tt(n) {
|
|
42
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
43
|
+
}
|
|
44
|
+
var nt = { exports: {} };
|
|
45
|
+
(function(n, e) {
|
|
46
|
+
(function(t, l) {
|
|
47
|
+
n.exports = l();
|
|
48
|
+
})(et, function() {
|
|
49
|
+
var t = "minute", l = /[+-]\d\d(?::?\d\d)?/g, o = /([+-]|\d\d)/g;
|
|
50
|
+
return function(r, a, c) {
|
|
51
|
+
var s = a.prototype;
|
|
52
|
+
c.utc = function(u) {
|
|
53
|
+
var f = { date: u, utc: !0, args: arguments };
|
|
54
|
+
return new a(f);
|
|
55
|
+
}, s.utc = function(u) {
|
|
56
|
+
var f = c(this.toDate(), { locale: this.$L, utc: !0 });
|
|
57
|
+
return u ? f.add(this.utcOffset(), t) : f;
|
|
58
|
+
}, s.local = function() {
|
|
59
|
+
return c(this.toDate(), { locale: this.$L, utc: !1 });
|
|
60
|
+
};
|
|
61
|
+
var v = s.parse;
|
|
62
|
+
s.parse = function(u) {
|
|
63
|
+
u.utc && (this.$u = !0), this.$utils().u(u.$offset) || (this.$offset = u.$offset), v.call(this, u);
|
|
64
|
+
};
|
|
65
|
+
var p = s.init;
|
|
66
|
+
s.init = function() {
|
|
67
|
+
if (this.$u) {
|
|
68
|
+
var u = this.$d;
|
|
69
|
+
this.$y = u.getUTCFullYear(), this.$M = u.getUTCMonth(), this.$D = u.getUTCDate(), this.$W = u.getUTCDay(), this.$H = u.getUTCHours(), this.$m = u.getUTCMinutes(), this.$s = u.getUTCSeconds(), this.$ms = u.getUTCMilliseconds();
|
|
70
|
+
} else
|
|
71
|
+
p.call(this);
|
|
72
|
+
};
|
|
73
|
+
var k = s.utcOffset;
|
|
74
|
+
s.utcOffset = function(u, f) {
|
|
75
|
+
var $ = this.$utils().u;
|
|
76
|
+
if ($(u))
|
|
77
|
+
return this.$u ? 0 : $(this.$offset) ? k.call(this) : this.$offset;
|
|
78
|
+
if (typeof u == "string" && (u = function(F) {
|
|
79
|
+
F === void 0 && (F = "");
|
|
80
|
+
var Y = F.match(l);
|
|
81
|
+
if (!Y)
|
|
82
|
+
return null;
|
|
83
|
+
var _ = ("" + Y[0]).match(o) || ["-", 0, 0], y = _[0], g = 60 * +_[1] + +_[2];
|
|
84
|
+
return g === 0 ? 0 : y === "+" ? g : -g;
|
|
85
|
+
}(u), u === null))
|
|
86
|
+
return this;
|
|
87
|
+
var h = Math.abs(u) <= 16 ? 60 * u : u;
|
|
88
|
+
if (h === 0)
|
|
89
|
+
return this.utc(f);
|
|
90
|
+
var m = this.clone();
|
|
91
|
+
if (f)
|
|
92
|
+
return m.$offset = h, m.$u = !1, m;
|
|
93
|
+
var E = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
|
|
94
|
+
return (m = this.local().add(h + E, t)).$offset = h, m.$x.$localOffset = E, m;
|
|
95
|
+
};
|
|
96
|
+
var x = s.format;
|
|
97
|
+
s.format = function(u) {
|
|
98
|
+
var f = u || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
|
|
99
|
+
return x.call(this, f);
|
|
100
|
+
}, s.valueOf = function() {
|
|
101
|
+
var u = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
|
|
102
|
+
return this.$d.valueOf() - 6e4 * u;
|
|
103
|
+
}, s.isUTC = function() {
|
|
104
|
+
return !!this.$u;
|
|
105
|
+
}, s.toISOString = function() {
|
|
106
|
+
return this.toDate().toISOString();
|
|
107
|
+
}, s.toString = function() {
|
|
108
|
+
return this.toDate().toUTCString();
|
|
109
|
+
};
|
|
110
|
+
var w = s.toDate;
|
|
111
|
+
s.toDate = function(u) {
|
|
112
|
+
return u === "s" && this.$offset ? c(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : w.call(this);
|
|
113
|
+
};
|
|
114
|
+
var b = s.diff;
|
|
115
|
+
s.diff = function(u, f, $) {
|
|
116
|
+
if (u && this.$u === u.$u)
|
|
117
|
+
return b.call(this, u, f, $);
|
|
118
|
+
var h = this.local(), m = c(u).local();
|
|
119
|
+
return b.call(h, m, f, $);
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
});
|
|
123
|
+
})(nt);
|
|
124
|
+
var It = nt.exports;
|
|
125
|
+
const Tt = /* @__PURE__ */ tt(It);
|
|
126
|
+
var ot = { exports: {} };
|
|
127
|
+
(function(n, e) {
|
|
128
|
+
(function(t, l) {
|
|
129
|
+
n.exports = l();
|
|
130
|
+
})(et, function() {
|
|
131
|
+
var t = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, l = {};
|
|
132
|
+
return function(o, r, a) {
|
|
133
|
+
var c, s = function(x, w, b) {
|
|
134
|
+
b === void 0 && (b = {});
|
|
135
|
+
var u = new Date(x), f = function($, h) {
|
|
136
|
+
h === void 0 && (h = {});
|
|
137
|
+
var m = h.timeZoneName || "short", E = $ + "|" + m, F = l[E];
|
|
138
|
+
return F || (F = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: $, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: m }), l[E] = F), F;
|
|
139
|
+
}(w, b);
|
|
140
|
+
return f.formatToParts(u);
|
|
141
|
+
}, v = function(x, w) {
|
|
142
|
+
for (var b = s(x, w), u = [], f = 0; f < b.length; f += 1) {
|
|
143
|
+
var $ = b[f], h = $.type, m = $.value, E = t[h];
|
|
144
|
+
E >= 0 && (u[E] = parseInt(m, 10));
|
|
145
|
+
}
|
|
146
|
+
var F = u[3], Y = F === 24 ? 0 : F, _ = u[0] + "-" + u[1] + "-" + u[2] + " " + Y + ":" + u[4] + ":" + u[5] + ":000", y = +x;
|
|
147
|
+
return (a.utc(_).valueOf() - (y -= y % 1e3)) / 6e4;
|
|
148
|
+
}, p = r.prototype;
|
|
149
|
+
p.tz = function(x, w) {
|
|
150
|
+
x === void 0 && (x = c);
|
|
151
|
+
var b, u = this.utcOffset(), f = this.toDate(), $ = f.toLocaleString("en-US", { timeZone: x }), h = Math.round((f - new Date($)) / 1e3 / 60), m = 15 * -Math.round(f.getTimezoneOffset() / 15) - h;
|
|
152
|
+
if (!Number(m))
|
|
153
|
+
b = this.utcOffset(0, w);
|
|
154
|
+
else if (b = a($, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(m, !0), w) {
|
|
155
|
+
var E = b.utcOffset();
|
|
156
|
+
b = b.add(u - E, "minute");
|
|
157
|
+
}
|
|
158
|
+
return b.$x.$timezone = x, b;
|
|
159
|
+
}, p.offsetName = function(x) {
|
|
160
|
+
var w = this.$x.$timezone || a.tz.guess(), b = s(this.valueOf(), w, { timeZoneName: x }).find(function(u) {
|
|
161
|
+
return u.type.toLowerCase() === "timezonename";
|
|
162
|
+
});
|
|
163
|
+
return b && b.value;
|
|
164
|
+
};
|
|
165
|
+
var k = p.startOf;
|
|
166
|
+
p.startOf = function(x, w) {
|
|
167
|
+
if (!this.$x || !this.$x.$timezone)
|
|
168
|
+
return k.call(this, x, w);
|
|
169
|
+
var b = a(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
|
|
170
|
+
return k.call(b, x, w).tz(this.$x.$timezone, !0);
|
|
171
|
+
}, a.tz = function(x, w, b) {
|
|
172
|
+
var u = b && w, f = b || w || c, $ = v(+a(), f);
|
|
173
|
+
if (typeof x != "string")
|
|
174
|
+
return a(x).tz(f);
|
|
175
|
+
var h = function(Y, _, y) {
|
|
176
|
+
var g = Y - 60 * _ * 1e3, P = v(g, y);
|
|
177
|
+
if (_ === P)
|
|
178
|
+
return [g, _];
|
|
179
|
+
var z = v(g -= 60 * (P - _) * 1e3, y);
|
|
180
|
+
return P === z ? [g, P] : [Y - 60 * Math.min(P, z) * 1e3, Math.max(P, z)];
|
|
181
|
+
}(a.utc(x, u).valueOf(), $, f), m = h[0], E = h[1], F = a(m).utcOffset(E);
|
|
182
|
+
return F.$x.$timezone = f, F;
|
|
183
|
+
}, a.tz.guess = function() {
|
|
184
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
185
|
+
}, a.tz.setDefault = function(x) {
|
|
186
|
+
c = x;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
});
|
|
190
|
+
})(ot);
|
|
191
|
+
var Ft = ot.exports;
|
|
192
|
+
const Lt = /* @__PURE__ */ tt(Ft), Ee = {
|
|
193
|
+
// 组件通用文本
|
|
194
|
+
"dao-ru": "导入",
|
|
195
|
+
"quan-xuan": "全选",
|
|
196
|
+
"xia-zai-dao-ru-mo-ban": "下载导入模板",
|
|
197
|
+
"xu-hao": "序号",
|
|
198
|
+
"qing-shu-ru": "请输入",
|
|
199
|
+
"qing-xuan-ze": "请选择",
|
|
200
|
+
"kai-shi-shi-jian": "开始时间",
|
|
201
|
+
"jie-shu-shi-jian": "结束时间",
|
|
202
|
+
"shai-xuan": "筛选",
|
|
203
|
+
"chong-zhi": "重置",
|
|
204
|
+
"guan-bi": "关闭",
|
|
205
|
+
"zhan-kai": "展开",
|
|
206
|
+
// Excel 工具相关
|
|
207
|
+
excel: {
|
|
208
|
+
fieldsMappingRequired: "请输入列字段映射",
|
|
209
|
+
invalidInput: "非法输入",
|
|
210
|
+
invalidOption: "请输入有效选项!",
|
|
211
|
+
copyFailed: "复制失败"
|
|
212
|
+
},
|
|
213
|
+
// 表单验证相关
|
|
214
|
+
validate: {
|
|
215
|
+
invalidInput: "请输入正确内容"
|
|
216
|
+
},
|
|
217
|
+
// 工具函数相关
|
|
218
|
+
tools: {
|
|
219
|
+
keysLengthError: "keys 长度必须大于2 默认前两位为 label value"
|
|
220
|
+
}
|
|
221
|
+
}, Ie = {
|
|
222
|
+
// Common component text
|
|
223
|
+
"dao-ru": "Import",
|
|
224
|
+
"quan-xuan": "Select All",
|
|
225
|
+
"xia-zai-dao-ru-mo-ban": "Download Import Template",
|
|
226
|
+
"xu-hao": "No.",
|
|
227
|
+
"qing-shu-ru": "Please enter",
|
|
228
|
+
"qing-xuan-ze": "Please select",
|
|
229
|
+
"kai-shi-shi-jian": "Start Time",
|
|
230
|
+
"jie-shu-shi-jian": "End Time",
|
|
231
|
+
"shai-xuan": "Filter",
|
|
232
|
+
"chong-zhi": "Reset",
|
|
233
|
+
"guan-bi": "Collapse",
|
|
234
|
+
"zhan-kai": "Expand",
|
|
235
|
+
// Excel utilities
|
|
236
|
+
excel: {
|
|
237
|
+
fieldsMappingRequired: "Please enter column field mapping",
|
|
238
|
+
invalidInput: "Invalid input",
|
|
239
|
+
invalidOption: "Please enter a valid option!",
|
|
240
|
+
copyFailed: "Copy failed"
|
|
241
|
+
},
|
|
242
|
+
// Form validation
|
|
243
|
+
validate: {
|
|
244
|
+
invalidInput: "Please enter valid content"
|
|
245
|
+
},
|
|
246
|
+
// Tool functions
|
|
247
|
+
tools: {
|
|
248
|
+
keysLengthError: "Keys length must be greater than 2, default first two are label and value"
|
|
249
|
+
}
|
|
250
|
+
}, Ot = {
|
|
251
|
+
zh_cn: Ee,
|
|
252
|
+
en: Ie
|
|
253
|
+
};
|
|
254
|
+
let ce = null;
|
|
255
|
+
function Dt(n = null) {
|
|
256
|
+
if (n) {
|
|
257
|
+
const { global: e } = n;
|
|
258
|
+
return e.messages.value.zh_cn ? e.mergeLocaleMessage("zh_cn", Ee) : e.setLocaleMessage("zh_cn", Ee), e.messages.value.en ? e.mergeLocaleMessage("en", Ie) : e.setLocaleMessage("en", Ie), ce = n, n;
|
|
259
|
+
}
|
|
260
|
+
return ce || (ce = kt({
|
|
261
|
+
legacy: !1,
|
|
262
|
+
locale: "zh_cn",
|
|
263
|
+
fallbackLocale: "zh_cn",
|
|
264
|
+
messages: Ot
|
|
265
|
+
})), ce;
|
|
266
|
+
}
|
|
267
|
+
function lt() {
|
|
268
|
+
return ce || Dt();
|
|
269
|
+
}
|
|
270
|
+
function Le() {
|
|
271
|
+
return lt().global.t;
|
|
272
|
+
}
|
|
273
|
+
Je.extend(Tt);
|
|
274
|
+
Je.extend(Lt);
|
|
275
|
+
async function vn(n, e) {
|
|
276
|
+
const { fields: t, range: l = 1 } = e;
|
|
277
|
+
if (!t) {
|
|
278
|
+
const a = Le();
|
|
279
|
+
throw new Error(a("excel.fieldsMappingRequired"));
|
|
280
|
+
}
|
|
281
|
+
let o = new Ge.Workbook();
|
|
282
|
+
await o.xlsx.load(n);
|
|
283
|
+
const r = {};
|
|
284
|
+
return o.eachSheet(function(a, c) {
|
|
285
|
+
const s = [];
|
|
286
|
+
a.eachRow(function(v, p) {
|
|
287
|
+
if (p > l) {
|
|
288
|
+
let k = {}, x = !0;
|
|
289
|
+
Object.keys(t).forEach((w) => {
|
|
290
|
+
const b = v.getCell(t[w]).value;
|
|
291
|
+
k[w] = b, b && (x = !1);
|
|
292
|
+
}), x || s.push(k);
|
|
293
|
+
}
|
|
294
|
+
}), r[a._name] = s;
|
|
295
|
+
}), o = null, r;
|
|
296
|
+
}
|
|
297
|
+
const zt = {
|
|
298
|
+
columnWidth: 30
|
|
299
|
+
};
|
|
300
|
+
async function At(n, e, t = [], l = {}) {
|
|
301
|
+
if (!n || !e)
|
|
302
|
+
return;
|
|
303
|
+
const { columnStyle: o } = l, { columnWidth: r } = zt;
|
|
304
|
+
e.forEach((s) => {
|
|
305
|
+
s.width = s.width ? s.width : r;
|
|
306
|
+
});
|
|
307
|
+
const { workbook: a, worksheet: c } = Mt();
|
|
308
|
+
c.columns = e, c.addRows(t), o && await Rt(a, c, o);
|
|
309
|
+
try {
|
|
310
|
+
const s = await a.xlsx.writeBuffer(), v = new File([s], n, {
|
|
311
|
+
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
312
|
+
});
|
|
313
|
+
wt(v);
|
|
314
|
+
} catch (s) {
|
|
315
|
+
console.log(s);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
function Mt() {
|
|
319
|
+
const n = new Ge.Workbook();
|
|
320
|
+
n.creator = "distributor System", n.lastModifiedBy = "distributor System", n.created = /* @__PURE__ */ new Date(), n.modified = /* @__PURE__ */ new Date(), n.lastPrinted = /* @__PURE__ */ new Date();
|
|
321
|
+
const e = n.addWorksheet("Sheet1");
|
|
322
|
+
return { workbook: n, worksheet: e };
|
|
323
|
+
}
|
|
324
|
+
async function Rt(n, e, t) {
|
|
325
|
+
const l = Object.keys(t);
|
|
326
|
+
for (const o of l) {
|
|
327
|
+
const r = t[o], { type: a } = r;
|
|
328
|
+
switch (a) {
|
|
329
|
+
case "IMG":
|
|
330
|
+
await Vt(n, e, o);
|
|
331
|
+
break;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
async function Vt(n, e, t, l) {
|
|
336
|
+
const o = e.getColumn(t), r = o.values;
|
|
337
|
+
e.getColumn(t).width = 20, e.eachRow((a, c) => {
|
|
338
|
+
c > 1 && (a.height = 40);
|
|
339
|
+
});
|
|
340
|
+
for (let a = 0, c = r.length; a < c; a++) {
|
|
341
|
+
if (a < 2)
|
|
342
|
+
continue;
|
|
343
|
+
let s = r[a];
|
|
344
|
+
s && (e.getCell(o.letter + a).value = "", await Ut(n, e, s, {
|
|
345
|
+
width: 100,
|
|
346
|
+
height: 50,
|
|
347
|
+
col: o._number - 1,
|
|
348
|
+
row: a - 1
|
|
349
|
+
}));
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
async function Ut(n, e, t, l) {
|
|
353
|
+
const { col: o, row: r, width: a, height: c } = l, { success: s, base64: v } = await jt(t, 0.3);
|
|
354
|
+
if (s) {
|
|
355
|
+
const p = n.addImage({
|
|
356
|
+
base64: v,
|
|
357
|
+
extension: "jpeg"
|
|
358
|
+
});
|
|
359
|
+
e.addImage(p, {
|
|
360
|
+
tl: { col: o, row: r },
|
|
361
|
+
ext: { width: a, height: c }
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
function jt(n, e = 1) {
|
|
366
|
+
const t = new Image();
|
|
367
|
+
return t.setAttribute("crossOrigin", "anonymous"), t.crossOrigin = "anonymous", t.src = n, new Promise((l, o) => {
|
|
368
|
+
t.onload = () => {
|
|
369
|
+
const r = document.createElement("canvas");
|
|
370
|
+
r.width = t.width, r.height = t.height, r.getContext("2d").drawImage(t, 0, 0, r.width, r.height), l({
|
|
371
|
+
success: !0,
|
|
372
|
+
//canvas.toDataURL的方法将图片的绝对路径转换为base64编码
|
|
373
|
+
base64: r.toDataURL("image/jpeg", e)
|
|
374
|
+
});
|
|
375
|
+
}, t.onerror = () => {
|
|
376
|
+
l({ success: !1 });
|
|
377
|
+
};
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
function qt(n) {
|
|
381
|
+
if (n < 26)
|
|
382
|
+
return String.fromCharCode(65 + n);
|
|
383
|
+
{
|
|
384
|
+
const e = String.fromCharCode(65 + Math.floor((n - 26) / 26)), t = String.fromCharCode(65 + (n - 26) % 26);
|
|
385
|
+
return e + t;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
function bn(n) {
|
|
389
|
+
return new Promise((e) => {
|
|
390
|
+
setTimeout(() => {
|
|
391
|
+
e();
|
|
392
|
+
}, n);
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
function yn(n) {
|
|
396
|
+
return JSON.parse(JSON.stringify(n));
|
|
397
|
+
}
|
|
398
|
+
function Cn(n) {
|
|
399
|
+
let e = [], t = {}, l = (o, r) => Object.prototype.hasOwnProperty.call(o, r);
|
|
400
|
+
for (const o of n) {
|
|
401
|
+
t[o.id] = {
|
|
402
|
+
...o,
|
|
403
|
+
// 判断当前项的子项 如果map有存储就用存储的子项 否则初始化
|
|
404
|
+
children: l(t, o.id) ? t[o.id].children : []
|
|
405
|
+
};
|
|
406
|
+
const r = t[o.id];
|
|
407
|
+
o.pid == -1 ? e.push(r) : (l(t, o.pid) || (t[o.pid] = {
|
|
408
|
+
children: []
|
|
409
|
+
}), t[o.pid].children.push(r));
|
|
410
|
+
}
|
|
411
|
+
return e;
|
|
412
|
+
}
|
|
413
|
+
function rt(n, e = " ") {
|
|
414
|
+
return n ? n.split(e).filter((t) => t.trim()) : [];
|
|
415
|
+
}
|
|
416
|
+
class Be {
|
|
417
|
+
constructor(e, t = ["label", "value", "labelEn"]) {
|
|
418
|
+
this.list = e, this.map = new Map(
|
|
419
|
+
e.map((l) => {
|
|
420
|
+
let o = {
|
|
421
|
+
...l,
|
|
422
|
+
label: l[t[0]],
|
|
423
|
+
value: l[t[1]]
|
|
424
|
+
};
|
|
425
|
+
return t[2] && (o.labelEn = l[t[2]]), [l[t[1]], o];
|
|
426
|
+
})
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
getName(e, t) {
|
|
430
|
+
if (!this.has(e))
|
|
431
|
+
return "-";
|
|
432
|
+
const { label: l, labelEn: o } = this.map.get(e);
|
|
433
|
+
return (t == "zh_cn" ? l : o) || l || "-";
|
|
434
|
+
}
|
|
435
|
+
getTag(e) {
|
|
436
|
+
if (!this.has(e))
|
|
437
|
+
return "info";
|
|
438
|
+
const { tag: t = "info" } = this.map.get(e);
|
|
439
|
+
return t;
|
|
440
|
+
}
|
|
441
|
+
getItem(e) {
|
|
442
|
+
return this.has(e) ? this.map.get(e) : null;
|
|
443
|
+
}
|
|
444
|
+
getColor(e) {
|
|
445
|
+
if (!this.has(e))
|
|
446
|
+
return null;
|
|
447
|
+
const { color: t } = this.map.get(e);
|
|
448
|
+
return t;
|
|
449
|
+
}
|
|
450
|
+
has(e) {
|
|
451
|
+
return this.map.has(e);
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
function xn(n, e = [], t = "i18nName") {
|
|
455
|
+
if (n.length == 0)
|
|
456
|
+
return new Be([]);
|
|
457
|
+
if (e.length < 2) {
|
|
458
|
+
const o = Le();
|
|
459
|
+
throw new Error(o("tools.keysLengthError"));
|
|
460
|
+
}
|
|
461
|
+
let l = n.map((o) => {
|
|
462
|
+
let r = {};
|
|
463
|
+
return t && (r.labelEn = o[t]), e.forEach((a, c) => {
|
|
464
|
+
c === 0 ? r.label = o[a] : c === 1 ? r.value = o[a] : r[a] = o[a];
|
|
465
|
+
}), r;
|
|
466
|
+
});
|
|
467
|
+
return new Be(l);
|
|
468
|
+
}
|
|
469
|
+
function wn(n) {
|
|
470
|
+
return n ? n.replace(/<[^>]+>/g, "") : "";
|
|
471
|
+
}
|
|
472
|
+
function kn(n) {
|
|
473
|
+
return n ? (n.includes("\\\\u") && (n = n.replace(/\\/g, "")), n.replace(/\\u[\dA-F]{4}/gi, (e) => String.fromCharCode(parseInt(e.replace(/\\u/g, ""), 16)))) : "";
|
|
474
|
+
}
|
|
475
|
+
function _n(n, e = 10) {
|
|
476
|
+
let t = 1048576 * e;
|
|
477
|
+
return !(n.size > t);
|
|
478
|
+
}
|
|
479
|
+
function $n(n) {
|
|
480
|
+
return Array.from(10).fill(0).map((t, l) => n + "_" + l);
|
|
481
|
+
}
|
|
482
|
+
function Sn(n) {
|
|
483
|
+
let e = {};
|
|
484
|
+
return n.map((t, l) => {
|
|
485
|
+
let { key: o, option: r, type: a } = t, c = qt(l);
|
|
486
|
+
r ? e[o] = `${c}---option` : a === "image" ? e[o] = `${c}---image` : e[o] = c;
|
|
487
|
+
}), e;
|
|
488
|
+
}
|
|
489
|
+
function En(n, e) {
|
|
490
|
+
return e.split(".").reduce((t, l) => t && t[l], n);
|
|
491
|
+
}
|
|
492
|
+
const ge = (n, e) => {
|
|
39
493
|
const t = n.__vccOpts || n;
|
|
40
|
-
for (const [
|
|
41
|
-
t[
|
|
494
|
+
for (const [l, o] of e)
|
|
495
|
+
t[l] = o;
|
|
42
496
|
return t;
|
|
43
|
-
},
|
|
497
|
+
}, Pt = {
|
|
44
498
|
__name: "index",
|
|
45
|
-
props: /* @__PURE__ */
|
|
499
|
+
props: /* @__PURE__ */ je({
|
|
46
500
|
api: {
|
|
47
501
|
type: Function
|
|
48
502
|
},
|
|
@@ -50,16 +504,14 @@ const K = (n, e) => {
|
|
|
50
504
|
type: Boolean,
|
|
51
505
|
default: !0
|
|
52
506
|
},
|
|
53
|
-
optionClick: {
|
|
54
|
-
type: Function
|
|
55
|
-
},
|
|
56
507
|
maxLimit: {
|
|
57
508
|
type: Number,
|
|
58
509
|
default: void 0
|
|
59
510
|
},
|
|
60
|
-
|
|
61
|
-
type:
|
|
62
|
-
default:
|
|
511
|
+
optionClick: {
|
|
512
|
+
type: Function,
|
|
513
|
+
default: () => {
|
|
514
|
+
}
|
|
63
515
|
},
|
|
64
516
|
data: {
|
|
65
517
|
type: Array
|
|
@@ -80,116 +532,116 @@ const K = (n, e) => {
|
|
|
80
532
|
modelValue: {},
|
|
81
533
|
modelModifiers: {}
|
|
82
534
|
}),
|
|
83
|
-
emits: /* @__PURE__ */
|
|
535
|
+
emits: /* @__PURE__ */ je(["success", "change"], ["update:modelValue"]),
|
|
84
536
|
setup(n, { emit: e }) {
|
|
85
|
-
const t = n,
|
|
537
|
+
const t = n, l = vt(), { t: o, locale: r } = de(), a = bt(n, "modelValue"), c = q(""), s = ue(() => {
|
|
538
|
+
if (l.remote !== void 0)
|
|
539
|
+
return t.data;
|
|
540
|
+
const h = rt(c.value), { data: m, labelValue: E } = t, F = m || k.value;
|
|
541
|
+
if (h.length == 0)
|
|
542
|
+
return F;
|
|
543
|
+
const { label: Y, labelEn: _ } = E;
|
|
544
|
+
let y = r.value == "en_us" ? _ || "i18nName" : Y;
|
|
545
|
+
return h.length == 1 ? F.filter(
|
|
546
|
+
(P) => P[y].toLowerCase().includes(h[0].toLowerCase())
|
|
547
|
+
) : F.filter((P) => {
|
|
548
|
+
let z = !1;
|
|
549
|
+
return z = h.some((fe) => P[y].toLowerCase() == fe.toLowerCase()), z;
|
|
550
|
+
});
|
|
551
|
+
}), v = ue({
|
|
86
552
|
get() {
|
|
87
|
-
|
|
88
|
-
return !1;
|
|
89
|
-
let f = t.data ? t.data : m.value, i = Ye(
|
|
90
|
-
f.map((p) => o["value-key"] ? p : p[t.labelValue.value]),
|
|
91
|
-
r.value
|
|
92
|
-
).length == 0;
|
|
93
|
-
return r.value.length == f.length && i;
|
|
553
|
+
return l.multiple == null || a.value == null ? !1 : a.value.length == s.value.length;
|
|
94
554
|
},
|
|
95
|
-
set(
|
|
96
|
-
return
|
|
555
|
+
set(h) {
|
|
556
|
+
return h;
|
|
97
557
|
}
|
|
98
|
-
}),
|
|
99
|
-
const { data:
|
|
100
|
-
|
|
558
|
+
}), p = e, k = q([]), x = async () => {
|
|
559
|
+
const { data: h } = await t.api();
|
|
560
|
+
k.value = [...h], p("success", k);
|
|
101
561
|
};
|
|
102
|
-
t.api &&
|
|
103
|
-
const
|
|
104
|
-
if (
|
|
562
|
+
t.api && x();
|
|
563
|
+
const w = t.labelValue.label.split("-"), b = (h) => {
|
|
564
|
+
if (w.length == 1) {
|
|
105
565
|
if (t.changeLocal)
|
|
106
|
-
return
|
|
107
|
-
let
|
|
108
|
-
return
|
|
566
|
+
return o(h[t.labelValue.label]);
|
|
567
|
+
let m = r.value == "en_us" ? h[t.labelValue.labelEn || "i18nName"] : h[t.labelValue.label];
|
|
568
|
+
return m = m || h[t.labelValue.label], m;
|
|
109
569
|
} else {
|
|
110
|
-
let
|
|
111
|
-
return
|
|
112
|
-
|
|
113
|
-
}),
|
|
570
|
+
let m = [];
|
|
571
|
+
return w.forEach((E) => {
|
|
572
|
+
m.push(h[E]);
|
|
573
|
+
}), m.join("-");
|
|
114
574
|
}
|
|
115
575
|
};
|
|
116
|
-
function
|
|
117
|
-
|
|
118
|
-
r.value = f ? i.map((p) => o["value-key"] ? p : p[t.labelValue.value]) : [], ge(() => {
|
|
119
|
-
s("change", r.value);
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
function d(f) {
|
|
123
|
-
t.optionClick && t.optionClick(f), t.optionClick && s("change", o["value-key"] ? f : f[t.labelValue.value]);
|
|
576
|
+
function u(h) {
|
|
577
|
+
a.value = h ? s.value.map((m) => m[t.labelValue.value]) : [], p("change", a.value);
|
|
124
578
|
}
|
|
125
|
-
function
|
|
126
|
-
|
|
579
|
+
function f(h) {
|
|
580
|
+
t.optionClick(h), p("change", l["value-key"] ? h : h[t.labelValue.value]);
|
|
127
581
|
}
|
|
128
|
-
function h
|
|
129
|
-
return
|
|
582
|
+
function $(h) {
|
|
583
|
+
return a.value.length >= t.maxLimit && !a.value.includes(h[t.labelValue.value]);
|
|
130
584
|
}
|
|
131
|
-
return (
|
|
132
|
-
const
|
|
133
|
-
return
|
|
134
|
-
modelValue:
|
|
135
|
-
"onUpdate:modelValue":
|
|
136
|
-
}, R(o), {
|
|
585
|
+
return (h, m) => {
|
|
586
|
+
const E = O("el-checkbox"), F = O("el-option"), Y = O("el-select");
|
|
587
|
+
return T(), U(Y, pe({
|
|
588
|
+
modelValue: a.value,
|
|
589
|
+
"onUpdate:modelValue": m[1] || (m[1] = (_) => a.value = _),
|
|
137
590
|
filterable: "",
|
|
138
591
|
"collapse-tags": "",
|
|
139
592
|
"collapse-tags-tooltip": "",
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
F(p, {
|
|
593
|
+
"filter-method": K(l).remote != null ? void 0 : (_) => c.value = _,
|
|
594
|
+
clearable: ""
|
|
595
|
+
}, K(l), { onClear: n.optionClick }), {
|
|
596
|
+
default: M(() => [
|
|
597
|
+
K(l).multiple != null && n.showCheckAll && n.maxLimit == null ? se(h.$slots, "header", { key: 0 }, () => [
|
|
598
|
+
G(E, {
|
|
147
599
|
class: "mgl20",
|
|
148
|
-
modelValue:
|
|
149
|
-
"onUpdate:modelValue":
|
|
150
|
-
onChange:
|
|
600
|
+
modelValue: v.value,
|
|
601
|
+
"onUpdate:modelValue": m[0] || (m[0] = (_) => v.value = _),
|
|
602
|
+
onChange: u
|
|
151
603
|
}, {
|
|
152
|
-
default:
|
|
153
|
-
|
|
604
|
+
default: M(() => [
|
|
605
|
+
te(ne(h.$t("quan-xuan")), 1)
|
|
154
606
|
]),
|
|
155
607
|
_: 1
|
|
156
608
|
}, 8, ["modelValue"])
|
|
157
|
-
], !0) :
|
|
158
|
-
(
|
|
159
|
-
key:
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
onClick:
|
|
163
|
-
value:
|
|
164
|
-
}, null, 8, ["
|
|
609
|
+
], !0) : ie("", !0),
|
|
610
|
+
(T(!0), re(_e, null, Ne(s.value, (_, y) => (T(), U(F, {
|
|
611
|
+
key: y,
|
|
612
|
+
label: b(_),
|
|
613
|
+
disabled: K(l).multiple != null && n.maxLimit > 0 ? $(_) : !1,
|
|
614
|
+
onClick: $e((g) => f(_), ["stop"]),
|
|
615
|
+
value: K(l)["value-key"] ? _ : _[n.labelValue.value]
|
|
616
|
+
}, null, 8, ["label", "disabled", "onClick", "value"]))), 128))
|
|
165
617
|
]),
|
|
166
618
|
_: 3
|
|
167
|
-
}, 16, ["modelValue"]);
|
|
619
|
+
}, 16, ["modelValue", "filter-method", "onClear"]);
|
|
168
620
|
};
|
|
169
621
|
}
|
|
170
|
-
},
|
|
622
|
+
}, Bt = /* @__PURE__ */ ge(Pt, [["__scopeId", "data-v-34eb8641"]]), In = {
|
|
171
623
|
__name: "index",
|
|
172
624
|
emits: ["ok", "no"],
|
|
173
625
|
setup(n, { emit: e }) {
|
|
174
|
-
const t = e,
|
|
626
|
+
const t = e, l = We(() => {
|
|
175
627
|
t("ok");
|
|
176
628
|
}, 500);
|
|
177
|
-
function
|
|
629
|
+
function o() {
|
|
178
630
|
t("no");
|
|
179
631
|
}
|
|
180
|
-
return (
|
|
181
|
-
const
|
|
182
|
-
return
|
|
183
|
-
onConfirm:
|
|
184
|
-
onCancel:
|
|
632
|
+
return (r, a) => {
|
|
633
|
+
const c = O("el-link"), s = O("el-popconfirm");
|
|
634
|
+
return T(), U(s, pe(r.$attrs, {
|
|
635
|
+
onConfirm: K(l),
|
|
636
|
+
onCancel: o
|
|
185
637
|
}), {
|
|
186
|
-
reference:
|
|
187
|
-
|
|
638
|
+
reference: M(() => [
|
|
639
|
+
G(c, {
|
|
188
640
|
underline: "never",
|
|
189
|
-
type:
|
|
641
|
+
type: r.$attrs.type
|
|
190
642
|
}, {
|
|
191
|
-
default:
|
|
192
|
-
|
|
643
|
+
default: M(() => [
|
|
644
|
+
se(r.$slots, "default")
|
|
193
645
|
]),
|
|
194
646
|
_: 3
|
|
195
647
|
}, 8, ["type"])
|
|
@@ -199,7 +651,7 @@ const K = (n, e) => {
|
|
|
199
651
|
};
|
|
200
652
|
}
|
|
201
653
|
};
|
|
202
|
-
const
|
|
654
|
+
const Yt = ["accept"], Ht = {
|
|
203
655
|
__name: "index",
|
|
204
656
|
props: {
|
|
205
657
|
accept: {
|
|
@@ -213,37 +665,37 @@ const Ke = ["accept"], Ze = {
|
|
|
213
665
|
},
|
|
214
666
|
emits: ["fileChange"],
|
|
215
667
|
setup(n, { emit: e }) {
|
|
216
|
-
const t = e,
|
|
217
|
-
function
|
|
218
|
-
let
|
|
219
|
-
t("fileChange",
|
|
668
|
+
const t = e, l = q(null);
|
|
669
|
+
function o(r) {
|
|
670
|
+
let a = r.target.files[0];
|
|
671
|
+
t("fileChange", a), l.value.value = null;
|
|
220
672
|
}
|
|
221
|
-
return (
|
|
222
|
-
const
|
|
223
|
-
return
|
|
224
|
-
|
|
673
|
+
return (r, a) => {
|
|
674
|
+
const c = O("el-button");
|
|
675
|
+
return T(), re("span", null, [
|
|
676
|
+
G(c, {
|
|
225
677
|
loading: n.loading,
|
|
226
678
|
class: "mgr10",
|
|
227
|
-
onClick:
|
|
679
|
+
onClick: a[0] || (a[0] = (s) => l.value.click())
|
|
228
680
|
}, {
|
|
229
|
-
default:
|
|
230
|
-
|
|
681
|
+
default: M(() => [
|
|
682
|
+
te(ne(r.$t("dao-ru")), 1)
|
|
231
683
|
]),
|
|
232
684
|
_: 1
|
|
233
685
|
}, 8, ["loading"]),
|
|
234
|
-
|
|
235
|
-
onChange:
|
|
686
|
+
ae("input", {
|
|
687
|
+
onChange: o,
|
|
236
688
|
ref_key: "input",
|
|
237
|
-
ref:
|
|
689
|
+
ref: l,
|
|
238
690
|
accept: n.accept,
|
|
239
691
|
style: { position: "absolute", width: "0px", height: "0px", opacity: "0" },
|
|
240
692
|
type: "file"
|
|
241
|
-
}, null, 40,
|
|
693
|
+
}, null, 40, Yt)
|
|
242
694
|
]);
|
|
243
695
|
};
|
|
244
696
|
}
|
|
245
|
-
},
|
|
246
|
-
const
|
|
697
|
+
}, Tn = /* @__PURE__ */ ge(Ht, [["__scopeId", "data-v-5f1449ad"]]);
|
|
698
|
+
const Nt = Ye({
|
|
247
699
|
props: {
|
|
248
700
|
name: {
|
|
249
701
|
tyepe: String,
|
|
@@ -251,17 +703,35 @@ const Ge = fe({
|
|
|
251
703
|
}
|
|
252
704
|
}
|
|
253
705
|
});
|
|
254
|
-
function
|
|
255
|
-
const
|
|
256
|
-
return
|
|
257
|
-
default:
|
|
258
|
-
(
|
|
706
|
+
function Kt(n, e, t, l, o, r) {
|
|
707
|
+
const a = O("el-icon");
|
|
708
|
+
return T(), U(a, { class: "cmp-icon" }, {
|
|
709
|
+
default: M(() => [
|
|
710
|
+
(T(), U(Ke(n.name)))
|
|
259
711
|
]),
|
|
260
712
|
_: 1
|
|
261
713
|
});
|
|
262
714
|
}
|
|
263
|
-
const
|
|
264
|
-
|
|
715
|
+
const at = /* @__PURE__ */ ge(Nt, [["render", Kt], ["__scopeId", "data-v-733f9daa"]]);
|
|
716
|
+
function Te(n) {
|
|
717
|
+
let e = {};
|
|
718
|
+
return n.forEach((t) => {
|
|
719
|
+
const { key: l, type: o, option: r = {}, value: a, dateType: c } = t;
|
|
720
|
+
if (l)
|
|
721
|
+
if (o == "input" && (r != null && r.multiple))
|
|
722
|
+
e[l] = rt(a);
|
|
723
|
+
else if (o == "date")
|
|
724
|
+
if (c.includes("range")) {
|
|
725
|
+
const [s, v] = l;
|
|
726
|
+
let [p, k] = a || [];
|
|
727
|
+
p && c == "daterange" && (p = qe(p).format("YYYY-MM-DD 00:00:00"), k = qe(k).format("YYYY-MM-DD 23:59:59")), e[s] = p, e[v] = k;
|
|
728
|
+
} else
|
|
729
|
+
e[l] = a;
|
|
730
|
+
else
|
|
731
|
+
e[l] = a;
|
|
732
|
+
}), e;
|
|
733
|
+
}
|
|
734
|
+
const Zt = { key: 0 }, Gt = { class: "btns" }, Jt = { class: "left" }, Wt = { class: "right" }, Qt = {
|
|
265
735
|
__name: "index",
|
|
266
736
|
props: {
|
|
267
737
|
form: {
|
|
@@ -269,73 +739,86 @@ const We = { key: 0 }, Qe = { class: "btns" }, Xe = { class: "left" }, et = { cl
|
|
|
269
739
|
required: !0
|
|
270
740
|
}
|
|
271
741
|
},
|
|
272
|
-
emits: ["confirm", "reset"],
|
|
273
|
-
setup(n, {
|
|
274
|
-
const
|
|
275
|
-
function
|
|
276
|
-
|
|
742
|
+
emits: ["confirm", "reset", "visibleChange"],
|
|
743
|
+
setup(n, { expose: e, emit: t }) {
|
|
744
|
+
const l = n, o = t, r = q(!0), a = q(null), { t: c } = de(), s = ue(() => r.value ? c("guan-bi") : c("zhan-kai"));
|
|
745
|
+
function v() {
|
|
746
|
+
o("confirm");
|
|
747
|
+
}
|
|
748
|
+
function p(f) {
|
|
749
|
+
f.option.onClear && f.option.onClear(), o("confirm");
|
|
750
|
+
}
|
|
751
|
+
function k() {
|
|
752
|
+
o("reset");
|
|
277
753
|
}
|
|
278
|
-
function
|
|
279
|
-
|
|
754
|
+
function x() {
|
|
755
|
+
o("confirm");
|
|
280
756
|
}
|
|
281
|
-
function
|
|
282
|
-
|
|
757
|
+
function w() {
|
|
758
|
+
return Te(l.form.items);
|
|
283
759
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
760
|
+
const b = Qe(l.form.items);
|
|
761
|
+
function u() {
|
|
762
|
+
l.form.items.forEach((f) => {
|
|
763
|
+
const $ = b.find((h) => h.key == f.key);
|
|
764
|
+
$ && (f.value = $.value);
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
return e({ getPrm: w, reset: u }), (f, $) => {
|
|
768
|
+
const h = O("el-input"), m = O("el-date-picker"), E = O("el-form-item"), F = O("el-form"), Y = O("el-link"), _ = O("el-button");
|
|
769
|
+
return T(), re("div", {
|
|
287
770
|
class: "searchBar-container mgt10 mgb10",
|
|
288
|
-
onKeydown:
|
|
771
|
+
onKeydown: yt(v, ["enter"])
|
|
289
772
|
}, [
|
|
290
|
-
|
|
773
|
+
ae("div", {
|
|
291
774
|
class: "searchBar",
|
|
292
|
-
style:
|
|
775
|
+
style: Ct({ height: r.value ? "auto" : "42px" })
|
|
293
776
|
}, [
|
|
294
|
-
F
|
|
777
|
+
G(F, {
|
|
295
778
|
inline: "",
|
|
296
779
|
model: n.form.data
|
|
297
780
|
}, {
|
|
298
|
-
default:
|
|
299
|
-
(
|
|
300
|
-
key:
|
|
781
|
+
default: M(() => [
|
|
782
|
+
(T(!0), re(_e, null, Ne(n.form.items.filter((y) => !y.hidden), (y) => (T(), re(_e, {
|
|
783
|
+
key: y.key
|
|
301
784
|
}, [
|
|
302
|
-
|
|
785
|
+
y.type == "br" ? (T(), re("br", Zt)) : (T(), U(E, {
|
|
303
786
|
key: 1,
|
|
304
|
-
label:
|
|
787
|
+
label: y.name
|
|
305
788
|
}, {
|
|
306
|
-
default:
|
|
307
|
-
var
|
|
789
|
+
default: M(() => {
|
|
790
|
+
var g, P;
|
|
308
791
|
return [
|
|
309
|
-
|
|
792
|
+
y.type === "input" ? (T(), U(h, {
|
|
310
793
|
key: 0,
|
|
311
|
-
modelValue:
|
|
312
|
-
"onUpdate:modelValue": (
|
|
313
|
-
class:
|
|
314
|
-
placeholder:
|
|
794
|
+
modelValue: y.value,
|
|
795
|
+
"onUpdate:modelValue": (z) => y.value = z,
|
|
796
|
+
class: Se(((g = y.option) == null ? void 0 : g.class) || "w150"),
|
|
797
|
+
placeholder: f.$t("qing-shu-ru"),
|
|
315
798
|
clearable: ""
|
|
316
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) :
|
|
317
|
-
|
|
799
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder"])) : y.type === "custom" ? (T(), U(Ke(y.render), { key: 1 })) : ie("", !0),
|
|
800
|
+
y.type === "select" ? (T(), U(Bt, pe({
|
|
318
801
|
key: 2,
|
|
319
|
-
class: ((
|
|
320
|
-
modelValue:
|
|
321
|
-
"onUpdate:modelValue": (
|
|
322
|
-
}, { ref_for: !0 },
|
|
323
|
-
onChange:
|
|
324
|
-
onClear:
|
|
325
|
-
}), null, 16, ["class", "modelValue", "onUpdate:modelValue"])) :
|
|
326
|
-
|
|
802
|
+
class: ((P = y.option) == null ? void 0 : P.class) || "w150",
|
|
803
|
+
modelValue: y.value,
|
|
804
|
+
"onUpdate:modelValue": (z) => y.value = z
|
|
805
|
+
}, { ref_for: !0 }, y.option, {
|
|
806
|
+
onChange: v,
|
|
807
|
+
onClear: (z) => p(y)
|
|
808
|
+
}), null, 16, ["class", "modelValue", "onUpdate:modelValue", "onClear"])) : ie("", !0),
|
|
809
|
+
y.type === "date" ? (T(), U(m, {
|
|
327
810
|
key: 3,
|
|
328
|
-
class:
|
|
329
|
-
modelValue:
|
|
330
|
-
"onUpdate:modelValue": (
|
|
331
|
-
"value-format": { datetimerange: "YYYY-MM-DD HH:mm:ss", daterange: "YYYY-MM-DD" }[
|
|
332
|
-
type:
|
|
333
|
-
onFocus: (
|
|
334
|
-
onChange: (
|
|
335
|
-
placeholder:
|
|
336
|
-
"start-placeholder":
|
|
337
|
-
"end-placeholder":
|
|
338
|
-
}, null, 8, ["class", "modelValue", "onUpdate:modelValue", "value-format", "type", "onFocus", "onChange", "placeholder", "start-placeholder", "end-placeholder"])) :
|
|
811
|
+
class: Se({ datetimerange: "w300", daterange: "w200" }[y.dateType] || "w100"),
|
|
812
|
+
modelValue: y.value,
|
|
813
|
+
"onUpdate:modelValue": (z) => y.value = z,
|
|
814
|
+
"value-format": { datetimerange: "YYYY-MM-DD HH:mm:ss", daterange: "YYYY-MM-DD" }[y.dateType] || "YYYY-MM-DD",
|
|
815
|
+
type: y.dateType || "date",
|
|
816
|
+
onFocus: (z) => a.value = y,
|
|
817
|
+
onChange: (z) => x(),
|
|
818
|
+
placeholder: f.$t("qing-xuan-ze"),
|
|
819
|
+
"start-placeholder": f.$t("kai-shi-shi-jian"),
|
|
820
|
+
"end-placeholder": f.$t("jie-shu-shi-jian")
|
|
821
|
+
}, null, 8, ["class", "modelValue", "onUpdate:modelValue", "value-format", "type", "onFocus", "onChange", "placeholder", "start-placeholder", "end-placeholder"])) : ie("", !0)
|
|
339
822
|
];
|
|
340
823
|
}),
|
|
341
824
|
_: 2
|
|
@@ -345,70 +828,52 @@ const We = { key: 0 }, Qe = { class: "btns" }, Xe = { class: "left" }, et = { cl
|
|
|
345
828
|
_: 1
|
|
346
829
|
}, 8, ["model"])
|
|
347
830
|
], 4),
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
831
|
+
ae("div", Gt, [
|
|
832
|
+
ae("div", Jt, [
|
|
833
|
+
se(f.$slots, "table-header-left", {}, void 0, !0)
|
|
351
834
|
]),
|
|
352
|
-
|
|
353
|
-
|
|
835
|
+
ae("div", Wt, [
|
|
836
|
+
G(Y, {
|
|
354
837
|
underline: "never",
|
|
355
838
|
class: "mgr10",
|
|
356
|
-
onClick:
|
|
839
|
+
onClick: $[0] || ($[0] = () => {
|
|
840
|
+
o("visibleChange", !r.value), r.value = !r.value;
|
|
841
|
+
})
|
|
357
842
|
}, {
|
|
358
|
-
default:
|
|
359
|
-
|
|
360
|
-
name:
|
|
843
|
+
default: M(() => [
|
|
844
|
+
G(at, {
|
|
845
|
+
name: r.value ? "ArrowUp" : "ArrowDown"
|
|
361
846
|
}, null, 8, ["name"]),
|
|
362
|
-
|
|
847
|
+
te(" " + ne(s.value), 1)
|
|
363
848
|
]),
|
|
364
849
|
_: 1
|
|
365
850
|
}),
|
|
366
|
-
|
|
851
|
+
G(_, {
|
|
367
852
|
type: "primary",
|
|
368
|
-
onClick:
|
|
853
|
+
onClick: v
|
|
369
854
|
}, {
|
|
370
|
-
default:
|
|
371
|
-
|
|
855
|
+
default: M(() => [
|
|
856
|
+
te(ne(f.$t("shai-xuan")), 1)
|
|
372
857
|
]),
|
|
373
858
|
_: 1
|
|
374
859
|
}),
|
|
375
|
-
|
|
860
|
+
G(_, {
|
|
376
861
|
type: "primary",
|
|
377
|
-
onClick:
|
|
862
|
+
onClick: k
|
|
378
863
|
}, {
|
|
379
|
-
default:
|
|
380
|
-
|
|
864
|
+
default: M(() => [
|
|
865
|
+
te(ne(f.$t("chong-zhi")), 1)
|
|
381
866
|
]),
|
|
382
867
|
_: 1
|
|
383
868
|
}),
|
|
384
|
-
|
|
869
|
+
se(f.$slots, "btn", {}, void 0, !0)
|
|
385
870
|
])
|
|
386
871
|
])
|
|
387
872
|
], 32);
|
|
388
873
|
};
|
|
389
874
|
}
|
|
390
|
-
},
|
|
391
|
-
|
|
392
|
-
return n ? Array.isArray(n) ? n : n.split(",").map((e) => e.trim()).filter(Boolean) : [];
|
|
393
|
-
}
|
|
394
|
-
function G(n) {
|
|
395
|
-
let e = {};
|
|
396
|
-
return n.forEach((t) => {
|
|
397
|
-
const { key: o, type: a, option: l = {}, value: r, dateType: u, toArr: s } = t;
|
|
398
|
-
if (a == "input" && (l != null && l.multiple))
|
|
399
|
-
e[o] = ot(r);
|
|
400
|
-
else if (a == "date")
|
|
401
|
-
if (u.includes("range")) {
|
|
402
|
-
const [m, v] = o;
|
|
403
|
-
let [_, g] = r || [];
|
|
404
|
-
_ && u == "daterange" && (_ = ie(_).format("YYYY-MM-DD 00:00:00"), g = ie(g).format("YYYY-MM-DD 23:59:59")), e[m] = _, e[v] = g;
|
|
405
|
-
} else
|
|
406
|
-
e[o] = r;
|
|
407
|
-
else
|
|
408
|
-
a == "select" ? e[o] = s ? [r] : r : e[o] = r;
|
|
409
|
-
}), e;
|
|
410
|
-
}
|
|
411
|
-
const at = { class: "center" }, rt = {
|
|
875
|
+
}, Xt = /* @__PURE__ */ ge(Qt, [["__scopeId", "data-v-32ac9990"]]);
|
|
876
|
+
const en = { class: "center" }, tn = {
|
|
412
877
|
__name: "index",
|
|
413
878
|
props: {
|
|
414
879
|
// 表格id 本地存储列设置时使用
|
|
@@ -433,7 +898,9 @@ const at = { class: "center" }, rt = {
|
|
|
433
898
|
showSearch: !1,
|
|
434
899
|
showPage: !1,
|
|
435
900
|
showShadow: !1,
|
|
436
|
-
showCheckBox: !1
|
|
901
|
+
showCheckBox: !1,
|
|
902
|
+
enableCellCopy: !0
|
|
903
|
+
// 是否启用单元格选区复制功能
|
|
437
904
|
})
|
|
438
905
|
},
|
|
439
906
|
api: {
|
|
@@ -448,198 +915,459 @@ const at = { class: "center" }, rt = {
|
|
|
448
915
|
}
|
|
449
916
|
},
|
|
450
917
|
setup(n, { expose: e }) {
|
|
451
|
-
const { t, locale:
|
|
452
|
-
|
|
918
|
+
const { t, locale: l } = de(), o = n, r = q(!1), a = q([]);
|
|
919
|
+
o.searchForm.selections = [], o.searchForm.enableCellCopy == null && (o.searchForm.enableCellCopy = !0);
|
|
920
|
+
const c = Qe(o.searchForm.items), s = o.searchForm.pageNoKey || "pageNo", v = ve({
|
|
921
|
+
[s]: 1,
|
|
453
922
|
pageSize: 10,
|
|
454
923
|
total: 0
|
|
455
|
-
}),
|
|
456
|
-
|
|
457
|
-
if (!
|
|
924
|
+
}), p = q(null), k = q(null), x = q(450), w = We(() => {
|
|
925
|
+
we(() => {
|
|
926
|
+
if (!k.value)
|
|
458
927
|
return;
|
|
459
|
-
const
|
|
460
|
-
|
|
928
|
+
const i = k.value.getBoundingClientRect(), C = window.innerHeight, I = i.top, R = 100, Z = C - I - R, V = 200;
|
|
929
|
+
x.value = Math.max(Z, V);
|
|
461
930
|
});
|
|
462
|
-
}, 100),
|
|
463
|
-
|
|
931
|
+
}, 100), b = () => {
|
|
932
|
+
w();
|
|
933
|
+
}, u = () => {
|
|
934
|
+
if (!o.searchForm.enableCellCopy)
|
|
935
|
+
return !1;
|
|
936
|
+
const d = p.value;
|
|
937
|
+
if (!d || !d.$el)
|
|
938
|
+
return !1;
|
|
939
|
+
const i = d.$el;
|
|
940
|
+
return i.classList.add("cell-copy-enabled"), i.removeEventListener("mousedown", z), i.removeEventListener("mousemove", fe), i.removeEventListener("mouseup", be), i.addEventListener("mousedown", z), i.addEventListener("mousemove", fe), i.addEventListener("mouseup", be), !0;
|
|
464
941
|
};
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
942
|
+
He(() => {
|
|
943
|
+
w(), window.addEventListener("resize", b), o.searchForm.enableCellCopy && (document.addEventListener("keydown", Ae), document.addEventListener("mouseup", Me), setTimeout(() => {
|
|
944
|
+
u();
|
|
945
|
+
}, 500));
|
|
946
|
+
}), xt(() => {
|
|
947
|
+
if (window.removeEventListener("resize", b), o.searchForm.enableCellCopy) {
|
|
948
|
+
document.removeEventListener("keydown", Ae), document.removeEventListener("mouseup", Me);
|
|
949
|
+
const d = p.value;
|
|
950
|
+
if (d && d.$el) {
|
|
951
|
+
const i = d.$el;
|
|
952
|
+
i.removeEventListener("mousedown", z), i.removeEventListener("mousemove", fe), i.removeEventListener("mouseup", be);
|
|
953
|
+
}
|
|
954
|
+
}
|
|
469
955
|
});
|
|
470
|
-
const
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
956
|
+
const f = ue(() => ye.value.height || x.value);
|
|
957
|
+
let $;
|
|
958
|
+
async function h(d) {
|
|
959
|
+
const { dataFormat: i } = o.tableConfig;
|
|
960
|
+
d.pageNo != 1 && (d.nextSearchAfter = $), r.value = !0;
|
|
961
|
+
const { code: C, data: I = {} } = await o.api(d).finally(() => {
|
|
962
|
+
r.value = !1, o.searchForm.selections = [];
|
|
476
963
|
});
|
|
477
|
-
if (
|
|
478
|
-
let
|
|
479
|
-
|
|
964
|
+
if (C == 200) {
|
|
965
|
+
let R = I.rows || I.records || [];
|
|
966
|
+
a.value = i ? i(R) : R, v.total = I.totalRows || I.total || 0, $ = I.nextSearchAfter, o.searchForm.enableCellCopy && we(() => {
|
|
967
|
+
setTimeout(() => {
|
|
968
|
+
u();
|
|
969
|
+
}, 100);
|
|
970
|
+
});
|
|
480
971
|
}
|
|
481
972
|
}
|
|
482
|
-
function
|
|
483
|
-
|
|
973
|
+
function m(d = {}) {
|
|
974
|
+
const { searchData: i = () => ({}) } = o.tableConfig, C = i();
|
|
975
|
+
h({ ...v, ...Te(o.searchForm.items), ...d, ...C });
|
|
484
976
|
}
|
|
485
|
-
|
|
486
|
-
const { reset:
|
|
487
|
-
|
|
488
|
-
const
|
|
489
|
-
|
|
490
|
-
}),
|
|
977
|
+
function E() {
|
|
978
|
+
const { reset: d } = o.tableConfig;
|
|
979
|
+
d && d(), o.searchForm.items.forEach((i) => {
|
|
980
|
+
const C = c.find((I) => Pe(i.key) && Pe(I.key) ? i.key.join(",") == I.key.join(",") : I.key == i.key);
|
|
981
|
+
C && (i.value = C.value);
|
|
982
|
+
}), m();
|
|
491
983
|
}
|
|
492
|
-
|
|
493
|
-
function
|
|
494
|
-
return { ...
|
|
984
|
+
o.api && o.immediate && m();
|
|
985
|
+
function F() {
|
|
986
|
+
return { ...v, ...Te(o.searchForm.items) };
|
|
495
987
|
}
|
|
496
|
-
const
|
|
497
|
-
|
|
498
|
-
|
|
988
|
+
const Y = () => {
|
|
989
|
+
const d = p.value;
|
|
990
|
+
d && d.clearSort();
|
|
991
|
+
}, _ = ve({
|
|
499
992
|
storage: !0
|
|
500
|
-
}),
|
|
993
|
+
}), y = ve({
|
|
994
|
+
width: "auto",
|
|
501
995
|
drag: !0,
|
|
502
996
|
resizable: !0,
|
|
503
997
|
maxFixedSize: 0
|
|
504
|
-
}),
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
998
|
+
}), g = ve({
|
|
999
|
+
isSelecting: !1,
|
|
1000
|
+
// 是否正在选择
|
|
1001
|
+
startCell: null,
|
|
1002
|
+
// 起始单元格 { rowIndex, colIndex }
|
|
1003
|
+
endCell: null,
|
|
1004
|
+
// 结束单元格
|
|
1005
|
+
selectedCells: []
|
|
1006
|
+
// 选中的单元格列表 [{ rowIndex, colIndex }]
|
|
1007
|
+
}), P = (d) => {
|
|
1008
|
+
const i = d.closest(".vxe-body--column");
|
|
1009
|
+
if (!i || i.classList.contains("col--checkbox") || i.classList.contains("col--seq"))
|
|
1010
|
+
return null;
|
|
1011
|
+
const C = i.closest(".vxe-body--row");
|
|
1012
|
+
if (!C)
|
|
1013
|
+
return null;
|
|
1014
|
+
const I = p.value;
|
|
1015
|
+
if (!I)
|
|
1016
|
+
return null;
|
|
1017
|
+
let R = -1;
|
|
1018
|
+
const Z = C.getAttribute("data-rowid");
|
|
1019
|
+
if (Z != null)
|
|
1020
|
+
R = parseInt(Z, 10);
|
|
1021
|
+
else {
|
|
1022
|
+
const L = C.parentElement;
|
|
1023
|
+
R = Array.from(L.querySelectorAll(".vxe-body--row")).indexOf(C);
|
|
1024
|
+
}
|
|
1025
|
+
if (R < 0)
|
|
1026
|
+
return null;
|
|
1027
|
+
let V = -1;
|
|
1028
|
+
const X = i.getAttribute("data-colid");
|
|
1029
|
+
if (X && (V = I.getColumns().findIndex((S) => S.id === X)), V < 0) {
|
|
1030
|
+
const S = Array.from(C.querySelectorAll(".vxe-body--column")).indexOf(i), j = !!i.closest(".vxe-table--fixed-left-wrapper"), H = !!i.closest(".vxe-table--fixed-right-wrapper"), A = I.getColumns();
|
|
1031
|
+
if (j) {
|
|
1032
|
+
const N = A.filter((B) => B.fixed === "left");
|
|
1033
|
+
S < N.length && (V = A.indexOf(N[S]));
|
|
1034
|
+
} else if (H) {
|
|
1035
|
+
const N = A.filter((B) => B.fixed === "right");
|
|
1036
|
+
S < N.length && (V = A.indexOf(N[S]));
|
|
1037
|
+
} else {
|
|
1038
|
+
const N = o.searchForm.showCheckBox ? 1 : 0;
|
|
1039
|
+
V = A.filter((J) => J.fixed === "left").length + S - N;
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
return V < 0 ? null : { rowIndex: R, colIndex: V, cell: i };
|
|
1043
|
+
}, z = (d) => {
|
|
1044
|
+
const i = P(d.target);
|
|
1045
|
+
if (!i) {
|
|
1046
|
+
Oe();
|
|
1047
|
+
return;
|
|
1048
|
+
}
|
|
1049
|
+
g.isSelecting = !0, g.startCell = {
|
|
1050
|
+
rowIndex: i.rowIndex,
|
|
1051
|
+
colIndex: i.colIndex
|
|
1052
|
+
}, g.endCell = { ...g.startCell }, De(), ze();
|
|
1053
|
+
}, fe = (d) => {
|
|
1054
|
+
if (!g.isSelecting)
|
|
1055
|
+
return;
|
|
1056
|
+
const i = P(d.target);
|
|
1057
|
+
i && (g.endCell = {
|
|
1058
|
+
rowIndex: i.rowIndex,
|
|
1059
|
+
colIndex: i.colIndex
|
|
1060
|
+
}, De(), ze());
|
|
1061
|
+
}, be = () => {
|
|
1062
|
+
g.isSelecting = !1;
|
|
1063
|
+
}, Oe = () => {
|
|
1064
|
+
g.selectedCells = [], g.startCell = null, g.endCell = null;
|
|
1065
|
+
const d = p.value;
|
|
1066
|
+
if (!d)
|
|
1067
|
+
return;
|
|
1068
|
+
d.$el.querySelectorAll(
|
|
1069
|
+
".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left"
|
|
1070
|
+
).forEach((C) => {
|
|
1071
|
+
C.classList.remove(
|
|
1072
|
+
"cell-selected",
|
|
1073
|
+
"cell-border-top",
|
|
1074
|
+
"cell-border-right",
|
|
1075
|
+
"cell-border-bottom",
|
|
1076
|
+
"cell-border-left"
|
|
1077
|
+
);
|
|
1078
|
+
});
|
|
1079
|
+
}, De = () => {
|
|
1080
|
+
if (!g.startCell || !g.endCell) {
|
|
1081
|
+
g.selectedCells = [];
|
|
1082
|
+
return;
|
|
1083
|
+
}
|
|
1084
|
+
const d = g.startCell.rowIndex, i = g.endCell.rowIndex, C = g.startCell.colIndex, I = g.endCell.colIndex, R = Math.min(d, i), Z = Math.max(d, i), V = Math.min(C, I), X = Math.max(C, I);
|
|
1085
|
+
g.selectedCells = [];
|
|
1086
|
+
for (let L = R; L <= Z; L++)
|
|
1087
|
+
for (let S = V; S <= X; S++)
|
|
1088
|
+
g.selectedCells.push({
|
|
1089
|
+
rowIndex: L,
|
|
1090
|
+
colIndex: S
|
|
1091
|
+
});
|
|
1092
|
+
}, ze = () => {
|
|
1093
|
+
we(() => {
|
|
1094
|
+
const d = p.value;
|
|
1095
|
+
if (!d)
|
|
1096
|
+
return;
|
|
1097
|
+
const i = d.$el;
|
|
1098
|
+
if (i.querySelectorAll(
|
|
1099
|
+
".cell-selected, .cell-border-top, .cell-border-right, .cell-border-bottom, .cell-border-left"
|
|
1100
|
+
).forEach((j) => {
|
|
1101
|
+
j.classList.remove(
|
|
1102
|
+
"cell-selected",
|
|
1103
|
+
"cell-border-top",
|
|
1104
|
+
"cell-border-right",
|
|
1105
|
+
"cell-border-bottom",
|
|
1106
|
+
"cell-border-left"
|
|
1107
|
+
);
|
|
1108
|
+
}), g.selectedCells.length === 0)
|
|
1109
|
+
return;
|
|
1110
|
+
const C = d.getColumns(), I = g.selectedCells.map((j) => j.rowIndex), R = g.selectedCells.map((j) => j.colIndex), Z = Math.min(...I), V = Math.max(...I), X = Math.min(...R), L = Math.max(...R), S = [
|
|
1111
|
+
i.querySelector(".vxe-table--body-wrapper tbody"),
|
|
1112
|
+
i.querySelector(".vxe-table--fixed-left-wrapper tbody"),
|
|
1113
|
+
i.querySelector(".vxe-table--fixed-right-wrapper tbody")
|
|
1114
|
+
].filter(Boolean);
|
|
1115
|
+
g.selectedCells.forEach(({ rowIndex: j, colIndex: H }) => {
|
|
1116
|
+
const A = C[H];
|
|
1117
|
+
if (!A)
|
|
1118
|
+
return;
|
|
1119
|
+
const N = A.fixed === "left", B = A.fixed === "right";
|
|
1120
|
+
for (const J of S) {
|
|
1121
|
+
const he = J.querySelectorAll(".vxe-body--row")[j];
|
|
1122
|
+
if (!he)
|
|
1123
|
+
continue;
|
|
1124
|
+
const oe = Array.from(he.querySelectorAll(".vxe-body--column"));
|
|
1125
|
+
let D = null;
|
|
1126
|
+
if (N && J.closest(".vxe-table--fixed-left-wrapper")) {
|
|
1127
|
+
const W = C.filter((Q) => Q.fixed === "left").indexOf(A);
|
|
1128
|
+
D = oe[W];
|
|
1129
|
+
} else if (B && J.closest(".vxe-table--fixed-right-wrapper")) {
|
|
1130
|
+
const W = C.filter((Q) => Q.fixed === "right").indexOf(A);
|
|
1131
|
+
D = oe[W];
|
|
1132
|
+
} else if (!N && !B && J.closest(".vxe-table--body-wrapper")) {
|
|
1133
|
+
const le = o.searchForm.showCheckBox ? 1 : 0, W = C.filter((Ce) => Ce.fixed === "left").length, Q = H - W;
|
|
1134
|
+
D = oe[Q + le];
|
|
1135
|
+
}
|
|
1136
|
+
if (D && !D.classList.contains("col--checkbox") && !D.classList.contains("col--seq")) {
|
|
1137
|
+
D.classList.add("cell-selected"), j === Z && D.classList.add("cell-border-top"), j === V && D.classList.add("cell-border-bottom"), H === X && D.classList.add("cell-border-left"), H === L && D.classList.add("cell-border-right");
|
|
1138
|
+
break;
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
});
|
|
1142
|
+
});
|
|
1143
|
+
}, it = async () => {
|
|
1144
|
+
if (g.selectedCells.length === 0)
|
|
1145
|
+
return;
|
|
1146
|
+
const d = p.value;
|
|
1147
|
+
if (!d)
|
|
1148
|
+
return;
|
|
1149
|
+
const i = d.$el, C = d.getColumns(), I = [...new Set(g.selectedCells.map((L) => L.rowIndex))].sort(
|
|
1150
|
+
(L, S) => L - S
|
|
1151
|
+
), R = [...new Set(g.selectedCells.map((L) => L.colIndex))].sort(
|
|
1152
|
+
(L, S) => L - S
|
|
1153
|
+
), Z = [
|
|
1154
|
+
i.querySelector(".vxe-table--body-wrapper tbody"),
|
|
1155
|
+
i.querySelector(".vxe-table--fixed-left-wrapper tbody"),
|
|
1156
|
+
i.querySelector(".vxe-table--fixed-right-wrapper tbody")
|
|
1157
|
+
].filter(Boolean), V = [];
|
|
1158
|
+
I.forEach((L) => {
|
|
1159
|
+
const S = [];
|
|
1160
|
+
R.forEach((j) => {
|
|
1161
|
+
const H = C[j];
|
|
1162
|
+
if (!H) {
|
|
1163
|
+
S.push("");
|
|
1164
|
+
return;
|
|
1165
|
+
}
|
|
1166
|
+
const A = H.fixed === "left", N = H.fixed === "right";
|
|
1167
|
+
let B = "";
|
|
1168
|
+
for (const J of Z) {
|
|
1169
|
+
const he = J.querySelectorAll(".vxe-body--row")[L];
|
|
1170
|
+
if (!he)
|
|
1171
|
+
continue;
|
|
1172
|
+
const oe = Array.from(he.querySelectorAll(".vxe-body--column"));
|
|
1173
|
+
let D = null;
|
|
1174
|
+
if (A && J.closest(".vxe-table--fixed-left-wrapper")) {
|
|
1175
|
+
const W = C.filter((Q) => Q.fixed === "left").indexOf(H);
|
|
1176
|
+
D = oe[W];
|
|
1177
|
+
} else if (N && J.closest(".vxe-table--fixed-right-wrapper")) {
|
|
1178
|
+
const W = C.filter((Q) => Q.fixed === "right").indexOf(H);
|
|
1179
|
+
D = oe[W];
|
|
1180
|
+
} else if (!A && !N && J.closest(".vxe-table--body-wrapper")) {
|
|
1181
|
+
const le = o.searchForm.showCheckBox ? 1 : 0, W = C.filter((Ce) => Ce.fixed === "left").length, Q = j - W;
|
|
1182
|
+
D = oe[Q + le];
|
|
1183
|
+
}
|
|
1184
|
+
if (D && !D.classList.contains("col--checkbox") && !D.classList.contains("col--seq")) {
|
|
1185
|
+
B = D.innerText || D.textContent || "", B = B.trim(), B = B.replace(/\n/g, " ").replace(/\s+/g, " ");
|
|
1186
|
+
break;
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
S.push(B);
|
|
1190
|
+
}), V.push(S.join(" "));
|
|
1191
|
+
});
|
|
1192
|
+
const X = V.join(`
|
|
1193
|
+
`);
|
|
1194
|
+
try {
|
|
1195
|
+
await navigator.clipboard.writeText(X);
|
|
1196
|
+
} catch (L) {
|
|
1197
|
+
console.error(t("excel.copyFailed"), L);
|
|
1198
|
+
}
|
|
1199
|
+
}, Ae = (d) => {
|
|
1200
|
+
o.searchForm.enableCellCopy && ((d.ctrlKey || d.metaKey) && d.key === "c" ? (d.preventDefault(), it()) : d.key === "Escape" && Oe());
|
|
1201
|
+
}, Me = () => {
|
|
1202
|
+
g.isSelecting = !1;
|
|
1203
|
+
}, ye = ue(() => {
|
|
1204
|
+
const { customConfig: d, columnConfig: i, ...C } = o.tableConfig;
|
|
510
1205
|
return {
|
|
511
1206
|
headerAlign: "left",
|
|
512
1207
|
align: "center",
|
|
513
|
-
customConfig: { ...
|
|
514
|
-
|
|
1208
|
+
customConfig: { ..._, ...d },
|
|
1209
|
+
columnConfig: { ...y, ...i },
|
|
515
1210
|
// 列过多时 自动宽度 虚拟滚动会闪屏 关闭虚拟滚动
|
|
516
1211
|
"virtual-x-config": {
|
|
517
1212
|
enabled: !1,
|
|
518
|
-
scrollToLeftOnChange: !
|
|
1213
|
+
scrollToLeftOnChange: !1
|
|
519
1214
|
},
|
|
520
1215
|
// 纵向虚拟滚动 大于100条开启
|
|
521
1216
|
"virtual-y-config": { enabled: !0, gt: 100 },
|
|
522
|
-
...
|
|
1217
|
+
...C
|
|
523
1218
|
};
|
|
524
|
-
}),
|
|
525
|
-
|
|
526
|
-
},
|
|
527
|
-
|
|
1219
|
+
}), ct = (d) => {
|
|
1220
|
+
v.pageNo = d, m();
|
|
1221
|
+
}, ut = (d) => {
|
|
1222
|
+
v.pageSize = d, v[s] = 1, m();
|
|
528
1223
|
};
|
|
529
|
-
function
|
|
530
|
-
const
|
|
531
|
-
|
|
1224
|
+
function Re() {
|
|
1225
|
+
const d = p.value.getCheckboxRecords();
|
|
1226
|
+
o.searchForm.selections = d;
|
|
532
1227
|
}
|
|
533
|
-
const
|
|
534
|
-
const
|
|
535
|
-
if (
|
|
536
|
-
|
|
537
|
-
const
|
|
538
|
-
|
|
1228
|
+
const Ve = (d) => {
|
|
1229
|
+
const i = p.value;
|
|
1230
|
+
if (i) {
|
|
1231
|
+
i.toggleCheckboxRow(d);
|
|
1232
|
+
const C = p.value.getCheckboxRecords();
|
|
1233
|
+
o.searchForm.selections = C;
|
|
539
1234
|
}
|
|
540
1235
|
};
|
|
541
|
-
return (
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
1236
|
+
return e({ tableRef: p, getList: m, getPrm: F, clearSort: Y, calculateTableHeight: w }), (d, i) => {
|
|
1237
|
+
var L;
|
|
1238
|
+
const C = O("el-button"), I = O("el-checkbox"), R = O("el-text"), Z = O("vxe-column"), V = O("VxeTable"), X = O("el-pagination");
|
|
1239
|
+
return T(), re("div", {
|
|
1240
|
+
class: Se({ box: n.searchForm.showShadow })
|
|
545
1241
|
}, [
|
|
546
|
-
n.searchForm.showSearch ? (
|
|
1242
|
+
n.searchForm.showSearch ? (T(), U(Xt, {
|
|
547
1243
|
key: 0,
|
|
548
1244
|
form: n.searchForm,
|
|
549
|
-
onReset:
|
|
550
|
-
onConfirm:
|
|
1245
|
+
onReset: E,
|
|
1246
|
+
onConfirm: i[1] || (i[1] = (S) => m()),
|
|
1247
|
+
onVisibleChange: K(w)
|
|
551
1248
|
}, {
|
|
552
|
-
btn:
|
|
553
|
-
|
|
554
|
-
|
|
1249
|
+
btn: M(() => [
|
|
1250
|
+
se(d.$slots, "search-bar-btn", {}, void 0, !0),
|
|
1251
|
+
G(C, {
|
|
555
1252
|
round: "",
|
|
556
|
-
onClick:
|
|
1253
|
+
onClick: i[0] || (i[0] = (S) => p.value.openCustom())
|
|
557
1254
|
}, {
|
|
558
|
-
default:
|
|
559
|
-
|
|
1255
|
+
default: M(() => [
|
|
1256
|
+
G(at, { name: "Tools" })
|
|
560
1257
|
]),
|
|
561
1258
|
_: 1
|
|
562
1259
|
})
|
|
563
1260
|
]),
|
|
564
1261
|
_: 3
|
|
565
|
-
}, 8, ["form"])) :
|
|
566
|
-
|
|
567
|
-
|
|
1262
|
+
}, 8, ["form", "onVisibleChange"])) : ie("", !0),
|
|
1263
|
+
se(d.$slots, "table-header-left", {}, void 0, !0),
|
|
1264
|
+
ae("div", {
|
|
568
1265
|
ref_key: "tableContentRef",
|
|
569
|
-
ref:
|
|
1266
|
+
ref: k
|
|
570
1267
|
}, [
|
|
571
|
-
|
|
1268
|
+
G(V, pe({
|
|
572
1269
|
id: n.id,
|
|
573
1270
|
ref_key: "tableRef",
|
|
574
|
-
ref:
|
|
575
|
-
loading: n.loading ||
|
|
576
|
-
data: n.api ?
|
|
577
|
-
}, C.value, {
|
|
578
|
-
height: y.value,
|
|
579
|
-
onCheckboxChange: A,
|
|
580
|
-
onCheckboxAll: A,
|
|
1271
|
+
ref: p,
|
|
1272
|
+
loading: n.loading || r.value,
|
|
1273
|
+
data: n.api ? a.value : n.data,
|
|
581
1274
|
border: ""
|
|
1275
|
+
}, ye.value, {
|
|
1276
|
+
height: f.value,
|
|
1277
|
+
onCheckboxChange: Re,
|
|
1278
|
+
onCheckboxAll: Re,
|
|
1279
|
+
onSortChange: (L = ye.value["sort-config"]) == null ? void 0 : L.sortChange
|
|
582
1280
|
}), {
|
|
583
|
-
default:
|
|
584
|
-
n.searchForm.showCheckBox ? (
|
|
1281
|
+
default: M(() => [
|
|
1282
|
+
n.searchForm.showCheckBox == null || n.searchForm.showCheckBox ? (T(), U(Z, {
|
|
585
1283
|
key: 0,
|
|
586
1284
|
type: "checkbox",
|
|
587
|
-
width:
|
|
588
|
-
|
|
589
|
-
|
|
1285
|
+
width: K(l) == "zh_cn" ? 80 : 150,
|
|
1286
|
+
title: d.$t("xu-hao"),
|
|
1287
|
+
fixed: "left"
|
|
590
1288
|
}, {
|
|
591
|
-
checkbox:
|
|
592
|
-
|
|
593
|
-
|
|
1289
|
+
checkbox: M(({ rowIndex: S, row: j, checked: H, disabled: A, indeterminate: N }) => [
|
|
1290
|
+
ae("div", en, [
|
|
1291
|
+
H ? (T(), U(I, {
|
|
594
1292
|
key: 0,
|
|
595
1293
|
checked: !0,
|
|
596
|
-
disabled:
|
|
1294
|
+
disabled: A,
|
|
597
1295
|
size: "default",
|
|
598
|
-
onClick:
|
|
599
|
-
}, null, 8, ["disabled", "onClick"])) : (
|
|
1296
|
+
onClick: $e((B) => !A && Ve(j), ["stop"])
|
|
1297
|
+
}, null, 8, ["disabled", "onClick"])) : (T(), U(I, {
|
|
600
1298
|
key: 1,
|
|
601
|
-
disabled:
|
|
1299
|
+
disabled: A,
|
|
602
1300
|
checked: !1,
|
|
603
1301
|
size: "default",
|
|
604
|
-
onClick:
|
|
1302
|
+
onClick: $e((B) => !A && Ve(j), ["stop"])
|
|
605
1303
|
}, null, 8, ["disabled", "onClick"])),
|
|
606
|
-
|
|
1304
|
+
G(R, {
|
|
607
1305
|
type: "info",
|
|
608
1306
|
class: "mgl5"
|
|
609
1307
|
}, {
|
|
610
|
-
default:
|
|
611
|
-
|
|
1308
|
+
default: M(() => [
|
|
1309
|
+
te(ne(S + 1), 1)
|
|
612
1310
|
]),
|
|
613
1311
|
_: 2
|
|
614
1312
|
}, 1024)
|
|
615
1313
|
])
|
|
616
1314
|
]),
|
|
617
1315
|
_: 1
|
|
618
|
-
}, 8, ["width", "title"])) :
|
|
619
|
-
|
|
1316
|
+
}, 8, ["width", "title"])) : ie("", !0),
|
|
1317
|
+
se(d.$slots, "default", {}, void 0, !0)
|
|
620
1318
|
]),
|
|
621
1319
|
_: 3
|
|
622
|
-
}, 16, ["id", "loading", "data", "height"])
|
|
1320
|
+
}, 16, ["id", "loading", "data", "height", "onSortChange"])
|
|
623
1321
|
], 512),
|
|
624
|
-
n.searchForm.showPage ? (
|
|
1322
|
+
n.searchForm.showPage ? (T(), U(X, {
|
|
625
1323
|
key: 1,
|
|
626
|
-
"current-page": s
|
|
627
|
-
"onUpdate:currentPage":
|
|
1324
|
+
"current-page": v[K(s)],
|
|
1325
|
+
"onUpdate:currentPage": i[2] || (i[2] = (S) => v[K(s)] = S),
|
|
628
1326
|
class: "myPagination mgt10",
|
|
629
1327
|
background: "",
|
|
630
1328
|
layout: "total, sizes, prev, pager, next",
|
|
631
|
-
total:
|
|
632
|
-
"page-size":
|
|
1329
|
+
total: v.total,
|
|
1330
|
+
"page-size": v.pageSize,
|
|
633
1331
|
"page-sizes": [10, 50, 100, 500],
|
|
634
|
-
onCurrentChange:
|
|
635
|
-
onSizeChange:
|
|
636
|
-
}, null, 8, ["current-page", "total", "page-size"])) :
|
|
1332
|
+
onCurrentChange: ct,
|
|
1333
|
+
onSizeChange: ut
|
|
1334
|
+
}, null, 8, ["current-page", "total", "page-size"])) : ie("", !0)
|
|
637
1335
|
], 2);
|
|
638
1336
|
};
|
|
639
1337
|
}
|
|
640
|
-
},
|
|
641
|
-
|
|
642
|
-
|
|
1338
|
+
}, Fn = /* @__PURE__ */ ge(tn, [["__scopeId", "data-v-7c7c0598"]]), Ln = {
|
|
1339
|
+
__name: "index",
|
|
1340
|
+
props: {
|
|
1341
|
+
sheetsConfig: {
|
|
1342
|
+
type: Object,
|
|
1343
|
+
required: !0
|
|
1344
|
+
},
|
|
1345
|
+
fileName: {
|
|
1346
|
+
type: String,
|
|
1347
|
+
required: !0
|
|
1348
|
+
}
|
|
1349
|
+
},
|
|
1350
|
+
setup(n) {
|
|
1351
|
+
const e = n;
|
|
1352
|
+
function t() {
|
|
1353
|
+
At(e.fileName, e.sheetsConfig);
|
|
1354
|
+
}
|
|
1355
|
+
return (l, o) => {
|
|
1356
|
+
const r = O("el-link");
|
|
1357
|
+
return T(), U(r, pe({
|
|
1358
|
+
type: "primary",
|
|
1359
|
+
underline: "never"
|
|
1360
|
+
}, l.$attrs, { onClick: t }), {
|
|
1361
|
+
default: M(() => [
|
|
1362
|
+
te(ne(l.$t("xia-zai-dao-ru-mo-ban")), 1)
|
|
1363
|
+
]),
|
|
1364
|
+
_: 1
|
|
1365
|
+
}, 16);
|
|
1366
|
+
};
|
|
1367
|
+
}
|
|
1368
|
+
};
|
|
1369
|
+
function On(n, e = {}) {
|
|
1370
|
+
const t = Le(), l = {
|
|
643
1371
|
inForm: !0,
|
|
644
1372
|
required: !0,
|
|
645
1373
|
...e
|
|
@@ -647,302 +1375,36 @@ function Ft(n, e = {}) {
|
|
|
647
1375
|
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}$/,
|
|
648
1376
|
password: /(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/,
|
|
649
1377
|
email: /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
|
|
650
|
-
}[n], { inForm:
|
|
651
|
-
return
|
|
652
|
-
if (
|
|
653
|
-
o.test(
|
|
1378
|
+
}[n], { inForm: r, value: a, required: c, msg: s = t("validate.invalidInput") } = l;
|
|
1379
|
+
return r ? function(v, p, k) {
|
|
1380
|
+
if (c) {
|
|
1381
|
+
o.test(p) ? k() : k(new Error(s));
|
|
654
1382
|
return;
|
|
655
1383
|
}
|
|
656
|
-
|
|
657
|
-
} : o.test(
|
|
1384
|
+
p && !o.test(p) ? k(new Error(s)) : k();
|
|
1385
|
+
} : o.test(a);
|
|
658
1386
|
}
|
|
659
|
-
const
|
|
1387
|
+
const Dn = {
|
|
660
1388
|
//加密
|
|
661
1389
|
encrypt(n, e) {
|
|
662
1390
|
e = e || "1CFEC667A1E6D42DC12565AAAA460494";
|
|
663
|
-
var t =
|
|
664
|
-
mode:
|
|
665
|
-
padding:
|
|
1391
|
+
var t = ee.enc.Utf8.parse(e), l = ee.enc.Utf8.parse(n), o = ee.AES.encrypt(l, t, {
|
|
1392
|
+
mode: ee.mode.ECB,
|
|
1393
|
+
padding: ee.pad.Pkcs7
|
|
666
1394
|
});
|
|
667
|
-
return
|
|
1395
|
+
return o.toString();
|
|
668
1396
|
},
|
|
669
1397
|
//解密
|
|
670
1398
|
decrypt(n, e) {
|
|
671
1399
|
e = e || "1CFEC667A1E6D42DC12565AAAA460494";
|
|
672
|
-
var t =
|
|
673
|
-
mode:
|
|
674
|
-
padding:
|
|
1400
|
+
var t = ee.enc.Utf8.parse(e), l = ee.AES.decrypt(n, t, {
|
|
1401
|
+
mode: ee.mode.ECB,
|
|
1402
|
+
padding: ee.pad.Pkcs7
|
|
675
1403
|
});
|
|
676
|
-
return
|
|
1404
|
+
return ee.enc.Utf8.stringify(l).toString();
|
|
677
1405
|
}
|
|
678
1406
|
};
|
|
679
|
-
|
|
680
|
-
function we(n) {
|
|
681
|
-
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
682
|
-
}
|
|
683
|
-
var $e = { exports: {} };
|
|
684
|
-
(function(n, e) {
|
|
685
|
-
(function(t, o) {
|
|
686
|
-
n.exports = o();
|
|
687
|
-
})(ke, function() {
|
|
688
|
-
var t = "minute", o = /[+-]\d\d(?::?\d\d)?/g, a = /([+-]|\d\d)/g;
|
|
689
|
-
return function(l, r, u) {
|
|
690
|
-
var s = r.prototype;
|
|
691
|
-
u.utc = function(c) {
|
|
692
|
-
var h = { date: c, utc: !0, args: arguments };
|
|
693
|
-
return new r(h);
|
|
694
|
-
}, s.utc = function(c) {
|
|
695
|
-
var h = u(this.toDate(), { locale: this.$L, utc: !0 });
|
|
696
|
-
return c ? h.add(this.utcOffset(), t) : h;
|
|
697
|
-
}, s.local = function() {
|
|
698
|
-
return u(this.toDate(), { locale: this.$L, utc: !1 });
|
|
699
|
-
};
|
|
700
|
-
var m = s.parse;
|
|
701
|
-
s.parse = function(c) {
|
|
702
|
-
c.utc && (this.$u = !0), this.$utils().u(c.$offset) || (this.$offset = c.$offset), m.call(this, c);
|
|
703
|
-
};
|
|
704
|
-
var v = s.init;
|
|
705
|
-
s.init = function() {
|
|
706
|
-
if (this.$u) {
|
|
707
|
-
var c = this.$d;
|
|
708
|
-
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();
|
|
709
|
-
} else
|
|
710
|
-
v.call(this);
|
|
711
|
-
};
|
|
712
|
-
var _ = s.utcOffset;
|
|
713
|
-
s.utcOffset = function(c, h) {
|
|
714
|
-
var f = this.$utils().u;
|
|
715
|
-
if (f(c))
|
|
716
|
-
return this.$u ? 0 : f(this.$offset) ? _.call(this) : this.$offset;
|
|
717
|
-
if (typeof c == "string" && (c = function(C) {
|
|
718
|
-
C === void 0 && (C = "");
|
|
719
|
-
var S = C.match(o);
|
|
720
|
-
if (!S)
|
|
721
|
-
return null;
|
|
722
|
-
var E = ("" + S[0]).match(a) || ["-", 0, 0], A = E[0], V = 60 * +E[1] + +E[2];
|
|
723
|
-
return V === 0 ? 0 : A === "+" ? V : -V;
|
|
724
|
-
}(c), c === null))
|
|
725
|
-
return this;
|
|
726
|
-
var i = Math.abs(c) <= 16 ? 60 * c : c;
|
|
727
|
-
if (i === 0)
|
|
728
|
-
return this.utc(h);
|
|
729
|
-
var p = this.clone();
|
|
730
|
-
if (h)
|
|
731
|
-
return p.$offset = i, p.$u = !1, p;
|
|
732
|
-
var k = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
|
|
733
|
-
return (p = this.local().add(i + k, t)).$offset = i, p.$x.$localOffset = k, p;
|
|
734
|
-
};
|
|
735
|
-
var g = s.format;
|
|
736
|
-
s.format = function(c) {
|
|
737
|
-
var h = c || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
|
|
738
|
-
return g.call(this, h);
|
|
739
|
-
}, s.valueOf = function() {
|
|
740
|
-
var c = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
|
|
741
|
-
return this.$d.valueOf() - 6e4 * c;
|
|
742
|
-
}, s.isUTC = function() {
|
|
743
|
-
return !!this.$u;
|
|
744
|
-
}, s.toISOString = function() {
|
|
745
|
-
return this.toDate().toISOString();
|
|
746
|
-
}, s.toString = function() {
|
|
747
|
-
return this.toDate().toUTCString();
|
|
748
|
-
};
|
|
749
|
-
var y = s.toDate;
|
|
750
|
-
s.toDate = function(c) {
|
|
751
|
-
return c === "s" && this.$offset ? u(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : y.call(this);
|
|
752
|
-
};
|
|
753
|
-
var d = s.diff;
|
|
754
|
-
s.diff = function(c, h, f) {
|
|
755
|
-
if (c && this.$u === c.$u)
|
|
756
|
-
return d.call(this, c, h, f);
|
|
757
|
-
var i = this.local(), p = u(c).local();
|
|
758
|
-
return d.call(i, p, h, f);
|
|
759
|
-
};
|
|
760
|
-
};
|
|
761
|
-
});
|
|
762
|
-
})($e);
|
|
763
|
-
var lt = $e.exports;
|
|
764
|
-
const st = /* @__PURE__ */ we(lt);
|
|
765
|
-
var Se = { exports: {} };
|
|
766
|
-
(function(n, e) {
|
|
767
|
-
(function(t, o) {
|
|
768
|
-
n.exports = o();
|
|
769
|
-
})(ke, function() {
|
|
770
|
-
var t = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, o = {};
|
|
771
|
-
return function(a, l, r) {
|
|
772
|
-
var u, s = function(g, y, d) {
|
|
773
|
-
d === void 0 && (d = {});
|
|
774
|
-
var c = new Date(g), h = function(f, i) {
|
|
775
|
-
i === void 0 && (i = {});
|
|
776
|
-
var p = i.timeZoneName || "short", k = f + "|" + p, C = o[k];
|
|
777
|
-
return C || (C = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: f, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: p }), o[k] = C), C;
|
|
778
|
-
}(y, d);
|
|
779
|
-
return h.formatToParts(c);
|
|
780
|
-
}, m = function(g, y) {
|
|
781
|
-
for (var d = s(g, y), c = [], h = 0; h < d.length; h += 1) {
|
|
782
|
-
var f = d[h], i = f.type, p = f.value, k = t[i];
|
|
783
|
-
k >= 0 && (c[k] = parseInt(p, 10));
|
|
784
|
-
}
|
|
785
|
-
var C = c[3], S = C === 24 ? 0 : C, E = c[0] + "-" + c[1] + "-" + c[2] + " " + S + ":" + c[4] + ":" + c[5] + ":000", A = +g;
|
|
786
|
-
return (r.utc(E).valueOf() - (A -= A % 1e3)) / 6e4;
|
|
787
|
-
}, v = l.prototype;
|
|
788
|
-
v.tz = function(g, y) {
|
|
789
|
-
g === void 0 && (g = u);
|
|
790
|
-
var d, c = this.utcOffset(), h = this.toDate(), f = h.toLocaleString("en-US", { timeZone: g }), i = Math.round((h - new Date(f)) / 1e3 / 60), p = 15 * -Math.round(h.getTimezoneOffset() / 15) - i;
|
|
791
|
-
if (!Number(p))
|
|
792
|
-
d = this.utcOffset(0, y);
|
|
793
|
-
else if (d = r(f, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(p, !0), y) {
|
|
794
|
-
var k = d.utcOffset();
|
|
795
|
-
d = d.add(c - k, "minute");
|
|
796
|
-
}
|
|
797
|
-
return d.$x.$timezone = g, d;
|
|
798
|
-
}, v.offsetName = function(g) {
|
|
799
|
-
var y = this.$x.$timezone || r.tz.guess(), d = s(this.valueOf(), y, { timeZoneName: g }).find(function(c) {
|
|
800
|
-
return c.type.toLowerCase() === "timezonename";
|
|
801
|
-
});
|
|
802
|
-
return d && d.value;
|
|
803
|
-
};
|
|
804
|
-
var _ = v.startOf;
|
|
805
|
-
v.startOf = function(g, y) {
|
|
806
|
-
if (!this.$x || !this.$x.$timezone)
|
|
807
|
-
return _.call(this, g, y);
|
|
808
|
-
var d = r(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
|
|
809
|
-
return _.call(d, g, y).tz(this.$x.$timezone, !0);
|
|
810
|
-
}, r.tz = function(g, y, d) {
|
|
811
|
-
var c = d && y, h = d || y || u, f = m(+r(), h);
|
|
812
|
-
if (typeof g != "string")
|
|
813
|
-
return r(g).tz(h);
|
|
814
|
-
var i = function(S, E, A) {
|
|
815
|
-
var V = S - 60 * E * 1e3, b = m(V, A);
|
|
816
|
-
if (E === b)
|
|
817
|
-
return [V, E];
|
|
818
|
-
var w = m(V -= 60 * (b - E) * 1e3, A);
|
|
819
|
-
return b === w ? [V, b] : [S - 60 * Math.min(b, w) * 1e3, Math.max(b, w)];
|
|
820
|
-
}(r.utc(g, c).valueOf(), f, h), p = i[0], k = i[1], C = r(p).utcOffset(k);
|
|
821
|
-
return C.$x.$timezone = h, C;
|
|
822
|
-
}, r.tz.guess = function() {
|
|
823
|
-
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
824
|
-
}, r.tz.setDefault = function(g) {
|
|
825
|
-
u = g;
|
|
826
|
-
};
|
|
827
|
-
};
|
|
828
|
-
});
|
|
829
|
-
})(Se);
|
|
830
|
-
var it = Se.exports;
|
|
831
|
-
const ct = /* @__PURE__ */ we(it);
|
|
832
|
-
be.extend(st);
|
|
833
|
-
be.extend(ct);
|
|
834
|
-
async function Vt(n, e) {
|
|
835
|
-
const { fields: t, range: o = 1 } = e;
|
|
836
|
-
if (!t)
|
|
837
|
-
throw new Error("请输入列字段映射");
|
|
838
|
-
let a = new ye.Workbook();
|
|
839
|
-
await a.xlsx.load(n);
|
|
840
|
-
const l = {};
|
|
841
|
-
return a.eachSheet(function(r, u) {
|
|
842
|
-
const s = [];
|
|
843
|
-
r.eachRow(function(m, v) {
|
|
844
|
-
if (v > o) {
|
|
845
|
-
let _ = {}, g = !0;
|
|
846
|
-
Object.keys(t).forEach((y) => {
|
|
847
|
-
const d = m.getCell(t[y]).value;
|
|
848
|
-
_[y] = d, d && (g = !1);
|
|
849
|
-
}), g || s.push(_);
|
|
850
|
-
}
|
|
851
|
-
}), l[r._name] = s;
|
|
852
|
-
}), a = null, l;
|
|
853
|
-
}
|
|
854
|
-
const ut = {
|
|
855
|
-
columnWidth: 30
|
|
856
|
-
};
|
|
857
|
-
async function It(n, e, t = [], o = {}) {
|
|
858
|
-
if (!n || !e)
|
|
859
|
-
return;
|
|
860
|
-
const { columnStyle: a } = o, { columnWidth: l } = ut;
|
|
861
|
-
e.forEach((s) => {
|
|
862
|
-
s.width = s.width ? s.width : l;
|
|
863
|
-
});
|
|
864
|
-
const { workbook: r, worksheet: u } = ft();
|
|
865
|
-
u.columns = e, u.addRows(t), a && await dt(r, u, a);
|
|
866
|
-
try {
|
|
867
|
-
const s = await r.xlsx.writeBuffer(), m = new File([s], n, {
|
|
868
|
-
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
869
|
-
});
|
|
870
|
-
Pe(m);
|
|
871
|
-
} catch (s) {
|
|
872
|
-
console.log(s);
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
function ft() {
|
|
876
|
-
const n = new ye.Workbook();
|
|
877
|
-
n.creator = "distributor System", n.lastModifiedBy = "distributor System", n.created = /* @__PURE__ */ new Date(), n.modified = /* @__PURE__ */ new Date(), n.lastPrinted = /* @__PURE__ */ new Date();
|
|
878
|
-
const e = n.addWorksheet("Sheet1");
|
|
879
|
-
return { workbook: n, worksheet: e };
|
|
880
|
-
}
|
|
881
|
-
async function dt(n, e, t) {
|
|
882
|
-
const o = Object.keys(t);
|
|
883
|
-
for (const a of o) {
|
|
884
|
-
const l = t[a], { type: r } = l;
|
|
885
|
-
switch (r) {
|
|
886
|
-
case "IMG":
|
|
887
|
-
await ht(n, e, a);
|
|
888
|
-
break;
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
async function ht(n, e, t, o) {
|
|
893
|
-
const a = e.getColumn(t), l = a.values;
|
|
894
|
-
e.getColumn(t).width = 20, e.eachRow((r, u) => {
|
|
895
|
-
u > 1 && (r.height = 40);
|
|
896
|
-
});
|
|
897
|
-
for (let r = 0, u = l.length; r < u; r++) {
|
|
898
|
-
if (r < 2)
|
|
899
|
-
continue;
|
|
900
|
-
let s = l[r];
|
|
901
|
-
s && (e.getCell(a.letter + r).value = "", await gt(n, e, s, {
|
|
902
|
-
width: 100,
|
|
903
|
-
height: 50,
|
|
904
|
-
col: a._number - 1,
|
|
905
|
-
row: r - 1
|
|
906
|
-
}));
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
async function gt(n, e, t, o) {
|
|
910
|
-
const { col: a, row: l, width: r, height: u } = o, { success: s, base64: m } = await pt(t, 0.3);
|
|
911
|
-
if (s) {
|
|
912
|
-
const v = n.addImage({
|
|
913
|
-
base64: m,
|
|
914
|
-
extension: "jpeg"
|
|
915
|
-
});
|
|
916
|
-
e.addImage(v, {
|
|
917
|
-
tl: { col: a, row: l },
|
|
918
|
-
ext: { width: r, height: u }
|
|
919
|
-
});
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
|
-
function pt(n, e = 1) {
|
|
923
|
-
const t = new Image();
|
|
924
|
-
return t.setAttribute("crossOrigin", "anonymous"), t.crossOrigin = "anonymous", t.src = n, new Promise((o, a) => {
|
|
925
|
-
t.onload = () => {
|
|
926
|
-
const l = document.createElement("canvas");
|
|
927
|
-
l.width = t.width, l.height = t.height, l.getContext("2d").drawImage(t, 0, 0, l.width, l.height), o({
|
|
928
|
-
success: !0,
|
|
929
|
-
//canvas.toDataURL的方法将图片的绝对路径转换为base64编码
|
|
930
|
-
base64: l.toDataURL("image/jpeg", e)
|
|
931
|
-
});
|
|
932
|
-
}, t.onerror = () => {
|
|
933
|
-
o({ success: !1 });
|
|
934
|
-
};
|
|
935
|
-
});
|
|
936
|
-
}
|
|
937
|
-
function mt(n) {
|
|
938
|
-
if (n < 26)
|
|
939
|
-
return String.fromCharCode(65 + n);
|
|
940
|
-
{
|
|
941
|
-
const e = String.fromCharCode(65 + Math.floor((n - 26) / 26)), t = String.fromCharCode(65 + (n - 26) % 26);
|
|
942
|
-
return e + t;
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
class Ut {
|
|
1407
|
+
class zn {
|
|
946
1408
|
constructor(e = {}) {
|
|
947
1409
|
this.config = {
|
|
948
1410
|
clientCode: e.clientCode || "one-portal",
|
|
@@ -1038,10 +1500,10 @@ class Ut {
|
|
|
1038
1500
|
});
|
|
1039
1501
|
if (!t.ok)
|
|
1040
1502
|
throw new Error(`HTTP ${t.status}: ${t.statusText}`);
|
|
1041
|
-
const
|
|
1042
|
-
if (
|
|
1043
|
-
return this.token =
|
|
1044
|
-
throw new Error(
|
|
1503
|
+
const l = await t.json();
|
|
1504
|
+
if (l.success && l.data)
|
|
1505
|
+
return this.token = l.data.token, this.user = l.data.user, this.saveToStorage(), this.clearTicketFromUrl(), this.log("ST票据验证成功,用户登录成功:", this.user), this.config.loginCallback && this.config.loginCallback(this.user, this.token), !0;
|
|
1506
|
+
throw new Error(l.message || "ST票据验证失败");
|
|
1045
1507
|
} catch (t) {
|
|
1046
1508
|
return this.log("ST票据验证失败:", t), this.handleError(t), !1;
|
|
1047
1509
|
}
|
|
@@ -1080,19 +1542,19 @@ class Ut {
|
|
|
1080
1542
|
* 发送带认证的HTTP请求
|
|
1081
1543
|
*/
|
|
1082
1544
|
async request(e, t = {}) {
|
|
1083
|
-
const
|
|
1545
|
+
const l = {
|
|
1084
1546
|
headers: {
|
|
1085
1547
|
"Content-Type": "application/json",
|
|
1086
1548
|
...t.headers
|
|
1087
1549
|
},
|
|
1088
1550
|
...t
|
|
1089
1551
|
};
|
|
1090
|
-
|
|
1552
|
+
l.headers.appId = this.config.clientCode, this.token && (l.headers.Authorization = `Bearer ${this.token}`);
|
|
1091
1553
|
try {
|
|
1092
|
-
const
|
|
1093
|
-
return
|
|
1094
|
-
} catch (
|
|
1095
|
-
throw this.log("请求失败:",
|
|
1554
|
+
const o = await fetch(e, l);
|
|
1555
|
+
return o.status === 401 ? (this.log("Token已过期,需要重新登录"), this.logout(), null) : o;
|
|
1556
|
+
} catch (o) {
|
|
1557
|
+
throw this.log("请求失败:", o), o;
|
|
1096
1558
|
}
|
|
1097
1559
|
}
|
|
1098
1560
|
/**
|
|
@@ -1148,228 +1610,231 @@ class Ut {
|
|
|
1148
1610
|
return this.config[e];
|
|
1149
1611
|
}
|
|
1150
1612
|
}
|
|
1151
|
-
function
|
|
1152
|
-
|
|
1153
|
-
setTimeout(() => {
|
|
1154
|
-
e();
|
|
1155
|
-
}, n);
|
|
1156
|
-
});
|
|
1157
|
-
}
|
|
1158
|
-
function Mt(n) {
|
|
1159
|
-
return JSON.parse(JSON.stringify(n));
|
|
1160
|
-
}
|
|
1161
|
-
function Yt(n) {
|
|
1162
|
-
let e = [], t = {}, o = (a, l) => Object.prototype.hasOwnProperty.call(a, l);
|
|
1163
|
-
for (const a of n) {
|
|
1164
|
-
t[a.id] = {
|
|
1165
|
-
...a,
|
|
1166
|
-
// 判断当前项的子项 如果map有存储就用存储的子项 否则初始化
|
|
1167
|
-
children: o(t, a.id) ? t[a.id].children : []
|
|
1168
|
-
};
|
|
1169
|
-
const l = t[a.id];
|
|
1170
|
-
a.pid == -1 ? e.push(l) : (o(t, a.pid) || (t[a.pid] = {
|
|
1171
|
-
children: []
|
|
1172
|
-
}), t[a.pid].children.push(l));
|
|
1173
|
-
}
|
|
1174
|
-
return e;
|
|
1175
|
-
}
|
|
1176
|
-
function jt(n, e = " ") {
|
|
1177
|
-
return n ? n.split(e).filter((t) => t.trim()) : [];
|
|
1178
|
-
}
|
|
1179
|
-
class ue {
|
|
1180
|
-
constructor(e, t = ["label", "value", "labelEn"]) {
|
|
1181
|
-
this.list = e, this.map = new Map(
|
|
1182
|
-
e.map((o) => {
|
|
1183
|
-
let a = {
|
|
1184
|
-
...o,
|
|
1185
|
-
label: o[t[0]],
|
|
1186
|
-
value: o[t[1]]
|
|
1187
|
-
};
|
|
1188
|
-
return t[2] && (a.labelEn = o[t[2]]), [o[t[1]], a];
|
|
1189
|
-
})
|
|
1190
|
-
);
|
|
1191
|
-
}
|
|
1192
|
-
getName(e, t) {
|
|
1193
|
-
if (!this.has(e))
|
|
1194
|
-
return "-";
|
|
1195
|
-
const { label: o, labelEn: a } = this.map.get(e);
|
|
1196
|
-
return (t == "zh_cn" ? o : a) || o || "-";
|
|
1197
|
-
}
|
|
1198
|
-
getTag(e) {
|
|
1199
|
-
if (!this.has(e))
|
|
1200
|
-
return "info";
|
|
1201
|
-
const { tag: t = "info" } = this.map.get(e);
|
|
1202
|
-
return t;
|
|
1203
|
-
}
|
|
1204
|
-
getItem(e) {
|
|
1205
|
-
return this.has(e) ? this.map.get(e) : null;
|
|
1206
|
-
}
|
|
1207
|
-
getColor(e) {
|
|
1208
|
-
if (!this.has(e))
|
|
1209
|
-
return null;
|
|
1210
|
-
const { color: t } = this.map.get(e);
|
|
1211
|
-
return t;
|
|
1212
|
-
}
|
|
1213
|
-
has(e) {
|
|
1214
|
-
return this.map.has(e);
|
|
1215
|
-
}
|
|
1216
|
-
}
|
|
1217
|
-
function Pt(n, e = [], t = "i18nName") {
|
|
1218
|
-
if (n.length == 0)
|
|
1219
|
-
return new ue([]);
|
|
1220
|
-
if (e.length < 2)
|
|
1221
|
-
throw new Error("keys 长度必须大于2 默认前两位为 label value ");
|
|
1222
|
-
let o = n.map((a) => {
|
|
1223
|
-
let l = {};
|
|
1224
|
-
return t && (l.labelEn = a[t]), e.forEach((r, u) => {
|
|
1225
|
-
u === 0 ? l.label = a[r] : u === 1 ? l.value = a[r] : l[r] = a[r];
|
|
1226
|
-
}), l;
|
|
1227
|
-
});
|
|
1228
|
-
return new ue(o);
|
|
1229
|
-
}
|
|
1230
|
-
function Rt(n) {
|
|
1231
|
-
return n ? n.replace(/<[^>]+>/g, "") : "";
|
|
1232
|
-
}
|
|
1233
|
-
function Bt(n) {
|
|
1234
|
-
return n ? (n.includes("\\\\u") && (n = n.replace(/\\/g, "")), n.replace(/\\u[\dA-F]{4}/gi, (e) => String.fromCharCode(parseInt(e.replace(/\\u/g, ""), 16)))) : "";
|
|
1235
|
-
}
|
|
1236
|
-
function Ht(n, e = 10) {
|
|
1237
|
-
let t = 1048576 * e;
|
|
1238
|
-
return !(n.size > t);
|
|
1239
|
-
}
|
|
1240
|
-
function Nt(n) {
|
|
1241
|
-
return Array.from(10).fill(0).map((t, o) => n + "_" + o);
|
|
1242
|
-
}
|
|
1243
|
-
function qt(n) {
|
|
1244
|
-
let e = {};
|
|
1245
|
-
return n.map((t, o) => {
|
|
1246
|
-
let { key: a, option: l, type: r } = t, u = mt(o);
|
|
1247
|
-
l ? e[a] = `${u}---option` : r === "image" ? e[a] = `${u}---image` : e[a] = u;
|
|
1248
|
-
}), e;
|
|
1249
|
-
}
|
|
1250
|
-
function Kt(n, e) {
|
|
1251
|
-
return e.split(".").reduce((t, o) => t && t[o], n);
|
|
1252
|
-
}
|
|
1253
|
-
function Zt(n, e = {}) {
|
|
1254
|
-
const o = Object.assign({
|
|
1613
|
+
function An(n, e = {}) {
|
|
1614
|
+
const l = Object.assign({
|
|
1255
1615
|
manual: !1,
|
|
1256
1616
|
// 手动执行
|
|
1257
1617
|
log: !1,
|
|
1258
1618
|
params: null,
|
|
1259
1619
|
format: null
|
|
1260
|
-
}, e), { manual:
|
|
1261
|
-
const
|
|
1262
|
-
|
|
1263
|
-
const { code:
|
|
1264
|
-
if (
|
|
1265
|
-
const { records:
|
|
1266
|
-
|
|
1620
|
+
}, e), { manual: o, log: r, params: a = {}, cb: c, format: s } = l, v = q([]), p = q(!1), k = (x) => {
|
|
1621
|
+
const w = x || a;
|
|
1622
|
+
p.value = !0, n(w).then((b) => {
|
|
1623
|
+
const { code: u, data: f, msg: $ } = b;
|
|
1624
|
+
if (c) {
|
|
1625
|
+
const { records: h, rows: m } = f || {}, E = h || m ? h || m : f;
|
|
1626
|
+
v.value = ke(E, s), c(b);
|
|
1267
1627
|
}
|
|
1268
|
-
if (
|
|
1269
|
-
if (
|
|
1270
|
-
const { records:
|
|
1271
|
-
|
|
1628
|
+
if (f) {
|
|
1629
|
+
if (f.records != null || f.rows != null) {
|
|
1630
|
+
const { records: h, rows: m, total: E = 0 } = f || {};
|
|
1631
|
+
w && w.total != null && (a.total = parseInt(E)), v.value = ke(h || m || [], s);
|
|
1272
1632
|
} else
|
|
1273
|
-
|
|
1274
|
-
|
|
1633
|
+
v.value = ke(f, s);
|
|
1634
|
+
r && console.log("useRequest-res", v.value);
|
|
1275
1635
|
}
|
|
1276
|
-
}).catch((
|
|
1277
|
-
|
|
1636
|
+
}).catch((b) => {
|
|
1637
|
+
c && (console.log("useRequestErr", b), c({ code: 500 }));
|
|
1278
1638
|
}).finally(() => {
|
|
1279
|
-
|
|
1639
|
+
p.value = !1;
|
|
1280
1640
|
});
|
|
1281
1641
|
};
|
|
1282
|
-
return
|
|
1642
|
+
return o || k(), [p, v, k];
|
|
1283
1643
|
}
|
|
1284
|
-
function
|
|
1285
|
-
const e =
|
|
1286
|
-
return
|
|
1287
|
-
const
|
|
1288
|
-
t.value =
|
|
1289
|
-
}), [e, t,
|
|
1644
|
+
function Mn(n) {
|
|
1645
|
+
const e = q(n), t = q(""), l = q("");
|
|
1646
|
+
return Ze(e, (o) => {
|
|
1647
|
+
const r = o || ["", ""];
|
|
1648
|
+
t.value = r[0], l.value = r[1];
|
|
1649
|
+
}), [e, t, l];
|
|
1290
1650
|
}
|
|
1291
|
-
function
|
|
1651
|
+
function Rn(n) {
|
|
1292
1652
|
return Object.prototype.toString.call(n).slice(8, -1).toLowerCase();
|
|
1293
1653
|
}
|
|
1294
|
-
function
|
|
1654
|
+
function ke(n, e) {
|
|
1295
1655
|
if (!e)
|
|
1296
1656
|
return n;
|
|
1297
1657
|
if (n instanceof Array)
|
|
1298
|
-
return n.map((
|
|
1299
|
-
let
|
|
1300
|
-
return e.forEach((
|
|
1658
|
+
return n.map((l) => {
|
|
1659
|
+
let o = {};
|
|
1660
|
+
return e.forEach((r) => o[r] = l[r]), o;
|
|
1301
1661
|
});
|
|
1302
1662
|
let t = {};
|
|
1303
|
-
return e.forEach((
|
|
1663
|
+
return e.forEach((l) => t[l] = n[l]), t;
|
|
1304
1664
|
}
|
|
1305
|
-
function
|
|
1306
|
-
const { locale: t } =
|
|
1307
|
-
return
|
|
1665
|
+
function Vn(n, e = []) {
|
|
1666
|
+
const { locale: t } = de(), l = q(n());
|
|
1667
|
+
return Ze(
|
|
1308
1668
|
[t, ...e],
|
|
1309
1669
|
() => {
|
|
1310
|
-
|
|
1670
|
+
l.value = n();
|
|
1311
1671
|
},
|
|
1312
1672
|
{ immediate: !0 }
|
|
1313
|
-
), [
|
|
1673
|
+
), [l];
|
|
1314
1674
|
}
|
|
1315
|
-
function
|
|
1316
|
-
|
|
1675
|
+
function Un(n, e = "zh_cn") {
|
|
1676
|
+
if (!n)
|
|
1677
|
+
return "-";
|
|
1678
|
+
const l = lt().global.locale.value;
|
|
1679
|
+
return n[l] || n[e] || "-";
|
|
1317
1680
|
}
|
|
1318
|
-
function
|
|
1319
|
-
let t =
|
|
1320
|
-
return typeof n == "string" && n.length > 0 && (t =
|
|
1681
|
+
function jn(n, e) {
|
|
1682
|
+
let t = _t;
|
|
1683
|
+
return typeof n == "string" && n.length > 0 && (t = Fe(n).mapState), st(e, t);
|
|
1321
1684
|
}
|
|
1322
|
-
function
|
|
1323
|
-
let t =
|
|
1324
|
-
return typeof n == "string" && n.length > 0 && (t =
|
|
1685
|
+
function qn(n, e) {
|
|
1686
|
+
let t = $t;
|
|
1687
|
+
return typeof n == "string" && n.length > 0 && (t = Fe(n).mapGetters), st(e, t);
|
|
1325
1688
|
}
|
|
1326
|
-
function
|
|
1327
|
-
let t =
|
|
1328
|
-
return typeof n == "string" && n.length > 0 && (t =
|
|
1689
|
+
function Pn(n, e) {
|
|
1690
|
+
let t = St;
|
|
1691
|
+
return typeof n == "string" && n.length > 0 && (t = Fe(n).mapActions), nn(e, t);
|
|
1329
1692
|
}
|
|
1330
|
-
function
|
|
1331
|
-
const t =
|
|
1332
|
-
return Object.keys(
|
|
1333
|
-
const
|
|
1334
|
-
|
|
1335
|
-
}),
|
|
1693
|
+
function st(n, e) {
|
|
1694
|
+
const t = Xe(), l = e(n), o = {};
|
|
1695
|
+
return Object.keys(l).forEach((r) => {
|
|
1696
|
+
const a = l[r].bind({ $store: t });
|
|
1697
|
+
o[r] = ue(a);
|
|
1698
|
+
}), o;
|
|
1336
1699
|
}
|
|
1337
|
-
function
|
|
1338
|
-
const t =
|
|
1339
|
-
return Object.keys(
|
|
1340
|
-
|
|
1341
|
-
}),
|
|
1700
|
+
function nn(n, e) {
|
|
1701
|
+
const t = Xe(), l = e(n), o = {};
|
|
1702
|
+
return Object.keys(l).forEach((r) => {
|
|
1703
|
+
o[r] = l[r].bind({ $store: t });
|
|
1704
|
+
}), o;
|
|
1705
|
+
}
|
|
1706
|
+
const on = {
|
|
1707
|
+
__name: "EnumRender",
|
|
1708
|
+
props: {
|
|
1709
|
+
renderOpts: {
|
|
1710
|
+
type: Object,
|
|
1711
|
+
default: () => ({
|
|
1712
|
+
enum: {}
|
|
1713
|
+
})
|
|
1714
|
+
},
|
|
1715
|
+
params: {
|
|
1716
|
+
type: Object
|
|
1717
|
+
}
|
|
1718
|
+
},
|
|
1719
|
+
setup(n) {
|
|
1720
|
+
const e = n, t = e.params.row[e.params.column.field];
|
|
1721
|
+
return (l, o) => {
|
|
1722
|
+
const r = O("el-text");
|
|
1723
|
+
return n.renderOpts.text ? (T(), U(r, { key: 0 }, {
|
|
1724
|
+
default: M(() => [
|
|
1725
|
+
te(ne(n.renderOpts.enum.getName(K(t))), 1)
|
|
1726
|
+
]),
|
|
1727
|
+
_: 1
|
|
1728
|
+
})) : (T(), U(r, {
|
|
1729
|
+
key: 1,
|
|
1730
|
+
type: n.renderOpts.enum.getTag(K(t))
|
|
1731
|
+
}, {
|
|
1732
|
+
default: M(() => [
|
|
1733
|
+
te(ne(n.renderOpts.enum.getName(K(t))), 1)
|
|
1734
|
+
]),
|
|
1735
|
+
_: 1
|
|
1736
|
+
}, 8, ["type"]));
|
|
1737
|
+
};
|
|
1738
|
+
}
|
|
1739
|
+
};
|
|
1740
|
+
function Bn() {
|
|
1741
|
+
me.renderer.add("Enum", {
|
|
1742
|
+
// 默认显示模板
|
|
1743
|
+
renderTableDefault(n, e) {
|
|
1744
|
+
return [null, void 0].includes(e.row[e.column.field]) ? "-" : /* @__PURE__ */ React.createElement(on, { renderOpts: n, params: e });
|
|
1745
|
+
}
|
|
1746
|
+
}), me.renderer.add("InputNumber", {
|
|
1747
|
+
// 默认显示模板
|
|
1748
|
+
renderTableDefault(n, e) {
|
|
1749
|
+
return /* @__PURE__ */ React.createElement(pt, { "v-model": e.row[e.column.field], ...n.props, "step-strictly": !0, "value-on-clear": 0 });
|
|
1750
|
+
}
|
|
1751
|
+
}), me.renderer.add("TrueFalse", {
|
|
1752
|
+
// 默认显示模板
|
|
1753
|
+
renderTableDefault(n, e) {
|
|
1754
|
+
const { locale: t } = de();
|
|
1755
|
+
let l = t.value == "zh_cn";
|
|
1756
|
+
return /* @__PURE__ */ React.createElement(
|
|
1757
|
+
gt,
|
|
1758
|
+
{
|
|
1759
|
+
type: e.row[e.column.field] ? "success" : "danger"
|
|
1760
|
+
},
|
|
1761
|
+
e.row[e.column.field] ? l ? "是" : "YES" : l ? "否" : "NO"
|
|
1762
|
+
);
|
|
1763
|
+
}
|
|
1764
|
+
}), me.renderer.add("I18n", {
|
|
1765
|
+
// 默认显示模板
|
|
1766
|
+
renderTableDefault(n, e) {
|
|
1767
|
+
const { locale: t } = de();
|
|
1768
|
+
let l = t.value == "zh_cn" ? e.column.field : n.fieldEn;
|
|
1769
|
+
return e.row[l] || e.row[e.column.field];
|
|
1770
|
+
}
|
|
1771
|
+
}), me.renderer.add("Link", {
|
|
1772
|
+
// 默认显示模板
|
|
1773
|
+
renderTableDefault(n, e) {
|
|
1774
|
+
var c;
|
|
1775
|
+
let t = e.column.field;
|
|
1776
|
+
const l = Et(), { multiple: o, to: r } = n;
|
|
1777
|
+
if (!o)
|
|
1778
|
+
return /* @__PURE__ */ React.createElement(
|
|
1779
|
+
Ue,
|
|
1780
|
+
{
|
|
1781
|
+
underline: "never",
|
|
1782
|
+
type: "primary",
|
|
1783
|
+
onclick: () => l.push({ path: r, query: { [t]: e.row[t] } })
|
|
1784
|
+
},
|
|
1785
|
+
e.row[t]
|
|
1786
|
+
);
|
|
1787
|
+
const a = ((c = e.row[t]) == null ? void 0 : c.split(",")) || [];
|
|
1788
|
+
return a.map((s, v) => /* @__PURE__ */ React.createElement("span", null, /* @__PURE__ */ React.createElement(
|
|
1789
|
+
Ue,
|
|
1790
|
+
{
|
|
1791
|
+
underline: "never",
|
|
1792
|
+
type: "primary",
|
|
1793
|
+
onclick: () => l.push({ path: r, query: { [t]: s } })
|
|
1794
|
+
},
|
|
1795
|
+
s
|
|
1796
|
+
), v < a.length - 1 ? "," : ""));
|
|
1797
|
+
}
|
|
1798
|
+
});
|
|
1342
1799
|
}
|
|
1343
1800
|
export {
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1801
|
+
Bt as CmpDictionary,
|
|
1802
|
+
In as ConfrimButton,
|
|
1803
|
+
Ln as DownExcelTemp,
|
|
1804
|
+
Tn as ImportButton,
|
|
1805
|
+
gn as LayOutForm,
|
|
1806
|
+
Fn as ListPage,
|
|
1807
|
+
zn as OnePortalCasSDK,
|
|
1808
|
+
Xt as SearchBar,
|
|
1809
|
+
Be as StatusMap,
|
|
1810
|
+
yn as _toRaw,
|
|
1811
|
+
Rn as _typeOf,
|
|
1812
|
+
xn as arrToStatusMap,
|
|
1813
|
+
Cn as arrayToTree,
|
|
1814
|
+
_n as checkFileSize,
|
|
1815
|
+
On as creatValidator,
|
|
1816
|
+
Sn as createImportFields,
|
|
1817
|
+
$n as createListPageId,
|
|
1818
|
+
Dn as crypto,
|
|
1819
|
+
Ie as en,
|
|
1820
|
+
At as exportExcel,
|
|
1821
|
+
lt as getI18n,
|
|
1822
|
+
Le as getI18nT,
|
|
1823
|
+
Un as getLocaleValue,
|
|
1824
|
+
En as getValueBykey,
|
|
1825
|
+
vn as importExcel,
|
|
1826
|
+
Ot as messages,
|
|
1827
|
+
Bn as registerVxeRenderers,
|
|
1828
|
+
Dt as setupI18n,
|
|
1829
|
+
bn as sleep,
|
|
1830
|
+
rt as stringToArray,
|
|
1831
|
+
wn as stripHtmlTags,
|
|
1832
|
+
kn as unicode2Str,
|
|
1833
|
+
Pn as useActions,
|
|
1834
|
+
Mn as useDatePicker,
|
|
1835
|
+
qn as useGetters,
|
|
1836
|
+
Vn as useI18nReState,
|
|
1837
|
+
An as useRequest,
|
|
1838
|
+
jn as useState,
|
|
1839
|
+
Ee as zhCn
|
|
1375
1840
|
};
|