@gopowerteam/table-render 0.0.173 → 0.0.174
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/dist/cjs/index.cjs +1 -1
- package/dist/es/index.mjs +418 -417
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/es/index.mjs
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { ref as g, getCurrentInstance as H, onMounted as A, onUpdated as Le, reactive as je, createVNode as f, Fragment as I, createTextVNode as
|
|
5
|
-
import { Button as P, Tag as Fe, Dropdown as ne,
|
|
6
|
-
import { useModal as D, onSubmit as
|
|
7
|
-
import * as
|
|
1
|
+
var $e = Object.defineProperty;
|
|
2
|
+
var Oe = (e, t, r) => t in e ? $e(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var $ = (e, t, r) => (Oe(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
|
+
import { ref as g, getCurrentInstance as H, onMounted as A, onUpdated as Le, reactive as je, createVNode as f, Fragment as I, createTextVNode as E, getCurrentScope as Re, onScopeDispose as qe, unref as Pe, readonly as se, computed as L, watchEffect as ze, watch as Ee, h as Ye, render as Ae, defineComponent as B, isVNode as Be, mergeProps as fe, nextTick as re, withDirectives as De, resolveDirective as Ve } from "vue";
|
|
5
|
+
import { Button as P, Tag as Fe, Dropdown as ne, Image as He, Message as Ie, Descriptions as Ke, DescriptionsItem as We, Divider as Ne, Space as ae, Pagination as Ue, Transfer as Ge, Table as Ze } from "@arco-design/web-vue";
|
|
6
|
+
import { useModal as D, onSubmit as Je, ModalProvider as Qe } from "@gopowerteam/modal-render";
|
|
7
|
+
import * as Xe from "exceljs";
|
|
8
8
|
import V from "dayjs";
|
|
9
9
|
import { FormRender as oe } from "@gopowerteam/form-render";
|
|
10
|
-
import { TableRenderResolver as
|
|
11
|
-
function
|
|
12
|
-
const [
|
|
13
|
-
n[
|
|
10
|
+
import { TableRenderResolver as Sr } from "./resolver.mjs";
|
|
11
|
+
function pe(e, t, r) {
|
|
12
|
+
const [u, ...a] = t.index ? t.index.split(".").reverse() : [t.key], n = a.reverse().reduce((l, i) => l == null ? void 0 : l[i], e);
|
|
13
|
+
n[u] = r;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function et(e) {
|
|
16
16
|
const t = g([]), r = (a) => {
|
|
17
|
-
const n = e.filter((
|
|
18
|
-
return n.length > 0 ? a.map((
|
|
19
|
-
i.formatter &&
|
|
20
|
-
}),
|
|
17
|
+
const n = e.filter((l) => l.formatter);
|
|
18
|
+
return n.length > 0 ? a.map((l) => (n.forEach((i) => {
|
|
19
|
+
i.formatter && pe(l, i, i.formatter(l));
|
|
20
|
+
}), l)) : a;
|
|
21
21
|
};
|
|
22
22
|
return [t, (a) => {
|
|
23
23
|
t.value = r(a);
|
|
24
24
|
}];
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function tt(e) {
|
|
27
27
|
return e.filter((t) => t.form).map((t) => ({
|
|
28
28
|
key: t.key,
|
|
29
29
|
title: t.title,
|
|
30
30
|
...typeof t.form == "boolean" ? {} : t.form
|
|
31
31
|
}));
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function gr(e) {
|
|
34
34
|
const t = H(), r = g();
|
|
35
|
-
function
|
|
36
|
-
var n,
|
|
37
|
-
const a = (
|
|
35
|
+
function u() {
|
|
36
|
+
var n, l;
|
|
37
|
+
const a = (l = (n = t == null ? void 0 : t.proxy) == null ? void 0 : n.$refs) == null ? void 0 : l[e];
|
|
38
38
|
a && (r.value = a);
|
|
39
39
|
}
|
|
40
|
-
return A(
|
|
40
|
+
return A(u), Le(u), r;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function rt(e) {
|
|
43
43
|
return (t, r) => e[t](r);
|
|
44
44
|
}
|
|
45
45
|
class F {
|
|
@@ -49,13 +49,13 @@ class F {
|
|
|
49
49
|
* @param size
|
|
50
50
|
*/
|
|
51
51
|
constructor(t = 1, r = 10) {
|
|
52
|
-
|
|
52
|
+
$(this, "data", je({
|
|
53
53
|
index: 1,
|
|
54
54
|
size: 10,
|
|
55
55
|
total: 0
|
|
56
56
|
}));
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
$(this, "pageSizeOpts", [10, 20, 30, 40, 50]);
|
|
58
|
+
$(this, "pageLayouts", ["PrevJump", "PrevPage", "JumpNumber", "NextPage", "NextJump", "Sizes", "FullJump", "Total"]);
|
|
59
59
|
this.pageIndex = t, this.pageSize = r;
|
|
60
60
|
}
|
|
61
61
|
get pageIndex() {
|
|
@@ -102,49 +102,49 @@ class F {
|
|
|
102
102
|
this.total = (r = t.data) == null ? void 0 : r.totalElements;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
const
|
|
105
|
+
const nt = Symbol.for("RenderColumnType");
|
|
106
106
|
function k(e, t, r) {
|
|
107
107
|
return t.$type = e, t.$disableColumnMode = r == null ? void 0 : r.disableColumnMode, t.$disableViewMode = r == null ? void 0 : r.disableViewMode, t;
|
|
108
108
|
}
|
|
109
109
|
function T(e, t) {
|
|
110
|
-
return t.index ? t.index.split(".").reduce((r,
|
|
110
|
+
return t.index ? t.index.split(".").reduce((r, u) => r == null ? void 0 : r[u], e) : [t.key].reduce((r, u) => r == null ? void 0 : r[u], e);
|
|
111
111
|
}
|
|
112
112
|
function Y(e) {
|
|
113
113
|
return !!e && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
return k("button", (r,
|
|
117
|
-
const n = D(),
|
|
118
|
-
async function o(
|
|
119
|
-
if (await (
|
|
115
|
+
function at(e) {
|
|
116
|
+
return k("button", (r, u, a) => {
|
|
117
|
+
const n = D(), l = Array.isArray(e) ? e : "buttons" in e ? e.buttons : [e], i = (d, s) => typeof d == "function" ? d(r) : d === void 0 ? s : d;
|
|
118
|
+
async function o(d) {
|
|
119
|
+
if (await (d.confirm === !0 ? new Promise((m) => {
|
|
120
120
|
n.confirm({
|
|
121
121
|
title: "提示信息",
|
|
122
|
-
content:
|
|
122
|
+
content: d.confirmText ?? "您确定要执行该操作?",
|
|
123
123
|
onOk: () => m(!0),
|
|
124
124
|
onCancel: () => m(!1)
|
|
125
125
|
});
|
|
126
|
-
}) : Promise.resolve(!0)) && (
|
|
127
|
-
const m =
|
|
128
|
-
Y(m) &&
|
|
126
|
+
}) : Promise.resolve(!0)) && (d != null && d.onClick)) {
|
|
127
|
+
const m = d.onClick(r);
|
|
128
|
+
Y(m) && d.autoReload !== !1 && m.then(() => {
|
|
129
129
|
a != null && a.emits && (a == null || a.emits("reload"));
|
|
130
|
-
}), !Y(m) &&
|
|
130
|
+
}), !Y(m) && d.autoReload === !0 && a != null && a.emits && (a == null || a.emits("reload"));
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
return f(I, null, [
|
|
134
|
-
onClick: () => o(
|
|
135
|
-
type:
|
|
136
|
-
shape:
|
|
133
|
+
return f(I, null, [l.filter((d) => i(d.visiable, !0)).map((d) => f(P, {
|
|
134
|
+
onClick: () => o(d),
|
|
135
|
+
type: d.type || "text",
|
|
136
|
+
shape: d.shape,
|
|
137
137
|
size: "mini",
|
|
138
|
-
disabled: i(
|
|
138
|
+
disabled: i(d.disabled, !1)
|
|
139
139
|
}, {
|
|
140
|
-
icon:
|
|
141
|
-
default: () => (typeof
|
|
140
|
+
icon: d.icon ? () => d.icon(r) : void 0,
|
|
141
|
+
default: () => (typeof d.content == "function" ? d.content(r) : d.content) || ""
|
|
142
142
|
}))]);
|
|
143
143
|
}, {
|
|
144
144
|
disableViewMode: !0
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
|
-
const
|
|
147
|
+
const lt = {
|
|
148
148
|
thousands: !0,
|
|
149
149
|
inputUnit: "元",
|
|
150
150
|
outputUnit: "元"
|
|
@@ -153,9 +153,9 @@ const at = {
|
|
|
153
153
|
元: 10 ** 2,
|
|
154
154
|
万: 10 ** 6
|
|
155
155
|
};
|
|
156
|
-
function
|
|
156
|
+
function ut(e) {
|
|
157
157
|
e = {
|
|
158
|
-
...
|
|
158
|
+
...lt,
|
|
159
159
|
...e || {}
|
|
160
160
|
};
|
|
161
161
|
const t = (n) => {
|
|
@@ -163,47 +163,47 @@ function lt(e) {
|
|
|
163
163
|
return;
|
|
164
164
|
if ((e == null ? void 0 : e.inputUnit) === (e == null ? void 0 : e.outputUnit))
|
|
165
165
|
return n;
|
|
166
|
-
const
|
|
166
|
+
const l = le[e.inputUnit] / le[e.outputUnit], i = parseFloat((n * l).toFixed(10));
|
|
167
167
|
return (e == null ? void 0 : e.precision) === void 0 ? i : i.toFixed(e == null ? void 0 : e.precision);
|
|
168
168
|
}, r = (n) => {
|
|
169
169
|
if (n == null)
|
|
170
170
|
return;
|
|
171
|
-
const
|
|
172
|
-
return
|
|
173
|
-
},
|
|
171
|
+
const l = n.toString().split(".");
|
|
172
|
+
return l[0] = l[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), l.join(".");
|
|
173
|
+
}, u = (n) => {
|
|
174
174
|
if ((e == null ? void 0 : e.zeroString) !== void 0 && Number(n) === 0)
|
|
175
175
|
return e == null ? void 0 : e.zeroString;
|
|
176
176
|
if ((e == null ? void 0 : e.nullString) !== void 0 && isNaN(Number(n)))
|
|
177
177
|
return e == null ? void 0 : e.nullString;
|
|
178
|
-
const
|
|
179
|
-
return e != null && e.thousands ? r(
|
|
178
|
+
const l = t(Number(n));
|
|
179
|
+
return e != null && e.thousands ? r(l) : l;
|
|
180
180
|
};
|
|
181
|
-
return k("dict", (n,
|
|
182
|
-
const i = T(n,
|
|
181
|
+
return k("dict", (n, l) => {
|
|
182
|
+
const i = T(n, l);
|
|
183
183
|
return f("div", null, [typeof (e == null ? void 0 : e.prefix) == "string" ? f("span", null, [e.prefix]) : typeof (e == null ? void 0 : e.prefix) == "function" ? f("span", null, [e.prefix()]) : void 0, f("span", {
|
|
184
184
|
class: "currency_value"
|
|
185
|
-
}, [
|
|
185
|
+
}, [u(i)]), typeof (e == null ? void 0 : e.suffix) == "string" ? f("span", null, [e.suffix]) : typeof (e == null ? void 0 : e.suffix) == "function" ? f("span", null, [e.suffix()]) : void 0]);
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
|
-
var
|
|
188
|
+
var it = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, ct = { exports: {} };
|
|
189
189
|
(function(e, t) {
|
|
190
|
-
(function(r,
|
|
191
|
-
e.exports =
|
|
192
|
-
})(
|
|
193
|
-
function l
|
|
194
|
-
return
|
|
195
|
-
default:
|
|
190
|
+
(function(r, u) {
|
|
191
|
+
e.exports = u(V);
|
|
192
|
+
})(it, function(r) {
|
|
193
|
+
function u(l) {
|
|
194
|
+
return l && typeof l == "object" && "default" in l ? l : {
|
|
195
|
+
default: l
|
|
196
196
|
};
|
|
197
197
|
}
|
|
198
|
-
var a =
|
|
198
|
+
var a = u(r), n = {
|
|
199
199
|
name: "zh-cn",
|
|
200
200
|
weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),
|
|
201
201
|
weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"),
|
|
202
202
|
weekdaysMin: "日_一_二_三_四_五_六".split("_"),
|
|
203
203
|
months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),
|
|
204
204
|
monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),
|
|
205
|
-
ordinal: function(
|
|
206
|
-
return i === "W" ?
|
|
205
|
+
ordinal: function(l, i) {
|
|
206
|
+
return i === "W" ? l + "周" : l + "日";
|
|
207
207
|
},
|
|
208
208
|
weekStart: 1,
|
|
209
209
|
yearStart: 4,
|
|
@@ -234,51 +234,51 @@ var ut = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
234
234
|
y: "1 年",
|
|
235
235
|
yy: "%d 年"
|
|
236
236
|
},
|
|
237
|
-
meridiem: function(
|
|
238
|
-
var o = 100 *
|
|
237
|
+
meridiem: function(l, i) {
|
|
238
|
+
var o = 100 * l + i;
|
|
239
239
|
return o < 600 ? "凌晨" : o < 900 ? "早上" : o < 1100 ? "上午" : o < 1300 ? "中午" : o < 1800 ? "下午" : "晚上";
|
|
240
240
|
}
|
|
241
241
|
};
|
|
242
242
|
return a.default.locale(n, null, !0), n;
|
|
243
243
|
});
|
|
244
|
-
})(
|
|
244
|
+
})(ct);
|
|
245
245
|
V.locale("zh-cn");
|
|
246
|
-
const
|
|
246
|
+
const dt = {
|
|
247
247
|
date: "YYYY-MM-DD",
|
|
248
248
|
datetime: "YYYY-MM-DD HH:mm:ss",
|
|
249
249
|
time: "HH:mm:ss",
|
|
250
250
|
week: "ddd"
|
|
251
251
|
};
|
|
252
|
-
function
|
|
253
|
-
return k("date", (r,
|
|
254
|
-
const a = T(r,
|
|
255
|
-
return f("span", null, [
|
|
252
|
+
function st(e) {
|
|
253
|
+
return k("date", (r, u) => {
|
|
254
|
+
const a = T(r, u), n = typeof (e == null ? void 0 : e.format) == "function" ? e == null ? void 0 : e.format() : dt[(e == null ? void 0 : e.format) || "datetime"], l = V(a);
|
|
255
|
+
return f("span", null, [l.isValid() && l.format(n)]);
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
|
-
const
|
|
258
|
+
const ft = {
|
|
259
259
|
success: "arcoblue",
|
|
260
260
|
warning: "orange",
|
|
261
261
|
error: "red"
|
|
262
262
|
};
|
|
263
|
-
function
|
|
263
|
+
function ot(e) {
|
|
264
264
|
return e instanceof Map ? e : e.dict;
|
|
265
265
|
}
|
|
266
|
-
function
|
|
266
|
+
function mt(e) {
|
|
267
267
|
const t = e instanceof Map ? !1 : e.tag;
|
|
268
|
-
return typeof t == "string" ?
|
|
268
|
+
return typeof t == "string" ? ft[t] : t;
|
|
269
269
|
}
|
|
270
|
-
function
|
|
271
|
-
const t =
|
|
270
|
+
function ht(e) {
|
|
271
|
+
const t = ot(e), r = mt(e);
|
|
272
272
|
return k("dict", (a, n) => {
|
|
273
|
-
const
|
|
273
|
+
const l = T(a, n);
|
|
274
274
|
return r ? f(Fe, {
|
|
275
275
|
color: r === !0 ? void 0 : r
|
|
276
276
|
}, {
|
|
277
|
-
default: () => [t.get(
|
|
278
|
-
}) : f("span", null, [t.get(
|
|
277
|
+
default: () => [t.get(l) || l]
|
|
278
|
+
}) : f("span", null, [t.get(l) || l]);
|
|
279
279
|
});
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function yt(e) {
|
|
282
282
|
const t = D();
|
|
283
283
|
async function r(a, n) {
|
|
284
284
|
a.confirm && !await new Promise((i, o) => {
|
|
@@ -291,17 +291,17 @@ function ht(e) {
|
|
|
291
291
|
}) || a.onClick(n);
|
|
292
292
|
}
|
|
293
293
|
return k("dropdown", (a, n) => {
|
|
294
|
-
const
|
|
294
|
+
const l = e.options.filter((i) => typeof i.visiable == "function" ? i.visiable(a) : i.visiable !== !1);
|
|
295
295
|
return f(ne, {
|
|
296
296
|
trigger: (e == null ? void 0 : e.trigger) || "click"
|
|
297
297
|
}, {
|
|
298
298
|
default: () => f(P, {
|
|
299
|
-
disabled:
|
|
299
|
+
disabled: l.length === 0,
|
|
300
300
|
type: "text"
|
|
301
301
|
}, {
|
|
302
302
|
default: () => [(e == null ? void 0 : e.content) || "操作"]
|
|
303
303
|
}),
|
|
304
|
-
content: () =>
|
|
304
|
+
content: () => l.map((i) => f(ne.Option, {
|
|
305
305
|
onClick: () => r(i, a)
|
|
306
306
|
}, {
|
|
307
307
|
default: () => [typeof i.content == "function" ? i.content(a) : i.content]
|
|
@@ -309,46 +309,47 @@ function ht(e) {
|
|
|
309
309
|
});
|
|
310
310
|
});
|
|
311
311
|
}
|
|
312
|
-
const
|
|
312
|
+
const bt = {
|
|
313
313
|
size: 30
|
|
314
314
|
};
|
|
315
|
-
function
|
|
316
|
-
e = {
|
|
317
|
-
...
|
|
315
|
+
function gt(e) {
|
|
316
|
+
return e = {
|
|
317
|
+
...bt,
|
|
318
318
|
...e || {}
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
}
|
|
322
|
-
return k("image", (l, a) => {
|
|
323
|
-
const n = T(l, a), u = Math.random().toString(32).slice(2).toUpperCase(), i = {
|
|
319
|
+
}, k("image", (r, u) => {
|
|
320
|
+
const a = T(r, u), n = Math.random().toString(32).slice(2).toUpperCase(), l = {
|
|
324
321
|
maxWidth: "100%",
|
|
325
322
|
maxHeight: "100%",
|
|
326
323
|
borderRadius: e == null ? void 0 : e.radius,
|
|
327
|
-
objectFit: "contain",
|
|
328
324
|
transform: `rotate(${(e == null ? void 0 : e.rotate) || 0}deg)`,
|
|
329
|
-
cursor: e != null && e.preview ? "zoom-in" : "unset"
|
|
330
|
-
|
|
325
|
+
cursor: e != null && e.preview ? "zoom-in" : "unset",
|
|
326
|
+
overflow: "hidden"
|
|
327
|
+
}, i = `${u.index || u.key}_parsed`;
|
|
331
328
|
if (e != null && e.parse) {
|
|
332
|
-
const
|
|
333
|
-
Y(
|
|
329
|
+
const o = e == null ? void 0 : e.parse(a, r);
|
|
330
|
+
Y(o) ? o.then((d) => r[i] = d ?? "") : r[i] = o ?? "";
|
|
334
331
|
}
|
|
335
|
-
if (e != null && e.parse && !
|
|
336
|
-
return f("div", null, [
|
|
332
|
+
if (e != null && e.parse && !r[i] === void 0)
|
|
333
|
+
return f("div", null, [E("Loading...")]);
|
|
337
334
|
{
|
|
338
|
-
const
|
|
339
|
-
return
|
|
340
|
-
id:
|
|
341
|
-
onClick: t,
|
|
335
|
+
const o = r[i] || a;
|
|
336
|
+
return o ? f("div", {
|
|
337
|
+
id: n,
|
|
342
338
|
style: {
|
|
343
339
|
display: "flex",
|
|
344
340
|
justifyContent: "center",
|
|
345
341
|
alignItems: "center",
|
|
346
|
-
height: `${e == null ? void 0 : e.size}px
|
|
342
|
+
height: `${e == null ? void 0 : e.size}px`,
|
|
343
|
+
width: `${e == null ? void 0 : e.size}px`
|
|
347
344
|
}
|
|
348
|
-
}, [f(
|
|
345
|
+
}, [f(He, {
|
|
346
|
+
preview: e == null ? void 0 : e.preview,
|
|
347
|
+
width: "100%",
|
|
348
|
+
height: "100%",
|
|
349
|
+
fit: "contain",
|
|
350
|
+
src: o,
|
|
349
351
|
alt: "image",
|
|
350
|
-
style:
|
|
351
|
-
src: c
|
|
352
|
+
style: l
|
|
352
353
|
}, null)]) : f(I, null, null);
|
|
353
354
|
}
|
|
354
355
|
});
|
|
@@ -356,125 +357,125 @@ function bt(e) {
|
|
|
356
357
|
function K(e) {
|
|
357
358
|
return Re() ? (qe(e), !0) : !1;
|
|
358
359
|
}
|
|
359
|
-
function
|
|
360
|
+
function O(e) {
|
|
360
361
|
return typeof e == "function" ? e() : Pe(e);
|
|
361
362
|
}
|
|
362
363
|
const W = typeof window < "u" && typeof document < "u";
|
|
363
364
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
364
|
-
const
|
|
365
|
+
const wt = Object.prototype.toString, vt = (e) => wt.call(e) === "[object Object]", Ct = () => {
|
|
365
366
|
};
|
|
366
|
-
function
|
|
367
|
+
function kt(e) {
|
|
367
368
|
let t;
|
|
368
369
|
function r() {
|
|
369
370
|
return t || (t = e()), t;
|
|
370
371
|
}
|
|
371
372
|
return r.reset = async () => {
|
|
372
|
-
const
|
|
373
|
-
t = void 0,
|
|
373
|
+
const u = t;
|
|
374
|
+
t = void 0, u && await u;
|
|
374
375
|
}, r;
|
|
375
376
|
}
|
|
376
|
-
function
|
|
377
|
+
function xt(e, t) {
|
|
377
378
|
var r;
|
|
378
379
|
if (typeof e == "number")
|
|
379
380
|
return e + t;
|
|
380
|
-
const
|
|
381
|
+
const u = ((r = e.match(/^-?\d+\.?\d*/)) == null ? void 0 : r[0]) || "", a = e.slice(u.length), n = Number.parseFloat(u) + t;
|
|
381
382
|
return Number.isNaN(n) ? e : n + a;
|
|
382
383
|
}
|
|
383
|
-
function
|
|
384
|
+
function St(e, t, r = {}) {
|
|
384
385
|
const {
|
|
385
|
-
immediate:
|
|
386
|
+
immediate: u = !0
|
|
386
387
|
} = r, a = g(!1);
|
|
387
388
|
let n = null;
|
|
388
|
-
function
|
|
389
|
+
function l() {
|
|
389
390
|
n && (clearTimeout(n), n = null);
|
|
390
391
|
}
|
|
391
392
|
function i() {
|
|
392
|
-
a.value = !1,
|
|
393
|
+
a.value = !1, l();
|
|
393
394
|
}
|
|
394
|
-
function o(...
|
|
395
|
-
|
|
396
|
-
a.value = !1, n = null, e(...
|
|
397
|
-
},
|
|
395
|
+
function o(...d) {
|
|
396
|
+
l(), a.value = !0, n = setTimeout(() => {
|
|
397
|
+
a.value = !1, n = null, e(...d);
|
|
398
|
+
}, O(t));
|
|
398
399
|
}
|
|
399
|
-
return
|
|
400
|
+
return u && (a.value = !0, W && o()), K(i), {
|
|
400
401
|
isPending: se(a),
|
|
401
402
|
start: o,
|
|
402
403
|
stop: i
|
|
403
404
|
};
|
|
404
405
|
}
|
|
405
|
-
function
|
|
406
|
+
function Mt(e) {
|
|
406
407
|
var t;
|
|
407
|
-
const r =
|
|
408
|
+
const r = O(e);
|
|
408
409
|
return (t = r == null ? void 0 : r.$el) != null ? t : r;
|
|
409
410
|
}
|
|
410
411
|
const N = W ? window : void 0, me = W ? window.navigator : void 0;
|
|
411
412
|
function he(...e) {
|
|
412
|
-
let t, r,
|
|
413
|
-
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([r,
|
|
414
|
-
return
|
|
415
|
-
Array.isArray(r) || (r = [r]), Array.isArray(
|
|
416
|
-
const n = [],
|
|
413
|
+
let t, r, u, a;
|
|
414
|
+
if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([r, u, a] = e, t = N) : [t, r, u, a] = e, !t)
|
|
415
|
+
return Ct;
|
|
416
|
+
Array.isArray(r) || (r = [r]), Array.isArray(u) || (u = [u]);
|
|
417
|
+
const n = [], l = () => {
|
|
417
418
|
n.forEach((s) => s()), n.length = 0;
|
|
418
|
-
}, i = (s, m, h, w) => (s.addEventListener(m, h, w), () => s.removeEventListener(m, h, w)), o =
|
|
419
|
-
() => [
|
|
419
|
+
}, i = (s, m, h, w) => (s.addEventListener(m, h, w), () => s.removeEventListener(m, h, w)), o = Ee(
|
|
420
|
+
() => [Mt(t), O(a)],
|
|
420
421
|
([s, m]) => {
|
|
421
|
-
if (
|
|
422
|
+
if (l(), !s)
|
|
422
423
|
return;
|
|
423
|
-
const h =
|
|
424
|
+
const h = vt(m) ? { ...m } : m;
|
|
424
425
|
n.push(
|
|
425
|
-
...r.flatMap((w) =>
|
|
426
|
+
...r.flatMap((w) => u.map((S) => i(s, w, S, h)))
|
|
426
427
|
);
|
|
427
428
|
},
|
|
428
429
|
{ immediate: !0, flush: "post" }
|
|
429
|
-
),
|
|
430
|
-
o(),
|
|
430
|
+
), d = () => {
|
|
431
|
+
o(), l();
|
|
431
432
|
};
|
|
432
|
-
return K(
|
|
433
|
+
return K(d), d;
|
|
433
434
|
}
|
|
434
|
-
function
|
|
435
|
+
function Tt() {
|
|
435
436
|
const e = g(!1), t = H();
|
|
436
437
|
return t && A(() => {
|
|
437
438
|
e.value = !0;
|
|
438
439
|
}, t), e;
|
|
439
440
|
}
|
|
440
441
|
function U(e) {
|
|
441
|
-
const t =
|
|
442
|
+
const t = Tt();
|
|
442
443
|
return L(() => (t.value, !!e()));
|
|
443
444
|
}
|
|
444
445
|
function q(e, t = {}) {
|
|
445
|
-
const { window: r = N } = t,
|
|
446
|
+
const { window: r = N } = t, u = U(() => r && "matchMedia" in r && typeof r.matchMedia == "function");
|
|
446
447
|
let a;
|
|
447
|
-
const n = g(!1),
|
|
448
|
-
n.value =
|
|
448
|
+
const n = g(!1), l = (d) => {
|
|
449
|
+
n.value = d.matches;
|
|
449
450
|
}, i = () => {
|
|
450
|
-
a && ("removeEventListener" in a ? a.removeEventListener("change",
|
|
451
|
-
}, o =
|
|
452
|
-
|
|
451
|
+
a && ("removeEventListener" in a ? a.removeEventListener("change", l) : a.removeListener(l));
|
|
452
|
+
}, o = ze(() => {
|
|
453
|
+
u.value && (i(), a = r.matchMedia(O(e)), "addEventListener" in a ? a.addEventListener("change", l) : a.addListener(l), n.value = a.matches);
|
|
453
454
|
});
|
|
454
455
|
return K(() => {
|
|
455
456
|
o(), i(), a = void 0;
|
|
456
457
|
}), n;
|
|
457
458
|
}
|
|
458
|
-
function
|
|
459
|
+
function _t(e, t = {}) {
|
|
459
460
|
function r(s, m) {
|
|
460
|
-
let h =
|
|
461
|
-
return m != null && (h =
|
|
461
|
+
let h = O(e[O(s)]);
|
|
462
|
+
return m != null && (h = xt(h, m)), typeof h == "number" && (h = `${h}px`), h;
|
|
462
463
|
}
|
|
463
|
-
const { window:
|
|
464
|
+
const { window: u = N, strategy: a = "min-width" } = t;
|
|
464
465
|
function n(s) {
|
|
465
|
-
return
|
|
466
|
+
return u ? u.matchMedia(s).matches : !1;
|
|
466
467
|
}
|
|
467
|
-
const
|
|
468
|
-
get: () => a === "min-width" ?
|
|
468
|
+
const l = (s) => q(() => `(min-width: ${r(s)})`, t), i = (s) => q(() => `(max-width: ${r(s)})`, t), o = Object.keys(e).reduce((s, m) => (Object.defineProperty(s, m, {
|
|
469
|
+
get: () => a === "min-width" ? l(m) : i(m),
|
|
469
470
|
enumerable: !0,
|
|
470
471
|
configurable: !0
|
|
471
472
|
}), s), {});
|
|
472
|
-
function
|
|
473
|
-
const s = Object.keys(e).map((m) => [m,
|
|
473
|
+
function d() {
|
|
474
|
+
const s = Object.keys(e).map((m) => [m, l(m)]);
|
|
474
475
|
return L(() => s.filter(([, m]) => m.value).map(([m]) => m));
|
|
475
476
|
}
|
|
476
477
|
return Object.assign(o, {
|
|
477
|
-
greaterOrEqual:
|
|
478
|
+
greaterOrEqual: l,
|
|
478
479
|
smallerOrEqual: i,
|
|
479
480
|
greater(s) {
|
|
480
481
|
return q(() => `(min-width: ${r(s, 0.1)})`, t);
|
|
@@ -500,9 +501,9 @@ function Tt(e, t = {}) {
|
|
|
500
501
|
isInBetween(s, m) {
|
|
501
502
|
return n(`(min-width: ${r(s)}) and (max-width: ${r(m, -0.1)})`);
|
|
502
503
|
},
|
|
503
|
-
current:
|
|
504
|
+
current: d,
|
|
504
505
|
active() {
|
|
505
|
-
const s =
|
|
506
|
+
const s = d();
|
|
506
507
|
return L(() => s.value.length === 0 ? "" : s.value.at(-1));
|
|
507
508
|
}
|
|
508
509
|
});
|
|
@@ -510,44 +511,44 @@ function Tt(e, t = {}) {
|
|
|
510
511
|
function ue(e, t = {}) {
|
|
511
512
|
const {
|
|
512
513
|
controls: r = !1,
|
|
513
|
-
navigator:
|
|
514
|
-
} = t, a = U(() =>
|
|
514
|
+
navigator: u = me
|
|
515
|
+
} = t, a = U(() => u && "permissions" in u);
|
|
515
516
|
let n;
|
|
516
|
-
const
|
|
517
|
+
const l = typeof e == "string" ? { name: e } : e, i = g(), o = () => {
|
|
517
518
|
n && (i.value = n.state);
|
|
518
|
-
},
|
|
519
|
+
}, d = kt(async () => {
|
|
519
520
|
if (a.value) {
|
|
520
521
|
if (!n)
|
|
521
522
|
try {
|
|
522
|
-
n = await
|
|
523
|
+
n = await u.permissions.query(l), he(n, "change", o), o();
|
|
523
524
|
} catch {
|
|
524
525
|
i.value = "prompt";
|
|
525
526
|
}
|
|
526
527
|
return n;
|
|
527
528
|
}
|
|
528
529
|
});
|
|
529
|
-
return
|
|
530
|
+
return d(), r ? {
|
|
530
531
|
state: i,
|
|
531
532
|
isSupported: a,
|
|
532
|
-
query:
|
|
533
|
+
query: d
|
|
533
534
|
} : i;
|
|
534
535
|
}
|
|
535
|
-
function
|
|
536
|
+
function $t(e = {}) {
|
|
536
537
|
const {
|
|
537
538
|
navigator: t = me,
|
|
538
539
|
read: r = !1,
|
|
539
|
-
source:
|
|
540
|
+
source: u,
|
|
540
541
|
copiedDuring: a = 1500,
|
|
541
542
|
legacy: n = !1
|
|
542
|
-
} = e,
|
|
543
|
+
} = e, l = U(() => t && "clipboard" in t), i = ue("clipboard-read"), o = ue("clipboard-write"), d = L(() => l.value || n), s = g(""), m = g(!1), h = St(() => m.value = !1, a);
|
|
543
544
|
function w() {
|
|
544
|
-
|
|
545
|
+
l.value && v(i.value) ? t.clipboard.readText().then((y) => {
|
|
545
546
|
s.value = y;
|
|
546
547
|
}) : s.value = j();
|
|
547
548
|
}
|
|
548
|
-
|
|
549
|
-
async function S(y =
|
|
550
|
-
|
|
549
|
+
d.value && r && he(["copy", "cut"], w);
|
|
550
|
+
async function S(y = O(u)) {
|
|
551
|
+
d.value && y != null && (l.value && v(o.value) ? await t.clipboard.writeText(y) : x(y), s.value = y, m.value = !0, h.start());
|
|
551
552
|
}
|
|
552
553
|
function x(y) {
|
|
553
554
|
const C = document.createElement("textarea");
|
|
@@ -561,33 +562,33 @@ function _t(e = {}) {
|
|
|
561
562
|
return y === "granted" || y === "prompt";
|
|
562
563
|
}
|
|
563
564
|
return {
|
|
564
|
-
isSupported:
|
|
565
|
+
isSupported: d,
|
|
565
566
|
text: s,
|
|
566
567
|
copied: m,
|
|
567
568
|
copy: S
|
|
568
569
|
};
|
|
569
570
|
}
|
|
570
571
|
const Ot = " ";
|
|
571
|
-
function
|
|
572
|
+
function Lt(e) {
|
|
572
573
|
return e == null ? void 0 : e.replace(/(\d{3})\d*(\d{4})/g, "$1****$2");
|
|
573
574
|
}
|
|
574
575
|
function ie(e, t) {
|
|
575
576
|
return e == null ? void 0 : e.replace(/\*/g, "M").replace(/\B(?=(?:\S{4})+$)/g, t ?? Ot).replace(/M/g, "*");
|
|
576
577
|
}
|
|
577
|
-
function
|
|
578
|
-
const t =
|
|
579
|
-
return k("phone", (
|
|
580
|
-
const n = `phone_${Math.random().toString(36).slice(2)}`,
|
|
578
|
+
function jt(e) {
|
|
579
|
+
const t = $t();
|
|
580
|
+
return k("phone", (u, a) => {
|
|
581
|
+
const n = `phone_${Math.random().toString(36).slice(2)}`, l = "__table__column_phone__", i = T(u, a), o = 16, d = `cursor:pointer;width:${o}px;height:${o}px;`, s = ie(Lt(i), e == null ? void 0 : e.separator), m = ie(i, e == null ? void 0 : e.separator);
|
|
581
582
|
function h() {
|
|
582
583
|
window.focus(), t.copy(i).then(() => {
|
|
583
|
-
|
|
584
|
+
Ie.success({
|
|
584
585
|
content: "复制成功",
|
|
585
586
|
duration: 1e3
|
|
586
587
|
});
|
|
587
588
|
});
|
|
588
589
|
}
|
|
589
590
|
function w() {
|
|
590
|
-
const v = document.querySelectorAll(`.${
|
|
591
|
+
const v = document.querySelectorAll(`.${l}.content`);
|
|
591
592
|
v.length > 0 && v.forEach((y) => {
|
|
592
593
|
const C = y;
|
|
593
594
|
if (C.innerText.includes("****"))
|
|
@@ -613,12 +614,12 @@ function Lt(e) {
|
|
|
613
614
|
style: "display:flex;align-items:center;gap:4px;"
|
|
614
615
|
}, [f("div", {
|
|
615
616
|
"data-encrypt": s,
|
|
616
|
-
class: `${
|
|
617
|
+
class: `${l} content`,
|
|
617
618
|
style: "use-select:none;font-family: monospace;cursor:pointer;font-variant-numeric: tabular-nums;padding-right: 2px;"
|
|
618
619
|
}, [e != null && e.safe ? s : m]), (e == null ? void 0 : e.safe) && (e == null ? void 0 : e.allowPreview) && f("i", {
|
|
619
620
|
class: "preview-icon",
|
|
620
621
|
title: "显示完整号码",
|
|
621
|
-
style:
|
|
622
|
+
style: d,
|
|
622
623
|
onClick: x
|
|
623
624
|
}, [f("svg", {
|
|
624
625
|
width: o,
|
|
@@ -639,7 +640,7 @@ function Lt(e) {
|
|
|
639
640
|
"stroke-width": "4",
|
|
640
641
|
"stroke-linejoin": "round"
|
|
641
642
|
}, null)])]), (e == null ? void 0 : e.allowDial) && f("i", {
|
|
642
|
-
style:
|
|
643
|
+
style: d,
|
|
643
644
|
title: "拨出号码",
|
|
644
645
|
onClick: j
|
|
645
646
|
}, [f("svg", {
|
|
@@ -667,7 +668,7 @@ function Lt(e) {
|
|
|
667
668
|
"stroke-width": "4",
|
|
668
669
|
"stroke-linejoin": "round"
|
|
669
670
|
}, null)])]), (e == null ? void 0 : e.allowCopy) && f("i", {
|
|
670
|
-
style:
|
|
671
|
+
style: d,
|
|
671
672
|
title: "复制号码",
|
|
672
673
|
onClick: h
|
|
673
674
|
}, [f("svg", {
|
|
@@ -691,22 +692,22 @@ function Lt(e) {
|
|
|
691
692
|
}, null)])])]);
|
|
692
693
|
});
|
|
693
694
|
}
|
|
694
|
-
function
|
|
695
|
+
function Rt(e) {
|
|
695
696
|
return k("render", (r) => e(r));
|
|
696
697
|
}
|
|
697
|
-
function
|
|
698
|
-
return k("tag", (r,
|
|
699
|
-
const a = (e == null ? void 0 : e.maxCount) || 5, n = e != null && e.formatter ? e.formatter(r) : T(r,
|
|
698
|
+
function qt(e) {
|
|
699
|
+
return k("tag", (r, u) => {
|
|
700
|
+
const a = (e == null ? void 0 : e.maxCount) || 5, n = e != null && e.formatter ? e.formatter(r) : T(r, u), l = (e == null ? void 0 : e.textColors) || ["#F87335"], i = (e == null ? void 0 : e.backgroundColors) || ["#FFF4E8"], o = n.length > a, d = e == null ? void 0 : e.minWidth;
|
|
700
701
|
return f("div", {
|
|
701
702
|
style: {
|
|
702
703
|
display: "flex",
|
|
703
704
|
flexWrap: "wrap"
|
|
704
705
|
}
|
|
705
706
|
}, [n.slice(0, a).map((s, m) => {
|
|
706
|
-
const h = typeof
|
|
707
|
+
const h = typeof l == "function" ? l(s, m) : l[m % l.length], w = typeof i == "function" ? i(s, m) : i[m % i.length];
|
|
707
708
|
return f("span", {
|
|
708
709
|
style: {
|
|
709
|
-
minWidth:
|
|
710
|
+
minWidth: d ? `${d}px` : "unset",
|
|
710
711
|
textAlign: "center",
|
|
711
712
|
margin: "2px",
|
|
712
713
|
padding: "2px 5px",
|
|
@@ -725,11 +726,11 @@ function ce(e) {
|
|
|
725
726
|
if (typeof e == "number")
|
|
726
727
|
return `${e}px`;
|
|
727
728
|
}
|
|
728
|
-
function
|
|
729
|
-
var
|
|
730
|
-
return typeof e == "function" ? (
|
|
729
|
+
function Pt(e, t, r) {
|
|
730
|
+
var u, a;
|
|
731
|
+
return typeof e == "function" ? (u = e(r)) == null ? void 0 : u.toString() : typeof (e == null ? void 0 : e.content) == "function" ? (a = e == null ? void 0 : e.content(r)) == null ? void 0 : a.toString() : typeof (e == null ? void 0 : e.content) == "string" ? e == null ? void 0 : e.content : T(r, t);
|
|
731
732
|
}
|
|
732
|
-
function
|
|
733
|
+
function zt(e, t) {
|
|
733
734
|
if (typeof e != "function") {
|
|
734
735
|
if (typeof (e == null ? void 0 : e.color) == "function")
|
|
735
736
|
return e == null ? void 0 : e.color(t);
|
|
@@ -741,35 +742,35 @@ function Et(e, t) {
|
|
|
741
742
|
if (typeof e != "function")
|
|
742
743
|
return typeof (e == null ? void 0 : e.size) == "function" ? ce(e == null ? void 0 : e.size(t)) : ce(e == null ? void 0 : e.size);
|
|
743
744
|
}
|
|
744
|
-
function
|
|
745
|
+
function Yt(e, t) {
|
|
745
746
|
let r = "";
|
|
746
|
-
const
|
|
747
|
-
return
|
|
747
|
+
const u = zt(e, t), a = Et(e, t);
|
|
748
|
+
return u && (r += `color:${u};`), a && (r += `font-size:${a};`), r;
|
|
748
749
|
}
|
|
749
|
-
function
|
|
750
|
-
return k("text", (r,
|
|
751
|
-
const a =
|
|
750
|
+
function At(e) {
|
|
751
|
+
return k("text", (r, u) => {
|
|
752
|
+
const a = Pt(e || {}, u, r), n = Yt(e || {}, r);
|
|
752
753
|
return f("span", {
|
|
753
754
|
style: n
|
|
754
755
|
}, [a]);
|
|
755
756
|
});
|
|
756
757
|
}
|
|
757
|
-
function
|
|
758
|
-
const t = (e == null ? void 0 : e.backgroundColor) ?? "#f5f5f5", r = (e == null ? void 0 : e.foregroundColor) ?? "#1677ff",
|
|
759
|
-
return k("progress", (
|
|
758
|
+
function Bt(e) {
|
|
759
|
+
const t = (e == null ? void 0 : e.backgroundColor) ?? "#f5f5f5", r = (e == null ? void 0 : e.foregroundColor) ?? "#1677ff", u = (e == null ? void 0 : e.showText) ?? !0, a = (e == null ? void 0 : e.textColor) ?? "#000";
|
|
760
|
+
return k("progress", (l, i) => {
|
|
760
761
|
var h;
|
|
761
|
-
const o = T(
|
|
762
|
+
const o = T(l, i), d = (e == null ? void 0 : e.precision) ?? 0, s = Math.min(Math.max(((h = e == null ? void 0 : e.format) == null ? void 0 : h.call(e, o)) ?? o, 0), 1), m = u ? `${(s * 100).toFixed(d)}%` : "";
|
|
762
763
|
return f("div", {
|
|
763
764
|
style: `background-color:${t};position:relative;min-height: 20px;text-align: center;border-radius: 2px;overflow:hidden;`
|
|
764
765
|
}, [f("div", {
|
|
765
766
|
style: `background-color: ${r};position:absolute;left:0;top:0;right;0;width: ${m};height: 100%;`
|
|
766
|
-
}, null),
|
|
767
|
+
}, null), u && f("div", {
|
|
767
768
|
style: `position:absolute;inset:0;display:flex;justify-content:center;align-items:center;color:${a}`
|
|
768
769
|
}, [m])]);
|
|
769
770
|
});
|
|
770
771
|
}
|
|
771
|
-
function
|
|
772
|
-
return k("serial", (r,
|
|
772
|
+
function Dt(e) {
|
|
773
|
+
return k("serial", (r, u, a) => {
|
|
773
774
|
const n = {
|
|
774
775
|
color: typeof (e == null ? void 0 : e.color) == "function" ? e.color(r) : e == null ? void 0 : e.color,
|
|
775
776
|
fontWeight: (e == null ? void 0 : e.weight) || "normal",
|
|
@@ -782,38 +783,38 @@ function Bt(e) {
|
|
|
782
783
|
disableViewMode: !0
|
|
783
784
|
});
|
|
784
785
|
}
|
|
785
|
-
function
|
|
786
|
+
function Vt() {
|
|
786
787
|
return {
|
|
787
|
-
dropdown:
|
|
788
|
-
text:
|
|
789
|
-
dict:
|
|
790
|
-
tag:
|
|
791
|
-
render:
|
|
792
|
-
phone:
|
|
793
|
-
image:
|
|
794
|
-
currency:
|
|
795
|
-
date:
|
|
796
|
-
button:
|
|
797
|
-
progress:
|
|
798
|
-
serial:
|
|
788
|
+
dropdown: yt,
|
|
789
|
+
text: At,
|
|
790
|
+
dict: ht,
|
|
791
|
+
tag: qt,
|
|
792
|
+
render: Rt,
|
|
793
|
+
phone: jt,
|
|
794
|
+
image: gt,
|
|
795
|
+
currency: ut,
|
|
796
|
+
date: st,
|
|
797
|
+
button: at,
|
|
798
|
+
progress: Bt,
|
|
799
|
+
serial: Dt
|
|
799
800
|
};
|
|
800
801
|
}
|
|
801
802
|
function G(e, t) {
|
|
802
803
|
if (!(e != null && e.render))
|
|
803
804
|
return;
|
|
804
805
|
const r = e.render({
|
|
805
|
-
...
|
|
806
|
+
...Vt()
|
|
806
807
|
// ...(Table?.$override?.table || {}),
|
|
807
808
|
});
|
|
808
809
|
return {
|
|
809
810
|
render: ({
|
|
810
|
-
record:
|
|
811
|
+
record: u,
|
|
811
812
|
rowIndex: a
|
|
812
|
-
}) => r(
|
|
813
|
+
}) => r(u, e, {
|
|
813
814
|
...t || {},
|
|
814
815
|
rowIndex: a
|
|
815
816
|
}),
|
|
816
|
-
[
|
|
817
|
+
[nt]: r.$type,
|
|
817
818
|
disableColumnMode: r.$disableColumnMode,
|
|
818
819
|
disableViewMode: r.$disableViewMode,
|
|
819
820
|
isRender: r.$type === "render",
|
|
@@ -824,50 +825,50 @@ function de({
|
|
|
824
825
|
columns: e,
|
|
825
826
|
columnsOptions: t,
|
|
826
827
|
columnsGroups: r,
|
|
827
|
-
pageMode:
|
|
828
|
+
pageMode: u,
|
|
828
829
|
collapsedColumns: a,
|
|
829
830
|
events: n
|
|
830
831
|
}) {
|
|
831
|
-
const
|
|
832
|
+
const l = e.map((i) => ({
|
|
832
833
|
...t || {},
|
|
833
834
|
...i
|
|
834
|
-
})).map((i) =>
|
|
835
|
-
return
|
|
835
|
+
})).map((i) => It(i, u, a, n)).filter(Boolean);
|
|
836
|
+
return Ht(l, r);
|
|
836
837
|
}
|
|
837
|
-
function
|
|
838
|
-
const r = [],
|
|
839
|
-
if ("children" in n && (n.children = n.children.map(
|
|
840
|
-
const
|
|
838
|
+
function Ft(e, t) {
|
|
839
|
+
const r = [], u = (n) => {
|
|
840
|
+
if ("children" in n && (n.children = n.children.map(u)), "key" in n) {
|
|
841
|
+
const l = t.find((i) => {
|
|
841
842
|
var o;
|
|
842
843
|
return ((o = Object.getOwnPropertyDescriptor(i, "key")) == null ? void 0 : o.value) === n.key;
|
|
843
844
|
});
|
|
844
|
-
if (
|
|
845
|
-
return r.push(
|
|
845
|
+
if (l)
|
|
846
|
+
return r.push(l), l;
|
|
846
847
|
}
|
|
847
848
|
return n;
|
|
848
|
-
}, a =
|
|
849
|
+
}, a = u(e);
|
|
849
850
|
if (r != null && r.length && a) {
|
|
850
|
-
const n = Math.min(...r.map((
|
|
851
|
-
r.forEach((
|
|
852
|
-
const i = t.indexOf(
|
|
851
|
+
const n = Math.min(...r.map((l) => t.indexOf(l)));
|
|
852
|
+
r.forEach((l) => {
|
|
853
|
+
const i = t.indexOf(l);
|
|
853
854
|
t.splice(i, 1);
|
|
854
855
|
}), t.splice(n, 0, a);
|
|
855
856
|
}
|
|
856
857
|
}
|
|
857
|
-
function
|
|
858
|
+
function Ht(e, t = []) {
|
|
858
859
|
return t.forEach((r) => {
|
|
859
|
-
|
|
860
|
+
Ft(r, e);
|
|
860
861
|
}), e;
|
|
861
862
|
}
|
|
862
|
-
function
|
|
863
|
+
function It(e, t, r, u) {
|
|
863
864
|
const {
|
|
864
865
|
render: a,
|
|
865
866
|
disableColumnMode: n
|
|
866
867
|
} = G(e, {
|
|
867
868
|
previewing: !1,
|
|
868
|
-
emits:
|
|
869
|
+
emits: u
|
|
869
870
|
}) || {};
|
|
870
|
-
if (!(n || e.visiable === !1) && !(typeof e.visiable == "function" && e.visiable() === !1) && !r.value.find((
|
|
871
|
+
if (!(n || e.visiable === !1) && !(typeof e.visiable == "function" && e.visiable() === !1) && !r.value.find((l) => l.key === e.key && l.collapsed === !0))
|
|
871
872
|
return {
|
|
872
873
|
dataIndex: e.index || e.key,
|
|
873
874
|
title: e.title,
|
|
@@ -886,10 +887,10 @@ function Ht(e, t, r, l) {
|
|
|
886
887
|
render: a
|
|
887
888
|
};
|
|
888
889
|
}
|
|
889
|
-
function
|
|
890
|
-
return new
|
|
890
|
+
function Kt() {
|
|
891
|
+
return new Xe.Workbook();
|
|
891
892
|
}
|
|
892
|
-
function
|
|
893
|
+
function Wt(e, t = "Sheet1") {
|
|
893
894
|
return e.addWorksheet(t, {
|
|
894
895
|
headerFooter: {
|
|
895
896
|
firstHeader: "",
|
|
@@ -897,29 +898,29 @@ function Kt(e, t = "Sheet1") {
|
|
|
897
898
|
}
|
|
898
899
|
});
|
|
899
900
|
}
|
|
900
|
-
function
|
|
901
|
+
function Nt(e, t) {
|
|
901
902
|
e.columns = t;
|
|
902
903
|
}
|
|
903
|
-
function
|
|
904
|
+
function Ut(e, t) {
|
|
904
905
|
e.addRows(t);
|
|
905
906
|
}
|
|
906
|
-
async function
|
|
907
|
+
async function Gt({
|
|
907
908
|
columns: e,
|
|
908
909
|
rows: t,
|
|
909
910
|
filename: r
|
|
910
911
|
}) {
|
|
911
|
-
const
|
|
912
|
-
|
|
913
|
-
const n = await
|
|
914
|
-
|
|
912
|
+
const u = Kt(), a = Wt(u);
|
|
913
|
+
Nt(a, e), Ut(a, t);
|
|
914
|
+
const n = await u.xlsx.writeBuffer(), l = new Blob([n]);
|
|
915
|
+
Zt(l, r || `${V().format("YYYY-MM-DD HH:mm:ss")}.xlsx`);
|
|
915
916
|
}
|
|
916
|
-
function
|
|
917
|
+
function Zt(e, t) {
|
|
917
918
|
const r = document.createElement("a");
|
|
918
919
|
r.download = t || "download", r.href = URL.createObjectURL(e), r.click(), setTimeout(() => {
|
|
919
920
|
URL.revokeObjectURL(r.href);
|
|
920
921
|
}, 1e3);
|
|
921
922
|
}
|
|
922
|
-
function
|
|
923
|
+
function Jt(e, t) {
|
|
923
924
|
const r = {};
|
|
924
925
|
return e.filter((a) => a.exportable !== !1).map((a) => ({
|
|
925
926
|
options: a,
|
|
@@ -927,25 +928,25 @@ function Zt(e, t) {
|
|
|
927
928
|
content: typeof a.exportable == "object" ? a.exportable.content : void 0
|
|
928
929
|
})).forEach((a) => {
|
|
929
930
|
var i;
|
|
930
|
-
const n = (i = a.render) == null ? void 0 : i.render,
|
|
931
|
+
const n = (i = a.render) == null ? void 0 : i.render, l = () => {
|
|
931
932
|
var o;
|
|
932
933
|
switch (!0) {
|
|
933
934
|
case !!a.content:
|
|
934
935
|
return a.content && a.content(t);
|
|
935
936
|
case !!n: {
|
|
936
|
-
const
|
|
937
|
+
const d = document.createElement("div"), s = Ye(() => n && n({
|
|
937
938
|
record: t
|
|
938
939
|
}));
|
|
939
|
-
return Ae(s,
|
|
940
|
+
return Ae(s, d), (o = s.el) == null ? void 0 : o.innerText;
|
|
940
941
|
}
|
|
941
942
|
default:
|
|
942
943
|
return T(t, a.options);
|
|
943
944
|
}
|
|
944
945
|
};
|
|
945
|
-
r[a.options.key] =
|
|
946
|
+
r[a.options.key] = l();
|
|
946
947
|
}), r;
|
|
947
948
|
}
|
|
948
|
-
function
|
|
949
|
+
function Qt(e) {
|
|
949
950
|
switch (!0) {
|
|
950
951
|
case typeof e == "number":
|
|
951
952
|
return e / 6;
|
|
@@ -955,31 +956,31 @@ function Jt(e) {
|
|
|
955
956
|
return 30;
|
|
956
957
|
}
|
|
957
958
|
}
|
|
958
|
-
function
|
|
959
|
-
const
|
|
960
|
-
var
|
|
959
|
+
function Xt(e, t, r) {
|
|
960
|
+
const u = e.filter((n) => n.exportable !== !1).map((n) => {
|
|
961
|
+
var l, i;
|
|
961
962
|
return {
|
|
962
963
|
key: n.key,
|
|
963
|
-
header: ((
|
|
964
|
-
width: ((i = n.exportable) == null ? void 0 : i.width) ||
|
|
964
|
+
header: ((l = n.exportable) == null ? void 0 : l.header) || n.title,
|
|
965
|
+
width: ((i = n.exportable) == null ? void 0 : i.width) || Qt(n.width)
|
|
965
966
|
};
|
|
966
|
-
}), a = t.map((n) =>
|
|
967
|
-
|
|
968
|
-
columns:
|
|
967
|
+
}), a = t.map((n) => Jt(e, n));
|
|
968
|
+
Gt({
|
|
969
|
+
columns: u,
|
|
969
970
|
rows: a,
|
|
970
971
|
filename: r
|
|
971
972
|
});
|
|
972
973
|
}
|
|
973
|
-
function
|
|
974
|
+
function pt() {
|
|
974
975
|
return {
|
|
975
|
-
exportExcel:
|
|
976
|
+
exportExcel: Xt
|
|
976
977
|
};
|
|
977
978
|
}
|
|
978
979
|
class Z {
|
|
979
980
|
constructor(t) {
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
981
|
+
$(this, "sort", {});
|
|
982
|
+
$(this, "defaultSort", {});
|
|
983
|
+
$(this, "before", (t) => {
|
|
983
984
|
t.paramsQuery = {
|
|
984
985
|
...t.paramsQuery || {},
|
|
985
986
|
sort: this.stringify(this.sort)
|
|
@@ -1000,9 +1001,9 @@ class Z {
|
|
|
1000
1001
|
* @param key 排序关键字
|
|
1001
1002
|
*/
|
|
1002
1003
|
remove(t) {
|
|
1003
|
-
const r = Object.entries(this.sort).filter(([
|
|
1004
|
-
this.sort = {}, r && r.forEach(([
|
|
1005
|
-
this.sort[
|
|
1004
|
+
const r = Object.entries(this.sort).filter(([u]) => u !== t);
|
|
1005
|
+
this.sort = {}, r && r.forEach(([u, a]) => {
|
|
1006
|
+
this.sort[u] = a;
|
|
1006
1007
|
});
|
|
1007
1008
|
}
|
|
1008
1009
|
/**
|
|
@@ -1015,35 +1016,35 @@ class Z {
|
|
|
1015
1016
|
* 转换排序对象为字符串
|
|
1016
1017
|
*/
|
|
1017
1018
|
stringify(t) {
|
|
1018
|
-
return typeof t != "object" ? [] : (t instanceof Z && (t = t.sort), Object.entries(t).map(([r,
|
|
1019
|
+
return typeof t != "object" ? [] : (t instanceof Z && (t = t.sort), Object.entries(t).map(([r, u]) => `${r},${u}`));
|
|
1019
1020
|
}
|
|
1020
1021
|
}
|
|
1021
|
-
const
|
|
1022
|
-
function
|
|
1022
|
+
const er = 300;
|
|
1023
|
+
function tr(e) {
|
|
1023
1024
|
const t = e, r = t == null ? void 0 : t.querySelector(".arco-scrollbar-container.arco-table-body");
|
|
1024
1025
|
if (!r)
|
|
1025
1026
|
return;
|
|
1026
|
-
let
|
|
1027
|
+
let u, a = !1, n;
|
|
1027
1028
|
r.addEventListener("mousedown", () => {
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
},
|
|
1029
|
+
u = setTimeout(() => {
|
|
1030
|
+
u && (r.style.cursor = "grab", r.style.userSelect = "none", a = !0);
|
|
1031
|
+
}, er);
|
|
1031
1032
|
}), r.addEventListener("mouseup", () => {
|
|
1032
|
-
clearTimeout(
|
|
1033
|
-
}), r.addEventListener("mousemove", (
|
|
1033
|
+
clearTimeout(u), u && (u = void 0, a = !1, r.style.cursor = "", r.style.userSelect = "", n = void 0);
|
|
1034
|
+
}), r.addEventListener("mousemove", (l) => {
|
|
1034
1035
|
if (a)
|
|
1035
1036
|
if (n === void 0)
|
|
1036
|
-
n =
|
|
1037
|
+
n = l.clientX;
|
|
1037
1038
|
else {
|
|
1038
|
-
const i = n -
|
|
1039
|
-
n =
|
|
1039
|
+
const i = n - l.clientX;
|
|
1040
|
+
n = l.clientX, r.scrollLeft += i;
|
|
1040
1041
|
}
|
|
1041
1042
|
});
|
|
1042
1043
|
}
|
|
1043
|
-
function
|
|
1044
|
+
function rr(e) {
|
|
1044
1045
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Be(e);
|
|
1045
1046
|
}
|
|
1046
|
-
const
|
|
1047
|
+
const nr = /* @__PURE__ */ B({
|
|
1047
1048
|
props: {
|
|
1048
1049
|
record: {
|
|
1049
1050
|
type: Object,
|
|
@@ -1077,7 +1078,7 @@ const rr = /* @__PURE__ */ B({
|
|
|
1077
1078
|
}
|
|
1078
1079
|
},
|
|
1079
1080
|
setup(e) {
|
|
1080
|
-
const t = H(), r = g(0),
|
|
1081
|
+
const t = H(), r = g(0), u = e.columns.filter((n) => typeof n.visiable == "boolean" ? n.visiable : typeof n.visiable == "function" ? n.visiable() : !0).map((n) => ({
|
|
1081
1082
|
options: n,
|
|
1082
1083
|
renderer: G(n, {
|
|
1083
1084
|
previewing: !0
|
|
@@ -1085,16 +1086,16 @@ const rr = /* @__PURE__ */ B({
|
|
|
1085
1086
|
})).filter(({
|
|
1086
1087
|
options: n
|
|
1087
1088
|
}) => {
|
|
1088
|
-
var
|
|
1089
|
-
return !((
|
|
1089
|
+
var l;
|
|
1090
|
+
return !((l = e.exclude) != null && l.includes(n.key));
|
|
1090
1091
|
}).filter(({
|
|
1091
1092
|
renderer: n
|
|
1092
1093
|
}) => !(n != null && n.disableViewMode));
|
|
1093
1094
|
function a() {
|
|
1094
1095
|
var n;
|
|
1095
1096
|
if (t) {
|
|
1096
|
-
const
|
|
1097
|
-
r.value = Math.floor(
|
|
1097
|
+
const l = (n = t.proxy) == null ? void 0 : n.$el;
|
|
1098
|
+
r.value = Math.floor(l.offsetWidth / e.minWidth);
|
|
1098
1099
|
}
|
|
1099
1100
|
}
|
|
1100
1101
|
return A(() => {
|
|
@@ -1103,19 +1104,19 @@ const rr = /* @__PURE__ */ B({
|
|
|
1103
1104
|
let n;
|
|
1104
1105
|
return f("div", {
|
|
1105
1106
|
class: "preview-container"
|
|
1106
|
-
}, [f(
|
|
1107
|
+
}, [f(Ke, {
|
|
1107
1108
|
column: r.value,
|
|
1108
1109
|
bordered: !0,
|
|
1109
1110
|
align: "left",
|
|
1110
1111
|
layout: e.layout
|
|
1111
|
-
},
|
|
1112
|
-
label:
|
|
1112
|
+
}, rr(n = u.map((l) => f(We, {
|
|
1113
|
+
label: l.options.title
|
|
1113
1114
|
}, {
|
|
1114
1115
|
default: () => {
|
|
1115
1116
|
var i, o;
|
|
1116
|
-
return [(i =
|
|
1117
|
+
return [(i = l.renderer) != null && i.render ? (o = l.renderer) == null ? void 0 : o.render({
|
|
1117
1118
|
record: e.record
|
|
1118
|
-
}) : T(e.record,
|
|
1119
|
+
}) : T(e.record, l.options)];
|
|
1119
1120
|
}
|
|
1120
1121
|
}))) ? n : {
|
|
1121
1122
|
default: () => [n]
|
|
@@ -1123,12 +1124,12 @@ const rr = /* @__PURE__ */ B({
|
|
|
1123
1124
|
};
|
|
1124
1125
|
}
|
|
1125
1126
|
});
|
|
1126
|
-
function
|
|
1127
|
+
function ar(e, t, {
|
|
1127
1128
|
tableForm: r,
|
|
1128
|
-
tableEvents:
|
|
1129
|
+
tableEvents: u
|
|
1129
1130
|
}) {
|
|
1130
1131
|
const a = e.refreshable || e.exportable || t.slots.actions, n = !!(r != null && r.length) && a;
|
|
1131
|
-
return a || n ? () => f(I, null, [n && f(
|
|
1132
|
+
return a || n ? () => f(I, null, [n && f(Ne, {
|
|
1132
1133
|
margin: 0
|
|
1133
1134
|
}, null), a && f("div", {
|
|
1134
1135
|
class: "table-actions",
|
|
@@ -1144,19 +1145,19 @@ function nr(e, t, {
|
|
|
1144
1145
|
}, [f(ae, null, {
|
|
1145
1146
|
default: () => [e.refreshable && f(P, {
|
|
1146
1147
|
type: "primary",
|
|
1147
|
-
onClick: () =>
|
|
1148
|
+
onClick: () => u("reload")
|
|
1148
1149
|
}, {
|
|
1149
|
-
default: () => [
|
|
1150
|
+
default: () => [E("刷新")]
|
|
1150
1151
|
}), e.exportable && f(P, {
|
|
1151
1152
|
type: "primary",
|
|
1152
|
-
onClick: () =>
|
|
1153
|
+
onClick: () => u("export")
|
|
1153
1154
|
}, {
|
|
1154
|
-
default: () => [
|
|
1155
|
+
default: () => [E("导出")]
|
|
1155
1156
|
}), e.collapsable && f(P, {
|
|
1156
1157
|
type: "primary",
|
|
1157
|
-
onClick: () =>
|
|
1158
|
+
onClick: () => u("collapse")
|
|
1158
1159
|
}, {
|
|
1159
|
-
default: () => [
|
|
1160
|
+
default: () => [E("显示")]
|
|
1160
1161
|
})]
|
|
1161
1162
|
})]), f("div", {
|
|
1162
1163
|
class: "customs"
|
|
@@ -1165,9 +1166,9 @@ function nr(e, t, {
|
|
|
1165
1166
|
})])])]) : () => {
|
|
1166
1167
|
};
|
|
1167
1168
|
}
|
|
1168
|
-
function
|
|
1169
|
+
function lr(e, t, {
|
|
1169
1170
|
tableForm: r,
|
|
1170
|
-
tableEvents:
|
|
1171
|
+
tableEvents: u,
|
|
1171
1172
|
formInstance: a
|
|
1172
1173
|
}) {
|
|
1173
1174
|
return r != null && r.length ? () => f("div", {
|
|
@@ -1176,7 +1177,7 @@ function ar(e, t, {
|
|
|
1176
1177
|
form: r,
|
|
1177
1178
|
ref: (n) => a && (a.value = n),
|
|
1178
1179
|
searchable: !0,
|
|
1179
|
-
onSubmit: () =>
|
|
1180
|
+
onSubmit: () => u("reload", {
|
|
1180
1181
|
reset: !0
|
|
1181
1182
|
})
|
|
1182
1183
|
}, e.formOptions), {
|
|
@@ -1184,49 +1185,49 @@ function ar(e, t, {
|
|
|
1184
1185
|
})]) : () => {
|
|
1185
1186
|
};
|
|
1186
1187
|
}
|
|
1187
|
-
function
|
|
1188
|
+
function ur(e, t, {
|
|
1188
1189
|
tableSource: r
|
|
1189
1190
|
}) {
|
|
1190
|
-
const
|
|
1191
|
+
const u = g([]);
|
|
1191
1192
|
function a() {
|
|
1192
|
-
|
|
1193
|
+
u.value = [], t.emit("update:radio-key", null), t.emit("update:radio-row", null), t.emit("update:checkbox-keys", []), t.emit("update:checkbox-rows", []);
|
|
1193
1194
|
}
|
|
1194
1195
|
function n() {
|
|
1195
1196
|
re(() => {
|
|
1196
|
-
e.checkboxRows !== void 0 && (
|
|
1197
|
+
e.checkboxRows !== void 0 && (u.value = [...e.checkboxRows.map((d) => d[e.rowKey])]), e.checkboxKeys !== void 0 && (u.value = [...e.checkboxKeys]), e.radioKey && (u.value = [e.radioKey]), e.radioRow && (u.value = [e.radioRow[e.rowKey]]);
|
|
1197
1198
|
});
|
|
1198
1199
|
}
|
|
1199
|
-
function
|
|
1200
|
-
const
|
|
1200
|
+
function l() {
|
|
1201
|
+
const d = typeof e.selection == "string" ? {
|
|
1201
1202
|
type: e.selection
|
|
1202
1203
|
} : e.selection;
|
|
1203
|
-
switch (
|
|
1204
|
+
switch (d == null ? void 0 : d.type) {
|
|
1204
1205
|
case "radio":
|
|
1205
1206
|
return {
|
|
1206
1207
|
title: "选择",
|
|
1207
1208
|
width: 80,
|
|
1208
|
-
selectedRowKeys:
|
|
1209
|
-
...
|
|
1209
|
+
selectedRowKeys: u.value,
|
|
1210
|
+
...d
|
|
1210
1211
|
};
|
|
1211
1212
|
case "checkbox":
|
|
1212
1213
|
return {
|
|
1213
1214
|
width: 80,
|
|
1214
1215
|
showCheckedAll: !0,
|
|
1215
|
-
selectedRowKeys:
|
|
1216
|
-
...
|
|
1216
|
+
selectedRowKeys: u.value,
|
|
1217
|
+
...d
|
|
1217
1218
|
};
|
|
1218
1219
|
}
|
|
1219
1220
|
}
|
|
1220
|
-
function i(
|
|
1221
|
+
function i(d, s, m) {
|
|
1221
1222
|
const {
|
|
1222
1223
|
type: h
|
|
1223
|
-
} =
|
|
1224
|
+
} = l() || {};
|
|
1224
1225
|
switch (h) {
|
|
1225
1226
|
case "radio":
|
|
1226
1227
|
t.emit("update:radio-key", s), t.emit("update:radio-row", m);
|
|
1227
1228
|
break;
|
|
1228
1229
|
case "checkbox":
|
|
1229
|
-
t.emit("update:checkbox-keys",
|
|
1230
|
+
t.emit("update:checkbox-keys", d), t.emit("update:checkbox-rows", d.map((w) => {
|
|
1230
1231
|
var S;
|
|
1231
1232
|
return r.value.find((x) => x[e.rowKey] === w) || ((S = e.checkboxRows) == null ? void 0 : S.find((x) => x[e.rowKey] === w));
|
|
1232
1233
|
}));
|
|
@@ -1235,32 +1236,32 @@ function lr(e, t, {
|
|
|
1235
1236
|
}
|
|
1236
1237
|
function o() {
|
|
1237
1238
|
re(() => {
|
|
1238
|
-
t.emit("update:checkbox-keys",
|
|
1239
|
+
t.emit("update:checkbox-keys", u.value), t.emit("update:checkbox-rows", u.value.map((d) => {
|
|
1239
1240
|
var s;
|
|
1240
|
-
return r.value.find((m) => m[e.rowKey] ===
|
|
1241
|
+
return r.value.find((m) => m[e.rowKey] === d) || ((s = e.checkboxRows) == null ? void 0 : s.find((m) => m[e.rowKey] === d));
|
|
1241
1242
|
}));
|
|
1242
1243
|
});
|
|
1243
1244
|
}
|
|
1244
1245
|
return n(), {
|
|
1245
|
-
selectedRowKeys:
|
|
1246
|
-
rowSelection:
|
|
1246
|
+
selectedRowKeys: u,
|
|
1247
|
+
rowSelection: l(),
|
|
1247
1248
|
onSelect: i,
|
|
1248
1249
|
onSelectAll: o,
|
|
1249
1250
|
resetSelection: a,
|
|
1250
1251
|
reloadSelection: n
|
|
1251
1252
|
};
|
|
1252
1253
|
}
|
|
1253
|
-
function
|
|
1254
|
+
function ir(e, t, {
|
|
1254
1255
|
pageService: r,
|
|
1255
|
-
tableEvents:
|
|
1256
|
+
tableEvents: u
|
|
1256
1257
|
}) {
|
|
1257
1258
|
function a(i) {
|
|
1258
|
-
r && (r.pageIndex = i,
|
|
1259
|
+
r && (r.pageIndex = i, u("reload"));
|
|
1259
1260
|
}
|
|
1260
1261
|
function n(i) {
|
|
1261
|
-
r && (r.pageSize = i,
|
|
1262
|
+
r && (r.pageSize = i, u("reload"));
|
|
1262
1263
|
}
|
|
1263
|
-
const
|
|
1264
|
+
const l = _t({
|
|
1264
1265
|
mobile: 0,
|
|
1265
1266
|
tablet: 640,
|
|
1266
1267
|
desktop: 1024
|
|
@@ -1270,7 +1271,7 @@ function ur(e, t, {
|
|
|
1270
1271
|
style: {
|
|
1271
1272
|
padding: "10px 0"
|
|
1272
1273
|
}
|
|
1273
|
-
}, [f(
|
|
1274
|
+
}, [f(Ue, {
|
|
1274
1275
|
current: r.pageIndex,
|
|
1275
1276
|
"onUpdate:current": (i) => r.pageIndex = i,
|
|
1276
1277
|
"page-size": r.pageSize,
|
|
@@ -1281,7 +1282,7 @@ function ur(e, t, {
|
|
|
1281
1282
|
"show-total": !0,
|
|
1282
1283
|
"show-page-size": !0,
|
|
1283
1284
|
size: "small",
|
|
1284
|
-
simple:
|
|
1285
|
+
simple: l.smaller("desktop").value,
|
|
1285
1286
|
onChange: (i) => a(i),
|
|
1286
1287
|
onPageSizeChange: (i) => n(i),
|
|
1287
1288
|
style: {
|
|
@@ -1290,7 +1291,7 @@ function ur(e, t, {
|
|
|
1290
1291
|
}, null)]) : () => {
|
|
1291
1292
|
};
|
|
1292
1293
|
}
|
|
1293
|
-
const
|
|
1294
|
+
const cr = /* @__PURE__ */ B({
|
|
1294
1295
|
props: {
|
|
1295
1296
|
collapsedColumns: {
|
|
1296
1297
|
type: Array,
|
|
@@ -1302,20 +1303,20 @@ const ir = /* @__PURE__ */ B({
|
|
|
1302
1303
|
label: a.title,
|
|
1303
1304
|
value: a.key,
|
|
1304
1305
|
disabled: !1
|
|
1305
|
-
}))),
|
|
1306
|
-
return
|
|
1306
|
+
}))), u = g(e.collapsedColumns.filter((a) => a.collapsed).map((a) => a.key));
|
|
1307
|
+
return Je(() => {
|
|
1307
1308
|
const a = e.collapsedColumns.map((n) => ({
|
|
1308
1309
|
key: n.key,
|
|
1309
1310
|
title: n.title,
|
|
1310
|
-
collapsed:
|
|
1311
|
+
collapsed: u.value.includes(n.key)
|
|
1311
1312
|
}));
|
|
1312
1313
|
t.close(a);
|
|
1313
1314
|
}), () => f("div", {
|
|
1314
1315
|
class: "table-collapsed-render"
|
|
1315
|
-
}, [f(
|
|
1316
|
+
}, [f(Ge, {
|
|
1316
1317
|
data: r.value,
|
|
1317
|
-
"default-value":
|
|
1318
|
-
onChange: (a) =>
|
|
1318
|
+
"default-value": u.value,
|
|
1319
|
+
onChange: (a) => u.value = [...a],
|
|
1319
1320
|
title: ["显示列", "隐藏列"],
|
|
1320
1321
|
style: {
|
|
1321
1322
|
justifyContent: "center"
|
|
@@ -1324,7 +1325,7 @@ const ir = /* @__PURE__ */ B({
|
|
|
1324
1325
|
default: () => [De(f("template", null, null), [[Ve("slot"), "source"]])]
|
|
1325
1326
|
})]);
|
|
1326
1327
|
}
|
|
1327
|
-
}),
|
|
1328
|
+
}), dr = /* @__PURE__ */ B({
|
|
1328
1329
|
props: {
|
|
1329
1330
|
value: {
|
|
1330
1331
|
type: Object,
|
|
@@ -1341,8 +1342,8 @@ const ir = /* @__PURE__ */ B({
|
|
|
1341
1342
|
},
|
|
1342
1343
|
setup(e) {
|
|
1343
1344
|
const t = D();
|
|
1344
|
-
function r(
|
|
1345
|
-
e.onSubmit && e.onSubmit(
|
|
1345
|
+
function r(u) {
|
|
1346
|
+
e.onSubmit && e.onSubmit(u), t.close(u);
|
|
1346
1347
|
}
|
|
1347
1348
|
return () => f("div", {
|
|
1348
1349
|
class: "edit-form-container"
|
|
@@ -1353,7 +1354,7 @@ const ir = /* @__PURE__ */ B({
|
|
|
1353
1354
|
onSubmit: r
|
|
1354
1355
|
}, null)]);
|
|
1355
1356
|
}
|
|
1356
|
-
}),
|
|
1357
|
+
}), sr = /* @__PURE__ */ B({
|
|
1357
1358
|
props: {
|
|
1358
1359
|
// 数据主键
|
|
1359
1360
|
rowKey: {
|
|
@@ -1502,10 +1503,10 @@ const ir = /* @__PURE__ */ B({
|
|
|
1502
1503
|
},
|
|
1503
1504
|
expose: ["preview", "export", "edit", "reload", "tableSource", "formSource", "update:radio-key", "update:radio-row", "update:checkbox-keys", "update:checkbox-rows", "formInstance", "resetSelection", "reloadSelection", "reloadColumns", "change"],
|
|
1504
1505
|
setup(e, t) {
|
|
1505
|
-
const r = Math.random().toString(32).slice(2).toUpperCase(),
|
|
1506
|
-
key:
|
|
1507
|
-
title:
|
|
1508
|
-
collapsed: !!
|
|
1506
|
+
const r = Math.random().toString(32).slice(2).toUpperCase(), u = g(), a = g(), n = g(), l = g(), [i, o] = et(e.columns), d = g(!1), s = e.form ?? tt(e.columns), m = S(), h = j(), w = g(e.columns.map((c) => ({
|
|
1507
|
+
key: c.key,
|
|
1508
|
+
title: c.title,
|
|
1509
|
+
collapsed: !!c.collapsed
|
|
1509
1510
|
})));
|
|
1510
1511
|
function S() {
|
|
1511
1512
|
switch (!0) {
|
|
@@ -1530,69 +1531,69 @@ const ir = /* @__PURE__ */ B({
|
|
|
1530
1531
|
}
|
|
1531
1532
|
})();
|
|
1532
1533
|
function j() {
|
|
1533
|
-
const
|
|
1534
|
-
if (
|
|
1534
|
+
const c = e.columns.find((b) => !!b.sortable);
|
|
1535
|
+
if (c || e.sortable)
|
|
1535
1536
|
return new Z({
|
|
1536
1537
|
...e.sortable || {},
|
|
1537
|
-
...
|
|
1538
|
-
[
|
|
1538
|
+
...c ? {
|
|
1539
|
+
[c.key]: c.sortable
|
|
1539
1540
|
} : {}
|
|
1540
1541
|
});
|
|
1541
1542
|
}
|
|
1542
|
-
function v(
|
|
1543
|
+
function v(c) {
|
|
1543
1544
|
const {
|
|
1544
1545
|
exportExcel: b
|
|
1545
|
-
} =
|
|
1546
|
-
b((
|
|
1546
|
+
} = pt();
|
|
1547
|
+
b((c == null ? void 0 : c.columns) || e.columns, (c == null ? void 0 : c.source) || i.value, (c == null ? void 0 : c.filename) || (typeof e.exportable == "object" ? e.exportable.filename : void 0));
|
|
1547
1548
|
}
|
|
1548
|
-
function y(
|
|
1549
|
+
function y(c) {
|
|
1549
1550
|
let b;
|
|
1550
1551
|
switch (!0) {
|
|
1551
|
-
case !!(
|
|
1552
|
-
b = i.value.find((_) => _[e.rowKey] === (
|
|
1552
|
+
case !!(c != null && c.key):
|
|
1553
|
+
b = i.value.find((_) => _[e.rowKey] === (c == null ? void 0 : c.key));
|
|
1553
1554
|
break;
|
|
1554
|
-
case !!(
|
|
1555
|
-
b =
|
|
1555
|
+
case !!(c != null && c.record):
|
|
1556
|
+
b = c == null ? void 0 : c.record;
|
|
1556
1557
|
break;
|
|
1557
1558
|
}
|
|
1558
1559
|
if (!b)
|
|
1559
1560
|
throw new Error("未找到需要预览的数据");
|
|
1560
|
-
return n.value.open(
|
|
1561
|
+
return n.value.open(nr, {
|
|
1561
1562
|
record: b,
|
|
1562
1563
|
columns: e.columns
|
|
1563
1564
|
}, {
|
|
1564
|
-
title: (
|
|
1565
|
-
mode: (
|
|
1565
|
+
title: (c == null ? void 0 : c.title) || "详情",
|
|
1566
|
+
mode: (c == null ? void 0 : c.mode) || "dialog"
|
|
1566
1567
|
});
|
|
1567
1568
|
}
|
|
1568
|
-
function C(
|
|
1569
|
+
function C(c) {
|
|
1569
1570
|
let b;
|
|
1570
1571
|
switch (!0) {
|
|
1571
|
-
case !!(
|
|
1572
|
-
b = i.value.find((_) => _[e.rowKey] === (
|
|
1572
|
+
case !!(c != null && c.key):
|
|
1573
|
+
b = i.value.find((_) => _[e.rowKey] === (c == null ? void 0 : c.key));
|
|
1573
1574
|
break;
|
|
1574
|
-
case !!(
|
|
1575
|
-
b =
|
|
1575
|
+
case !!(c != null && c.record):
|
|
1576
|
+
b = c == null ? void 0 : c.record;
|
|
1576
1577
|
break;
|
|
1577
1578
|
}
|
|
1578
1579
|
if (!b)
|
|
1579
1580
|
throw new Error("未找到需要编辑的数据");
|
|
1580
|
-
return n.value.open(
|
|
1581
|
+
return n.value.open(dr, {
|
|
1581
1582
|
value: b,
|
|
1582
|
-
form:
|
|
1583
|
-
onSubmit:
|
|
1583
|
+
form: c == null ? void 0 : c.form,
|
|
1584
|
+
onSubmit: c.onSubmit
|
|
1584
1585
|
}, {
|
|
1585
|
-
title: (
|
|
1586
|
-
mode: (
|
|
1586
|
+
title: (c == null ? void 0 : c.title) || "编辑",
|
|
1587
|
+
mode: (c == null ? void 0 : c.mode) || "dialog",
|
|
1587
1588
|
footer: !0,
|
|
1588
1589
|
form: "form"
|
|
1589
1590
|
});
|
|
1590
1591
|
}
|
|
1591
|
-
function M(
|
|
1592
|
+
function M(c) {
|
|
1592
1593
|
var p, ee;
|
|
1593
1594
|
if (!e.dataLoad)
|
|
1594
1595
|
return Promise.reject();
|
|
1595
|
-
|
|
1596
|
+
c != null && c.reset && (m && m.reset(), h && h.reset(), (p = u.value) == null || p.resetSorters());
|
|
1596
1597
|
const b = {
|
|
1597
1598
|
...((ee = a.value) == null ? void 0 : ee.formSource) || {}
|
|
1598
1599
|
};
|
|
@@ -1605,39 +1606,39 @@ const ir = /* @__PURE__ */ B({
|
|
|
1605
1606
|
sort: h,
|
|
1606
1607
|
update: o
|
|
1607
1608
|
});
|
|
1608
|
-
return Y(_) ? (
|
|
1609
|
-
|
|
1609
|
+
return Y(_) ? (d.value = !0, Promise.resolve(_).finally(() => {
|
|
1610
|
+
d.value = !1;
|
|
1610
1611
|
}), _) : Promise.resolve();
|
|
1611
1612
|
}
|
|
1612
1613
|
function ye() {
|
|
1613
|
-
n.value.open(
|
|
1614
|
+
n.value.open(cr, {
|
|
1614
1615
|
collapsedColumns: w.value
|
|
1615
1616
|
}, {
|
|
1616
1617
|
title: "显示列",
|
|
1617
1618
|
size: "small",
|
|
1618
1619
|
footer: !0
|
|
1619
|
-
}).then((
|
|
1620
|
-
w.value =
|
|
1620
|
+
}).then((c) => {
|
|
1621
|
+
w.value = c;
|
|
1621
1622
|
});
|
|
1622
1623
|
}
|
|
1623
|
-
const be = (
|
|
1624
|
+
const be = (c, {
|
|
1624
1625
|
type: b
|
|
1625
1626
|
}) => {
|
|
1626
1627
|
switch (b) {
|
|
1627
1628
|
case "drag": {
|
|
1628
|
-
o(
|
|
1629
|
+
o(c), t.emit("change", c);
|
|
1629
1630
|
break;
|
|
1630
1631
|
}
|
|
1631
1632
|
}
|
|
1632
|
-
}, R =
|
|
1633
|
+
}, R = rt({
|
|
1633
1634
|
reload: M,
|
|
1634
1635
|
preview: y,
|
|
1635
1636
|
export: v,
|
|
1636
1637
|
edit: C,
|
|
1637
1638
|
collapse: ye
|
|
1638
1639
|
});
|
|
1639
|
-
function ge(
|
|
1640
|
-
!h || x === "client" || (b ? h.update(
|
|
1640
|
+
function ge(c, b) {
|
|
1641
|
+
!h || x === "client" || (b ? h.update(c, b === "descend" ? "desc" : "asc") : h.remove(c), R("reload"));
|
|
1641
1642
|
}
|
|
1642
1643
|
const J = g(de({
|
|
1643
1644
|
columns: e.columns,
|
|
@@ -1646,28 +1647,28 @@ const ir = /* @__PURE__ */ B({
|
|
|
1646
1647
|
pageMode: x,
|
|
1647
1648
|
collapsedColumns: w,
|
|
1648
1649
|
events: R
|
|
1649
|
-
})),
|
|
1650
|
+
})), z = {
|
|
1650
1651
|
tableEvents: R,
|
|
1651
1652
|
tableForm: s,
|
|
1652
1653
|
tableSource: i,
|
|
1653
1654
|
formInstance: a,
|
|
1654
1655
|
pageService: m,
|
|
1655
1656
|
formOptions: e.formOptions
|
|
1656
|
-
}, we =
|
|
1657
|
+
}, we = lr(e, t, z), ve = ar(e, t, z), Ce = ir(e, t, z), {
|
|
1657
1658
|
selectedRowKeys: Q,
|
|
1658
1659
|
rowSelection: X,
|
|
1659
1660
|
onSelect: ke,
|
|
1660
1661
|
onSelectAll: xe,
|
|
1661
1662
|
reloadSelection: Se,
|
|
1662
1663
|
resetSelection: Me
|
|
1663
|
-
} =
|
|
1664
|
+
} = ur(e, t, z), Te = L(() => ({
|
|
1664
1665
|
rowKey: e.rowKey,
|
|
1665
1666
|
size: e.size,
|
|
1666
1667
|
bordered: e.bordered,
|
|
1667
1668
|
hoverable: e.hoverable,
|
|
1668
1669
|
stripe: e.stripe,
|
|
1669
1670
|
scroll: {
|
|
1670
|
-
x: e.columns.reduce((
|
|
1671
|
+
x: e.columns.reduce((c, b) => c += typeof b.width != "number" ? Math.max(b.title.length * 16, 80) : b.width, 0),
|
|
1671
1672
|
y: e.height ?? "100%"
|
|
1672
1673
|
},
|
|
1673
1674
|
rowSelection: X,
|
|
@@ -1693,21 +1694,21 @@ const ir = /* @__PURE__ */ B({
|
|
|
1693
1694
|
});
|
|
1694
1695
|
}
|
|
1695
1696
|
return A(() => {
|
|
1696
|
-
|
|
1697
|
+
l.value && (l.value.id = `table-${r}`), e.autoLoad && M(), e.grabbable && l.value && tr(l.value);
|
|
1697
1698
|
}), {
|
|
1698
1699
|
tableId: r,
|
|
1699
|
-
tableInstance:
|
|
1700
|
+
tableInstance: u,
|
|
1700
1701
|
tableSource: i,
|
|
1701
1702
|
tableOptions: Te,
|
|
1702
1703
|
tableColumns: J,
|
|
1703
1704
|
tableEvents: R,
|
|
1704
1705
|
tableForm: s,
|
|
1705
|
-
tableLoading:
|
|
1706
|
+
tableLoading: d,
|
|
1706
1707
|
modalInstance: n,
|
|
1707
|
-
tableRenderElement:
|
|
1708
|
+
tableRenderElement: l,
|
|
1708
1709
|
formSource: se(L(() => {
|
|
1709
|
-
var
|
|
1710
|
-
return (
|
|
1710
|
+
var c;
|
|
1711
|
+
return (c = a == null ? void 0 : a.value) == null ? void 0 : c.formSource;
|
|
1711
1712
|
})),
|
|
1712
1713
|
formInstance: a,
|
|
1713
1714
|
reload: M,
|
|
@@ -1738,7 +1739,7 @@ const ir = /* @__PURE__ */ B({
|
|
|
1738
1739
|
class: "table-body"
|
|
1739
1740
|
}, [f("div", {
|
|
1740
1741
|
class: "table-body-wrapper"
|
|
1741
|
-
}, [f(
|
|
1742
|
+
}, [f(Ze, fe({
|
|
1742
1743
|
loading: this.tableLoading,
|
|
1743
1744
|
data: this.tableSource,
|
|
1744
1745
|
columns: this.tableColumns,
|
|
@@ -1757,7 +1758,7 @@ const ir = /* @__PURE__ */ B({
|
|
|
1757
1758
|
"auto-fill": this.autoFill
|
|
1758
1759
|
},
|
|
1759
1760
|
ref: (t) => this.tableRenderElement = t
|
|
1760
|
-
}, [f(
|
|
1761
|
+
}, [f(Qe, {
|
|
1761
1762
|
ref: (t) => this.modalInstance = t
|
|
1762
1763
|
}, {
|
|
1763
1764
|
default: () => [f("div", {
|
|
@@ -1766,23 +1767,23 @@ const ir = /* @__PURE__ */ B({
|
|
|
1766
1767
|
})]);
|
|
1767
1768
|
}
|
|
1768
1769
|
});
|
|
1769
|
-
function
|
|
1770
|
+
function wr(e) {
|
|
1770
1771
|
return e;
|
|
1771
1772
|
}
|
|
1772
|
-
function
|
|
1773
|
+
function vr(e) {
|
|
1773
1774
|
return e;
|
|
1774
1775
|
}
|
|
1775
|
-
const
|
|
1776
|
+
const Cr = {
|
|
1776
1777
|
install(e, t) {
|
|
1777
|
-
e.component("TableRender",
|
|
1778
|
+
e.component("TableRender", sr);
|
|
1778
1779
|
}
|
|
1779
1780
|
};
|
|
1780
1781
|
export {
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1782
|
+
sr as TableRender,
|
|
1783
|
+
Sr as TableRenderResolver,
|
|
1784
|
+
Cr as default,
|
|
1785
|
+
wr as defineColumns,
|
|
1786
|
+
vr as defineTableLoad,
|
|
1787
|
+
rt as useEvents,
|
|
1788
|
+
gr as useTable
|
|
1788
1789
|
};
|